variables

Bash: how to process variables from an input file?

I've got a bash script that reads input from a file like this: while IFS="|" read -r a b do echo "$a something $b somethingelse" done < "$FILE" The file it reads looketh like this: http://someurl1.com|label1 http://someurl2.com|label2 However, I'd like to be able to insert the names of variables into that file when it suits me,...

Qt: default value of variable in class

When creating my own class in Qt I would like my variables in the class to have a standard/default value if I haven't set them to anything. It would be perfect if this was possible to set in the h-file so I don't have to do it in each instance method of my class. You can see what I want to do in the code below. In the example myBool woul...

How can I give a variable to an action listener?

I have a static variable partner in the class. And I want to set a value of these variable whenever a radio button is pressed. This is the code I tried to use: for (String playerName: players) { option = new JRadioButton(playerName, false); option.addActionListener(new ActionListener(){ @Override public void acti...

How to increment variable names/Is this a bad idea

In Python, if I were to have a user input the number X, and then the program enters a for loop in which the user inputs X values, is there a way/is it a bad idea to have variable names automatically increment? ie: user inputs '6' value_1 = ... value_2 = ... value_3 = ... value_4 = ... value_5 = ... value_6 = ...

PHP application variable... maybe?

I went to a PHP job interview, I was asked to implement a piece of code to detect visitors are bots to crawl thru the website and steal content. So I implemented a few lines of code to detect if the site is being refreshed/visited too quickly/often by using a session variable to store last visit timestamp. I got told that session varai...

How much space does "variable name" takes ?

I have 2 variable like below char s='s'; char Kaazoooombaa ='s'; how can I know which variable is consuming how much space ? ...

C: Global ,Static variables understanding

Hi All, In following program . I have one doubt. I have declared one global variable . I am printing the address of the global variable in the function . It is giving me same address when I am not changing the value of global . If I did any changes in the global variables It is giving me different address why...........? Like tha...

Facebook user language / internationalization

I'm developing a Facebook application for a business page. The application can only be accessed as a tab, meaning there is no box or direct access intended. I've done my share of searching and even though I hate asking for help when I know the information I'm after must be there somewhere, I've reached the point of exhaustion and beg for...

Why I do not see a static variable in a loop?

I have a static method which sets a variable: static String[] playersNames; public static void setParameters(String[] players) { playersNames = players; } Then I have a static block: static { JRadioButton option; ButtonGroup group = new ButtonGroup(); // Wright a short explanation of what the user should do. partnerSe...

Choose variable based on users choice from picklist.

I have this form. Basically what I want is to send a auto-response with a different URL based on what the user picks in the "attn" picklist. I've been thinking I could have a different variable for each drop down value. It will then pass this variable on to the mail script that will choose which URL to insert inside the auto response tha...

Pass a value to an inFrame

This probably an easy thing to do but for some reason I can't get a handle on it. I have a simple form that allows people to select one if three items for sale. When they chose their item I need to pass that variable into an iFrame with a third party checkout page to safely process their cc transaction. How would I do this? Cheers- ...

C++ Variable declarable in function body, but not class member?

I want to create a C++ class with the following type: It can be declared inside of a function. It can be declared inside of a member function. It can not be declared as a class member. The use of this: think "Root" objects for a GC. Is this possible in C++? In particular, I'm using g++. Willing to switch to clang. Either templates o...

Excel formula for variable fields

I am looking for a simple formula to do the calculation on two fields that are variable, for e.g., c1 has 100 and c3 has 150 and I want to calculate an increase/decrease percentage, but the trick is the cell values change every month. How do I put the formula to cater for such variation. Appreciate your help. Regards ...

IMDB Grabber PHP

I am recieving an error: Notice: Undefined variable: content in C:\wamp\www\includes\imdbgrabber.php on line 17 When using this code: <?php //url $url = 'http://www.imdb.com/title/tt0367882/'; //get the page content $imdb_content = get_data($url); //parse for product name $name = get_match('/<title>(.*)<\/title>/isU',$imdb_content);...

What can I do with an enum variable?

When I declare a enum variable like this: enum paint_colors { RED, GREEN, BLUE, ...} colors; is the colors variable useful? If so, what can I do with it? Thanks in advance. ...

Codeigniter: Retrieving a variable from Model to use in a Controller

Hi, I bet this is easy but been trying for a while and can't seem to get it to work. Basically I am setting up pagination and in the model below I want to pass $total_rows to my controller so I can add it to the config like so '$config['total_rows'] = $total_rows;'. function get_timeline_filter($per_page, $offset, $source) { ...

putting variables value into .text

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 not get i value. ...

PHP variable in variable

I have set an array in my config file that I use global in my functions. This works fine, but now I want to pass the name of this array as a @param in my function. // in config file: $album_type_arr = array("appartamento", "villa"); global $album_type_arr; // pull in from db_config echo $album_type_arr[0]; function buildmenu($name)...

Jquery variable not defined error....

I use the following jquery statements but i get error in this function onGetDataSuccess(result) { Iteratejsondata(result); $(document).ready(function() { $("#pager").pager({ pagenumber: 1, pagecount: 5, buttonClickCallback: PageClick }); }); PageClick = function(pageclickednumber) { $("#pager").pager({ pagenumber: pageclickednu...

A jscript variable in a Query

Maybe a very simple question. How can I put in this code <Query> <Where> <Eq> <FieldRef Name="Judge_x0020_1" /> <Value Type="Text">mr. R. Sanches</Value> </Eq> </Where> </Query> A variable from jscript in the area of the code where mr. R. Sanches is written. So my jScript contains a dynamic text va...