variables

C++ reference variable clarification

Hi All, I think most would be surprised about the topic again, However I am referring to a book "C++ Common Knowledge: Essential Intermediate Programming" written by "Stephen C. Dewhurst". In the book, he quotes a particular sentence (in section under Item 5. References Are Aliases, Not Pointers), which is as below A reference is ...

Netlogo: error when putting variable in table, only constants allowe??

Hello, Currently I am working on a Netlogo program where I need to use nodes and links for vehicle routing problem. (links are called streets in the program) Here I have some practical problems of how to input variable linkspeed in a table with another node. Constants like 200 etc are fine. Online I found some examples where variables ...

Using JavaScript to render HTML; nothing appearing but values will alert

Hi, I'm taking some information from some variables I have already defined outside this function to create a html svg text box. Here is the function which is causing me trouble: RenderTextBox:function() { alert('this.x: ' + this.x); alert('this.y: ' + this.y); this.textBox = paper.text(this.x, this.y, this.htmlTextBox); } Th...

How do I create Variables in XSLT that are not document fragments?

Consider the following XSLT 2.0 template <xsl:template match="/"> <xsl:variable name="var1"> <elem>1</elem> <elem>2</elem> <elem>3</elem> </xsl:variable> <xsl:text>var1 has </xsl:text> <xsl:value-of select="count($var1)"/> <xsl:text>elements. </xsl:text> <xsl:variable name="var2" sele...

How can I concatenate these values and perform an md5 calculation

I have some values: $data1 $data2 $data3 I want to concatenate these variables and then perform an md5 calculation how is it done?? ...

Does the for foreach construct in java create a hard or soft copy?

Say I have the following piece of java code ArrayList<Double> myList = new Double[100]; for (Double x : myList) x = randomDouble(); Does this actually modify myList or just the dummy variable? I realize I should just try this code segment out, but I think this is the sort of thing I should be able to google or search for on this ...

Passing variables from Model to Model in codeigniter

Hi, I need to pass a variable to model, that model needs to send another back and use that variable to query a different model. EG: I have a product_ID which I send to the product model, From that I find out the supplier_ID. I want to grab that supplier_ID to the supplier model to get the supplier name. How do you implement this in ...

Select template for execution using a condition including variable on apply-templates

Hi, I have a template that looks like below <xsl:template match="more-info" mode="docuSection"> html </xsl:template> and which is applied with the call <xsl:apply-templates select="." mode="docuSection"/> so the template is applied when the current node has more-info element, is there a way to make this template get ap...

C# Dynamically reference objects in loop

I don't know whether this is possible or not. What I want to do is to reference a DataTable (and other objects, but getting it working for one will make the rest easy) and use it as a paramater, but I want to do this in a loop, so that I can perform the function with each DataTable dt1, dt2, dt3 etc. Something like this (although this ob...

PHP All Function Variables Global

Hi, I have a function called init on my website in an external file called functions.php. Index.php loads that page and calls function init: function init(){ error_reporting(0); $time_start = microtime(true); $con = mysql_connect("localhost","user123","password123"); mysql_select_db("db123"); } How can I get all of these ...

What the difference between "$@" and "$*" in bash ?

Hello All, It seems to me that they both store all the command-line argument. So is there a difference between this two ? Thanks ...

Will JavaScript evaluate a property's value if it's not part of an assignment statement?

I've come across a fairly obscure problem having to do with measuring a document's height before the styling has been applied by the browser. More information here: http://sonspring.com/journal/jquery-iframe-sizing http://ajaxian.com/archives/safari-3-onload-firing-and-bad-timing In Dave Hyatt's comment from June 27, he advises simp...

jquery hover pass variable to callback function

I am trying to remove a title attribute for a link on hover and then add it back on mouse out. I would like to pass var hoverText to the hover out... Here is the code I have. Any ideas? $(".icon a").hover(function() { $this = $(this); var hoverText = $.data(this, 'title', $this.attr('title')); $(this)...

How to run SQL that contains bind variables in the ODT Query Window?

How do you run SQL that contains one or more bind variables in the Oracle Developer Tools for Visual Studio Query Window? For example, the following works fine in SQL*Plus: variable x NUMBER; BEGIN :x := 0; END; / SELECT 1 FROM DUAL WHERE :x <> 1; When executed in the ODT Query Window, the following exception is raised in the Query...

shared global variables in C

How can I create global variables that are shared in C? If I put it in a header file, then the linker complains that the variables are already defined. Is the only way to declare the variable in one of my C files and to manually put in externs at the top of all the other C files that want to use it? That sounds not ideal. ...

How do I get preferences to work in Android?

I've really been struggling through this. New to Java/Android. I'm writing my first app and this is the first thing that has taken me longer than a couple days of searching to figure out. Here's the setup: It's a BAC calculator / drink counter: A formula is used to calculate the BAC. Here's the forumla: Bac = ((StandardDrinks / 2) * ...

can't find variable: $j

Ahh i'm stuck again. helpp why do i encounter this "can't find variable: $j" when i use this method function myMethod(htmlObject) { var buttonTags = $j("button",htmlObject); ... } Sorry for askin silly questions again. running outta time =\ THANKS FOR THEHELP! ...

Powershell - Splitting variable into chunks

I have written a query in Powershell interrogating a F5 BIG-IP box through it's iControl API to bring back CPU usage etc. Using this code (see below) I can return the data back into a CSV format which is fine. However the $csvdata variable contains all the data. I need to be able to take this variable and for each line split each colu...

Getting a variable from an object with a string in PHP

I have a Persons object. It has a variable name accessible by saying $p = new Person('John'); echo $p->name; Now I have a string. $name = 'name'; I need to get $p->name using $p and $name. Something like echo $p->[$name]; ...

Accessing Variables in Javascript using .length

Hey all, I'm pretty new to Javascript, so forgive me if this is a simple question. I'm trying to access the length of a set of checkboxes in a form using Javascript. However, I need to be able to change the "name" field of the checkboxes to check several different sets of them. Right now, my sample code looks like: var set = "set" + x...