|
Posts Tagged ‘programming’
Monday, December 3rd, 2007 by Alexander Lang
Tags: implementation-patterns, patterns, programming, ruby Posted in Uncategorized | 4 Comments »
Sunday, August 26th, 2007 by Thilo Utke
I’m currently read the Ruby Cookbook and found a good explanation for duck typing. You know, the concept to treat objects according to their methods rather their classes/modules. It might be well known to you, but i like to share it anyway.
Duck Typing means:
“… if an object quaks like a duck, just go ahead and treat it like a duck”
Tags: book, duck-typing, mnemonic, programming, ruby Posted in Uncategorized | 1 Comment »
Saturday, July 28th, 2007 by Alexander Lang
I started reading the book Programming Erlang and while I read I blog along what I find most interesting/important. In the end, this will hopefully be some kind of erlang tutorial, for your pleasure and my reference. I also started creating an Erlang Cheat Sheet with all the syntax on it. Here are the previous posts and now comes the third:
funs
Funs are anonymous functions. Funs can be assigned to variables and, more importantly, passed as arguments into functions and also be returned by functions – these would be called higher order functions.
1> Double = fun(X) -> X * 2 end.
2> Double(2).
4
(more…)
Tags: erlang, programming, programming-erlang, tutorial Posted in Uncategorized | 1 Comment »
Tuesday, July 24th, 2007 by Alexander Lang
I started reading the book Programming Erlang and while I read I blog along what I find most interesting/important. In the end, this will hopefully be some kind of erlang tutorial, for your pleasure and my reference Here’s the first post and now comes the second:
Yesterday I started reading the next chapter called “Sequential Programming”. It actually is about functional programming: functions, anonymous functions, higher order functions, predicates, pattern matching for calling functions a.s.o. – I had to read most of it twice to actually understand it and haven’t even finished the chapter yet. Anyway, let’s start. By the way I started creating an Erlang Cheat Sheet with all the syntax on it. Being used to the very clear Ruby syntax, things started to get a bit confusing in this chapter.
(more…)
Tags: erlang, programming, programming-erlang, tutorial Posted in Uncategorized | 19 Comments »
Sunday, July 22nd, 2007 by Alexander Lang
I just started reading the latest book from the pragmatic programmers: Programming Erlang. In this series of articles, I’m going to summarize and comment on every chapter I read. Enjoy. (The reason I’m doing this in English is that I simply feel like writing some English again and that I hope to reach a larger audience )
What is Erlang and why read that book?
Erlang is a programming language which has things like parallel processing and functional programming features built right into the language. Software written in Erlang is therefore supposed to utilize the power of multi core processors found in today’s and future computers much better than software written in … my precious Ruby? omg.
Anyway, Erlang seems to be a language with features completely different from what I’ve seen before, so that’s my main reason to start reading about it, and we’re supposed to learn a new new language every year anyway. Let’s get started.
(more…)
Tags: book, erlang, programming, programming-erlang, tutorial Posted in Uncategorized | 10 Comments »
Saturday, March 31st, 2007 by Alexander Lang

Ich bin in den vergangen Tagen über mehrere Blogeinträge gestolpert, die sich mit dem Thema Farben in Unit Tests (also , bei deren Ausführung) beschäftigt haben. RedGreen ist etwas unelegant, da man statt einfach rake einzutippen rake | redgreen schreiben muss.
Mit diesem kleinen Patch und dem colored Gem geht dann doch alles vollautomatisch. Toll.
Update: gerade ist mir aufgefallen, dass die Tests, wenn man sie innerhalb von TextMate ausführt, recht unansehnlich werden, da TextMate die entsprechenden Codes plain ausgibt, statt die Schrift farbig werden zu lassen. Bisher hatte ich oben genannten Patch in eine Datei colorized_tests.rb gepackt und diese mittels require File.expand_path(File.dirname(__FILE__) + '/colorized_tests')am Ende von test_helper.rb eingebunden. Um die Farbcodes in TextMate abzustellen, habe ich noch ein unless ENV["TM_PROJECT_DIRECTORY"] dahintergehangen. Jetzt sehen die in TextMate ausgeführten Tests wieder wie gewohnt aus, und bei rake gibt’s trotzdem Farben. Cool.
Tags: color, colored, green, programming, rails, red, redgreen, testing, textmate Posted in Uncategorized | No Comments »
Wednesday, February 21st, 2007 by Alexander Lang
We are just migrating one of our projects from Rails 1.1.6 to 1.2.2. One of the problems we encountered was, that Recipe 44: Write tests for your helpers from Rails Recipes (by the way Advanced Rails Recipes will come out in Augut 2007) is not working anymore. The line
@controller.send :initialize_current_url
resulted in a
can’t clone NilClass
After some messing around, we found out that the following setup method solves this:
def setup
@controller = MyController.new
request = ActionController::TestRequest.new
@controller.instance_eval { @url = ActionController::UrlRewriter.new(request, {}) }
@response = ActionController::TestResponse.new
end
Happy testing
Tags: helpers, programming, rails, rails-1.2, test, testing, tests, unit-tests Posted in Uncategorized | 5 Comments »
|
|