Hello,
I've written two python scripts script1.py and script2.py. I want to run script1.py from script2.py and get the content of the variables of script1 created during the execution of script1. Script1 has several functions in which the variables are created including in the main.
rgds,
Bruno
Thank you for all your answers. I've...
Hi,
$str='input_arr["username"]';
$input_arr=array();
$$str='abcd';
print_r($input_arr);
When I run the above code it only prints Array().
I expected it to print Array([username]=>'abcd')
What am I doing wrong?
This is in php 4 by the way.
Thanks a lot.
Edit:What am I trying to do?
$input_arr is supposed to be a static variabl...
file name myServices.php
<?php
$gender = 'MALE';
?>
in another file lets say file.php
include "myServices.php"
$name = 'SAM';
$age = '23';
?>
<!--after some more HTML code-->
<?php
$gender = 'FEMALE';
$name = 'ELENA';
//Question:
//In the above statements are there new variables crea...
Using targetCurrent -- I am able to get the name of the MovieClip a user clicks on.
On function toggleClick
there is a trace statement that says:
trace("movieClip Instance Name = " + e.currentTarget);
OUTPUT Window:
movieClip Instance Name = [object Comp]
Based on what a user clicks on -- there will be a value associated to the Mo...
Hi,
Whenever I use a variable name that stands for a primary key as
int pk_MyObject = GetPrimaryKey(myObject)
ReSharper complains about the pk_MyObject and offers me to rename it pkMyObject.
How can I add a new rule to ReSharper so that it does not complain about variable names such as xx_YYYYY ?
...
I have a script i am writing. it parses through a list of scanned (barcoded) items and pulls data about the items. It also needs to count how many times each item was scanned. The part number is called $partselect. Ideally, I would like to store them in an array called $count with the format of $count[$part] = (number of times it's been ...
I have multiple toggle buttons on my flash stage. These toggle buttons are MovieClips. If a user clicks on one of the MovieClips, I want to be able to find a way to go through the Object below--get the appropriate value based on what the User clicked--and store that value in a new value called var powerData which will then be passed to a...
I know that I should encodeURI any url passed to anything else, because I read this:
http://www.digitalbart.com/jquery-and-urlencode/
I want to share the current time of the current track I am listening to.
So I installed the excellent yoururls shortener.
And I have a bit of code that puts all the bits together, and makes the following:...
I'm having difficulty trying to figure this out. I'm not even sure if it's possible.. I will appreciate any sort of help!!
On site A, I have a link (an affiliate type link) that redirects to site B. When clicking the link on site A, I use this script to redirect..
header('HTTP/1.1 301 Moved Permanently');
header('Location: ' . $url);
...
This is tricky..
I have two sites. Site A and site B. On another site (any site) I post an affiliate link which takes you to site A where I have a script that redirects to site B (so the first link goes to site B after going through site A)
On site A, I have a variable which I'm trying to pass to site B but without putting it in the br...
//get var of posted info so user does not
//have to reinsert if if validation = false
if(!isset($_POST['FactionChanges'])){ $faction_name = ''; }
else { $faction_name = "".$_POST['factionname'].""; }
//without form submit, num_errors = 0
if(!isset($_POST['FactionChanges'])){ $num_errors = 0; }
//without form submit, success = 0
if(!isse...
When I create variable I just put the a name for it, but can I create the name of the variable like this:
int var+1= 1;
So basically that should be:
int var1=1;
I know I can't use the + sign to do that but is there way to do it?
EDIT
int g=1;
string hello+g = "sdljfsdl"; // So hello+g will be hello1
So it is like mixing variabl...
My question(s) is one of best practices for OOP. Im using Codeigniter framework/PHP.
I have a class:
class Test() {
var $my_data = array();
function my_function() {
//do something
}
}
Is it ok to declare $my_data in the class like that? or should it go in the constructor? Basically every function will be writ...
Hello,
i have this little problem, i use the Application settings in VS 2010 to configure a path. now it would be convenient if i could add a variable there (its an argument) so it looks like this: C:\EXAMPLEDIR\... is there any way todo this?
Or should i change the settings at startup in code? is this even possible (i would like to avo...
This really is my last resort as I am absolutely stumped and I just know it is something stupid!
I have a UITableView and a UISearchBar, the user uses the search bar to enter a location, which is then appended to a url with page=1. This is then sent to an api and a list of adverts are returned (this has been successful). The user can th...
I have declared a char variable ope in function main.
i took the input through getchar function and stored in ope.
Now i want to blank the variable so i will be able to store some other in ope.
Can anybody show me how to do it??
I just want to continuously store the input in ope variable. If it's possible through some other way, kindly g...
I have the following piece of latex code:
\def\a{1}
\def\b{2}
\def\c{\a+\b}
\def\d{\c/2}
I expected \d to have the value 1.5. But it did not. However, adding parenthesis to the definition of \c like
\def\c{\a+\b}
Doesn't work either, because if I use \c somewhere, it complains about the parenthesis. Is there a way to evaluate \c ...
I have two preexisting variables:
$side (which is either F or B)
and
$plate (which is a 3 digit number)
I am trying to build two arrays called
$sidecountF
and
$sidecountB
using the following code:
$sidecount{$side}[$plate] = 1;
assuming $side is F and $plate is 200, I'm hoping that the end result is that
$sidecountF[200] = 1;
...
Easy points. Quick search didn't tell me what I wanted.
I want something like
DECLARE myVariable nvarchar[MAX] = "hello world".
Bonus points if you show me how to encode a quote in the string.
eg.
I want the string to read
John said to Emily "Hey there Emily"
my attempt would be
DECLARE myVariable nvarchar[MAX] = "John said to ...
I'm a python newbie and I don't understand why it won't read my IP and ADDR variables in the function dns.zone.query(IP, ADDR)???
import dns.query
import dns.zone
import sys
IP = sys.stdin.readline()
ADDR = sys.stdin.readline()
z = dns.zone.from_xfr(dns.query.xfr(IP , ADDR))
names = z.nodes.keys()
names.sort()
for n in names:
pri...