Ask HN: Share a gem. Teach me and you.
One of my favorite discussion threads of all time, on any forum, was "Teach me and you. Give a gem" on the Civfanatics forum. It wound up being 15 pages of insights on how to play Civilization IV well, and was really a wonderful, enjoyable, community building experience.
Here was the first post:
"Share a "one-liner" simple strategy that can help beginners, seasoned players and maybe even be a gem that one of the pros can learn from.
Feel free to explain your tip, but avoid complex, in-depth strategy."
So, care to share a gem about technology, entrepreneurship, or general Hacker News type topics?
306 comments
[ 0.29 ms ] story [ 494 ms ] threadI had a client a few weeks ago that had a drive failure. We went to restore from his offsite backup copy and found that some of the files he needed weren't being backed up. A quick review of the backup job would have caught this.
Also, answer this question: If your home burns down, will your backup still work? I like to have one or two hard copies, and one cloud copy of the most important things.
For example, let's try and factorise f(x) = 2x^3 + 9x^2 + 4x - 15
What happens if we set x = 1? Then f(1) = 2 + 9 + 4 - 15 = 0, so (x-1) must be a factor.
It's much easier to get f(x) = (x - 1)(2x^2 + 11x + 15) = (x - 1)(x + 3)(2x + 5) if you know one of the factors in advance. This was useful at school, at least. Not so much now.
* See http://en.wikipedia.org/wiki/Polynomial_remainder_theorem
If the co-efficients of the odd powers and the even powers are equal, then (x+1) is a factor.
I'm, ah, coming up blank on this one for now.
Also, accept that humans are imperfect and no code (whether yours or another's) will be defect-free. Fixing is more important than blaming.
For anything you wish you were doing every day, like working out or practicing violin or working on your startup: Get a big, yearlong calendar and put it on a wall in your bedroom. Every day you complete your task, mark a big, red "X". Eventually, you'll build up a big string of X's and won't want to break it. That incentive will push you more than you think.
I'm having a decent month: http://calendaraboutnothing.com/~telemachus
Worked much better than the excel spreadsheet I had tried before (the one from the Hacker's diet).
Then I hung a small calendar in the bathroom where I cross each day that I brush my teeth, and the "I don't want to break my win streak" feeling is so RIDICULOUSLY compelling that it's been many months now and I brush my teeth almost every day, in fact I didn't miss one day since 1 month and 3 weeks ago.
DON'T underestimate the sheer POWER of "win streaks".
My teeth are almost white now!
From this I'd gathered that tooth discoloration is permanent.
http://en.wikipedia.org/wiki/Zsh
or its cousin:
maybe, but do it anyway.
Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have three problems, the original problem, the regular expression, and dealing with the annoying developer who isn't that good at simple regular expressions who will repeat this phrase everytime he comes across a regex in any codebase rather than actually figure out how they work.
(This might seem obvious, but I find that it is tempting to "just see if I can get it to work" before I read the documentation. I always end up with worse code than when I take the time to read up on the technology. A similar advice is The Pragmatic Programmer's "Don't program by coincidence")
http://chegra.posterous.com/you-only-need-one
Course, this is my personal motivational technique.
* See http://en.wikipedia.org/wiki/Rule_of_72 for more info and background/variations that improve on accuracy in certain situations.
tail -10000 somelogfile | cut -d ' ' -f 1 | sort | uniq -c | sort -n | tail
Quick one liner to get a fix on who is currently messing with your server in ways that are 'counter-productive', also a nice way to show newcomers to unix how you can string together existing unix commands to create new ones on the fly.
As for start-up advice that would fit in one line:
A practical, bug ridden, bad implementation of something trumps a theoretical, perfect implementation of the same thing.
It's also not a bad idea to do a quick mysqldump of the database you are working on, just in case.
http://news.ycombinator.com/item?id=1398805 http://en.wikipedia.org/wiki/Ego_depletion
The title says it all. Self-control is exhaustible. So when you're trying to make changes in your life, keep it to one simple thing at a time. Over time the one thing you decided to change stops being self-control and starts becoming a habit. Once it becomes a habit? Start training something else. You'll rack up positive changes in no time.
I don't have the study in front of me, but I recall the effect was pretty clear.
That said, taking an option off of the table simply because you'd have to "break a rule" to do it can be foolish -- just be aware of why the rule exists, and what you're actually risking in breaking it.
I suggest 'Yes! 50 secrets from the science of persuasion', it's a fascinating read.
I think it is more preferable to know your limits, but not necessarily accept them and then actively work towards overcoming them.