jkeisling/hacker-news-corpus-2007-2022 huggingface dataset:
> So now you want to instantiate a variable of type "A", where "A" is a string that you read in from a configuration file. How do you do it in Python?

Depends on which kind of flexibility you want. You can use a dict of name to type i.e.

d = {"A":A, "B":B}
variable = d[string_from_file] (arguments)

or (perhaps slightly un-Pythonic, I guess)

variable = getattr(my_types_module, string_from_file) (arguments)

where my_types_module is a module with your constructors.

The second version is somewhat closer to the PHP version, but still cleaner.

The problem with a system like

function call_me($arg) {} $func = 'call_me'; $func(1);

is that it does not play well if you have several different functions of the same name but in different scopes. Or if you want to generate functions on the fly.

That's a concern, but not too much of a concern in a language like Python. I only chose Python because many people are somewhat familiar with it, and it does the Right Thing in this regard.

As an aside: Matlab recently changed from a PHP-like functions-passed-around-by-string-name system to functions-as-first-class-citizens system. They even had to introduce a new bit of syntax for that---but they found it important enough to go through with it. (Look at http://stackoverflow.com/questions/796935/function-handle-in... if you want to read about it.)
That looks horrifying. What are the benefits of such a layout?
> I don't need a faster iPhone, or more tech.

Maybe you don't, but lots of people do, as evidenced by the fact that they pay for it. If you don't need it, then don't pay for it.

> the last ten years worth of "growth" (much of which seems to have been pumping up asset prices)

This is true, but faster iPhones and other tech weren't what did that. Investment banks did that, by playing risky zero-sum games with other people's money.

> with the constant chasing of growth by everyone else, standing still means you will get left behind

Really? You need a faster iPhone just to keep up?
> I actually don't even like having the same desk every day.

I think the differences many of these arguments partially boil down to the differences in the nature of various lines of business. I have had four positions at two companies and have never had a situation where changing desks every day was feasible. Work from home has never been an option for me. Since I like the type of work I do, I want to do it in a real office (something I have yet to do).
Great post, but if you put things into practice like "write them as gen_servers", the resulting code will be way more verbose than something like Ruby.

I think some way of creating 'object processes' with methods and state would greatly benefit Erlang. I mean, if it's such a common pattern, why not make it simpler, easier and possible with less boilerplate.
It is still interesting to me how Android doesn't show up on web usage shares whereas iOS does; my website reports far more Android share than iOS (and I'm on Android now).
An interesting thesis. I can see both sides.

On the one hand, the idea of mixing all these messaging formats together sounds like it might be a confusing mess -- a Google Wave-level UI disaster. As he points out, these media have very different usage patterns that may not turn out to mesh that well.

On the other hand, saying "Facebook should just do a beautiful, elegant implementation of what everybody else has already done" is a very low-risk strategy. It doesn't innovate or solve any new problems. As a strategy for an industry-defining company, this is a route to irrelevance.

So is it better for Facebook to risk failure, or risk being boring? I have to say they've recovered well from failure in the past (Beacon, early mis-steps with news feeds), so my vote would be for the gutsy, risky, change-the-game strategy.
That's me. Scott asked me to do a guest post and had no idea what I'd come up with. I'd been telling folks this story about him for a while, so I figured it was as good an excuse as any to share it with a wider audience.
It doesn't solve a user problem per se, but it may make it more convenient to have a 'one stop shop' for managing all of those things.

Supermarkets carrying things other than groceries (e.g. lightbulbs) didn't necessarily solve a user problem (i.e. people just went to the hardware store for light bulbs), but that decision was still a win for supermarkets.
The same article was commented by Bruce Scheiner on his blog. http://www.schneier.com/blog/archives/2010/01/adopting_the_i...

Very interesting comments, bottom line "Israel model does not scale well".
I assure you someone, more than likely Google, will one day develop this. Greplin could also position themselves in this space?
"This happens accidentally a few times per year, Alperovitch said."

They aren't the only ones.
Meanwhile, a 2010 study of teacher-prep programs in 16 countries found a striking correlation between how well students did on international exams and how their future teachers performed on a math test. In the U.S., researchers tested nearly 3,300 teachers-to-be in 39 states. The results? Our future middle-school math teachers knew about as much math as their peers in Thailand and Oman—and nowhere near what future teachers in Taiwan and Singapore knew.

This article is more than usually informative, and focuses on what's working best as well as worst (although in our case, that's sadly not saying much). Well worth the read.
Guess I'm in the rock star league, but I don't think I have a shitty attitude. I've worked with lots of weak programmers over the years and it can be disconcerning but that doesn't mean you should be an asshole for that.

When people you work with asks "what's this strange Dictionary class you're using?" you take a deep sigh (internally, not so that they hear it) and explains that "a dictionary is a hash" and then they ask "what is a hash?" and you say "it's something that converts from one type to another, say english words to german words"

It causes conflict no matter what you do so you try to reduce the risk of it. "What is a linked list?" you answer correctly and helpfully "It's like an array it's easy to insert and remove elements from. I've some books at home explaining data structures you might want to borrow?"

It's only when people refuse to take advice that you get the right to be impatient with them. For example, you might review someones code and point out the logical errors in it and if they don't believe you, you might even make a test case which crashes their code. If they then say "well, that's unlikely to happen in production anyway" then you know you're wasting your time with them. Better just let them "sink" on their own.

Btw, have you asked your colleagues for help? Maybe they are introverted and that is why you think they have a rotten attitude? Maybe they aren't as bright as you think because I've never met a great programmer who wasn't always willing to help underachievers.
I think it's a reasonable thing to say on their part, it allows them to deal with weird cases, or errors that upload thousands of copies of the same file or something. It's just coverall-contracting.
So, let's say you worked hard for decades to invent something like a new drug. You're telling me you wouldn't want anything from that? Fine, publish your paper without disclosing your invention to us. Your choice. In all likelihood, big pharma will avoid that technology, as it cannot be protected to any degree that would give them the assurance that their considerable investment would be worth it. So, now your discovery won't help patients and make the impact you wanted.

For some reason, however, our researchers don't seem to pick that approach. They'd much rather work with us to get their work to a place where it can make a difference, and it's only fair that they get rewarded for that.
It's worse in the humanities: http://jakeseliger.com/2012/05/22/what-you-should-know-befor... .

As others have said, a PhD may be worth it if and only if you don't expect a job in academia at the end. But that's a long time not spent on one's career, and boy, that love for the subject has to be really strong.

For the vast majority of people I don't think it worthwhile. I said in another thread like this one that I don't think most people in academia want to be rich and famous, but they should expect a reasonable material existence. Academia currently doesn't deliver that. As Louis Menand points out in The Marketplace of Ideas, median times to a PhD degree is now hitting seven years in the sciences and ten in the humanities.

That's a very, very long time in a person's life.
What I think I would try I that situation is to change the address. Pick a nonexistent address on the same street, and order service at that address. Change the numbers on the house to match and make sure they are prominent so any people dispatch there will find it.
Ahh the IRA example again. Virtually all experts categorize that conflict as an ethno-nationalist one, not a religious one.

Can you point to any teachings or statements by the Catholic Church today that condone terrorism and violence?
Still winds up just feeling like a trick question: because the immediate response in any real world scenario is "why does the client need this feature?" when a CAS operation is right there.

But probably not what the interviewer wants to hear - maybe.
If anyone is looking for a streaming service to support, the Criterion Channel is phenomenal.

They do historical, current, American, gay, black, Latino, female, Chinese, Korean, Japanese, etc. films without any pretense other than a film in its honest self.

I've been introduced to so many films and ideas without pretext from the CC that I consider the fee worth it even as I return to the high seas.
is it difficult for your wifes business to make money, and pay your employees at $15 (or more)? Serious question.
Update: edited to reflect comments of xnull2guest below.

Wealthy people have disproportionate power in society and use that power to distort society to serve their needs. One simple example is how large US companies use government lobbying to transfer money from the public to themselves. Here is a list of the top spenders on lobbying:

https://www.opensecrets.org/lobby/top.php?indexType=s

(Incidentally, notice how underrepresented consumer groups are.) Consider Lockheed, Boeing, and Northrup, which each spent about $200M. These companies all produce expensive military goods. Much has been written about the military-industrial complex (http://en.wikipedia.org/wiki/Military%E2%80%93industrial_com...), and how it serves the needs of the defence companies. A fairly clear example is the program to transfer excess military equipment (worth $billions) from the military to the US police (e.g. http://www.theguardian.com/world/2014/aug/14/ferguson-police...), which supports over-spending on military equipment. Another is the cost overruns in F35 project (http://en.wikipedia.org/wiki/Lockheed_Martin_F-35_Lightning_...).

What happens to the money that these companies acquire? Just as inequality is increasing in society, so is inequality in pay within companies (e.g. http://www.washingtonpost.com/blogs/wonkblog/wp/2014/09/25/t...). Choosing Boeing at random, it's CEO has received over $20M for several
years running (http://www.usatoday.com/story/money/business/2014/03/14/comp...)

All up, this is a complex system to transfer money from the public into the pockets of the high level executives at a few firms.

There are other examples of systematic changes to benefit the wealthy, such as declining tax rate for top earners in the US and other countries. See http://milescorak.com/2013/05/29/do-falling-tax-rates-explai...

I don't want to give the impression that all these shenanigans involve government corruption. The wage fixing case against Apple, Google, etc. (http://www.cnet.com/uk/news/apple-google-appeal-settlement-r...) is a good example of private companies acting to screw over workers without involving government.
Well, it depends on how the exploit was being used and who was being targeted.

If SK was only using it to target, say, Iran and NK, then it would not be in the NSA's interest to disclose the exploit to anyone. Only if they had reason to believe it could be targeting Five Eyes governments or corporations would they feel any need to.
Doesn't that require that everybody have a fairly large and dedicated room they can use as a private home office.
If it is any comfort Spain, UK and Italy also failed responding to the crisis, so it is not like the American authorities are obviously worse?
> The lockdown is in effect and the moment it's taken down, we'll see a second wave. No?

Who knows, I think they have no idea and are just keeping things as they are to avoid having Wuhan in the news. Would make awful press to admit to any new cases in Wuhan.

Are other major metropolises locked down similarly? Beijing, Shanghai?

In general, is it credible that China has had no new cases other than those so called "imported from outside"? Sounds like propaganda to me.
The catalytic reduction of CO2 using cerium loaded liquid metal at room temperature in a single step process is quite novel, really exciting . . . .
Count and Data.
B is Base.
For what it's worth, dictionary.com will play a little sound clip of spoken words:

http://dictionary.reference.com/browse/orange?s=t

http://dictionary.reference.com/browse/range?s=t

Of course, it's only one possible accent, but might be helpful with things like this. (In this example, it says "orange" is pronounced, [AWR-inj], and "range" is [reynj]. That's about how I would pronounce "range", but you don't hear that strong distinction between syllables of "orange" here. It comes out more like [awrj].)
Sure, there's a bunch of ways to do it. I'm not taking a position on the legislation, merely trying to answer my parent's question.
Your Daily Finance link contains nothing that supports your claim.

Your second link in that paragraph is to a conspiracy site that basically declares anyone who ever is on the same side as Microsoft on any issue to be a Microsoft astroturfer or to have been infiltrated by Microsoft. Among things they claim are under the control of Microsoft: NPR, the Department of Education, the White House, the French government, all major newspapers, Amazon, Yahoo. The page you linked to is up to their usual standards--they base their argument on a Google search showing the CW has criticized Google more than it has criticized Microsoft, and on CW hosting its site on a hosting service that is part of a company that provides services for managing and contacting people.

It's probably best to start with more mainstream sites when researching something, such as the Wikipedia entry for the thing you are researching [1], rather than heading right to the conspiracy sites like Boycott Novell.

[1] http://en.wikipedia.org/wiki/Consumer_Watchdog
Hehe, I'm pretty sure they don't care at all.

Interesting product anyway...
These look easy, but I don’t think they always are.

Think about CSV for example. Looks simple to create and parse. In reality these simple implementations will give you lot of headache when they don’t handle edge cases (escaping, linefeeds etc).
We were too busy building in the wake of AWS. Looking forward and building into the paradigm shift was the strategy (and it seemed to work!). :)
That's fair enough. Prefacing it, as "even if you're right, the market can remain irrational longer than you can remain solvent" gets that point across better; that there's a dual risk in betting on the downside scenario.

When I hear people saying this, the subtext is usually that there is obviously an actual bubble that will pop someday. Rather than a warning, the statement is more of a joke about how stupid the market is.
Static executables seems like one of the key selling points driving adoption of Go, for example.
(Article is 7 months old. I’m too early in coffee to look for newer articles but mentioning in case others might fill in the gap.)

This is fantastic news. I can say as a white male-presenting person, I find traffic stops intimidating even though I know I’m far less likely to experience violence in the course of one. I can hardly imagine the experience of people of color being approached in their car by someone with gun and taser, knowing a failing brake light or similar malfunction could lead to violence.

Edit: clicked send by too soon accident, see above re not enough coffee.

Eliminating that possibility will undoubtedly make traffic stops more safe, and probably also less frequent.
If history is any guide, the start will come from the ruins when this boom crashes. First movers almost always get swept up in and crushed under the early part of the adoption curve.
Just like IE, sometimes you have to use Adode Reader. I deliberately removed Acrobat from my mom's iMac and set Preview.app as the default. Worked fine for years until I got a call a few days ago about a PDF she needed to open to do some work. Sure enough, it was some sort of interactive PDF that only seemed to work with the Adobe Reader.
Hmmm... I dunno. A lot of times I like to bang out the design for something fairly significant without running the entire thing once. I might have an interpreter open and I'll play with a bunch of values trying to get the right form of everything up and going. Y'know, working on the details.

Then I start slapping it together, writing some tests on it, adding some fixtures for my data. Etc. etc. At the end, I've got all my tests done and my code working.

TDD or BDD is fine when you know what you're trying to build. If you've only got a few vague, high level ideas about your design and you're just iterating on the problem space, it's a drag man.
Flip4Mac isn't my idea of good Mac software. I have it installed on my Mac but basically, it um, isn't good.

I don't have any problem viewing WMVs and doing whatever with them on Linux. Is VNC or mplayer available for Mac OS?
Tesla will get away with terrible manufacturing practices and quality until the established or new car makers come up with an equally viable electric car and charging network solution, not just the compliance cars they produce at negative margins(almost makes you think it's a reverse marketing thing to make people buy petrol cars).
Also, how can anyone think Tesla or Elon are good people with those self serving contracts and terms and conditions is unexplainable to me.
Any idea if this overlaps even more with RAML? I've seen some projects based around RAML but none so far with JSONApi and I'm trying to understand what advantage there is either way when I don't see JSON being more expressive in this goal.
If they're ferrying passengers for compensation then they absolutely should follow the law (including ADA). If they don't want to deal with all types of passengers then they don't have to be in that business.
But, but, but --

Why not simply use the iPad's wifi via the MiFi as a hotspot?

(Yes, I get it; pure hack value. But honestly, other than the hack value, why chop up a piece of kit like the MiFi and void the warranty on the iPad in order to do ... less?)
Yes. The [P] sign indicates that this area is intended for parking, and that outside of the hours specified in fee-sign, parking is free.

In the case where the default is "no parking", the top sign will be a dashed or crossed red circle (the first meaning you can stop to let people off but not park, the other meaning that you can not stop there for any reason). There can then be a sign below it that specifies times when parking is allowed.
I would say that a grid would be a great showcase, especially with custom column renderers and/or editors. That's a real stress test for any GUI system, update code, templating etc.
WhatsApp operates at insane scale very cheaply. It's one reason they can charge $1 per year or less (lots of users don't seem to pay - they keep giving me free extensions for example). Not archiving all messages on their end keeps their costs in check, and is better for privacy.
That statistic is meaningless. The percentage of what's app users using a particular platform is far more important, assuming their customers matter to them. There are a lot of Nokia users on What's App. As far as iOS, with iMessage, what's app is redundant unless you have a lot of friends using another platform.

If there's a legitimate security benefit from What's App, then perhaps that's compelling, but trusting a Facebook company with anything remotely related to privacy and security is a fool's errand. Zuck has yet to prove that privacy and security matter.

For secure messaging I generally use a courier and a message written on paper using a one-time pad. Slower but more secure. If it goes over a wire, the odds of it being actually secure are low, unless you handle the encryption and control the keys yourself.
For a second, I thought this was an article about a new Star Trek series. And yes, I can feel the downvotes coming.
Flags are already downvotes on submissions so even if you don't get enough flags in time to 'kill' the article it will definitely go down in the rankings when it gets more flags.
Yep, and what should happen is that when you enter a ruleset that uses a %{VARIABLE}, a text field should appear to let you specify the value to use for testing. If this does not happen for you, would you mind using the problem report button on the site? It will let me see your ruleset and a debug log to troubleshoot.
Sometimes, when I think no one is looking, I shout "Arch!" just in case I'm on a holodeck
so I'm hoping for 2) to be your answer

Even more confusing - he refers to 2 as being his preference.
Sure, but alas there's now enough new users on HN who upvote general purpose news to the front page that flagging doesn't work anymore.

Example: http://news.ycombinator.com/item?id=2043841
You know, I actually don't visit Reddit too often since I prefer Hacker News because of the entrepreneur/hacker content I can rely on. But at the same time the best entrepreneurs are well rounded and cultured, so articles about other topics isn't tainting Hacker News. I just wouldn't want every article on the front page to be about bees, TSA and Wikileaks.
Hey those kinds of rad handles are making a comeback. You should consider adpting Wolflord again

- gota, previously NukeBombz
What I never see discussed with national sales tax proponents: a huge portion of the tax collected would now be on credit cards. As an layman to economics, this seems like it could be potentially disastrous.
> where you can never escape the tiles

Tbf that's exactly what floating mode is for
(I hate to meta-comment, but the sheer meta-ness of people downvoting my comment has me delighted.)
And trying to optimize them gets you stink eye at code review time. Someone quotes Knuth, they replace your fast 200 lines with slow-as-molasses 10 lines and head to the bar.
Sure, by I assume we’re not talking about outliers.
The problem is that LLVM IR is not stable across releases, so keeping an out-of-tree back end up to date would be expensive.
The cards are supposted to bypass themselves when powered off, that's what those relays were for.

Later they had these MAU devices that let you build star like topologies where the mau would bypass inactive ports.
Yes, the reality is all those weird architectures stopped being developed and actively supported 20 years ago. If someone wants to get some old Itaniums and Alphas and such together to hack in support, go wild and have fun. But the reality is the venn diagram interesection of people knowledgeable enough to create a LLVM backend, people motivated to support vintage architectures, and people that actually have the hardware available and ready to test is basically zero. If people in the community are passionate about it happening then organize and make it a reality.
Total nitpick, but by saying that you are "in the top 80% of programmers" do you really mean you consider yourself in the top 20%? Because if you are in the top 80, there could definitely be a reason why you are drawing such a low salary :)