3,132 reputation
1920
bio website newmodifier.com
location Bedminster, NJ
age 28
visits member for 2 years, 11 months
seen 2 days ago

He who codes with me shall be my brother.

Never blame Anders for your bad design.


Nov
26
comment Function guaranteed to never return the same value twice
Fine, everyone, add a 5 day delay to the function and we'll never collide. It will take 5 day for 2 calls of it to return, but problem solved on my end.
Nov
26
comment Function guaranteed to never return the same value twice
@stakx I didn't say what os this is.. Let's say it's on a VXWorks machine with a highly accurate clock. Funny how everyone likes their own assumptions best.
Nov
24
comment Function guaranteed to never return the same value twice
@Telastyn What do you mean "concurrently enough". It sounds like you're talking about parallelism, not concurrency. A simple lock+delay would would work fine.
Nov
24
awarded  Nice Answer
Nov
24
revised Function guaranteed to never return the same value twice
added 113 characters in body
Nov
24
answered Function guaranteed to never return the same value twice
Jul
29
awarded  Famous Question
Dec
30
comment Database Context and Singleton injection with IoC
You should create a new DbContext per request. IIS/ASP.NET uses new threads to serve requests and the DbContext isn't thread safe. Even if you aren't explicitly creating new threads, your singleton DbContext will have multiple threads operating on it. If multiple users are using your website at the same time, you will run into issues. A static DbContext variable won't work. See these links : stackoverflow.com/questions/6126616/is-dbcontext-thread-safe stackoverflow.com/questions/1416351/…
Dec
29
answered Database Context and Singleton injection with IoC
Dec
29
revised Should I use the new method/action to retrieve records? (Rails)
deleted 13 characters in body
Dec
29
answered Should I use the new method/action to retrieve records? (Rails)
Dec
29
awarded  Yearling
Oct
2
awarded  Good Answer
Sep
12
comment Why would I ever use delegates if I'm not doing events?
stackoverflow.com/questions/10766139/… great explanation there. Although, I prefer F#'s first class function system, C#'s is easier to understand once you come to terms with HAVING to declare the delegate signature and name it OR using a "built in" one.
Sep
12
comment Why would I ever use delegates if I'm not doing events?
Because there is no other way to pass a piece of code to a method in C#. The APIs exposed in those 3 libraries are some of the best, in my opinion. Try to imagine how you would make a similar library without delegates (aside from true first-class functions); you would not be able to. msdn.microsoft.com/en-us/library/dd460720.aspx Try rewriting Parallel.ForEach without delegates.
Sep
12
answered Why would I ever use delegates if I'm not doing events?
Sep
9
comment What are examples of automating BDD specifications through the UI layer?
It's testing both behavior AND technical aspects of the UI. The second you combine more than 2 dependent steps in a UI test, how is that not BDD? The "problem" is, there's the argument that you may as well do javascript unit testing as to not be testing many things at once. The link I posted is definitely BDD in a UI test because it's executing repeatable steps, expressed as behaviors, and asserting the result. It could fail because of a jquery selector being wrong, true, but it absolutely tests behavior.
Sep
9
revised What are examples of automating BDD specifications through the UI layer?
added 148 characters in body
Sep
9
answered What are examples of automating BDD specifications through the UI layer?
Sep
9
comment can I use XML for AJAX in a website created using HTML5
"DTD's, schemas" To reinforce your point, programmers didn't even define these when using XML years ago. They can be helpful for public APIs (things like XAML), but are relatively useless for a 1-off transport situation