(*) As of now R, Ruby, Python and JavaScript 😉 GraalVM consists of a Java Compiler, a VM and a JDK based on HotSpot/OpenJDK, implemented in Java. These days it’s all about additional execution modes compared to the standard JVM, mainly ahead-of-time compilation and the creation of native images. Native images are an important piece […]
Here is how to get correct unicode substrings in Ruby 1.8.x require ‘jcode’ $KCODE = ‘u’ "öäüÖÄÜß".split(//)[4,2].join # ÄÜrequire ‘jcode’ $KCODE = ‘u’ "öäüÖÄÜß".split(//)[4,2].join # ÄÜ Don’t know, if this performes well… In case you have better ideas, please drop me a comment.
The default behavior for quite a long time was :hard_breaks in the textilize helper method in rails. Hard Breaks means: All line breaks are turned into <br />’s. Somebody changed the textilize helper in “actionpack-2.3.4/lib/action_view/helpers/text_helper.rb” in 2.3.4 and added the ability to pass some options but broke the default behavior here: def textilize(text, *options) options […]
I recently presented biking.michael-simons.eu, a Sinatra based application written in Ruby. Its main purpose for me is to keep track of my milage in 2009. Although the application is completely self containing it has some nice features: Simple setup The application is simple and i didn’t want to use a “big” database like PostgreSQL or […]
By default, Rubys heredocs are interpreted as double-quoted strings, that is #{something} is evaluated, \r turns into newline and so forth. You can change this behaviour by single quoting the heredoc identifier like so: s = <<-‘SINGLE_QUOTED’ #{i’m not interpreted} SINGLE_QUOTEDs = <<-‘SINGLE_QUOTED’ #{i’m not interpreted} SINGLE_QUOTED