global

Make all variables global, PHP

Is there a way to make all variables global? ...

VB.NET - Imports namespace from other projects in Solutions

In my Solutions in Visual Studio, I have 3 projects. - Common (Root namespace: PodcastPlayer.Common) -PodcastPlayer (Root namespace: PodcastPlayer) This is the Silverlight project. -PodcastPlayer.Web (Root namespace: PodcastPlayer.Web) In Common, I have several classes and service references. But my problem is that I can`t not use Podca...

Static variable

In C language, I want to access a global static variable outside the scope of the file . Let me know the best possible way to do it. One of the methods is to assign an extern global variable the value of static variable, In file a.c static int val=10; globalvar =val; In file b.c extern globalvar ; But in this case any changes in val...

"Global variable" in Visual C#

I have made the Graph class, and i want to simulate a distribution network. The Graph works 100%. But, i want to use that same struct/class in all my application! For example: I have Form1 that shows the simulation, but i want to insert Nodes (for example) but i want to do it in Form2! Since the data is always in the same class, i could...

Global Mouse Hook + Simulate Mouse Inputs

I'm looking to create a global mouse hook that works in XP/Vista/7 which would allow me to access the X,Y values that the mouse is inputting, and modify those values before they hit Windows... I also want to be able to simulate mouse inputs in between actual mouse inputs... For example, lets say our inputs looked like this: 1: 1,0 2: ...

asp.net global resources problem

Hello. I have a weird problem with global resources in my asp.net mvc web application. I have some resources in separate project(not a web app project). Those resources have following settings: Build action: Embedded Resource, Copy To Output Directory: Do not copy, Custom Tool: ResXFileCodeGenerator. When I change an existing value i...

[ASP.NET] Application variables global to Webgarden

Hello, I am currently trying to program an online drawing program using the HTML5 canvas. The thing is, I need to have the current canvas saved somewhere globally. Static variables work, but they do not get shared across a Webgarden. This results in two different drawings being created. I will have to somehow create a new application...

PHP -What's the difference between global variables and constants

According to many sources, register_globals (global variables that is) should be disables in your php.ini. Should I write define() in my code and use constants if global variables are disabled? Are those even related? ...

How to use Global Hook

Hi! I tried using global hook, and when I typed in using gma.System.Windows; it did not recognize gma? What do I need to do? ...

Cannot change global variables in a function through an exec() statement?

Why can I not change global variables from inside a function, using exec()? It works fine when the assignment statement is outside of exec(). Here is an example of my problem: >>> myvar = 'test' >>> def myfunc(): ... global myvar ... exec('myvar = "changed!"') ... print(myvar) ... >>> myfunc() test >>> print(myvar) test ...

How to check a chackbox without window focus.

Hi! I just wanted to know, what would be the c# coding to check a checkbox (named cBox) even when the window does not have focus? I need the exact coding and what the using directives would be. Thank you for all who helped! I'm sorry to those of you who feel like I am just asking too much. I am brand new, and I had tried using Global...

Global hotkey poller via python for Mac OS X

I use this for Linux. And pyhook on windows. But I don't know what to use to register if a key is pressed (global - non-focused) on Mac OSX. How can one do this? I'm mostly looking at registering the modifier keys (ctrl/alt/shift etc.). ...

In javascript, is accessing 'window.Math' slower or faster than accessing the 'Math' object without the 'window.'?

I'm kind of curious about what the best practice is when referencing the 'global' namespace in javascript, which is merely a shortcut to the window object (or vice versia depending on how you look at it). I want to know if: var answer = Math.floor(value); is better or worse than: var answer = window.Math.floor(value); Is one bette...

Making a module global?

I would like to know why >>> def func2(): ... global time ... import time ... >>> time Traceback (most recent call last): File "<stdin>", line 1, in <module> NameError: name 'time' is not defined >>> func2() >>> time <module 'time' (built-in)> >>> works, but >>> def func(): ... global module ... module="time" .....

php - extract array into global variables

The manual on "extract" shows you can extract an array like: extract(array('one'=>1,'two'=>2)); into $one,$two... But the extract function doesn't return the variables. Is there a way to 'globalize' these variables? Maybe not using extract, but a foreach loop? EDIT: (explanation about what I'm trying to achieve) I have an array co...

Set a global menu on an Android application

Duplicate: static options menu Hi everyone, I know how to create a menu in my application with an icon and text on each "button" of the menu, but this menu is only visible on the activity where I created it... I would like to know if it is possible to create a global menu which would be accessible from all activities? thank you ...

Python vars() global name error

Hi there, I'm having a bit of trouble understanding what's going wrong with the following function: def ness(): pie='yum' vars()[pie]=4 print vars()[pie] print yum So When I run that I get this result: >>> ness() 4 Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<stdin>", line 5, in ness NameErro...

How do I define a friend class from the global namespace in another namespace?

In a previous Q&A (How do I define friends in global namespace within another C++ namespace?), the solution was given for making a friend function definition within a namespace that refers to a function in the global namespace. I have the same question for classes. class CBaseSD; namespace cb { class CBase { friend class ::CBaseSD...

global php class in functions?

Hi, is there a way to access one instance of a class inside functions in php? like this: include("class.php"); $bla=new Classname(); function aaa(){ $bla->DoSomething(); //Doesnt Work } $bla->DoSomething(); //works. thanks! ...

PHP global include?

I have a seperate PHP file I include that has a several important functions on it. I also have a file called variables.php which I include into each function so I can call some important variables too. Is there a way to just call variables.php at the top of the page, instead of inside each function manually? I just thought it would be ea...