|
Archive for July, 2007
Sunday, July 29th, 2007 by Thilo Utke
Hier also ein weiteres Post zum Thema file_column Hacks.
Vor kurzem mussten wir die Anforderung umsetzen, dass Bilder, die im Netz liegen, wie eine vom Client hochgeladene Datei speichern zu können. Warum wir sowas machen wollen? In diesem Fall, um Daten von einer Anwendung über http nach autoki zu importieren. Dazu gehörten auch Bilder, die über eine URL erreichbar waren.
(more…)
Tags: file_column, hacks, ruby, web Posted in programmieren, rails, ruby | No Comments »
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.
(more…)
Tags: erlang, programming, programming-erlang, tutorial Posted in Uncategorized | No Comments »
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 | 12 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 »
Friday, July 20th, 2007 by Alexander Lang
Tadaaa, weltexklusiv nur für Besucher dieses Blogs, das nagelneue autoki-online-Autoquartett - ab Montag auch für alle anderen, dieses Wochenende nur hier:
Viel Spaß beim Spielen.
Tags: autoki, autoquartett, game, iframe, online, quartett, rails, spiel Posted in Uncategorized | 9 Comments »
Friday, July 20th, 2007 by Alexander Lang
Thilo hat beim letzten Treffen der Berliner Ruby User Group gleich mal einen Buchgutschein für O’Reilly gewonnen und hat sich das Ruby Cookbook ausgesucht. Gestern ist’s angekommen und ich hab gleich mal geblättert. Hier zwei kleine Schätze, die sich auf (fast) zufällig aufgeschlagenen Seiten fanden:
Array.inject
Ich wusste schon lange, dass es diese Methode irgendwo geben musste, nur gefunden hatte ich sie noch nicht. Eine Methode, mit der man aus den Elementen eines Array einen Wert berechnen kann, z.B. die Summe eines Array voller Zahlen. Inject kann genau das, es ruft für jedes Element des Array einen übergebenen Block auf und gibt das Ergebnis an die Berechnung des nächsten Elements.
Es geht auch etwas komplexer, z.B. aus einem Array mit Wertepaaren ein Hash aufbauen:
Wichtig hierbei ist, dass der Block wieder den Hash zurueck gibt, damit die nächste Operation wieder auf dem Hash läuft. Hash.[]= liefert jedenfalls nicht den Hash, sondern den zugewiesenen Wert.
Array.min / Array.max
Irgendwann brauchten wir mal die kleinere von 2 Zahlen. Ich hab ewig in der Doku von FixNum gesucht und nix gefunden und am Ende die eine Zeile selbst implementiert, unzwar für FixNum. Natürlich hatte ich an der falschen Stelle gesucht, denn um die kleinste von zwei oder mehr Zahlen zu finden, kann man einfach einen Array benutzen:
Tags: array, cookbook, hash, inject, ruby Posted in Uncategorized | 2 Comments »
Wednesday, July 18th, 2007 by Thilo Utke
Seit kurzen beunruhigt uns die folgende Fehlermeldung: Mysql::Error: Lost connection to MySQL server during query. Sie tritt immer wieder sporadisch ohne erkennbare Ursache auf. Heute Nacht bin ich eher durch Zufall auf eine Erklärung und idealerweise auch auf eine Lösung des Problems gestoßen.
Kurz zusammengefasst: ActiveRecord verwendet pro Model eine Datenbankverbindung. Wenn die Datenbank unter Last steht, kann es passieren, dass die Verbindung nicht schnell genug bereitgestellt wird und der Lost-Connection-Fehler auftritt.
Über das setzen von ActiveRecord::Base.verification_timeout=14400 oder einen Wert niedriger als die MySql Server interactive_timeout -Einstellung in der environment.rb lässt sich der Timeout heraufsetzen. Um dem Problem nachhaltig zu begegnen, hat Tyler Kovacs von zvents das Pluginmysql_retry_lost_connection geschrieben, das versucht, die Verbindung erneut herzustellen, wenn es einen Timeout gab.
Tags: error, lost-connection, mysql, mysql_retry_lost_connection, plugin, rails Posted in Uncategorized | 2 Comments »
Tuesday, July 3rd, 2007 by Alexander Lang
Ich halte am Donnerstag eine kleine Präsentation zum Thema file_column und Widgets/Banner. Wer hin will: www.rug-b.com bzw. einfach 19:30 Uhr bei /i-d media, Ohlauer Strasse 43, Berlin Kreuzberg. Man sieht sich.
Die Slides gibt’s hier.
Tags: berlin, file_column, praesentation, rails, rmagick, ruby, rug, user-group Posted in Uncategorized | No Comments »
|
|