state

Control WPF Navigation History

WPF Automatically remembers control state for Dependency Properties with the Journal metadata flag. On top of this you can implement IProvideCustomContentState to provide your own custom state information. However, I can't find a way to do ONLY custom state and turn off the automatic Dependency Property state tracking. I want to do th...

How to create a stateful XML WebService in asp.net ?

Without getting into the 'Stateful services are bad' discussion... How do you create one? From the lack of helpful search results.. it seems either I'm searching for the wrong terms or it is being actively discouraged. The best link i could find was this one on MSDN To give a brief context of what my current app looks like. Rails Web A...

Is it bad to model a web user control as a state machine?

We're designing a web user control, which does some different things. It gets events from inside it or outside it, and the response to these events depend on the state of this control. We're thinking of modeling as a state machine, but we think it might be too geeky or hard for someone else to understand. Do you think this is true? ...

Gridview looses ItemTemplate after columns are removed

I'm trying to bind a datatable to a gridview where I've removed some of the autogenerated columns in the code behind. I've got two template columns and it seems that when I alter the gridview in code behind and remove the non-templated columns that the templates loose the controls that are in them. Using the following as a sample, "He...

How can I create a Mouse Hover State on Silverlight for a Stack Panel?

Hi There, I am trying to create a mouse hover state which it changes its opacity when a mouse is over the stack panel. I have created the state, and created a mouse_enter event for the stack panel, and on the code behind cs file, I have the following code on Mouse_Enter event. MouseOver.Begin(); Where MouseOver is the StoryBoard's na...

jQuery "active" class assignment

All I am trying to accomplish is to be able to have an unordered list of links in which one is clicked, the parent list item is assigned the class "active." Once another link is clicked within that list, it checked to see if "active" is assigned, remove it from that list item, and add it to the most recent clicked links parent list item....

How to get Javascript cookie to remember DIV state?

Hey there: I've got a test site here (still in development) and I'm trying to get the little notification at the top to stay hidden once you click close. Currently my script is like this: <style type="text/css"> <!-- .hide { display:none; } .show { display:block; } --> </style> <script type="text/javascript"> <!-- var state; window.on...

Remembering a jQuery draggable tool palette position between page refreshes

I have a tool palette which shows up when an admin user is logged in to a site. The palette is draggable (via jQueryUI.draggable) and I would like it to remember the position between pages/refreshes... Is there a standard way of doing this, or a plug-in I should be using, or do I need to roll my own (via cookies or something)? ...

State vs. Behavior

Sometimes objects consist of pure data. Such objects have fields, accessors, and virtually no other methods. Sometimes objects consist of pure behavior. They have other objects representing their state, or data is passed as method parameters. Usually such objects represent algorithms or some kind of policies. What state/behavior ratio...

State Pattern: How the states of an object should transition when they're involved in complex processes?

Guys, I have some doubts about the following implementation of the state pattern: I have an Order object. For simplicity, let's suppose it has a quantity, productId, price and supplier. Also, there are a set of known states in wich the order can transition: state a: order is new, quantity must be > 0 and must have productId. Price an...

c# Implement IHttpModule or IHttpHandler for IRequiresSessionState

Hi how do I set up an http handler so I can manipulate IRequiresSessionState? I need to change when I can access session state. There is a stackoverflow question that takes me 90% of the way there, I am just too green in c# to know how to actually implement it and get it to work. If one of you experts could give me a quick 123 I would...

Synchronizing online game state via AJAX or RPC

I'm trying to find a way to synchronize game state in a browser based game. I've been using Google Web Toolkit, but I think my question pertains to any AJAX or RPC framework. As for my "game": think chess, but where you need to move the chess pieces in real time; if player 1 moves (drags and drops) a piece to a new location and player 2...

Best way to share data between .NET application instance?

I have create WCF Service (host on Windows Service) on load balance server. Each of this service instance maintain list of current user. E.g. Instance A has user A001, A002, A005, instance B has user A003, A004, A008 and so on. On each service has interface that use to get user list, I expect this method to return all user in all servic...

Session State Server and memory problems

We have an application that pulls back fairly large datatables and stores them in session (I know this is bad, i didnt design it this way). We are using the Session State Server and I have verfied that its working (the site relies heavily on session and I can work with it just fine). However, when we return a large datatable (~12MB), we ...

How to save and load a C++ application state in a modular way

I have a distributed C++ application, which is composed of 4 processes spread on 2 machines. One of the applications serves as "control center" for the rest of the applications. I want to be able to save the current state to a file and load it again later. What exactly is a "state" is defined separately by each module in the system. Wh...

Ideas for populating input checkboxes from database and maintaining state during postback

I have an asp.net page that uses a stringbuilder to output a client side checkbox for each record in my database. I need to check whether the checkbox should be on, depending upon a bool in the db and on postback maintain the state of all the checkboxes. Can anyone suggest a good approach to this? ...

UITabBarController not loading "More" views at applicationDidFinishLaunching

I'm trying to restore the state of my multi-tabbed iPhone application. There are more than 5 tabs, each with it's own navigation controller. On applicationDidFinishLaunching, I determine which was the last tab the user was on and set it with myTabController.selectedIndex = persistedTabIndex; I then call a function on that tab's root v...

Best way to persist state with Tomcat/Scala?

What's the best way to persist user state with Tomcat/Scala? My first thought is to keep account information on the session at all times and redirect the user to a login page if there's no information on the session for the account. Is this a viable model, or is there a smarter way of persisting user information? I'm trying to replicate ...

How to pass global values around (singleton vs. ???)

I've inherited a project that stores various parameters either in a config file, the registry and a database. Whoever needs one of these parameters just reads (and in some cases writes) it directly from the store. This, or course, is stupid, so my first thought was to refactor the existing code so that the client doesn't know where the p...

Saving form elements properties to XML (Save control state)

Hello, I have been using in some projects a xml library for my settings saving, how it worked was like this : saveSettings(Control control, XmlConfig config, string controlName) It would then search all the controls inside that one (recursively), calling itself each time it found a new control, etc, and saving all their info to a xml ...