variables

Weird AS3 variable behaviour

OK, so here's what I'm trying to do: I have a landing page with 3 buttons on it, and I have 3 corresponding external swf files, one for each button... so the user clicks a button and the corresponding swf file is loaded into an empty MC on the stage. Now each of these external swf files also contains several buttons and each of these bu...

How to reference a variable dynamically in javascript

I am trying to reference a variable dynamically in javascript The variable I am trying to call is amtgc1# (where # varies from 1-7) I am using a while statement to loop through, and the value of the counting variable in my while statement corresponds with the last digit of the variable I am trying to call. For Example: v...

Copying an XSLT variable

Hello Stack Overflow, I'm working on an Umbraco XSL Stylesheet and I am pretty stuck. Basically, I have a parameter that I test and use it's value if it's present, otherwise I use the default parameter $currentPage. Here are the parameters <xsl:param name="source" select="/macro/sourceId" /> <xsl:param name="currentPage" /> Here's ...

How many bytes does a #define string (string literal) take?

#define STR "test1" Why does this take 6 bytes? sizeof(STR) = 6 ...

Can I use two precision '*' in a string format of two strings?

.* The precision is not specified in the format string, but as an additional integer value argument preceding the argument that has to be formatted. #define SUFF ".txt" #define MAX_STR 50 fileName[MAX_STR]; name ="myFile" sprintf( fileName, "%s%s", name, SUFF ); //fileName = "myFile.txt" Now I want to bound the str...

Swap the contents of 2 JavaScript variables from one to the other.

Basically what I am wanting to do is take the variable named FROM and swap it with the variable named TO and vice visa, the reason for this is to allow the user to press a button which swaps the variables over when pressed. Exactly how it does when you press the swap button on google translate. Below is the code for the variables ect, b...

C++ variable redefinition

I have a file: variableinclude.h #ifndef _variableinclude_h_ #define _variableinclude_h_ AClass* variable1; int* variable2; #endif But I include this file in another two different ones: - atest1.h - atest2.h The problem is the following: variable redefinition. How to avoid that??? ...

Why doesn't Perl's $OSNAME work on Solaris?

I remember having used the variable $OSNAME in linux. Currently I'm working on a project on Solaris where I need to get the OS name and that variable is not working on Solaris. Even a simple one line program does not work: print "OS is $OSNAME\n"; it prints OS is Please help. ...

initializing a static variable in header

hey everyone. i am new in programming in c, so i am trying all these things just to get the hang of the code. so i worte the following: // file: q7a.h static int err_code = 3; void printErrCode (); ///////////// END OF FILE ///////////////// // file: q7a.c #include <stdio.h> #include "q7a.h" void printErrCode () { printf ("%d ", err_c...

call_user_func and variables by reference

Hy there. I'm developing plug-in system and I have problems with call_user_func and referenced variables. I'm calling plug-in handler like this: if(PluginFactory::NumberOfPlugins() != 0) foreach(PluginFactory::GetPlugins() as $pPlugin) call_user_func(get_class($pPlugin) . "::OnHandlePluggablePart", "Core:AfterSceneAssem...

SELECT INTO a table variable in T-SQL

Got a complex SELECT query, from which I would like to insert all rows into a table variable, but T-SQL doesn't allow it. Along the same lines, you cannot use a table variable with SELECT INTO or INSERT EXEC queries. http://odetocode.com/Articles/365.aspx Short example: declare @userData TABLE( name varchar(30) NOT NULL, oldloca...

Set a image url dynamically into a xsl file

Hi. I want to create an xsl file (for a xslt transformation to xsl:fo using an xml) How can I display a image whose url is stored in the xml file? I can use variables <fo:block-container top="5mm" height="20mm" left="0mm" width="75mm"> <fo:block margin-top="10mm" margin-left="50mm"> <fo:external-graphic display-align="cent...

IPhone SDK - How to detect variable type (float or double)?

Hello, How do I detect whether a variable is float, double, int, etc.? Thanks. ...

How can I Scan file to search for value

I need to scan an input file and search for a specific value. How do I do that? ...

code problem - beginner

Ok here is my code so far: @implementation PtyView - (id)initWithFrame:(NSRect)frame; { if (self = [super initWithFrame: frame]) { [self setFont:[NSFont fontWithName:@"Courier" size:0.0]]; [self startTask]; } return self; } - (void)keyDown:(NSEvent *)event { const char * typein = [[event characters]...

How do I pass variables using 'file?x=3' instead of 'file.php?x=3' ?

Possible Duplicate: How come some site urls do not include a file extension? Hi there, I was wondering how I can pass a variable to my PHP script using the following syntax: http://example.com/script?variable=value It seems I have to include .php after the script name or it won't work, but YouTube for example doesn't have th...

Ruby: OptionParser: String Arg & Hash Assignment

Using OptionParser for string argument input and hash assignment. What is the best way to read-in multiple variables for a single argument? How do I then assign those to a hash to reference? Here is what I have so far: large_skus = Hash.new small_skus = Hash.new OptionParser.new do |opts| opts.on("-b", "--brands bName1,bName2,bName...

JavaScript put variably into url, then use it if reloaded

We're working on a music page to list albums, songs and add lyrics. We have a "View More" below each album, clicking that shows you the song list (using jquery, making a hidden div slide down). We'd like to add a variable to the URL if someone clicks it (or remove it if they "hide") the songs, so that it creates a permalink to that sec...

Php to get value of hashtag from URL

How can I get a variable of a hashtag in php. I have a variable on page like this catalog.php#album=2song=1 How can i get the album and song values and put them into PHP variables? ...

How do I use a Perl variable in a regular expression?

I am trying to do a search and replace with variables. In this case variables that I pulled from a previous match. Here is my code: $fileContentToAlter =~ s/$2/$1/g; Now I realize in that state, it is being read incorrectly as $ has its own meaning inside of a regexp. I did some searching on the web and read that doublequotes could fi...