w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to disable autolayout for individual UI elements (UIlabel)
If you're using Autolayout then your UIViews are positioned based on their NSLayoutConstraints. To move them, rather than set their frames you need to alter the constraints.

Categories : IOS

what is the command to see the revision of individual files under a folder in svn?
You can use svn info for this purpose. The following command prints information for each file in the current directory - including the revision your are looking for: svn info --depth files | grep '^Path: |^Revision: ' If you want to format the output, I recommend using the option --xml and piping the output to script that parses the XML and prints the fields in a readable manner. The following listing contains a simple example how that can be done in Python: #! /usr/bin/env python3 import sys, lxml.etree document = lxml.etree.parse(sys.stdin.buffer) for entry in document.xpath('//entry[@kind="file"]'): print(entry.xpath('string(@path)'), entry.xpath('string(@revision)'))

Categories : Svn

Email individual row data from mysql to individual users
Why don't you put all of the user's information into an Array then loop through? <?php $con=mysqli_connect("localhost","root","xx","card"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $result2 = mysqli_query($con,"SELECT * FROM mailtest"); while($row = mysqli_fetch_array($result2)){ $send_details[$row['email']] .= "ID: ".$row['Stu_id']."; Pin No: ".$row['Pin_number']."; name: ".$row['name']."; Email: ".$row['email']." "; } foreach($send_details as $email => $body){ // Send the mail }

Categories : PHP

how to disable/enable tinymce toolbar by command
Prevent the mouse event from propagating to the buttons in the toolbar. toolbarElement.addEventListener("click", function(e){ e.stopPropagation(); }); Depending on which browsers you want to support, you could also use pointer-events:none // disables toolbarElement.style.pointerEvents = "none"; // enable toolbarElement.style.pointerEvents = "all"; Reference: https://developer.mozilla.org/en-US/docs/Web/CSS/pointer-events http://caniuse.com/pointer-events

Categories : Javascript

Disable or remap o single-window command in vim
How about putting set hidden into your .vimrc, so after closing all the splits they don't get closed, only put to background? After that you can list all the opened buffers via :ls command for example. But regards to your mapping, maybe you could try unmapping (or yet even better nunmap - which unmaps a command only in normal mode) o first, and then map it.

Categories : Vim

Disable auto-scrolling in command window
Use the more function: http://www.mathworks.com/help/matlab/ref/more.html more on Then run your program. Press spacebar when you wish to see more of the output. more off will turn it off.

Categories : Matlab

Enable/disable commands after another command was executed
Each instance of ICommand has a bool CanExecute element. The answer is to put your logic into these elements. I use a type of RelayCommand because I use MVVM, but this is irrelevant for this issue... the important thing is the bool parameter that specifies whether the Command can execute or not. I would do something like this: private bool isOpen, hasStarted; public ICommand Open { get { return new ActionCommand(action => OpenCommand(), canExecute => !hasStarted); } } private void OpenCommand() { // do your stuff here isOpen = true; } public ICommand Save { get { return new ActionCommand(action => SaveCommand(), canExecute => isOpen && !hasStarted); } } private void SaveCommand() { // do your stuff here } public ICommand Start

Categories : Wpf

Disable verbose debugging in unix using set command
Saying: set +x would disable trace. From the manual: Using ‘+’ rather than ‘-’ causes these options to be turned off. The options can also be used upon invocation of the shell. The current set of options may be found in $-.

Categories : Debugging

PHP+cURL disable command line progress output
From the manual refering to CURLOPT_NOPROGRESS: CURLOPT_NOPROGRESS TRUE to disable the progress meter for cURL transfers. Note: PHP automatically sets this option to TRUE, this should only be changed for debugging purposes. Looks like the progress has been explicitly turned on. Check you code for that option. In any case, if you want to explicitly disable it again, curl_setopt($curlHandle, CURLOPT_NOPROGRESS, true) should do the trick. Update: If you instead do something like exec("curl http://example.com") you should a) think about what you're doing and b) run curl -s to disable the progress. PHP's streams have support for http, so you can just use file_get_contents, copy et al.

Categories : PHP

Is there a way to disable the command link until the ajax response is rendered
Yes, certainly there is. You only need to change the command link by a command button, because a JSF command link is not trivially disablable by JS means. You could if necessary throw in some CSS to make the button look like better. Once done that, you could make use of <f:ajax onevent> to listen on ajax events. On begin of the ajax request, you could just disable the command button. On success of the ajax request, you could just re-enable the command button. So, given this event function listener example, function handleDisableButton(data) { var button = document.getElementById("formId:buttonId"); switch (data.status) { case "begin": // This is called right before ajax request is been sent. button.disabled = true; break; case "com

Categories : Javascript

Disable autochange scrollbar position (disable scroll to active control)
Find the same question here How can I disable the scroll-into-view behavior of TScrollBox? In my case I use override AutoScrollInView procedure. Disable implemention of this procedure at all. procedure TfrSection.AutoScrollInView(AControl: TControl); begin // inherited; end; It works.

Categories : Delphi

Piping output from 1 command to other command in an adb shell command line
One way is to create a shell script containing the commands you want and then run the shell script. Since the Android root filesystem is not writeable at run time (usually, unless you have rooted your device and remount it), you can copy the file to the removable (or emulated) storage, for example /sdcard. Then run the script using the command adb shell sh /sdcard/your-script-name. Because each script runs in its own subshell, both of your commands will be executed in the same shell on the device (you can confirm it with ps).

Categories : Android

Get the value of an individual pixel
pygame.PixelArray should do the trick. You can use it on the screen surface. But personally, I wouldn't recommend that you use the pixels as a reference. Handling everything logically is a lot better.

Categories : Python

How to set individual event for all div
Try this if the main div is the parent of "#" + ControlId + "_child": $('div[id$="_child"]').parent().on('click', function(){ var child = $(this).find('div[id$="_child"]').last(); child.fadeIn("slow"); child.toggle(); }); However, I strongly advise against your current approach. Try this instead: <div id=ControlId class="control-main"> <span>Select Option</span> <div id=ControlId + "_child" class="control-child" style="display: none" > // your other html here </div> JS: $(document).on('click', '.control-main', function(){ $('.control-child').last().fadeIn("slow").toggle(); });

Categories : Jquery

how to keep individual sessions in MVC 4 app
You're using static variables. Never use them in a web application, unless you're making an in-memory cache. A possible solution is to store a session ID in a cookie and retrieve the session data at the beginning of a request.

Categories : Asp Net Mvc

when issuing a logout command to my cpanel ftp server, it returns a 500 error unknown command
abruptlyCloseCommunication() method causes the communication channel to be abruptly closed. It is gives as an "emergency brake" to close the control connection when it is blocked. A thread-safe solution for the same purpose is a call to disconnect(false). Instead you can use client.disconnect(true); class, This one sends the FTP QUIT command to the remote server, requesting a legal disconnect procedure. Hope it will also work for cpanel.

Categories : Java

Binding Different Sources for Command and Command parameter WPF/MVVM for checkbox inside listbox
A good tool for investigating xaml and databinding is Snoop. http://snoopwpf.codeplex.com/ Looking at your code you should define a DataTemplate for your ListBox that contains your TextBlock and CheckBox. You can then use the ItemTemplate property on the ListBox and set it to your data template. This way each ListBoxItem will have a DataContext of type Project. <DataTemplate x:Key="ProjectTemplate"> <TextBlock...../> <CheckBox....../> </DataTemplate> <ListBox ItemTemplate="{StaticResource ProjectTemplate}" ...... /> Therefore, you want to bind your CommandParameter to a property of your Project (like ProjectID) (when you have a collections of Porjects in your ListBox) I think this is the xaml you will need. CommandParameter="{Binding Path=DataContex

Categories : Wpf

setting variables inside a compound command in bash fails (command group)
I think, you miss that /bin/true returs 0 and /bin/false returns 1 $ r='res:'; { /bin/true; r+=$?; } 2>/dev/null; echo $r; res:0 And $ r='res:'; { /bin/false; r+=$?; } 2>/dev/null; echo $r; res:1

Categories : Bash

Combining variables in Bash to form a command sent to AppleScript using the osascript command
As a general rule, don't put double-quotes in the variable, put them around the variable. In this case it's more complicated, since you have some double-quotes for bash-level quoting, and some for AppleScript-level quoting; in this case, the AppleScript-level quotes go in the variable, the bash-level quotes go around the variable: the_url=""http://stackoverflow.com/questions/1521462/looping-through-the-content-of-a-file-in-bash"" the_script='tell application "Safari" to set the URL of the front document to ' osascript -e "${the_script}${the_url}" BTW, using echo to check things like this is highly misleading. echo is telling you what's in the variable, not what'll be executed when you reference the variable on a command line. The biggest difference is that echo prints its arguments afte

Categories : Osx

How to redirect time command output in ksh when invoke shell function with dot command?
I tried to reproduce the issue and was not able to: % cat my.sh #!/bin/ksh echo hi % (time . my.sh) 2>&1 | tee my.log hi real 0m0.00s user 0m0.00s sys 0m0.00s % cat my.log hi real 0m0.00s user 0m0.00s sys 0m0.00s If you are still having this issue - please share your my_function.sh and full shell output.

Categories : Unix

Sitecore Workflow command throwing a "Could not find command definition" error
This exception is thrown either if the item is not in any workflow state or the workflow state which this item is in does not have any child with ID equals to command id passed as parameter. Try to execute the following code: if (item.Database.Name == "web") { throw new Exception("Can not execute workflow command in web database"); } if (String.IsNullOrEmpty(item[FieldIDs.WorkflowState])) { throw new Exception("Workflow state is not set for the item"); } Item stateItem = ItemManager.GetItem(wf.GetState(item), Language.Current, Version.Latest, item.Database, SecurityCheck.Disable); if (stateItem == null) { throw new Exception("Workflow state " + item[FieldIDs.WorkflowState] + " is n

Categories : C#

Command works in command line but gives 'no such file or directory' in bash script
Remove the quotes around line 8. Like this: ./optAlg.exe "$inputFile" 500 2>&1 > "output/$outputFile" By placing quotes around the whole line you tell bash to execute a command which is called exactly ./optAlg.exe $inputFile 500 2>&1 > output/$outputFile and of course there is no such command. In reality you want to run ./optAlg.exe with parameters. Do not forget to place quotes around the variables because otherwise filenames that have whitespace characters are going to be passed as several arguments. Please read about arguments. And you can read about common pitfalls as well.

Categories : Bash

Detecting errors of a command that print nothing if the command was successful using Perl and Expect
akarageo@Pal4op:~> cd banana bash: cd: banana: No such file or directory akarageo@Pal4op:~:( > echo $? 1 i.e. check the error code that CD returns, 0 means OK anything else is an error, No need to check the prompt , and btw, the CD command does not generate the prompt the shell does, so that must be part of your confusion also. try $object->exitstatus() if it is of any help

Categories : Regex

How to open Command Prompt, change directory and execute a command using Java code (Windows)
If you just want to run an application with a specific working directory, the easiest way is to use a ProcessBuilder: ProcessBuilder pb = new ProcessBuilder(executable, arguments, if, any); pb.directory(theWorkingDirectory); pb.start();

Categories : Java

How to take individual input in python?
wordList is list of lines, each element is line (stripped one, without ') You should split each line, to get its tokens. Then for each token check if it is string or integer (using isdigit for example).

Categories : Python

Making individual comparisons?
Assuming they're always in the same order, you could do something crude like this - I would say classes are an overkill: >>> people = [ ... ('Mark', 19,) , ... ('John', 19, ), ... ('Jess', 25, ), ... ('Jonty', 21,)] >>> >>> to_work = map(int, '20 25 30 40'.split()) >>> result = [] >>> ages = [] >>> for index, person in enumerate(people): ... name, age = person ... result.append((name, age, to_work[index])) ... ages.append(age) ... >>> print ' '.join(map(str, result)) ('Mark', 19, 20) ('John', 19, 25) ('Jess', 25, 30) ('Jonty', 21, 40) >>> print 'max dist =', max(to_work) max dist = 40 >>> print 'avg. age =', sum(ages) / len(ages) avg. age = 21

Categories : Python

Individual jquery actions for each div
Use context selector $(".in", this).slideToggle(100); Code $(document).ready(function() { $(".in").hide(); $('.out').hover(function() { $(".in", this).slideToggle(100); }); }); Check Fiddle

Categories : Javascript

jquery getting each individual value from array
Try this: $('select').change(function () { var selected_options = $(this).parent().find('option:selected'); myFunction($.map(selected_options, function (selected_option) { return selected_option.value; })); }); function myFunction(selectValues){ console.log(selectValues) $.each(selectValues, function () { var theitem = $('#' + this).html(); }); } Fiddle

Categories : Jquery

Target individual div using jQuery $this
$('.flyout').mouseout(function() { window.isoverdiv = false; var $this = $(this); setTimeout(function() { if ( ! window.isoverdiv ) { $this.slideUp(); } }, 1000); });

Categories : Jquery

How to make this command open a new terminal & execute the command within it ( Exec=bash -c "tail -n 10 -f /var/log/httpd/error_log" )
To open a terminal Exec=nameOfYourTerminalApp (eg:gnome-terminal, lxterminal, xterm) Then you can run your commands in the opened terminal. Otherwise, you can create a script with some command and run it. In that case you have to put tail -n 10 -f /var/log/httpd/error_log in the script and make it executable. Then call it with a shortcut file.

Categories : Linux

What is the best way to pass a command alias/function without reducing the functionality of said command?
Handle each argument to ll separately: function ll () { for d in "$@"; do ls -lh --color "$d" | grep "^d"; ls -lh --color "$d" | grep "^-" | grep -v "~"; ls -lh --color "$d" | grep "^l" done }

Categories : Linux

How to display the command's drop-down menu after the command icon is clicked?
I just asked the same question on Eclipse RCP forum and got immediate answer. The trick is to fire a fake event that will trigger the menu to display, here are the details: http://www.eclipse.org/forums/index.php/t/488692/

Categories : Java

How to issue a command from the command line of a process running on Linux
If you don't mind waiting for the calls to finish (one at a time) before returning control to your program, you can use the subprocess library. If you want to start something running and not wait for it to finish, you can use the multiprocessing library.

Categories : Python

(eval (...)) in a flychecker command doesn't work with command symbols
This is the correct form: (flycheck-declare-checker unity-csharp-flychecker "given a c-sharp file, looks for the unity file and then tries to build it using mdtool." :command '("mdtool" "build" (eval (process buffer-file-name))) ...) Thanks for Bruce Conner for getting me to remove the quote before (process ...). That gave me a new error: Error: (void-variable source-original) So I dug into the source and saw there is no symbol substitution before evaluation. I assumed because we were given symbols that just using buffer-file-name wouldn't work, but I tried it and it does. I don't know if there are ramifications for that approach down the road.

Categories : Emacs

Always given command line before python fabric command is executed on remote
Interesting, I don't have such issue, your code works fine for me (up to adding env.key_filename and env.password) c:work>fab hello [x.x.x.x] Executing task 'hello' [x.x.x.x] run: touch hello.world Done. Disconnecting from x.x.x.x... done. I'm using Fabric 1.7.0 and Paramiko 1.11.0. Possibly it's a problem of the terminal on your server.

Categories : Python

Perls system($command) returns other result than command on shell
You are using double quotes. In double quotes, is special, so only + instead of + is passed to sed. You can use the q() operator to avoid backslashing the backslash: $ssh->cmd(q(head -11 /some/path/to/the/file.xml | tail -1 | sed 's/<[^>]+>//g' | xargs));

Categories : Perl

What is the command to get the .listing file from SFTP server using cURL command
This is what I found on http://curl.haxx.se/docs/faq.html#How_do_I_get_an_FTP_directory_li If you end the FTP URL you request with a slash, libcurl will provide you with a directory listing of that given directory. You can also set CURLOPT_CUSTOMREQUEST to alter what exact listing command libcurl would use to list the files. The follow-up question that tend to follow the previous one, is how a program is supposed to parse the directory listing. How does it know what's a file and what's a dir and what's a symlink etc. The harsh reality is that FTP provides no such fine and easy-to-parse output. The output format FTP servers respond to LIST commands are entirely at the server's own liking and the NLST output doesn't reveal any types and in many cases don't even include all the directory en

Categories : Linux

How to get command-line equivalent of command entered in Task Scheduler
schtasks /query /? schtasks /create /? the first has an option to export to xml, the second one as an option to import from xml. If you have only one or a few tasks to schedule, I would create them "the hard way" with schtasks /create

Categories : Windows

Batch file/command to start a program through command line
I'll edit this if you respond to my comment but if you want to simply execute this command via a batch file (and you know nothing about batch files): Open a text editor (e.g.Notepad) Type in your command (e.g. c: andaotherfoldermyprogram.exe 10 20) Save the file as mybatchfile.cmd Double click the file (in Windows Explorer etc.)

Categories : Windows

Batch file run command after previous command has finished executing
I'm assuming Windows, since you have .cmd files!? You can use & between the scripts to run them in sequence. If you use && the ensuing scripts will only run if the previous ones completed successfully. You can read more here. Cheers,

Categories : Java



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.