state

GridView is scrolling back to top after row selection

I've got one long GridView control on ma website. It allows row selection. The problem is, when I scroll down this GridView and select some of the bottom rows the selection occurs, but whole GridView is scrolling back to top. Does enyone know how to avoid this? ...

.NET - Unit Testing Your Code and State in Your Database

Assumptions: We use .NET coding against SQL Server 2005 I was just wondering how most people incorporate state into the Unit Tests that affect their database? I know when and where to use mocking, but when you want to move past that and actually do some database tests... what strategies do you use to setup and teardown your database? Do...

Create history of states in Java

Hi All, I need to save a history of states over a few actions in a Java application, which I can later reload in order to restore the state at a certain action. In other words I have a screen which has a state associated with it and I need to store it as well as any changes in a history so that I can restore the state of the screen at a...

Best way to save data in a Java application?

Hi. I'm trying to find the best way to save the state of a simple application. From a DB point-of-view there are 4/5 tables with date fields and relationships off course. Because the app is simple, and I want the user to have the option of moving the data around (usb pen, dropbox, etc), I wanted to put all data in a single file. What ...

Html.Checkbox does not preserve its state in ASP.net MVC

I have this annoying issue with the checkbox created using the Html.Checkbox extension method. Apparently the state of the checkbox is not saved in case of a postback (due to a form validation error). Delving into the MVC code itself (System.Web.Mvc.Html.InputExtensions) I found out that the 'checked' property is determined by calling 'h...

Upgrade from .NET 3.0 to 3.5: Sites set to StateServer revert to InProc when in Web Garden

Scenario: Take a server running .NET 3.0 and an ASP.NET Web site running in an application pool that has Web gardens enabled (number of processes: 3). The web.config configuration is as follows: <sessionState cookieless="UseCookies" cookieName=".authz" mode="StateServer" regenerateExpiredSessionId="true" ...

Naming Convention for State / Region / Province

I am building a class that represents a US State or Canadian Province. What should the class be called? Some ideas: Region: Problem with this is that .Net has a RegionInfo class that uses the term Region to represent a country (and not a State or Province). State: Problem with this is that it could cause confusion with Application St...

Handling of UI state

I have application running on Windows written using MFC. The enable/disable state of the menu items depends upon a lot of conditions. For example, I have to enable the menu item if condition A is satisfied OR if condition B is satisfied, but should be disabled if both A AND B are TRUE at the same time. How do we model this in code ? I t...

Enum vs Lookup table vs Enum reflection vs State pattern

The software I will be building will involve "application" switching between different status a lot. Certain tasks can be done depends on the status an application is at. I was thinking about using enum as the status public class Application { public int Id {get;set;} public Status {get;set;} } public enum Status { [Description("N...

Tools for experimental Protocol Design & Development?

Are there any open source, high level tools that would facilitate and simplify development of experimental network protocols (TCP/UDP) using a GUI? Basically, something like a dynamic state machine editor that would allow you to define "packets", "messages", "states", "validators", "handlers" etc. Preferably, such a tool would be compr...

Consecutive SQL statements with state

I'm writing a simple messaging program, where there is a table of messages, which can be claimed by users and have stuff done to them by that user. It isn't predestined which user will claim a given message and so I want a query to select the first of all the available messages, which I have, and then one to mark that message as take, wh...

Modelstate with Ajax Form

I'm using an AJAX form to update an item to the database. When it gets done, it returns a partial view that re-lists all the items and displays them all in a table. The problem occurs when I have to add a modelstate error in my controller action. I don't want to return the list of items when there is a modelstate error because I want ...

UserControl Textbox Won't Maintain State

I have a very simple usercontrol, basically a textbox and a label, whose purpose is to toggle between one another. The control is bound during the page's Page_Load event. On the UserControl's Page_Load event, I call the Toggle() function, which shows or hides the appropriate control and sets its text based on a boolean Editable property ...

Many objects with global and local state

I'm looking for the best Design for the following situation. We have many objects form one class, for instance a picture frame. Now each of the picture frames can display 3 types of picture. 1) a face 2) a screenshot 3) empty Thats easy: public enum PictureMode { Face, Screen, None } public class PictureFrame { priva...

Another question about iPhone application state

Hi, I have another question about restoring application state, on the iPhone. Simple data (like the selected tab) can be stored in NSUserDefaults, but it is not enough. I want to restore the whole state, including the Navigation Controllers (go to the sub-sub-sub View Controller). My problem is that my application is divided in severa...

Bulletproof Sessions for IIS Web Farm

Good afternoon, all. We're currently making the jump from one web server to two and in order to provide seamless failover to our users we need to do something about the session. Currently, we're investigating three different methods. Make use of a state server Make use of SQL server Chuck everything into hidden fields I, personally...

What is the best way to manage Form state?

I'm developing a form in a C# .NET 2.0 application that contains complex logic regarding the state (enabled/disabled) of various controls on the form. (The design is a symptom of a business analyst's poor understanding of UI best practices.) What would be the best way to go about managing the "state" of the form? Normally, I've seen...

Recreate a Flex 3 scene

Hi, Does anyone know how i can reset/reinitialize a state in flex 3? Let's say I have the following code: <mx:states> <mx:State name="Scene1"> <mx:AddChild> <Scenes:Scene1 id="scene1"></Scenes:Scene1> </mx:AddChild> </mx:State> <mx:State name="Scene2"> <mx:AddChild> <Scenes:Sc...

How to control what happens when a program is iconned in Windows XP

I have a real-time program that needs to be operating continuously. When the program is iconned, it seems that it sometimes stops updating and other times will abort when it is restored to the active state. Is there a method of controlling what happens when my program is iconned? I am using Visual Studio 2005. ...

Advantages of stateless programming?

I've recently been learning about functional programming (specifically Haskell, but I've gone through tutorials on Lisp and Erlang as well). While I found the concepts very enlightening, I still don't see the practical side of the "no side effects" concept. What are the practical advantages of it? I'm trying to think in the functional m...