w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Does Sublime Text have support for Ruby API (auto-complete)?
Sublime Text 2 has some degree of auto-complete functionality right out of the box. If you want to kick it up a notch, the Sublime CodeIntel plugin is probably the closest thing to intelli-sense that we have for Sublime Text w/ Ruby, supporting: Jump to Symbol Definition - Jump to the file and line of the definition of a symbol. Imports autocomplete - Shows autocomplete with the available modules/symbols in real time. Function Call tooltips - Displays information in the status bar about the working function. Auto-complete: Symbol definition: Would output the following to the status bar: Info: Passes each element of the collection to the given block. The method returns true if the block ever returns a value other than false or nil. If the blo

Categories : Ruby

SublimeText2 auto complete wrong for ruby do block
maybe you should try dob, that is for do..end block snippet or you can create this snippet your self: <snippet> <content><![CDATA[ do $1 end ]]></content> <tabTrigger>do</tabTrigger> <scope>source.ruby</scope> <description>do..end</description> </snippet> then you can use do tab to insert the do block which has no variable

Categories : Ruby

How to auto complete a text box using jQuery depending the value of another text box
Change the controller function little bit. Instead of sending the texbox1 value as arg2, post it using AJAX. And receive it inside the function using $_POST['data']. Send arg1 as such and post the arg2 value. $(function() { $( "#textbox2" ).autocomplete({ source: function(request, response) { $.ajax({ url:"<?php echo site_url('controller_name/function_name/arg1');?>", data:{'request':$("#textbox1").val()}, dataType: "json", type: "POST", success: function(data){ response(data); } }); }, }); });

Categories : PHP

Call PHP Script from Auto-complete AJAX JQuery Mobile
You need to prepare a json object to send from your PHP file. Take a look at json_encode(). Ideally, you would prepare an associative array and then convert it to a JSON For example $arr = array(); $arr['name'] = 'PHP'; echo json_encode($arr); Output { 'name' : 'PHP' } You can then refer to the name in your JS as .then(function(resp) { console.log(resp.name); } This will output PHP in the console. However, you might be better off using jQuery UI's built in Autocomplete. Please refer to this post. Moreover, your code is vulnerable to SQL injections. You should switch to Prepared Statements to avoid this. UPDATE : As for your second issue, you can first assign a class to the list items, eg <li class="autocomp-data"> and then bind a click handler to it. $ul.html( ht

Categories : PHP

Auto complete text view is not working
The following link solved my issue pls have a try by using sqlite db http://saga-androidapplication.blogspot.in/2011/07/how-to-use-autocomplete-searchbox-in.html the source code can be downloaded from http://media0.webgarden.com/files/media0:4e0f5e93920fd.rar.upl/AutoCompleteSample.rar 2.non dynamic import android.app.Activity; import android.os.Bundle; import android.widget.ArrayAdapter; import android.widget.MultiAutoCompleteTextView; public class Autocomplete extends Activity { /** Called when the activity is first created. */ String[] names = { "vasu","kamal","vimal","santhosh", "prabu","prakash", "bala","baskar", "arjun","aravind", "shankar","siva", "mani","manickam", "moha

Categories : Android

Auto-complete values should appear based on the value selected in another text box
Try this: HTML <form id="myForm" action='test1.php' method='GET' rel="history"> Country <BR> <select name="COUNTRY" id="country" > <option value="India" >India</option> <option value="US">US</option> </select><BR> <BR> State <BR> <input type="text" name="STATE" id="istate" value=""> <BR> <BR> <input id="sub" type="submit" value="Search" align="centre"/> </form> JS $(function() { var collegetypesIndia = [ "Delhi", "Assam", "Tamil Nadu" ]; var collegetypesUS = [ "Alabama", "Alaska", "Florida" ]; $('#country').change(function(){ if( $('#country').val() == 'India' ) {

Categories : PHP

Enlarge Auto-complete Text Box JQuery Mobile
I think this is what you're after - <div data-role="page" id="page1"> <div data-role="content"> <div style='font-size:18px;padding-bottom:15px;'>Customer:</div> <ul id="autocomplete_customer" data-role="listview" data-inset="true" data-filter="true" data-filter-placeholder="Find a customer..." data-filter-theme="d"> <li><a href="acura.html">Acura</a></li> <li><a href="audi.html">Audi</a></li> <li><a href="bmw.html">BMW</a></li> </ul> </div> </div> $(function () { $('form input[data-type="search"]').css('height', '75px'); }); jsFiddle Demo Here

Categories : HTML

cannot populate data in auto complete text field
Not totally sure but I think if you add this it may help towards a sloution. In this code change data_names=data; to data_names = jQuery.parseJSON(data); to convert the json string into a proper json object that autocomplete can handle properly. var data_names; jQuery.ajax( { type: "POST", url: 'AutoCompleteHandler.php', data: {d_name: "d_name"}, dataType: "html", success: function(data) { //data_names=data; data_names = jQuery.parseJSON(data); console.log(data); } }); EDIT: This is possibly why autocommit does not like the data you have passed it. From autocommit documentation: Array: An array can be used for local data. There are two supported formats: An array of strings: [ "Choice

Categories : Jquery

auto-complete for two text fields jquery mobile
Can you try with below code: $(function() { $("#customer").keyup(function(event) { if(document.getElementById("customer").value == "") $( "#store" ).prop( 'disabled', true ); }); $('#customer').autocomplete({ source: "./SearchCustomer.php?term="+document.getElementById("customer").value, minLength: 0, focus: function( event, ui ) { $( "#customer" ).val( ui.item.label ); return false; }, select: function (event, ui) { $( "#customer" ).val( ui.item.label ); $( "#customer-id" ).val( ui.item.value ); $("#store").removeAttr("disabled").focus(); return false; } }) .each(function() { $(this).data( "ui-autocomplete" )._renderIte

Categories : Jquery

How to run a Ruby script in Sublime Text 2 from project root
Depending on your scripts you might want to look into using Package Control and the SublimeREPL Package. SublimeREPL allows you to have a Ruby Interpreter in a separate tab or window in SublimeText. Running CMD + Shift + B has never been very reliable in SublimeText for Ruby code anyways. Also, similar answer to similar question: Execute Ruby code in sublime text 2

Categories : Ruby

Configuring sublime text build system to use shell script
Shell variables and functions, including those defined in .bash_profile and other places, are not available to ST2 because it doesn't run inside bash. It's its own independent program - analogous to how Firefox (for example) can't read your $PATH variable. To have your custom functions, variables, etc. available to your build system, you'll have to create a separate build script to run as your build system: { "cmd": ["ST2_build.sh", "$file"], "file_regex": "^[ ]*File "(...*?)", line ([0-9]*)", "selector": "source.python" } then within ST2_build.sh have the following at the top: #!/bin/bash if [ -f ~/hcom-env/conf/sys/hcom-profile]; then source ~/hcom-env/conf/sys/hcom-profile fi # now I can use my cool functions... myfunc($1)

Categories : Osx

Sublime text: Process current buffer with Ruby script?
I would try to write a .sublime-build for your Markdown files. Something like { "cmd": ["/full/path/to/ruby/ /full/path/to/process_markdown.rb", "$file"], "file_regex": "^(...*?):([0-9]*):?([0-9]*)", "selector": "source.md" }

Categories : Ruby

Sublime Text 2: Module autocompletion for Perl (Script supporting)
SublimeCodeIntel should work for you. I haven't used it for Perl, but the language is supported, and it does all the things you're looking for with Python, my language of choice. You can install it through Package Control. It will take a while to get going at first, as it has to index all your modules (you can tell it where to look in the settings), but once that's done it's a real time-saver.

Categories : Perl

How do I ignore auto complete values when capturing data from a text field?
You should use .blur() instead of .keyup(). This way, the data is submitted when the control loses focus, instead of every time a key is pressed.

Categories : PHP

RSync works stand alone, not as script in Sublime Text Build System
The Sublime Text console/build system is not interactive, so there is unfortunately no way to enter input during a build. To get around this, you'll either need some other way of authenticating, such as with an SSH key, or you'll need to program a small plugin that uses sublime.Window.show_input_panel() to obtain the password from the user.

Categories : Bash

In Sublime Text, Gedit or any Other editor, how to select and replace everything inside Tags?
If you don't mind regexes, the regex that matches the opening is /[caption[^]]*]/ http://rubular.com/r/eRRxYIsVCG remember to specify case insensitivity if you're going to have caption and CAPTION, etc. if you just want to do this on the command line you can use sed(1) sed 's/[caption[^]]*]/<div class=\"sss\">/g' file.html which sends it to stdin, which you can pipe to whatever file you want. if you want to modify the file in-place you can add the -i switch to sed.

Categories : Regex

Is there a way to import Python3's multiprocessing module inside a Sublime Text 3 plugin?
Assuming you intend this program for wide distribution, it's probably unreasonable to expect users to install Python 3 in a standard location in order to use your work. However, depending on Python's redistribution license, you may be able to get away with just bundling multiprocessing with your plugin. If your main my_awesome_plugin.py file is in the root of your plugin directory, put the full multiprocessing directory in as a subdirectory and you should be able to import multiprocessing as mp just fine. Fortunately it's pure Python, so you don't have to worry about platform-specific distributions. EDIT OK, my bad. After a little more exploring around the ...lib/python3.3/ hierarchy, it turns out there is a compiled _multiprocessing.so library in there to supplement the pure Python ve

Categories : Python

Make Sublime Text treat inside a text box?
I want to alert('test'); in an input type text but it should not execute the alert(alert prompt). <input type="text" value="<script>alert('test');</script>" /> Produces: You can do this programatically via JavaScript. First obtain a reference to the input element, then set the value attribute. var inputElement = document.querySelector("input"); inputElement.value = "<script>alert('test');</script>";

Categories : Javascript

UITextView that expands dynamically to text inside a scroll view using auto layout
Instead of setting the frame, drag one of the height constraints for your text view into your controller to create an outlet. Then in viewWillLayoutSubviews grab the contentSize and set the constant of your text view height constraint. That should accomplish what you're doing with the frame in your code above. Just be sure that your text view has constraints from all edges to your scroll view so that the scroll view can size itself properly.

Categories : IOS

Auto-complete AWK variable
Instead of doing this: array$1[something]++ It would be better if you do this instead: array[$1, something]++ You can also store your indices to another variable like: indices[i++]=$1 Then later do for (i = 0; i in indices; ++i) { k = indices[i] printf "something of %s: %s ", k, array[k, something] }

Categories : Linux

Is it possible to have