While I was wandering around Proc and Lambda in Ruby, I found very useful method Proc#curry. This method answer the question that bugs me for a while, is there an easy way to make Curry happen in Ruby? Let look at the example how to use it.
Start with a simple method:
Manually currying: But with Proc#curry, you can heavily simplify your code like this:
Sunday, June 3, 2012
I just read a blog post about TDD and really like it, TDD for Those Who Don't Need It. It reminds me to my first impression when I start practicing TDD more than a year ago, it allows us to not have to to hold everything in our head.
By the way, that post also mentions to other TDD benefits. I want to note it down here just for a reference.
- Not have to hold everything on our head. Just follow errors.
- Confidence to refactor
- Better design
(.getInputArguments (java.lang.management.ManagementFactory/getRuntimeMXBean)) Credit: How to get vm arguments from inside of java applic...
Formatting Run this command in shell sudo cpan JSON::XS Put this line to ~/.vimrc map <leader> jt <Esc> : %! json_xs -f json ...
This error message from chef is not very useful FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit ...
Print some ANSI characters (print (str (char 27) "[2J")) ; clear screen (print (str (char 27) "[;H")) ; move cursor to...