10,807 reputation
2454
bio website dmitry.cheryasov.in
location
age
visits member for 4 years, 5 months
seen 4 hours ago

I constantly try to expand the little I know about programming.

google profile


May
18
comment shadow simulation from buildings
Note that a group of buildings are prone to shadowing both their surroundings and each other. This may affect what it considered 'shadow area'.
May
15
comment Complex data structure in python: just dict, etc, or some classes?
If your JSON schema is fixed, it's not hard. See update.
May
15
revised Complex data structure in python: just dict, etc, or some classes?
added 475 characters in body
May
15
awarded  Revival
May
15
comment Complex data structure in python: just dict, etc, or some classes?
I have one word for you: namedtuples. :)
May
15
answered Complex data structure in python: just dict, etc, or some classes?
May
15
answered URL routing for master detail pattern
May
15
comment URL routing for master detail pattern
Yes, a 403 page saying 'You have no access here; we can neither confirm nor deny the existence of apples' would be perfectly fine. Add a helpful link to /fruit with a list of allowed fruit for extra points.
May
13
comment How to apply Alpha-Beta pruning to a game tree? (Algorithms Theory)
Doesn't the wikipedia article answer this enough for you?
May
12
revised Why dynamically typed languages do not let the developer specify the type?
added 47 characters in body
May
12
comment Why dynamically typed languages do not let the developer specify the type?
@MasonWheeler: A fair point. There are of course ways to do metaprogramming statically, some of them fairly widespread (C++ templates, for instance). I've updated the answer.
May
12
revised Why dynamically typed languages do not let the developer specify the type?
added 47 characters in body
May
6
comment Reuse already fetched data for request
I've updated my answer. The approach really depends on your needs. In a commercial setting, every 100 ms of delay cost you a certain percent of visitors closing the tab. In an internal system, you might have other priorities before you start to optimize for speed, and your network is likely a fast LAN.
May
6
revised Reuse already fetched data for request
added 897 characters in body
May
5
answered Reuse already fetched data for request
May
3
comment Best way to structure many-to-one allocation of users to projects in NoSQL
Just in case: I suppose this is not a centerpiece of your DB design, and there are other, bigger compelling reasons to use NoSQL as opposed to an RDBMS?
May
2
comment Check distance between all elements in a list of numbers in O(n*lg(n))
@StefanPochmann: While I understand that everything hints to a sort-oriented solution, I'd prefer a stricter problem statement. For instance, the 'divide and conquer' hint is not entirely applicable to sorting solution: quicksort does classic divide and conquer, merge sort works a bit differently (and BTW merge sort is always O(N log N), quicksort isn't).
May
2
comment Check distance between all elements in a list of numbers in O(n*lg(n))
«all numbers in a list X have distance greater or equal to k from each other» is a bit unclear to me. What is "each other" — just neighbors or an arbitrary other number in the list? For the former, an O(N) solution is obvious, for the latter, an O(N log N) solution with sorting is also obvious.
May
1
answered Close to knapsack problem?
Apr
30
comment Using System.err.println() for debugging in Java
One problem with printing directly to stderr is that output from parallel threads gets intermingled. Logging fixes that.