variables

What's the best way to store quickly-changing data in Python?

On a quest to learn a bit about Python and sockets I'm writing a little 2d-game server. And although I don't see more than a few people on this server at any given time, I want to write it as efficiently as I can. I have a global dictionary called "globuser", in it is another dictionary containing the user stats (like the X & Y coordin...

Uninitialized Automatic variable forcing value to random value

Hi All, This may look like a trivial problem. Sorry in that case, I am not able to find the actual way. I understand that automatic variable are un-initilaized. So a code snippet provided below is likely to dump in block-2 char *p; if(NULL == p) { //do something block-1 statement } else { //do something else block-...

Getting PHP variables and their values from SQL COUNT() and GROUP BY

I'm trying to extract and make variables out of the "thinking skills" (like analyzing, evaluating, etc.) from a test and set their value to the number of test items within each. I'm stuck, so any help would be appreciated. (The SQL statement seems to work fine.) Example of what I want: $analyzing = 7, $applying = 13, etc.... Thanks! ...

My url data isn't passing to my codeigniter controller's function.

The domain I'm using is ->http://www.domainname.com/admin/users/edit/1 class Cal_Admin extends Controller { function Cal_Admin() { parent::Controller(); $this->load->model('events/model_events'); $this->load->model('users/model_users'); } function index() { $data['events'] = $this->model_events->get_home_entries()...

Set table names using user-defined variables in MySQL stored procedures

Hello, I want to create a table with a name taking from a user-defined variable. The following code doesn't seem to work (I get a MYSQL syntax error near CREATE TABLE line) Thanks in advance for the help SET @ratingsNewTableName = CONCAT('ratings_', 'anotherString'); CREATE TABLE IF NOT EXISTS @ratingsNewTableName ( `id` INT(11) N...

[c/c++] set variable to cmd.exe

Greeting earthmen, Here is my question: How can I create a program which sets variable to current session of cmd.exe e.g. c:\> set myvar Environment variable myvar not defined c:\>myexe.exe c:>set myvar myvar=myvalue The only similar topic that I've found is this - http://stackoverflow.com/questions/774047/how-can-i-change-windows...

How big can variable be, in python?

I get an response in Python program from SQL server. How big can this response be? What is the maximum? Coult it be as much as about 100 mb? ...

Regex replaces everything that matches any character

a[b].innerHTML=a[b].innerHTML.replace(RegExp('['+bbc[c][0]+']','ig'),bbc[c][1]) This is basically what I'm working with. It's wrapped in two loops so that should explain why it looks like what it does. Basically I want to replace something that matches '['+variable from an array+']'. I'm making a BBCode script for a free forum and no d...

Ada: how to access this variable?

Hi, I have a modified textbook example as follows (the book is Understanding Ada---a software engineering approach by Bray and Pokrass): PACKAGE SOLAR_SYSTEM IS TYPE PLANET IS (MERCURY, VENUS, MARS, JUPITER, SATURN, NEPTUNE); SUBTYPE TERRESTRIAL_PLANET IS PLANET RANGE MERCURY..MARS; SUBTYPE JOVIAN_PLANET IS PLANET RANGE JUPITER..NE...

Problem passing variable from javascript to controller Codeigniter

I'm struggling with this and just can't seem to make it work. Need to pass the current users date (cdate) variable to my controller and in spite my alert windows shows the correct value, that value never reaches the controller. Here's the javascript code: $(document).ready(function() { $('#submit').click(function() { v...

Writing PHP into Javascript or Javascript Into PHP

i have this code var myChart = new FusionCharts("../themes/clean/charts/hbullet.swf", "myChartId", "400", "75", "0", "0"); myChart.setDataXML("<chart lowerLimit='0' upperLimit='100' caption='Revenue' subcaption='US $ (1,000s)' numberPrefix='$' numberSuffix='K' showValue='1'><colorRange><color minValue='0' maxValue='50' color='A6A...

Rails application variable life cycle question.

Assume that I have a global variable user in application....like this: # GET /users.xml def index @users = User.all respond_to do |format| format.html # index.html.erb format.xml { render :xml => @users } end end Is that mean every request, a new @user is created? If every request , an object is cre...

storing preferences within the app to be used later

How can I store a large float value, like 0.00032012 in the app?? I need to store that number, so when someone click a save preferences button, it stores a variable. Then when I relaunch the app, it will remember that number and post it in a text field. I was thinking of using plist, but how can I store variables in the plist??? Exampl...

Do Lua variables lose their value between script calls?

In a C app when I call a Lua script, do the variables in the code stay with the same value when I call the script again later? ...

Is this the correct syntax for passing a file pointer by reference?

Is this the correct syntax for passing a file pointer by reference? Function call: printNew(&fpt); printNew(FILE **fpt) { //change to fpt in here kept after function exits? } Thanks. ...

Code Igniter POST Variable

Hi Everyone! I am brand new to Code Igniter but I can't seem to find a way to do this in the documentation, In normal PHP you can retrieve the contents of the entire POST variable like this $_POST = $postedVars But I can't seem to find something that does this in the same manner, I've tried $arr = $this->input->post; and $arr = $t...

Javascript global variable problem

I have a script tag with 'A' variable and has been initialised as 16 but when I use alert on IE under onclick event, I received undefine rather than 16. Is this the problem in IE 6? e.g. var A =16; undefine ...

Trouble with Using Value of a Variable

I am quite new to Javascript. I am trying to use the ajaxupload plugin to make an upload work within a form. I figured out how to use the form with the file upload plugin. Now, however the output of the form field just appears as [object Object]. Here's the code var text=$('input#text').val(); onSubmit: function(file, ext){ ...

Cannot get declared variables in javascript

Hello, Consider a javascript file script.js which contains the code alert(theVar); Now, i linked the js file to the document like <script type="text/javascript"> var theVar= 'a alert'; </script> <script type="text/javascript" src="script.js"></script> //Contains alert(theVar); The variable theVar is used and i get a alert. This ...

Why isn't my index variable increasing when I add numbers to it?

I've got the following float array public static float camObjCoord[] = new float[8000]; declared as a global variable. I'm then adding content to it by calling the following method: public void addcube(float highx, float lowx, float highz, float lowz){ //Constructing new cube... Global.cubes = Global.cubes + 1; float highy =...