Hi!
In order to make function calls to our back-end php code we've implemented something called an ActionProxy like this:
function ActionProxy(action, input, callback){
$.post("ActionProxy.php?method="+action,
{ data: input},
function(data, textStatus, XMLHttpRequest){
//return data....
First of all, let me say that I've never used C# before, and I don't know about it much.
I was studying for my "Programming Languages" exam with Sebesta's "Concepts of Programming Languages 9th ed" book. After I read the following excerpt from "Scope declaration order (on 246th page)", I got a little bit puzzled:
"...For example, in...
So here I have two classes: Customer Order Class and Confirmation Class. I want to access the data stored in LastNameTextField (Customer Order Class) and set it as the text for UserLastNameLabel (Confirmation Class) after clicking a "Submit" button. For some reason however, the output displays nothing.
Snippet of my code:
package custo...
When i run this code alert 2 shows 6 different href links. alert 3 shows the last href 6 times. How do i make it use the same object (linkdom aka thelink) as alert 2.
NOTE: This is in a greasemonkey script
{
var linkdom = thelink;
alert('2' + linkdom.getAttribute("href"));
GM_xmlhttpRequest({
met...
How can I create global variables that are shared in C? If I put it in a header file, then the linker complains that the variables are already defined. Is the only way to declare the variable in one of my C files and to manually put in externs at the top of all the other C files that want to use it? That sounds not ideal.
...
Why is still C99 mixed declarations and code not used in open source C projects like the Linux kernel or GNOME?
I really like mixed declarations and code since it makes the code more readable and prevents hard to see bugs by restricting the scope of the variables to the narrowest possible. This is recommended by Google for C++.
For ex...
I am trying to make each number displayed clickable. "1" should alert() 80, "2" should produce 60, etc.
However, when the alert(adjust) is called, it only shows 0, not the correct numbers. However, if the commented out alert(adjust) is uncommented, it produces the correct number on page load, but not on clicking.
I was wondering why t...
All,
Consider the following code:
void func(void)
{
int a;
printf ("%d", a);
}
int main(int argc, char **argv)
{
int a = 3;
func();
printf("%d", a);
}
According to my understanding, the output should be:
<junk value><3>
Can anyone please confirm my understanding? My basic query is, does the compiler refer to t...
// myClass.h
@interface myClass : NSObject {
int variable1;
}
- (int) addOne: (int)variable1;
//myClass.m
- (int) addOne: (int)variable1{
variable1++;
}
My question is: will [myClass addOne:aNumber] add 1 to aNumber or will it add 1 to the value of the ivar variable1?
...
For a school assignment I have to find a solution to the following problem;
In this below code, the foo function in the global scope tries to access the private variables of a Box, which ofcourse doesn't work. I have to make the foo function work with one line of code at the place show code.
#include <iostream>
using namespace std;
c...
I'm rather new to Ruby, and so far, figuring out how to use "binding" objects is one of the biggest pain points for me. If I'm reading the documentation correctly, they're almost entirely opaque. To access the scope inside the binding object, you have to have a string of Ruby code and eval it using the binding.
Maybe I'm just a purist...
Hi All,
I always get confused between the static and dynamic scoping and hence need someone to examine my evaluation. Following is the example code:
int x = 1;
procedure P(i) {
int x = 1;
i++;
Q(i);
}
procedure Q(j) {
j = j + x;
}
P(x)
print x
In static scoping, we always look at the placement of the function/procedure to underst...
I'm trying to use raw Lua files for configuration purposes, but don't want the config files polluting the global namespace.
The problem I'm running into is that dofile always seems to execute in the real global environment, so external files just throw all their declarations into _G.
Here's an example main file, with comments indicat...
This wants me to dig deeper in Python sources, but since there are many people on SO that already done that, I would love to hear their pointers.
>>> import os
>>> def scope():
... print os
... import os
...
>>> scope()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 2, in scope
U...
Hi everybody,
Here's my code:
class Manual extends controller {
function Manual(){
parent::Controller();
$myVar = 'blablabla';
}
function doStuff(){
echo $myVar; // Doesn't work.
}
}
I've tried various methods to make it work, but I've can't get my head around it. What can I do?
Thanks
...
Hello, i've been thinking if something like this is possible.
// this creates a variable $test in the scope it was called from
function create_var() {}
class A {
function test()
{
create_var();
// now we have a local to var() method variable $test
echo $test;
}
}
So, the question is, can a function create_var() crea...
I've the following code in my app.
MyEventHandler handler = null; //Declare the handler
foreach (string pname in group)
{
handler = getHandler(pname); //Get the handler
if(handler == null)
{
throw new KeyNotFoundException("No user " + pname + " could be found");
}
//invoke the handler
handler.B...
<xsl:choose>
<xsl:when test="long convoluted expression">
<xsl:element name="Class">123</xsl:element>
<a lot more xsl:elements>
</xsl:when>
<xsl:when test="next very long expression">
<xml:element name="Class">124</xsl:element>
<a lot more xsl:elements>
</xsl:when>
<tens of more similar...
Hello
I've the following doubt. I've a page "MyPage" and i've declared few dictionary objects in the page class.
My doubt is
If i declare the dictionary as a private non-static object i'm not able to use it across the functions in that page class (the object is getting nulled)
But if i declare the dictionary to be static i'm able to ...
I have a question about best practices for Ruby variable scope using class_eval.
In the below code snippet, in the class_eval block, the local variables first and second are undefined.
def parent_method(opts={})
first = opts[:percent]
second = (10 * first).to_i
SecondClass.class_eval do
def second_method; return {:...