Reputation
26,109
Next tag badge:
93/100 score
34/20 answers
Badges
2 49 108
Newest
 Enlightened
Impact
~1.3m people reached

22h
revised Does a `long` ban make sense?
edited body
1d
comment Algorithm to fit all items in a bag choosing most optimal cost?
Sounds like a problem from a game. For small problems of this type you can just run an exhaustive search. For example, if you have ten categories of five items each, that's 5^10 possible configurations, or less than 10^7.
May
3
comment Does it make sense to use a cursor for complex business logic?
@mike: The query engine collapses all this just as you would expect. For Transact-SQL, the query plan has a single "Calculate Scalars" block that takes almost no time.
May
3
awarded  Enlightened
May
3
awarded  Nice Answer
May
3
comment Drawing sequence diagram for user-forget-password functionality
It's a security breach to display "user not found". That allows fishing for valid user names. Instead just display "If you are a registered user, then a code has been sent to your phone."
May
2
answered Does it make sense to use a cursor for complex business logic?
May
2
comment How do I create a parse tree, given a grammar?
There is a wealth of published information about building or generating a parser from a grammar. But your question doesn't indicate that you even tried to understand any of them. "Help me get started with whatever" is a request, not really a question.
Apr
25
comment Algorithm to create all unique sets of the alphabet using arbitrary group sizes
There are four sets of five. There are 24 ways to order them. You counted every ordering of the same four sets, so that you counted both [abcde], [fghij], [klmno], [pqrst] and [fghij], [abcde], [klmno], [pqrst]. Since the sets are not ordered, I just divided your number by 24.
Apr
23
comment Algorithm to create all unique sets of the alphabet using arbitrary group sizes
Do you really need them all? Your calculation is only off by a factor of 24, there will still be 1.1x10^14 partitions meeting your specifications.
Apr
22
comment Best way to enforce constraints in Class
The concept you are looking for is "Discriminated Union". It's directly supported in some languages, but not C#. See stackoverflow.com/questions/3151702/…
Apr
21
comment What Style is Better (Instance Variable vs. Return Value) in Java
"Some instance variables are only used to communicate between private methods from call to call." That's a code smell. When instance variables are used this way, it is a sign the class is too large. Extract that variables and methods into a new class.
Apr
19
comment When being a technical genius is not enough to be a successful developer?
A high reputation here got me an invitation to put a profile on StackOverflow careers which led to a call from a recruiter which led to an offer to relocate to Seattle :-)
Apr
19
comment Ensure that callbacks registration and triggering don't cause infinite recursion
The problem has nothing to do with events or callbacks. You are inappropriately using recursion for an unbounded series of retries.
Apr
18
comment Ensure that callbacks registration and triggering don't cause infinite recursion
Your question is too vague. Can you please post just the gist of the code that is causing the problem? Sounds like it's just a couple of callbacks and maybe one other bit. I'm guessing that your problem would be cured by following the MVC pattern but I can't say without seeing the code.
Apr
15
comment Algorithm to determine the fastest route passing in all points
@Tommy: the TSP does not assume the number of cities is fixed. It assumes that distance is pre-calculated for every city pair. The run time is exponential in the number of points to visited.
Apr
15
comment Algorithm to determine the fastest route passing in all points
@gnasher729: if the number of intermediate points is fixed, then the run-time is O(N + E), where N is the number of nodes and E is the number of edges.
Apr
15
comment Algorithm to determine the fastest route passing in all points
-1: it's still the "traveling salesman problem", and it's still NP-Hard.
Apr
15
answered Should we embed special cases into business logic/algorithm or leave it separate?
Apr
12
revised Coding style: Binary logic or multiple if()s?
added 1 character in body