“If something saps your energy and puts you in a bad mood, delegate it even if you have to pay someone more to do it than it would cost you do to yourself. And if something gives you energy, maybe you should do it yourself even if someone else could do it cheaper.”—John D. Cook, Whether to delegate
“It’s easy to get caught up in the heady buzz of making money. You should regard money as fuel for what you really want to do, not as a goal in and of itself. Money is like gas in the car — you need to pay attention or you’ll end up on the side of the road — but a well-lived life is not a tour of gas stations!”—Tim O’Reilly
“Plans are worthless, but planning is everything. There is a very great distinction because when you are planning for an emergency you must start with this one thing: the very deﬁnition of “emergency” is that it is unexpected, therefore it is not going to happen the way you are planning.”—Dwight D. Eisenhower
“An underlying problem with artificial intelligence that I have personally experience in my forty years in this area is that as soon as an AI technique works, it’s no longer considered AI and is spun off as its own field (for example, character recognition, speech recognition, machine vision, robotics, data mining, medical informatics, automated investing.)”—Ray Kurzweil
“There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.”—Tony Hoare
“A human being should be able to change a diaper, plan an invasion, butcher a hog, conn a ship, design a building, write a sonnet, balance accounts, build a wall, set a bone, comfort the dying, take orders, give orders, cooperate, act alone, solve equations, analyze a new problem, pitch manure, program a computer, cook a tasty meal, fight efficiently, die gallantly. Specialization is for insects.”—Robert A. Heinlein
“I didn’t really expect anyone to use it because it’s so hard to use, but that turns out to be its big appeal. No technology can ever be too arcane or complicated for the black t-shirt crowd.”—Linus Torvalds on Git
“We believe it is better to have application programmers deal with performance problems due to overuse of transactions as bottlenecks arise, rather than always coding around the lack of transactions.”—Several Google authors in the Spanner: Google’s Globally-Distributed Database paper (PDF link)
/usr/lib/ruby/gems/1.8/gems/fpm-0.4.17/lib/fpm/../../templates/rpm.erb:68:in `output': undefined method `shellescape' for Shellwords:Module (NoMethodError)
from (eval):3:in `each_without_optional_block'
from (eval):3:in `each'
from /usr/lib/ruby/gems/1.8/gems/fpm-0.4.17/lib/fpm/../../templates/rpm.erb:67:in `output'
from /usr/lib/ruby/gems/1.8/gems/fpm-0.4.17/lib/fpm/package/rpm.rb:189:in `output'
from /usr/lib/ruby/gems/1.8/gems/fpm-0.4.17/lib/fpm/command.rb:368:in `execute'
from /usr/lib/ruby/gems/1.8/gems/clamp-0.3.1/lib/clamp/command.rb:64:in `run'
from /usr/lib/ruby/gems/1.8/gems/clamp-0.3.1/lib/clamp/command.rb:126:in `run'
from /usr/bin/fpm:19:in `load'
So after some Googling, I found that I needed to monkeypatchShellwords.shellescape. I’d heard about monkeypatching in Ruby before and even had an idea of how to do it if I were developing an application myself, but in this case, I need fpm to use this monkey patch.
With my limited Ruby knowledge, the crude solution was to patch /usr/lib/ruby/1.8/shellescape.rb itself:
--- shellwords.rb.orig 2012-09-21 18:56:38.000000000 -0300
+++ shellwords.rb 2012-09-21 18:56:50.000000000 -0300
@@ -56,5 +56,31 @@
+ def shellescape(str)
+ str = str.to_s
+ # An empty argument will be skipped, so return empty quotes.
+ return "''" if str.empty?
+ str = str.dup
+ # Treat multibyte characters as is. It is caller's responsibility
+ # to encode the string in the right encoding for the shell
+ # environment.
+ str.gsub!(/([^A-Za-z0-9_\-.,:\/@\n])/, "\\\\\\1")
+ # A LF cannot be escaped with a backslash because a backslash + LF
+ # combo is regarded as line continuation and simply ignored.
+ str.gsub!(/\n/, "'\n'")
+ return str
+ module_function :shellescape
+ class << self
+ alias escape shellescape
“- Avoid overengineering datastructures. Tuples are better than objects (try namedtuple too though). Prefer simple fields over getter/setter functions.
- Built-in datatypes are your friends. Use more numbers, strings, tuples, lists, sets, dicts. Also check out the collections library, esp. deque.
- Be suspicious of function/method calls; creating a stack frame is expensive.
- Are you sure it’s too slow? Profile before optimizing!
- The universal speed-up is rewriting small bits of code in C. Do this only when all else fails.”—Guido van Rossum, Some patterns for fast Python
“I think less code should be written in C/C++ than actually is – the safety problems of pointers/array overruns and explicit memory management are much worse than the performance benefits for most applications.”—John Carmack, father of Wolfenstein 3D, Doom, Quake, among others
I have OS X set to use English language but Brazilian formats, which confuses R:
During startup - Warning messages: 1: Setting LC_CTYPE failed, using "C" 2: Setting LC_COLLATE failed, using "C" 3: Setting LC_TIME failed, using "C" 4: Setting LC_MESSAGES failed, using "C" 5: Setting LC_PAPER failed, using "C" [R.app GUI 1.42 (5933) i386-apple-darwin9.8.0] WARNING: You're using a non-UTF8 locale, therefore only ASCII characters will work. Please read R for Mac OS X FAQ (see Help) section 9 and adjust your system preferences accordingly.