8,086 reputation
1845
bio website
location Los Angeles, CA
age
visits member for 4 years, 8 months
seen 34 mins ago

The traditional notion of object ownership via function call (i.e. where it is unconditionally and unquestionably assumed that the caller must own the object throughout the call, and the callee merely "borrows" from it) is detrimental to memory usage if the object passed via the call needs to be released early, in the middle of the call.

In the past, I may have blamed it on other things, but now I see it this way. And this faulty dogma is pandemic; I can't think of any language that escapes from it.


6h
comment website for algorithm analysis in various languages
duolingo? ......
6h
comment As a tech team lead, how should I handle team members' coding mistakes and bad practices?
programmers.stackexchange.com/questions/1224/…
11h
comment distinguish requests from the same vehicle
@Ewan: This article on Wikipedia explains why this is the case. As latitude changes, the linear distance that correspond to a small change in longitude and latitude (in other words, their ratios) change as well, and the ratios become different. Thus, one unit of lat and one unit of lon will not correspond to the same linear distance anymore, unless you follow the steps described in the article(s) linked above.
12h
comment distinguish requests from the same vehicle
@Ewan: Plugging (lat, lon) directly into the 2D Pythagoras formula will not give the correct - not even an approximately useful - result at all. See this question on math.stackexchange for a correctly worked example.
18h
comment distinguish requests from the same vehicle
The JSON datum is also missing a "timestamp", because there can be a significant delay between the time of GPS measurement and the time the application's message finally reaches the web server.
18h
comment distinguish requests from the same vehicle
Disambiguation of buses traveling in opposite directions are usually done with e.g. "north-south", "east-west", "inbound-outbound" (with respect to a bus depot or public transportation hub).
18h
comment distinguish requests from the same vehicle
I think the issue is how to correctly aggregate incoming reports into the correct instance of a bus. In other words, it is a kind of signal processing, and may involve spatial queries, averaging, and rejection of obviously inaccurate data. For example, the JSON datum mentioned in the question is missing the "direction of travel", and this will cause two buses traveling on the same route in opposite directions to be confused by the system.
1d
comment Algorithms for edge detection in digital photos? (Java)
MilesDavis: If this question comes from a College Board ® AP Computer Science course, please say so. Edge detection is a topic that requires college-level image processing knowledge, and it involves calculus (most notably finite difference). If you do not possess this prerequisite knowledge, then please mention this in the question to prevent it from being closed as "too trivial".
1d
comment hashing algorithm to check inclusion in a set
"This can cause a lag that detracts from the user experience..." this seems to call for an asynchronous approach (to keep the UI responsive, and not to discard partially-entered information from the user). Perhaps you should look for a design solution (not a coding solution) to this problem.
2d
comment Are there any languages that allow subclassing or instance specific behavior without recompiling?
@hildred The question you asked in this comment seems entirely different from the question you asked originally. But anyway, the first thing to do is to check whether the component/module is intended to be used in a "same process" mode, or a "separate process" mode (as in OS processes). If they are separate, they must use some kind of inter-process communication. If they are same process, then it can be further classified into same-language (which is based on linking), or foreign-function interface (abbreviated FFI), which allows all sorts of dynamically-generated glue code given the declarati
2d
comment Are there any languages that allow subclassing or instance specific behavior without recompiling?
To make this question less ambiguous, please describe what language(s) you have in mind, and clarify the meaning of this phrase: "special or nonstandard linker support". Also, the use of the acronym "OOP" to refer to dynamically loadable modules is not a mainstream use. Object-oriented programming is now mainly used to refer to both a programming style (paradigm) and a software architecture/design approach.
2d
comment How to think as a C programmer after biased with OOP language?
LibTiff (source code on github) is an example of how to organize large C programs.
2d
comment How to think as a C programmer after biased with OOP language?
To echo amon, focus on the following: graph-like data structure, pointers, algorithms, the execution (control flow) of code (functions), function pointers.
May
29
comment How to treat bugs that users thought were a feature?
provide a switch in the new version that is off by default, and when turned on will emulate the old behavior? happens all the times. no news, move on
May
28
comment Best solution to switch between new and deprecated code
In other words, implA and implC are not substitutes of each other - they are unique as they are, and the users/programmers need to be aware of it. Questions: (1) Are there graceful degradations that allow implC's new functionality on older hardware? (2) Are the functionalities in implC cohesive enough (i.e. they naturally belong together), or would it be better off if the collection of functionalities are split off into smaller modules?
May
28
comment Middleware dependencies
What makes it difficult for all of the devs to know and follow the exact order that the app.uses must happen in?
May
28
comment Middleware dependencies
The word "middleware" is merely a choice-of-word by express.js to mean "handler". It has no relationship to middleware architecture.
May
28
comment Middleware dependencies
Is your question directed toward express.js (and therefore javascript), or your own framework? If it is your own framework, it may fall short of the design of the original library, and therefore tasks that are doable in the original library may be impossible in your own framework. Since we know nothing about your own framework, we can't give any useful advice.
May
28
comment Identifier vs domain object as a method parameter
It seems that would depend on several things: (1) whether the use cases require the actual attributes (columns) or just the ID, which depends on that use cases themselves; (2) whether you use some caching or performance-enhancing techniques that would make the ID-to-attributes query effortless, and whether your use cases would be heavy enough as to break such caching schemes.
May
28
revised Middleware dependencies
added 269 characters in body