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 14y ago · link · parent
That said, the standard library leaves something to be desired for the functional style. It makes sense for object-oriented programming to have non-mutating functions return the result and mutating functions return None (think sorted vs. sort), but this can get rather irritating when you're trying to write in a purely functional paradigm.
Also, am I forgetting my Python, or does it not have a great solution for appending to the front of a list? One thing I love about Lisp is that it's ridiculously easy to write (cons item some-list), or even (cons item1 (cons item2 some-list)). Doing the same thing in Python is irritating, because insert() doesn't return the result list.
...or maybe that's what I deserve for trying to write Lisp-like code in Python, anyway....!
EDIT: As noted in the comments, the '+' operator will suffice here. Though since lists are really arrays and not linked lists, this functional way of thinking will result in horribly inefficient CPython code.
comment 14y ago · link · parent
I think this could be achieved in a simple way in a similar fashion - some sort of a straightforward 'multithreaded' pragma shouldn't be too much of a burden.
comment 14y ago · link · parent
Given that, and given that the patches for removing the GIL were submitted for an earlier version a while back (2.4 or before, I believe), is it unfeasible/impossible to design an interpreter that detects whether a program requires support for multiple threads and then act accordingly? Since this currently requires the inclusion of a module, it seems like it would be unambiguous.
comment 14y ago · link · parent
A Bayesian approach is especially well-suited to small sample sizes, unlike a frequentist approach, which will give a nonsensical result for a sample size of 0,1, or 2.
As for improper technique, I can't help you there. 'Garbage in, garbage out', as they always say.
comment 14y ago · link · parent
Or it reflects how the event happened to him, as opposed to how the event just happened.
When writing narrative essays, remember that truth is subjective, and you have a choice between being loyal to how it impacted the narrator and how it 'objectively happened'. If you want the latter, you'll just end up with an overdetermined logfile.
I don't know what parts of David Sedaris's stories are true, and I don't care - all I know is that some of them are incredibly powerful emotionally, and that man sure knows how to nail the ending of a story.
comment 14y ago · link · parent
I mean, from the ones shown, it's sort of obvious, but I'm thinking in general. Also, Common Lisp, Racket, and Clojure are different enough that they count as separate languages in their own right, rather than 'variations', which a dotted line might imply.
comment 14y ago · link · parent
That's a problem inherent in the standardization process, though - it's all but contradictory to have something be both 'standard' and 'continuously improving'.
Once something enters the standard, does anyone propose a better way of removing cruft without constantly deprecating everything, rendering the concept of a 'standard' somewhat meaningless?
comment 14y ago · link · parent
If a juror genuinely believes that the idea of copyrighting APIs and extending that copyright to alternate implementations makes no sense, how can they come up with a decision that's anything but arbitrary? That's like me saying, 'Assume that 1 * 5 = 0, and then decide if if the satisfiability problem can be solved in linear time'.
If you give me a nonsensical set of assumptions, how can I come up with an answer that's not also nonsensical? If you give me some messed up numerical system like that one, well sure, maybe those definitions would propagate though to the definition of polynomial complexity as well. But what does that mean for the real world? Nothing - and law is meant to be applied, not some abstract theoretical exercise.
comment 14y ago · link · parent
I mean, look at it this way - GNU is almost completely compatible with Unix, but it was rebuilt from the ground up. Even if AT&T hadn't given out the license for free, you'd have a hard time convincing me that GNU breaks some sort of copyright - the entire damn codebase was rewritten from the ground up. The design of the operating system may be the same, but copyrighting that is as ridiculous as patenting a geometric shape.
comment 14y ago · link · parent
Yes, I guess potent would have been a better word choice, but you get the idea. I was trying to explain it without using terms like bioavailability and analgesic potential... I assume that anybody who understands those words doesn't need me to point out my main point, which was simply that it's hard to make a argument based on biochemistry and pharmacokinetics alone for the current drug schedules!
comment 14y ago · link · parent
I'm being tongue-in-cheek. That is, the effectiveness of the medicines would be very different, but the actual substances available in some way would barely be different.
With the exception of marijuana, almost every drug with medicinal use is either available medically in some form or unavailable, but with very related 'cousins' readily available.
Marijuana is available as Marinol - it just doesn't work, because it's synthesized without the full set of ~70 cannabinoids. MDMA isn't available (outside of very restricted research), but it's closely related to methamphetamine, which is available with a prescription. (People are often surprised to hear that one). GHB is available with a prescription. Heroin is really just a synthesized and concentrated form of morphine (available with prescription), and peyote is available for some religious ceremonies. [Psilocybin is not, but oddly enough, I believe mushroom spores are legal, even though the mushrooms are not (because the spores don't contain any psylocybin - I believe this may depend on your jurisdiction, though, and as always, IANAL.).]
So what's the end result? We've criminalized drugs not based on their underlying chemistry - there is almost no Schedule I drug that doesn't have a closely related (and oftentimes identical!) counterpart in Schedules II-IV or not scheduled at all.
If I were the conspiracy-theory type, I'd say that this is a way of saying that drugs can only be useful if a pharmaceutical company is profiting off of it. Though I'm inclined to side with Hanlon's razor on this one - that's not really how it came about historically, even if 'Big Pharma' does benefit off of it now. I don't really care - I just wish we'd start drafting laws based on science, not fear.
comment 14y ago · link · parent
I don't see how that would work. In an abstract sense, I can conceptualize it, but from a practical standpoint, I can't see it ever being implemented well enough to the point where it would be widely adopted (which would be the whole point). If you can think of a way to do it, by all means go for it, but I just don't think it's possible.
> A bash/sh dependency hurts on non-Unix OSes. I'd rather Python than sh. I also admit that, for the most part, I absolutely hate sh and all its derivates and view them all as dirty hacks, so this is probably just innate bias.
I think it's just your bias. At some point, whatever language it's written in would be non-native on most of the OSes, so you'd have to port something one way or the other (Python has a fairly nice port that abstracts away some of the warts, but it's still just serving as a pseudo-agnostic interface). Given that, why not sh? It's already been ported to Windows (I've never used Cygwin, but it seems like it'd be a useful starting point), and virtually every other OS is either Unix-like or supports some native POSIX-like interface for compatibility reasons.
If you're complaining about sh syntax, I'm a bit sympathetic toward that, but it's ingrained enough - and good enough - that I wouldn't go to the effort of replacing it. Also remember that, for shell scripting, you don't want a language as powerful as Python - it needs to be able to do a very small set of simple tasks and do them well.
Also, just think about concurrency. We take pipes for granted, but imagine trying to do that all natively in Python.
comment 14y ago · link · parent
I don't really follow your logic. There are very good reasons why you wouldn't be able to install the same package in the same way on Linux and OS X. (For starters, homebrew isn't true package manager in that it's not a one-stop shop - it can't even handle critical system updates like apt-get/pacman can!)
> Aside from all of this is the difficulty in actually constructing the packages. Arch PKGBUILDs seem the closest I've used to an easy source->binary package but they're not mainstream. As far as I know debs still don't support natively bundling the source with the binaries and the RPM SPEC system is the single unfriendliest system I've encountered to quickly make a portable package.
I think PKGBUILDs are the best of both worlds, because they allow system-specific package management to coexist with application-level packaging - two related, but subtly different problems. PKGBUILDs are general-purpose enough that they can do pretty much whatever you need them to do, assuming that they're well-written (which is our assumption when comparing any packaging method), and they're flexible enough that you can modify them to fit your specific system.
The only real problem I see with PKGBUILDs is that, at least on Arch, they're community-developed, which means that they can be out-of-date or variable in quality. But that's no worse than the situation if you were to install from source, anyway (which is the alternative), and that's more a byproduct of the way that the Arch community is structured than the PKGBUILD system itself. I'm sure if Red Hat or Canonical suddenly decided overnight that they'd start supporting PKGBUILDs, things would be different (and would have their own problems, likely...)
> Moreover, the ties to shell script just continue to harm OS independent adoption
Without looking, I'm 99% sure that PKGBUILDs are bash, not sh, but I'm also 99% sure that 99% of the PKGBUILDs I've ever installed are sh-compatible. And I don't think that's the worst thing in the world - in this day and age, you have to be able to handle sh for any Unix-like OS, and you have to be ready to implement the appropriate interface for any other OS that you want to be compatible (or to throw compatibility to the wind altogether, like Windows does).
Second, since many PKGBUILDs are really just convenient wrappers around the already-provided application distribution mechanism, I don't see how this is that bad at all.
comment 14y ago · link · parent
1. Because that puts extra work on the developers who don't necessarily know the target system very well. What if the developer doesn't know the FHS (which apparently is quite common, given what I've seen...)? How are you going to manage dependencies if the packaging systems differ widely (and no, there's no one way to bridge them all, because some of them differ because of the whole construction of the distribution itself!).
2. They'll never do it.
(#1 leads to #2, but seriously, it's enough work getting developers to write a proper Makefile/gemfile/setup.py or whatever is appropriate for the language they're working in. Now you want them to do it 100 times over, for systems that they've probably never used before?)
That works for something like sta.li, in which everything is statically linked, because then you have no problem. But when you start talking about dependency tracking and small-but-important configuration differences between distributions, this becomes impossible.
The solution is to use a two-tiered approach, which some distributions sort of already do. If I make a Python program, for example, I create a setup.py file and all of the other things that you need to install it with pip (sidenote: this is embarassingly complicated for a language that's dead-simple otherwise!). Then, I let each distro's community handle it themselves - after all, they know their system better than I do, and remember that I've already listed all dependencies, etc. because I've packaged the program itself properly!
Then, the distribution can figure out how to handle those packages - perhaps installing them directly through pip is the best solution, or perhaps they add an extra layer the language-specific package (check out the AUR for something similar to this), or perhaps they want to just hard-code the file destinations. Whatever makes the most sense in the context of the distribution itself.
comment 14y ago · link · parent
Yes, but the original point was that more or less any quantitative PhD would be expected to have these skills.
> For instance, I was the only person in my department to learn R
Case in point - and I can tell you from knowing the PhD students that I if I found someone who knew how to program in any language not used primarily for statistical computation (R, Stata, Matlab, SAS etc.), I would consider them the exception, not the norm.
The exact opposite is true about a data scientist.
> but if you are not capable of performing this kind of analysis that you probably shouldn't be doing a PhD anyway.
Or you just don't care about those types of jobs - and apparently there are plenty of those, because many, if not the majority, of PhD students I can think of aren't looking for data science jobs.
> I really don't see how programming upends all that grad students learn (though I would be delighted to hear your thoughts), as to me it just seemed like the application of logic with the aid of computers.
It's not programming per se, but the computational power that it brings makes certain techniques feasible, and other concepts and methods aren't obsolete - just no longer optimal. This is really a comment about statistics specifically. Most job postings for data science positions mention some form of the phrase 'machine learning' - and if they don't, they often have that in mind. Unfortunately, while demand for machine learning dominates the job market, in the grand scheme of things, it's just one branch in the field of statistics, and its 'parent' branch was relatively obscure until very recently. To this day, if a PhD student finished their program having next to none of the required academic background for machine learning, I doubt most academics would bat an eyelid. It's just not considered important from an academic standpoint. It's unfortunate that we have such a disconnect between academic interest and industry demand, but it's very much the case.
A basic example that I often cite about how computational power has fundamentally changed statistics from how it was for the previous few decades is in our selection of estimators. (I often cite this because anybody who's ever taken a statistics class probably had this experience). In every introductory statistics class (and for many non-intro classes as well), when studying inference, you spend 90% of your time talking about estimators for which the first moment has an expectation of zero, and the 10% is a 'last resort' when no 'better' estimator exists. Who decided that the first moment was the most important? What about the second? Third?
Well, it turns out that the first moment is easier to calculate, and, by coincidence, it happens to be the most relevant when your dataset is small (say, between 30 and 100). But once you're talking about datasets with observations which number in the thousands (which is still 'small' by some standards today!), you'd be insane to throw out any estimator that converges at a linear rate (rather than at the rate of \sqrt{n}) just because it introduces a small bias.
But we do - and that's reflected in the the sheer amount of academic research and literature that discusses the former, and the sheer lack of that reflects the latter. In many cases, the theory exists, but it was developed in an era in which it could never feasibly be applied.
Vestiges of this era are visible even in many statistical software packages - for another basic example, regressions by default assume homoskedasticity in errors, even though this is almost never valid in real life. Why? Because in a previous era, everyone imposed this assumption, because while the theory behind the alternative had been developed, it was expensive to carry out in practice (it involves several extra matrix multiplications).
I'm painting with a broad brush, but the general picture still very much holds.
comment 14y ago · link · parent
Having taken all but one of the core requirements for a masters' degree in statistics at a university with a well-respected statistics department, I can tell you that's very much not true.
The true challenges in data science have almost nothing to do with what you spend 90% of your time as a graduate student studying (whether you're getting an MA or a PhD, this applies the same). You may happen to end up a qualified data scientist, but that's not by design of the program.
The big problems in data science are almost a disjoint set from the big problems in statistics (at least the solved ones), and that's because the things that are tractable from a theoretical/mathematical perspective are very different from the ones that we hope to solve in the workforce. We're just starting to bridge this gap in recent years (particularly with the advent of computers), but that's a very, very nascent trend.
This isn't unique to my university, either - most schools just simply aren't teaching the type of skills that a data scientist - not a statistician, but a data scientist - would need to be competitive in the work force. Those that do know these skills mostly do by chance - either because they branched into statistics from another discipline, because they were forced to learn it on the job, or because they took the time to learn it themselves.
All three of those are pretty rare - I recently took a class in applied data mining and Bayesian statistics. Except for a few undergraduates majoring in comp sci, the class was mostly graduate students in statistics, and those who knew how to program were in the stark minority (and were very popular when we were picking project groups!)
> all that's left is to train them to program
And to turn everything that they've learned and studied for the past two, four, or more years on its head so that they can actually put it to use. Okay, not everything, but at least 80% of it. Seriously, studying statistics at a high level is incredibly valuable, but it's not sufficient - it's not even going to get you half of the way there.
comment 14y ago · link · parent
I'm glad! This is a great way to filter out news sources that I actually want to read, rather than sensational 'ZOMG - Neutrinos are faster than light!!! Einstein was wrong!!!' drivel that was all over the place a few months back.
I mean, seriously - can you imagine someone like Fox News publishing news articles with embedded TeX?
comment 14y ago · link · parent
I guess that's one way of protecting your accounts from being hacked, though... you can't hack an account that no longer exists!
comment 14y ago · link · parent
comment 14y ago · link · parent
Still, if that works, that's good and takes care of #1, but I'd still like to see something like #2. The sad part is that it wouldn't be that hard for a 3rd party to implement (assuming that they support the /links endpoint in the API), but I'd be too afraid to do it myself, given Dropbox's history with broken symbolic links.