variables

In VIM: How to highlight "local variables" in a "C" file

I have highlighted all Symbols by using tags file & highlight option. But I could not able to highlight my local variables. I have an idea, that is, VIM already supports autocompletion of keywords for a current file, it does autocompletion of my local variable, so, if I get a list of keywords for my current file then I will highlight t...

How can I pass variables from a form within the Wordpress platform?

Hi, I'm building a website using Wordpress. The WP-Events plugin is being used to display a list of upcoming events. What I need is for people to be able to confirm their attendance at any particular event. WP-Events is a bit awkward in that it's customised using a template that is only able to be edited with the Wordpress admin. I...

Accessing constants using Key-Value Coding in Objective-C

I'm making a program that has a lot of constants. I decided to put them all into a separate class and I'm importing it by the classes that need it. The files look similar to this // Constants.h extern const int baseCostForBuilding; extern const int maxCostForBuilding; // etc // Constants.m const int baseCostForBuilding = 400; const int...

Java uninitialized variable with finally curiosity

I was trying to come up with obscure test cases for an alternative open-source JVM I am helping with (Avian) when I came across an interesting bit of code, and I was surprised that it didn't compile: public class Test { public static int test1() { int a; try { a = 1; return a; // this is fine ...

Final variable manipulation in Java

Hi, Could anyone please tell me what is the meaning of the following line in context of Java: final variable can still be manipulated unless it's immutable As far as I know, by declaring any variable as final, you can't change it again, then what they mean with the word immutable in above line? ...

Beautiful way to remove GET-variables with PHP?

I have a string with a full URL including GET variables. Which is the best way to remove the GET variables? Is there a nice way to remove just one of them? This is a code that works but is not very beautiful (I think): $current_url = explode('?', $current_url); echo $current_url[0]; The code above just removes all the GET variables. ...

Mysql real escape string loop multiple variables

Say I want to insert into name, address, city, state, zip values $name, $address Etc..... How can I run mysql_real_escape_string on each of the variables before inserting. There has got to be a foreach or loop or while method instead of writing out each variable right? Thanks for the help. Tom so if I have $data = array($address...

paper on var bmp

where can I find a paper that explains var bmp for beginners, please? ...

Problems with replacing a static id with variable

I have a script that loads info from external XML file and inserts it into the HTML page on click. Here's the code of this script: var xmlhttp; function loadXMLDoc(url,target) { xmlhttp = null; if (window.XMLHttpRequest) { // code for all new browsers xmlhttp = new XMLHttpRequest(); } else if (window.ActiveXObject) { // code for I...

How do I properly split a PATH variable in PHP?

I want to split $path = getenv('PATH'); into its components. How do I determine the separator char in an os-dependent fashion? ...

Included variables not working in PHP

Alright, so this is something really basic, and I know that when someone tells me the answer I'm going to feel really silly, but I can't for the life of me figure out why the following code isn't working: index.php: <?php include('config.php'); //this works fine. variables in this file are reached correctly - $_MYSQL is defined there ?...

Reccomended thread layer to use for iPhone development?

I'm new to Objective C, and Mac development... It appears that I can use the Posix threads API in my app.. Is this the recommended way? Or is their some Apple API I should be using for mutexes, condition variables and threads instead? I should add that I'm developing for the iPhone. I'd like to add exactly what I'm trying to do. Basica...

Persisting sensitve data in asp.net, odd implementation

For reasons not in scope of this question I have implemented a .net project in an iframe which runs from a classic asp page. The classic asp site persisted a few sensitive values by hitting the db on each page. I have passed there variables as xml to the aspx page, now I need to make these values available on any page of this .net si...

how to store an approximate number? (number is too small to be measured)

Hello, I have a table representing standards of alloys. The standard is partly based on the chemical composition of the alloys. The composition is presented in percentages. The percentage is determined by a chemical composition test. Sample data. But sometimes, the lab cannot measure below a certain percentage. So they indicate that the...

PHP static variables in double quotes

Hi, How can I get PHP to evaluate a static variable in double quotes? I want to do something like this: log("self::$CLASS $METHOD entering"); I've tried all sorts of {} combos to get the variable value of self::$CLASS, but nothing has worked. I've currently settled with string concatenation but it is a pain to type: log(self::$CLA...

varchar or nvarchar

I am storing first name and last name with up to 30 characters each. Which is better varchar or nvarchar. I have read that nvarchar takes up twice as much space compared to varchar and that nvarchar is used for internationalization. So what do you suggest should I use: nvarchar or varchar ? Also please let me know about the performa...

Variables in Create Statement

I am trying to use some variables in a creation script for database setups. I am not exactly sure how to use them. Please explain how to properly format my code. Below is the code I try, and the error I get: SET @username = 'xxxx'; -- store number goes here SET @password = 'xxxxxx'; -- store password goes here CREATE TABLE IF NOT EXIST...

Jquery, xml and variables

I'm trying to use xml data to insert as a variable for an animation but am fairly clueless. What am I doing wrong and how far off am I? $(document).ready(function(){ $.ajax({ type: "GET", url: "data.xml", dataType: "xml", success: function(xml) { $(xml).find('mon').each(function(){ var top = $(t...

variables inside variables

Ok this might sound like a dumb question but bear with me. I am trying to make it so that when people go to example.php?id=1, example.php?id=2, example.php?id=3 etc they see different data called from an included file filling in the blanks. I have a variable called $offername and I want to display $offer1name, $offer2name, $offer3name...

How to deal with special characters in a string

I have a php script creating an encoded value, for example: m>^æ–S[J¯vÖ_ÕÚuÍÔ'´äœÈ‘ ®@M©t²#÷[Éå¹UçfU5T°äÙ“©”ˆÇVÝ] [’e™a«Ã°7#dÉJ> I then need to decode this in a vb.net application The problem is that value above can have any characters. And VB.net can't handle it: dim strCryptedString As String = 'm>^æ–S[J¯vÖ_ÕÚuÍÔ'´äœÈ‘ ®@M©t²#÷[É...