skysight-inc/HackerNews huggingface dataset:
My rule of thumb: I only import things locally (i.e. within a function) if it is a conditional dependency. This is particularly true if it's something not from the standard library. Example: I might have an application that supports multiple database back ends, such as PostgreSQL, SQLite, etc, but I'll conditionally import only the one applicable DB API module.
I think the problem is that the definition of "operating system" has been warped over the years, and customers can think only in terms of bundled programs and not the capabilities of...well...the operating system.

From a software developer's point of view, a single target is most valuable. If I have to worry about the availability of APIs or libraries based on Microsoft's arbitrary bundles, it's a huge problem (not only because explaining the "problem" to customers becomes my job, but because it means Microsoft is arbitrarily limiting the size of the potential market).

If 3rd party programs all work the same no matter what version of Windows 7 is in use, it should be fine.
I wonder how that traffic breakdown would look if they only ever did pieces on actual news relating to twitter instead of pretty much daily news.
I'm not sure if you believe you're disagreeing with me, but you're not. Goals are necessary for an optimization process, but errors in specifying those goals (or in the goal-specification procedure itself) are potentially existential risks, for a powerful enough optimization process.
I think Noam is a pretty cool guy. eh kills pomo and doesnt afraid of anything.
Handy webapp to make CSS inline (for HTML emails etc)
I haven't read the 4 hour workweek book, but the two pieces of advice
1) Money is a means not an end
2) Doing less e-mail,
are good bits. But I'm not sure why this is worthy of repeating. Doesn't everyone know this? Personally I'm way more interested in how people discovered their passions. I love reading biographies of people on Wikipedia that shows chronologically how they came to realize or produce something great. What was it that led them to their ideas? How did they become so productive? Did they meet someone, read something, or had some other type of epiphany? If you love your job and want to do more, then I doubt money and e-mail are the things that hold you back. If you love your job you will be in the office everyday because it is an essential part that brings you happiness.
Google Voice’s Secret Weapon: Number Portability
Have a look at: http://stackoverflow.com/questions/477096/python-import-codi...
The Case for Piracy
HEY GOYS EMIL HERE. Sorry for not providing enough info, really stupid of me. Here's the description:

BizTeen.net - Where Teens Start Businesses
----------------------------------------------------------------------

What is the problem?

It is "frustrating" and "difficult" and "time consuming" and
"not free" to try to meet teens who are like minded and want
to start a business togther, further more, there is no "single place"
to do it.

What is the oppertunity?

The oppertunity is that there are 400 million teenagers between
15-18 of whom we believe that at least 1% (4 million) are feeling
the "pain" and "frustration" of trying to find a reliable partner
to earn a little extra money on the side.

What is the solution?

To create a place on the web that makes it "easy" and "free" and
"fast" for teenagers to find and connect with other teenagers and
join forces with them to start new business ventures.

What are the benefints for somone joining the bizteen.net team?

- Build credibility
- Learn how to start a business
- Develope better coding skills
- Get PR and notoriety if the project succeeds

What are the CORE features?

- Find bussiness partners
- Post new business ideas and get them reviewed
- Browse other peoples business ideas and join thier team
- Place to ask questions about business stuff
- Place to hang out and chat with like minded teenagers
- Place to answer questions about starting a business
- Browse other teenagers profiles to see if they would be cool to meet
- Post a resume about yourself and what your into
PEP 8 has an opinion on everything ;)

The best reason to do them at the top of a module, at least to me, is so you know where all the imports are. The only reason I'd ever put them in functions is to avoid circular import issues.

There's really no need to use comments; reading the module should be enough to figure out what the grouping is. My only convention is sticking all the global imports in one line at the top (PEP be damned) and grouping stuff from there.

import os, sys, datetime, xmlrpclib
from django.http import Htt404, HttpResponseRedirect
from django.core import serializers
from tstumbler.util import slice_it, parse_date, flatten

Edit: it is also non-trivial from a performance point of view to have a module import every time a function is called...
Benchmarks: MySQL in Memory Using tmpfs
This seems to be a sort of afterthought from his "On Carving Your Initials" speech: http://www.tbray.org/ongoing/When/200x/2009/06/12/Convocatio...
I think in both cases the best solution is to somehow mandate slack. The temptation is to run both the financial system and the electric grid as hot as possible. In the grid case, this means that the grid is running at 100% and if anything goes wrong, the whole thing just unravels as nobody can pick up any slack. In the financial world, this manifests as leveraging as much as possible to grab as much positive investment as possible, and when the investment ticks even the slightest bit negative you get total, massive bankruptcy and unpayable debt.

In both cases, if we didn't leverage so much or run the grid so hot, a failure is much more likely to be contained. The downside is that it is more expensive, you're leaving money on the table or putting up more power capacity than you really "need"... but it only takes one financial disaster to pay for years of slightly less growth, and only one total power failure for an extended period to suck as much value out of the economy as you would have put into building more capacity. If you don't account for the possibility of disaster it looks like a terrible investment, but factor that in and it looks downright prudent.

Look at the stock value graphs of the past 30 years; would you trade a lesser growth rate for not having the past year on your graph? I sure would!

The primary problem as I see it is the question of how you mandate financial slack. Mandating excess power capacity would be relatively straightforward (though it blends with "green energy" initiatives very poorly as they tend to add virtually no baseline power to the grid), but even defining financial "slack" is a challenge, let alone making the system robust. There are just so many games that can be played with paper that it may not be actually possible to prevent huge leverage.
another good one to go for - http://ideamonk.blogspot.com/2009/04/cracking-code-introduct...
Err... make that SW, rather than SE, sorry.
Thanks for your input man. It sucks that you dont wanna work on Spinly though
Another interesting (and more negative) account of being quarantined in China can be found here: http://jamesfallows.theatlantic.com/archives/2009/06/journal...
Setting Up A High-Availability Load Balancer With HAProxy/Keepalived
Emacs is extremely "productive" in the hands of a capable user. A "hacker", let's call him or her. "Usable"? Well, not in the hands of a beginner. If you want to just click a few things, Emacs is not for you. If, on the other hand, you live in your text editor all day long (you are, say, a programmer), what Emacs lacks in usability it makes up for 1000 times over in extensibility, flexibility, and ability to do pretty much anything you could imagine, with a bit of effort.
Ah, I meant Guys
Sorry!
Super computers are already focused on "embarrassingly parallel" problems. Otherwise 300,000 cores is not going to do much for you anyway. However, I agree that interconnect speed would be a major issue for many supper computer workloads. Yet, I suspect if you had access to a 10+million$ supercomputer built using 1million GPU cores plenty of people would love to work with such a beast.
Mother language is English, and no, I didn't learn Chinese in 6-12 months. I studied 3 years in high school, 2 years in China, 3 years in college and another 2 years in grad school, so what's that 10 years all together.

High school was a wash, and living in China helped but I never made real progress till I hit upon this produce and repeat method. College and grad school were mostly classical Chinese and other dialects, so I'm not sure if that counts.

Were I to start Russian today, 6-12 months would be enough for a) no discernible accent and b) every day proficiency. But "pick up" is the wrong phase here. You aren't going to pick up a foreign language in 6-12 months with the immersion method. Look at what the grand OP did: 6-12 months of produce and repeat, followed by immersion. By the time he immersed himself, he had developed the faculties to process the stream of stimulus. That's a huge difference.
If you have the same 20 modules coming in over and over, consider bundling them all up in a single module of yours that does nothing but load those 20 modules, then other modules simply import that module.

If it is the same set of 20 modules, but those twenty modules are not conceptually similar, that might be something worth investigating further. That those modules need to be imported might suggest that the current module is attempting to do too many things at once.

I only point this out because a former coworker's code I've been dealing with. This was in PHP, but everything had been broken out into classes and the classes were named after the files. So, closer than just including raw PHP code into the same scope, and hopefully close enough that I don't get buried in comments to the contrary. :-)

But the coworker had the logical extreme of a module importing module. Arguably, he had the same 120 files coming in over and over. But this created all sorts of problems, the most prevalent being that a typo anywhere in these module files would bring down the entire site, since they have to be syntax checked.

So, I overall agree with jerf, with the addendum of be vigilant and be careful. :-)
Is Programming A Generic Skill?
BTW, if u hack it, you can use it for non-sleep related data too, as a general EEG to wear while programming etc.
How would the NVidia GPU personal supercomputer do on large matrix-matrix multiplication?
I'm not wild about Mac OS (no focus-follows-mouse, no davidw), but it's a fantastic OS for parents. Mine use it, like it a lot, and have a generally pleasant time using it.
How is this hypocritical, though?

It is hypocritical because on one hand, he's saying that those professors should create content of the same scope that you would find in a text book and put it online for free - meanwhile he's got adverts for his books just to the left of that exact same statement.

Don't write text books, give away all your knowledge, but it doesn't apply to his books?

If he gave his books away as ebooks and just worked on the assumption that his income is coming from consulting/speaking then I wouldn't have a problem, since he's not, he's a hypocrite.
Ask HN: ~80% of this year's US uni grads are unemployed. How are you guys doing?
I know: [Citation needed]. I think I saw the figure in the Financial Times.
Its a rewrite in that they threw out nearly an entire codebase and built it on top of something different. If tomorrow Microsoft said "lets get rid of Vista and build something new on top of Ubuntu", I think it would be fair to call that new version of Windows a rewrite despite them not having written the underlying code. Also, lets not forget that a fair amount of work (understatement) went into Mac OS X post NeXT.
Also note, google app engine throws a warning if try and import anywhere but at the top.
If the only two things the author got out of the 4HWW was (1) money is a means not an end, and (2) do less emailing, then the author should try actually reading the book instead of skimming it.

You can't "review" a book you haven't read.
> I'm way more interested in how people discovered their passions.

I found mine between the couch cushions.

> But I'm not sure why this is worthy of repeating.

I think that this piece is basically a dig at the book, with a few nice things being said to make a small effort at "balance".
Memoirs of a Poker Bot Developer
Zope? The most popular web framework? Cool! I had no idea it was still in use that much. Can anybody shed light on who uses it these days?
John, I' see that you have the Belgrade Tesla museum in your book -- but I think that even more interesting would be the visit to the village of Smiljan, Croatia. This is where Tesla was born, and there is a memorial center there -- http://www.mcnikolatesla.hr/ -- and you can find the place at http://6url.net/smiljan

Also, the Technical Museum in Zagreb has daily demonstrations of the Tesla's main inventions, including the 3 million volt transformer: http://www.mdc.hr/tehnicki/en/07-velikani/07-velikani-7.htm

Perhaps you could put some of those things to the next edition. :)
Google News now linking to Wikipedia
This is an interesting article and something that I've been musing about for a few weeks. Is manufacturing completely leaving the United States? I know its easy for non-engineers to point to engineers and say "hey, make something" but there is a little truth to Lacy's statements.

I can't speak as to whether the US is falling behind in innovation, but solutions to keeping manufacturing in the US are not simple. To properly address this problem you have to start with education and the incentives with enticing more American's to go to graduate school. Then there's globalization and monetary policy and immigrant visas. I'm sure there are a whole host of issues in between.
so you can start a web company,software company where you don't need so much money, rather brain,
You might also want to take advantage of:

from foo import bar, baz, quux

if you aren't already.
>> "Professors should be spending their time devising pages or chapterettes or even entire chapters on topics that matter to them, then publishing them for free online."

Some of the worst classes I had as an undergrad were the ones taught with a professor's class notes instead of a proper text. It's true that texts are overly expensive, but the amount of work that goes into a good text isn't trivial.

I'd recommend to anyone that if they don't like the text their class is using, find another one and just photocopy the problem sets from the library's copy if you need them. There's an excellent text available for almost every subject, if you look for it.
Obsolete Features in HTML5
If anyone who read Four Hour Work Week came away feeling slightly dirty about Ferriss's route to success, I'd recommend reading "The Art of Learning" by Josh Waitzkin. Josh is the chess prodigy featured in the movie "Searching for Bobby Fischer" and later became a world champion in Tai Chi/Push Hands.

Where Ferriss finds ways to quickly exploit weaknesses in the system to win, Waitzkin wins by constantly analyzing _himself_ to find weaknesses and improving until he is truly the best at what he does.

Both books were good, and both strategies have their time and place, but "The Art of Learning" resonated with me a little more, and I suspect it might do the same with other folks here. It feels a little more "noble".

On a side note, I think "resourcefulness", the desirable trait in a startup founder, is probably a 50/50 split between the two: recognizing and exploiting weakness/opportunity, backed up by substance and hard work.
Lot's of shitty books of all kinds sell because of good marketing. It wouldn't be a phenomenon exclusive to textbooks.

That said, there are huge differences among calculus textbooks. I don't know the one mentioned here, but when I studied, there was a choice between a very concise and condensed one, and a very drawn out and long one. The latter would have bored me to death. It is not easy to present maths in a short and concise way.
Is everyone here so young (and I'm only 31 mind you) that you've never heard of land lines?

Not so much directed at the parent as all the responses.
I think at some point any piece of software requires a major rewrite (of course, when that point is depends). Whenever software is written, fundamental assumptions get made, and even the most forward thinking architects can't predict everything that will become possible or necessary. For a while, it is simply enough to build on top of what you currently have, but eventually the underlying architecture will no longer represent the main goals of the app. At this point, the spaghetti and hacks will far outnumber the well written aspects of an application and you will be spending most of your time trying to navigate the mess.

Again, that's not to say all software should be rewritten for every version. Mac OS X has been around for about 10 years and could easily go for another 10 with its current architecture. However, I think we can all agree that sometime between now and 100 years from now, something fundamental will probably have to change.
This is awesome. I occasionally do email mailouts for an old friend and its normally pretty manual. I was thinking about getting around to building something like this, but this works perfectly!
The wikipedia article mentioned that 2.0 and 3.0 was developed in parallel (http://en.wikipedia.org/wiki/Winamp#Winamp3). I'm not sure if that means if they were made by the same coders, however...
China’s College Entry Test, Gao Kao, Is National Obsession
Back in the day I worked for a large computer networking company that had (for the time) really high-speed drivers for their adapter cards. I worked on the adapter card drivers writing code in C and assembler.

One of our drivers emulated the Novell IPX/SPX API on the PC and it worked great. Except for one piece of software which would crash (it was a 3270 emulator). I was task with debugging this problem.

It turned out that an optimization in our code meant that if you sent a packet to yourself it would be never actually go into the network. We'd simply immediately deliver it. The real NE2000 driver would send the packet on the network and then receive it.

This piece of software was using a packet sent to itself as a test of network connectivity and because of the way in which the code was written the packet had to be received with a short delay. Basically, the software called Send_Packet and when that API returned it would clear a flag and then it would hang around and wait for the flag to change.

The flag would be changed inside the ESR (sort of interrupt service routine) registered by the software for receiving packets.

Trouble was our optimization meant that the ESR was called while Send_Packet was executing (i.e. before it returned) and hence the flag was always zero and the software died.

The solution was... to ship our network driver with special code that I wrote that would examine the code of all programs that registered ESR for packet receipt. By examining the ESR routine code I would determine whether this particular piece of software was running and patch it to get around this problem.

(Yes, you did read that right: we shipped a network driver that would patch host software live.)
sigh So in the end, this is more mindless, ignorant Microsoft bashing. It simply isn't justified.

Cut the guy a break. He's letting off some steam about something absolutely ridiculous that has happened to him. Don't always expect people to comment on their unpleasant personal experiences with a detached, unbiased, global, balanced, carefully worded judgment as though they had the full attention of an entire nation.
I think there is something seriously wrong with his benchmark. His fastest case is 5 requests per second. That is 5 requests of a 5K blob selected on a primary key. That just doesn't sound right.
Of course SoftICE does not have handy "save to executable" function (or at least it did not have it in the 90s when I last looked at it).

In that case you simply write down binary signatures surrounding your patch, open executable with any hex editor, find those signatures and patch. Then do binary diff, save it into CRK file and distribute.

PS. I wonder why this guy copied EDX into ECX instead of just doing PUSHF...
Others have mentioned this... I am thinking of doing a volume 2 (my editor is already bugging me about it :-)

Would you please post in the forums on http://geekatlas.com/ so I don't lose track of these great suggestions. I am especially fond of Tesla.
Twitter will go the way of facebook, which of course will go the way of myspace, which of course is about to go the way of friendster, which went the way of pets.com, and so on and so forth all the way until we get back to tulips.
He asks for $2.99 min so his paypal fees are payed, etc. I gave a bit more and got a personal thank you. It does have a demo mode as well.
I once tried to crack Microsoft Reader to extract ebooks from memory.

That was a failure, but one innovation, given that Reader checked the integrity of its code against patching... I simply ran Reader, waited 500 milliseconds, then patched it in memory, after the code that checked!
It might, if I was really to pay $20 for a hack that does something that should be in the OS by default. And it looks like it still won't let you just resize windows with the mouse from any corner.
Here is a list over all keyboard shortcuts in Mac Os X :
http://support.apple.com/kb/HT1343
It's hard to memorize all this, but I put them into a learning by repetition program named Genius.App.
Genius can be found here: http://www.macupdate.com/info.php/id/13938

I enter only those shortcuts that I tend to need from whatever App I use. I spend the odd 10 minutes each day repeating keystrokes. The shortcuts seem to stick in the grey matter after a while.
Funny, Ferriss also recommends The Art of Learning

http://www.fourhourworkweek.com/blog/2008/05/25/the-multitas...
... but you can "comment" on an article you haven't read.
Imagine this purely hypothetical situation for a minute: some classes are actually required for your major, and even though you are having exorbitant textbook prices extorted from you, it's still not enough to warrant quitting the major entirely.

Just because people can technically choose to avoid the situation entirely by dropping out or altering their life's course by switching majors doesn't justify ripping students off, or any other such small evils.
DOS on Khamenei's site?
Symbolic Programming Vs. the A.P. Curriculum
For anyone interested in teaching programming, this one is a must read
Not to make a shameless plug, this is something that the company I work for is working on:

http://www.palantirtech.com/government/analysis-blog/sec-tra...
I mean this in a very constructive way, but you should really spell check to find the obvious typos. Especially if English is not your first language.

First impressions are important, small details like fixing typos are low-hanging fruit.
This is very nice. I am interested in whether or not
an open source library was used for much of the processing,
or if it was written from scratch entirely.

If there is no open source library available to convert
stylesheets+HTML to inline CSS, it would be a good idea
to consider open sourcing some of the code behind this
app.

Either way, very nice app - great job!
A little offtopic, but I would say this is the reason that vigilantly commenting your code is essential, especially for a one man shop.

I've learned this the hard way enough times to make it stick to the point now that even when I'm just writing regular, mundane CSS, I make sure to comment in every workaround I write, no matter how routine. It takes longer, but it's worth saving me from myself.
Please please PLEASE fix search. The awk and grep bundles suck. Coda has a really great project wide search.
http://twitter.com/persiankiwi/status/2169483495

"I am accessing twitter from 148.233.239.24 Port:80 in tehran. you can avoid gov filters from here. spread to others. #Iranelection"