skysight-inc/HackerNews huggingface dataset:
Calling [1,2,3].inject(0) {|sum, ii| sum + ii } has a cleaner smell, but it's a lot more typing.

I wonder if the solution might be to have all arrays support sum (in the responds_to() sense) only if they can can actually perform the operation.

Thus

[1, 2, 3].respond_to?(:sum)
=> true

[1, [2, 3]].respond_to?(:sum)
=> false

I can come up with an O(1) way to do this where we assume that an array does respond to sum, and degrades to not supporting sum when a non numeric is inserted ... but getting the array to support sum again if/when the non-numeric is removed... I'd have to think for a bit to come up with something better than O(n)...
You raise an interesting point. I'm not sure what YouTube counts as a "hit" -- it's probably as you say just initiating a "view". Let's assume that only 1% viewed the video 'til the end. That's still 1.5MM full views, for which Mr. Waterman received £11. That's still paltry! And, in any case, YouTube certainly knows how many views carried through to the end or close to the end of the video, and as such is in a position to refute Mr. Waterman's claim.
It's a mistake to assume that "apps in the browser" and "apps in the cloud" are the same thing. HTML in the future will allow much more in-browser data storage. The cloud does offer a big advantage in access to data but the other big advantage of browser apps is that you can run the same code whether it's Mac, PC, Android phone, etc.

The advantages of browser apps - standard and ubiquitous deployment target, potential use of cloud - are all improving over time.

The disadvantages of browser apps are all in factors like bandwidth and connectivity - factors which are steadily giving way to the advance of technology.

I'm betting on the future of browser-based apps. PG was right.

http://dev.w3.org/html5/spec/Overview.html
Conficker wakes up and has a business model?
Lambda is fine. The loops are mutating the variable i, so all the lambda share the same i. Apparently, list comprehensions also use mutation--I suppose that's fine.
I'm not sure if PHP vs. Ruby is of interest to hackers. I do know that I have a vote for that article and I have a vote for your opinion, and that mechanism allows me to express my thoughts on what I'd like to see on the front page.

You don't need to tell me why you feel that PHP vs. Ruby does to belong on the front page, you need simply vote. On the other hand, if there is some reason why you feel the existing voting mechanism is broken in some way such that PHP vs. Ruby keeps making it to the front page despite the fact that "Good hackers do not find PHP bashing interesting," that is an "interesting new phenomena" that I would like to understand.

Disclosure: My two most recent homoiconic posts could be described as "Ruby bashing."
The other responderer's covered most everything I would have said in response to this, but this cracked me up:

>> you'll be a small minority, like the people who still buy records on vinyl.

You got me there, I totally do buy my records on vinyl.

Cheers!
Girl with genetic disorder sues sperm bank for providing defective sperm
I thought the idea of biological products like sperm being defective was an interesting one.
It's fun only the first 10 or so times you hear "PHP sucks, ROR is the greatest language in the world!" As with any joke, it tends to get old pretty quickly. Move on, find another joke to tell.

As a disclaimer, I don't take sides. I use both PHP and ROR. Use a language that works for YOUR project, but don't harass other people because of the languages they choose to use on theirs.
If I had to guess I'd say vc oversight is part of a larger 'lets watch all the money in the system' initiative. Seeing as how the govt has pledged upwards of $12 trillion to bridge parts of the us financial system, I can understand why the government would want to keep an eye on everything to limit the chances of something in the shadows blowing up and requiring further govt bridging. Will it work, who knows ... personally, I don't agree with it, nor do I agree with any of the bailouts: banking, auto otherwise.
Vandalism Suspected in Bay Area Cable Cut Phone/Internet Outage
Stanford CS is a "family" you don't have to be born into. You can get into Stanford by being good.
Kinda like how ESR's "How to be a hacker" article is actually "How to be more like me".
The girl "does not have to show that [the sperm bank] was negligent, only that the sperm it provided was unsafe and caused injury"

I thought the notion of biological products like this as defective was an interesting idea. I'd never considered it before, and thought it might pique others' interest as well.
I actually sympathize with Geithner. You have to look at Geithner's approach from a system design point of view. All things being equal, financial instruments will prefer less regulation over more. As other areas of the financial system become more regulated, he has to be mindful of the money will just flow to unregulated areas.

An analogy would be like squeezing a circus balloon on one end, and unless there's equal pressure all around, the other sides will just expand.
> how puritanical America is

Heard this lots; never seen much evidence or experienced it in my travels. I think it's unchallenged BS.

I mean, the sale of rated music CDs to 16 year olds is controlled and enforced in the UK. There are a bunch of American movies that are close to banned in Europe, but none of the reverse.

As for "sexual liberation", major US cities and major European cities are no different.
I am an advocate of open markets. One of the cornerstones of such a system is the ability for the customers to talk and discuss the interesting qualities and deficiencies of the various products. We all know about this economic model: If I can only buy one product but have 2 to chose from, I try to figure out which is better and spend my resources wisely.

When it comes to technologies, frequently the only cost is our time. And since our time is so valuable, we like to spend a bit of it discussing the merits and problems with the tools we use. Of course, there can be an emotional connection to these tools (I <3 Perl) that can interfere with discussions. But on the whole, I think these discussions can be insightful and interesting, and can even introduce me to new ideas. That's what hacking is all about after all, isn't it?
Seeing as I'm at work and can't upgrade from IE 6.0 I can't view this site. Ahh Well.
Why Windows Vista sucks?
All people/developers/sites/reviews says Windows Vista sucks and is bad, but they don't mention why really it's bad. I have about1 year working with Vista on a new DualCore machine.

I'm a Dot Net developer, Vista is fast, easy and non bugy. It's easier for network connections especially with BlueTooth and also for Wifi. I don't have to install drivers for most of the devices (I used to install in XP).
Breif, I'm very statisfied and I can't really find what's wrong or what's bad in Vista.

Even in gaming, (I played the same game (GTA)) using the same PC (another one with 1.9Ghz) Vista was better than XP and runs the game more smoothly (Graphic Card is 128MB)
I want you to talk about your own experience, what's really wrong with Vista.

Thanks
Are you sure? At least in the US, hasn't broadband speed and cost been fairly static for the past five years. I'm not sure I would bet on super fat pipes solving all the problems with web applications.

Thin clients too- I don't think you can honestly expect that. The difference between using google docs and a native application is night and day. Docs is slow, prone to pauses, and has lots of bugs related to the poor mapping between html and page layout. Either the browser is going to get a lot faster, we're going to need /thicker/ clients, or people will stay with the status quo:

writing their documents in word, copying and pasting them into google docs only when they need an easy wiki.
[1, [2, 3]].respond_to?(:sum) => false

I elided a discussion about this case from the post. For some arrays, a recursive sum is semantically valid. For other arrays a recursive sum is not semantically valid, and it is not a simple case of knowing whether all of the leaf elements respond to :+. So again, trying to implement this in the Array class doesn't work because containers are implementation rather than interface.

If you are going to use an Array class, I think the array's client is the one responsible for knowing whether its elements can be summed and if so, whether recursive summing is valid. The other approach is to subclass or otherwise create special-case arrays that know about their semantically valid operations like sum.
The DrScheme repl isn't the one in Emacs
I like the design. Why don't you open it up for users to add content on the website and not just thru twitter?
Continuations in Mono: Embrace and Extending.NET, Part 3 - Miguel de Icaza
Count me as one of those people that don't get it. If I'm joining the elements of an array together, I'm operating on the array. Therefore I _expect_ the join() method to be on the array.

To me, Python can't seem to make up its mind with these weird (IMHO) stand-alone methods like join(), sum(), any(), etc. That's the kind of thing I'd expect in a functional language, not in an OO language.
I'd argue it's for a good cause, and doesn't have much potential for harm.
Ask HN: Feedback on Scribnia
I am the co-founder of Scribnia, an online community where users can rate and review bloggers, journalists, and other online authors. Our site also allows users to discover new authors. We have an algorithm which provides tailored author recommendation and use AJAX filtering to allow uses to search for authors on criteria specific to that writer. For example, users can filter for a conservative, controversial blogger who writes for political junkies.

Our company recently received funding from DreamIt and will be re-locating to Philadelphia for the summer. We just launched our alpha version and we would appreciate commentary from the HN community. Since our site is in private alpha, please leave an email address and we will send an invitation. Sorry about having a password protected site, we wanted to get feedback before launching our commercial version.
Presumably anyone could just go through your trash and get as much information about you as mint.com has.
"I'm no prude"

I'd argue that you are, and you have some extremely revealing hang-ups about sex and sexuality, as evidenced by your reaction to a freaking cartoon avatar ("make me, personally, uncomfortable about working there, or talking to anyone who worked there") and the "what will we tell our parents?" line.

how about you tell them "hey parents, i'm a grown-ass man capable of making my own decisions without being afraid of what my PARENTS will think!!"
http://scribnia.com/
Calambrac's correct, nobody uses the first two forms, as google will tell you. But why not?

This is actually a very interesting question. You'd say "Cyberdyne Customers" is an indirect object.

I give Cyberdyne Customers a cookie.
I give a cookie to Cyberdyne Customers.
I ask Cyberdyne Customers a question.
*I ask a question to Cyberdyne Customers.

Why is the last form incorrect? What rules apply here? If you're interested in questions like this, I can recommend Steven Pinker's "The Stuff of Thought" ( http://www.amazon.com/Stuff-Thought-Language-Window-Nature/d... )
I recall articles in kids' magazines in the mid-80's about how to build solar cookers. Apparently, they are already in widespread use today, with many different designs:

http://solarcooking.org/plans/

Does anyone know what makes this new design special?
biological social networking!
I'm not a Ruby programmer so I have a simple question: Is it common to request whether an object implements a particular method before you make any sort of call? That seems considerably more fussy than strong typing of interfaces or even the type-hinting of interfaces that PHP has.

I can't help thinking a cleaner solution is the more traditional way: Create a subclass called NumberArray that can only hold numbers and has specific methods for operating on them. But I guess that might not be the "Ruby-way".
Thank god there's still something like a nuanced argument...
here are the result of using the technology in the wrong way
I feel like this meta-reminder was warranted. This article in particular was submitted, voted to the front page, deleted, re-submitted, and hit the front page again in an hour or two.

Besides, all it takes is 2 votes to hit the front page, and that certainly does not indicate community interest. That's where the mods and members are expected to come in and set the tone.
Ask HN: How are you monetizing your site?
What are all the different ways you found to make money off your site?
Outspark: Online Gaming Success Story
> Create a subclass called NumberArray that can only hold numbers and has specific methods for operating on them.

I can't see anything wrong with this for some cases. Another way to get there would be to define a NumericCollection module that can be used to extend any Array.
Same in Common Lisp.

cl-user(1): (defvar fns (loop for i from 0 below 10 collect (lambda (n) (+ i n))))
fns
cl-user(2): (funcall (elt fns 3) 4)
14

Personally I don't like this behavior (I've been bitten before in more subtle cases), but you can't blame lambda. It is consistent if one understands the same i is shared by all lambdas and loop mutates the i.
Does Atwood have some sort of vendetta running against IMVU? This isn't the first time he's laid into them.
I don't mind reading language comparison articles if they make significant, detailed comparisons of the languages. Typical language partisanship posts don't contribute much.
And your site doesn't feel that good either...
It isn't typical. The author was using it as a way to show what a class claims to support.
The thing is, they aren't methods. They really aren't. They don't operate on an object using the object's local data. They are generic functions that use certain defined interfaces that many objects define.

"list.join(str)" and "str.join(list)" are not the same. The list.join syntax only works for lists, but str.join takes any sequence, which is anything that implements the sequence protocol, including lists, dicts, sets, trees, heaps, iterators in general, and a limitless variety of user-defined sequences. Once you understand that it's not a matter of picking two spellings of the same functionality, but actually radically different functionality between the two spellings. (Putting this on string rather than it being a free-floating function is perhaps dubious, but at least the operation does have a sort of irreducible stringy-ness to it in a way that it does not have a listy-ness to it.)

If you make the "join" a method of list, then you have grotesquely cut its functionality. Now you are requiring people to implement their own join on every other object that implements the sequence protocol, which is just silly. (Of course if they have other needs they may still implement something else, but why not give them the option of the default?)

This is generic-programming through duck-types, not OO. Similarly for all the other examples you cite and quite a few more; putting them on "list" is not "the sensible thing to do", it would be a grave error.

Python 2.5.2 (r252:60911, May 7 2008, 15:19:09)
...
>>> ", ".join(str(x) for x in xrange(10))
'0, 1, 2, 3, 4, 5, 6, 7, 8, 9'

That's not a list in there.
I'm kind of wishing someone smarter than me did this with the JVM - I would love to be able to use continuations or even coroutines in Clojure.
heres what i did:

>>> [i(4) for i in [(lambda n: i + n) for i in range(10)]]

and i got this:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 1, in <lambda>
TypeError: unsupported operand type(s) for +: 'function' and 'int'

Apparently the outer and inter "i"s got confused. when i change the outer 'i' to 'f':

[f(4) for f in [(lambda n: i + n) for i in range(10)]]

i get this:

[13, 13, 13, 13, 13, 13, 13, 13, 13, 13]

With generator expressions it worked as expected:

>>> [i(4) for i in ((lambda n: i + n) for i in range(10))]
[4, 5, 6, 7, 8, 9, 10, 11, 12, 13]

Meanwhile:

[i(4) for i in map(lambda i: lambda n:i+n, range(10))]

Also works as expected.

This obviously has nothing to do with the lambda in python and everything to do with the way loops work.

Python has a few quirks of this kind, this one i didn't know about. I didn't know that list comprehensions and generator expressions differ in any other way than the thing they return. I should have known better, they are very different things.

edit: looks like this also works:

[i(4) for i in [(lambda i: lambda n:i+n)(i) for i in range(10)]]

Its all about scope I guess.
Does anybody know if there is any way to test the sperm for genetic defects such as this before it is used?

And how much would it cost do this for every sample?
Yes, my thoughts exactly.
Good hackers do not find PHP bashing interesting ...

Why don't we let the votes decide that?

If you do find this sort of thing interesting, please respect the site guidelines and don't submit or upmod it.

As a hacker, I definitely find language debate a lot more interesting than this sort of navel gazing about what should and shouldn't be posted here.
So, I wrote this and I'm afraid of two things: (1) it's too academic and (2) I'm not sure I believe it.

Hah!

The idea the spurred it is something like, "When you're building social applications you're building social networks."

The strategies you'd use to build a new Facebook are exactly the same as you'd use to build a new application on Facebook.

Thoughts?
Top 7 Icon Search Engines
Timing is part of execution, sure. But when people toss around the "execute better" cliché, the implication is nearly always that you can make your product better and succeed, even if your timing is abysmal and your approach is unoriginal.

This story isn't about making the better e-mail newsletter. It's about a guy who recognized that he could arbitrage traffic for massive gain.
sell a product. sell a service. sell ad space. referral programs.
Shit's hard, sure, but that's why we have a full-time government and all their associated aides to do it.

Complexity is not something that should be carte blanche ignored, but it also should not be the determining factor for any major decision. Prohibition, repealing prohibition, abolishing slavery, women's suffrage, and desegregating schools were also hard, but that wasn't a reason for not doing it. In the software world, search engines, networking protocols, transaction programming, and email were also much more complicated than their simple descriptions imply, but that doesn't mean they didn't get done.

My point is this: everything has a cost, but that doesn't mean it's not worth that cost. The reason VPs and others think at that level of abstraction is so they can clearly see the benefits without having to immediately balance it against the cost. If they can sell these benefits to the implementers, stuff gets done. If not, it doesn't. They're not living in a dream world where anything is possible; they're doing the "benefit" part of a cost/benefit analysis, because benefits are not always as tangible as the costs.

Complexity is just another cost to be considered, and it can be overcome with hard work.
Not to criticize your creativity, but I propose changing the title, because I was expecting something about food, which it isn't entirely. But it is full of awesome and based in Nairobi!
The deeper issue here is "mutation is hard to reason about". Well, yeah.
While the planning fallacy is absolutely a problem, the issue is that "roughly similar" is a hard thing to gauge in software development.

Unless you're doing fairly repetitive work (cranking out brochure websites for clients, for instance), you shouldn't be doing any "roughly similar" projects! Each thing you do should be brand new—if it wasn't, you'd just reuse the code you already have.

That is the perennial dilemma in software estimation. You don't know how big it is until you're halfway done building it.

I'm not proposing a solution to this problem, just pointing out that this IS a problem, and probably not one that can be solved in a one-line bit of advice. Saying "cut it up into pieces" or "estimate similar past projects" is like telling a nervous guy to "just be himself" on a first date.
Easy statistics for A/B testing (AdWords), and Hamsters
I would say that failure should be very, very low. What I really took issue with here was the relative silence about altering my query. It wouldn't have been half as bad if the note was on the top of the page.

I would really prefer it if they just suggested that I may like to try the search without the word and leave it up to me to decide if that's what I want.

In any case, these Google fuck-ups are not a rare occassion for me anymore. This morning I was searching for "min cut directed graph" (no quotes). Of the 10 results on the front-page only three were about directed graphs. The rest were about undirected graphs, despite the fact that I explicitly asked for directed graphs.

At that point I snapped and continued my search with Yahoo!. Something I expect to do more often when this keeps up. It's really hard to find something if this is the way things work...
Why is [1,"two"].sum any different from 1 + "two"? That is, 1.respond_to?(:+) is always going to be true, and yet sometimes sending the + message to a number will give a type error.

I don't buy into this idea of interface as binary - that if you respond_to? the message, it's always appropriate, and if you don't, it's not. Interfaces are something you look at when you're writing the program, and so they are interpreted by humans and can be necessarily fuzzy: "#sum will give you the total of the elements in the array, unless they aren't homogenous, in which case you'll likely get an error". Fine. If you don't know enough about the array in question, don't send #sum.

Similarly, if you don't know that this is a chequing account, it would be odd to ask it to write a cheque.

But at runtime, you send the message, and you maybe get an error. Whether this is TypeError or NoMethodError seems entirely irrelevant.

Incidentally, my objection to Array#sum is that you don't know what to use as the "0" element (what if the elements implement +, but aren't numbers), though I'd be fine with it being called #numeric_sum or the like.
Well it makes sense given the language - I just found it interesting that Haskell acts differently.