skysight-inc/HackerNews huggingface dataset:
It won't alert quite what you want - when you click on each element in the list, it will alert "4".

This is because the function assigned to the click event of each li is bound to the "i" variable used in the loop by a closure. Variable i is incremented to 4 before the loop ends, so that is what each will print.

You could use make the function used in the click handler take a parameter, then use partial function application (or currying) to fix the value of the parameter.
Craftmanship And The Crevasse
> On the other hand, the only thing I use gdb for is cheating at nethack (+99 blessed Unicorn horn anyone?) [...]

Might as well use wizard mode, and wish for that stuff.

I prefer playing on public servers, they take away that temptation, and give you more bragging rights.
If you run the code you'll find that they all alert('4'). However, the third parameter of els.addEventListener() so you'll get an exception if you run the code verbatim.
How would you express the algorithmic complexity of an algorithm like this, that incorporates a random walk which must hit a particular point before the algorithm can proceed?

In theory, this algorithm could run for any arbitrarily large amount of time. Although the probability of that is low, doesn't it make the worst-case time for this algorithm unacceptable?
In this situation, as a smug HN reader you may want to make a comment that mirrors the form of the article in a way that you find clever but is in fact irritating.

The best way to achieve this is to go one level up on the meta-ladder, and to write a meta-comment, that is, a comment about comments.

However that would be self-indulgent to the point of solipsism, so I advise against it. At least I think it would be. Let me just ask the next djinn above me...
The questions are all still valid, but thank you for the update, and I made the change :).
Thats not the reason why it will alert 3 (it will alert 4, btw).

Here is a fix http://jsfiddle.net/hBe3c/
Or just take a walk outside.
Extroverts Are Not Always the Most Successful Bosses
Instead of replicating/copying/stealing/whatever you could also try working together.

Side note: if you come up with an idea and only -then- see it has already been done, I wouldn't even consider it copying.
Yup, and especially how it correlates against Referrer.

Though the author would probably need to add <START> button, to minimize the unintentional fails. Also failing could be adjusted for accidental mouse movements, perhaps by ignoring distances of just couple of pixels.
Out of determination I succeeded, even though by my calculations doing nothing for two minutes cost me $1.60 that I could have made writing code. Of course, I stopped the clock anyway when I clicked on the HN popup notification.

Edit: Just looked at the code. The programmer missed a great chance to gather some data. I would have tracked the fail events using Google Analytics so I could see how many fails on average per user from different traffic sources:

_gaq.push(['_trackEvent', 'Fail', 'Mouse Move', 'dummy', 'dummy']);
Good concise advice, and that's certainly a baseline. In my case I am speaking (asking) more about replicating functionality or an idea, which is a lot more difficult to know where to draw a line on.
The line is innovation. If you actually bring something new to the table people close to the original idea will still say cheap knockoff, but most won't. Just look at the phone to blackberry to iphone progression no one considers any of them to be knockoffs or stolen ideas even though they largely innovated directly on what had come before.
By "as easy as each other" I meant reducible to each other with a polynomial factor, as is standard in complexity theory.
Glenn Beck: "You're going to have to shoot them in the head"
What makes it hard is just that annoying countdown. Nothing else.

(And I had no waves, because I don't have Flash plugin enabled, meh.)
In this specific example it's a problem because a fair bit of local software is required. If you set it up so that all you have to do is VNC or RDP, possibly over ssh, all you need is a USB key and access to a computer to get access to your computer.
It's geo-ip restrictions. I'm also in Canada. Works through a US-based VPN, but it's just not worth it, in this case...
مشاهدة
it's accessible from anywhere at anytime (if you don't shut it down) from any device capable of executing a ssh client (iPhone, iPad, for example) also you can have a development environment exactly equal to your production environment and you are safe from hardware failures.
"In addition, debugging with print requires more understanding, so it's more likely to be correct than debugging with a debugger."

I don't believe this is true. I suspect the way most people use print statements for debugging goes something like: "I think the problem is somewhere in this function, let's stick a print statement here. Oops, that doesn't seem to be it, let's try one here. Oops, that's not it either, let's try printing out a different variable." and so on.

That's remarkably similar to using a debugger only a lot less efficient, because you have to go back through the whole edit-compile-run cycle each time (or maybe edit-deploy-run if you're working on a web app using a scripting language).
Why not, if you compiler proves that it's safe?

I don't even care in which order my single-threaded code gets executed (if it's in the right language).
is it cheating to just use a custom property?

https://gist.github.com/788257
Yeah, I thought exactly the same thing. What's new here?
http://en.wikipedia.org/wiki/EBaums_World

http://www.linkedin.com/companies/zvue-corporation

http://www.google.com/finance?q=zvue (very likely the same ZVUE)

Check their home page: http://www.zvue.com/

"$15 million cash and $2.5 million in stock" !

"$5.2 million revenue in 2007!" (check the Wikipedia source page for this figure, hilarious)

Edit: I see now you are acangiano...
I'll try it, but I suspect that there won't be enough strength in the plastic. Torx are designed to be set with a lot more torque than "normal" screws, hence the name.
Review my Startup: Radius - location based message broadcasting
Radius is my current project. My goal is to create a multi-dimensional, location-based communications platform without any walls. My inspiration for this is Citizen's Band radio.

Currently, the service itself is simple. You visit the stream page, and you may broadcast messages to other users within a 5 mile radius of you. Messages are transmitted to other users in real time. Messages are also indexed with their geographical location, basically creating a geo-tagged message board where the message threads are real world locations (this enables non real time communication).

I'm going for a non room-based approach because I feel like that hampers the utility of this, and ultimately my vision is closer to CB radio than it is to IRC. I'm working on several different clients at the moment. The only one I'm showing here is the web front end. I'm finishing up an iPhone application for communicating over Radius.

Gotcha's: This relies on browser geolocation reporting, at the moment. because of that, this doesn't seem to work at all on IE. Firefox connects a little slowly. It seems to work best in Chrome. You must allow geolocation reporting when the browser prompts you for it. It also relies on websockets which restricts browsers to more modern versions.

Requests: I'm looking forward to feedback on this. So, if you check this out and have any feedback for me I will make sure to fix it, or incorporate it if I can. I made a thread about this about a week ago, but it didn't get much attention because I posted it at around 1AM.

I'm severely lacking in the UI and UX department. All of my time has been focused on the back end, so far. I'm looking for suggestions on how to make the message stream visually appealing and engaging, too! :)

The fun part! Check it out, let me know what you think:

http://useradius.com/
http://useradius.com/map (fun page, simply shows all messages from anywhere, as they come in)
Well, minimal. http://www.google.com/search?q=amazon+ec2+down
"The value of i is figured out only when the link is clicked."

This makes it sound a bit like magic. A more accurate description is that the usage of the variable "i" within the closure is simply a reference to i in the outer function--not a copy of the value.

A great follow-up is to describe the memory implications of what they've done here and how memory use can be improved.
click: http://useradius.com/ http://useradius.com/map
Japanese Web outlook and predictions for 2011
Nice! Now you can tell which way it's spinning. I updated mine to include your CSS additions.
Striving for money and happiness are both selfish. Striving for the happiness of others because your own cup runneth over is true success. Providing people with jobs is a form of charity just like going to the backwoods of Africa and building schools is charity.
Wrap the line of code inside the loop inside another function, which will have the effect of binding the iterator i to the desired value before the event handler anonymous function is created.
I passed, but it was very hard because I got no waves and so was immediately tempted to view source and find out why not, and also because I kept looking at the horizon of the photo and wondering if it was just me or if it was very slightly tilted down to the right.

For extra difficulty, you should throw in more and more things like the above to make ocd people squirm ;)
That's why it's diabolical!
pretty cool idea, though I don't think I could have passed just listening to the waves, without my music collection I don't think I'd be able to muster the patience for this, well. maybe.
Although comparatively more concurrent connections. The 'hub' looks somewhat like an IRC server. In fact, you can emulate this behavior with IRC.
Is there a live feed anywhere? I love to watch this thing launch in real time!
Split test it dude. Just split test it. My guess is that you would be better off getting more people in the door with a $5 a month account and then having them upgrade to $18 then $50, but for something like this you can't afford not to test test test.
I might not have done that until I heard back from one of their compliance group so that you had a contact, but, you might be ok.

I would still petition to get the original app back online so that they do see that you fixed it. Regrettably, that is one difficult group to get quick feedback from because of the volume of tickets they review.
Goldman Sachs and Facebook: A Risk Too Far
I know this practice is not uncommon, but could someone explain the business case here? Surely it doesn't seriously keep 3rd party repair shops from working on the hardware? Is it to protect the aftermarket / 1st party replacement parts business, in that consumers can't order something on ebay and do the replacement themselves? Is this really a significant enough revenue stream to these companies to justify the abuse?
The function in the click handler does take a parameter 'e' (...or whatever you call it) which is an Event object. But I think you're on to something by using currying.
Armitage: AKA - Making Metasploit Even Easier
You're absolutely right. Both this one and Aldous-Broder both have a worst-case where the algorithm never terminates. As for whether the algorithm is "unacceptable", that depends on the application. For games? Yeah, this is probably far from your best option for generating mazes. But for cases where you absolutely must have a uniform spanning tree, your options are limited. Wilson's is much better than Aldous-Broder, but still not perfect. Robin Houston has described a variant that combines both Aldous-Broder and Wilson (doing AB until about 30% of the field is filled, and then switching to Wilson's) which empirically improves the odds quite a bit, but as long as you're doing a blind random walk, you're pretty much never guaranteed to finish.
So you wouldn't be opening them anyway, in which case it makes no difference to you. But as an Apple shareholder, I fail to see any benefit to Apple expending resources trying to stop customers who do want access to their own hardware.
Really looking forward to this... and love the Andes story.
Yes, I had the same "whoa!" reaction, then never went back because it's a terribly ineffective way to acquire information.
By definition, a problem P is NPC if:

a. P is in NP, and

b. Every problem in NP can be converted to an instance of P.

Consider any two problems in NPC, P and Q. Then each is in NP, and each can be converted to the other. They are therefore equivalent.

QED.
Why Venture Capital Returns Are Going Up
There was sadly never a 12" Macbook Pro, but assuming you mean the Powerbook, and that it worked after a 2 meter drop, that's surprising & impressive.
10 Immutable Laws of Security
http://technet.microsoft.com/en-us/library/cc722487.aspx

Law #1: If a bad guy can persuade you to run his program on your computer, it's not your computer anymore.

Law #3: If a bad guy has unrestricted physical access to your computer, it's not your computer anymore.

---

Law #1 should be expanded nowadays: "If a bad guy can persuade you to plug his widget into your computer, it's not your computer anymore. In the USB case, the widget (phone) contains the bad guy's program.
CouchDB in production
I'd put some money on `He hasn't proved P=NP.' as long as the odds are greater than zero.
I like the seagull at 0:38
Take Econ courses. Understanding economics changes the way you make decisions. At it's simplest level, an understanding of sunken costs and opportunity costs overrides many "logical" decisions people make daily. At a more advanced level, understanding market forces and reactions will help in an entrepreneur career.
I think you want var j = i outside the function.

Edit: Oops, this is wrong as well. :-)
Boundary Condition Thinking
Arithmetic coding is patent-encumbered, and a bit harder to implement. The point where arithmetic coding outperforms Huffman coding is when you have very frequent symbols (i.e. less than two bit or so); you can circumvent this if you apply Huffman coding to larger units such as words or tokens (i.e., instead of characters '4','2', have a single integer token "42").

Another thing that's fun to implement is the Burrows-Wheeler transform which is at the heart of bzip2 (and you then need another compressor for the BW-transformed text, but still...)
You could actually make the 'Fail' event hierarchical 'Fail.1', 'Fail.2', 'Success.3'

to track how many fails were required before success
Awesome! Yeah this reminds me of a little experiment I did back in the day that was similar, but not using the logo of course:

http://fun.amadeusamade.us/iphone/

(Warning, my deceleration method is gehetto, so please forgive, I coded it in a rush :) )
The behaviour is due to the fact that variables in JavaScript are scoped to the function, although as that code is in the global scope and lacks a var declaration it will live under the global object (window in this case). So in that example each closure captures the same variable hence 4 being produced within each alert(). For more info see: https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/C...
For penetrating a particular target, this is very interesting. Bribe a repairman into leaving such a device plugged into a developer workstation at a company where everyone goes home at 5 or 6. The device presents itself as a USB hub, then waits until late at night, when it connects its keyboard and types out and compiles an entire rootkit. This would even work at companies which lock down USB ports against removable drives.

Better yet, the device could act as an attacker's remote shell by downloading commands using curl and uploading redirected stdout and stderr.
alert('"'+i+'"')
Yes, there's probably a bubble right now.

And this is the kind of investment that will make you look like an idiot if it blows up. But I have to think someone like Brad Feld, whose firm was part of this investment, is pretty confident in the business if he is willing to put his money and his reputation at stake on this.

Funny movies, funny books, and funny tv shows have all proven to be big money makers over a long period of time (but they also bomb often). Why is a business built on funny websites so ridiculous?

It seems that a lot people have a hard time differentiating between an intelligent business and a business that makes intelligent products.
I agree, but not everyone is a command line ninja.
I'm surprised to read more people arguing, "print statements and/or understanding the code I'm working on is more valuable than a debugger" rather than straightforward, "my platform/language/environment doesn't have a good debugger--print statements are simply easier." pdb is pretty good but wedging it into my FastCGI processes running as another user is a PITA (albeit one I could fix just once). Clojure has CDT but that's even kind of PITA-y since I have to go start up another JVM and get them to talk to each other. It's much easier just to type "print x, y, z" and reload my code.

If I was in VS.Net or Eclipse and not Emacs all day, and/or if I was writing something more "straightforward" like a desktop application, I bet I'd be much more inclined to use a debugger.

(Edit for word choice.)
The names you cite have pretty good advice to give, but they also have obvious incentives for doing so. That is, they are all trying to sell something to aspiring entrepreneurs. As are you, judging from your website.

For those who are not looking to sell books, invest in the next big thing, give lectures, or provide startup consulting, "work on the product" is about the most non-terrible piece of advice anyone could possibly give.
That won't quite work, as you're still just copying the value of i when that function is executed, which will be 4.

You could make the function take a parameter, then return a function which uses that parameter, or use currying.

Edit: I've posted a working version in my comment further down, http://news.ycombinator.com/item?id=2124559
Apple probably doesn't see it as "abuse" when they use proprietary fasteners for components that cannot be unfastened without violating their warranty, nor are they likely to see it as "abuse" when they prevent unrelated third parties from selling Apple customers services that can only be performed by violating the warranty.

You see it as abuse, and I understand why, but from the perspective of a multi-billion-dollar business, this is not dissimilar from the people who think all non-GPL software is also abuse.
is it silly of me to think that this doesn't seem hard enough to be an interview question? i'd be more interested in whether (and how quickly) someone could grasp a complex problem
this is what I usually tell people to do:

var els = document.getElementsByTagName('li');//use var unless you really really really meant global
for(var i=0; i < els.length; i++){
(function(i) {//creates new scope for each iteration
els[i].addEventListener('click', function(){alert(i);}, false);
})(i);
}
I smell a new Facebook game!

The quotes in the article are kind of cringeworthy.

"I was going, 'This is really odd,'"

"I was going around in the lab going, 'Yay! Yay!'"
Qwiki seems mostly to me like an attempt to "multimedia-ize" the information on the web. This seems the wrong way to go. What the web is lacking isn't breadth or engagement capacity. Hell, Wikipedia has engagement capacity. What the web lacks is information with the depth, quality and low entry barrier of textbooks. You can have depth and quality with stuff like Google Scholar, but the barrier of entry is absurd, and you can have breadth with a plethora of other sites, but without expertise on the matter at hand you'll only find shallow information directed at the general public. WikiBooks and OpenCourseWare are probably good examples of things which are helping alleviate with lack.
http://news.ycombinator.com/item?id=2124262
IMO, Linode is the best for this use. I pay around $22/month for 512MB/16GB/32-bit Linux instance and the instance is always on.
How Bloggers Beat Wall Street
Credit Card Data Portability Update
Great idea, thanks. I'll add it. At the moment we're looking at the average time on site stats.
I saw these guys at TC disrupt last year. I really don't get it. I had a bigger "woah" moment when I saw Flipboard (and I've hardly used that after the initial playing-around phase). Is there great value here that I just can't see?
You can put value judgements on it like that, or you can express the exact same sentiment without emotion by saying "or, you could just not buy hermetically sealed products if you want to be able to tinker with your hardware", in which case even the Apple advocates will agree with you.
Dirty web video secret: If you can see it, you can steal it
Just curious, but what is your startup? I spent the last 10 minutes cyber stalking you and couldn't find a reference to any website other than your Posterous account and the Mixergy interview.
I've been doing this for years. Surprised that its number 1 on hacker news, weak.
Perhaps a minor UI tweak, instead of counting down (which creates a slight sense of panic), you should count up? It'll help with the calm.
If I'm reading the article correctly (and it's a bit vague), these are part of the experimental extensions API. They're accessible only to arbitrary programs you've downloaded and run, and they inform you that they use api X.

To make matters harder, experimental API extensions aren't allowed in the chrome extension gallery - you'll have to go looking for unapproved, file-system-accessing extensions to expose yourself in the slightest to that danger.
Free startup wine tasting in SF tonight
Nice. I have my little fan blowing, so this greatly reminded me of sitting down at Kits beach, playing guitar in the evening.
We (http://getbizen.com) received seed funding from JumpStart Foundry (http://jumpstartfoundry.com) and have been incubating at the Nashville Entrepreneur Center (http://entrepreneurcenter.com). The combination has been amazing.

JumpStart provides similar levels of funding as YC or Techstars. They also provided me with three mentors (one lead and two others). This was the first year for JumpStart and it was done on a rolling basis (one company funded per month). A side effect of that was that there was no programming or much interaction between the startups. JumpStart is going to work differently in 2011 and I believe is now part of the TechStars affiliate network.

The Nashville Entrepreneur Center has the mission of "connecting entrepreneurs with critical resources to accelerate business creation and growth." That is exactly what they have provided for us. There are 6-12 companies at the EC on any given day. There are mentors here regularly available for meetings and advice. The local investment community has started coming by the space regularly and watching and learning about the companies.

The combination of JumpStart and the Entrepreneur Center has taken Bizen from conception to a viable startup within the span of about 5 months. We are closing enough funding to operate for a year and are starting to hire.

It has been a great experience.
Flash to HTML5: Gridshock Remade
I felt like the post isn't quite finished. He could have gone into greater depth.

That said, to me, a great programmer can be measured by how much fun he is having when programming. Not by how much he hate particular tasks.

Programming requires constant act of learning, that gets old real fast if you don't love what you do.

I admire programmers who can take shitty tools that he hates, cleverly hack it, and make something cool with it.
Seems to be avoiding the intended topic: scope and its temporality