So I have multiple forms for my current project and I have made classes that interact and do some utility work behind these forms.
However I am unable to access controls on other forms.
Say I have a text control on Form A and I want to use a class that receives/manipulates data from a completely different Form B.
My classes and Form ...
I want to be able to return all of the parameters that are being passed into a specific page using PHP.
$_SERVER['QUERY_STRING'];
Seems to perform this task adequately, however I have heard many warn against the use of $_SERVER variables due to their sometimes inconsistent nature. So I was wondering if there are any best practice gui...
It's really embarrassing but i stuck on it for two hours of trial and error.
I declared an NSString in the interface as:
NSString *testString;
Then i made a property and synthesized it. I allocate it in viewDidLoad with:
testString = [[NSString alloc] initWithFormat:@"thats my value: %i", row];
If i want to get the value of the st...
I'm working on a Windows game, and I have this:
bool game_cont;
LRESULT WINAPI WinProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
{
case WM_QUIT: case WM_CLOSE: case WM_DESTROY: game_cont = false; break;
}
return DefWindowProc(hWnd, msg, wParam, lParam);
}
int WINAPI WinMain(/*lots of paramete...
Hi! Until some time ago, I thought a .a static library was just a collection of .o object files, just archiving them and not making them handled differently. But linking with a .o object and linking with a .a static library containing this .o object are apparently not the same. And I don't understand why...
Let's consider the following ...
How do I declare global variables in Visual C#?
...
I have a set of jQuery plugins I'm creating for a website.
All of these plugin have the common functionality that they make $.getJSON() calls.
The URL passed in these calls varies based on Dev, QA and production environments.
I would like to store the URL in a central place so it can be easily changed.
Where should the URL be stored?...
Is there a way to create a global variable in SQL Server so it's saved even the server is shut down, so I can use it in functions?
Example from what I need:
DECLARE @@DefaultValue bit
This variable should never be deleted unless I explicityl do so.
...
We all know that global variables are anything but best practice. But there are several instances when it is difficult to code without them. What techniques do you use to avoid the use of global variables?
For example, given the following scenario, how would you not use a global variable?
Javascript:
var uploadCount = 0;
window.onl...
Hi there,
I am currently working on a php framework, which is in some cases structured like the ZendFramework.
It has MVC etc.
I did not found any equal matching to my problem.
My "problem" is I have a variable number of classes (models, controller), e.g.
http_handler.
Now I have that much classes I can not set them all manualy into va...
I have a set of static class methods. I also have an existing database connection in a script stored in an object variable $DB. How do I call those static class methods and let them use that $DB object without having to pass them this variable every time as a parameter on the class method?
For instance, right now I'm having to use a glo...
Hey everyone, some background info:
In the config file for my website, I set the mysql database name, username and password based on the contents of $_SERVER['HTTP_HOST']. Because it is possible for this variable to not be set in the case of old (HTTP 1.0) requests and cron jobs, I include a file that spoofs the $_SERVER['HTTP_HOST'] va...
The task is to create dynamically linked library, which encapsulates database hard work. Due to some design limitations I have a defined interface, which consist of numerous functions. Each function takes a parameters and use them in database query. Database connection should be inside dll and application don't want to bother is there a...
Problem: Our web console shows a list of all computers on which our application is installed. Each machine has some identification information that can be associated with it. Simple strings like department name, team name etc. We need to make it such that the user can change the name of these identification fields and add/remove as many ...
Background
The application I am working with has several COM DLLs.
One of the COM DLLs has a global singleton object, which stores pointers to COM interfaces in other DLLs. Because it is a global singleton object, I have employed the lazy initialization idiom because it is possible that the interface I am trying to get a pointer to ex...
I'm reading The C Book to try and get a better foundation in C. While I think I'm generally getting the concept of pointers, one thing sticks out to me is that it seems like it's generalizing whatever it's pointing to into a global variable (e.g. the ability to use pointers to return values from void functions), which naturally carries...
Is there a way to make all variables global?
...
I have a package:
CREATE PACKAGE my_pkg
IS
g_var NUMBER;
END;
/
Is there any way I can query SYS views, to find that this package has this global variable? I'm interested in explicit variable name and data type.
P.S.
Parsing user_source does not count.
Edit: I would like to do that without introducing getter/setter functions.
...
How can I create global variable keep remain values around the life cycle of the application regardless which activity running..
...
I'm having a bit of trouble capturing the value of a global variable in my $.get() callback:
Relevant markup
<div class="block" id="blog"></div>
<div class="block" id="music"></div>
<div class="block" id="video"></div>
Relevant code
$('div.block').each(function() {
$this_id = $(this).attr('id');
alert($this_id); // outputs: blog...