state

Class member variables, methods and their state

How should class member variables be used in combination with class methods? Let's say I have a class 'C' with a member variable 'someData'. I call C.getData(), which does not return a value but instead puts data in C.someData. The class that instantiated 'C' first calls C.getData and then uses the data by accessing the member variab...

ASP.NET Page.Cache versus Page.Application storage for data synchronization?

Both Page.Cache and Page.Application can store an application's "global" data, shared among requests and threads. How should one storage area be chosen over the other considering scenarios of data synchronization in the multi-threaded ASP.NET environment? Looking for best practice and experienced recommendation. ...

How to persist objects between requests in PHP

I've been using rails, merb, django and asp.net mvc applications in the past. What they have common (that is relevant to the question) is that they have code that sets up the framework. This usually means creating objects and state that is persisted until the web server is recycled (like setting up routing, or checking which controllers ...

Is it possible to implement Flex states in Android application.

Hi guys, Let me explain what I am want to archive. For example, in Flex I can create page (list of something) with 3 states: Loading state (just display some animation or label with text "Please wait."), No records state (page with text saying that there is no records) and Page with populated list. It is very easy to operate with state...

ExtJS: Login with 'Remember me' functionality

I'm trying to create a simple login window with the very common 'Remember me' functionality. The login validation is done AJAX style, thus the browser won't remember my input. My approach is to use the built-in state functionality, but how to use it confuses me. Ext.state.Manager.setProvider(new Ext.state.CookieProvider({ expires: ...

How to simulate a corrupt state exception in .NET 4?

Well, in .NET 4 Microsoft added the HandleProcessCorruptedStateExceptions attribute: HandleProcessCorruptedStateExceptionsAttribute Class I want to test this feature. How can I bring my application to a "corrupt state"? ...

PHP Beginner: How to pass PHP variable from one PHP code segment to another ?

I have index.php which uploads a file to server and sets several PHP variables (like $target_folder_and_file_name). index.php also has the following line (it was originally index.html): <script language="JavaScript" src="main.js.php"></script> After index.php returned to the browser, the browsers asks for main.js.php from the server ...

Transition methods in state design pattern

Hi, I have a state machine with many states A--B--C--D--E. I have many transitions from C for example to A if some condition is verified. For every state I have a class extending abstract class Stateand I have a manager that delegates every transition method to state method. The question is "could states call directly manager transitio...

how to maintain Div state on Page Load - aka Facebook

How does facebook manage the toolbar that appears on the bottom of each page and contains the chat box. When i click to other pages, the state of the div stays alive and just overlays everything else. Is there a larger div that is just getting reloaded in the background? ...

Resolving a Forward Declaration Issue Involving a State Machine in C++

I've recently returned to C++ development after a hiatus, and have a question regarding implementation of the State Design Pattern. I'm using the vanilla pattern, exactly as per the GoF book. My problem is that the state machine itself is based on some hardware used as part of an embedded system - so the design is fixed and can't be ch...

Three State Treeview Windows Forms

Hello everybody people, One of the frustrations with the standard TreeView is that you can't show a partial selection to indicate that some of the children are selected. A partial selection in a complex tree allows the user to easily determine where the selections are, even if the tree is not completely expanded. A similar idea is use...

Ref to map vs. map to refs vs. multiple refs

I'm working on a GUI application in Swing+Clojure that requires various mutable pieces of data (e.g. scroll position, user data, filename, selected tool options etc.). I can see at least three different ways of handling this set of data: Create a ref to a map of all the data: (def data (ref { :filename "filename.xml" :scroll ...

Flex 4 animation question

Hello.. I am trying to do the move vertically animation on a button nested in the vertical layout. I am not sure if the Hgroup restricts the button moving vertically. Are there ways to go around it? Thanks for the helps. <s:states> <s:State name="default"/> <s:State name="addRecommend"/> <s:State name="seeOther"/> </s:states> AS: ...

Flex State transition questoin..

Hi I am trying to create the transition between states. The first state transition works fine(state1=>state2), but the second one is acting weird(state2=>state3). After clicks the button to change state2=>state3, some text areas which are belong to state2 show up and stay on the screen. I am not sure why. I would appreciate it if some...

jQuery Ajax checkbox state

I have checkboxes on my page for which I would like to send their state back to the database via ajax. I know how to use jquery with ajax, but I don't know how to get the checked state, both checked and unchecked along with the id of the checkbox so I can send it back to the server. Any ideas? ...

Frustrated Animation Issue....

Hi guys.. I have spent 2 hours on this simple state to state transition with simply resize and move animation.... I can get the element to move and fade...but there is no resize animation at all. The panel element stay the same width whole time. If I copy the code to a brand new test mxml file, it works, but not in my main application...

GOF State Pattern State Transition Implementation Issues

Firstly, can anyone explain how a state object can be shared when the state object has no instance variables ? This text is taken from GOF, page 308, item 3 (consequences section): The state object can be shared. If state objects have no instance variabkes - that is, the state they represent is encoded entirely in their type...

Maintaining the state in load balanced server?

What are the ways to mainatain the state in load balanced servers? I am using one application which is hosted in two different servers. Now I want to check a record about whether it has already been taken by somebody to edit or not. How to maintain a state inorder to accomplish my above requirement. ...

How does ASP.NET maintain state in between subsequent request ?

Please explain on bases of caching concept. ...

C++ Game State System.

Okay: I'm fairly new to C++ and static languages on a whole. Coming from years of ruby (and other dynamic languages) I don't know if this is possible. I've been making a game state system for... well a game. I want to make the system easy for me to cut and paste into other games without any (or very few) changes. The two things I am wa...