Search Results

Search found 15137 results on 606 pages for 'global state'.

Page 73/606 | < Previous Page | 69 70 71 72 73 74 75 76 77 78 79 80  | Next Page >

  • How do I reset the state of a view inside a tabbar?

    - by ABeanSits
    Hello CocoaTouch-Experts! This is a fairly straightforward question though my Googling session gave me nothing. How do I reset the state of a view hierarchy located in a tabbar programmatically? The behavior I want to replicate is when the user tapps on a tab twice. This causes the view located under that tab to return to it's initial state. The tab is "owned" by a UINavigationController and when the user reaches a certain point in the view hierarchy there is a button which I want to connect this behavior to. All my attempts have failed except calling on a method in AppDelegate which kills the view and adds it back to the UITabBarController again. But this does not feel like the right way to go. Thanks in advance. Best regards //Abeansits

    Read the article

  • Problem accessing MICROSOFT##SSEE database (Error: 18456, Severity: 14, State: 16.)

    - by Philipp Schmid
    After an unexpected server shutdown due to a power failure, I can no longer connect to the internal windows database MICROSOFT##SSEE which is hosting Central Admin for my SBS 2008 server. The log shows: Error: 18456, Severity: 14, State: 16. Login failed for user 'NT AUTHORITY\NETWORK SERVICE'. [CLIENT: <named pipe>] I've tried to connect using the SQL Management studio (connecting to .pipemssql$microsoft##sseesqlquery) but no luck. The SQL Server Configuration Manager doesn't show a entry for 'Protocols for MICROSOFT##SSEE' (but shows it for 2 other database hosted on the same SQL server 2005 Express edition. I have tried to restore the master.ldf and mastlog.log files from a backup, but the issue persists.

    Read the article

  • How to: StructureMap and configuration based on runtime parameters?

    - by user981375
    In a nutshell - I want to be able to instantiate object based on runtime parameters. In this particular case there are only two parameters but the problem is that I'm facing different permutations of these parameters and it gets messy. Here is the situation: I want to get an instance of an object specific to, say, given country and then, say, specific state/province. So, considering the US, there are 50 possible combinations. In reality it's less than that but that's the max. Think of it this way, I want to find out what's the penalty for smoking pot in a given country/state, I pass this information in and I get instantiated object telling me what it is. To the code (for reference only): interface IState { string Penalty { get; } } interface ICountry { IState State { get; set; } string Name { get; } } class BasePenalty : IState { virtual public string Penalty { get { return "Slap on a wrist"; } } } class USA : ICountry { public USA(IState state) { State = state; } public IState State { get; set; } public string Name { get { return "USA"; } } } class Florida: BasePenalty { public override string Penalty { get { return "Public beheading"; } } } // and so on ... I defined other states // which have penalties other than the "Slap on a wrist" How do I configure my container that when given country and state combination it will return the penalty? I tried combinations of profile and contextual binding but that configuration was directly proportional to the number of classes I've created. I have already gone thru trouble of defining different combinations. I'd like to avoid having to do the same during container configuration. I want to inject State into the Country. Also, I'd like to return UsaBasePenalty value in case state is not specified. Is that possible? Perhaps these is something wrong with the design.

    Read the article

  • Using Boost statechart, how can I transition to a state unconditionally?

    - by nickb
    I have a state A that I would like to transition to its next state B unconditionally, once the constructor of A has completed. Is this possible? I tried posting an event from the constructor, which does not work, even though it compiles. Thanks. Edit: Here is what I've tried so far: struct A : sc::simple_state< A, Active > { public: typedef sc::custom_reaction< EventDoneA > reactions; A() { std::cout << "Inside of A()" << std::endl; post_event( EventDoneA() ); } sc::result react( const EventDoneA & ) { return transit< B >(); } }; This yields the following runtime assertion failure: Assertion failed: get_pointer( pContext_ ) != 0, file /includ e/boost/statechart/simple_state.hpp, line 459

    Read the article

  • Shoud a method that waits for a change of state be const?

    - by Space_C0wb0y
    In a multithreaded scenario, I have a method like this: bool WaitForChange( time_duration WaitTime ) const; This method waits either until the state of the object has changed and returns true, or until the timeout times out (how do you say that?) and returns false. My intuition is, that const is to protect against unwanted side-effects of the method itself, so this is fine. But then again, some user might think that the state of the could not have changed, since the method is declared const. Is that user stupid, or should I make the method non-const in order to avoid confusion?

    Read the article

  • How to properly scroll a 2D tilemap?

    - by Sri Harsha Chilakapati
    Hello and I'm trying to make my own game engine in Java. I have completed all the necessary ones but I can't figure it out with the TileGame class. It just can't scroll. Also there are no exceptions. Here I'm listing the code. TileGame.java @Override public void draw(Graphics2D g) { if (back!=null){ back.render(g); } if (follower!=null){ follower.render(g); follower.draw(g); } for (int i=0; i<actors.size(); i++){ Actor actor = actors.get(i); if (actor!=follower&&getVisibleRect().intersects(actor.getBounds())){ g.drawImage(actor.getAnimation().getFrameImage(), actor.x - OffSetX, actor.y - OffSetY, null); actor.draw(g); } } } /** * This method returns the visible rectangle * @return The visible rectangle */ public Rectangle getVisibleRect(){ return new Rectangle(OffSetX, OffSetY, global.WIDTH, global.HEIGHT); } @Override public void update(){ if (follower!=null){ if (scrollHorizontally){ OffSetX = global.WIDTH/2 - Math.round((float)follower.x) - tileSize; OffSetX = Math.min(OffSetX, 0); OffSetX = Math.max(OffSetX, global.WIDTH - mapWidth); } if (scrollVertically){ OffSetY = global.HEIGHT/2 - Math.round((float)follower.y) - tileSize; OffSetY = Math.min(OffSetY, 0); OffSetY = Math.max(OffSetY, global.HEIGHT - mapHeight); } } for (int i=0; i<actors.size(); i++){ Actor actor1 = actors.get(i); if (getVisibleRect().contains(actor1.x, actor1.y)){ actor1.update(); for (int j=0; j<actors.size(); j++){ Actor actor2 = actors.get(j); if (actor1.isCollidingWith(actor2)){ actor1.collision(actor2); actor2.collision(actor1); } } } } } but the problem is that all the actors are working, but it just won't scroll. Help Please.. Thanks in Advance.

    Read the article

  • How I understood monads, part 1/2: sleepless and self-loathing in Seattle

    - by Bertrand Le Roy
    For some time now, I had been noticing some interest for monads, mostly in the form of unintelligible (to me) blog posts and comments saying “oh, yeah, that’s a monad” about random stuff as if it were absolutely obvious and if I didn’t know what they were talking about, I was probably an uneducated idiot, ignorant about the simplest and most fundamental concepts of functional programming. Fair enough, I am pretty much exactly that. Being the kind of guy who can spend eight years in college just to understand a few interesting concepts about the universe, I had to check it out and try to understand monads so that I too can say “oh, yeah, that’s a monad”. Man, was I hit hard in the face with the limitations of my own abstract thinking abilities. All the articles I could find about the subject seemed to be vaguely understandable at first but very quickly overloaded the very few concept slots I have available in my brain. They also seemed to be consistently using arcane notation that I was entirely unfamiliar with. It finally all clicked together one Friday afternoon during the team’s beer symposium when Louis was patient enough to break it down for me in a language I could understand (C#). I don’t know if being intoxicated helped. Feel free to read this with or without a drink in hand. So here it is in a nutshell: a monad allows you to manipulate stuff in interesting ways. Oh, OK, you might say. Yeah. Exactly. Let’s start with a trivial case: public static class Trivial { public static TResult Execute<T, TResult>( this T argument, Func<T, TResult> operation) { return operation(argument); } } This is not a monad. I removed most concepts here to start with something very simple. There is only one concept here: the idea of executing an operation on an object. This is of course trivial and it would actually be simpler to just apply that operation directly on the object. But please bear with me, this is our first baby step. Here’s how you use that thing: "some string" .Execute(s => s + " processed by trivial proto-monad.") .Execute(s => s + " And it's chainable!"); What we’re doing here is analogous to having an assembly chain in a factory: you can feed it raw material (the string here) and a number of machines that each implement a step in the manufacturing process and you can start building stuff. The Trivial class here represents the empty assembly chain, the conveyor belt if you will, but it doesn’t care what kind of raw material gets in, what gets out or what each machine is doing. It is pure process. A real monad will need a couple of additional concepts. Let’s say the conveyor belt needs the material to be processed to be contained in standardized boxes, just so that it can safely and efficiently be transported from machine to machine or so that tracking information can be attached to it. Each machine knows how to treat raw material or partly processed material, but it doesn’t know how to treat the boxes so the conveyor belt will have to extract the material from the box before feeding it into each machine, and it will have to box it back afterwards. This conveyor belt with boxes is essentially what a monad is. It has one method to box stuff, one to extract stuff from its box and one to feed stuff into a machine. So let’s reformulate the previous example but this time with the boxes, which will do nothing for the moment except containing stuff. public class Identity<T> { public Identity(T value) { Value = value; } public T Value { get; private set;} public static Identity<T> Unit(T value) { return new Identity<T>(value); } public static Identity<U> Bind<U>( Identity<T> argument, Func<T, Identity<U>> operation) { return operation(argument.Value); } } Now this is a true to the definition Monad, including the weird naming of the methods. It is the simplest monad, called the identity monad and of course it does nothing useful. Here’s how you use it: Identity<string>.Bind( Identity<string>.Unit("some string"), s => Identity<string>.Unit( s + " was processed by identity monad.")).Value That of course is seriously ugly. Note that the operation is responsible for re-boxing its result. That is a part of strict monads that I don’t quite get and I’ll take the liberty to lift that strange constraint in the next examples. To make this more readable and easier to use, let’s build a few extension methods: public static class IdentityExtensions { public static Identity<T> ToIdentity<T>(this T value) { return new Identity<T>(value); } public static Identity<U> Bind<T, U>( this Identity<T> argument, Func<T, U> operation) { return operation(argument.Value).ToIdentity(); } } With those, we can rewrite our code as follows: "some string".ToIdentity() .Bind(s => s + " was processed by monad extensions.") .Bind(s => s + " And it's chainable...") .Value; This is considerably simpler but still retains the qualities of a monad. But it is still pointless. Let’s look at a more useful example, the state monad, which is basically a monad where the boxes have a label. It’s useful to perform operations on arbitrary objects that have been enriched with an attached state object. public class Stateful<TValue, TState> { public Stateful(TValue value, TState state) { Value = value; State = state; } public TValue Value { get; private set; } public TState State { get; set; } } public static class StateExtensions { public static Stateful<TValue, TState> ToStateful<TValue, TState>( this TValue value, TState state) { return new Stateful<TValue, TState>(value, state); } public static Stateful<TResult, TState> Execute<TValue, TState, TResult>( this Stateful<TValue, TState> argument, Func<TValue, TResult> operation) { return operation(argument.Value) .ToStateful(argument.State); } } You can get a stateful version of any object by calling the ToStateful extension method, passing the state object in. You can then execute ordinary operations on the values while retaining the state: var statefulInt = 3.ToStateful("This is the state"); var processedStatefulInt = statefulInt .Execute(i => ++i) .Execute(i => i * 10) .Execute(i => i + 2); Console.WriteLine("Value: {0}; state: {1}", processedStatefulInt.Value, processedStatefulInt.State); This monad differs from the identity by enriching the boxes. There is another way to give value to the monad, which is to enrich the processing. An example of that is the writer monad, which can be typically used to log the operations that are being performed by the monad. Of course, the richest monads enrich both the boxes and the processing. That’s all for today. I hope with this you won’t have to go through the same process that I did to understand monads and that you haven’t gone into concept overload like I did. Next time, we’ll examine some examples that you already know but we will shine the monadic light, hopefully illuminating them in a whole new way. Realizing that this pattern is actually in many places but mostly unnoticed is what will enable the truly casual “oh, yes, that’s a monad” comments. Here’s the code for this article: http://weblogs.asp.net/blogs/bleroy/Samples/Monads.zip The Wikipedia article on monads: http://en.wikipedia.org/wiki/Monads_in_functional_programming This article was invaluable for me in understanding how to express the canonical monads in C# (interesting Linq stuff in there): http://blogs.msdn.com/b/wesdyer/archive/2008/01/11/the-marvels-of-monads.aspx

    Read the article

  • I can't scroll my tilemap ... HELP!

    - by Sri Harsha Chilakapati
    Hello and I'm trying to make my own game engine in Java. I have completed all the necessary ones but I can't figure it out with the TileGame class. It just can't scroll. Also there are no exceptions. Here I'm listing the code. TileGame.java @Override public void draw(Graphics2D g) { if (back!=null){ back.render(g); } if (follower!=null){ follower.render(g); follower.draw(g); } for (int i=0; i<actors.size(); i++){ Actor actor = actors.get(i); if (actor!=follower&&getVisibleRect().intersects(actor.getBounds())){ g.drawImage(actor.getAnimation().getFrameImage(), actor.x - OffSetX, actor.y - OffSetY, null); actor.draw(g); } } } /** * This method returns the visible rectangle * @return The visible rectangle */ public Rectangle getVisibleRect(){ return new Rectangle(OffSetX, OffSetY, global.WIDTH, global.HEIGHT); } @Override public void update(){ if (follower!=null){ if (scrollHorizontally){ OffSetX = global.WIDTH/2 - Math.round((float)follower.x) - tileSize; OffSetX = Math.min(OffSetX, 0); OffSetX = Math.max(OffSetX, global.WIDTH - mapWidth); } if (scrollVertically){ OffSetY = global.HEIGHT/2 - Math.round((float)follower.y) - tileSize; OffSetY = Math.min(OffSetY, 0); OffSetY = Math.max(OffSetY, global.HEIGHT - mapHeight); } } for (int i=0; i<actors.size(); i++){ Actor actor1 = actors.get(i); if (getVisibleRect().contains(actor1.x, actor1.y)){ actor1.update(); for (int j=0; j<actors.size(); j++){ Actor actor2 = actors.get(j); if (actor1.isCollidingWith(actor2)){ actor1.collision(actor2); actor2.collision(actor1); } } } } } but the problem is that all the actors are working, but it just won't scroll. Help Please.. Thanks in Advance.

    Read the article

  • Laptop drains of quickly with battery

    - by Shyam
    I am a user since years in ubuntu and I have not come across this problem with ubuntu till date. My battery drains off immediately after I unplug my AC power. The options I tried: 1) checked the battery state with : cat /proc/acpi/battery/BAT0/state present: yes capacity state: ok charging state: charged present rate: 0 mA remaining capacity: 392 mAh present voltage: 12476 mV Initially it was showing charging state: charging after 5mins it started displaying as charged. ! Based on that if I remove my AC Power it shows low battery notification. 2) When I run acpi : acpi -b Battery 0: Unknown, 9% The battery state shows as unknown. But initially when we plug-in to AC adapter acpi -b Battery 0: Charging, 9%, 13:04:00 until charged 3) When the check the same with : upower -i /org/freedesktop/UPower/devices/battery_BAT0 native-path: /sys/devices/LNXSYSTM:00/device:00/PNP0A08:00/device:02/PNP0C09:00/PNP0C0A:00/power_supply/BAT0 vendor: HP power supply: yes updated: Thu Nov 1 16:06:40 2012 (20 seconds ago) has history: yes has statistics: yes battery present: yes rechargeable: yes state: charging energy: 4.2336 Wh energy-empty: 0 Wh energy-full: 33.1128 Wh energy-full-design: 33.1128 Wh energy-rate: 5.6052 W voltage: 12.474 V time to full: 5.2 hours percentage: 12.7854% capacity: 100% technology: lithium-ion Is the power stats output, It says 5hrs to charge completely, If I charge it even more than 5hrs and unplug the AC power, It again cribs stating LOW BATTERY !! The same thing does not happen with Windows7. Any suggestions/ help will be greatly appreciated.

    Read the article

  • Preventing item duplication?

    - by PuppyKevin
    For my game, there's two types of items - stackable, and nonstackable. Nonstackable items get assigned a unique ID that stays with it forever. A character ID is assosicated with the item, as is a state (CHANGED, UNCHANGED, NEW, REMOVED). The character ID and state is used for item saving purposes. Stackable items have one unique ID, as in the entire stack has one unique ID. For example: 5 Potions (stacked ontop of each other) has one unique ID. When dropping a nonstackable item, the state gets set to REMOVED, and the unique ID and state don't change. If picked up by another player, the state gets set to NEW, and the character ID gets changed to the new character's ID. When dropping all items in a stack of stackable items (for example, 5 potions out of 5) - it behaves just like a nonstackable item. When dropping some of a stack of stackable items (for example, 3 potions out of 5)... I really have no clue what to do. The 3 dropped potions have the state of REMOVED, but the same unique ID and character ID. If another player picks it up, it has no choice but to obtain a new unique ID, and its state gets changed to NEW and its character ID to the new one. If the dropping player picks it back up, they'd just be readded to the stack. There's two issues with that though. 1. If the player who dropped the 3 potions picks it back up, there's no way to tell if they legitimately dropped the items, or if they're duped items. 2. If another player picks up the 3 potions (assuming they're duped), there's no way to know if they're duped or not. My question is: How can I create a system that detects duplicated items for both nonstackable and stackable items?

    Read the article

  • Security &amp; Dev Opinions needed for 2013 Global Information Security Workforce study and have a chance to win an Ipad!

    - by SoftwareSecurity
    You have the opportunity to help guide the security profession world wide with your opinions and experiences by taking part in the 2013 edition of (ISC)2 Global Information Security Workforce Study and have the chance to win an Ipad!  This study will provide an understanding about upcoming trends, technologies, and visions that as technology professional you will be able to provide invaluable understanding.  The study is being conducted by Frost & Sullivan.  You can participate in the study by clicking here.  Read the last study that was conducted in 2011 and provided tremendous insight into upcoming Trends.  Software developers are encouraged to respond!

    Read the article

  • how to override ckeditor events [migrated]

    - by joe
    I am new to ckeditor, I have hard time figuring this issue out. due to my html design; if I try to use the link editor dialog while my ckeditor is maximized, it just doesn't show up, I understand that ckeditor is the top most object in my html page and the link dialog comes underneath it. if now I bring ckeditor to its normal state I will be able to see and use the link dialog. my idea is to slightly override the link button click event as follows: if the editor is in full screen mode, bring it back to the normal state. and keep a flag somewhere so that when I close the link dialog, I can decide whether to bring back the ckeditor to a maximized mode again. now this is easy logic except that I do not know how to override the click event of the link button and keep it work as expected. here's what I have: $().ready(function () { var editor = $('#txa').ckeditor(); CKEDITOR.plugins.registered['link']= { init : function( editor ) { var command = editor.addCommand( 'link', { modes : { wysiwyg:1, source:1 }, exec : function( editor ) { if(editor.commands.maximize.state == 1 ){ alert("maximized"); //....here bring back the editor to UN-maximized state and let the link button event click do the default behavior } else { alert("normal state"); } //2 is normal state //1 is maximized } } ); editor.ui.addButton( 'link',{label : 'YOUR LABEL',command : 'link'}); } } }); html part to make the exemple work: <div> <textarea id="txa"> </textarea> </div> TO BE SHORT: http://jsfiddle.net/Q43QP/ if the editor is maximized, bring it to normal state then show the link dialog.

    Read the article

  • How to add global exception handling to a add-in dll?

    - by redjackwong
    Here's my context: I am writing a WPF add-in for an application. This Application's main thread is unmanaged. I want to add a global exception handling system for this add-in to handle any unhandled exceptions. Here's what I've tried but not working: I cannot add a try-catch block to my Application.Run() code line. Because I am an add-in, that code fragment is in the application. System.Windows.Forms.Application.ThreadException is not working too. There might not be an WinForm Application exists. (WPF hosting in unmanaged code.) AppDomain.CurrentDomain.UnhandledException is not working too. Because maybe it's handled by the Application itself. It just doesn't enter my code. So, any ideas for this situation?

    Read the article

  • After reading this article I'm thinking to move eric meyer reset to global reset, would it be wise m

    - by metal-gear-solid
    After reading this article I'm thinking to change my css reset from eric meyer reset to global reset * {margin:0;padding:0} or thinking to use like this only body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, code, form, fieldset, legend, textarea, p, blockquote, th, td, a { border: 0 none; font-family: inherit; font-size: 100%; font-style: inherit; font-weight: inherit; text-decoration: none; vertical-align: baseline; } table { border-collapse: collapse; border-spacing: 0; } li { list-style: none; }

    Read the article

  • Is it possible to have a global exception hook?

    - by Heinrich Ulbricht
    Hi, my code is fairly well covered with exception handling (try..except). Some exceptions are not expected to happen and some exceptions happen fairly often, which is expected and ok. Now I want to add some automated tests for this code. It would be good to know how many exceptions happened during execution, so I can later see if the expected number was raised or anything unexpected happened. I don't want to clutter every exception handling block with debug code, so my question is: Is there a way to install some kind of global exception handler which sits right before all other exception handling blocks? I am searching for a central place to log these exceptions. Thanks for any suggestions! (And if this matters: it is Delphi 2009)

    Read the article

  • How do I temporarily monkey with a global module constant?

    - by Daniel
    Greetings, I want to tinker with the global memcache object, and I found the following problems. Cache is a constant Cache is a module I only want to modify the behavior of Cache globally for a small section of code for a possible major performance gain. Since Cache is a module, I can't re-assign it, or encapsulate it. I Would Like To Do This: Deep in a controller method... code code code... old_cache = Cache Cache = MyCache.new code code code... Cache = old_cache code code code... However, since Cache is a constant I'm forbidden to change it. Threading is not an issue at the moment. :) Would it be "good manners" for me to just alias_method the special code I need just for a small section of code and then later unalias it again? That doesn't pass the smell test IMHO. Does anyone have any ideas? TIA, -daniel

    Read the article

  • ASP.NET MVC: Is is possible to set a global variable?

    - by Sergio
    Hello, I have a process within my MVC 2 application that takes a large amount of time and alters many rows in the database in the process. There is a chance that two or more users could attempt to perform this action at the same time, which would lead to undesirable effects. Is there a way to set a global flag somewhere within asp.net that I can check against all requests to see if the action in question is currently being executed? (a bit that I flip prior to running query, and then then flip back on completition) Or is there a better way of handling this situation? Thanks

    Read the article

  • Servicestack CorsFeature Global Options Handler Not Firing on Certain Routes;

    - by gizmoboy
    I've got a service setup using the CorsFeature, and am using the approach that mythz suggested in other answers, collected in a function used in the appHost file: private void ConfigureCors(Funq.Container container) { Plugins.Add(new CorsFeature(allowedOrigins: "*", allowedMethods: "GET, POST, PUT, DELETE, OPTIONS", allowedHeaders: "Content-Type, Authorization, Accept", allowCredentials: true)); PreRequestFilters.Add((httpReq, httpRes) => { //Handles Request and closes Responses after emitting global HTTP Headers if (httpReq.HttpMethod == "OPTIONS") { httpRes.EndRequest(); } }); } However, the pre-request filter is only firing on some of the service requests. One of the base entities we have in the service is a question entity, and there are custom routes defined as follows: [Route("/question")] [Route("/question/{ReviewQuestionId}", "GET,DELETE")] [Route("/question/{ReviewQuestionId}/{ReviewSectionId}", "GET")] Using POSTMAN to fire test queries (all using the OPTIONS verb), we can see that this will fire the pre-request filter: http://localhost/myservice/api/question/ But this will not: http://localhost/myservice/api/question/66 Presumably, this is because the second and third routes explicitly defined the verbs they accept, and OPTIONS isn't one of them. Is it really necessary to spell out OPTIONS in every defined route that restricts the verbs supported?

    Read the article

  • Can this example be done with pointers instead of global variable?

    - by Louise
    This is a simplified example of the problem I have: #include <stdio.h> #include <stdlib.h> void f2(int** a) { printf("a: %i\n", **a); } void f1(int* a) { f2(&a); } int main() { int a = 3; f1(&a); // prints "a: 3" f2(???); return 0; } The problem is that I would like to be able to use f2() both in main() and in f1(). Can that be done without using global variables?

    Read the article

  • How can I access a global pointer outside of a C function?

    - by patrick
    I am trying to access the data of*tkn within a different function in my program for example: putchar(*tkn); It is a global variable but its not working correctly. Any ideas? #define MAX 20 // globals char *tkn; char array[MAX]; ... void tokenize() { int i = 0, j = 0; char *delim = " "; tkn = strtok (str," "); // get token 1 if (tkn != NULL) { printf("token1: "); while ((*tkn != 0) && (tkn != NULL)) { putchar(*tkn); array[i] = *tkn; *tkn++; i++; } } }

    Read the article

  • Should I use a global var or call the function every time? C++

    - by extintor
    Im using: bool GetOS(LPTSTR pszOS) { OSVERSIONINFOEX osve; BOOL bOsVersionInfoEx; ZeroMemory(&osve, sizeof(OSVERSIONINFOEX)); osve.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); if( !(bOsVersionInfoEx = GetVersionEx ((OSVERSIONINFO *) &osve)) ) return false; TCHAR buf[80]; StringCchPrintf( buf, 80, TEXT("%u.%u.%u.%u"), osve.dwPlatformId, osve.dwMajorVersion, osve.dwMinorVersion, osve.dwBuildNumber); StringCchCat(pszOS, BUFSIZE, buf); return true; } to get the windows version, and I am planning to use pszOS every a few minutes, Should I use pszOS as a global var or call GetOS() every time? What's the best option from a performance point of view.

    Read the article

  • How to config a default global EJB transaction attribute in JBoss Server?

    - by seven
    my project need to migrate from oc4j to jboss. But it seems that default EJB transaction attribute is different between them. For OC4J: If you do not specify any transaction attributes for an EJB method then OC4J uses default transaction attributes. OC4J by default uses Required for CMP 2.0, NotSupported for MDBs and Supports for all other types of EJBs. (refer to official doc) For JBoss: default for all types EJB is Required. (Maybe , refer to un-official site) To migrate my project within less effort, how to config a default global EJB transaction attribute, e.g. Supports, in JBoss Server?

    Read the article

  • Global search box extension - how to make browser to start when suggestion picked.

    - by Ramps
    Hi, I'm implementing global search box extension (sth like SearchableDictionary sample in android sdk). Everything works fine - suggestions are displayed properly. Problem is that I want browser to start when user picks a suggestion. (each suggestion is a link) Columns of my cursor contain SearchManager.SUGGEST_COLUMN_INTENT_DATA, and I use that to pass http link. My searchable xml contains default intent action set to: android:searchSuggestIntentAction="android.intent.action.VIEW". But when user hits the suggestion, my application is started instead of browser. What am I missing? Regards!

    Read the article

  • In CQRS (event-sourced), do you need a global sequence counter in the event store?

    - by Jon M
    In trying to get my head around CQRS (and DDD in general) I have come across situations when two events occur on different aggregates but the order of them has domain meaning. If so then they could happen so close together that a timestamp (as used by the sample implementations I have seen) cannot differentiate them, meaning the event store doesn't contain a 'complete' representation of the domain as there is ambiguity over the order in which events occurred. As an example, the domain could fire a CustomerCreatedEvent which applies to the Customer aggregate, and then a CustomerAssignedToAgent event on the Agent aggregate. The CustomerAssignedToAgent event doesn't make sense if it occurs before the CustomerCreatedEvent, but typically both of these might be fired as a result of one operation which makes it likely that the timestamps would effectively be the same. So am I just modelling things badly? Should there ever be a situation where the sequence of events across different aggregates is important? Or should you keep a global sequence number on your event store, so that you can identify the exact sequence in which events occurred?

    Read the article

  • What should be contained in a global Subversion ignore pattern for Visual Studio 2010?

    - by Chris Simmons
    After installing and using Visual Studio 2010, I'm seeing some newer file types (at least with C++ projects ... don't know about the other types) as compared to 2008. e.g. .sdf, .opensdf, which I guess are the replacement for ncb files with Intellisense info stored in SQL Server Compact files? I also notice .log files are generated, which appear to be build logs. Given this, what's safe to add to my global ignore pattern? Off the bat, I'd assume .sdf, .opensdf, but what else?

    Read the article

< Previous Page | 69 70 71 72 73 74 75 76 77 78 79 80  | Next Page >