global

Global Keyboard Hooks (C#)

Hey, I was wondering if anyone could help me setup a Global Keyboard Hook for my application. I want to set Hotkeys (Such as Ctrl+S) that can be used when not focused on the actual form. Anyone got an idea? ~Regards Luke ...

Using $.post within a javascript function, cannot assign value to a variable?

Hi, I'm trying to use $.post within a function, get the results, then return the function true or false based on the results of the $.post callback. However, the callback seems to occur, AFTER the return event of the parent function. Here's the current code the ret variable is always undefined but if I alert() it within the $.post callb...

How to mark a global as deprecated in Python?

I've seen decorators that let you mark a function a deprecated so that a warning is given whenever that function is used. I'd like to do the same thing but for a global variable, but I can't think of a way to detect global variable accesses. I know about the globals() function, and I could check its contents, but that would just tell me ...

Creating multiple instances of global statics in C++?

One of the libraries we are using for our product uses a singleton for access to it. I'm pretty sure it's implemented as a static instance (it isn't open source). This works well for a single document application, but our app may have more than one document loaded. I'm assuming access to the instance is written something like this: Inst...

Python module globals versus __init__ globals

Apologies, somewhat confused Python newbie question. Let's say I have a module called animals.py....... globvar = 1 class dog: def bark(self): print globvar class cat: def miaow(self): print globvar What is the difference between this and class dog: def __init__(self): global globvar def bark(self): ...

Exchange Server - Global Access

Hey everyone, I'm trying to create a web-based app that can interact with Exchange server globally. Meaning, I need it to have the ability to view, change, delete, and create all e-mails, calendars, appointments, tasks, notes, etc... across the domain. I am using .Net, and have been looking into sinks, but wasn't sure if this was the ...

Global variable problem

I load an image and add it to the MC someMC. If "something" is true, the someVariable gets the someMC scaleX number. Let's say its 0.82. What I need is to get that number into the s.value in my Slider object. Since I want the Slider value to be where my image scale is. This of course doesn't work because of variable scope limitations. ...

Implementing a global lock in Java

Hi, I have a relatively simple (perhaps stupid) question regarding synchronisation in Java. I have synchronisation blocks that acquire locks on various objects throughout my code. In some scenarios, I want to acquire a global lock that subsumes every other synchronisation statement in my code. Is there a fancy way to do this in Java w...

Hold global data for an ASP.net webpage

I am currently working on a large-scale website, that is very dynamic, and so needs to store a large volume of information in memory on a near-permanent basis (things like configuration settings for the checkout, or the tree used to implement the menu structure). This information is not session-specific, it is consistent for every threa...

Global flag to check if any component has been edited in Flex.

I need to use a global flag. This flag will be set whenever I change my datagrid i.e. add/ update rows, change checkboxes, radiobuttons, etc. in my screen. Also, on what event can this global variable be set. Will "change()" or "click()" work. Need some idea in this context. ...

How would I reference a global variable in my UIView ?

I have a UIView which is accessed by two different View Controllers. Whenever the user presses a button through the view controllers, I increment/decrement a shared variable like: -(void) viewWillAppear:(BOOL)animated { [[self appDelegate] sharedData].count++; } The shared variable gets created and initialized in the app delega...

Using JavaScript's replace() method with global switch on a variable

I can't any example of this after being unable to puzzle out how it would work on my own. All I want to do is take a string which has been assigned to a value, and use that as the replace match string for all matches. var replacement = 'i'; var text = 'tieiam'; text = text.replace(replacement, ''); // 'teiam' text = text.replace(/ti...

low level, global keyboard hook in wince

I'm trying to make a small tool will run in background & capture all key events. For instance it will do a job like: when user types 'uu' on any textbox it will turn 'uu' to 'aa' ...

Does the anonymous namespace enclose all namespaces?

In C++ you specify internal linkage by wrapping your class and function definitions inside an anonymous namespace. You can also explicitly instantiate templates, but to be standards conforming any explicit instantiations of the templates must occur in the same namespace. AFAICT this should compile, but GCC fails on it: namespace foo { ...

How to use a global selector to respond to all click events except on one element?

If I have a button: <button id="button1"> Normally I would write: $("#button1").click(function () { //do something } But I want to define a function that responds to all click events except when someone clicks on this button. Is there a selector that would allow me to target all other clickable elements in the document ex...

How to avoid using PHP global objects?

I'm currently creating blog system, which I hope to turn into a full CMS in the future. There are two classes/objects that would be useful to have global access to (the mysqli database connection and a custom class which checks whether a user is logged in). I am looking for a way to do this without using global objects, and if possible...

PHP - Is there a way to clear some session data from ALL sessions?

Hi, In general, I have the following scenario: - Fetch product and its related data from database - Convert fetched data to php 'product' object - cache product object in session The cache is readonly, i.e customers viewing products on the site. But there are calls like getProductIdsByCategory($categoryId) and the productIds from thes...

change global variables in c++

Hi, Is there a way to define a global variable by user input? Lets say I use #include... #define N 12 double array[N][N]; void main();... But I would like the user to be able to choose what N is. Do I have to have N as a local variable or is there a way around this(without macros)? I've a pretty small program but with a lot of diff...

Initialize Global Variables in PHP

Is it good practice to initialize a global variable in PHP? The snippet of code seems to work fine, but is it better to initialize (in a larger project, say for performance sake) the variable outside of a function, like in the second scratch of code? if(isset($_POST["Return"]))Validate(); function Validate(){ (!empty($_POST["From"])...

How Does Google Global Login Work?

Whenever I login to one Google service, I am automatically logged in all their other websites on different domains. What I want to know is how they are able to access the disparate cookies and sessions that belong on another domain. I tried searching online but I couldn't find any information. I could probably pull out firebug and tr...