2,831 reputation
1124
bio website
location
age
visits member for 4 years, 3 months
seen 12 hours ago

May
13
comment How Do I Create A Module* For A Class That Relies On Another Module?
@Carcigenicate: Yes, my interface proposal is intended to allow external callers to tell any implementor of ICanRandomWalk to randomly walk. I admit this is slightly annoying in that every implementer of ICanRandomWalk must copy/paste an identical implementation of the randomwalk function. You could instead pass position to RandomWalk's constructor, though this means RandomWalk contains state information.
May
13
comment Smallest and Largest contiguous repeating sub-sequence in a sequence
@david.pfx: In the OP's example, the repeated pairs are 3,6, 6,17, 17,19, and 19,3. Your answer does not make it clear how/why you are ignoring 17,19 and 19,3.
May
13
answered How Do I Create A Module* For A Class That Relies On Another Module?
May
13
comment Should I prefer properties with or without private fields?
#1 - Most serializers ignore private properties/fields by default; I've never encountered the issues you mention. #2 - This is fixed in VS2015 and can be worked around in VS2013. See this Visual Studio Magazine article.
May
11
comment Why is iterating through List<T> more expensive than iterating through Array in .NET?
Loop iteration cost is normally irrelevant for non-trivial loops; the inside of the loop tends will normally have much higher cost than loop iteration.
May
5
comment Is my usage of explicit casting operator reasonable or a bad hack?
@Neil: No, by default using an extension method avoids coupling entirely, since an extension method would lack the ability to access private members either of the two objects.
May
5
comment Is my usage of explicit casting operator reasonable or a bad hack?
One interesting distinction between this approach and Telastyn's answer is whether responsibility for generating SmallObject lies with SmallObject or BigObject. By default, this approach forces SmallObject to avoid dependencies on private/protected members of BigObject. We can go a step further and avoid dependencies on private/protected members of SmallObject by using a ToSmallObject extension method.
May
2
awarded  Nice Answer
Apr
28
comment Split multiple overlapping intervals to non overlapping intervals
If only to satisfy curiosity, are you able to share any practical applications for this? Usually, differentiating between the inside and outside of an interval is important when processing intervals.
Apr
22
comment Choosing a software license that requires written permission to use commercially
Note that your code cannot be dual-licensed in this fashion if using 3rd party GPL code. The simplest way to avoid this issue is to require all contributions towards the dual-licensed software to assign copyright to the product owner, though assigning rights is sufficient. Of course, it is much harder to get unpaid contributions for any commercial product, even an open source one. To expand on Doc Brown's example, take note of the MySQL Contributor's agreement.
Apr
20
comment Is restricting sessions to an absolute IP likely to have a wide impact on mobile networks?
As a minor addendum: Depending on the nature of your service, it may be of value to provide your users with an optional feature which restricts their usage to a specific IP or IP range (and then handles violations by either blocking the user, logging a warning, or requiring a secondary form of authentication). I've encountered services which offer this feature.
Apr
20
answered Why does the TRACE level exists, and when should I use it rather than DEBUG?
Apr
9
comment is there a cleaner / simpler way to code this?
@Matthew: That's how I usually do it as well. A quick google says that in LUA 5+ you would use table.concat for this purpose. I usually only use WHERE 1=1 when editing via SMSS or when using dynamic SQL.
Apr
8
comment Language compiled to JS – most elegant way to do synchronous-style waits
@MasonWheeler: I assume the op means he wants to use synchronous-style syntax.
Mar
26
awarded  Nice Answer
Mar
25
comment What is a simple, correct and secure way of executing code stored in database?, that is also sandboxed
Please provide more context. Why do you want to do this?
Jan
31
awarded  Yearling
Jan
12
comment How does big O notation indicate upper bound on a function?
@Snowman: No, the least upper bound on f(n)=n+10 is O(n) (i.e., the upper+lower bound, i.e. f(n) ∈ Θ(n)). Big O notation defined as being applied to functions, not execution times.
Jan
12
comment How does big O notation indicate upper bound on a function?
@BartvanIngenSchenau: That is incorrect. O(1) is defined as being applied to functions, not execution times.
Dec
22
comment why “new” keyword is not contextual keyword?
@programmer1: Read the article linked in my comment on your question.