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...
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.
...
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...
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...
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?
...
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 ?
...
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...
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?
...
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(...
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,...
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...
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)
...
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...
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...
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...
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
$_...
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...
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
...
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();
?>
...
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...