Better HN
topnewbestaskshowjobs
Log inSign up

chimeracoder

21,186 karma · joined Oct 12, 2010 (16y ago) · 6,050 submissions

Inveterate builder.

Personal site: http://www.adityamukerjee.net/

My email is pretty easy to guess from my username.

Submissions

comment 12y ago · link · parent

For context: Go has been my primary language both at work and for personal use for over two years now.

> It is worth pointing out that if the Go community settles on something like this as the solution, it negates one of the underlying arguments that the Go designers have against generics in the language.

It wouldn't really negate the underlying arguments; it would just mean that the community had grown and attracted developers who may not necessarily share that part of the language creators' original vision of the language.

> But all the other solutions that are headed into that gap are just one level or another of convenience wrapper around exactly that.

Well, focusing on "the other solutions" misses two things:

First, many (I dare say most) Go developers[0] don't really use any "solution" for this other than the features built into the language itself. In other words, they're not out there writing alternative solutions because they genuinely don't perceive a lack of generics to be as big of a problem as other things, which they do write tools for.

Secondly, there is a way to use interface{} to accomplish some (not all) of the same things that generics do, while still preserving type safety. Look at the functions in this Twitter client library I wrote: https://github.com/ChimeraCoder/anaconda/blob/master/users.g...

All the endpoints use the same apiGet() function ("generic"), but they all return concrete types, and they are all typesafe - you will never get a runtime panic from any of those functions. This is more than Java's generics guarantee, due to the quirks of the way type erasure works there[1].

No, this isn't "generics", but it provides an alternative way of solving the problem most of the time (in practice), and isn't that what matters? And yes, this is not quite as clean as some languages which focus on having a very expressive and precise type system (ML, Haskell, etc.), but it provides enough type safety for me without requiring me to think consciously about the types that I am using (which I have to do when writing ML or Scala).

[0] I mean people who write primarily Go at least 4-5 days a week, for work, as opposed to people who dabble with it for side projects but primarily use other languages.

[1] TL;DR: Java's generics are converted to "Object" after compilation, which means that you can actually end up with runtime type errors that are detectable at compiletime, due to inheritance. (It's been a while since I used Java, so I won't provide an example, but they're easy to find online).

comment 12y ago · link · parent

Mozilla's funding comes primarily from search partners (namely Google)[0][1] - I don't think they could do this and still survive as a company at this point, sadly.

At the same time, if every Firefox user donated even $1 to Mozilla, they wouldn't need to take this money[2], and could probably be a bit more carefree in these decisions.

[0] https://www.mozilla.org/en-US/foundation/annualreport/2012/f...

[1] https://en.wikipedia.org/wiki/Mozilla_Foundation#Financing

[2] https://en.wikipedia.org/wiki/Firefox

comment 12y ago · link · parent

> If you run a web service and would like to provide high-security anonymous access, consider running an Exit Enclave -- a Tor exit configured to exit only to your site. If Tor detects that your exit and your site share an IP address, it will automatically extend the normally 3-hop circuit to your node, and the traffic will exit the Tor network on your machine rather than an arbitrary node (which could be malicious).

For what it's worth, DuckDuckGo has done this for the past 4 years[0].

I think StartPage is still the default for the Tor browser bundle, but I'm not sure if they have an exit enclave as well.

[0] http://www.gabrielweinberg.com/blog/2010/08/duckduckgo-now-o...

comment 12y ago · link · parent

No need to use git, since you can just use diff(1) to find the unfollowers between any two dates. I've been doing this for a while with a Go program I created[0].

Unfortunately, people who change their Twitter handles (which I found surprisingly common) show up as false positives - you either need to filter these out manually or match against the user id[1].

[0] https://github.com/ChimeraCoder/twitter-follower-logger

[1] Adding that as a separate field and then calling `cut -f2` would be a quick hack, now that I think about it.

comment 12y ago · link · parent

> I had 6 in January and it is just 2 now.

I'm fairly certain they changed the ranking algorithm for comments around April/May. My average used to be 10 (it's 4.5 now), and this meant that I could comment on a thread and it would essentially always be the top comment, even if it only had 1 point and the comments below had more.

This created a positive feedback loop - because the top comments get read more, they also get voted up more (as long as they're not blatant trolls/spam). So once you had an average of about 6 or more, it was very easy to maintain and rack up points.

They seem to have changed the algorithm them - I remember when they did it, because I noticed the effects almost immediately (not just on my own account, but on others' accounts, like tptacek and tokenadult).

Overall, this is probably a change for the better, since it mitigates the "rich get richer" effect of commenting frequently while still rewarding people who consistently contribute valuable comments.

comment 12y ago · link · parent

> anything that gets people thinking more about their activity and diet seems like a good thing.

This makes intuitive sense; however, in practice, the truth is a bit more complicated.

We don't really know how to get people to change their behaviour and exercise more, eat less, etc.[0] - this is the holy grail of "lifestyle" diseases such as diabetes or heart attacks. (Disclaimer: my startup is a health-tech company aimed at improving medical outcomes through a number of factors, including getting patients to adapt their behaviour).

However, there's a lot that we know doesn't work. It turns out that simply making people more aware of what they're eating not only doesn't work, but in fact oftentimes causes people to eat more. There are a few hypotheses explaining this, both of which are supported by evidence (so it's likely to be a combination of factors).

First, people falsely equate awareness with action, psychologically[1], so making them over-aware of that they are doing makes them likely to think that they are taking more action than they actually are[2].

The second is that people don't have a good sense of how to process this data, so by (e.g.) placing caloric counts[3] next to food items, if they don't also know how many calories they should be consuming in a typical meal[4], they can end up overeating ('This dessert is "only" 800 calories!).

[0] by this, I mean a systematic process that is cost-effective on the population at large, not something that is (a) effective only for a small subset of people, or (b) effective but cost-prohibitive. There are a lot of strategies that are very effective for people who are already low-risk, and a few strategies that are effective but insanely expensive for people who are high-risk.

[1] This is analogous to what happens in politics with "slactivism".

[2] This is probably the origin of the advice that you shouldn't tell your friends about new resolutions before you have constructed a plan to enact them - telling others about it gives you a sense of satisfaction even before you've done anything.

[3] Not that calories are really the best way to measure diet, but let's set that aside

[4] Most often, people are familiar with the number '2,000 daily', but that doesn't help you determine how that should be allocated throughout the day (dividing up into three equally-sized meals is not ideal), and many people require significantly less than or more than 2,000 calories.

comment 12y ago · link · parent

> Linus has had plenty of heated moments on the mailing lists, but 1) he's often right and 2) his venom is usually reserved for experienced developers that really should know better

Also, his gain attention specifically because they're available, whereas most companies don't make all their internal emails visible to the public (which Linux does).

One of the few uncensored corpora of emails that we have is the Enron Corpus[0] - if you look through them, you'll see a lot of profanity, vitriol, etc. that helps put Linus's rants in perspective.

Also, the "Linus rants" are rather cherry-picked - they make the rounds here periodically (sometimes years after the emails were originally sent), but that's not to say that it's representative of a typical email that one is likely to receive from Linus.

[0] https://en.wikipedia.org/wiki/Enron_Corpus

comment 12y ago · link · parent

> Advocates say misdemeanor marijuana charges, which require that the drug is in plain sight, are a bellwether, because the police ordered thousands to empty pockets, and arrested them.

Stop-and-frisk in NYC is very closely linked to marijuana laws. To give some context on the ridiculousness of marijuana laws in New York:

Marijuana has been decriminalized in New York since the 1970s. It was originally included as part of the Rockefeller Drug Laws, guaranteeing lengthy mandatory minimum sentences, but after a bunch of kids were getting caught with dime bags, the PTAs[0] lobbied to issue an exception for possession of less than 25 grams[1].

Unfortunately, they included a loophole: if the marijuana is either burning or "in plain sight", it receives the same penalty as if it were over 25 grams, regardless of the amount. So, police can simply tell people to empty their pockets, and - presto! - the marijuana is 'open to public view'.

This loophole is so widely exploited that, despite the fact that marijuana is decriminalized in New York, New York City arrests more people for non-violent, low-level marijuana possession and more people per capita for non-violent, low-level marijuana possession than any other city in the entire world[2].

[0] I kid you not!

[1] Not a full ounce, just 25 grams: http://norml.org/laws/item/new-york-penalties-2

[2] https://www.drugpolicy.org/news/2011/02/2010-nyc-marijuana-a...

comment 12y ago · link · parent

> speculative (AirBnB increases rental property prices for everyone)

Far from speculative - it's a rather straightforward result from the basic economic principles at play. And even if you hesitate to draw conclusions based on reasoning from first principles alone (which you should), there have been a few studies which have measured this effect empirically.

Keep in mind that the economic impact of hotels (both illegal and legal) on nearby rent has been well studied[0], so unless there is a reason to believe that Airbnb specifically is unique, the default assumption should be that they will have this effect too.

It's not a smoking gun, no, but it's far from speculative if both inductive and deductive reasoning support that conclusion.

[0] Especially zoning, which is a distinct but very related issue.

comment 12y ago · link · parent

> Unless there is an escalation exploit, worst case is that the code trashes your user's home folder.

Which is where your $PATH is often contained.

If an attacker can modify your $PATH (and has write-access to $HOME), you're pretty much done for.

comment 12y ago · link · parent

It's funny that OP uses Twitter as the case study at the end. I wrote what was then the first (and think still the only) Go Twitter client library that works with v1.1 of Twitter's API[0]. It implements automatic rate-limiting/throttling behind the scenes, and it returns values of concrete types (not interfaces) ready for immediate use.

Keep in mind that, were I to write this again today from scratch, there are a number of things I would do differently (since I started it as a relative beginner expanded on it as my familiarity with Go developed, it's grown to be a bit over-engineered in places). But I still think it's a worthwhile example in this discussion.

For concurrency, I wouldn't say that what OP is trying to do is going to be easy in any language, because OAuth in general kind of sucks[1] the Twitter API itself has a number of quirks that make it cumbersome in general, irrespective of language[2]. That said, Go was by far the easiest to work with here, because channels allowed me to abstract the pagination and the rate-limiting in a way that it would be invisible to all callers, but "magically" handled behind the scenes.

Without going into too much detail, I can see that the way OP has designed his code looks a bit cumbersome. That said, while it's a reasonable way of approaching it, I don't think it's actually the best approach in Go given the language's idioms.

One other thing I want to draw attention to is the use of the general-purpose function for issuing a GET request to Twitter, and how that is shared among the various functions that use it to return values of varying, but known, types.

I don't want to use the word "generic" here because people expect a certain thing when they hear that word, but I will say that this function is (A) general-purpose, and (B) type-safe - it involves no type assertions, and the functions all return concrete types instead if interface{}.

[0] https://github.com/ChimeraCoder/anaconda/

[1] Don't get me started on this

[2] I've written client libraries for Twitter in a few different languages, so I actually have a reasonable point of reference on this - at one point, it was my personal "hello world" for testing out a new language.

comment 12y ago · link · parent

> As far as I can tell, the inflated prices (that almost no one pays) are mostly just so the hospital can report how much they're "losing" treating uninsured patients who can't pay.

Actually, it's because they lose money (on average) on patients on public insurance (Medicare[0] and Medicaid patients), so they need to charge private insurers more to cover the gap[1].

Insurers negotiate "discounted" rates with certain "preferred" hospitals in exchange for sending them more volume, but in this case "discounted" means "still overpriced, but closer to the actual marginal cost". The other private insurers still pay the exorbitant rates.

This is why hospitals are completely willing to lower your bill if you are uninsured and paying cash if you ask - they don't care about the money they're getting from you; they care about the money they're getting from the private insurers. The amount of money they make off of patients who are uninsured and paying out of pocket is negligible in this calculus.

Many hospitals are not at all secretive about this; executives talk about this pricing model fairly openly.

[0] For simplicity, I'm ignoring Medicare Advantage plans here.

[1] The ratio of this is HIGHLY dependent on the patient demographics of the particular hospital, but the general trend holds throughout.

comment 12y ago · link · parent

> And don't even get me started on "pre-existing conditions".

First, I would delete the sentence after this if I were you, since it could come back to haunt you legally[0].

Second, unless things are different for foreigners in the US (which AFAIK is not the case), this is not how pre-existing conditions actually work (anymore), post-ACA.

[0] (I am not a lawyer, I am not your lawyer, and this is not legal advice.)

> So you are practically forced to go in completely blind about potential costs.

This (price transparency) is actually the real problem more than the sticker prices themselves.

If patients had the ability to know expected prices beforehand, market forces would work to bring prices down. As it stands, we have a very awkward situation in which insurers compete to keep premiums down to attract customers, and therefore negotiate lower prices with providers, but patients are completely blind to this entire process and are unable to "vote with their wallets", because the prices that patients pay and the prices that insurers pay are not always directly linked in practice.

comment 12y ago · link · parent

> I wonder what this would look like adjusted for income. The same author wrote about how much income matters in online dating, especially when over 23 and making less than 100k[1]

It didn't make it into that post, but I can tell you that, when we ran the numbers[0], the relationship between the races did in fact remain even when adjusted for income.

As suggested by one of the other comments in this thread, income does mitigate the effect somewhat (a black man who earns $100K+ was more appealing on average than a black man who earned <$20K), but the intercepts were still different (the effects of race were non-zero), even though the slopes were positive (income could counteract this).

There were a few surprising quirks that did come out when we teased income out, but I'd have to go back and check. Sorry I can't be more specific - this was over four years ago, and I don't have the data in front of me anymore!

[0] (I did the income analysis for that post you linked)

comment 12y ago · link · parent

Just so you know, what you are saying doesn't contradict what I am saying.

You're saying that there are technical concerns, and that those are a large number of the concerns expressed.

I'm saying that his personality and previous history with PulseAudio are a reason that those technical concerns are expressed far more often (and with more vitriol) than they otherwise would be.

comment 12y ago · link · parent

> What is it about init systems that causes this outrage? I really want to know!

There are some technical concerns, but a disproportionate amount of criticism is because the lead developer[0] of systemd also developed PulseAudio, which was adopted by distros too early and therefore caused a lot of problems for people.

People remember PulseAudio without much fondness, so they are bitter and take it out on systemd.

It doesn't help that he has a somewhat direct manner of communicating, which some people find off-putting.

So, to answer your question, a lot of it is personal, not technical. That's why you see much more vitriol than you'd otherwise expect for a somewhat technically controversial, low-level piece of software.

[0] http://en.m.wikipedia.org/wiki/Lennart_Poettering

comment 12y ago · link · parent

> There are a lot of comments here about how IRC lacks features of HipChat/Slack/whatever.

I really don't understand this. What features does IRC lack that Hipchat has? AFAIK, the advantage of Hipchat is the branding, the packaging, and the support.

The one thing I see ("image previews") is a feature of the client, not IRC itself. And many clients used to offer that, way back - the reason they turned it off was because it was a great vector to (e.g.) goatse someone. In any GUI-based IRC client, this is dead simple.

Most of what Hipchat seems to provide is branding and support, and I get that that's very valuable, but I don't see why that needs to be viewed as an either/or situation.

comment 12y ago · link · parent

I used to work at OkCupid, on OkTrends.

You're not the first person to propose this question - there's a comment like this almost every time OkCupid makes the front page - and here's what I wrote the last time[0], which I think explains it well:

There were a number of factors. A bit part is that, in 2010, there were 2.5 people working full-time[1] on doing research for OkTrends, which allowed us to research, write, and publish posts much more often.

The blog posts took a lot of work. "The Real Stuff White People Like"[2] took almost two months of my time, plus some from Max and Christian as well. (Much like the product design process, since we didn't start each post off with a clear end result in mind, not all the work was visible in the final product).

I left to go back to school. Max ended up taking on more responsibility for other data/stats work, which slowed the pace a bit, and he left at the beginning of 2012 to do his own stuff. And Christian became in charge of running OkCupid after the acquisition, which meant he had even less time then he did before Max and I joined.

People asked me for the last three years whether the reason OkTrends hadn't posted since 2011 was because of the Match.com acquisition and whether Match shut them down and I had to tell everyone "No, trust me, they're still around! It's just a coincidence!". Thankfully I no longer have to. :)

[0] https://news.ycombinator.com/item?id=8097780

[1] 2.5 full-time means: Two of us full-time, as well as Christian, though he split his work time between OkTrends (the blog) and other stuff.

[2] http://blog.okcupid.com/index.php/the-real-stuff-white-peopl...

comment 12y ago · link · parent

> When signing a contract, are you ethically obligated to follow the terms of the contract, or are you merely agreeing to something which can be enforced by the terms of the contract, including penalties and lawsuits.

Ethics have nothing to do with the likelihood of getting caught or any potential penalties after being caught.

Some people do do business in that way, sure, but that doesn't change the ethics of those actions.

comment 12y ago · link · parent

> It's pretty straightforward, as ethical dilemmas go. "Excitement" comes nowhere close to justifying breaking your word.

Agreed - this is inexcusable.

If you lose an investment because a later-stage investor is keen on you cheating existing investors out of what you already promised them, I'd say you dodged a bullet - you don't want them owning any piece of your company.

If your later-stage investors are so keen on working with investors who are willing to renege on their promises and legal obligations to earlier investors, that says something about:

(A) The types of entrepreneurs they want to work with

(B) How they themselves can expect to be treated in later rounds, when they are now the "earlier investors".

comment 12y ago · link · parent

> This will turn out to be the most important technology news of the year.

I live in Manhattan as well, and I used to think this would help.

But then Eric Garner[0] happened. The video evidence there was about as clear as you can get, and still it was amazing how apologetic the responses I saw from both NYPD and other LEOs in other jurisdictions (e.g. /r/ProtectAndServe)[1][2].

And look at Ferguson. We have no shortage of evidence of the atrocities that have been committed there. The problem isn't just pictorial evidence. The problem is actually turning that evidence into action.

[0] https://en.wikipedia.org/wiki/Death_of_Eric_Garner

[1] https://pay.reddit.com/r/ProtectAndServe/comments/2b4on3/i_d...

[2] Note that this particular thread was later linked from /r/Bad_Cop_No_Donut so the current state is not representative of what it was when it was initially posted - previously, the comments defending the NYPD had far more support (votes-wise), and many of the comments defending Garner are from readers of the latter subreddit.

comment 12y ago · link · parent

> I'll start with heavy number crunching (Go/C) and browser-based apps (JS)

Be careful to distinguish between the language and a particular implementation or runtime environment.

Go, for example, runs perfectly well in the browser[0] except for channels (which are very difficult to implement reliably given the Javascript concurrency model).

If Google decided to allow Go as a language for manipulating the DOM in Chrome, there's no reason that it couldn't serve this role equally well. (This is what Google has done with Dart, so they're unlikely to do it with Go, but this is simply illustrative).

[0] https://github.com/gopherjs/gopherjs

comment 12y ago · link · parent

It's not like there isn't precedent for percent-revenue-over-time penalties in the law (albeit perhaps not by the FCC). For example, Google was ordered to pay 1.36% of AdWords revenue to Vringo[0] (though this was later overturned).

[0] http://arstechnica.com/tech-policy/2014/01/court-orders-goog...

comment 12y ago · link · parent

> This is also why recreational crystal meth [1] is very bad for the brain. Crystal meth overloads the neurons and definitely not equivalent to Rx Ritalin as intelligently prescribed.

"Crystal meth" isn't equivalent to Ritalin (methylphenidate), but it is equivalent to Desoxyn (brand name for methamphetamine), and more or less equivalent to Adderall (d-amphetamine, with a bit of l-amphetamine).

All three drugs are prescribed for a variety of conditions and, in appropriate doses, are safe[0]. The main difference between Desoxyn and Adderall is that the extra methyl group attached to the amphetamine makes it cross the blood-brain barrier more easily, which means that the equivalent doses are smaller (by weight). The metabolic processes and the effects on the brain are virtually identical, though, so it's misleading to draw a line between them and label one as "good" and the other "bad".

The real reason that people think of crystal meth as "bad" is because it's taken in far higher doses recreationally than would ever be prescribed medically, and because it's smoked (not that this is inherently bad, but changing the means of ingestion changes the onset, duration of effects, etc.[1])

[0] At least, to the extent that we can say that any pharmaceutical is "safe"

[1] This is why nicotine gum is frustrating to many smokers, because it takes much longer to absorb.

comment 12y ago · link · parent

> appreciate that google is aware enough to know that when I search for "hash salt" I'm not talking about potatoes. DDG shows me recipes and first.

Really? For that exact query, I get the Wikipedia page for "Salt (Cryptography)", "How to Hash Passwords", and "Salt the Hash - Security tutorial"... you get the idea[0].

AFAIK, the stuff you're seeing at the top is their 'zero click' information, which Google never provided (until after DDG added it and promoted it as a selling point). That's a little hit-or-miss, sure, but the actual search results of DDG are generally just as relevant.

I've been using DDG as my primary search engine for years now - I still resort to "!g" searches sometimes, but I have to do it far less than I used to.

[0] https://i.imgur.com/qt2Xpfm.png

comment 12y ago · link · parent

If what you care about is privacy, I really don't think iOS is appreciably better than Android. (Not marginally or theoretically - I mean practically).

If you're looking to be as private as possible[0], you should either use a custom ROM of Android with Privacy Guard and with Google services disabled (or use something like Replicant or FirefoxOS, if you're comfortable straying from the two dominant mobile OSes).

[0] As private as possible while still carrying around a tracking device 24/7, mind you (cell phones constantly report your location to your carriers, who are not at all modest with this data)

comment 12y ago · link · parent

> Email: Fastmail

I recently migrated to Fastmail, and I was pleasantly surprised by how easy it was. Fastmail automatically imports your emails from Gmail, and it took me so little time that I kicked myself for not doing it before.

> Calendar: iCloud

For those of us who don't use both OS X and iOS, this isn't feasible. Fortunately, though, Fastmail also provides a calendar service. It synchronizes with Google Calendar in case you still need to use Google (e.g. for work), and it was also a seamless switch.

As for a client, I was very surprised by this, but I've actually found that the latest version of Mozilla Lightning[0] is the best calendar interface. Fastmail's is okay, but still in beta (it's less than a year old). Setting up Lightning to sync with Fastmail's calendar took just a minute, and I actually like the interface more than I liked Google Calendar's[1].

Thunderbird is an okay mail client (not a terrible interface, but not a great one), but even if you don't use Thunderbird for mail, I would recommend trying out Lightning for calendaring.

[0] https://en.wikipedia.org/wiki/Lightning_%28software%29

[1] It's okay for viewing events in the week view, but there are a lot of UI quirks and bugs that catch up with you after daily use - this one is the most pernicious, but there are a number that are simply annoying as well: http://arstechnica.com/security/2014/01/how-google-calendar-... [2]

[2] Since I know people will ask - I consider this a UI issue because it's fairly easy to imagine a minor UI improvement that would indicate this unexpected result of Quick Add (and others) before clicking "Add" without sacrificing this functionality in case it is desired.

1
134135136
202