state

How can I restore process state after a crash?

What's a good way to persist state when restarting a crashed process? I have a supervisor in an OTP application what watches several "subsystem" gen_servers. For example, one is a "weather" subsystem that generates a new weather state every 15 minutes and handles queries for the current state of the weather. (Think the lemonade stand ...

Static class vs instanced class

Duplicate Should C# methods that can be static be static? Please forgive me if this question seems elementary - I'm looking over some source code that otherwise looks pretty good, but it's raised some questions... If a given class has no member data - i.e. it doesn't maintain any sort of state, are there any benefits in not ma...

In javascript, how can I uniquely identify one browser window from another which are under the same cookiedbased sessionId

The users of my web application may have more than one browser window open and pointed to the same page. I would like the state of certain in things in the page (loaded via ajax) to be retained across postbacks. I can either store in a cookie or on my server. Either way, I can't think of how I can distinguish each window. For example...

What is the best way to remember tab selection with the .NET TabContainer?

This is what i am currently using to remember the state but wonder if there's a better way to do this? <script language="javascript" type="text/javascript"> function readCookie(name) { var nameEQ = name + "="; var ca = document.cookie.split(';'); for(var i=...

How do I bind the enabled binding of a button to whether or not an NSArrayController has a selection?

I want to bind the enabled state of an NSButton to whether or not an NSArrayController has any selected items. How do I do this? ...

Maintaining Persistence When Using Rake Tasks

I'm running some basic continuous integration scripts in the form of rake tasks, using cron to automate their running. I'd like to be able to maintain some form of state between tasks however. I've considered just writing information to a file and reading it back in. Is there a more "ruby" way of doing this? ...

How can you do anything useful without mutable state?

I've been reading a lot of stuff about functional programming lately, and I can understand most of it, but the one thing I just can't wrap my head around is stateless coding. It seems to me that simplifying programming by removing mutable state is like "simplifying" a car by removing the dashboard: the finished product may be simpler, b...

HttpWebRequest and HttpWebResponse : maintaining state of logged in request for consecutive queries

Hi, I have a few HttpWebRequests and HttpWebResponses chained together, also using CookieContainer. The code simulates a user going through three different 'I agree' pages which set the cookie info, logging in with username and password on a fourth, and doing a POST (search) on the fifth returning the response as a string. Is there a ...

State Server not saving session in clustered environment...

I am using Session State Server. My web application is not sticky. The application works fine on one box, but when the load-balancer switches to another box, the session seems to have lost the data. This happens intermittently. Any ideas? I have a similar application on the same boxes, that works fine with the same state server. Tha...

TransactionScope and rolling back object state

I'm looking for a solution to a design problem. This will take a bit of explaining. I would post code, but that woul make this even longer. I have a custom generic collection I use to hold Business Objects as needed. For easy of reference, call the business objects BO and the generic collection GC. Inside GC I have a private colle...

Losing session variables in a web farm using State Server...

I have four servers in a clustered non-sticky environment that is serviced by a single state server. I noticed that the app loses session when it hits a particular box 90% of the time, and 10% times on the other boxes. I observed the machine keys, and they are the same in all the boxes. I also checked the application path in IIS, they a...

How to rewind application state?

I'm developing a Java desktop flight simulation. I need to record all the pilot actions as they occur in the cockpit, such as throttle controls, steering, weapon deployment, etc. so that I can view these events at a later time (or stream them live). I'd like to add a visual replay feature on the playback of the events so I can visually ...

How can I create a new STATE in a button in Flash CS3?

Hello! I'm trying to create a new state for a button, like when I take the mouse pointer out of the Hit Area and, doing this, it fires a small movieclip. How can I do it? I probably need some especific name for this state, like Hit or Over, right? ...

C# / Object oriented design - maintaining valid object state

When designing a class, should logic to maintain valid state be incorporated in the class or outside of it ? That is, should properties throw exceptions on invalid states (i.e. value out of range, etc.), or should this validation be performed when the instance of the class is being constructed/modified ? ...

Keeping state with remote EJBs and Web Services

I have a web-based application which makes use of remote EJBs for its business logic. Some of these EJBs are also exposed as Web Services. I need to keep a small state for some of these calls in order to allow subsequent calls to function correctly. Which of the following would you recommend? Stateful EJBs (will this work with Web Serv...

Ninject and named item in session state

Hi there, is there a way to inject an object into the session state automatically with Ninject? For example: I have a provider that gets me a list of objects. In my views I have something that reads state from session like <%=Session["MyKey"].Data%> Now I want to be able to inject the value of Session["MyKey"] with Ninject instead of ...

ASP.NET State Management in appropriate situations.

There are 6 techniques to manage states in ASP.NET 3.5 (as far as I know). (1) View State (2) Cross Page Posting (3) Query String (4) Session State (5) Application State (6) Cookies Can anyone give me some appropriate examples of situations where I should use these techniques? For example: (*) Session State: Personalization, Buy Car...

iPhone app: SDK 3.0 : Button Selected State: Can't get working!!!

Trying to do simple button functionality. Button A. It has 3 states: default, highlighted, selected. Should UNSELECT when clicked again. For the life of me, I can't even get a simple 3 state functionality established. Highlight (on press) appears built in (goes to "stock" blue). I"ve used Button Attributes to load in image for select...

In what scenario is stateful better than stateless for the web?

I have always advocated the stateless web, but would like to know what the advocates of the stateful web are saying. Do you have any situation where stateful is more appropriate than stateless? ...

What are the best resources for learning how to avoid side effects and state in OOP?

I've been playing with functional programming lately and there are pretty good treatments on the topic of side effects, why they should be contained, etc. In projects where OOP is used, I'm looking for some resources which lay out some strategies for minimizing side effect and/or state. A good example of this is the book RESTful Web Se...