5,792 reputation
1437
bio website
location Los Angeles, CA
age
visits member for 3 years, 10 months
seen 4 hours ago

I love strange shrimp.

eh, string stream.


16h
comment “Undoing” an integer wraparound
@Xcelled194: It might have been (learned from) part of the DJB hash function. It might have been better than nothing when dedicated multiplication unit don't exist as a standard feature on CPUs back then. stackoverflow.com/questions/1579721/…
1d
comment “Undoing” an integer wraparound
Something along the line of en.wikipedia.org/wiki/Modular_multiplicative_inverse
2d
comment When I test out the difference in time between shifting and multiplying in C, there is no difference. Why?
As general rule, (1) you should be very familiar with the language's specification for shift operations before using them (e.g. their behavior on signed vs unsigned integers of various widths). (2) if you use them for performance reasons, you should know three things: (2.1) application-wide performance profiling, (2.2) micro-benchmarking (and CPU-level timing), (2.3) know how to read disassembly code, though it's not necessary to know how to write them.
2d
comment If we could get a file's binary form, would this method of file compression work?
Also read Pigeonhole principle, which is a tool that can help find loopholes in one's arguments about a compression scheme.
Jul
20
comment What is the best way to learn COM programming?
@Debhere: Kenny Kerr is an expert in Microsoft Operating Systems. He provides a lot of C++, C# and COM lectures available at: pluralsight.com/training/Authors/Details/kenny-kerr <br>*(This is not an advertisement.)*
Jul
18
comment Why does C have no competitors in low level stuff?
@dan04 that linked question uses the emphasized (bolded) word prominently; this causes the subsequent answerers and voters to become biased (trying to support or refute that claim), while being distracted from the more sensible (pragmatic) reasons. This question is able to attract the more sensible reasons.
Jul
18
comment Why does C have no competitors in low level stuff?
Ability to insert arbitrary "inline" assembly, or raw machine code, are also a necessity, because the embedded C compiler may not provide full support for the target's instruction set architecture. Also, the ABI or the protocols for making function calls (registers and stacks) needs to be well documented and allow for inter-operation between C and assembly code.
Jul
17
comment College fresher, the road ahead
As for practical advice, that would actually be a subjective debate. (Remember that subjective and opinionated questions are not welcome here.) There is an ongoing debate of which parts of the Computer Science curriculum are actually essential for (1) understanding the whole picture vs. (2) just getting an entry-level job vs. (3) doing software development (engineering) professionally. The verdict is still out on it.
Jul
17
comment College fresher, the road ahead
Mandatory quote: Teach Yourself Programming in Ten Years, by Peter Norvig. Still, the key is to get good enough for you to enter a good software development company (because a bad one wouldn't have allowed you to learn and improve), and then embark your lifelong journey of learning to program a computer. (It takes way more than 10 years to learn everything.)
Jul
17
comment Partial sorting problem
Use the keyword "Hasse diagram" to help with your Google search, read the results and then add more details to your question if there is anything unsolved. Also see this question. Finally, keep in mind that you can extract the relevant elements into a new array, process it, and then merge the result into the final array interspersed with the untouched elements.
Jul
17
comment Dividing 2D grid to most efficient search
This question can be answered by a straightforward implementation of: Quadtree, R-tree, k-d tree, or other dimensional nearest neighbor search algorithms.
Jul
17
comment Do development standards vary by city?
Common sense says that there is a strong correlation with (1) the local industries and types of business and (2) the sizes of the business. Then, these two has a weak correlation with the city location. Other than that, it is a job search optimization question, and also a highly subjective one.
Jul
15
comment Have there been studies on the effectiveness of OOP in managing software complexity?
To make a comparison, one must have an alternative paradigm that is applicable to very large programming systems, constructed by programmers of ordinary skills (i.e. not by a team of experts or state-of-the-art academics). Large systems tend to involve networking, database, load-balancing and redundancy (i.e. unreliable machines), among other things. The latter list of issues dominate any debates one may have for programming language paradigms.
Jul
15
comment Does it make sense to use interfaces if you don't have polymorphism?
Android's LayoutParams is an example of this. Although they (there are multiple classes of same name, nested inside various layout classes) inherit from a common base class, swapping an implementation will break things.
Jul
15
comment What is the best way to learn COM programming?
From the perspective of C# programmers, this part of knowledge is called "Interop" (short for inter-operation). Two of the essential terminologies are: COM Callable Wrapper and Runtime Callable Wrapper. There is the issue of data conversion between C# types and COM (C++) types.
Jul
15
comment What is the best way to learn COM programming?
COM programming is tightly related to C and C++ languages. Simply put, if you are using any newer language that does not have "vtable" (virtual method tables) or function pointers, all these newer language are "decoupled" from COM - meaning that you never get to see how the lower level of COM mechanisms work.
Jul
15
comment What is a class library?
From a programmer perspective, "class library" is typically associated with a package-and-release process by one software provider (closed-source or open source) so that it can be used by other programmers. Perhaps the articles on Object Mentor may contain phrases to help you find references that match whatever you have in your mind.
Jul
14
comment Strategy game, how do I calculate the parallel actions?
Taking damage is more of an impediment that is involuntary. That is, if a unit is under attack by another unit, whatever action was originally being undertaken by the unit being attacked would be slowed down, or cancelled entirely.
Jul
13
comment How to handle divide by zero in a language that doesn't support exceptions?
But beginners can also argue about sqrt(-1). Basically, it is acceptable to surprise a beginner if it serves the purpose of highlighting a critical misunderstanding (an unknown unknown). Beginners can argue or misunderstand about anything, including math. Lacking non-fatal errors (NaN), a program-aborting error may be acceptable.
Jul
11
comment Why not apply Interface Segregation Principle to “extreme”
Providing that clients would typically consume just one method... this would be an unusual situation in software development.