skysight-inc/HackerNews huggingface dataset:
As you mention, RegExps are the wrong way to handle markup.

In Python, load lxml module and parse the content into an etree, a heirarchical data structure for XML elements.

lxml.etree will read them in and treat them as Comment or ProcessingInstruction.

You can then iterate the tree and collect the
comments.

http://codespeak.net/lxml/tutorial.html

I've been working with etree for the last couple of weeks, firstly using xpaths to extract data from a HR database a customer expects my company to look up manually for 6000 people, then to create OpenDocument files. It's really easy, even if you've never done any XML programming before, and the mailinglist is very helpful too.
I've added another powerful book to my library since the last time we had this discussion:

Made to stick: Why some ideas survive and others die... - Chip and Dan Heath.

Essential startup reading.
Confirmation Bias at the Symphony
Ya, I was hoping the redesign was done by Pearl Jam.
Those aren't "system calls"! They're shell-outs. Replacing a shell-out with File.read doesn't get rid of system calls; File.read("/etc/termcap") incurs, at best, 4 system calls (stat, open, read, close).

I'm surprised that Github was sloppy enough to be dropping to the shell to get things done.
Please. http://en.wikipedia.org/wiki/Phil_Knight

Anyway I'm gonna post Oprah's secrets to success and see how that goes over.
Books I wish I had on my bookshelf:

Tribes: We Need You to Lead Us (Seth Godin, Oct. 21st)

Outliers: Why Some People Succeed and Some Don't (Malcolm Gladwell, Nov. 18th)

Reality Check: The Irreverent Guide to Outsmarting, Outmanaging, and Outmarketing Your Competition (Guy Kawasaki, Oct. 30th)

If you're the kind of person who lines up at bookstores to get the newest non-fiction books the day they come out then it's going to be an awesome fall.
Most of that stuff is a bit silly but I learned python before it supported verbose regular expressions so I found this example useful.

finder = re.compile(r"""
^ \s* # start at beginning+ opt spaces
( [\[\]] ) # Group 1: opening bracket
\s* # optional spaces
( [-+]? \d+ ) # Group 2: first number
\s* , \s* # opt spaces+ comma+ opt spaces
( [-+]? \d+ ) # Group 3: second number
\s* # opt spaces
( [\[\]] ) # Group 4: closing bracket
\s* $ # opt spaces+ end at the end
""", flags=re.VERBOSE)
Actually this one is a delight by comparison. This guy at least means well. The last one was like Fox News.
I Still Don't Believe Wireless Is Safer
The best thing I've been reading lately is E. W. Bovill's English Country Life 1780-1830. Boring title, but a great book. His Golden Trade of the Moors is fabulous.
Considering Git is written primarily in C, it's not that surprising, and the fact that they're no longer using the canonical Git implementation but a Ruby-based clone makes me worried about future incompatibilities and bugs.

I don't know Ruby, but wouldn't the better solution be some variant of C's exec call that executes the instruction directly without interpreting the shell string? This would reduce some parsing overhead and still allow the site to use the official version of Git.
Getty, Flickr reach deal:  amateur photogs to get paid
Where can a guy find freelance work nowadays? 
Hi I'm currently looking for some freelance work to do and I'm not sure if this is the right place to post. So really my question is do any of you gents know of reputable sites I can post myself in so that prospective (employers|startups|companies) can hire me to do some contractual work for them and would allow me to work remotely. The latter is optional though. Thank you!
-Black Swan & Fooled by Randomness

-The C Programming Language

-The Non-Designers Design Book

-How to Read a Book

-Never Eat Alone

-Art of War

-Bill Bryson's a History of Everything(~)
The Digital Gap Is getting Smaller
Converting over to a pure-Ruby solution has taken us weeks. If we had put forth this effort pre-launch, it would have either a) cost us integral features or b) pushed back the launch.
Not really. I mean, with the backtick, you're doing 2x the execve's (you're exec'ing the shell), but it's still just very slow to fork and exec another process to get things done for you.

The real solution to calling C code from within Ruby is to call into the C code, either using DL/Win32API (tricky but doable) or by writing Ruby bindings.
Generate a random 256-bit salt, and compute H = HMAC-SHA256(salt, password). Then compute K = 2^H mod P where P is the Diffie-Hellman group #14 modulus 2^2048 - 2^1984 + 2^64 * floor(2^1918 pi + 124476) - 1, and store (H, K).

At least, that's how I do it. A nice, expensive computation -- not only expensive in software, but also expensive for custom silicon, since 2048 bit modular exponentiation needs a lot of gates -- and as an added benefit you can do password verification using DH and thereby separate the password from its verifier.

EDIT: Ok, that's not quite how I do it. I actually compute K = 2^(2^258 + H) mod P, because I can do that using two exponentiations with blind exponents. But that's just me being paranoid about side channel attacks.
I have no smartassed response to this. You're right, the backticks are better than not shipping.
Yes I pee in the shower. It is very convinent. Sometimes I'll pee in a floor drain at Starbucks so i dont have to flush. I have a vey small bathroom, and Im fat. So I sit on the edge of the tub and pee while brushing my teeth.
Is that actually true?

As far as I know, desktop virtualization (for developers and QA) is a large chunk of VMware's business, indeed it's where they got their start.
First person to say "The Long Tail" gets expelled.
awesome. simply awesome.
As the old adage goes, "an ounce of prevention is worth a pound of cure", and it's especially pertinent when it comes to software bugs. The first two questions are OK, but to any experienced coder they are automatically considered part of fixing the bug and not afterthoughts. The third question, "What should I do to prevent bugs like this?", is especially important because once you learn to identify where and how bugs can occur you can markedly decrease their occurrence, which makes everyone involved happier.
#3 was written by a copywriter for a Nike TV spot.
The Power Broker is awesome. One of the finest books for understanding the 20th century. It's also fascinating to note that today we blame car culture on oil companies and selfish consumers. Turns out that the one of the people most responsible for creating America's car dependent culture was a progressive named Robert Moses ( with a lot of help from the NY Times).

BTW, another great book on urban themes is City: Urbanism and its End, by Doug Rae.
Let's not forget Phil's partner and coach either - http://en.wikipedia.org/wiki/Bill_Bowerman

He fits my idea of the athlete/hacker a lot more than Jordan does.
Yup. Being the capital of ideas isn't terribly interesting. Ideas aren't worthless but they are worth less than the vetting, refining, and execution of ideas.
BRK hit a few good points right on the nose.

It's definitely a burgeoning industry, but you really do need a decent amount of certification to be taken seriously. I used to work in clean energy and it is becoming somewhat of a crowded field, especially for residential solar. You'd be setting yourself up for some strong future business, but right now the costs of solar installation for homeowners is quite high, especially considering the federal tax credit for solar systems is about to expire. There might be some more incentives that will drive increased use under the next president, but there likely won't be much within the next half-year.

Not sure how things are where you live, but the geographic market I was working in saw mostly retrofits and very little integration with new construction. As the cost of producing solar panels continues to decrease, you'll be strengthening your position, but until that happens you likely won't be making very much money.

Another thing to consider is the proliferation of larger solar companies that operate on a franchise model and include service and maintenance into the cost of the system.

If you're very passionate about clean energy and have the time to dedicate over the next 5-10 years, I say go for it, otherwise you won't see very strong returns. Just my 2c...
Or people that know Adobe...
Yeah...Seattle has a startup scene. But from what I've witnessed, you can't compare it to the scene in the bay.

Your average startup founder in Seattle is in his mid-to-late 30's, and has just come off of an N-year (N >= 10) successful career at Microsoft or Amazon. He's financially comfortable, and the decision to jump into a startup was probably driven as much by boredom (with the 9-to-5) as ambition. Moreover, without outside help, young founders rarely get the time of day from local investors (after all, everyone knows that you need to work at Microsoft for a while to gain experience before you can start a company!)

All of this could be viewed as good or bad, but in my opinion, it's not as vibrant, energetic or varied as the scene in the bay area. Here, young founders have an uphill climb to prove themselves -- in the bay, it's almost the opposite.
The Triumph of Conservatism by Gabriel Kolko - the book for understanding the rise of corporate serfdom

The World of Yesterday by Stefan Zweig - will make you nostalgic for the days of monarchy

World on Fire by Amy Chua - the single best book for understanding globalization that I have read. The antidote to Tom Friedman.

America's Great Depression by Murray Rothbard - very different from the story you get in school. Is he right?

Two favorite tech books are Inside Intuit and The Manager Pool
See ya later Matt :-)
Speaking of blogging about zombies: http://www.crimsonmane.org/spikevision/cleaner/
The site still feels somewhat busy and corporate, but I'll give them credit for losing the "Tour News" and "Entertainment Guides" sidebars. The sidebars they have are busy and space-sapping but not quite so bad. I think someone there's been looking at upcoming.org.

Another site redesign made easier by having a low bar. So it goes.
I thought about posting this here after a relative success asking the question on Reddit:

http://www.reddit.com/info/6mikl/comments/

but it looks like you've beaten me to it!

I did create a listing of the most popular books mentioned on the comment thread, if you're interested. The following were mentioned by 4 or more people:

14 The C Programming Language

11 Structure and Interpretation of Computer Programs

8 Introduction to Algorithms

7 Compilers: Principles, Techniques and Tools

6 Programming Erlang

5 The Mythical Man-Month

5 The Pragmatic Programmer

5 Applied Cryptography

4 Beautiful Code

4 The Little Schemer

4 Programming Perl

more here: http://www.reddit.com/info/6mikl/comments/c04abpy
Trying Hard To Like Loren Feldman
Nostrademon's comment about making work more fun than the distraction seems right.

<... only thing that seems to work for me is to make whatever I'm working on significantly more fun than what I should be doing>

My latest STRATEGY is to move my work (writing and elearning game design) into the cloud since that's where I live anyway. I have 5+ private blogs (all connected of course, through WordPress dashboard) that I use to manage content (categories are king, tags are pointless since I don't want publicity) and as a place to do my real work (planning, designing, collating, editing, researching) and keep a record of my progress... and SO FAR I'm effortlessly spending most of my hours in this artificial work-world I've created and much much less time on the wild untamed Net.
Ask News.YC: What MTA?
I'm reading the exim4 documentation trying to figure out how to pipe to a script any mail with a recipient matching publish-* or draft-*. This is on Debian stable. Was it a mistake to switch with my OS's default MTA? Would Postfix or netqmail keep this conceptually simple task simple?
I thought (hazy memory here) that git was implemented as a bunch of perl wrappers on some C code. Wouldn't it be better to call into that C code, rather than implementing git in Ruby?
This is an excellent overview of how Python is usually written by people who write (and read) a lot of it.

I hardly ever see coding conventions documents that do such a good job of capturing the popular conventions without inserting quirky personal preferences. I clicked through expecting something to point and laugh at, but was pleasantly surprised!
Def down,I'm in the union square area.
I'm no engineer but it seems that cooling system is too simple, especially with ten of those together... The heat generated in the middle will be way more intense then on the sides.
at least they got rid of the double search engines,
I'm pretty sure people who know her from her UCB days (she was peripherally involved with Stonebraker's research) would say it's a mistake to call Diane "non-technical".
The improvement is noticeable. As a paying user, I appreciate it. I also appreciate that R1.0 was out the door so fast. So no demerits for the shell calls. :) Glad they're gone though.

When I am hacking something together and can't find a library or don't have time to write one to do something that UNIX does really well already, I use the shell too.

When performance becomes an issue, you rip it out and do it better.

I appreciate the visibility into the service issues and the related fix. That was a good move on GitHub's part.
Yeah. Desktop virt for developers and QA is certainly visible.

Virtualized server farms, OTOH, are transparent. You could be logging into a VM and never know unless you ran dmidecode (Linux) or Get_WMIObject Vendor (Windows, IIRC).

That VM could also be moving from one physical machine to another while you're logged into it. You'd never know.

Last project I worked on was at a bank, with a few hundred VMs used to replicate the prod environment about 18 times. Project budget was $450M AU, about $400M US. VMware got a good chunk of that.
Same here, especially on a 13 inch screen (macbook) I could only see half the page.
Actually that's my point. It's PR fluff, and platitudes, and nothing resembling genius. It's even a top ten list.
I go for abbreviations that are pronounceable - but I do try to abbreviate. My soft rule is six characters or more.

I understand your concern, but I consider horizontal space a resource. There's a point at which long names just add to the clutter and get in the way of the concepts.
I'm not asking just to make geek-celebrity gossip. I'm asking because I'd like to find some people to play. :)
I disagree. I think it depends on context. Generally, one branch is the more common case, and I prefer to put that one first. It's the main flow of the code.
I think it's a good idea. However, as with any venture, do your homework.

Research the market size, the barriers to entry, the competition, how you might differentiate yourself, the threat of a disruptive technology making you obsolete, etc.

The solar panels currently in widespread use are:

* Expensive
* Limited in Capacity
* Fragile-ish

So if I were you, I'd be looking at third-gen solar and finding ways to bring that to people in ways your competition cannot.
yes, there's abbreviation expansion. i do well enough with keyword completion though
Make it work.
Make it right.
Make it fast.

GitHub is a stellar example of how to start a software company.
"Is this really how Paul thinks his YCombinator startups should make decisions on where to build their business? By restaurants with jacket requirements?"

Paul figured out a way to quantify something (fussiness about appearance) that seems completely squishy. That's a good skill to develop, by the way.
You know, I missed the other articles because I was out of town (I assume), but I just wanted to let you know that'd I'd like to nominate this comment for Comment-Of-The-Year award. Here everyone else is setting up for a flame war and you just come along and remind everyone that they are being four-year-olds.
Index variables with names like i, j, k are meaningful, through convention. Also, index variables are usually used to index things, and long names clutter up those expressions.
I know some people who have had success with odesk.com and elance.com. It looks like a bidding war on those sites, though, so you have to build some reputation before you can command higher rates.

For my money, the best people to talk to about freelance work are design firms, boutique consulting companies, and recruiters. They always seems to have some expertise they're missing and willing to subcontract out.

Make some calls to firms you trust or have heard of and ask. It may be harder in terms of effort, but I'd bet you'll land a better gig that way.
Unfortunately, the implementation of Git makes writing bindings to it - in Ruby or Python or something similar -very problematic. None of it is really meant to be a long running process, so it will exit program execution on lots of different errors, etc.

There was a Google Summer of Code project that tried to address this 'libification' problem, but it did not get very far - at least, not far enough to do what something like GitHub needs to do.

http://code.google.com/soc/2007/git/appinfo.html?csaid=5DB94...

Actually, the Ruby implementation for most of these operations is pretty fast (though not as fast as C) and the object specs are incredibly slow changing. The commands change around a lot, but the objects themselves are pretty simple and have not changed much in years. Doing this is far less prone to git changing than depending on command line (or possibly even binding) calls.
I love how transparent and proactive the GitHub guys are. Top notch start-up.
There is interest in the corporate space for 3d interaction of tools and equipment w/ folks from different geos. Complex troubleshooting, training, etc.

I'll be playing with Lively in the morning behind the firewall.
The "cutting edge" is getting rather dull. -- Andy Purshottam

I suspect you may have gotten to the point where you're able to quickly recognize fundamental issues. Problems which may have once seemed to be interesting and challenging because they were new to you are now familiar and boring.

This happened to me a while ago and I decided doing the same kind of thing for work and play was too much so I decided to take up the piano in my spare time. I rented an old upright and bought a lot of beginner books and just started to try and learn to play. I'm not very good but I find even a few minutes of practice now and then helps me clear my mind when I'm stuck on something.

Perhaps there is some similar creative outlet you could explore?
I've been coding for quite a few years, but it was Godel's Proof that got me into the theoretical parts of computer science (even though it's a logic book). Strongly recommended. Godel, Escher, and Bach is the usual book to read after Godel's Proof.

Universal Principles of Design - great when you need some UI inspiration.
Hopefully they'll integrate it with their actually functional apps.

I'm still waiting for the metaverse where I can accomplish real tasks in a pseudo-natural way.
QMail.
I'd suggest reading up on http://en.wikipedia.org/wiki/Procmail to start.
There are Perl packages to do the same - XML::TreeBuilder and HTML::TreeBuilder come to mind. I'm sure for most cases they would both work just fine and it's really just a matter of preference.
So you let the philosophy of your editor get in the way of writing good code? Sounds like a plan...
Their desktop products like vmplayer, vmware server are free.
Does this really throw people off? I see code like this from time to time, and my brain mentally ends that first "if" statement right at the ; after i++. It even did when I was reading the above example.
I remember reading that one thing that separates us from other primates is our (relative) mastery of our emotions.
I have mixed feelings about this. One one hand, this will promote wider unicode adoption which imho is a good thing but this will fragment the internet as regions split by language.
Ask YC:  What's the greatest number of projects you can work on at once, successfully?
Right now I have a coding project I'm doing for work, one for a side for-profit thing, and one I'd like to do just for fun.

I'm trying to decide whether to do them with as little overlap as possible with the goal of total focus, or all at once with the hope of cross pollination of ideas.

What's your threshold and/or ideal? I realize this will vary a lot by individual, free time, complexity of the projects -- but I'm interested to hear some opinions of HN members on this.
With respect to what other programmers might do, I think "defensive" programming is a waste of energy. A bad programmer will screw up your code regardless of what you name a variable. The best you can do is avoid working with such people.

Exactly. I had a really hard time working with normal programmers... I would explain why I did something that wasn't brute force, they wouldn't get it and their way also worked... so the codebase was one big festering pile of shit.

Now I work somewhere where my coworkers are arguable some of the best programmers in the world... and I don't have this problem.

Life is too short for bad jobs. As a programmer with a clue, you are a very hot commodity. So go somewhere where you won't want to kill yourself at the end of the day. (Or start your own company, of course. Then you really get to pick who you work with.)
Number 3 is especially relevant. It gives weight to the adage that "Success is learning to improve with each failure."

Whenever I make a mistake, especially a big one, I like to stop and think, "is this mistake a result of process. Is there an improvement or a best practice I could follow?"
How much do you need to edit a stolen article? SEO article
AMOP was a good read.
My sister hires web developers for her company off elance frequently.
I agree - wasn't trying to use that as an an illustration of superiority of Python, but just show how the data should be properly parsed, not treated like unstructured data.

That said, I do prefer the 'one, right way to do it' of Python - it makes it a lot easier to pick up on someone else's code.
Don't whine, fix it.

By that I mean, propose specific suggestions for improvement. There's not a single constructive comment offered by the author.
Just remember that "Total focus" means 100%

You can divvy that up however you see fit.
Women Gossip, Celebrity News, Fashion
Find the best celebrity gossip, entertainment news, beauty tips, parenting help, delicious recipes , latest fashions and other helpful tips for women updated daily
> if x is None: ...
> if items is None: ...

None's truth value is false, so the above are equivalent to:

if x: ...
if items: ...

Empty sequences and mappings are also considered false, so you don't need to

if len(items): ...

Instead, you should

if items: ...

On a side note, does it annoy the hell out of anyone else that a sequence's length is len(foo) instead of foo.length() (or size, count, etc)?
"Who writes like that??"

The authors of:

BitTorrent: https://develop.participatoryculture.org/trac/democracy/brow...

Django: http://code.djangoproject.com/browser/django/trunk/django/ut...

Pylons: http://pylonshq.com/project/pylonshq/browser/pylons/util.py

Twisted: http://twistedmatrix.com/trac/browser/trunk/twisted/python/u...
If you're talking about coding projects, then I like one at a time. Sometimes I split that to be one at work, one at home.

I find that when I flight a lot of other ideas when I already have a major project in the works, I end up with a lot of sparse git and svn repositories.

That's just my preference. I can handle a handful (5 or 6 maybe and still be effective?) but the context switching saps my productivity pretty fast.
Living With a Zombie
Are we talking about coding, or doing the whole thing(marketing etc..)? If the full project, then I'm a fan of going 100% into that one thing you believe most in.
your "burnt out at the office" speaks very closely to my experience - its my first serious job as a full-on C++ software developer, and frankly, it sucks the interest out of programming.