21,186 karma · joined Oct 12, 2010 (16y ago) · 6,050 submissions
Personal site: http://www.adityamukerjee.net/
My email is pretty easy to guess from my username.
comment 13y ago · link · parent
Yes, you still have to deal with timezones, but I'd much rather be given a UNIX timestamp for a UTC time and then adjust accordingly, rather than deal with all the other problems that come from communicating and converting between various other calendar formats and locales.
And this exchange should occur at the very last step, only when being displayed to the user. For almost any other purposes, there's no reason that two different applications should need to talk to each other using anything but UNIX timestamps. The potentially error-prone conversion should happen in the latest stage possible, because that's the part with the most knowledge of how any error should be corrected.
> At the same time, the human brain doesn't seem particularly well-suited to breaking down Unix time into meaningful scales,
But we're talking about for programming purposes - to a computer, one 64-bit int is as good as any other.
comment 13y ago · link · parent
(As far as non-concurrent code goes, gccgo is very well-optimized, because it's basically piggy-backing on the extensive optimizations of gcc over the decades.)
comment 13y ago · link · parent
The only messy part is the OAuth callback, which I did manually instead of using one of the OAuth2 libraries, because at the time I was trying to identify a possible bug in an OAuth implementation.
Keep in mind that it's not the cleanest or most idiomatic Go code, but even that aside, it's relatively concise - and more importantly, straightforward to understand, even if you've never written Go before.
comment 13y ago · link · parent
Well, yes, it's really easy to say that a disease doesn't exist if you ignore all the people who are suffering from it.
> they don't just do better because they're given less drugs, it's also because of social differences in terms of how families interact with each other.
What "social differences"?
Schizophrenics in India are far more likely to go undiagnosed and untreated, which only exacerbates the problems for them and their families. That's a big difference from saying that there's a high recovery rate, let alone that it's not a disease.
comment 13y ago · link · parent
1. It assumes all slices to be of type []interface{} by default, though oftentimes a more precise type is possible. (This is just a matter of looping through and determining the most specific type)
2. It only accepts valid JSON. Not a bug, but for example, the sample responses on the foursquare API documentation omit the (required) quotation marks around identifiers: https://developer.foursquare.com/docs/venues/venues (click "Try it Out"). That's a common problem which I'd like to fix eventually.
comment 13y ago · link · parent
I wrote a short script to automate generating the struct definitions, since I didn't want to generate the structs by hand. Go's reflection made this really easy.
comment 13y ago · link · parent
How are these mutually exclusive? If you want a server that automatically runs the most recent (working) build of a piece of code, it's rather straightforward to implement.
comment 13y ago · link · parent
To be honest, most schools that do cover those do an even worse job than not teaching anything at all.
If you're interested in filling in the gaps on your own:
http://www.amazon.com/Dont-Know-About-History-Anniversary/dp... http://www.amazon.com/Lies-My-Teacher-Told-Everything/dp/074...
comment 13y ago · link · parent
In the short run, this would make a difference, but not in the long run - the incidence of payroll taxes has been shown to fall almost entirely (~98%) on the employees.
(For those unaware: the incidence of a tax[1] is a way of describing who really bears the burden, which is completely unrelated to who nominally pays a tax out-of-pocket).
comment 13y ago · link · parent
[1] http://blog.okcupid.com/index.php/the-real-stuff-white-peopl...
comment 13y ago · link · parent
Actually, I'm pretty sure it uses Busybox tools with ash, not GNU with bash.
http://www.gnu.org/philosophy/android-and-users-freedom.html
comment 13y ago · link · parent
Or maybe I've just been thinking about types too much recently!
comment 13y ago · link · parent
If you're looking for a tl;dr, you've come to the wrong place - not everything is so simple, and while I'm happy to explain my comments to people who ask politely (like isbadawi), I'm not really in the habit of writing MLA-style research papers on demand (and certainly not when the same information is already so widely and easily accessible).
comment 13y ago · link · parent
No, there's a distinction between a code translation and a code compilation. At an abstract level, it's the difference between an actual Turing machine encoded with a specific set of instructions, and a Universal Turing machine along with an encoded representation of a program. Logically equivalent, yes, but that's not the same thing as saying that they're actually the same thing. (If they were, this would mean that any Turing-complete languages would be the same, so you might as well just write COBOL!)
Compilation is not just a matter of "produce another piece of source code that appears to have the same logic when executed". With compilation, the only information required at runtime is the input to the program itself (which is never known at compiletime, unless your program is one massive thunk - which would be kind of a useless program!). When translating code to another language like, eg., Javascript, this isn't the case, because the input to the program isn't fed directly to the output of the translation; rather, both are fed to the interpreter which executes one on the other.
This applies whether the target language for the translation is itself an interpreted language or a compiled language, but in practice, the translated form of a compiled language (ie, C) can itself be compiled immediately as part of the translation, so this isn't really a relevant distinction there.
(By this logic, it would seem that javac is a translator, not a compiler, which is almost half-true, but only because Java itself blurs the distinction[1]. javac compiles Java code to run "natively" on the Java virtual machine, and that machine is virtualized on actual hardware. So no input is required at runtime from the perspective of someone inside the virtual machine; however, since we're outside that hypothetical bubble, we can't actually execute that code natively and need to run a second translation at runtime - ie, the "just-in-time" portion of the process).
The reason this distinction is important has to do with the portability, reliability, and predictability of the generated code. Compiled code is inherently less portable (or at least, no more portable) than the pre-compilation source (whatever that language is). This is why languages like C are compiled for a particular system. On the other hand, the compiled form "solves" a lot of the decision problems that don't require executing (or even knowing) the input before-the-fact.
An interesting example of this problem is hiphop-php. As one of the other commenters pointed out, when translating code from one language to another, you have to encompass all of the quirks of the language (like 'wat') properly. The hiphop-php output is incredibly large because it has to statically determine the actions required when, ie, two variables are added, but one is a number and one is a string. This is just a feature of a dynamically typed language, yes, but it's not an issue if you simply wanted to translate Ruby to PHP, because you don't have to factor in any of that logic at compilation time - rather, it gets factored out and passed on to the interpreter. To create a truly self-executing, compiled form, that requires solving a lot of this logic insofar as your target system will allow, which is a much trickier process - you can't just rely on the runtime or the interpreter to pick up the slack for you.
[1] Incidentally, this was one of Java's selling points back in the day - hard to believe now!
comment 13y ago · link · parent
comment 13y ago · link · parent
In any case, I think this was just for display purposes. The touchscreen is intended more to replace the mouse than to replace the keyboard - at least for now.
comment 13y ago · link · parent
The availability issues for the Nexus 4 have absolutely nothing to do with the Christmas rush.
> So don't buy locked down devices. There are unlocked device for sale,
You're missing the two points, which are:
1. Unlocking the device should be an option for all phones - it's a basic right of ownership.
2. It's getting harder and harder to find truly open devices (the Galaxy Nexus had issues on this front). If things keep heading in this direction, soon there won't be any unlocked devices for sale.
comment 13y ago · link · parent
For example, my music collection is split across multiple hard drives in two different states - not by intention, of course; it's just what happens over the years. However, I can create a single folder on my laptop that organizes all of this music, even though it's far too large to fit on the laptop's hard drive. Even though the files exist on multiple hard drives, my laptop knows which ones have which files, so I know which hard drive I'd need to plug in to access a particular file.
Better yet, since this is a fully distributed setup, there's nothing magical about my laptop - I have a desktop that has another copy of the repository, and it too knows where all of the files are (even though it has a different subset of my music collection).
I can also back portions of the collection up without ever having my entire collection on a single drive. I can enforce redundancy - "make sure that three verifiable copies of this file exist on other drives before deleting it here". I can back up to Amazon S3 or Glacier. I can - well, do pretty much whatever you'd want to do on a non-distributed filesystem - except this is distributed.
Dropbox is a great idea - I'm happy that it exists, and I see its value for a lot of use cases, but at the end of the day, it's not really solving the problem of distributed data; it's just creating a centralized, canonical data store in the cloud that is capable of interacting with other data stores.
Dropbox is great, but at some point, it's nice to move on from SVN! :)
Keep in mind, I'm not trying to do any sort of version control on my files - it's strictly a way of managing a completely distributed filesystem. If you want versioning, git-annex apparently can do some of this too, but I can't speak to it.
comment 13y ago · link · parent
On the other hand, it's ridiculous to think of how far things have come since then... people who complain about Linux usability and driver issues in 2012 really don't know what they missed!
[1] and failing!