Hello,
I have this in my class
When the second function is called php errors with
wrong datatype and only variables can be past by reference.
I don't know what they mean by that
This code comes from php.net
If the same code is outside the class it executes fine
What am I doing wrong here, if I am working within a class?
$extensiesA...
I'm used to MSSQL's Query Analyzer. Needing to convert some SP's for a hobby project, I'm having trouble making the transition to the mysql query browser, particularly when it comes to using variables. I'm essentially trying to simulate a procedure before it's a procedure.
So in Query Analyzer i'd write something like this...
delca...
i like to make my database insert more dynamicly with functions.
Like this:
private void setValues() {
string test = "foo";
string test2 = "bar";
}
private void WriteToDB() {
dc dcOfMyDatabase = new dc();
DBTable myTable = DbTable() {
field1 = test; // values of other function
field2 = test2; // values o...
Variable is used in 1 task only, but the question is: can it be CALLED shared?
...
What is the difference between initializing a variable as global var or calling globals().update(var).
Thanks
...
How do I declare a generic variable in Scala without initializing it (or initializing to any value)?
def foo[T] {
var t: T = ???? // tried _, null
t
}
...
How do you know whether a variable has been set at a particular place in the code at runtime? This is not always obvious because (1) the variable could be conditionally set, and (2) the variable could be conditionally deleted. I'm looking for something like defined() in Perl or isset() in PHP.
if condition:
a = 42
# is a defined he...
I am new to Rails. I have following construction. Mainmenu in my project has many submenus. In defining @submenu is everything ok, but in finding @mainmenu not. The output is: Couldn't find Mainmenu without an ID
@submenu = Submenu.find(params[:submenu_id])
@mainmenu = Mainmenu.find(params[:id => @submenu.mainmenu_id])
How can i defin...
I'm trying to transform certain parts of an XML file to another XML file. The source file:
<CUSTOMERS>
<CUSTOMER>
<CUSTOMER_NUMBER>12345678</CUSTOMER_NUMBER>
<CUSTOMER_ADDRESS>
<CUSTOMER_ADDRESS_NAME>John Doe</CUSTOMER_ADDRESS_NAME>
<CUSTOMER_ADDRESS_STREET>Street 1</CUSTOMER_ADDRESS_STREET>
<CUSTOMER_ADDRESS...
The following modify method somehow modifies the whole @x array instead of just simply generating another element to be pushed later. How come?
def modify i, s
t = @x[-1]
t[i] = t[i] + s
t
end
@x = [ [10, 12] ]
@x << modify(0, 1)
puts @x
Edited
The following code have done the trick. Still I wonder if its possible to get rid o...
Here is:
declare
v_str1 varchar2(80);
begin
v_str1 := 'test';
print :v_str1;
end
When I run it using SQLDeveloper just in a sql worksheet I get this:
Bind Variable "v_str1" is NOT DECLARED
anonymous block completed
...
Hello,
my Python class has some variables that require work to calculate the first time they are called. Subsequent calls should just return the precomputed value.
I don't want to waste time doing this work unless they are actually needed by the user.
So is there a clean Pythonic way to implement this use case?
My initial thought was ...
This should work, so I'm really perplexed about why it's not working.
I'm checking to see if a user is logged in using a $session class method at the top of each admin page. However, I want to dynamically adjust the header file depending on whether a user is logged in, and on what role level that user has.
So I check $session->is_logge...
Hi,
I would like to store a variable to disk or registry so I can use it the next time I run the scheduled script? Preferably an one-liner or two...
Cheers,
Roy
...
I have a static method that creates an instance of the class and puts it in the static variable. I am wondering what the proper way of memory management is in this situation.
You can't put it in the dealloc-method, because although it can access the static variable any instance method that is created that get's released will also relea...
Problem description:
Hello !
My XMLHTTPRequest object, when ready, does a couple of things, as in, the responseText which i receive, is split up, and sent as a parameter to myFunction()
Now, i need to call myFunction() 'n' number of times, with substrings of the response text as parameters.
This Works:
myAjaxObj.onreadystatechange=fun...
Hi,
I am new to JQuery and maybe am missing the obvious, but how can I filter a table using the contains selector but have it look for multiple strings using an OR operator. In other words, I would like rows containing "Red" OR "Yellow" to be hidden.
So far I have this which works by hiding all rows except the given date:
$(function()...
I'm trying to come up with a way to effectively easily clean all POST and GET variables with a single function. Here's the function itself:
//clean the user's input
function cleanInput($value, $link = '')
{
//if the variable is an array, recurse into it
if(is_array($value))
{
//for each element in the array...
fore...
I'd like to create a decorator like below, but I can't seem to think of an implementation that works. I'm starting to think it's not possible, but thought I would ask you guys first.
I realize there's various other ways to create static variables in Python, but I find those ways ugly. I'd really like to use the below syntax, if possible...
if I write:
a = 0;
b = 0;
c = 0;
d = 0;
e = 0;
f = 0;
I think (maybe am wrong) that the CPU will go line by line for example:
CPU says:
let me assign a to 0
then let me assign b to 0
then let me assign c to 0
then let me assign d to 0
etc...
I was just wondering if there is a processor that can change variables simultaneously...?
...