Search Results

Search found 11735 results on 470 pages for 'global variables'.

Page 3/470 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • global.asax and ASP.NET MVC solution Organization

    - by nachid
    I am refering to this article from Jimmy Bogard He is suggesting two projects to organize your ASP.NET MVC solution. Basically, one project for the code and another for the rendering My concern is about global.asax file. Jimmy suggested separating global.asax from global.asax.cs and put them in two differents projects When I did this, I could not compile my solution. I got this error : Could not load type 'MyProject.Web.Global'. Can someone help and show me how to solve this? Thanks

    Read the article

  • POD global object initialization

    - by paercebal
    I've got bitten today by a bug. The following source can be copy/pasted (and then compiled) into a main.cpp file #include <iostream> // The point of SomeGlobalObject is for its // constructor to be launched before the main // ... struct SomeGlobalObject { SomeGlobalObject() ; } ; // ... // Which explains the global object SomeGlobalObject oSomeGlobalObject ; // A POD... I was hoping it would be constructed at // compile time when using an argument list struct MyPod { short m_short ; const char * const m_string ; } ; // declaration/Initialization of a MyPod array MyPod myArrayOfPod[] = { { 1, "Hello" }, { 2, "World" }, { 3, " !" } } ; // declaration/Initialization of an array of array of void * void * myArrayOfVoid[][2] = { { (void *)1, "Hello" }, { (void *)2, "World" }, { (void *)3, " !" } } ; // constructor of the global object... Launched BEFORE main SomeGlobalObject::SomeGlobalObject() { std::cout << "myArrayOfPod[0].m_short : " << myArrayOfPod[0].m_short << std::endl ; std::cout << "myArrayOfVoid[0][0] : " << myArrayOfVoid[0][0] << std::endl ; } // main... What else ? int main(int argc, char* argv[]) { return 0 ; } MyPod being a POD, I believed there would be no constructors. Only initialization at compile time. Thus, the global object SomeGlobalObject would have no problem to use the global array of PODs upon its construction. The problem is that in real life, nothing is so simple. On Visual C++ 2008 (I did not test on other compilers), upon execution myArrayOfPodis not initialized, even ifmyArrayOfVoid` is initialized. So my questions is: Are C++ compilers not supposed to initialize global PODs (including POD structures) at compilation time ? Note that I know global variable are evil, and I know that one can't be sure of the order of creation of global variables declared in different compilation units. The problem here is really the POD C-like initialization which seems to call a constructor (the default, compiler-generated one?). And to make everyone happy: This is on debug. On release, the global array of PODs is correctly initialized.

    Read the article

  • How do you use environment variables, such as %CommonProgramFiles%, in the PATH and have them recogn

    - by Brad Knowles
    I'm trying to add C:\Program Files\Common Files\xxx\xxx to the system PATH environment variable by appending %CommonProgramFiles%\xxx\xxx to the existing path. After rebooting, I open a command prompt and check the PATH. It expands correctly. However, when using Process Explorer from Sysinternals to view the Environment variables on services.exe, it shows the unexpanded version. Coincidentally, the paths using %SystemRoot% expand and are recognized just fine. I've tried altering the PATH through the Environment Variables window from System Properties and through direct Registry manipulation, neither seems to work. Is it possible to use other environment variables, besides %SystemRoot% in PATH and have services.exe understand it?

    Read the article

  • "service"-command and environment variables

    - by varesa
    I am trying to start a service that requires a env. variable to be set to certain path. I set this variable in "/etc/profile.d/". However when I start this service using the service command, it doesn't work. man service: service runs a System V init script in as predictable environment as possible, removing most environment variables and with current working directory set to /. So it seems that service is removing my variables. How should I set the variables up to keep them from being removed. Or is that something i should not do. I could start the service manually using the init-scripts, or even hardcode the path into the script, but I'd like to know how to use it with the service command.

    Read the article

  • How to make route-commands execute in the global application scope rather than locally in a page or

    - by Shimmy
    Hello! I created a window that contains a frame, and above the frame it contains a button that its Command property is set to "Refresh". In the page shown in the frame, I set a CommandBinding for Refresh. I want that when the 'Refresh' command is executed it should be caught by the page Refresh_Executed event-handler set in the CommandBinding. In other words, Is there a way to set global Commands that are targeted for the entire application scope and execute everywhere they're bound?

    Read the article

  • perl: Run remote perl script through SSH and query environment variables on remote machine

    - by kakyo
    I'm running a perl script through SSH, in the perl script I query environment variables using $ENV{MY_VAR_NAME} and it works fine when run locally. But through SSH, all environment variables become unset. I also tried to run system("source ~/.bash_profile"); at the beginning of my script to no avail. Any tips? EDIT: Rephrasing my question. I have machine A and B. I ran my perl on machine B, trying to get the environment variables on B and it worked. Then I ssh from A to B running the same script, i.e., using this code ssh user@B perl myscript.pl This time the environment variables on B are all blank. Any tips? UPDATE: I found that running the above script, ~/.bashrc on Machine B was invoked, but after setting environment variables in ~/.bashrc, run the above command again and still I don't see any environment variables. Also, if my perl script contains only echo $ENV{PATH} Then I get /usr/bin:/bin:/usr/sbin:/sbin

    Read the article

  • [Doxygen] How to documenting global dependencies for functions?

    - by Thomas Matthews
    I've got some C code from a 3rd party vendor (for an embedded platform) that uses global variables (for speed & space optimizations). I'm documenting the code, converting to Doxygen format. How do I put a note in the function documentation that the function requires on global variables and functions? Doxygen has special commands for annotating parameters and return values as describe here: Doxygen Special Commands. I did not see any commands for global variables. Example C code: extern unsigned char data_buffer[]; //!< Global variable. /*! Returns the next available data byte. * \return Next data byte. */ unsigned char Get_Byte(void) { static unsigned int index = 0; return data_buffer[index++]; //!< Uses global variable. } In the above code, I would like to add Doxygen comments that the function depends on the global variable data_buffer.

    Read the article

  • Alternative ways of setting environment variables through PuTTy?

    - by A T
    Connecting via SSH to a SPARC server but am unable to set environmental variables through the usual PuTTy way, which gives me this error: Server refused to set environment variables I also noticed that export and set techniques don't work from the prompt; the only which works is: $ PATH=/everyones_passwords_in_plain_text/:$PATH How do I automatically run that line on every connect to this server?

    Read the article

  • APPDATA and LOCALAPPDATA environment variables are not set on a profile in Windows 7 Pro 32bit

    - by Timur Fanshteyn
    I am having problem with a user account on a Windows 7 machine (local install, admin user account) APPDATA and LOCALAPPDATA environment are not set. Another user on the same machine, (also a local account, but without admin rights) has the variables set. This started to happen recently, however, I can not figure out if there was something installed on the machine to cause this. This is creating issues with applications that are trying to expand the variables to store local files. Thank you for the help.

    Read the article

  • How to set environment variables for Xfce windowing environment

    - by GreenMatt
    We're using Ubuntu 12.04.1 with Xfce 4.8. We have a script which sets environment variables needed by our software. In the past, I figured out how to run this script in the Xfce start up so that these environment variables are set up and available to gui based programs launched via icons. Recently an OS upgrade wiped out this setting and I can't remember or find how to do this. I've tried sourcing the script from ~/.profile, ~/.xinitrc, and ~/.config/xfce4/xinitrc, but no luck.

    Read the article

  • APPPATH and LOCALAPPPATH environment variables are not set on a profile in Windows 7 Pro 32bit

    - by Timur Fanshteyn
    I am having problem with a user account on a Windows 7 machine (local install, admin user account) APPPATH and LOCALAPPPATH environment are not set. Another user on the same machine, (also a local account, but without admin rights) has the variables set. This started to happen recently, however, I can not figure out if there was something installed on the machine to cause this. This is creating issues with applications that are trying to expand the variables to store local files. Thank you for the help.

    Read the article

  • Please Describe Your Struggles with Minimizing Use of Global Variables

    - by MetaHyperBolic
    Most of the programs I write are relatively flowchartable processes, with a defined start and hoped-for end. The problems themselves can be complex but do not readily lean towards central use of objects and event-driven programming. Often, I am simply churning through great varied batches of text data to produce different text data. Only occasionally do I need to create a class: As an example, to track warnings, errors, and debugging message, I created a class (Problems) with one instantiation (myErr), which I believe to be an example of the Singleton design pattern. As a further factor, my colleagues are more old school (procedural) than I and are unacquainted with object-oriented programming, so I am loath to create things they could not puzzle through. And yet I hear, again and again, how even the Singleton design pattern is really an anti-pattern and ought to be avoided because Global Variables Are Bad. Minor functions need few arguments passed to them and have no need to know of configuration (unchanging) or program state (changing) -- I agree. However, the functions in the middle of the chain, which primarily control program flow, have a need for a large number of configuration variables and some program state variables. I believe passing a dozen or more arguments along to a function is a "solution," but hardly an attractive one. I could, of course, cram variables into a single hash/dict/associative array, but that seems like cheating. For instance, connecting to the Active Directory to make a new account, I need such configuration variables as an administrative username, password, a target OU, some default groups, a domain, etc. I would have to pass those arguments down through a variety of functions which would not even use them, merely shuffle them off down through a chain which would eventually lead to the function that actually needs them. I would at least declare the configuration variables to be constant, to protect them, but my language of choice these days (Python) provides no simple manner to do this, though recipes do exist as workarounds. Numerous Stack Overflow questions have hit on the why? of the badness and the requisite shunning, but do not often mention tips on living with this quasi-religious restriction. How have you resolved, or at least made peace with, the issue of global variables and program state? Where have you made compromises? What have your tricks been, aside from shoving around flocks of arguments to functions?

    Read the article

  • Windows Server Certified as Secure Global Desktop Clients with EBS 12

    - by Steven Chan (Oracle Development)
    Oracle Secure Global Desktop provides secure access to centralized applications—Microsoft Windows, UNIX, mainframe, and midrange—from a wide variety of popular client devices, including Windows PCs, Oracle Solaris workstations, Linux PCs, and thin clients. Secure Global Desktop is certified for use with Microsoft Windows Server 2003 and 2008 virtualized environments acting as desktop clients connecting to Oracle E-Business Suite Release 12 environments.  32-bit and 64-bit versions of Microsoft Windows Server are certified. These combinations may also be used in conjunction with Oracle VM, if required. How does this work? For example, a Secure Desktop Client can connect to a Secure Global Desktop environment.  That environment can be running Microsoft Server 2008.  That environment can be used, in turn, as a "desktop client" to access Oracle E-Business Suite Release 12.1.3. Requirements EBS 12.1.3 + Windows Server 2008 R2 (64-bit) Secure Global Desktop version 4.6 or higher Internet Explorer 8 (32-bit and 64-bit) or Internet Explorer 9 (32-bit and 64-bit) JRE Plug-in 1.6.0_32 (32-bit and 64-bit) or later 1.6 releases EBS 12.1.3 + Windows Server 2008 (32-bit) Secure Global Desktop version 4.6 or higher Internet Explorer 8 (32-bit) or Internet Explorer 9 (32-bit) JRE Plug-in 1.6.0_32 (32-bit) or later 1.6 releases EBS 12.1.3 + Windows Server 2003 R2 (64-bit) Secure Global Desktop version 4.6 or higher Internet Explorer 8 (32-bit and 64-bit) JRE Plug-in 1.6.0_32 (32-bit and 64-bit) or later 1.6 releases EBS 12.1.3 + Windows Server 2003 R2 (32-bit) Secure Global Desktop version 4.6 or higher Internet Explorer 8 (32-bit) JRE Plug-in 1.6.0_32 (32-bit) or later 1.6 releases References Oracle Secure Global Desktop with E-Business Suite Release 12.1.3 (Note 1491211.1) Related Articles Oracle VM Templates Available for E-Business Suite 12.1.3 Support Policies for Virtualization Technologies and Oracle E-Business Suite Webcast Replay Available: Virtualization and Cloud Deployments of Oracle E-Business Suite

    Read the article

  • Nginx Global Error Page

    - by sidprak
    I see this question was also asked here: Configure Nginx global error page but there wasn't a suitable answer. I am currently allowing only certain IPs to some of my sites and would like Nginx to drop connections from the rest of the IPs instead of returning a 403. Ideally, I would like to do this without configuring each site separately. I have this in the http section: error_page 403 =444; But, now, it tries to serve up the page =444 instead of returning a 444.

    Read the article

  • Is it possible to get all member variables in flash(AS3)?

    - by Parris
    Hi, I am trying grab all the member variables in AS3, and then foreach one i would like to process it in various ways. I would need the name and then if it is a collection of some type I would like to loop through that collection as well. I am attempting to essentially serialize in a somewhat custom fashion. Thanks!

    Read the article

  • Saving Variables In An ASP Page

    - by Or Betzalel
    I'm trying to convert a game I made (WindowsFormApplication) to an ASP Page. My Problem is that I have a lot "private" variables in my WindowFormApplication and those variables are important for the game. But when after I Declare all my variables (in my Page_Load), they turn null no matter what I do(click a button, refresh the page). Is there anyway to save my variables between buttons (other than Session, because I'd have to create like 6 more sessions)

    Read the article

  • Inherit one instance variable from the global scope

    - by Julian
    I'm using Curses to create a command line GUI with Ruby. Everything's going well, but I have hit a slight snag. I don't think Curses knowledge (esoteric to be fair) is required to answer this question, just Ruby concepts such as objects and inheritance. I'm going to explain my problem now, but if I'm banging on, just look at the example below. Basically, every Window instance needs to have .close called on it in order to close it. Some Window instances have other Windows associated with it. When closing a Window instance, I want to be able to close all of the other Window instances associated with it at the same time. Because associated Windows are generated in a logical fashion, (I append the name with a number: instance_variable_set(self + integer, Window.new(10,10,10,10)) ), it's easy to target generated windows, because methods can anticipate what assosiated windows will be called, (I can recreate the instance variable name from scratch, and almost query it: instance_variable_get(self + integer). I have a delete method that handles this. If the delete method is just a normal, global method (called like this: delete_window(@win543) then everything works perfectly. However, if the delete method is an instance method, which it needs to be in-order to use the self keyword, it doesn't work for a very clear reason; it can 'query' the correct instance variable perfectly well (instance_variable_get(self + integer)), however, because it's an instance method, the global instances aren't scoped to it! Now, one way around this would obviously be to simply make a global method like this: delete_window(@win543). But I have attributes associated with my window instances, and it all works very elegantly. This is very simplified, but it literally translates the problem exactly: class Dog def speak woof end end def woof if @dog_generic == nil puts "@dog_generic isn't scoped when .woof is called from a class method!\n" else puts "@dog_generic is scoped when .woof is called from the global scope. See:\n" + @dog_generic end end @dog_generic = "Woof!" lassie = Dog.new lassie.speak #=> @dog_generic isn't scoped when .woof is called from an instance method!\n woof #=> @dog_generic is scoped when .woof is called from the global scope. See:\nWoof! TL/DR: I need lassie.speak to return this string: "@dog_generic is scoped when .woof is called from the global scope. See:\nWoof!" @dog_generic must remain as an insance variable. The use of Globals or Constants is not acceptable. Could woof inherit from the Global scope? Maybe some sort of keyword: def woof < global # This 'code' is just to conceptualise what I want to do, don't take offence! end Is there some way the .woof method could 'pull in' @dog_generic from the global scope? Will @dog_generic have to be passed in as a parameter?

    Read the article

  • Seeking enlightenment - global variables in AppEngine (aeoid.get_current_user())

    - by jerd
    Hello This may be a 'Python Web Programming 101' question, but I'm confused about some code in the aeoid project (http://github.com/Arachnid/aeoid). here's the code: _current_user = None def get_current_user(): """Returns the currently logged in user, or None if no user is logged in.""" global _current_user if not _current_user and 'aeoid.user' in os.environ: _current_user = User(None, _from_model_key=os.environ['aeoid.user']) return _current_user But my understanding was that global variables were, ehm, global! And so different requests from different users could (potentially) access and update the same value, hence the need for sessions, in order to store per-user, non-global variables. So, in the code above, what prevents one request from believing the current user is the user set by another request? Sorry if this is basic, it's just not how i thought things worked. Thanks

    Read the article

  • maintain pageViews in global.asax (asp.net)

    - by nishant
    I need a function in global.asax file which gets called only once when user enter a page url. application_beginrequest gets called 50-60 times in a single page( as to render a page several requests go to server.) i though of a solution - I can write my fucntion in global.asax and call it on page load of other pages but in that solution I need to call it in every page. I would prefer something which is to be done only in global.asax

    Read the article

  • Making Global Struct in C++ Program

    - by mosg
    Hello world! I am trying to make global structure, which will be seen from any part of the source code. I need it for my big Qt project, where some global variables needed. Here it is: 3 files (global.h, dialog.h & main.cpp). For compilation I use Visual Studio (Visual C++). global.h #ifndef GLOBAL_H_ #define GLOBAL_H_ typedef struct TNumber { int g_nNumber; } TNum; TNum Num; #endif dialog.h #ifndef DIALOG_H_ #define DIALOG_H_ #include <iostream> #include "global.h" using namespace std; class ClassB { public: ClassB() {}; void showNumber() { Num.g_nNumber = 82; cout << "[ClassB][Change Number]: " << Num.g_nNumber << endl; } }; #endif and main.cpp #include <iostream> #include "global.h" #include "dialog.h" using namespace std; class ClassA { public: ClassA() { cout << "Hello from class A!\n"; }; void showNumber() { cout << "[ClassA]: " << Num.g_nNumber << endl; } }; int main(int argc, char **argv) { ClassA ca; ClassB cb; ca.showNumber(); cb.showNumber(); ca.showNumber(); cout << "Exit.\n"; return 0; } When I`m trying to build this little application, compilation works fine, but the linker gives me back an error: 1>dialog.obj : error LNK2005: "struct TNumber Num" (?Num@@3UTNumber@@A) already defined in main.obj Is there exists any solution? Thanks.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >