skysight-inc/HackerNews huggingface dataset:
Probably if you have a trivial piece of code, you don't need inheritance to help you structure it. But you're right that we need a smaller example than the entire class hierarchy of Pygmusic. What do you think would be the smallest sensible example?

If your objective is only to explain what inheritance is rather than why someone would use it, you could probably write two classes and three methods:

class A:
def z(self):
print "z " + self.y()
def y(self):
return "Ay"

class B(A):
def y(self):
return "By"

A().x()
B().x()

But I really think that most people will find a program easier to understand if it's not completely abstract like that — if it reflects some kind of intentional process where a programmer was trying to achieve something. But in order to explain inheritance in such a context, you need a program where inheritance makes things better instead of worse. What do you think is the simplest possible piece of code that would do that? I am thinking of a very-much-cut-down version of Pygmusic with only two drawable objects.
There is a direct mapping between our natural construction of ontologies (we are pattern-detecting creatures, we naturally see commonalities across the birds) and why object orientation works. Cars are a subset of vehicles in most peoples' minds; and Buttons are a subset of Controls in most UI programmers' minds. And the topologies of these ontologies are similar enough, by design, that you can indeed teach valuable lessons using vehicles and birds.

As to polymorphism, that comes for free from understanding language. Most people will understand a "No vehicles allowed" sign to prohibit cars but not people. What else is that but an understanding of polymorphism in evaluating a predicate?
Blue tory burch flats
I love how people are worried about the possibility of deep, everlasting psychological scars.

I work at the OSUOSL. Some of our finer (read: less uptight) patrons occasionally donate Nerf weaponry. Getting shot at with Nerf guns is not uncommon, and really isn't that big of a deal. I do not constantly glance over my shoulder in fear of a Nerf raid.
I bought this book on Yegge's recommendation as well, and this actually was a stumbling block for me at first.

"Whyyy is this variable, ★★p a pointer to a pointer?! p is never referenced in the function, so why are we two levels of indirection down?!" I didn't realize at the time that pointers are copied by value in C, so in order to modify the pointer you need to give the function a pointer to it.

I guess it was worthwhile, though, because it encouraged me to play around with C[1] a bit in order to grok it.

P.S. Sorry for those stupid stars, HN kept eating my highlights. Any way to avoid that?

[1]https://gist.github.com/661564
Now that's impressive.
I'd object to your example: your example seems to me to be closer to that of instance :: class than subclass :: superclass. PrinterDriver defines a contract; each of HPDriver, CanonDriver etc. will need to fulfill the contract. But I don't see them usefully adding behaviour. The OS would have to already know about HPDriver in order to use its extra functionality - then what's the point in using inheritance at all?
Air jordan 6
I was doing the same thing, but moved over to this https://github.com/boyter/BATF (note I wrote it)

Mostly because I want to be able to access it from anywhere and have revisions accessible without requiring git/mercurial/svn etc...

I have been using it for a year or so now and still use it every day. I still think its the most useful 40 lines of code I have ever written.
I've since moved on to plain text files, but at my last job, when I left, I just had to delete a few more sensitive notes before passing my TiddyWiki file to my replacement and he had all my notes for the job. It was a technical sales role. I'd argue that a personal wiki is even more important for many other vocations than for programmers.
People want to give gifts, not gift cards. :) Make sure that it's a stand-alone product (eg. a 6-month subscription) that can then be extended or upgraded, not $50 towards a membership.
Seriously, WOW!
So what is needed is a world wide network that can automatically insert relevant regional/local ads into popular shows so that they can be streamed online with no region restrictions.

Sounds like a good startup idea for a seasoned founder, since they're more likely to get 'color' levels of funding required to do this at scale from the get go. As unfortunately I don't see this kind of startup getting traction in a limited market, hence go big or go home levles of funding.
Seems to be an interesting product, but..

There seem to be a lot of questions in the thread regarding how this thing works, one commentator noted that you could just bind something to window.onerror (which is a valid point)

They basically seem to have their own JS asynchronous loader script that will wrap all of your scripts into its own thing. That also means you can't use a JS loader like head.js, require.js etc, but their loader serves a similar purpose. (If I'm not misunderstanding)

I have no idea why they need to do this, they might be extending JS function prototypes to log function calls etc to get a stack trace. Who knows. Way beyond myself atm.

This is just got released, but still there are a few things that strike me as odd/worrying:

- If they really need to load the JS for you, what happens to inline JS and JS that needs to be at the end of the document (for some reason or another)..

- Their JS file is +100k un gzipped.. That seems a lot if you compare to any other JS loader (typically in the 5-10 k range

- Note: 100k of JS to load in the head is a LOT of KB before the user starts downloading some HTML.

- They are actually including all of jquery within their JS file - not in global scope - which seems really wasteful, because you will probably also be doing that - there might be more libraries in there, I'm not sure.

- This taken from their docs:

> 2. We recommend that you download proxino.js and host it locally. This will ensure that your javascript always loads, even if our proxy goes down (which has never happened). Here is the basic form:

"Which has never happened" -- didn't they JUST launch? That seems a bit immature.

I mean, this is probably just their initial beta thing and I'm guessing this will be pretty decent in a year or two, but so far it's just an interesting tech demo, imo.
Losing weight is now becoming easy
Thanks for all the comments! Veyron had told me a hastable would be a better idea. I have been reading about creating a perfect hash so I don't have to deal with collisions, although I'm (obviously) not the best algorithm guy. So that post may be coming soon.

I had thought that due to the extreme low latency that a hardware solution would be required. So that may be the next place to start experimenting.
Sims also says that the company is actually a part of the latest Y Combinator batch (something they hadn’t previously disclosed).

I was hoping they would be picked up by YC... looks like it already happened :~)
I'm interested in Codecademy's marketing; how did they accumulate so many active users in 72 hours?
Top 2 Free Ways to Convert PDF to RTF Speedily
Thanks to everyone in the Hacker News community for being so supportive and providing feedback on our launch. We really appreciate it! As always, if you have any issues, shoot me an email - contact (at) codecademy (dot) com. -Zach

EDIT: I'll be back on HN in a bit to answer questions but the next few hours are a little busy. Thanks again.
No, it's not misleading. It is insufficient to capture the totality of what is meant by object-oriented programming and polymorphism. But it is not misleading. It is simply a very narrowly applicable -- but very useful, when leveraged properly -- analogy.
Mercedes gives a kid a bionic hand
Quick note: If you are hosting your sites on EC2 using the Elastic Load Balancer service and Route 53 (Amazon's DNS service), you can now use naked domains (without the www. or other subdomain requirement).

https://forums.aws.amazon.com/thread.jspa?threadID=63893&...
I can't agree more with your judgement. I've read all these three books and the fact is just like what you mentioned. CLRS and TAoCP use a lot of space to prove the algorithms correct(especially TAoCP, it even uses different ways to prove one algorithm) and that makes me feel dizzy. Perhaps I'm just a programmer not a computer scientist.

But I have to say that use some time to read CLRS and TAoCP is worthwhile. It will help u know more about algorithms and avoid the condition that just know how but not know why.
Remember that judges have hundreds of games to play. If at any time during your game they get stuck, they are likely to shrug and move on to a different game.

...

Nobody likes a game that treats the player like an idiot. However, a player is far more willing to tolerate a Level 1 that they can pass without thinking, than they are to try to disassemble a masterpiece puzzle at the very beginning. Judges are much more likely to give up and move on.

I've entered two past PyWeeks; this part of the article really hit me.

My last two games were very, very short. I wanted to lengthen the game so I made the levels harder. The feedback that I got was that the game was too hard; judges got stuck within the first minute or two.

I'll again be limited by time but this time I'll prefer to make the game easy than hard. I think players will find it more enjoyable to finish the game than get stuck.

If anyone is planning on participating in the PyWeek a few weeks away, I recommend reading some articles from this list:

http://www.pixelprospector.com/indie-resources/

I particularly liked these quick tips:

http://devmag.org.za/2011/01/18/11-tips-for-making-a-fun-pla...
NM B&N Just sent me an email saying my order was canceled and my card refunded...

DAMN DAMN DAMN... lol
The "Improved" grid looks decidedly worse.
Not working for me. What version of org-mode?
What prevents you from bit torrenting the content you want, and then sending appropriately sized cashier's checks to the content producers?
The way I envisioned using it, yes. The use of a Monad over a Functor is merely because I'm still very much a Haskell newbie.
Nike Hyperdunk 2010 black 407625-001
After several years, I find that programming languages are so similar that I can pick up the language aspect (syntax) of a new programming language in minutes, maybe hours, but spend time weeks learning the library. So I agree with the author.
I love hipmunk for flights, but I'm less in love with the UI for hotels. I find it more confusing, and less easy to see what's good value. So if that's where they're really making their money then maybe they need to adapt it a bit.

I can see how in some cases it'd be great. If I'm looking for a hotel convenient to, say, the Denver Convention Center, then I can zoom in on that area and pick my favourite out of the small number of hotels within walking distance.

But if my goal is "I want a room somewhere in San Francisco, I don't especially care where as long as it's reasonably convenient, but it has to be reasonably good value but not too cheap" then I just get overwhelmed by having too many options and no obvious way to narrow them down (except by geography, which in this case I don't care too much about). And while I can easily understand "agony" as a function of price and duration, precisely what "ecstasy" should mean is beyond me.

Oh, and it seems to only tell me the average yelp rating, rather than the actual star class of the hotel, so it's really hard for me to decide whether $169 for the "Hotel Abri", with four yelp stars, is better or worse value than $106 a night for the "Hayes Valley Inn", also with four yelp stars. And then the Four Seasons, for $501 a night, gets 4.3 stars, but does that mean it's only slightly better than the Hayes Valley Inn? Probably not. Yelp stars generally aren't that useful except for identifying really awful places, since everywhere seems to rate somewhere between 3.5 and 4.5.

What I'd really like to see is information on how the price being asked for this hotel right now compares to the average price at which it's usually sold.
Google search on Android marketplace is awful
You can view the blog entry here, my server is rubbish:

http://ipadtravelguides.blogspot.com/2011/08/google-not-so-great-at-search.html
The day after a show airs on FOX, I can't buy it from FOX for any price.
You're missing the point.

While the user is entering the credit card number, there's a chance that someone can intercept and steal the CC.

You can easily solve this problem by putting the credit card form inside your own iframe. :)
To be honest, I found Skiena's book a bit too introductory. I'm doing my preparation for interviews right now and I think I'm going to try to use TAOCP as my algorithms book. For the programming part I'm not sure if any book is going to help me. I tend to think that reading books rarely helps with programming -- only programming does.
I think Braintree does it, kind of: "By using our Transparent Redirect (TR) and Vault, merchants can achieve PCI Compliance in days. TR and the Vault will eliminate the handling, processing or storing credit card data so you can qualify for the Self Assessment Questionnaire A, the shortest of the four SAQs."

http://www.braintreepayments.com/services/pci-compliance

edit: So, w/ Recurly I wonder if it's the same thing and I'd need to do the Self Assessment Questionnaire A when using recurly.js
It is pointless if you make it an ontological exercise. If you make it a question of substitutability (as your link does), then I agree that you're doing it the right way.

The question shouldn't be: "is a Square a special kind of Rectangle, in a pure/platonic/logical sense?" The question should be "can a Square be treated as if it were a Rectangle." The answer to the second question could depend on the program and what it wants to do! The first is a rathole that accomplishes nothing.
How to install Ubuntu Linux on an HP TouchPad
> Sims also says that the company is actually a part of the latest Y Combinator batch (something they hadn’t previously disclosed).

I love them for that. Having their product loved (here and elsewhere) based on the product not the connections they have. Awesome.
I assume it was "viral". I know I shared it with a bunch of people and posted it on Facebook, I assume a lot who were impressed did the same :-)
Android (Finally) Taking Steps Towards WebKit And Chromium
socialgold had a similar product before google acquired it.
In a lot of OO languages instances rarely have different behaviour to each other.

You are also forgetting that it's possible to have more than one printer using the same driver (i.e. multiple instances of a class of printers). This is not uncommon when you consider network printers.

> The OS would have to already know about HPDriver in order to use its extra functionality

And that isn't true of any other instance in which inheritance is used?
> [..] it has drawn 200,000 unique users. That’s users who have actually interacted with the app — and not people who hit the webpage and bounced away a second later.

from the article...
The CNET Download.com Installer
Using Jenkins as a Cron Server
In the article, it actually says That’s users who have actually interacted with the app — and not people who hit the webpage and bounced away a second later.

So it's not unique users, and is actually quite impressive either way.
Tory burch sandals sale
Questions to ask when valuing that equity slug:

Will you be around see it vest? Will you be diluted before you cash out? Will the exit leave anything for common shareholders? Will there be an exit at all? Is there a double trigger? Can they make you move to another city? Will you have a tax bill due when you exercise your options? How long (after you quit) will you have to exercise. How much cash will it cost you to exercise?

In other words, getting 1% of a company that just raised a round at a $2M valuation does not mean you have equity worth $20,000. It's actually worth quite a bit less.
Explaining FNAC: Feature, Not a Company
MBT Shoes
Air Max Clearance
I would be interested to see what happened if someone did that. My guess would be that the content producers (movie industry) would begin legal action as while you paid for the content you didn't pay for it in the manner they dictated.
When you give people inheritance all they see is hierarchies and when you give them information hiding systems all they see is access control.

One should not be able to find trade secrets by grepping for "private", nor reproduce a companies org chart by a class inheritance graph.
Ask HN: Any good Photoshop tutorials for front end developers?
I think it's funny that people still think walking people through algorithms on a whiteboard is a good way to hire programmers.
This is also an error which cannot, as far as I know, be detected by any coding convention. I'd suggest that if you are trying to prevent such errors with a coding convention rather than tests, that's a process smell.

In practice, I find it best to avoid non-commutative functions with two arguments of the same type. The obvious choice (for a DB I'm writing):

addRecord :: ByteString -> ByteString -> IO Bool
addRecord key value = do ...

But this is safer:

addRecord :: DBKey -> DBValue -> IO Bool

Now `addRecord value key` won't compile.
And while we're at it - he is much better known for the CAP theorem: http://en.wikipedia.org/wiki/CAP_theorem
Simple iOS photo app makes $6,639.32 in first 11 days
Yes, because drawing a bunch of game objects on a screen is something a real program might actually want to do, and therefore opens up opportunities to talk about real-world design tradeoffs.

Making a program print "quack" when you call the "speak()" method is something that only happens in textbooks, and since there's no reason to actually do that there's no easy way to discuss the alternatives and why polymorphism is a win.
How to Use Kaspersky Virtual Keyboard Against Keylogger
Clojure and the CLR
As a non-programmer, I absolutely love this. I was able to complete two courses within 10 minutes.

More than anything, this makes programming seem like FUN.

Well done and kudos to the Codecademy team!
I don't know if Cushman was referencing this, but it seems reasonably likely: http://c2.com/cgi/wiki?RavioliCode "It has been said that with objects you get RavioliCode: thousands of little classes everywhere and no one knows how to find the places where things really happen."
Didn't we find the answer to this question when Compaq beat off IBM's lawsuit over clone PC BIOSes? Compaq showed they kept the API of the PC, but engineered a completely different se of code behind it.
Reddit user buys HP TouchPad with Android 2.1 running
With Recurly.js and our Transparent Post, merchants only need to fill out the Self Assessment Questionnaire A.

We launched our own Transparent Post back in March 2011. We created Recurly.js to simplify performing client-side validation, pricing calculations (w/ coupons, VAT, add-ons), and proper error handling when a transaction is declined. It's 10x easier to implement than Transparent Post, and has a much better user experience for the customer.
Quicksort is a wonderful example of an algorithm that's really simple, but that gets mired up in implementation details to the point of being unrecognizable. The fundamental insight of quick sort is that you partition the list into items smalller than a given value and items larger than that value. Then you just sort the subitems.

Most algorithms are similar; there's a core idea and then a bunch of implementation around it. My advice for dealing with that is to build up a library of routines that you know the complexities of, and then use those to build more complex algorithms.

Unfortunately, I'm not in a good environment to write code right now, but I'll give an example of how that might work when I get home.

In terms of reference material, check out CLRS
This is very nicely done. I would like to see a long-form explanation from Recurly about the safety implications of this, however. Maybe it really is brilliantly bullet-proof, but please explain.
Rolex replica
Complex pricing schemes tend to be a sign of a monopoly or oligopoly. The sellers of the market use these complex pricing schemes to skim off as much consumer surplus as possible.

In my opinion, the best way to disrupt an oligopoly or monopoly is to create a product that makes the original offering irrelevant. Square is doing just that - making the credit card processing industry irrelevant with simple technology and pricing.
I also hacked together TiddlyBox, which lets you leave your TiddlyWiki on your Dropbox and edit it directly. It's a simple WAR file that'll run in any Java container (Jetty, Tomcat).
Libya's Domain Name Registry Hacked, .ly Domains Unaffected
The nastiness problem in computer science
Here's the actual decision: http://www.nysd.uscourts.gov/cases/show.php?db=special&i...

It looks like EMI prevailed on some claims, but not the claim that de-duplicated storage is itself a copyright violation.
Chanel shoes flat
GroupMe was sending SMS text messages, and while they're nominally just a tiny amount of data, the cellcos don't bill the same way as your local upstream internet provider.
How to Buy research paper
Buy research paper is a distinctive college research paper that has been calculated to meet the needs of every good research paper, and this paper is usually made available in online writings services for sale.
Indent your "code" with a few spaces.

int **p; /* I used 4 spaces in front of "int" */
It's pretty easy to switch away from Square if you find a better deal elsewhere. Not like there's a big capital commitment to get started with square that might go wasted.
Thanks! We're glad you think the product spoke for itself ;)
We'll try to do a postmortem on this as soon as traffic dies down a little. But yes, as a few people have mentioned, it's mostly viral traffic.
Thanks! Glad you're on your way to becoming a programmer.
What You Don't Get About the Job Search: Voices of the Jobless
There has definitely been requests and offers to create lessons... When are they coming???
I think this is absolutely true, but my understanding is that the PCI powers-that-be are OK with it. If the credit card numbers are by design not hitting your server, you don't need an audit. Yet another reason why we've avoided doing PCI stuff.

These forms sure are pretty though.
Diana Kruger Hot Germany Super Model Photos
While we're on the topic of processing credit card payments, anyone have recommendations for processing monthly subscriptions online? (Merchant account and gateway). Similar to this article, there are many hidden and weird pricing schemes.
This article is misleading in that it depicts Square as being cheaper than most merchant accounts. If you sell one cupcake a month then I suppose it is, but for most merchants Square isn't even an option. It's far more expensive and there are other limitations that reporters tend to gloss over. (See http://www.quora.com/Aaron-Greenspan/Of-Round-Pegs-and-Squar... .)

Credit card companies are scared of change because change could easily put them out of business. They're protected, not by a good product or world-class service, but by lobbyists and other artificial barriers to entry. (See http://www.quora.com/Aaron-Greenspan/Held-Hostage-How-the-Ba... .) Once those are overcome, it's just a matter of time before cards are thought of just like casette tapes.
A common pattern is a superclass with "abstract" methods that subclasses then implement. So the `sendCommand(cmd)` function is implemented in HPDriver and CanonDriver and higher level methods in PrinterDriver can use that piece even though PrinterDriver itself has no implementation of that method.