skysight-inc/HackerNews huggingface dataset:
Ask HN: Code Generators
I am interested in knowing which (if any?) code generation tools Hacker News readers use?

As a professional C# developer (don't laugh :), I'm familiar with CodeSmith, MyGeneration, and most recently Microsoft T4. But I'm getting more and more into Python, PyDev, and Eclipse and would like to generate Python source based on entity definition files. I have rolled my own ORM toolkit in C# would now like to "port" it to Python.

I came across Cheetah and it looks pretty solid, but an IDE-integrated solution would be ideal. Is there a tool which is the code generator to use? Or maybe because there is no obvious solution, code generation with dynamically-typed languages is dead and I'm trying to apply my statically-typed background to a dynamically-typed foreground?
I just watched Apollo 13 last night and I have to say, I'm sad i wasn't alive during the space race - the very concept thrills me.

But it appears that while we have the technology to get to Mars today, we lack the impetus - something that the article addresses, but not wholly.

We went to the moon to beat the Soviets. It would be more likely that we would persue a manned Mars program if we had someone to beat.

As it stands, I feel it's more likely that a manned Mars program will be undertaken by the various commercial ventures out there than by any government.
Right. The server can immediately know all the files that the client could need (and with some coordination.. does need). The client though has to get the first one to learn what others it may need, then request those.. and those may require more. Each level of recursion costs you at least 1 round-trip latency, likely much more due to the links not being at the very top of the page, the server not being instantly fast, and the browser's rules for requesting things.
DiggBar Commits Career Suicide, Starts Redirecting Users To Digg Homepage
Most people will just use the default. TinyURL used to be the default, now it's Bit.ly. If they made a basic (TinyURL style) shortener it would be more popular than Bit.ly over night.

The way they have done the default has always bugged me--they don't shorten URLs as you type them so if you're over 140 characters it won't shorten, but if your message is under 140 characters it sometimes (only sometimes) shortens the URL. Which is unnecessary and annoying, if the space is there why not show the full URL?
It's different strokes for different folks. His article highlights this. For example: rapping onstage is rapping onstage. But writing for the literary journal is not writing a novel.

To use a martial arts analogy, the rapping is kumite (sparring). You are working directly at your goal. In kumite, your feedback is kicks in the face. The article writing is kata (forms). Your are working at a parallel goal whose skills are transferrable. In kata, your feedback is angry shouting from Sensei. Either way, you get feedback and you improve.

The article's point is not method, motivation, kata, or kumite.

Rather, it is focus and measurement. Attack a precise, difficult, measurable goal, to the exclusion of all else, until victory is achieved. Then Sensei will stop shouting, and your opponent will yield.
Yes, yes. The problem comes when you don't have much free time. When you're working on a successful project, it will consume every hour that you can devote to it. If you then want to have a life outside of computers, you find yourself having to make a conscious choice between your main project, and learning new technologies.

This problem becomes far more acute as you get older. When I was in college, I had all the time in the world to experiment with things. These days, I don't have much energy for computers when I'm away from work.
Einstein's Pyramid Club was relativity itself.
Here we go again :-\
A link that says "digg.com" in the URL goes to digg.com? SAY IT AIN'T SO!!!!!

Anyway, there is an easy solution to this problem. It's called using any one of the other 100 million URL shorteners.
A Visit to the R&D Dept of the New York Times
They're pushing bit.ly pretty hard, it's the default.
Others have mentioned that there are different definitions of what "design" means, but I will assume you're talking primarily about visual/graphic design more so than the other ways the word is used.

As designers/developers or creative people in general, it's natural to think of our creations as art, they are.

But when it comes to art that has a concrete function, like websites, I find it helps me to remember that the average user will not be coming to a website I build for the sole purpose of marvelling at that lovely gradient that I made or that Ajax UI element that took me hours to put together. They're coming to the site to use a service or obtain information. That's all they're really interested in.

I'm not trying to say that the prettiness of the site doesn't matter, it does (for some sites more than others). But it's secondary to making sure the site is usable/accessible, making sure the visual design doesn't get in the way of what your users are trying to do. I'd also include in this making sure the design conveys the image you're tying to get across. That's part of the design not getting in your users way.

Users by and large will not squint at your visual design like you do and critique it in anywhere near as much detail as you might.
The EngineYard Contest is becoming a lottery of smarts. The ability to build or find the best solution increases your odds.
Video: http://www.niemanlab.org/2009/05/the-new-york-times-envision...
I have everything forced to Verdana anyways. It's a computer screen, why would I want to read a serif font?
"Let me guess... it would only take about a weekend, right?"

Making a functional link redirector? Yes, absolutely. There are frameworks that you could toss something together with in an hour that would scale enough for most people's purposes. With some frameworks you can get pretty close to true internet-scale scalability in a weekend. (I'd think Yaws and Erlang here.) I've seen framework tutorials use this as the demo, and, again, we're talking things that can get awfully close to internet scale without much work.

Making all the stuff that apparently surround link redirectors in some desperate attempt to make it "monetizable"? It would take longer, but unlike the case for "replicating Stack Overflow" where all the extra stuff is the real value and will take more than a weekend, that's all extra stuff that nobody really cares about very much in this case. A page that takes a URL, returns a URL, and does nothing else really is enough for the vast majority of uses.

It's a different class of problem. This truly is a fundamentally trivial problem. I personally see no reasonable way to "monetize" this trivial service, because the market value of a URL synonym is going to trend very strongly towards zero due to effectively infinite supply.

(Much as your point was that it's hard to recreate bit.ly rather than the weekend snark, note my point is more that doing that is a waste of time, mostly-crap features done to benefit the redirector, not the user, and that this truly is easy to recreate enough to drive supply sky-high.)
Interesting. I have two fast food restaurant sites and, from memory, IE is about the same but most of the rest is Firefox. I know we have that many IE6 users because they're next door to a huge financial institution which is also their largest customer.
Nope. I'm well aware that people still study analysis. I just meant that one doesn't necessarily need to learn calculus before taking the plunge into serious mathematics. Even in analysis, there's quite a bit you can do without knowing the stuff from a standard calculus class (though it certainly helps).
Want To Kill E-publishing?
A weekend is pretty generous for a two-column table and a single-field form.
Having a routine/schedule/structure in your life should help with mitigating such issues. Obviously you're not going to be at 100%, but setting up your life so it isn't a house of cards is very important.
There is already LilUrl implementation for anyone to use and get started as well. http://lilurl.sourceforge.net/
perfectly summed up in the last part: all DRM does is annoy people who legally buy the music in the first place. pirates will be pirates (or whatever you want to call them.. "felons").
Company Denies its Robots Feed on the Dead
I actually prefer serif fonts, at least if they’re designed for screen rather than print (So, basically, Georgia is my favorite web-safe typeface).
http://codepad.org/

Firefox 55.28%
IE 17.05%
7.0 38.08%
6.0 34.21%
8.0 27.77%
Chrome 7.51%
Safari 7.46%
Opera 5.53%
Mozilla 5.34%
Konqueror 0.95%
I blogged. I had a pretty big readership (three hundred or so followers on Tumblr, not sure how many followed on RSS), and I wrote a lot about how I felt and what I was going through.

The conversations I had with my readers led to a lot of self-growth and peace. I grew up a lot writing about the experience. There were also some moments of personal vindication: After writing about a particularly assed argument with her re:music, I got a message from somebody who works on a major music site that vindicated my point of view a little. (I'll also say right now how astounded I am that the people I was reading stories about at fifteen I get to talk to and attend events with at eighteen.)
Interesting plan, but massively glosses over some very hard things.

Land 40 tons using a parachute????

And of course galactic radiation that is going to be bad for the crew (how bad is a subject of debate that I already had, so am not going to repeat).
A red color doesn't mean failure BTW. It means Russia, it's just Russia has not had much luck with Mars.
Is computing a hash over 4x4bytes (+1 protocol bit) really faster than looking up an address (that is only 4bytes long, btw) in an optimized routing table ?

That seems counterintuitive to me.
By 1989, NASA estimated such a trip would come to half a trillion dollars

I admit the idea of going to Mars is very exciting, but honestly, is this where we want to be spending our money?
Apropos:
http://www.realclearpolitics.com/articles/2009/07/17/the_moo...
I've been very happy with SugarSync. I also back up my most important files to a couple of USB thumb drives.
Post-Traumatic Stress Disorder is also experienced by a high percentage of combat veterans.
I think compilers exist largely to relieve humans of the tedium and difficulty of dealing with the target language. Accordingly, I'm more likely to look for a better compiler or a more flexible metaprogramming language or approach than to seek/invent a source code generation program.
it needs competition, private companies would be all over this if they could profit from space exploration. Setup a law that states that any landing on the planet will get the lander all land for 250 miles, and you'd have hundreds of missions lifting off trying to get a piece of the pie.
I don't suppose you know of a web page with appropraite gradients, by any chance?
No, he said people would stop using Digg as a URL shortener. Granted, I don't know anyone who uses Digg to shorten links anyway.
Probably talking about ready-built libraries. Poorly worded though.
Are you viewing the large version or the medium one. The large one, http://quotesque.net/images/stdio003-web-l.jpg, has text plenty big enough to read.
Java performance does not scale for multiple tasks
Does this really happen?

Does this count?

Another soldier, Staff Sgt. Daniel Shannon, told CBS that his PTSD changed him completely. "I started smashing furniture, very rapidly; so I didn’t know what I was doing ‘til it happened. I’d get mad so fast, so angry fast, and just lash out." (http://www.thecommentfactory.com/irregular-army-the-prevalen...)

It only takes a bit of googling to find all sorts of information on suicide, substance abuse, domestic violence, and so on, in the military. Here's a pretty compelling and sad story:

http://www.boston.com/news/nation/articles/2007/02/11/told_t...

The problem has gotten so bad that the US military has embarked on programs to try to destigmatize therapy and to convince soldiers to do something about suicidal mates.

So yes, obviously this stuff really happens.

Edit: as it happens, NPR led with a story tonight about violence and mental illness among veterans: http://www.npr.org/templates/story/story.php?storyId=1067890....
Kevin Rose claims he had no idea about this:

http://twitter.com/kevinrose/status/2729862918

just now reading the digg short url discussion, I was not aware this changed and will check in on it tomorrow (was on vacation for 2 weeks)
36 new A/H1N1 cases confirmed in Europe
http://www.apartmenttherapy.com

6/2009 - 4.3m visits / 2.3m uniques
Firefox 42.52%
IE 33.59%
Safari 19.44%
Chrome 3.07%

All others under 1% each
As one commenter noted, this really cuts down on the already-small number of reasons I have to justify pirating music.
It isn't telling you to just be happy with the way things are, it's telling you to see the way things are before you decide what to do - be present and aware of your surroundings and thoughts, otherwise when you act it will be based on what you wanted to see, or what you imagine you saw, or on a habit, an unknown desire or fear or prejudice, or a lesson you learned via advertising or an idea you unwittingly picked up from a friend. It wont be acting, it will be reacting, and you wont even know it.

You are done with mindfulness meditation because of a fear that it will ruin a desire, which comes from an interpretation. Isn't that a perfect example of where it could be helpful?
It will more then pay for itself with increased interest in engineering and science. But besides that the US is throwing trillions at all kinds of unpopular things. I would much rather it be mars.
Agreed, although I think an even better solution is to not use URL shorteners at all. It could just as easily be one of the others that does something stupid next time.
I am all for private enterprise and creating incentives, but would that work? We know that there are metals and minerals that could be mined in asteroids and other planets. But, so far no private mission has been carried out. In fact, only recently have private companies started launching satellites into orbit, which is kind of trivial when compared to mining the Moon, or Mars.

Last but not least, suppose that you would grant any spaceship landing in Mars the right to own all land within 250 miles. Sounds great, but why wouldn't they explore and mine the entire planet if they could?!? It's not like you have CCTV cameras on Mars to know what they're doing, where they're mining, etc. Hence, in a way that's a false incentive.
Work vs Life
I recently met this really attractive girl, which causes the following problem.

The people I admire most in life (in random order): Tesla, Lance Armstrong, Steve Jobs, Larry Ellison, Jim Clark, Larry Bird, Michael Jordan, ... all seem to be people who:

() would rather die than fail
() had tremendously successful careers
(*) had numerous divorces (if they ever got married)

Given that that is the way I plan to live my life (I would rather achieve my dreams and meet random strangers than live with existing friends/family but let my dreams wither), how should I handle this current situation? (Both the girl & I are in our mid twenties).

On one hand, it seems almost wrong entering a relationship knowing that I will value my work more. On the other hand, there is always hope that all will turn out well.

Can HN'ers speak from experience? Those that pursued their dreams first + pursued family life later on / those that pursued family life first and somehow tried to balance it with pursuing their dreams?

Thanks!
New vulnerability discovered for Firefox 3.5.1 (Update)
You can get full data with T-Mobile prepaid? I'm using a SIM pulled from a $19.99 prepaid phone stuck in an iPhone 2G and all I get is EDGE service, funneled through their WAP portal. You really need the monthly service to get full internet connectivity (friend's G1 SIM in my phone works great).
Seems to me like you are putting the cart before the horse. Don't waste your time living solely for the future. You aren't Lance Armostrong or Steve Jobs yet, and you may never become them.

Life is what happens while you're busy planning other things. Don't waste an opportunity.
CrashPlan. I've got it backing up all my machines to a Drobo on my LAN as well as remotely to CrashPlan's servers, encrypted before it crosses the wire, and it costs me $5 a month. Been using it for years and have done several very large restores and it's worked like a charm.
The question is, is a human Mars mission worth doing? Wouldn't a series of missions building an infrastructure to use metal and water-rich asteroids do more to establish a permanent human presence in space?

Given a fixed amount of time and research money, what provides the best return for the next four decades?
Simple solution: Use actual URLs.
They didn't actively do anything to Palm. Apple fixed a bug in their software that causes what they think is undesirable behavior.

Suggesting that a company should avoid fixing bugs in it's software if it would potentially harm their competitors is a little bit on the silly side. I don't know of any business that operates on that principle.
Be careful with Mozy. If you haven't done a test restore, I strongly recommend you try one now. The Mozy restore process is extremely broken and has been for years.

You can read about my horrible experience with Mozy (and the horrible experiences of hundreds of commenters) here: http://wonko.com/post/it_turns_out_mozy_isnt_so_hot_after_al...
I disagree. In the absence of axioms logical reasoning amounts to recursion without a base case.
Yes, because every address seen by the router isn't in some simple lookup table in the router, unlike the flow table (or the CEF table or whatever your hardware has).

That's not to say this is a huge win --- I don't think it is --- but yes, flow lookups are a simpler problem than per-packet routing and per-packet N-dimensional classification.
Did you ever tried meditation (I recommend zen style sitting, aka zazen)?

There is some nice, simple and to the point books about it, and for me it is something that really helps with concentration, sadness and focus.

list of good books

http://www.amazon.com/Zen-Training-Philosophy-Shambhala-Clas...

http://www.amazon.com/Zen-Brain-Understanding-Meditation-Con...

http://www.amazon.com/Mindfulness-Plain-English-Updated-Expa...
IMHO, what differs from those people and the rest of us is their willingness to suffer it out until they succeed.
That's because the cost does not justify the payout. Sure you could go and mine on Mars, but there is no guarantee you'll keep the land if you find anything. By setting up a rule that if you explore it, it's yours...you'd have companies rushing to plant their flag...not because they wish to explore, but to lay a claim of ownership on the area for the future.

As far as companies mining the entire planet, sure they could, but they'd be poachers. The 250 mile area claim would have legal rights of ownership backed by earth governments.

The rule would obviously need to add some extra provisions to drive innovation. I dunno, require colonies within 100 years, or trips every decade to show the flag etc.

There is a reason that pretty much every single explorer on earth was financially backed by either a company or a gov't grant.
Take up a (slightly) risky sport. I was getting into rock climbing a few years ago (gave up for logistical reasons), and I can just about guarantee that when you're on a route, with your forearms burning and no obvious next move, that your troubles fade into insignificance.
Appears totally unrelated.
They were also people who were fascinated in the stuff they became famous for.

Don't make the mistake of thinking that you can work hard at something you don't like and become a legend. Find what you love, what you don't mind working hard at. Do that. If you want your work to be separate from your life, expect cognitive dissonance.

My advice, from life experience: Try everything. Do what feels natural. Give the relationship a try; if it falls apart, then continue with your work. Not everybody succeeds young. Not every girlfriend turns into a wife.
About 4 years ago I was assigned to an internal project that was to provide a GUI CRUD interface in VB.Net to replace one written in curses on Linux. There were 50-75 attributes for the main entity plus multiple hierachical subsets of sub-entities. It was a mess. The business user specified a complex GUI that would let you have different levels of users and allow fields to be protected and show warnings and error by changing the background color of the control, etc, etc. Tons of boilerplate code and lots of changing conditions because the business user would come up with new requirements and conditions to test for.

To keep track of all of this I ended up specifying a lot of the rules in an XML file and used 'Cog' written by Ned Batchelder. http://nedbatchelder.com/code/cog/ to generate the boilerplate code. Cog is different than any other code generation tool I had used before because you write your generation code in commented lines in your normal source file. When you run Cog, it finds these special lines and replaces the code between the markers with whatever code is supposed to be generated. No other code is touched so it survived a round trip through an IDE like VS.
It worked great for what I was doing and I used it heavily but the project was thankfully cancelled before I could finish.
Agree. Also: beware sample bias. For every hero the public worships, there may be 1000 people who love what they do, make tremendous sacrifices, and remain completely anonymous.

The good news is, they love what they do.
I don't know the personal stories of all those people you mentioned, but I can guarantee you that none of them passed on relationships while aiming for their success.

The ones who did, most likely didn't suffer, because they were so focused on their work, that they didn't even notice the opportunity.
Yep, and they were also very, very lucky in addition to being dedicated and talented. The world is full of smart, talented, determined people who never achieve fame.

Live your life, be honest with yourself and others, work hard, everything else will take care of itself.
You have your entire life to pursue your interests and projects. That's not a lot of time, because one single lifetime is not enough for someone who is passionate about various topics and wants to find out more and more about them.

On the other hand, meeting a girl you find attractive and worth spending time with is not something that happens often. As you're still in your mid-20s, you may think that you'll have plenty of chances to meet other good girls. But soon you'll wake up and you'll be 35... and you'll have a different perspective on life.

It doesn't have to be either work OR the girl. You can have both worlds. You'll just decide what the optimal allocation of time is. Of course, if the girl thinks you're allocating too much time to your work, you relationship might not last. If you have the opportunity to be with someone you like, go for it. A stable and healthy personal life is great for one's productivity, and you still have 50 years or so to become a mini-Tesla ;-)

PS: be careful when idolizing athletes. They are done by the time they're 30. Tesla had done great work by the time he was 30, but some of his best work was done later in his life.