variables

Sharing var from one function to the other function in PHP Class

Well, I am not good at scripting, and I am kinda Photoshop guy. I am also new at PHP, so please bear with me. I am currently creating web form generation class which needs to be reusable and flexible for localization. What I hope to ask at here is: How I can pass var from one function($avInq->textFeild) to the other function($avInq->J...

Best way convert text with '&' into the variables

I've got a this text "?foo=bar&foobar=barfoo" what is the best way to convert this text to variable? Like this: <?php echo $q['foo']; //bar echo $q['foobar']; //barfoo ?> Thanks. Sorry for my English. ...

reading bytes in a file in vb.net

After getting the file name I create a new filestream and load all the bytes from the FileStream into a byte array, now I need to get certain bytes and store them in fields like the second 4 bytes are the time the file was created. When storing these in the variables should I store them as bytes or as string/integers/etc. Or have I done...

Variable argument lists in C functions - How to properly iterate through the arg list?

In the following C program i get the warning: warning #2030: '=' used in a conditional expression. What exactly is the problem and how do i avoid this? What is the correct way to iterate through the variable arguments? #include <stdio.h> #include <stdarg.h> int Sum(int a, int b, ...) { int arg; int Sum = a + b; va_list...

storing hexadecimal in a variable (Dim xx as "Hex") in vb.net

As the title says how can I store a hexadecimal number in a variable without it becoming a decimal. Or do I have to store it as either a string or integer? ...

PHP Switching between two variables equally without using database

i need to switch between two variables so i am able to serve two variables equally for example i have $ad1 $ad2 i want to serve both ads equally using a light method with no database using random method won't serve both equally can you please guide me how to achieve this ? ...

SELF keyword in Objective-C

In a project I'm creating, I have various classes. One of my classes has an instance of NSMutableArray that holds objects of another one of my classes. I thought I had a firm understanding on this topic, but somehow it got jumbled up in my mind again. When initializing an instance of this class, I have this initilize method: - (MMShowM...

variable/property changed event in vb.net

How can I make an event that is raised when a variable or property is changed (or can I just put the code I would put in an event in the Set section of a property? ...

Pass a php variable to mysql query

Hai guys, What is wrong in this code i get an empty array. i am passing a php variable to the query it didnt work, when i give a hardcoded value the query returns result. echo $sub1 = $examSubject[$i]; $subType = $examType[$i]; $query = $this->db->query("select dSubject_id from tbl_subject_details where dSubjectCode='$sub1'"); print_r(...

How to create dynamical scoped variables in Python?

Hello, I am translating some code from lisp to Python. In lisp, you can have a let construct with the variables introduced declared as special and thus having dynamic scope. (See http://en.wikipedia.org/wiki/Dynamic_scope#Dynamic_scoping) How can I do likewise in Python? It seems the language does not support this directly, if true,...

How can I escape meta-characters when I interpolate a variable in Perl's match operator?

Suppose I have a file containing lines I'm trying to match against: foo quux bar In my code, I have another array: foo baz quux Let's say we iterate through the file, calling each element $word, and the internal list we are checking against, @arr. if( grep {$_ =~ m/^$word$/i} @arr) This works correctly, but in the somewhat possi...

PHP function to return a reference a variable

I'm trying to write a function that will return a reference to a PDO object. The reason for wanting a reference is if, for some reason, the PDO object gets called twice in one page load, it will just return the same object rather than initializing a new one. This isn't silly, is it? :/ function &getPDO() { var $pdo; if (!$pdo) ...

Property Scope (Iphone)

Hello All. I am having trouble accessing a declared property and I think I am missing something fundamental about the nature of properties and perhaps view controllers. Here's what I'm doing so far: declaring a property "myPhone" in a root view controller called RootViewController. grabbing a phone number from a modally presented peo...

How to manipulate parameter according to other parameter in a php function?

I have id names with the second part of table name plus id. For example admins_id in omc_admins table, customers_id in omc_customers table, products_id in omc_products table, categories_id in omc_categories table etc. Now the following function code is supposed to find orphans. For example, when I delete categories, it will ch...

Release static int variable

Hello, How to "clean" static int variables in a view class method? Every time a get back to this view I need those vars "zeroed". The [self.view removeFromSuperview]; instruction does not seem enough to free up memory from those vars. Thank you. Have a great 2010! These int vars are declared static in a view method. They are not globa...

PHP Storing Sessions: Can't Seem to Serialize Session Variables

Hello all, I am making use of seralize and unseralize to set and get session variables from my Database. A user is in a session and every time they click save. I do this: $array = serialize($_SESSION); //and save to DB field When a user loads a session, I load the variables too to continue that session like so: //get row from DB $_...

Python: why aren't variables updating?

A python program that I'm debugging has the following code (including print statements for debugging): print "BEFORE..." print "oup[\"0\"] = " + str(oup["0"]) print "oup[\"2008\"] = " + str(oup["2008"]) print "oup[\"2009\"] = " + str(oup["2009"]) oup0 = oup["0"] oup2008 = oup["2008"] oup2009 = oup["2009"] ouptotal = oup2008 + oup2009 p...

Objective-C: testing for an unassigned (undefined) variable?

If I've created these two variables: NSDecimalNumber *myNum; NSString *myString; how do I later test whether an object has been assigned to them yet or not? Thanks ...

Create and include a variable in SimplePie (PHP)

Within the code below, how do I set VAR as some variable and then include it within the SimplePie code as the feed URL? The "feed" code is from the Simplepie PHP libary. <?php $VAR = "http://website.com/feed/"; $feed1 = new SimplePie(); $feed1->set_feed_url('$VAR'); $feed1->init(); ?> ...

Notice: Undefined index: XXX - Does it really matter?

Hello. Since i changed my error reporting level to error_reporting(E_ALL | E_STRICT); I am facing this error. I can obviate from this error using isset() but the code looks so ugly! So my question is: What if I go back to my normal settings of error reporting? does it really matter to know that something is not already defined? becau...