HNHacker News
TopNewBestAskShowJobs

suraj

1,851 karma · joined October 7, 2009

[ my public key: https://keybase.io/suraj; my proof: https://keybase.io/suraj/sigs/CpkHpnpwfYefUMiVKZWCHzp1_v8etd1DHkYSeciStes ]
submissionscomments
suraj··on C++ in Coders at Work
Looking at your code a bit, it seems you are not using templates, operator overloading, exceptions, STL or std::string. Your test framework also looks custom built (aside: IMO UnitTest++ would have fit you style). I think if you just changed class data to structure and member functions to accept structure pointer, you would get a nice C representation (almost every class I looked at had an Init method). In effect you are using C++ to avoid very small boilerplate code in equivalent C program.

No wonder you find C++ pleasurable, you are using it as C with classes! However, if you are working on an existing code base with mix of STL, boost and bunch of other libraries, you would start feeling pain of using C++. In my experience, every library author uses a different subset of C++ and as an application writer, you often have to grapple with the glaringly different idoms in your program. I find boost pleasurable to use; however looking at boost source is enough to melt my mind.

Almost everywhere C++ (language and libraries) try to satisfy every corner case and sacrifice usability of common case. e. g. STL iterators (at least I have BOOST_FOREACH to soften them). Ah well this is probably contributing very little to the discussion but I feel better now :) So let me redirect to [C++ FQA](http://yosefk.com/c++fqa/) and let yourself decide whether the points in FQA make sense to you.

suraj··on Rietveld - code review Google style
I have used it for a team of 10 people (at 2 locations) and it actually reduced some overhead in communication. I had set it up on a desktop machine for about 2 months and only adjustment I needed was to increase heap size for JVM. If you are using git, give it a try. It is dead easy to set up.
suraj··on The Zen of Python by Example
I do not like example 4 "Complex is better than complicated". Use of string concatenation is going to lead to SQL injection bugs and SQLAlchemy version actually looks better to me.

Can somebody please enlighten me on how using raw sql is preferable?

suraj··on Why do programmers write apps and then make them free
What if the software supplier goes out of business?

I am going to pay for support for any software open or closed source. However, with open source, I can almost always get some support.

suraj··on Space Stasis (Neal Stephenson)
If an efficient approach to convert hydrocarbons into electricity had been invented, we all would be driving electric cars today.
suraj··on Introduction to Gnome 3
Truncation != Rendering. Truncating long strings by replacing middle by ... is pretty common.
suraj··on Paranoia and deletion: the wipe man page
How would a hard disk controller detect encrypted data? It is essentially a (psudo-) random stream of bytes. Even if the controller is programmed to recognize such streams, it would be easy to first wipe disk by writing small random files all over and then wiping with 0/1 pattern. So any cached data is essentially worthless.
suraj··on Google Removing H.264 Support in Chrome
DSP's are like processor units in GPU. Optimized for fast and parallel multiply and add computations (and some other basic signal processing stuff). One codec is not that much different from other from computation point of view.

The accelerator units are usually filters that operate over a region of memory while processor is busy computing something else. These can be made fixed function, however most of them are programmable to support multiple steps in codec processing.

suraj··on Google Removing H.264 Support in Chrome
Meta: You should start "John Gruber and Methods of Rationality" blog.
suraj··on Ask HN: What has progressed in your field in 2010?
Automotive infotainment underwent a major shift to Linux from WinCE. There is even GENIVI alliance (http://www.genivi.org/) to speed up the adoption.
suraj··on Add Latency to Localhost
If you have a spare machine, you can use WanEm http://wanem.sourceforge.net/ livecd. WanEm gives you a nice web interface to configure network parameters. I have used it successfully to check effects of latency on Lotus Notes on Windows.
suraj··on Ask HN: Best book you read in 2010 and briefly why
This book got me started on "The Baroque Cycle". Now I am doomed to think of Newton as a wizard alchemist.
suraj··on 128-bit storage: are you high?
My brain is probably addled by reading a lot of science fiction. But here are my thoughts on the matter. We know of two ways in which energy is manifested in stable form. The matter particles and the force carrying particles. Recent astronomical observations point to a third form i.e. dark matter. So hopefully in future we may uncover (or device) yet another form of energy which would find 128bits on a low side.
suraj··on Who are the polite Indians?
Most of the students in India lack basic problem solving skills. They tackle exams (even maths) by rote memorizing a set of questions and answers. In real life this has caused profusion of "guides" i.e. books that contain questions most likely to appear in exams.

When these students start engineering studies, they are flabbergasted by lack of "guides" for problems. These students will fail the FizzBuzz test, however will be able to answer questions about C++ quirks. They can not ask intelligent questions because they can neither understand problem nor investigate the root cause. They are studying just to get a degree (which would help them get a job) not to get educated.

Even if we assume that only 50% of the students fit this criteria, there are over five hundred thousand students who are looking for shortcuts! Which should account for these kind of posts.

The education system in India is geared towards producing clerks not free thinking individuals. Sadly, this the is the end result.

suraj··on Ask HN: How is Git on Windows today?
I have been keeping tabs on TortoiseGit and it has become a lot more usable. I usually shy away from command line on windows and my git usage on windows is very light. TortoiseGit seems sufficient for day to day activities not involving any git magic.

For setting up a git server on windows please check out gerrit ( http://code.google.com/p/gerrit ). It is a pure Java implementation so should work reasonably well on Windows.

suraj··on There is no sane reason for the dock connector to not be micro-USB. Discuss.
iPod can stream protected audio content over USB. You just need an auth chip approved by Apple to be able to do that. Most of the cheap devices just use analog audio out and use "Apple Accessory Protocol" (which can be sent over either serial port or USB) to control it.
suraj··on Jugaad, an inspired kind of duct-taped ingenuity
It is usually housed in an metal enclosure founded in concrete. Much harder to steal than a wire.
suraj··on Ask HN: Share a gem. Teach me and you.
Well you can keep the database file in Dropbox :)
suraj··on Apple Magic Trackpad
It should have been a mouse pad you can touch. Probably with a different design for mouse (you just need a metal point instead of trackball/optics).
suraj··on Types of Comments to Avoid Making when Programming
If you are putting audit trail in source code, merging changes from one release to another becomes a chore. Since there are no trivial merges anymore. You get conflicts in comments which have to be merged by hand.

Also without ability to diff files, you are never sure what actually changed for a given comment. So you are dependent on VCS anyway! I have been burned by this in two large codebases (> 2k files).

suraj··on Dagen H: The day Sweden switched to the right hand side of the road
I drove stick shift for 2 years in US (right hand) and I drive stick shift in India (left hand). I did not notice any major benefits in either style.
suraj··on When Pigs Fly: Apache Pig, Open Source and Understanding Systems
Well I have interest but no experience ;)
suraj··on Antenna designer writes about the iPhone 4
FTA -

| So, naturally, the design evolved to meet requirements - and efficient transmission and reception while being held by a human hand are simply not design requirements!

This is analogous to saying driving experience doesn't matter as long as car pases emission tests which is certainly not true (I hope). People don't buy phones because it passes FCC testing they buy phones to make calls! If you don't factor human hand into your design, word of mouth will kill the phone.

suraj··on Tutorial: Ordering EAGLE Designed Circuit Boards
SMD's are easy if you have tweezers, a magnifying glass and clean soldering iron. Take a look at this link http://www.infidigm.net/articles/solder/
suraj··on Emacs isn't for everyone
Err Ctrl+up seems to be working OK. PBKAC
suraj··on Our new search index: Caffeine
Similarly searching for Apache directives (e.g. http://www.google.com/search?q=rewriterule ) returns result for apache 1.3 docs. You have to add 2.2 while searching for apache info.
suraj··on Emacs isn't for everyone
Soegaard, I was thinking of submitting a patch over the weekend. That way I get to see how a large lisp app is designed :)
suraj··on Emacs isn't for everyone
I was trying out racket yesterday and I couldn't figure out how to get the previous line in DrRacket. I tried all sorts of combinations and finally pursuing documentation came up with Esc-P shortcut. You can argue that this feature was first implemented in scheme before arrow keys were there but looking at it now it is different than everything else.

For me switching from Windows to OS X was easier (just use Command instead of Ctrl) than switching from "a generic editor" to emacs/vim. The point here is not that learning emacs is hard but that there are now a significant number of developers who expect standard shortcuts from the programs they use.

suraj··on Torvalds: git vs CVS
I have had wrong code delivered on more than one occasion because of workflow of using tarballs and/or backup folders.

If you are working on windows, there is no GUI better than TortoiseSVN. Give TortoiseSVN a try, it won't replace the #ifdef's; but it will certainly be better that tarballs for solo development.

suraj··on Did Google Just Kill Ogg Theora?
Thanks for that interesting perspective. I guess it succeeded because western world effectively stopped development of space programs and nuclear technology. Similar strategy for semiconductor (http://en.wikipedia.org/wiki/Bharat_Electronics_Limited) has not worked out very well.
← PreviousPage 2 of 3Next →