Sebastian Cohnen

my tech-related blog

Ruby Is Magic!

As you might have been noticed already Dirk and I started rubyismagic.de. First it was just a quick idea to give a talk at cologne.rb – the local Ruby User Group here in Cologne. We talked about the seven types of closures in Ruby and we good quite positiv feedback right after the talk. So we decided to make the show a regular one at colognerb. We will take a closer look stuff you see everyday using Ruby, like closures.

For every presentation at colognerb we’ll post an article, the slides and code. Additionally we’ll add some articles in between on subjects that are related to the shows topics.

We hope you have fun reading the first episodes post about Closures in Ruby.

Native List Functions With CouchDB

Show and List Functions are used to transform single documents (show) and multiple documents e.g. from a view (list) into anything you want: JSON, HTML lists, SVG graphs…

You might know that you can write CouchDB Views in Erlang. But you can also write Show and List functions in Erlang as well. Today I played a bit around with a list function I’ve implemented in JavaScript first. I wanted to know, how much faster a native version would be and I wanted to write some Erlang too. I’ve not done any extensive benchmarking, just simple queries, but the difference is quite significant. Writing Erlang - if you aren’t used to it - might be an obstacle though.

Fixing Problems With Iconv and Ruby 1.9.x (Rvm)

Today I had some weird issues with various gems complaining about missing iconv and readline. Here is how I fixed it: Installing the libs via rvm package install, switched to the system ruby (not sure if this is really necessary), remove ruby 1.9.2 (important!) and reinstall it. Before installing the rvm packages I removed any previous trace of them by rm -rf ~/.rvm/usr.

I hope that might be handy for anyone having issues with that too.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env bash
rm -rf ~/.rvm/usr
rvm package install iconv
rvm package install readline
rvm package install zlib
rvm package install autoconf
rvm use system
rvm remove 1.9.2
rvm install 1.9.2 --with-iconv-dir=$rvm_path/usr \
                  --with-readline-dir=$rvm_path/usr \
                  --with-zlib-dir=$rvm_path/usr \
                  --with-openssl-dir=/usr/local
rvm --default 1.9.2
rvm wrapper 1.9.2 textmate

Using Gem Edit via TextMate

The gemedit-gem is very useful if you want to have a quick look at what the lib you are using is doing. I found myself using gem edit some_gem_name quite often, several times a day. Yesterday I thought it would be nice to have a shortcut to open a gem’s code from within TextMate. So I wrote a little TextMate snippet. You can grab it here: https://gist.github.com/703646 (I’ll also update the gist, if I found any bugs/issues).

Wikipedia on CouchDB

This is the first post of a little series I’m planing. It’s about one of my favorite open source projects at the moment: Apache CouchDB. I assume you’ve already heard of the not-so-new player in the NoSQL league and I’m watching the project for quite a while now. Little hint: #couchdb on irc.freenode.net is where you get in touch with the couchers and I’m there most of the day, too.

But what will this little series be about? Short: Play with Wikipedia and CouchDB. I want to give interested people some guidance to CouchDB and working with it. It’s fun, believe me! And why Wikipedia? Because everybody knows it, they have plenty of data to play with and it’s just a perfect match for a document-orientated database like CouchDB. You can keep it simple, just import it, or you go one step further, do benchmarks, see how it performs, add lucene-powered full-text indices, write map/reduce views to analyse Wikipedia’s content… the possibilites are endless and maybe you even create something useful ;)

Hire Me!

I recently finished my studies in computer science at the Cologne University of Applied Sciences, so you may call me master of computer science now *yay!* ;)

Seriously: It feels good to be (finally) finished with this part of my life now. And now?

I’d like to work on your projects!

I’m specialized in Ruby and Rails and other web technology like JavaScript and all the stack down to application servers, caching, messaging services, protocols like HTTP… – you name it. I also have experience in MySQL as well as several NoSQL datastores (especially CouchDB). My master’s thesis was about design patterns for scalable, service-orientated web-architectures — so designing and implementing scalable web-architectures is something I’m familiar with too.

My desk and working place here in Cologne (Germany) is hosted by the mighty Galaxy Cats which are very passionate developers and geeks — just like me. So if you want to get in touch feel free to drop by (Club Mate is on me).

I’m looking forward to hear from you!

CouchDB Shirt Arrived

Have a look what just arrived! :)

CouchDB Shirt

Ordered from the German CouchDB-Spreadshirt. If you want to have other products just ping me (I am managing the products there).

CouchDB-Lucene Console

Really quick, but I wanted to start with an actual useful blogpost (I’ve some more interesting topics in the queue though). So here we go!

I’m playing a lot with CouchDB and CouchDB-Lucene and I was missing something: An easy way to play with queries to c-l, without having to think about proper URL encodings, without having to remember the current/correct URL and syntax for a given index. And so I wrote this little ruby gem called cl-console!