Search Results

Search found 10025 results on 401 pages for 'state restoration'.

Page 89/401 | < Previous Page | 85 86 87 88 89 90 91 92 93 94 95 96  | Next Page >

  • Linq Projection Question

    - by Micah
    I'm trying to do the following: from c in db.GetAllContactsQuery() select new { ID= c.ID, LastName = c.LastName, FirstName = c.FirstName, Email = c.Email, City =c.City+" "+c.State } The issue i'm running into is that if c.City or c.State are null, the City property returns null. How can I put a function right beside that City= declaration?

    Read the article

  • IAR MSP430 compiler internal error while compiling

    - by michael
    IAR C/C++ Compiler for MSP430 5.10.1 [Evaluation] (5.10.1.20144) I get an illegal state internal error when attempting to compile the FreeRTOS 5.4 Task.c file (everything else compiles fine) Internal Error: [CoreUtil/General]: Illegal state The kick start version of IAR (MSP430 version) works fine. Any thoughts?

    Read the article

  • WinForms: Control ListView checkbox painting

    - by Telanor
    It seems that the checkbox used in a ListView when CheckBoxes = true isn't a proper checkbox. It doesn't draw the MouseOver or MouseDown state and it doesn't support the Indeterminate/Intermediate state. How can I replace the checkbox with a standard checkbox control or take control of the drawing of just the checkbox so I can use the CheckBoxRenderer class?

    Read the article

  • Gtk, Setting GtkWindow Background from gtkrc file.

    - by PP
    I am trying to set background image to GtkWindow through gtkrc file using pixmap engine but it is not working out following is the rc file. style "theme-window" = "default" { xthickness = 1 ythickness = 1 GtkButton::inner-border = {10, 10, 10, 10} text[NORMAL] = "#FFFFFF" text[ACTIVE] = "#000000" text[PRELIGHT] = "#FFFFFF" text[INSENSITIVE] = "#787878" text[SELECTED] = "#FFFFFF" engine "pixmap" { image { function = FLAT_BOX state = NORMAL recolorable = TRUE file = "NarrowVideo.png" border = { 0, 0, 0, 0 } stretch = TRUE } image { function = FLAT_BOX state = ACTIVE recolorable = TRUE file = "NarrowVideo.png" border = { 0, 0, 0, 0 } stretch = TRUE } } } class "GtkWindow" style "theme-window"

    Read the article

  • What is SocketOptionName.ReuseAddress used for?

    - by Hemant
    I used to think that using SocketOptionName.ReuseAddress, I can reuse a port that is in TIME_WAIT state. But I tried to experiment with it and it seems it has no effect. If I check sockets using netstat, and it shows the socket is in TIME_WAIT state and I immediately run the client again, I get the exception: Only one usage of each socket address (protocol/network address/port) is normally permitted 172.16.16.16:12345 I cannot make anything out of it. Please can you elaborate what SocketOptionName.ReuseAddress is good for?

    Read the article

  • c# switch statement - variable "case"?

    - by dotnet-practitioner
    For ScoreOption, I expect to get the following input "A", "B", and T_(state) for example T_NY so.. how can I write case switch statement for third option T_(state) switch(ScoreOption.ToUpper().Trim()) { case "A": .... break; case "B": .... break; case T_???? .... break; } I might as well write if-else statement??

    Read the article

  • What is the best workaround for the WCF client `using` block issue?

    - by Eric King
    I like instantiating my WCF service clients within a using block as it's pretty much the standard way to use resources that implement IDisposable: using (var client = new SomeWCFServiceClient()) { //Do something with the client } But, as noted in this MSDN article, wrapping a WCF client in a using block could mask any errors that result in the client being left in a faulted state (like a timeout or communication problem). Long story short, when Dispose() is called, the client's Close() method fires, but throws and error because it's in a faulted state. The original exception is then masked by the second exception. Not good. The suggested workaround in the MSDN article is to completely avoid using a using block, and to instead instantiate your clients and use them something like this: try { ... client.Close(); } catch (CommunicationException e) { ... client.Abort(); } catch (TimeoutException e) { ... client.Abort(); } catch (Exception e) { ... client.Abort(); throw; } Compared to the using block, I think that's ugly. And a lot of code to write each time you need a client. Luckily, I found a few other workarounds, such as this one on IServiceOriented. You start with: public delegate void UseServiceDelegate<T>(T proxy); public static class Service<T> { public static ChannelFactory<T> _channelFactory = new ChannelFactory<T>(""); public static void Use(UseServiceDelegate<T> codeBlock) { IClientChannel proxy = (IClientChannel)_channelFactory.CreateChannel(); bool success = false; try { codeBlock((T)proxy); proxy.Close(); success = true; } finally { if (!success) { proxy.Abort(); } } } } Which then allows: Service<IOrderService>.Use(orderService => { orderService.PlaceOrder(request); } That's not bad, but I don't think it's as expressive and easily understandable as the using block. The workaround I'm currently trying to use I first read about on blog.davidbarret.net. Basically you override the client's Dispose() method wherever you use it. Something like: public partial class SomeWCFServiceClient : IDisposable { void IDisposable.Dispose() { if (this.State == CommunicationState.Faulted) { this.Abort(); } else { this.Close(); } } } This appears to be able to allow the using block again without the danger of masking a faulted state exception. So, are there any other gotchas I have to look out for using these workarounds? Has anybody come up with anything better?

    Read the article

  • UISwitch not tapped on right area

    - by beryllium
    I placed UISwitch on main view. Now I try change state. But the state changed only when I touch on the left side of the UISwitch. and never on the right. For example in Settings App the airplane mode chanhed any of those ways. Can anybody help me?

    Read the article

  • hand coding a parser

    - by John Leidegren
    For all you compiler gurus, I wanna write a recursive descent parser and I wanna do it with just code. No generating lexers and parsers from some other grammar and don't tell me to read the dragon book, i'll come around to that eventually. I wanna get into the gritty details about implementing a lexer and parser for a reasonable simple langauge, say CSS. And I wanna do this right. This will probably end up being a series of questions but right now I'm starting with a lexer. Tokenization rules for CSS can be found here. I find my self writing code like this (hopefully you can infer the rest from this snippet): public CssToken ReadNext() { int val; while ((val = _reader.Read()) != -1) { var c = (char)val; switch (_stack.Top) { case ParserState.Init: if (c == ' ') { continue; // ignore } else if (c == '.') { _stack.Transition(ParserState.SubIdent, ParserState.Init); } break; case ParserState.SubIdent: if (c == '-') { _token.Append(c); } _stack.Transition(ParserState.SubNMBegin); break; What is this called? and how far off am I from something reasonable well understood? I'm trying to balence something which is fair in terms of efficiency and easy to work with, using a stack to implement some kind of state machine is working quite well, but I'm unsure how to continue like this. What I have is an input stream, from which I can read 1 character at a time. I don't do any look a head right now, I just read the character then depending on the current state try to do something with that. I'd really like to get into the mind set of writing reusable snippets of code. This Transition method is currently means to do that, it will pop the current state of the stack and then push the arguments in reverse order. That way, when I write Transition(ParserState.SubIdent, ParserState.Init) it will "call" a sub routine SubIdent which will, when complete, return to the Init state. The parser will be implemented in much the same way, currently, having everyhing in a single big method like this allows me to easily return a token when I found one, but it also forces me to keep everything in one single big method. Is there a nice way to split these tokenization rules into seperate methods? Any input/advice on the matter would be greatly appriciated!

    Read the article

  • How to get an hierarchical php structure from a db table, in php array, or JSON

    - by daniel
    Hi guys, can you please help me. How to get an hierarchical php structure from a db table, in php array, or JSON, but with the following format: [{ "attributes" : {"id" : "111"}, "data" : "Some node title", "children" : [ { "attributes" : { "id" : "555"}, "data" : "A sub node title here" } ], "state" : "open" }, { "attributes" : {"id" : "222"}, "data" : "Other main node", "children" : [ { "attributes" : { "id" : "666"}, "data" : "Another sub node" } ], "state" : "open" }] My SQL table contains the fields: ID, PARENT, ORDER, TITLE Can you please help me with this? I'm going crazy trying to get this. Many thanks in advance. Daniel

    Read the article

  • Start a short video when an incoming call is detected, first case using the emulator.

    - by Emanuel
    I want to be able to start a short video on an incoming phone call. The video will loop until the call is answered. I've loaded the video onto the emulator sdcard then created the appropriate level avd with a path to the sdcard.iso file on disk. Since I'm running on a Mac OS x snow leopard I am able to confirm the contents of the sdcard. All testing has be done on the Android emulator. In a separate project TestVideo I created an activity that just launches the video from the sdcard. That works as expected. Then I created another project TestIncoming that creates an activity that creates a PhoneStateListener that overrides the onCallStateChanged(int state, String incomingNumber) method. In the onCallStateChanged() method I check if state == TelephonyManager.CALL_STATE_RINGING. If true I create an Intent that starts the video. I'm actually using the code from the TestVideo project above. Here is the code snippet. PhoneStateListener callStateListener = new PhoneStateListener() { @Override public void onCallStateChanged(int state, String incomingNumber) { if(state == TelelphonyManager.CALL_STATE_RINGING) { Intent launchVideo = new Intent(MyActivity.this, LaunchVideo.class); startActivity(launchVideo); } } }; The PhoneStateListener is added to the TelephonyManager.listen() method like so, telephonyManager.listen(callStateListener, PhoneStateListener.LISTEN_CALL_STATE); Here is the part I'm unclear on, the manifest. What I've tried is the following: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.incomingdemo" android:versionCode="1" android:versionName="1.0"> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".IncomingVideoDemo" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.ANSWER" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity> <activity android:name=".LaunchVideo" android:label="LaunchVideo"> </activity> </application> <uses-sdk android:minSdkVersion="2" /> <uses-permission android:name="android.permission.READ_PHONE_STATE"/> </manifest> I've run the debugger after setting breakpoints in the IncomingVideoDemo activity where the PhoneStateListener is created and none of the breakpoints are hit. Any insights into solving this problem is greatly appreciated. Thanks.

    Read the article

  • Drupal location autosuggest doesn't recognize provinces

    - by harry_T
    I am using Drupal Location module in CCK to retreive longitude & latitude based on location (stree/city/state). There is an automatic autosuggest for State, but unfortunately recognizes only US states. I set default country to Canada, but autosuggest still only recognized US states. Is there a way to get autosuggest function to recognize Canadian provinces or to disable this feature. thanks!

    Read the article

  • In XMLHttpRequest, where is error flag variable?

    - by Tiangolo
    In the XMLHttpRequest Spec it says that: The DONE state has an associated error flag that indicates some type of network error or abortion. It can be either true or false and has an initial value of false. Also says something similar about a "send() flag" in an "OPENED" state. It's said in the specification but not in the IDL and when I create a new XMLHttpRequest I can't find those "flags". Where are those boolean variables?

    Read the article

  • Combined states, FSM

    - by bobobobo
    Not sure this is the right place to ask, but is it "correct" to combine states of an FSM? Say you have an object with enum State { State1 = 1 << 0, State2 = 1 << 1, State3 = 1 << 2 } ; It just so happens that it makes sense to combine states, as in State myState = State1 | State2 ; however in FSM theory is this illegal?

    Read the article

  • I get an error when implementing tde in SQL Server 2008

    - by mahima
    While using USE mssqltips_tde; CREATE DATABASE ENCRYPTION KEY with ALGORITHM = AES_256 ENCRYPTION BY SERVER CERTIFICATE TDECert GO I'm getting an error Msg 156, Level 15, State 1, Line 2 Incorrect syntax near the keyword 'KEY'. Msg 319, Level 15, State 1, Line 3 Incorrect syntax near the keyword 'with'. If this statement is a common table expression or an xmlnamespaces clause, the previous statement must be terminated with a semicolon. please help in resolving the same as i need to implement Encryption on my DB

    Read the article

  • Wcf exception handling

    - by pdiddy
    I noticed that if you do a throw new InvalidCastException for example, the channel state on the client side is faulted. But if you throw new FaultException, the channel state on the client side is opened. By curiosity, what is the reason why one faults the channel and the other doesn't?

    Read the article

  • Simulate Network Presence in dbus

    - by Evans
    Is there a way using Python to simulate the presence of an active network connection using dbus? If I call getstate() on the dbus, I'm able to get the current network state. I want to set the current state to 4 (Connection Present). This is because Network Manager is not able to connect using my modem and I use other tools to connect. Pidgin, Empathy and other software are not able to detect the network.

    Read the article

  • Qt QTableView and horizontalHeader()->restoreState()

    - by cheez
    I can't narrow down this bug, however I seem to have the following problem: - saveState() of a horizontalHeader() - restart app - Modify model so that it has one less column - restoreState() - Now, for some reason, the state of the headerview is totally messed up. I cannot show or hide any new columns, nor can I ever get a reasonable state back I know, this is not very descriptive but I'm hoping others have had this problem before.

    Read the article

  • How to generate automatic response from the server in flex

    - by Jeeva
    I'm developing a web based game application using flex. I'm placing images dynamically inside a canvas . Whenever i place an image it should change it state after a period of time. For example after 2 mins it should change it state. The time has to be calculated for each image after i place the image. How shall i handle this.

    Read the article

  • Do I need to explicitly destroy JavaScript objects on window unload?

    - by Bilal Aslam
    I have a JavaScript widget that is hosted on websites. This widget tracks state in a number of variables in its local namespace. Moreover, it attaches listeners for several events, such as mouse movement. Should I explicitly destroy both state-tracking variables and detach event listeners on window unload? Or is it ok to rely on the browser to do a good job of cleaning up after the user leaves the page that hosts my widget?

    Read the article

  • How to catch 'exceptions' for out of order execution in Workflow Foundation 4?

    - by Alex Key
    Hi, I am attempting to model a worklfow using a "WCF Workflow Service" in .net / vs 2010 that needs to handle out of order execution gracefully (but not allow it - if thath makes sense!?) For example I have 2 receive activities one called Initialize and the other called GetValue inside a FlowChart. In most cases Initialize should be called first and GetValue after (as modled in the flow chart). However if GetValue is executed before Initialize I do not want to return an "out of order" exception (although when I look at the WCF test client, I can't actually see an exception). But instead a custom exception saying something like "you must initialize first". In theory I could model this with lots of parallel activities and conditions to check if Initialized / Running / Terminated etc. But the business process I am modelling if very very similar to a state machine... except it must handle people executing things in the wrong order. Ideally I would like to catch the "out of order" exception (thought I don't think it's really an exception as such), check the 'exception' to see which function was attempted to run and then handle it. I have done some research around enabling AllowBufferedReceive. However I don't want to be able to execute out of order (I don't think), but instead give a detailed response if it does happen. I've looked at the new beta state machine template for WF 4 - but i'm not sure if it does what i'm after? I'm not sure if I have the wrong end of the stick, so any help would be greatly appreciated. [EDIT] To help clarify... Sorry it's a tricky one to explain. The standard I am trying to implement (the e-learning standard SCORM RTE) is structured like a state machine i.e. certain functions can only be executed in certain states. However the standard specifies that if the calling clients tries to execute a function that it is not meant to, then a warning should be issued... for example "you cannot use GetValue(), because you have not yet Initialized". Ideally I'd like to structure the workflow as the theoretical state machine and not need to have to use multiple if/else's to handle all the scenarios where something could be executed out-of-order. I'd like to catch a out-of-order exception (but I don't think there is such an exception - as it's not in the debugger) and rethrow it.

    Read the article

  • image button template?

    - by Rev
    Hi I want Image button with two state(normal , mouse over). that button must change image with Mouse Over event trigger automatically. this image button must be a user control. Also i want to set image for each state form code in which form i use that user control. Solution is using a template with "Value Converter" but i don't know how?

    Read the article

  • Class type while deserialization in c++

    - by Rushi
    I am developing game editor in c++.I have implemented reflection mechanism using DiaSDK.Now I want to store state of the objects(Like Camera,Lights,Static mesh) in some level file via serialization. And later on able to retrieve their state via deserialization.Serializing objects is not a problem for me.But while deserializing objects how do I know class type?so that i can create object of that particular type.

    Read the article

< Previous Page | 85 86 87 88 89 90 91 92 93 94 95 96  | Next Page >