variables

xsl strange behaviour using variables

I've stored a file's tree into $onto <xsl:variable name="onto" select="document('file.xml')"/> In some places I can use this variable as espected: <xsl:copy-of select="$onto/rdf:RDF"/> But I'm having trouble in other places, strange chars are written on output: <xsl:element name="autor"> <xsl:attribute name="rdf:resource"> ...

PHP include class functions with variables.

I am trying to use a variable to get a function in a extended class, this is what I want to do but I can't get it to work, Thanks for your help. class topclass { function mode() { $mode = 'function()'; $class = new extendclass; $class->$mode; } } ...

Advantage of var keyword in C# 3.0

Duplicate: What to use var or object name type I couldn't understand the need of var keyword in C# 3.0 What is the advantage in using it. i saw this question but did not understand the real purpose of using it ...

Can i get more variables instead of string in jquery $ajax?

I have this script: $.ajax({ url: 'submit_to_db.php', type: 'POST', data: 'name=' + name + '&email=' + email + '&comments=' + comments, success: function(result) { $('#response').remove(); $('#container').append('<p id="response">' + result + '</p>'); $('#loading').fadeOut(500, function() { $(this).remov...

VBScript - Don't know why my arguments are not used the same way as variables

Hello, I have written a VBScript to enumerate events from the event log on a particular day. The first query select from the NT event log events between todays date and yesterdays date, Set colEvents = objWMIService.ExecQuery _ ("Select * from Win32_NTLogEvent Where TimeWritten >= '" _ & dtmStartDate & "' and TimeWritten ...

Xcode variables

In Xcode, I know that you can get variables such as PROJECT_DIR to use in some situations, such as a run script build phase. I am wondering if it's possible to get the build type: IE 'Release' or 'Debug'. Any ideas? ...

.htaccess mod_rewrite playing with variables

I want to have my site urls look like http://example.com/place/info?var=info&amp;morevars=ifneeded Place and info are also variables but they have a fixed name, the ones after would vary. EDIT This is the url I am trying to rewrite http://example.com/test.php?place=test&amp;action=info&amp;var=info&amp;morevars=ifneeded This is wha...

Why do I get an "Unreferenced Local Variable" warning? (C++)

When I do something like #include<iostream> int main() { int x; return 0; } I get a warning about x being an unreferenced local variable (I assume becuase I created a variable, then did not use it), why does this give me a warning though? ...

Can I have an application scope variable in Perl?

Hello everybody, I'm somewhat new to Perl/CGI, and I'm coming from a Java/JSP background. I'm writing a small prototype and need to load some "heavy" data (~200MB) into a data structure. Now, I'd obviously like to avoid loading the data with every request. So far I managed to use a "static" variable (one enclosed in a {} block), but t...

Does an overloaded __get need to manage all member variables?

I am creating a __get() function for a class to control access to my private member variables. Do I need to design the function to handle all possible member value reads or can I not write it for members that are public? Also, I am assuming that classes that inherit this class will use my __get() function to access private members. cl...

Finding compound word variable name spelling mistakes

I have just discovered a variable name that is misspelled. If it were hidden away in the depths of code, that would be fine, but this variable name ends up in a configuration that is stored with visibility to the customer. It's really not a big deal, but I wonder if there is a way to avoid it? In this case the variable name is a compo...

Check if variable has a number php

I want to check if a variable has a number in it, I just want to see if there is one I don't care if it has any thing else in it like so: "abc" - false "!./#()" - false "!./#()abc" - false "123" - true "abc123" - true "!./#()123" - true "abc !./#() 123" -true There are easy ways of doing this if you want to know that is all numbers bu...

formating data in php

What I need to be able do is format data in a variable, like so: format: xxx-xxx variable: 123456 output: 123-456 The problem is I need to be able to change the format, so a static solution wouldn't work. I also like to be able to change the variable size, like: format: xxx-xxx variable: 1234 output: 1-234 All ideas are welcome! Th...

Python - get static information

Hello, i have to get static information from one 'module' to another. I'm trying to write logger with information about code place from where we're logging. For example, in some file: LogObject.Log('Describe error', STATIC_INFORMATION) Static information is class name, file name and function name. I get it from this: __file__ self._...

Is it possible to load a specific div from a variable?

Does anyone know if it's possible to load a specific div from a variable like $item = '#help_mobiel_prive'; $('#infopopup_content').load('help.html'+ $item, function() { only that one doesn't work ...

Why does Java have transient variables?

Why does Java have transient variables? ...

Append digit to an int without converting to string?

Is there a safe way of adding a digit at the end of an integer without converting it to a string and without using stringstreams ? I tried to google the answer for this and most solutions suggested converting it to a string and using stringstreams but I would like to keep it as an integer to ensure data integrity and to avoid converting...

How can I have the date from today show up with PHP?

I'm sending a mail function to myself. My first line reads 'Order for $name on $date' The $name variable comes from a form the user fills out. I would like the $date variable to be today's date, whatever that is on that day. How can I make the $date variable show today's date? ...

How can I declare and use T-SQL variables across multiple SqlCommands using the same SqlConnection object to perform multiple inserts into a table variable?

I want to load a list of records given a possibly lengthy list of usernames (anywhere from one to thousands of usernames). Disregard how the name(s) are chosen, and assume they cannot be determined from any existing data in the database. This applies to SQL Server 2005. I specifically want to avoid using a single select statement with ...

Is there a way to query HTML/XML content from a variable using jQuery?

If I have HTML content in a variable like so: var data = "<div id='myid'><div id='subid'>Text</div></div>"; Is there a way to query this using jQuery and selectors? As this, if it were HTML DOM: var data = $("#myid > #subid").text(); ...