61 karma · joined May 5, 2008
Not exactly pretty, but using signals to trigger to produce reports isn't exactly pretty either.
Unfortunately, signals are often abused in this manner. Not a big deal for such for this small piece of software, but in larger systems this kind of abuse can cause very hard to fix bugs.
Here's a list of async-signal-safe functions (scroll down): http://pubs.opengroup.org/onlinepubs/009695399/functions/xsh...
I know I'm missing the point of the post, but it is a particular nit that I pick. You'd be surprised at how often this happens in production code, and how often it causes mysterious, hard-to-reproduce bugs.
iTunes + AirPortExpress == poor-man's-sonos.
Also, podcasts would be good.
THIS IS NOT COMMUTING.
Commuting is getting in your car and sitting in traffic for two hours per day.
Here it is in a nutshell: No grains nor legumes; minimize fructose; minimize PUFAs; emphasize MUFAs and saturated fats, especially short- and medium- chain triglycerides; aim for 20% carbs, 65% fats, 15% protein (by caloric value); fiber is good (because your gut bacteria convert a lot of it to SCTs and MCTs).
The 20/65/15 ratio may need to change depending on how active your are and how damaged your metabolism is.
Butter contains a fair amount of butyric acid (a short-chain triglycerides), so it would make sense to add it to your diet. I prefer coconut oil because it is about 50% MCTs and typically doesn't require refrigeration. I eat a lot of it, and it tends to fire me up like a rocket.
And, yes, I've lost approximately a shit-ton of weight on a Paleo diet.
ps -ef | grep foo | grep -v grep
Will fail if foo="grep" function psg () { [[ -z "$1" ]] && return ; local _first=${1:0:1} ; local _rest=${1:1} ; [[ -z "$_rest" ]] && _rest='[^]]' ; local _com="ps -ef | grep '[$_first]'$_rest" ; eval "$_com" } seq $((2**32)) | perl -ne '/find me/ && print' ps -ef | grep foo | grep -v grep
This always works: ps -ef | grep '[f]oo'
And, if you're running a modern operating system: pgrep fooAlso, I never really understand why everyone wants to tout the "cross-platform" nature of their applications. You always run up against OS differences fairly quickly, negating any supposed "cross-platform" benefits. Especially if you want hooks into the OS (and who doesn't want OS hooks?)
Cross-platform apps that do provide hooks into the OS are excepted: those are indeed useful: Python, etc.
So, by analogy (and since we're talking about simple thermodynamics), eating more calories should make your metabolism run faster. More fuel, more fire, higher rate of fuel consumption. This is definitely true for those people who can eat lots of food and never get fat. Ectomorphs.
So, why doesn't this rule apply to everyone? Why do some people store what they eat as fat and others just burn it all off regardless of how little they exercise. Why aren't we all ectomophs? Genetics may come into play, sure, but all humans have the same genome.
The difference must be related to differences in our bodies. Which means differences in hormonal reflexes, differences in responses to certain types of food, etc.
It is about calories, but it's not _just_ about calories. It's about our bodies, too, and how we've conditioned them to process different kinds of foods.
Highly recommend "Good Calories, Bad Calories" by Gary Taubes.
$ echo 'echo $0' > 'Hello, world!' $ chmod +x 'Hello, world!' $ 'Hello, world!' Hello, world! $ wc 'Hello, World!' 1 2 8 Hello, world!
8 bytes. I think that's probably as small as you can get.
Usually a few questions involving pointers does the trick quite nicely.
In fact, I'm almost at the point where I'm rejecting applicants with CS degrees out of hand. I've had too many problems with architecture astronauts and the Java-solves-all-problems crowd.