Search Results

Search found 6488 results on 260 pages for 'global thermonuclear war'.

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

  • PHP question about global variables and form requests

    - by user220201
    Hi, This is probably a stupid question but will ask anyway sine I have no idea. I have written basic php code which serve forms. Say I have a login page and I serve it using the login.php page and it will be called in the login.html page like this - <form action="login.php" method="post"> By this it is also implied that every POST needs its own php file, doesn't it? This kind of feels weird. Is there a way to have a single file, say code.php, and just have each of the forms as functions instead? EDIT: Specifically, say I have 5 forms that are used one after the other in my application. Say after login the user does A, B, C and D tasks each of which are sent to the server as a POST request. So instead of having A.php, B.php, C.php and D.php I would like to have a single code.php and have A(), B(), C() and D() as functions. Is there a way to do this? Also on the same note, how do I deal with say a global array (e.g. an array of currently logged in users) across multiple forms? I want to do this without writing to a DB. I know its probably better to write to a DB and query but is it even possible to do it with a global array? The reason I was thinking about having all the form functions in one file is to use a global array. Thanks, - Pav

    Read the article

  • system crash after declaring global object of the class

    - by coming out of void
    hi, i am very new to c++. i am getting system crash (not compilation error) in doing following: i am declaring global pointer of class. BGiftConfigFile *bgiftConfig; class BGiftConfigFile : public EftBarclaysGiftConfig { } in this class i am reading tags from xml file. it is crashing system when this pointer is used to retrieve value. i am doing coding for verifone terminal. int referenceSetting = bgiftConfig->getreferencesetting(); //system error getreferencesetting() is member fuction of class EftBarclaysGiftConfig i am confused about behavior of pointer in this case. i know i am doing something wrong but couldn't rectify it. When i declare one object of class locally it retrieves the value properly. BGiftConfigFile bgiftConfig1; int referenceSetting = bgiftConfig1->getreferencesetting(); //working But if i declare this object global it also crashes the system. i need to fetch values at different location in my code so i forced to use someting global. please suggest me how to rectify this problem.

    Read the article

  • Delphi - Why is my global variable "inacessible" when i debug

    - by Antoine Lpy
    I'm building an application that contains around 30 Forms. I need to manage sessions, so I would like to have a global LoggedInUser variable accessible from all forms. I read "David Heffernan"'s post about global variables, and how to avoid them but I thought it would be easier to have a global User variable rather than 30 forms having their own User variable. So i have a unit : GlobalVars unit GlobalVars; interface uses User; // I defined my TUser class in a unit called User var LoggedInUser: TUser; implementation initialization LoggedInUser:= TUser.Create; finalization LoggedInUser.Free; end. Then in my LoginForm's LoginBtnClick procedure I do : unit FormLogin; interface uses [...],User; type TForm1 = class(TForm) [...] procedure LoginBtnClick(Sender: TObject); private { Déclarations privées } public end; var Form1: TForm1; AureliusConnection : IDBConnection; implementation {$R *.fmx} uses [...]GlobalVars; procedure TForm1.LoginBtnClick(Sender: TObject); var Manager : TObjectManager; MyCriteria: TCriteria<TUser>; u : TUser; begin Manager := TObjectManageR.Create(AureliusConnection); MyCriteria :=Manager.Find<TUtilisateur> .Add(TExpression.Eq('login',LoginEdit.Text)) .Add(TExpression.Eq('password',PasswordEdit.Text)); u := MyCriteria.UniqueResult; if u = nil then MessageDlg('Login ou mot de passe incorrect',TMsgDlgType.mtError,[TMsgDlgBtn.mbOK],0) else begin LoggedInUser:=u; //Here I assign my local User data to my global User variable Form1.Destroy; A00Form.visible:=true; end; Manager.Free; end; Then in another form I would like to access this LoggedInUser object in the Menu1BtnClick procedure : Unit C01_Deviations; interface uses System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, FMX.Types, FMX.Graphics, FMX.Controls, FMX.Forms, FMX.Dialogs, FMX.StdCtrls, FMX.ListView.Types, FMX.ListView, FMX.Objects, FMX.Layouts, FMX.Edit, FMX.Ani; type TC01Form = class(TForm) [...] Menu1Btn: TButton; [...] procedure Menu1BtnClick(Sender: TObject); private { Déclarations privées } public { Déclarations publiques } end; var C01Form: TC01Form; implementation uses [...]User,GlobalVars; {$R *.fmx} procedure TC01Form.Menu1BtnClick(Sender: TObject); var Assoc : TUtilisateur_FonctionManagement; ValidationOK : Boolean; util : TUser; begin ValidationOK := False; util := GlobalVars.LoggedInUser; // Here i created a local user variable for debug purposes as I thought it would permit me to see the user data. But i get "Inaccessible Value" as its value util.Nom:='test'; for Assoc in util.FonctionManagement do // Here is were my initial " access violation" error occurs begin if Assoc.FonctionManagement.Libelle = 'Reponsable équipe HACCP' then begin ValidationOK := True; break; end; end; [...] end; When I debug I see "Inaccessible Value" in the value column of my user. Do you have any idea why ? I tried to put an integer in this GlobalVar unit, and i was able to set its value from my login form and read it from my other form.. I guess I could store the user's id, which is an integer, and then retrieve the user from the database using its id. But it seems really unefficient.

    Read the article

  • install red5 demos via installer or within war file manually

    - by dursunturan
    I'm using Ubuntu 10.10 and installed the red5-server package. I've also downloaded oflaDemo.war file from that address. First I tried to install the oflaDemo via installer, but I couldnt reach the goal. I see the .war file under the /tmp directory, I got stuck with this message: "This may take a couple minutes, please wait". After that, I put the downloaded war file into the /webapps directory and wait 10 minutes as mentioned in red5-common.xml. Unfortunately, nothing changed ... So I decided to extract war file manually. I did this: jar -xvf oflaDemo.war Ok, I see all of the unzipped content under the webapps directory, but how can I preview the demo via a web browser? I really need to make live stream via Red5. Please help me.

    Read the article

  • install red5 demos via installer or within war file manually

    - by dursunturan
    I'm using Ubuntu 10.10 and installed the red5-server package. I've also downloaded oflaDemo.war file from that address. First I tried to install the oflaDemo via installer, but I couldnt reach the goal. I see the .war file under the /tmp directory, I got stuck with this message: "This may take a couple minutes, please wait". After that, I put the downloaded war file into the /webapps directory and wait 10 minutes as mentioned in red5-common.xml. Unfortunately, nothing changed ... So I decided to extract war file manually. I did this: jar -xvf oflaDemo.war Ok, I see all of the unzipped content under the webapps directory, but how can I preview the demo via a web browser? I really need to make live stream via Red5. Please help me.

    Read the article

  • WPF: RenderOptions.EdgeMode="Unspecified" vs "Alias" override global setting with local setting

    - by msfanboy
    Hello, in the ressource-tag of my MainWindowView.xaml I have this markup: RenderOptions.EdgeMode="Aliased" to get a general sharp look of my whole application. Using mostly rectangular shapes/controls this works fine. But for my validation error symbols I use a red ellipse with a white cross or "X" in it. The ellipse is using now the global "Aliased" settings what looks not good because I can see the pixelated border of the ellipse. Using now does NOT change anything ??? I always set in wpf local settings override global settings ?

    Read the article

  • Using the Ninject NLogModule Logger in global.asax

    - by Ciaran
    I'm using Ninject for DI in my asp.net application, so my Global class inherits from NinjectHttpApplication. In my CreateKernel(), I'm creating my custom modules and DI is working fine for me. However, I notice that there is a Logger property in the NinjectHttpApplication class, so I'm trying to use this in Application_Error whenever an exception is not caught. I think I'm creating the nlog module correctly for Ninject, but my logger is always null. Here's my CreateKernel: protected override Ninject.Core.IKernel CreateKernel() { IKernel kernel = new StandardKernel(new NLogModule(), new NinjectRepositoryModule()); return kernel; } But in the following method, Logger is always null. protected void Application_Error(object sender, EventArgs e) { Exception lastException = Server.GetLastError().GetBaseException(); Logger.Error(lastException, "An exception was caught in Global.asax"); } To clarify, Logger is a property on NinjectHttpApplication of type ILogger and has the [Inject] attribute Any idea how to inject correctly into Logger?

    Read the article

  • Setting a session variable in Global.asax causes AJAX errors

    - by Fly_Trap
    I'm getting a very peculiar problem with my asp.net application, it took me an age to track down but I still don't know what is causing this behaviour. If I set a session variable in the Application_PreRequestHandlerExecute event, then my external JavaScript files are ignored, and therfore causing a raft of errors. I have simplified the problem below. E.g. I have file called JScript.js containing the code: function myAlert() { alert("Hi World"); } And in my Default.aspx file I reference the js with the code: <script src="JScript.js" type="text/javascript"></script> And in the body onload event I call the myAlert() function: <body onload="myAlert()"> And finally in the Global.asax file: Private Sub Application_PreRequestHandlerExecute(ByVal sender As Object, ByVal e As EventArgs) HttpContext.Current.Session("myVar") = "MyValue" End Sub If you run the Default.aspx file you will see the js function isnt called, however, if you comment out the line of code Global.asax then the external js is called and the function executed when the page loads. Why is this?

    Read the article

  • Accessing HttpRequest from Global.asax via a page

    - by Polymorphix
    I'm trying to get a property (ImpersonatePersonId) from a page in global.asax but get a HttpException saying 'Request is not available in this context'. I've been searching for some documentation on where in the pipeline the request is accessible, but as far as I can see all Microsoft can produce of documentation is one-liners like "PostRequestHandlerExecute: Occurs when the ASP.NET event handler finishes execution." which really doesn't give me much... I've tried placing the call in both Pre and PostRequestHandlerExceute but with the same result. I wonder if anyone with experience in this would be so kind as to tell me where the Request object is available. My code from global asax is below. ICanImpersonate page = HttpContext.Current.Handler as ICanImpersonate; ImpersonatedUser impersonatePerson = page != null ? page.ImpersonatePersonId : null; Response.Filter = new TagRewriter(Response, new TagProcessor(Context, impersonatePerson).Process); What I want to do is rewrite some HTML based on some request parameters.

    Read the article

  • Python namespace in between builtins and global?

    - by Paul
    Hello, As I understand it python has the following outermost namespaces: Builtin - This namespace is global across the entire interpreter and all scripts running within an interpreter instance. Globals - This namespace is global across a module, ie across a single file. I am looking for a namespace in between these two, where I can share a few variables declared within the main script to modules called by it. For example, script.py: import Log from Log import foo from foo log = Log() foo() foo.py: def foo(): log.Log('test') # I want this to refer to the callers log object I want to be able to call script.py multiple times and in each case, expose the module level log object to the foo method. Any ideas if this is possible? It won't be too painful to pass down the log object, but I am working with a large chunk of code that has been ported from Javascript. I also understand that this places constraints on the caller of foo to expose its log object. Thanks, Paul

    Read the article

  • In game programming are global variables bad?

    - by Joe.F
    I know my gut reaction to global variables is "badd!" but in the two game development courses I've taken at my college globals were used extensively, and now in the DirectX 9 game programming tutorial I am using (www.directxtutorial.com) I'm being told globals are okay in game programming ...? The site also recommends using only structs if you can when doing game programming to help keep things simple. I'm really confused on this issue, and all the research I've been trying to do is very confusing. I realize there are issues when using global variables (threading issues, they make code harder to maintain, the state of them is hard to track etc) but also there is a cost associated with not using globals, I'd have to pass a loooot of information around very often which can be confusing and I imagine time-costing, although I guess pointers would speed the process up (this is my first time writing a game in C++.) Anyway, I realize there is probably no "right" or "wrong" answer here since both ways work, but I want my code to be as proper as I can so any input would be good, thank you very much!

    Read the article

  • global counter in application: bad practice?

    - by Martin
    In my C++ application I sometimes create different output files for troubleshooting purposes. Each file is created at a different step of our pipelined operation and it's hard to know file came before which other one (file timestamps all show the same date). I'm thinking of adding a global counter in my application, and a function (with multithreading protection) which increments and returns that global counter. Then I can use that counter as part of the filenames I create. Is this considered bad practice? Many different modules need to create files and they're not necessarily connected to each other.

    Read the article

  • Implementing fog of war in opengl es 2.0 game

    - by joxnas
    Hi game development community, this is my first question here! ;) I'm developing a tactics/strategy real time android game and I've been wondering for some time what's the best way to implement an efficient and somewhat nice looking fog of war to incorporate in it. My experience with OpenGL or Android is not vast by any means, but I think it is sufficient for what I'm asking here. So far I have thought in some solutions: Draw white circles to a dark background, corresponding to the units visibility, then render to a texture, and then drawing a quad with that texture with blend mode set to multiply. Will this approach be efficient? Will it take too much memory? (I don't know how to render to texture and then use the texture. Is it too messy?) Have a grid object with a vertex shader which has an array of uniforms having the coordinates of all units, and another array which has their visibility range. The number of units will very probably never be bigger then 100. The vertex shader needs to test for each considered vertex, if there is some unit which can see it. In order to do this it, will have to loop the array with the coordinates and do some calculations based on distance. The efficiency of this is inversely proportional to the looks of it. A more dense grid will result in a more beautiful fog of war... but will require a greater amount of vertexes to be checked. Is it possible to find a nice compromise or is this a bad solution from the start? Which solution is the best? Are there better alternatives? Which ones? Thank you for your time.

    Read the article

  • Javascript redeclared global variable overrides old value

    - by Yousuf Haider
    I ran into an interesting issue the other day and was wondering if someone could shed light on why this is happening. Here is what I am doing (for the purposes of this example I have dumbed down the example somewhat): I am creating a globally scoped variable using the square bracket notation and assigning it a value. Later I declare a var with the same name as the one I just created above. Note I am not assigning a value. Since this is a redeclaration of the same variable the old value should not be overriden as described here: http://www.w3schools.com/js/js_variables.asp //create global variable with square bracket notation window['y'] = 'old'; //redeclaration of the same variable var y; if (!y) y = 'new'; alert(y); //shows New instead of Old The problem is that the old value actually does get overriden and in the above eg. the alert shows 'new' instead of 'old'. Why ? I guess another way to state my question is how is the above code different in terms of semantics from the code below: //create global variable var y = 'old'; //redeclaration of the same variable var y; if (!y) y = 'new'; alert(y); //shows Old

    Read the article

  • Javascript Square bracket notation for global variables

    - by Yousuf Haider
    I ran into an interesting issue the other day and was wondering if someone could shed light on why this is happening. Here is what I am doing (for the purposes of this example I have dumbed down the example somewhat): I am creating a globally scoped variable using the square bracket notation and assigning it a value. Later I declare a var with the same name as the one I just created above. Note I am not assigning a value. Since this is a redeclaration of the same variable the old value should not be overriden as described here: http://www.w3schools.com/js/js_variables.asp //create global variable with square bracket notation window['y'] = 'old'; //redeclaration of the same variable var y; if (!y) y = 'new'; alert(y); //shows New instead of Old The problem is that the old value actually does get overriden and in the above eg. the alert shows 'new' instead of 'old'. Why ? I guess another way to state my question is how is the above code different in terms of semantics from the code below: //create global variable var y = 'old'; //redeclaration of the same variable var y; if (!y) y = 'new'; alert(y); //shows New instead of Old

    Read the article

  • Redeclared javascript global variable overrides old value in IE

    - by Yousuf Haider
    (creating a separate question after comments on this: http://stackoverflow.com/questions/2634410/javascript-redeclared-global-variable-overrides-old-value) I am creating a globally scoped variable using the square bracket notation and assigning it a value inside an external js file. In another js file I declare a var with the same name as the one I just created above. Note I am not assigning a value. Since this is a redeclaration of the same variable the old value should not be overriden as described here: http://www.w3schools.com/js/js_variables.asp Create 2 javascript files with the following content : Script1 //create global variable with square bracket notation window['y'] = 'old'; Script2 //redeclaration of the same variable var y; if (!y) y = 'new'; alert(y); //shows New instead of Old in IE Include these 2 files in your html file <html> <head></head> <body> <script type="text/javascript" src="my.js"></script> <script type="text/javascript" src="my2.js"></script> </body> </html> Opening this page in Firefox and Chrome alerts 'old' which is the expected behavior. However in IE 8 the page will actually alert 'new' Any ideas on why this happens on IE ?

    Read the article

  • Cookie add in the Global.asax warning in application log

    - by Ioxp
    In my Global.ASAX file i have the following: System.Web.HttpCookie isAccess = new System.Web.HttpCookie("IsAccess"); isAccess.Expires = DateTime.Now.AddDays(-1); isAccess.Value = ""; System.Web.HttpContext.Current.Response.Cookies.Add(isAccess); So every time this method this is logged in the application events as a warning: Event code: 3005 Event message: An unhandled exception has occurred. Event time: 5/25/2010 12:23:20 PM Event time (UTC): 5/25/2010 4:23:20 PM Event ID: c515e27a28474eab8d99720c3f5a8e90 Event sequence: 4148 Event occurrence: 332 Event detail code: 0 Application information: Application domain: /LM/W3SVC/2100509645/Root-1-129192259222289896 Trust level: Full Application Virtual Path: / Application Path: <PathRemoved>\www\ Machine name: TIPPER Process information: Process ID: 6936 Process name: w3wp.exe Account name: NT AUTHORITY\NETWORK SERVICE Exception information: Exception type: NullReferenceException Exception message: Object reference not set to an instance of an object. Request information: Request URL: Request path: User host address: User: Is authenticated: False Authentication Type: Thread account name: NT AUTHORITY\NETWORK SERVICE Thread information: Thread ID: 7 Thread account name: NT AUTHORITY\NETWORK SERVICE Is impersonating: False Stack trace: at ASP.global_asax.Session_End(Object sender, EventArgs e) in <PathRemoved>\Global.asax:line 113 Any idea why this code would cause this error?

    Read the article

  • How can I inject Javascript (including Prototype.js) in other sites without cluttering the global na

    - by Daniel Magliola
    I'm currently on a project that is a big site that uses the Prototype library, and there is already a humongous amount of Javascript code. We're now working on a piece of code that will get "injected" into other people's sites (picture people adding a <script> tag in their sites) which will then run our code and add a bunch of DOM elements and functionality to their site. This will have new pieces of code, and will also reuse a lot of the code that we use on our main site. The problem I have is that it's of course not cool to just add a <script> that will include Prototype in people's pages. If we do that in a page that's already using ANY framework, we're guaranteed to screw everything up. jQuery gives us the option to "rename" the $ object, so it could handle this situation decently, except obviously for the fact that we're not using jQuery, so we'd have to migrate everything. Right now i'm contemplating a number of ugly choices, and I'm not sure what's best... Rewrite everything to use jQuery, with a renamed $ object everywhere. Creating a "new" Prototype library with only the subset we'd be using in "injected" code, and renaming $ to something else. Then again I'd have to adapt the parts of my code that would be shared somehow. Not using a library at all in injected code, to keep it as clean as possible, and rewriting the shared code to use no library at all. This would obviously degenerate into us creating our own frankenstein of a library, which is probably the worst case scenario ever. I'm wondering what you guys think I could do, and also whether there's some magic option that would solve all my problems... For example, do you think I could use something like Caja / Cajita to sandbox my own code and isolate it from the rest of the site, and have Prototype inside of there? Or am I completely missing the point with that? I also read once about a technique for bookmarklets, were you add your code like this: (function() { /* your code */ })(); And then your code is all inside your anonymous function and you haven't touched the global namespace at all. Do you think I could make one file containing: (function() { /* Full Code of the Prototype file here */ /* All my code that will run in the "other" site */ InitializeStuff_CreateDOMElements_AttachEventHandlers(); })(); Would that work? Would it accomplish the objective of not cluttering the global namespace, and not killing the functionality on a site that uses jQuery, for example? Or is Prototype too complex somehow to isolate it like that? (NOTE: I think I know that that would create closures everywhere and that's slower, but I don't care too much about performance, my code is not doing anything that complex)

    Read the article

  • How build a global function to have the recent background-Positions for continue animation after cha

    - by andi
    Try to find a global function, to get and to put the backgroundPosition-values, but I feel a bit confused. Here is the function: function global_backgroundPosition_Menu(num){ $('#Navigation_1') .css({ backgroundPosition: num + "px 0" }) } /////////////////// An here I want to call and put the function: if ($('#Navigation_1 li.leistungen.active').length != 0){ global_backgroundPosition_Menu(); $('#Navigation_1') .css({ backgroundImage: "url(images/background/menu_highlight_hg.png)", backgroundRepeat: "no-repeat", }) .animate({ backgroundPosition: "30px 0" }) global_backgroundPosition_Menu(30) };

    Read the article

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