state

Accessing child and parent elements in Silverlight styles on different states

I'm currently styling a Silverlight combobox. The designer wants the combobox to turn black on "pressed", a state that is not supported by the combobox itself, but is available on the togglebutton ("DropDownToggle") within the combobox. So I edit the template for the togglebutton, and make it black on "pressed". No problem. The problem ...

state design pattern from Java to Ruby

Hello, I have a working solution in java using a classic state design pattern and facing some difficulties translating it to ruby. I am new in ruby, but the diffuclty I believe lies in the differences on how patterns can be implemented in dynamic languages. My interface is describing the actions the model can execute in every state: p...

Wildcard for PyGTK States

How do I combine: button.modify_bg(gtk.STATE_NORMAL, gtk.gdk.color_parse("Green")) button.modify_bg(gtk.STATE_ACTIVE, gtk.gdk.color_parse("Green")) button.modify_bg(gtk.STATE_SELECTED, gtk.gdk.color_parse("Green")) etc. Into a one-liner wildcard covering all of the possible states (See Doc) ...

Entity Framework caching under ASP.Net

I was trying to find out which Entity Framework objects, if any, remain live after the end of an HTTP request that is being handled by ASP .Net? i.e. Does an ASP .Net application benefit from any of the Entity Framework caching mechanisms across different requests? This article describes the operations that are occurring under the hood...

HttpApplicationState - Why does Race condition exist if it is thread safe ?

I just read an article that describes how HttpApplicationState has AcquireRead() / AcquireWrite() functions to manage concurrent access. It continues to explain, that in some conditions however we need to use an explict Lock() and Unlock() on the Application object to avoid a Race condition. I am unable to understand why a race conditi...

ASP.NET GridView with LinqDataSource: Remeber Sorting, Paging and WhereParameters state

I'm using a standard GridView with a LinqDataSource. The user can sort and page through the grid using the stock standard stuff. Searching criteria (WhereParameters) can also be used to filter the results. This works great, but the state is obviously lost whenever navigating away from the page. So a generic mechanism of capturing the So...

Saving the State of a System

A very flowery title indeed. I have a PHP web application that is in the form of a web based wizard. A user can run through the wizard and select options, run process (DB queries) etc. They can go backwards and forwards and run process again and again. I am trying to work out how to best save the state of what users do/did, what proces...

WPF and State Machine Pattern

Hi guys, I want to implement functionality that give possibility switch tabItems (TabItem1,TabItem2,TabItem3), when user click button "next" on the Form. And for that reason I'd like to use State Machine Pattern. These things I've already implemented, but I have no clue, is it right or not?: public abstract class State { #...

changed object after storage or object-state used

Example: class UserStorage { public function addUser(User $user) { //saves to db } } class User { public function setName($name); } What if I add a user to the user storage and later change that user object? In this case you might argue that user objects only should be stored on __destruct. But sometimes this isn't an option ...

MS CRM 4.0 CrmService - Close a Task

Hey guys, I'm trying to work out how to use the CrmService to close a Task in MS CRM 4.0 I've tried to use the SetStateTaskRequest to set a Task's state and status to TaskState.Completed and 5. I also tried TaskState.Completed and -1, but no dice there either. Either way, I only receive the ever-helpful "Server was unable to process r...

Stateful experience

What are three ways in which web applications can provide a stateful experience for the user?(using http) I know Sessions and Cookies are two of them, but don't know a third (database??) Yes a question from a lecture. ...

How to save the state of a dojo grid

I want the user to be able to save the state of their grid, so that their sort options, column widths (and order) are preserved for the duration of their visit. Does anyone know of a way of doing this? I have noticed that the dhtmlXGrid provides a cookie interface for doing this: http://www.dhtmlx.com/dhxdocs/doku.php?id=dhtmlxgrid%3Acoo...

Preserving state in Silverlight 3

Hi, I'm developing a Silverlight 3 Application which I want to connect to a webservice with a provided .dll or with SOAP. But the .dll is not suited for Silverlight so I can not do that. And I can't access the SOAP service because of cross-domain issues (I do not host it so a clientpolicy xml will not do). So my solution is the include...

Does static imply no state

I recently made a recommendation to one of my colleagues stating that on our current project (C#) "services should be stateless and therefore static". My colleague agreed and indicated that in our project the services are (and should be) indeed stateless. However my colleague disagreed that static implies no state and that stateless sh...

Activator.GetObject - Using the state parameter.

In .NET Remoting, Activator.GetObject method has a state parameter. What is the purpose of this state param? Can I retrieve its value from server side? mdsn didn't help much. What I'd like to do: Client side: ChannelServices.RegisterChannel(new TcpChannel(0)); object obj = Activator.GetObject(typeof(MyObj), "tcp://serverName:1234/Remot...

WCF service running as WindowsService and somehow goes into FaultedState

Hi, WCF Service hosted as windows service Using netmsmq binding MSMQ is transactional Windows 2003 server to host MSMQ 3.0 Due to some reason exceptions are raised and so it puts the message back in the queue and tries for serval times and then goes in faulted state. So what should be the mechanism to handle this type of scenarios...

Can you provide information or links that discuss using resource state over session or DB state?

There is a talk here by Stefan Tilkov, where he is describing REST architecture at its core. I haven't watched all of it, but in the portion where he talks about the 5 Principles of REST (slides 12-19) he mentions maintaining state through the resource (i.e. -- the URI). His example is a shopping cart. Usually the state of your shopping ...

In Flex, How can I prevent my variable from losing state after being set?

I've hit a very strange issue in adobe flex and I'm not sure how to solve it. I have a popup box that is called on creationComplete before startup of my main application. The popup simply asks for an email address and then the application is enabled showing the email address in a label component. However, when I try to access the email ...

Can Iphone restore the state of app after [[UIApplication sharedApplication] openURL:[NSURL URLWithString:call_url]];

In my Iphone app I give a button when pressed calls a specific number using the following function call and uses the native iphone call app. [[UIApplication sharedApplication] openURL:[NSURL URLWithString:call_url]]; where call_url is of the form tel:// Once the call is done, is there a way to restore and open my Iphone App as it was ...

combining decorator and state pattern in java - question about OO design

I am in the middle of solving a problem where I think it's best suited for a decorator and a state pattern. The high level setting is something like a sandwich maker and dispenser, where I have a set amount of ingredients and a few different types of sadnwiches i can make. Each ingedient has a cost associated with it. The client would be...