HNHacker News
TopNewBestAskShowJobs

gajjanag

433 karma · joined July 25, 2015

Software engineer with a keen interest in high performance computing. In the past, PhD from MIT in EECS in a mix of applied mathematics and computer science.

Research interests: a broad range of applied mathematics topics, generally in the neighborhood of information theory and probability.

Other interests: mathematics in general, computer systems (especially security), FOSS projects, reading, bicycling, and cooking.

Website: gajjanag.github.io

[ my public key: https://keybase.io/gajjanag; my proof: https://keybase.io/gajjanag/sigs/-vv1qyl9QGR_46BS-LPAm3wBVPYna8zjMyUzDBWVKWg ]

submissionscomments
gajjanag··on A Simple Request: VLC.js
> The glue is quite large.

Then how is that mpv gets the "glue" work done with significantly fewer lines than VLC, as I pointed out?

> I hope you are joking. Look at the performance of ffplay...

I am obviously not joking here. I used (and still use) ffplay for a large chunk of media playback. The only reason I do not is for the rare hardcoded sub need, which may get at least partially addressed in a future gsoc project. The gsoc idea is on the wiki and has been discussed to some degree on the mailing list, so this is not a mere speculation.

A blanket statement about performance is also obviously false here; it really depends on the codec/config settings. For example, I simply tested with the first link (a 2160p hevc video) at http://4ksamples.com/, to really put all three media players under their paces. This was on my laptop, a Core i7 2.4 GHz Haswell, with Intel graphics on Arch Linux, with default configuration for all of ffplay, mpv, and vlc. Played essentially fine with mpv and ffplay, with minimal stutter. VLC was the only one on which playback actually crashed, with numerous "[hevc @ ...] Could not find ref with POC ..." messsages, stalls, and display artifacts rendering playback useless along the way before the crash at ~ 00:30.

gajjanag··on We’re Scientists, Moms, And We Avoid Non-GMO Products
This is part of the reason why I wish we had more of an "open food" movement. As it stands, it is astonishingly difficult to make well reasoned choices about food. There are numerous gimmicks that can be played going far beyond things like http://www.simplemost.com/sneaky-reason-tic-tacs-can-say-sug... , which is still non-obvious.

This is a reason I added to my more "traditional" reasons for being a vegetarian - as it stands, it is very hard to reason about the likely supply chain of food that I purchase. Nevertheless, it is easier in my view with vegetables as they are lower down in the food chain. With meat, there are a whole bunch of extra parameters governing things beyond the feed composition and structure.

This also meshes well with the original ideas behind the virtues of free markets, which depend upon customers making informed, rational choices. "Openness" regarding the supply chain is essential for the critical "informed" aspect.

gajjanag··on A Simple Request: VLC.js
> There is a lot more than just codecs and formats in a media player. :D

As you are the VLC lead, I understand where you are coming from. Nevertheless, depending on the perspective, a media player can be legitimately viewed as codecs+formats+some glue.

For example, ffplay that is shipped with FFmpeg has < 5k lines of code, and although not as full featured as VLC, definitely serves for basic media playback needs.

Or if that is too extreme, per the Open Hub stats, mpv does media playback with ~ 100k lines of code, once again in < 1/4 of the lines of FFmpeg (even with the hardcoded lookup tables ignored).

gajjanag··on Advanced Data Structures
I think yes, but then I have not read TAOCP beyond the first chapter.

What I can say is that "Concrete Mathematics" is a terrific book. It is the best general "math for algorithms" book I have seen. Its exercises are wonderfully picked, with problems at all levels of difficulty and classified neatly into categories. It also discusses topics that for strange reasons are not as widely known as one would expect, even though they are extremely elegant and quite useful. A concrete example of this is the Euler-Maclaurin formula relating sums and integrals.

gajjanag··on Snapchat Seeks to Raise as Much as $4B in IPO
I hope not.

I really dislike the asymmetry between the ability to take pictures of anyone in public easily (assuming spectacles or an equivalent comes out), with low chance of detection (unlike cameras/phones, which are harder to disguise) while being unable to as easily wear a mask in public to preserve some semblance of anonymity. Anti-mask laws exist for a variety of reasons, some of which I am fine with (e.g near banks) and some of which I am not (e.g abuse to shut down things like the Occupy movement). I would like to see a similar treatment of devices like this (spectacles, google glass, or whatever other product people work on in this space).

They should be treated on par with hidden cameras and the like. Until legislation takes care of this, I am not happy with the situation.

gajjanag··on Drug Agents Use Vast Phone Trove, Eclipsing N.S.A.’s (2013)
I wish someone did a detailed analysis on the whole drug supply chain, in order to determine the best place in the chain for intervention.

I bring this up as I remember a fascinating security economics paper that examined the economics of spam and its non-obvious conclusions regarding a good intervention point: http://css.csail.mit.edu/6.858/2014/readings/trajectories.pd...

Does anyone here know of a similar study for the drug supply chain?

gajjanag··on Sputtering Startups Weigh on U.S. Economic Growth
> ML is the one I'm most excited about at the moment.

I don't deny that ML is useful (I work in the field of statistical inference), but I am bothered by the characterization of "ML" as a great invention.

First off, "ML" is not really new per se; it has gone through iterations over a long time frame. Pattern recognition (via discriminant analysis, a method that is still popular in a variety of circles) was introduced in 1936. One could argue that there were statistical works addressing this at even earlier time frames - see e.g "The History of Statistics" by Stigler that focuses on linear regression, a method with at least 250 years of history. Popular methods like nearest neighbor date to at least the 1970's. Even the "revolutionary" deep learning paradigm had most of its key architectural ingredients mapped out by the 1980's or early 1990's - the main changes have been the scale at which one can operate these algorithms, tweaks of algorithms, etc due to improvements in hardware. This in turn has fed a bunch of further developments, the stage we are at right now.

Essentially, what has happened is that "ML" has appropriated a variety of disciplines and techniques under its umbrella, many of which have existed for a long time.

As for why concretely (i.e from an economic perspective) I lack the same level of enthusiasm as many others here, I have the following test: Amazon (or for that matter Google or your favorite search engine) has rarely been able to recommend me a nontrivial product (nontrivial in the sense of transaction magnitude) that I liked within the first few links. The best nontrivial products that I have acquired have always needed meticulous searching through a variety of diverse sources on the web (reddit, youtube, random blog posts/discussion forums including hn, etc), conversations with people, etc. Same goes for movie recommendations, and miscellaneous other things. This was true 7 years back, it is still true today for me.

This suggests either that these problems are genuinely hard (e.g at an NP-complete fundamental level), or that we still don't know how to come up with good recommendation systems, or that companies have failed to incorporate/package techniques into a good product, or that I am just an outlier with respect to recommendation engines.

gajjanag··on Shame on Y Combinator
Exactly; a good system by definition should be robust to these kinds of things.
gajjanag··on Driving on electricity is cheaper than gas in all 50 states
This is a great point, and indeed the article is overly simplistic.

I think though that what really matters beyond the base cost in this point is the depreciation cost over time. This is of course much harder to estimate.

gajjanag··on OpenSSL Security Advisory
Exactly. Memory safety is a very nice property, but is not complete by itself. This primary emphasis on memory safety was part of a critique of Rust by Andrei Alexandrescu: https://www.quora.com/Which-language-has-the-brightest-futur....

And even wrt memory, Rust (with the standard library) is not free of its own warts, see the OOM situation. See e.g https://news.ycombinator.com/item?id=10545877 for a discussion on this.

Just to be clear: I generally like the ideas of Rust. I just dislike its presentation by some as a magic solution to all kinds of concerns.

gajjanag··on Uber's billion-dollar losses expose the fragile state of the on-demand economy
> Rich people contribute more to society

Maybe in the sense of economic contributions, but this is far from clear for contribution defined in a general sense.

gajjanag··on The Fourier Transform and its Applications
As someone who has gone down the rabbit hole of measure theory, functional analysis, and the like, I completely agree with the wonderful balance that Prof. Osgood strikes.

For a concrete instance, he brings up the distributional viewpoint of Laurent Schwartz and talks about the class of decaying functions for which one can operate nicely. This was something I next saw primarily in mathematics texts, with very few engineering books caring to talk about this even though it is not very hard to introduce and gives significant clarity to the process IMHO.

Studying Prof. Osgood's stuff off Stanford SEE during my summer vacation at the end of high school was one of the best learning experiences I have had till date.

gajjanag··on North Korea claims success in fifth nuclear test
Nonetheless, the Doomsday Clock has been recently advanced: https://chomsky.info/06122016/.
gajjanag··on A Survival Guide to a PhD
> Personally, I had an awful time during my PhD, and between the penury and the toil and the bleak prospects afterward, I'd say you're definitely in the minority on this one.

Do you have any evidence for the minority claim beyond the personal anecdote? Also, this is field dependent, so a mention of the field could be helpful.

gajjanag··on Joe Sutter, who guided creation of the Boeing 747, has died
My fascination with the 777 lead me to a great documentary on Rolls Royce and jet engine manufacture: https://www.youtube.com/watch?v=VfomloUg2Gw.

Note that Rolls Royce faces stiff competition with chiefly General Electric as the engine supplier for the 777 line.

gajjanag··on Why prisons continue to grow, even when crime declines
> I think a prison sentence on someone's record will make them more likely to repeat the crime. With the criminal record, minimum wage, or close to, are the only options available.

What difference then does it make it if is 30 days or 3 years? In other words, how is 30 days an improvement to the problem of deterence (though it is an improvement to the taxpayer)?

> Also, it's human nature to believe you won't get caught. If someone thought they were likely to get caught, they wouldn't do it.

Not necessarily, some people who know that with high probability they will get caught still perform crimes; drug addiction can be quite powerful. At a first glance, I would think that substance abuse treatment/improvement in mental health facilities can help here.

> Thirdly, what makes you think a 3 year sentence would deter someone from doing it any more than a 30 day sentence would? I'm sure the person didn't even realize stealing a bicycle carried a 3 year sentence. For deterrence to work, a person must know the punishment for the crime. Also, the 3 year sentence doesn't fit the crime. At some point, it becomes cruel and unusual.

I agree here; this is part of the reason why I don't think long sentences are a good solution. But in my view, your proposed solution does not do much either to the problem of deterrence.

> I think locking a person up for 3 years for stealing an unlocked bicycle that the police planted trying to bait someone into stealing it is cruel and certainly unusual. It's also pretty darn close to entrapment.

What if the police simply want to install a tracker, in order to investigate the possibility that the theft is being performed by an organized ring which regularly steals bikes, in which case a 3 year sentence could fit the crime? Standard bikes do not come with trackers; this will require active intervention.

See http://www.nbclosangeles.com/news/local/Thief-Makes-Quick-Wo... - here the "entrapment" was done by civilians. Sting operations by civilians are certainly useful in many parts of the world, e.g to expose bribery. I fail to see why there should be a blanket "no to entrapment" in the case of police, but continue to allow it for civilians. Personally, I believe entrapment by both civilians and police forces has its uses at times.

> Finally, we have a deterrence paradox. If the US houses the largest prison population in the world, why are there people still stealing bicycles? On the other hand, if crime is at an all time low, why are we still locking people up at an increasing rate every year?

I don't have an answer to this. On the other hand, in my view your proposals do not either.

gajjanag··on Why prisons continue to grow, even when crime declines
As I pointed out above, I don't think 3 year prison sentences are an answer.

Just saying that the proposed solution of a fine/30 days sentence will likely not decrease the rate of bike theft.

gajjanag··on Why prisons continue to grow, even when crime declines
> 1. I would think either a fine or a 30 day sentence is more than enough.

What makes you think this will deter them from repeating the crime in the future? For a drug addict in search of a fix, bicycles have high liquidity on the market, are easily stolen, and usually not caught. Drug habits are not easy to kick away.

Note that I am not saying that long prison sentences are an answer for this, just pointing out that a fine/30 day sentence will likely not work.

gajjanag··on Looking ahead for WhatsApp
> Use Signal: https://whispersystems.org/

I like the idea, but don't know of a good method to get my contacts to use Signal as well without making myself look extreme in my views. Any suggestions for this? For example, do you know of any short and crisp messages that get the point across, without getting into a never ending discussion of privacy and its value?

gajjanag··on Lyft Is Said to Seek a Buyer, Without Success
> Freight generally needs to be handle all of the problems that a cab does (turning, stoplights, other cars, getting from point A to point B, etc.), mostly because pretty much all freight trucks need to go through a town/city at some point.

Freight consists of both long and short haul, with different needs and approaches. Your point applies to the "last mile" delivery phase, which may or may not be a significant part of the operation.

In fact, many big stores like Walmart, Costco, Aldi, and the like are placed pretty close to an interstate exit. I would guess that this allows significant reduction in costs, as the operators don't need to switch from their optimized long haul vehicles (big trailers, etc) to more maneuvarable, less efficient (per unit weight of goods) trucks for the last mile stage.

There is plenty of freight that is carried on highways over long distances with low traffic volumes, in a similar role to rail freight.

> Additionally, they need to be able to drive at night in areas without much lighting,

During winter at higher latitudes a lot of driving is at night. As for lighting, plenty of city streets are dark and have poor lighting at night.

> they need to drive for hours and hours on end, instead of just 5-45minutes, etc.

So? Fatigue is something that affects human drivers. There should be no serious differences for an autonomous vehicle driving 10 30 minute trips and one 5 hour one, modulo start and stop. In fact, if anything, longer duration trips tend to involve a greater fraction of highway usage that does not require significant brake usage, turning, etc.

> Finally, they are 40+ feet long (instead of being around 15 feet long) and have much less maneuverability and a much longer stopping distance/time.

I agree with this.

gajjanag··on The Age of Absurdity: Why Modern Life Makes It Hard to Be Happy (2010)
> The core thought is that people trade up for comfort (including privacy), but that they lose out on the overall bonds with other people that are what really makes us happy.

The fundamental importance of high quality bonds with other people is something I wish was emphasised more. The following TED talk describes a pretty interesting research experiment done over a long time frame which essentially comes to this conclusion: https://www.youtube.com/watch?v=8KkKuTCFvzI

gajjanag··on Un-Facebooked
> But market forces only work well when there's a lot of competitors. Facebook, on the other hand, is very close to being a monopoly — and just like relativistic speeds break classic mechanics, just like that the monopoly status breaks the classic market forces. And they should decrease the amount of freedom the company enjoys as well.

> Of course, there's a question about how we define "monopoly": there's a lot of counter-arguments to this, and a lot of them perfectly valid. There's Twitter, there's self-hosting, there's all these forums around the internet... But at the same time, isn't it strange that "monopoly" as we understand it is a binary category? I think it's reasonable to think about it as a continuum; and Facebook today would certainly be very far on that axis.

Interestingly, Charles Munger has spoken quite extensively on how market dynamics can often favor consolidation and "winner takes all" phenomena such as the Facebook example you describe. Indeed, he discusses newspapers as follows:

"The most obvious one is daily newspapers. There's practically no city left in the U.S., aside from a few very big ones, where there's more than one daily newspaper. And again, that's a scale thing. Once I get most of the circulation, I get most of the advertising. And once I get most of the advertising and circulation, why would anyone want the thinner paper with less information in it? So it tends to cascade to a winner-take-all situation. And that's a separate form of the advantages of scale phenomenon."

Similar things happen with the Internet. Indeed, I find it extremely surprising that anyone would think that the Internet would be different in this respect.

> After disabling my Facebook account for half a year, it became painfully evident that I wouldn't be able to keep in touch with a lot of family and friends without it.

There were methods to keep in touch with family and friends before that have not gone away. Anyone who I regard as a close friend would certainly understand when I explain to them why I don't use Facebook and how to contact me (via email, etc). Maybe this is a bit harsh, but for me if someone I know does not understand this and spend the minimal effort to contact me via other channels, after I explain to them in copious detail, I don't bother keeping in touch with them.

As for business stuff, this is where the centralization does get annoying. For instance, for a musician these days it definitely helps to have a Facebook and/or Twitter account and/or YouTube channel. On the other hand, the music industry has been plagued by these issues for a long time - before it was the album makers as the gatekeepers, now it is Apple with iTunes, Google with YouTube, etc. Most of what has changed are the names of the gatekeepers and means of distribution, not their existence.

gajjanag··on Facebook will force advertising on ad-blocking users
A method that is more complete was described on HN a while back: https://news.ycombinator.com/item?id=11791052.

For OS X implementation, see the comment https://news.ycombinator.com/item?id=11795351 and the linked implementation.

For GNU/Linux, no one seemed to have posted something and I could not easily find it. Hence I wrote my own that has been tested successfully on my own machine: https://github.com/gajjanag/config_files/blob/master/block_f....

gajjanag··on The Two Cultures of Computing (2013)
> Any example?

Really depends on what means by better and what one values. Still, here are some relatively unambiguous ones: global warming/climate change, the fragile nature of the current equilibrium wrt nuclear weapons. Maybe long term we will solve them, but in the short term we are worse off.

> That doesn't mean much. Even if a process (e.g. iteration) doesn't always achieve the desire result, it can still be the only way to achieve those results.

> E.g. asking a person out. It might not always work, but it's still the only way to go on a date with them.

There are costs associated with each iteration, and in the context of dating, there is a threshold to the number of rejections. Obviously, at some level any work is an iteration on the existing body of work, in which case your point also does not mean much.

My point is that in certain cases it can be best to leave things as they are.

"Fixing" rm is one such thing for me: there are trivial workarounds via aliases (can be shipped by a distribution) for those who really care. I am sure your thoughts are not unique on this: people must have tried "fixing" rm in the past, and judged it not worth it.

One is completely free to work on "improving" something. However, there should be no expectations that others find it an improvement.

gajjanag··on What I learned from the Chinese about our Indian online market
Not a whole chapter, but yes, I had forgotten the exchange near Cirith Ungol.
gajjanag··on We’re in a Low-Growth World. How Did We Get Here?
FWIW, some ideas on how to reduce time spent on cooking: 1. Pressure cooking - saves not just time, but also energy. 2. Cooking in bulk, e.g. over the weekend, freeze or refrigerate the contents, and heating in a microwave over the weekdays.

Personally, I think the biggest tragedy for low income people is that many small food stores that accept food stamps do not stock healthy foods well, instead favoring higher margin junk, processed food: http://www.nytimes.com/2015/03/21/opinion/see-no-junk-buy-no....

There is also the problem that a lot of healthy food is ridiculously overpriced, catering to the upper middle class population who wants to "eat healthy" and believes some nice "feel good" marketing material instead of careful thought. There still exists very good food that is very cheap, such as the beans mentioned in this discussion. Lentils operate in a similar fashion. It takes effort to identify such things though.

gajjanag··on The Two Cultures of Computing (2013)
> That's how you get better stuff though, with cycles.

This is an assumption that is not necessarily true. In the short term, there are plenty of examples of places where it is not true. As for this being true "asymptotically", that is a hard to verify assumption.

What is true is that cycles result in something new. New does not necessarily mean better.

The examples you give below are examples where the cycles have worked; there are examples where it has not.

gajjanag··on What I learned from the Chinese about our Indian online market
Nobody has written epics about anyone digging someone else's toilets as far as I know. This is not unique to the Mahabharatha or other Indian epics.

As for the caste system, yes, it has had a lot of evils. But then almost all populations around the world have some notion of "class" that is loosely defined, with its own set of evils. I fail to see how this is unique to India, see for instance the topic of ghettos in medieval history. In modern times, the "class" is usually based on financial wealth.

Furthermore, in the sense of classification based on profession (the idealistic interpretation of caste), this certainly exists across the world (merchant guilds, high concentrations of a single occupation like Harley St, London, etc).

Finally, as for viewing the past through rose-coloured lenses, every historian has his/her own set of biases in terms of coverage and emphasis. There are some who are honest about the reality of this, such as Howard Zinn who mentions it in his preface to "A People's History of the United States", but many delude themselves into thinking that they somehow are magically "unbiased".

With respect to works of fiction, the same applies. In the case of Tolkien, the treatment of the orcs is an example, we never see an orc perspective or pov. In the case of the Song of Ice and Fire, there is arguably little treatment of the common population. Military engagements are reduced to the standard historical style focusing on the leaders and "important" entities involved. As for the Mahabharatha, similar issues arise. Nevertheless, it has a surprising amount of depth and complexity in many respects (e.g morally grey characters and a bittersweet ending).

gajjanag··on The Two Cultures of Computing (2013)
> I'd even appreciate a "trash mode" for rm as default. Then you do something like "rm purge" and only then it actually kills everything put in between calls. Tons of user documents would have saved that way, instead of "just be careful because that's how we always did things". And of course some --doitnow flag could just delete stuff immediately.

That will break a large chunk of scripts that use rm. Say someone with sufficient clout implemented this, dumped the information into some release notes, even made it widely known via various internet forums.

Inevitably, what will happen is that we get a split: some who do not want to use the "improved" tool as they have other more pressing concerns, and others who view it as progress.

If anything, there is already a ton of fragmentation even in such basic utilities found in coreutils (BSD vs GNU differences, not immediately available on Windows, etc).

And the funny thing is that even if unity is practically achieved for some time, someone will want to scratch a new itch, repeating the cycle.

gajjanag··on Ask HN: What was your “why didn't I start doing this sooner” moment?
I am a bit surprised that no one else has mentioned the "warrior diet" https://en.wikipedia.org/wiki/Warrior_diet, explained in more detail in https://books.google.com/books/about/The_Warrior_Diet.html?i....

Basically, the idea is to divide into undereating and overeating cycles, eating a single big meal a day (or in more extreme instances, one large meal per 2 days).

Unfortunately, the book linked above does not have a lot of scientific backing. This may simply be due to how it deviates from a lot of conventional diets at the moment.

Nevertheless, personally I rarely trust "scientists" who work in the field of nutrition:

1. They tend to change their views drastically over time. See e.g the whole sugar vs fat issue.

2. They are often heavily influenced by corporate funding, and as such incentive structures do not align well with the goal of rigorous science. One personal anecdote: my extended family uses a lot of coconuts and coconut oil in cooking. Coconut oil was presented in many "scientific" publications as being one of the worst oils, and olive oil as the best (often by olive oil company funded research). Things are much more even now.

Basically, I believe in the following:

1. Following a particular ancestral diet is a pretty safe bet - it has been tested and refined over hundreds, if not thousands, of years. There is often accumulated wisdom in certain practices. See e.g. https://www.amazon.com/100-Million-Years-Food-Ancestors/dp/1... for a detailed discussion of this.

2. Intermittent fasting has been practiced in various cultures to different extents, often due to religious beliefs. Again, something that has persisted that long is likely fine.

In short, true science is usually lacking in nutritional work. As for anecdotal evidence, there is some, detailed in the book above. I also am skeptical about the extent of its benefits, but see no serious downside to the "one meal a day" idea.

← PreviousPage 5 of 7Next →