5,860 reputation
1639
bio website
location Los Angeles, CA
age
visits member for 4 years
seen yesterday

I love strange shrimp.

eh, string stream.


2d
answered What is more efficient, a single square root or multiple divisions?
Sep
11
awarded  Necromancer
Sep
9
awarded  Yearling
Sep
9
comment What is the best computer programming content that an aspiring technical cofounder (for a 2-person team) can consume?
Also read about wireframe and user-interaction design.
Sep
9
comment algorithmic problem - Combining overlapping ranges
Stackoverflow already have a few questions on QuadTree implementations in Python (anything from SciPy to pure Python, and more). Since your list is initialized from the beginning, you don't need to worry about the issue of tree rebalancing. That is, you can just build the tree upfront. Quadtree, R-tree and k-D tree are examples of multi-dimensional spatial search trees. If you aren't already familiar with this concept, you should learn it first. It is not something reducible to single-dimensional search unless your data size is known and fixed (i.e. reducible to a constant).
Sep
8
answered Polymorphic engines in C and/or C++
Sep
1
awarded  Nice Question
Sep
1
comment What's wrong with comments that explain complex code?
Sometimes algorithm code begins as a big ball of mud, and it is only after a lengthy period of analysis "picking-apart" that reusable parts can be isolated from it, based on identifying recurring patterns which occur across different algorithm implementations. Such "algorithmic patterns" are similar to Design Patterns, but they are not design patterns - GoF doesn't teach algorithms. Algorithms are taught in universities.
Sep
1
comment What's wrong with comments that explain complex code?
From my own experience, it is easier to make business code self-explanatory than to make algorithm code self-explanatory. Business code can draw from common-sense intuition, whereas algorithms can only draw from papers, theorems, axioms, equivalences, algebraic abstractions, etc., none of them belong to common-sense.
Aug
30
comment sanity checks: when do they become paranoid checks
It is language-dependent. For languages where "undefined behavior" is possible, one must be extremely cautious. In fact, programs written in these languages cannot be made safe unless proven otherwise (e.g. Coq theorem prover, static analysis, or a equally-capable human theorist). On safer languages, and also on languages that supports (enforces) "member visibility" the right way, one can make use of limited visibility to eliminate some impossible scenarios from the analysis. This is where "code cohesion" helps analysis.
Aug
30
comment What optimizations can be done for soft real-time code in C#?
@CodesInChaos: Agreed. Anything less than a kilobyte apiece (i.e. arrays of that size) is not worth object-pooling. However, as far as Android is concerned, even the official development guide says to avoid object allocations inside time-sensitive code (especially the view.onDraw method), because on Android every allocation carries a tiny risk of triggering a GC, and yet the consequences of that tiny risk is deemed severe enough for Google to justify issuing such an advice. Weird, and hopefully it will go away as software and hardware improve over time.
Aug
30
comment Reading assembly useful for insights when writing C/C++?
Prioritize your skills. It is a higher priority to learn how to accurately measure the performance of software (benchmarks, profilers, samplers, event loggers, etc). Then, once you gain the ability to narrow down to hotspots, you will find use for your arsenal of skills, within which reading assembly is a good skill to have.
Aug
28
comment What optimizations can be done for soft real-time code in C#?
@JTrana: Please refer to the "object cesspool anti-pattern" article. Summary: (1) not having release method, (2) release method doesn't do its job, (3) release method not being called appropriately, or not at all.
Aug
28
comment Designing Nested List<Class> Property in a Class
This is an example of what LINQ is designed for.
Aug
27
comment How do I move away from the “for-loop” school of thought?
(Continued.) After grouping, read out each group, and sort out by the actual string values. When a consecutive runs of identical string values are found, read out the first column (which says whether it is in small_array or big_array), and the second column (which gives the item's index in the corresponding array). Posting as comment because I don't know if such operations are possible in python or numpy.
Aug
27
comment How do I move away from the “for-loop” school of thought?
As a non-pythonist, I have this idea, but I don't know whether numpy or python has support for these things. For each item in small_array, create a tuple of (constant 1, item index in small_array, item value in small_array). Likewise, for each item in big_array, create a tuple of (constant 2, item index in big_array, item value in big_array). Since the tuples are of same type, they can be concatenated. Group by the third column - the item values, in this case strings. Grouping is similar to sort but is not necessarily ordered (for example, sort by hash value).
Aug
27
comment What optimizations can be done for soft real-time code in C#?
@9a3eedi : With regard to whether object pool can be bolted on after the application development has been done, I can offer the following advice. (1) you will have to inject an object factory (which doubles as the object pool) into all objects which you would like to pool, (2) replace all constructor methods with factory methods, (3) each object has a recycle method which return themselves back to the pool-factory (4) implement your objects to be recyclable: be wiped and then rewritten with new information. You may take this into account if you need to design the API interface upfront.
Aug
26
comment How to measure algorithm accuracy?
There is answer to your question: please read Fixed-point iteration. Basically, first step is to understand the region of convergence of your approach, and then for a given point, calculate the rate of convergence.
Aug
23
comment Questioning one of the arguments for dependency injection: Why is creating an object graph hard?
@oberlies: Your code example straddles between two styles, the constructor argument style and the zero-args constructible style. The fallacy is that zero-args constructible is not always possible. The beauty of DI or Factory is that they somehow allows objects to be constructed with what looks like a zero-args constructor.
Aug
22
comment Interface design where functions need to be called in a specific sequence
A state transition diagram, similar to the Android application activity lifecycle, may be necessary to convey the information.