Input:
hello world "22" bye world
I need a regex that will work in bash that can get me the numbers between the quotes. The regex should match 22.
Thanks!
Python newb here. I m trying to count the number of letter "a"s in a given string. Code is below. It keeps returning 1 instead 3 in string "banana". Any input appreciated.
def count_letters(word, char):
count = 0
while count <= len(word):
for char in word:
if char == word[count]:
count += 1
return count
print count_letters('banana','a')
I want to do some funky things with controlling MIDI streams, and I'd like to be able to pipe MIDI input into an application like Ableton or Reason. Presumably this involves some sort of driver level work?
Ultimately I'd like to write my application in Python, so if there is some Python-based solution, I'd consider it. I'm perfectly fine with using C/C++, though, so that's not a problem.
I want to get the object of this code ,
<input class="radio"
id="conversation_sub_kind_id_208"
name="conversation[sub_kind_id]"
onclick="set_department_name('department_name208')"
type="radio"
value="208" />
I want to use jQuery Framework to get the object, like the document.getElementbyTagName("conv..."); what should i do in here?
Thank you, and best regards!
Hi,
I have been trying to figure out how to use the jQuery BBQ plug-in.
I have been able to add it to my site by copying the code from the site but I'm seeing that if I have a form in one of my tabs, I can't post any of the results successfully.
Has anyone used this plug-in and gotten used to its functionality? I need help figuring out where to input my php code for form handling and have the results returned the page loaded in the tab.
How can I input varables value into a textfield?
var i:uint=0
for(i; i<4; i++){
pageText.text=i+1
}
If i use i+"something" then it can get the i value, but other than that it could now get i value.
Hello everyone,
I would like someone to explain me what _forward is exactly doing, I cannot see if _forward is also rendering the attached view to the action or just executing the action.
Also is it possible to pass argument to $this-action in a view script ?
More generally my problem is how to code a confirmation page, let's say the user input some stuff and you want to show him confirmation, is forward is mean for that case ?
Thanks
Hi, for a certain project, I need some way to parse XML and get data from it. So I wonder, which one of built-in parsers is the fastest?
Also, it would be nice of the parser could accept a XML string as input - I have my own implementation of thread-safe working with files and I don't want some nasty non-thread-safe libraries to make my efforts useless.
Hi
im looking (but cant find) for sample app that will show me how to implement UITableView with custom UITableViewCell that is similar to one in the Things app, with smooth animation from read-only view (that hides empty cells) to editable view that shows only cells that can be edited, and custom cell with multiline input with small image. I would appreciate if someone could point me in the right direction. Im new to Cocoa/Objective-C programming but Im familiar with Object Oriented programing concepts.
I'm trying to write a program to take the first letter of the user input to generate a username. I'm trying to write it so that if the user leaves the input blank, then the letter that would otherwise be taken to generate the username defaults to the letter 'z'.
Here is my full code:
import java.util.Scanner;
/**
UsernameGenerator.java
Generates a username based on the users inputs.
@author: Evan Fravert
*/
public class UsernameGenerator {
/**
* Generates a username based on the users inputs.
*@param args command line argument
*/
public static void main(String[] args)
{ // abcde
String first;
String middle;
String last;
String password1;
String password2;
int randomNum;
randomNum = (int) (Math.random() * 1000) + 100;
Scanner userInput = new Scanner(System.in);
System.out.println("Please enter your first name:");
first = userInput.nextLine();
String firstLower = first.toLowerCase();
System.out.println("Please enter your middle name:");
middle = userInput.nextLine();
String middleLower = middle.toLowerCase();
System.out.println("Please enter your last name:");
last = userInput.nextLine();
int lastEnd = last.length()-1;
String lastLower = last.toLowerCase();
System.out.println("Please enter your password:");
password1 = userInput.nextLine();
System.out.println("Please enter your password again:");
password2 = userInput.nextLine();
char firstLetter = firstLower.charAt(0);
char middleLetter = middleLower.charAt(0);
char lastLetter = lastLower.charAt(0);
char lastLast = lastLower.charAt(lastEnd);
if first.length() == 0) {
firstLetter = 'z';
}
else {
firstLetter = firstLower.charAt(0);
}
System.out.println("Your username is " + firstLetter + ""
+ middleLetter + "" + lastLetter + "" + "" + lastLast + "" + randomNum);
System.out.println("Your password is " + password1);
System.out.println("Welcome " + first + " " + middle + " " + last + "!");
}
}
input:
string1=this is a joke.this is not life.
string 2=this is not a joke. this is life.
by comparing string1&string 2 we found
output:
pos8 deleted 4 chars " not"
pos28 inserted 4 chars " not"
Hey all,
I'm looking for a HTML editor which can be (easiliy) integrated in a RoR app that has the possibility to create forms.
Not forms per se, but I need the possibility to add radiobuttons, input fields, checkboxes and so on.
I loved the smoothness of TinyMCE, but apparently this doesn't take me far enough.
Does there exists such a gem/plugin?
Thanks!
Iam quite new to functions in SQL and I would like to create a function to compare values in a MySQL table against previous and I am not sure how to do this.
For example (iId is the input value)
DECLARE pVal INT(20);
DECLARE val INT(20);
SELECT price INTO pVal FROM products WHERE Id=iId;
SELECT price FROM products;
IF price == pVal THEN
SET val = price;
END IF;
Thanks
I want to somehow place a question on the title using the url.
Actually I am building a webpage where I have placed a question input box and submit button, so I want that when I submit it should redirect me to the ask questions page and the title should contain the question that he asked.
Is there any way to do that?
Thanks.
Say I got two functions that looks like this:
function main(Index)
{
doStuff();
}
function doStuff()
{
if(Index == 1)
{
document.write("Hello world!")
}
}
And some HTML:
<input type="button" value="Click me" onclick="main(1)" />
I realize this is a very stupid way to use function-specific variables and such, but it's just out of curiosity. So is it possible to pass the variable Index from the main function to the doStuff function?
Hi, I need to create a bash shell script starting with a day and then loop through each subsequent day formatting that output as %Y_%m_d
I figure i can submit a start day and then another param for the number of days.
My issue/question is how to set a DATE (that is not now) and then add a day.
so my input would be 2010_04_01 6
my output would be
2010_04_01
2010_04_02
2010_04_03
2010_04_04
2010_04_05
2010_04_06
Thanks
Is it possible to record a user's input into an HTML textfield, and playback at a later date in realtime? One way I can think of would be to capture each keyDown event and the time delta (accurate to a few hundred ms), and store the pairs together.
Can you think of a better/more efficient way?
I have a table with a Screen on it underneath there are 2 mouses I need to determin the position of the table. This will manipulate the content on the screen. I already can get the mouse input using the multipoint SDK from microsoft, I only keep failing at the mathemathics. My question now is, how would you determine the position of the table using 2 mouses?
So I already have a database setup with a few columns and a few rows already inserted in. I'm trying to create a view that you would just input information into a form and press Submit, then a row would be added to the MySQL database with the information you just typed in.
I believe you can do this with admin, but I would like to try without admin and I'm not sure if this is possible? I've been using the MySQL commandline to add rows as of now..
I have attached a toolbar with a UITextField and UIButton to the keyboard when it becomes the first responder via the user taping inside the textfield
textField.inputAccessoryView = theToolbar;
Problem is, the toolbar disappears when the keyboard is dismissed, thus preventing any further input.
Any ideas on how to make the toolbar go back to the bottom of the screen rather than off it completely?
I'm thinking a delegate method might help but Im really not too sure. It seems once the inputAccessoryView always the inputAccessoryView :(
Cheers
DEAR All
I'm new to the C++, so maybe someone can say what the proper way to write a function that gets a string char (represents number) and converts it to the integer number.
For example : input : Sixty five, output: 65.
Maybe it should use by cin.getline() ?
Well, vice-versa is little bit simlper...
Thanks for advance.
Igal