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 ...
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...
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...
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=...
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?
...
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?
...
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...
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 ...
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...
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...
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...
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 ...
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?
...
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 ?
...
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...
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 ...
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...
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...
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?
...
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...