Reputation
2,740
Top tag
Next privilege 3,000 Rep.
Cast close & reopen votes
Badges
2 8 19
Newest
 Enthusiast
Impact
~83k people reached

Jun
11
comment What is a proper way to chain instructions if previous one is ok
For rare errors with no proper local response, apart from aborting the transaction, I'd use exceptions. (e.g. your database error)
Jun
11
comment How to pick a random move/action/element non-probabilistically?
@Qqwy You could just run a while longer, the probability of not finding anything drops exponentially (assuming your PRNG is good). Or you could switch to another search algorithm (enumerate all valid moves, then pick one or error out if there is none) in that rare case.
Jun
11
comment How to pick a random move/action/element non-probabilistically?
@Qqwy When playing a 'random' game, you wouldn't choose moves with equal probability, but you'll employ RAVE and various game dependent heuristics, e.g. "a move filling your own eye is unlikely to be correct".
Jun
11
comment How to pick a random move/action/element non-probabilistically?
A hybrid approach where you eliminate some points from the list (e.g those occupied by stones) and reject others once they're chosen is another possible choice.
Jun
11
comment How to pick a random move/action/element non-probabilistically?
@Qqwy AFAIK typical MCTS engines will use heuristics to choose move candidates with different probability. These heuristics will be more expensive to compute/update than merely tracking occupied points.
Jun
10
comment What's the best way to return an array as a response in a RESTful API?
Does that answer the question? I read it as "Should I use a json array or a json object as root?". Both can be parsed with json parsers, so your answer doesn't help them decide.
Jun
9
comment Are “plus” and “minus” appropriate method names?
sum sounds wrong in this context. I prefer .net's AddDays.
Jun
5
comment How to handle rating?
I'd store both the individual votes and the denormalized totals (and don't make the stackexchange mistake of storing only upvotes - downvotes instead of both).
Jun
2
comment If possible, would it be a bad practice to use Nullable for non value types?
"the language does not seem to have a problem with using nullable on other types" Nullable<T> has a struct constrain on T, so you only use it on value types.
Jun
1
comment std::vector Non-Array Implementation?
@ThomasEding Of course. This was just a response to Steven's comment that the performance guarantees would be hard to implement without a contiguous memory block.
Jun
1
comment std::vector Non-Array Implementation?
@StevenBurnap A fixed depth tree has the same asymptotic performance as a single block. Of course in practice the additional indirections will decrease performance.
Jun
1
comment How to think as a C programmer after biased with OOP language?
As a C# programmer I'd miss delegates (function pointers with one bound parameter) far more than I'd miss objects.
May
22
comment Resetting vs. re-sending forgotten passwords
See How to securely hash passwords? on security.se.
May
19
comment How do you avoid getters and setters?
I don't think the customer class should know about any of these things.
May
11
comment Is there any point in preventing developers from having a local copy of the database in their machine?
If your application is well written, knowledge of the database scheme shouldn't allow any attacks. Don't rely on security-through-obscurity.
May
11
comment Is there any point in preventing developers from having a local copy of the database in their machine?
How would they even write database queries without knowing the schema?
May
7
comment Java: why do collections accept a Comparator but not (a hypothetical) Hasher and Equator?
1) In C# you can pass an IEqualityComparer<T> to a hash based collection. If you don't specify one, it uses a default implementation based on Object.Equals and Object.GetHashCode(). 2) IMO overriding Equals on a mutable reference type is rarely a good idea. That way the default equality is pretty strict, but you can use a more relaxed equality rule when you need it via a custom IEqualityComparer<T>.
May
4
comment Synchronization between two systems using MongoDB as changelog
One pitfall is that ObjectIds don't increase monotonically.
Apr
18
comment Using uniqueness types to implement safe parallelism
You might want to take a look at Mozilla's Rust.
Apr
13
comment How is distribution of PKI certificates allowed?
I'd expect certificates to not meet the threshold of originality required for copyright protection. In particular check the section "Mechanically-produced works" in the wikipedia article.