Search Results

Search found 3022 results on 121 pages for 'loose typing'.

Page 49/121 | < Previous Page | 45 46 47 48 49 50 51 52 53 54 55 56  | Next Page >

  • color letters in a div

    - by Growler
    I've created a palindrome checker. I want to take it one step further and show the letters being compared as it is being checked. HTML: <p id="typing"></p> <input type="text" id="textBox" onkeyup="pal(this.value);" value="" /> <div id="response"></div> <hr> <div id="palindromeRun"></div> JS: To do this, I run the recursive check... Then if it is a palindrome, I run colorLetters(), which I'm trying to highlight in green each letter as it is being checked. Right now it is just rewriting palindromeRun's HTML with the first letter. I know this is because of the way I'm resetting its HTML. I don't know how to just grab the first and last letter, change only those letters' css, then increment i and j on the next setTimeout loop. var timeout2 = null; function pal (input) { var str = input.replace(/\s/g, ''); var str2 = str.replace(/\W/, ''); if (checkPal(str2, 0, str2.length-1)) { $("#textBox").css({"color" : "green"}); $("#response").html(input + " is a palindrome"); $("#palindromeRun").html(input); colorLetters(str2, 0, str2.length-1); } else { $("#textBox").css({"color" : "red"}); $("#response").html(input + " is not a palindrome"); } if (input.length <= 0) { $("#response").html(""); $("#textBox").css({"color" : "black"}); } } function checkPal (input, i, j) { if (input.length <= 1) { return false; } if (i === j || ((j-i) == 1 && input.charAt(i) === input.charAt(j))) { return true; } else { if (input.charAt(i).toLowerCase() === input.charAt(j).toLowerCase()) { return checkPal(input, ++i, --j); } else { return false; } } } function colorLetters(myinput, i, j) { if (timeout2 == null) { timeout2 = setTimeout(function () { console.log("called"); var firstLetter = $("#palindromeRun").html(myinput.charAt(i)) var secondLetter = $("#palindromeRun").html(myinput.charAt(j)) $(firstLetter).css({"color" : "red"}); $(secondLetter).css({"color" : "green"}); i++; j++; timeout2=null; }, 1000); } } Secondary: If possible, I'd just like to have it colors the letters as the user is typing... I realize this will require a setTimeout on each keyup, but also am not sure how to write this.

    Read the article

  • it takes 2 seconds to compile a hello world C++ project in netbeans (windows)

    - by Ethan
    I used code:blocks as the C++ IDE on Windows. I switched to netbeans 6.8 (with C/C++ plugin, MinGW, MSYS) recently, because netbeas have the nice feature of "checking syntax errors when typing" (same as working on Java or PHP projects). But the painful thing is that, it takes 2 seconds to compile a simple hello world project in netbeans. Any trick to make it as fast as code:blocks, or at least make the compiling time no more than 0.5 second?

    Read the article

  • Reset UIKeyboard State

    - by kamziro
    I have a UITextView which the keyboard enters values into. However, if you clear the text value (i.e uitextview.text = @""), the keyboard's state does not reset to the lowercase alphabet keyboard. That is, if I was in the middle of typing "hello.." and the textview gets cleared, the keyboard still shows the symbols, rather than back to the alphabetical letters. Is there a way to get around this?

    Read the article

  • Passing parameter to base class constructor or using instance variable?

    - by deamon
    All classes derived from a certain base class have to define an attribute called "path". In the sense of duck typing I could rely upon definition in the subclasses: class Base: pass # no "path" variable here def Sub(Base): def __init__(self): self.path = "something/" Another possiblity would be to use the base class constructor: class Base: def __init__(self, path): self.path = path def Sub(Base): def __init__(self): super().__init__("something/") What would you prefer and why? Is there a better way?

    Read the article

  • how to update two input box in jquery

    - by Mac Taylor
    hey guys i create two input text fields , one for title and another for permanent link i need to update the second filed automatically when user is typing the tilte how can i do such a thing in jquery /php somehow im looking for a way to simulate wordpress creation of permanent link in post section

    Read the article

  • ASP.NET Hosting and routing

    - by V-Man
    Is it possible to host 2 asp.net projects off one ip address? I don't have a domain name just an ip number. I'm running IIS7. The first project runs and displays fine over the web by simply typing in the ip address into the browser but I'm having trouble accessing the second. Currently both projects have virtual directories in IIS7. Help is greatly appreciated. Thx

    Read the article

  • void foo(int &x) -> Ruby? Passing integers by reference?

    - by Earlz
    Hello, as a way to spice up my C++ programming homework, I've decided to instead of typing the C++ from the book onto my computer, instead reforming it in Ruby. Yes it's a bit silly, but I'm bored. Anyway, I'm having trouble converting this kind of function to Ruby void swap(int &a,int &b){ int c=b; b=a; a=c } What would the equivalent ruby code looking inside a function ?

    Read the article

  • [winapi] Three questions about editbox ?

    - by subSeven
    Hello! I have three questions about editbox control in WINAPI (i can't find information on msdn about this) 1. How to disable moving typeing cursor with mouse, arrows, backspace in editbox ? I want to make typing like in command line in dos, but with out backspace. Can I write some piece of text with red color, and another with blue ? How to write to editbox control from another thread ?

    Read the article

  • Please suggest ASP.Net source editor

    - by Jerry
    Can someone suggest ASP.Net source editor which I can integrate into my web site expected features: Highlight ASP.Net source code, including server code / javascript code / html / css Intelligent suggesting when typing the code. (this is optional) "Design View" is not required. I just need the code view, please suggest, thank you

    Read the article

  • how to hook key event.

    - by backspace7
    I'd like to limit the text length of EditText widget, And if user type more charactes than the limited length, I want to show a kind of warning popup, however I can't show popup. The problem is that we can't show popup while typing, Probably, many people think a way of utilizing OnKeyListener or OnKeyDown. But, when the word is composing, nothing come into OnKeyListener or OnKeyDown, So, we can't show popup when we want to. Is there anyone who have smart idea to solve this problem?

    Read the article

  • Isn't objective-c function parameter syntax weird? [closed]

    - by Haoest
    Consider the following method: +(void) myMethod:(int)arg1 **argument2**(int)arg2 **argument3**(int) arg3; See how the first argument, unlike the 2nd and 3rd, doesn't have a description, giving it an impression of bad symmetry. Also you would expect the extra typing will provide named argument as you pass it in, but you still have to pass them in the correct order. Can anyone help me make sense of this?

    Read the article

  • Eclipse Doesn't List Classes Within Java Packages

    - by Matt Robertson
    Usually when I'm typing a Java import statement in Eclipse or otherwise referencing a class via the packages that it is in, Eclipse shows a context menu with a list of all classes within that package. There have been several times, however, that it would only shows subpackages within a package and would not show classes within that package. Does anyone know why this is? It sounds like a setting/preference was changed, but I never knowingly changed anything related to this.

    Read the article

  • GIT core.editor setup on windows along w application PATH reference

    - by delinquentme
    Hey all so i wehnt ahead and opened up my .gitconfig file and manually input the [core] editor = 'C:/Program Files/Notepad++/notepad++.exe' which would allow me to execute command: (im trying to setup my .gitignore list) "C:/Program Files/Notepad++/notepad++.exe" .gitignore im JUSt not interested in typing this out every time that i need to make a file SO ive heard something about editing PATH to allow me to replace the above with something like: npp .gitignore any help would be aprpeciated!

    Read the article

  • javascript autocompletion for DSL. (e.g.: SQL)

    - by chacko
    I want to give the user a web-page where he can type some simple SQL. select * from myTable. What I would like is to have the autocompletion area to help typing: sel [selECT] select * f [select * fROM] select * from [select * fROM column1] [select * fROM column2] ... Anybody can suggest if there is a nice open source library for this ? I am not really interested in the SQL (I will have to parse a DSL) I am more interested on a powerful autocompletion text area widget.

    Read the article

  • Selecting text and focusing on a textbox

    - by Malfist
    I'm trying to programmatically select the text in a textbox, and focus on it too, so that when the form is launch the user only has to start typing and it will replace what is already there. I've been using the code: stage.focus = _finalScoreTF; _finalScoreTF.setSelection(0, _finalScoreTF.text.length - 1); but it doesn't work...any ideas?

    Read the article

  • fastest way to upload an xls file into a database

    - by shmichael
    I have an xls file with ~60 sheets of data. I would like to move them into a database (postgres) such that each sheet's data is stored in a different table. What is the fastest way of creating these tables? I don't care about naming or proper typing of columns. The columns could all be strings for that matter. I don't want to run 60 different csv uploads.

    Read the article

  • Notepad++ premade template

    - by bah
    Hi, I have seen in videos, that people get html template by typing "html:5" or something like that (btw, they're not using notepad++). Is this possible in notepad++? Thanks.

    Read the article

  • Javascript: Properly Setting A Text Area

    - by Jeremy Person
    I have a text area and the problem is people are typing a large amount of text and I have it clearing out the value and forcing an N/A so I can force something to be entered. How can I make the script below validate someone has already typed something (and not clear it out) but still clear out the N/A by default? textarea name="req_WhatMadeItDifficultToUse" cols="35" onfocus="this.value = '';" onblur="if(this.value == '') this.value = 'N/A';" id="WhatMadeItDifficultToUse"N/A

    Read the article

  • iPhone UITextView leaves room for 2 lines at the bottom

    - by Ton
    Hi Guys, When i start typing text in a default textView in my viewcontroller, its not going to the bottom of the textfield. It leaves room for 2 more lines of text and then starts scrolling. I want it to start scrolling when i start going beyond the last line. I tried everything, and i dont know what i can do? Anyone any ideas?

    Read the article

  • How do I run an iPad emulator ?

    - by John
    I have no real need for the entire SDK, my project involves mainly JS and CSS on an ePub structure. My fiend lend me his MacBook on which I'm typing now. I can create everything on a PC box, import to the MacBook and than test it on the emulator. So - how do I install an iPad emulator on a MacBook ? Thank you for your assistance.

    Read the article

< Previous Page | 45 46 47 48 49 50 51 52 53 54 55 56  | Next Page >