global

ASP.Net Persisting Data Across the Application

How Can I persist a User-Specific data for an ASP.Net application. I tried Session Variable - Not good when the worker process recycles. I need something that can be accessed GLOBALLY by any class of my application. Advice most welcome. I tried to utilize asp.net session State Server but I got some DLLs crashing because they are Unse...

How do I 'globally' catch exceptions thrown in object instances.

I am currently writing a winforms application (C#). I am making use of the Enterprise Library Exception Handling Block, following a fairly standard approach from what I can see. IE : In the Main method of Program.cs I have wired up event handler to Application.ThreadException event etc. This approach works well and handles the applicat...

SAS Macro GLOBAL scope

is there a short way to make ALL macro variables created inside a macro global in scope? ie: %macro x; %global _all_; * ??? ; %let x=1; %let y=1; %let z=1; %mend; ...

Isn't the Factory pattern the same thing as global state?

Let's say I have a class like this: class MonkeyFish { MonkeyFish( GlobalObjectA private: GlobalObjectA GlobalObjectB GlobalObjectC } Without a factory, I need to do the following in order to instantiated a MonkeyFish. GlobalObjectA a; GlobalObjectB b; GlobalObjectC c; int main() { MonkeyFish * monkey_f...

.NET MVC - Global Settings Class - which of these methods is best:

OK so im trying to create a settings class to store certain strings that i need to access throughout the system. I have created a globalSettings.cs with the code below: public class GlobalSettings { private readonly Hashtable myHT; public GlobalSettings() { //Hashtable used to store global strings myHT = new...

Global Keyboard Hook in Linux?

How to write global keyboard hook in Ubuntu (Linux) (like Hook for Windows) In C/C++ or Python ...

Why gcc gives error of unused variable for local variables but not for global variables?

Hello, I have a question regarding gcc. Why I get an error of unused variable when I define the variable locally in a function but not when the variable is global in a unique file?. I can understand that it can be use for someone else, but to do that then I need to put the external word right? Thanks in advance. ...

ASP.NET C# Application_Error in Global.asax cannot access Session variables.

I have my error handling setup to track all exceptions and write the information we need to a database and email out the developers who need to know about the error in order to fix it. The problem I run into is when the error occurs before the page has fully loaded. In this case the session variables I want to track are not available in ...

Many objects with global and local state

I'm looking for the best Design for the following situation. We have many objects form one class, for instance a picture frame. Now each of the picture frames can display 3 types of picture. 1) a face 2) a screenshot 3) empty Thats easy: public enum PictureMode { Face, Screen, None } public class PictureFrame { priva...

Propagating application settings

Probably a very common question, but couldn't find suitable answer yet.. I have a (Python w/ C++ modules) application that makes heavy use of an SQLite database and its path gets supplied by user on application start-up. Every time some part of application needs access to database, I plan to acquire a new session and discard it when ...

How can I recursively use the Global in VIM?

Is something wrong in ":g-2-g/3/" or is the recursion in the global just missing? I can not understand a reason for the error: E147: Cannot do :global recursive How can I get a recursive global search in VIM? [Neil's initial Suggestion with the operator \| ] g/1.*2\|2.*1/ A disadvantage is that the combinations expand with n nu...

Where to put global application data in Vista?

Where in a Windows (Vista) system should I place data that ought to be readable and writable by everyone, i.e. every user of the computer? Vista's concepts of C:\Users\xxx\AppData\something, C:\Program Files and C:\ProgramData directories and UAC are a bit confusing. Furthermore, is there any ready solution to determine those locations ...

PHP: "Global" Include

Current situation: I have the current version of my MVC Framework which uses classes as controllers. I have some "vintage" modules from my old MVC Framework which uses simple, flat includes as controllers. Much simplified that means: New Version: <?PHP class blaController extends baseController { private $intVar; function ...

Static Variable problem On JQuery

if(i==0){ $(document).ready(function(){ $("div#rozet").hover(function(){ $(this).hide("fast"); $(this).animate( { top:'+45px', left:'+500px'}, {duration: 1} ); $(this).show("slow"); $(this).stopall(); }); i=1; } if(i==1){ $("div#rozet")....

C++ Random Seed, Global Objects, and SDL_Threads

In my program, I have an object the global cpp file, that takes an integer as an argument. //In global header extern Object example; //In global cpp file Object example( (rand() % 6) ); I want a random number to be generated to the object's argument, but the seed does not reach the global variable, as the seed created in another cpp ...

php global variable modifier not working

I'm using the basic php example for the global modifier, and it doesn't work for me :-| $a = 1; $b = 2; function Sum() { global $a, $b; $b = $a + $b; } Sum(); echo "***: ".$b; Here is the result... $ ***: 2 Is there any parameter on the php.ini that might effect this? ...

(C++ Query) Accessing the instantiated objects globally

This is a basic program to get two 5-digit numbers as string and use addition on the 2 numbers utilising operator overloading on '+' . #include <iostream> #include <limits> #include <cstdlib> #include <cstring> #include <sstream> using namespace std; class IntStr { int InputNum; public: //IntStr(); IntStr::IntStr(int ...

Why is it bad to make elements global variables in Javascript?

I've heard that it's no good idea to make elements global in JS. I didn't understand why. Is it something IE can't handle? For example: div = getElementById('topbar'); ...

Singleton, Logging and Global Settings - Good or Bad implementation?

I've got a logging class which requires need to be called from almost everywhere in the application. However it requires setup in the beginning of the application with "which path to write", "log level" and if it's "enabled" or not. I don't want to give this parameters every time or pass Logging class as parameter to every single objec...

Is there a function that returns the character/string at a point in a .txt? (C++)

I know its possible to get a part of a .txt, then convert it to an integer, then store it in a variable, but is it possible to to that in a single declaration. (The variable needs to be global). Ie: [data.txt] 1020 [convert_data.cpp] #include<fstream> fstream convert("data.txt"); //way to declare something equal to A PARTICULAR POINT i...