Kühl, der Export von Unity zu Flash macht Fortschritte: im Blog von Unity3D gibt es eine Vorschau, DrawLogic hat auch etwas zum Thema gepostet.
September 07, 2011
Unity and Flash
Kühl, der Export von Unity zu Flash macht Fortschritte: im Blog von Unity3D gibt es eine Vorschau, DrawLogic hat auch etwas zum Thema gepostet.
August 17, 2011
Adobe products and Java make Kaspersky's top 10 security loopholes
March 10, 2011
FB deprecates FBML
November 03, 2010
Why Unity won't suffer from hardware-accelerated Flash
Adobe will deliver hardware-acceleration for 3D for Flash in the first half of 2011. They are going to add a new Adobe Labs-page about this key-feature in the next months.
I read a comment on Gamasutra that this spells trouble for Unity3D next year. I beg to differ, mainly out of three reasons:
First: Market-penetration
Of course Flash has a dominant market-penetration with its installed plug-in base. But new hardware-accelerated features will require the latest Flash-plugin (probably version 11). Moreover, Unity seems to have a different approach to its plugin-architecture: more logic seems to be inside compiled code, rather than in the plugin itself; the upgrade from Unity 2.6 to 3.0 did not require any new plugin installation. Furthermore, Unity also caters to the gaming-console-market.
Second: Unity is focussed
Flash is a great all-round-tool, while Unity concentrates on 3D-media and -games. Flash is capable of a lot more, but Unity is better at the things its meant for. Just compare the working-metaphors of Flash and Unity: since the advent of AS3, the mode of operation for Flash changed more and more to "do everything in code" (especially when working with Flex). Unity uses a lot of drag & drop and so-called "exposed properties", which accelerates many production steps.
Third: the production-pipeline counts
Integrating a good production-pipeline is crucial for working with 3D and games. Unity has the edge over Flash here: you simply drop more or less any file-format into your working folder and it immediately becomes usable in Unity. That's a huge difference to the hoops you need to jump through to import complex 3D-assets into one of the large 3D-engines for Flash like Away, Sandy etc. I have written VRML-parsers myself for Sandy and Away in the past years, switching to Unity was a real eye-opener for me.
Warum hadwarebeschleunigtes Flash keine Konkurrenz für Unity ist
In der ersten Hälfte 2011 gönnt Adobe Flash endlich Hardwarebeschleunigung für 3D. In den nächsten Monaten wird es für diese Funktionalität einen neuen Adobe-Labs Bereich geben.
In einem Bericht von Gamasutra las ich den Kommentar, daß Unity sich im nächsten Jahr einigen Schwierigkeiten gegenübersehen wird. Ich sehe das anders, und zwar aus drei Gründen:
Erstens: Marktdurchdringung
Sicher hat Flash gegenüber Unity einen gewaltigen Vorsprung was seine Plugin-Marktdurchdringung angeht. Aber für die neuen 3D-Hardware-Fähigkeiten wird man den neuesten Flash-Player (vermutlich Version 11) benötigen. Zudem: Unity hat offenbar eine andere Philosophie bei seinem Plugin als Adobe -- es scheint mehr Logik im kompilierten Code als im Player zu stecken; so war z.B. beim Umstieg auf das brandneue Unity 3 kein Plugin-Upgrade nötig. Außerdem eröffnet Unity Zugang zum Marktsegment der Konsolenspiele.
Zweitens: Unity ist fokussierter
Flash ist ein Allround-Tool, Unity konzentriert sich auf 3D-Medien und Spiele. Sicher "kann" Flash mehr, aber Unity ist besser in den Dingen, für die es gedacht ist. Das zeigt sich für mich z.B. in der Arbeitsmetapher: seit dem Umstieg auf AS3 ging die Arbeitsweise von Flash immer mehr dazu über, alles durch Programmierung zu lösen (vor allem wenn man mit Flex arbeitet). Bei Unity kommen Drag & Drop und "Exposed Properties" zum Einsatz. Damit lassen sich einfache Arbeitsschritte sehr schnell erledigen.
Drittens: die Produktions-Pipeline zählt
Der Einsatz von 3D hängt stark von der Qualität der Integration der Produktions-Pipeline ab -- und hier hat Unity eindeutig die Nase vorn: man kann ein (fast) beliebiges 3D-Objekt in den Projektordner ziehen und dieses steht dann in Unity zur Verfügung; ein Riesenunterschied zu den Problemen hat, aufwendigere Objekte in einer der gängigen 3D-Flash-Engines (Away3D und Konsorten) zu verwenden. Ich habe in den vergangenen Jahren selber VRML-Parser für Sandy und Away geschrieben. Der Umstieg auf Unity war da ein echter Augenöffner.
June 30, 2009
Let's make the Web faster
Another piece I've nearly missed: Google runs a special page dedicated to "make the web faster", a topic which I find pretty important -- so check out the link, please.
Treten wir auf's Gas
Das hier ist wieder einmal etwas, das mir fast entgangen wäre: Google hat eine Aktionsseite zum Thema "Laßt uns das Web beschleunigen" -- eine wichtige Angelegenheit, wie ich finde, deshalb hier der Link. Schaut mal rein.
April 09, 2009
Ga.js
April 24, 2008
Memos from my desk
Greensock's TweenMax
I stumbled upon the AS2-version TweenLite when looking for a lightweight animation-framework for Flash-banners. The revamped, bigger brother written in AS3 for me even outbeats the ubiquitous Fuse.
Yahoo's Astra Components
You probably heard this earlier than me, but Yahoo's Dev Network offers some really helpful components for Flash 9, like charts and various menu-UIs.
Grant Skinner's Memory Gauge
Memory management in Flash is a mess -- the excellent gBlog offers a simple component which monitors framerate and memory-allocation through drag & drop. Nifty! I was looking for something similar for quite a while.
Arbeitsnotizen
Ich ersticke mal wieder in Arbeit, wie üblich, daher komme ich regelmäßig nicht zum bloggen, wie üblich... ;) Den neuesten Stand meines derzeitigen Projektes gibt es unter Coobico.com. Ich bin mittlerweile auf Actionscript 3 umgestiegen und möchte ein paar nützliche Links für Adobes aktuelle Flash-Version vorstellen:
Greensock's TweenMax
Auf die AS2-Version TweenLite bin ich gestoßen, während ich nach einem kleinen Animationsframework für die Arbeit an Flash-Bannern suchte. Der größere, in AS3 umgesetzte, Bruder ist für mich mittlerweile sogar besser als das allgegenwärtige Fuse.
Yahoo's Astra Components
Ich habe davon vermutlich wieder als letzter erfahren: das Yahoo Entwicklernetzwerk hat eine Menge sehr nützlicher Komponenten für Flash 9 veröffentlicht. Astra umfaßt Charts und verschiedene Menü-UIs.
Grant Skinner's Memory Gauge
Memory management in Flash ist eine schwierige Angelegenheit -- das exzellente gBlog hat kürzlich eine einfache Komponente veröffentlicht, die per Drag & Drop Framerate und Speicherauslastung überwacht. Sehr nett, nach so etwas habe ich bereits seit einer Weile gesucht.
:) <- Lutz
February 16, 2008
Release 6 of Drupal
After building quite a few websites with Drupal, I am personally not shilling too much for it any more. Don't get me wrong here, Drupal is great with all its networking features and homebrew-plugins; but I eventually grew annoyed of two of its characteristics:
First, I don't like Drupal's on-site administration. An admin-area is not supposed to be handled in the same space like the website it dishes out, in my opinion.
Second, and rather unnerving to me is the code Drupal produces, which is cluttered with unnecessary mark-up (like div's) wrapping each and all of its contents. The bottom line is, I found myself writing preg_replace functions to strip undesirable pre-formatted contents from most designs.
After working with CMSs for about two years, my light-bulb moment was finding that each CMS has its own philosophy; Drupal's approach then to me is, you only need a few clicks and you already got a (pre-formatted) site. While this is useful in some situations, it's counter-productive in others. A CMS with a completely different attitude is ExpressionEngine, which I'm using quite a lot at the moment (I'm building Coobico with EE, for example). EE's unique strength is that nothing is preset by default. You need to build every detail yourself, giving you unmatched control.
There is nothing else to it but to keep yourself familiar with two or three different CMSs for different specifications, I guess.
Drupal 6
Das brandneue Drupal 6 steht seit ein paar Tagen zum Download bereit. Hier ist ein Screencast, der alle Neuheiten vorstellt, insbesondere eine vereinfachte Installation, Administrieren durch benutzerfreundliches Drag & Drop, und vor allem: Unsterstützung von OpenID (das echte Killer-Feature für mich).
Nachdem ich bereits ein paar auf Drupal basierende Websites gebaut habe, bin ich allerdings kein echter Drupal-Fanboy mehr; Drupal ist schon klasse, wenn es um Community-Websites oder die Auswahl selbstgebastelter Plug-Ins geht. Aber zwei Umstände ärgern mich bei Drupal:
Erstens: die Administration erfolgt bei Drupal im selben Website-Umfeld und im selben Design, wie die Seite, die es betreibt. Das Endprodukt eines CMS und sein Admin-Bereich gehören getrennt, meiner Meinung nach. Und zweitens: der Code, den Drupal produziert, ist überfrachtet mit unnötigem Mark-Up -- jeder Inhaltsblock wird z.B. in div's verpackt. Im Endeffekt musste ich für fast jedes Design eine Preg_Replace-Funktion schreiben, um unerwünschte Gestaltungselemente los zu werden.
Mein Aha-Erlebnis nach etwa 2 Jahren Arbeit mit CMS war, daß jedes CMS auf einer eigenen Philosophie fußt. Die von Drupal ist meiner Meinung nach, daß man mit wenigen Klicks eine lauffähige (vorformatierte) Website aufsetzen kann. Das kann nützlich aber auch kontraproduktiv sein.
Ein CMS mit einem radikal anderen Ansatz ist ExpressionEngine, welches ich zur Zeit sehr häufig einsetze, z.B. auch beim Aufbau von Coobico. Bei EE wird bewußt auf alle vorgefertigten Bauteile verzichtet, es muß alles von der Pike auf selber geschrieben werden. Dies verleiht eine unerreichte Kontrolle über das Endergebnis.
Es bleibt einem wohl nichts anderes übrig, als sich mit mehreren CMS für unterschiedliche Anforderungen vertraut zu machen.
:) <- Lutz
May 26, 2006
Bye bye embed

Software patents are evil. To some extent they are not being used to protect intellectual property at all, but as a mere cash-cow. They block innovation and limit user-experience. The latest case of such practice with impact on my own work is a patent on embedding multimedia-objects such as Flash into a webpage.
Read more...
Embed wiedergesehen
Software-Patente sind böse. Sie dienen vielen Inhabern nicht als Schutz geistigen Eigentums, sondern nur dazu, Konkurrenten abzumelken. Sie bremsen Innovation und stören die optimale Nutzbarkeit für User. Der neueste Fall eines solchen Patentes, das auch meine eigene Arbeit beeinträchtigt, wurde auf das Einbinden von Multimedia-Objekten (wie z.B. Flash) in Websites angemeldet.
Mehr davon...
The story started out already in February. Wikipedia has the long version:
"Eolas is a United States company and patent licensee. It was founded in 1994 by Dr. Michael David Doyle. His UCSF team has claimed to have created the first web browser that supported plugins. They demonstrated it at Xerox PARC, in November 1993, at the second Bay Area SIGWEB meeting. The claim has been contested by Perry Pei-Yuan Wei, developer of the earlier Viola browser, a claim supported by Sir Tim Berners-Lee and other Web developers.
Patent 5,838,906, titled "Distributed hypermedia method for automatically invoking external application providing interaction and display of embedded objects within a hypermedia document," was filed on October 17, 1994 and granted on November 17, 1998.
In 1999 Eolas filed suit in the US District Court for the Northern District of Illinois against Microsoft over validity and use of the patent. Eolas won the initial case in August 2003 and was awarded damages of $521m from Microsoft for infringement. The District Court reaffirmed its decision in January 2004."
Due to this patent, plug-ins embedded via embed, applet and object will not be interactive unless the user clicked unto them first (and received an irritating message). At the moment only IE is being affected.
If you don't mind using Javascript, then you can use a workaround (find details here and here) to embed your plug-ins via script, thus avoiding the patent ruling.
I initially read about a similar method to embed flash-objects through Javascript at Macromedia's devnet articles before. At that time I disapproved on that method, cause the only argument for it seemingly was that it looked more "clean" than the original embed-code. But now I'm going to use this kind of embedding too... :P
Die Geschichte ereignete sich bereits im Februar. Wikipedia hat eine längere Abhandlung:
"Eolas ist ein US-amerikanisches Unternehmen, welches vor allem durch Patentstreitigkeiten Berühmtheit erlangte.
Eolas wurde 1994 von Dr. Michael David Doyle gegründet. Doyles Team an der Universität Californien (San Francisco) programmierte den ersten Webbrowser, der Plugins unterstützte. Im November 1993 führten sie diese Funktion erstmals vor. Dieser Anspruch wird von Pei Wei, Entwickler des Browsers Viola angezweifelt. Dabei erhält er Rückendeckung von Tim Berners-Lee und anderen wesentlich an der Entwicklung des Webs beteiligten Größen.
Zur Zeit liegt Eolas mit Microsoft im Streit. Dabei geht es vor allem um die Gültigkeit, aber auch um die Nutzung des Patents im Internet Explorer. Nach einem Urteil von 2003 musste Microsoft 512 Millionen Dollar an Eolas zahlen; im Oktober 2003 schlug Microsoft vor, den Internet Explorer und die enthaltene Technik zu ändern, um Lizenzzahlungen an Eolas zu umgehen."
Durch dieses Patent werden Plugins, die mit embed, applet oder object eingebunden wurden, nun erst dann interaktiv, nachdem sie einmal angeklickt wurden (und dem User eine nervige Meldung beschert haben). Z.Zt ist allerdings nur der IE betroffen. Wer sich nicht daran stört, Javascript zu verwenden, kann dieses benutzen, um solche Plugins zu integrieren (mehr über die Methode hier und hier). Dadurch wird die Patentbestimmung umgangen.
Ich habe bereits vorher in einem Macromedia-Entwickler-Artikel über eine ähnliche Methode gelesen. Zu dem Zeitpunkt habe ich sie allerdings verworfen, denn als Argument dafür konnte der Entwickler nur anführen, daß der Code übersichtlicher aussieht. Nun werde ich diese Technik wohl auf einsetzen (müssen)...
:P <- Lutz
December 21, 2005
Rails rolling on X

This will probably be the last Mac-related entry for a while, as I'm switching to Windows at the moment (maybe I'm going back to Apple, when all the Intel-issues are settled).
I want to describe the process of installing Ruby on Mac OS X, because I found surprisingly few materials on the topic.
Read more...
Ruby läuft auf X
Das hier ist der vorläufig letzte Eintrag von meinem und über meinen Mac. Ich steige gerade auf Windows um (vielleicht kehre ich zu Apple zurück, wenn sich alle Intel-Angelegenheiten eingerenkt haben).
Ich möchte ein wenig über Ruby auf dem MAc schreiben. Ich habe erstaunlich wenig Material über die Installation unter OS X im Internet gefunden.
Mehr davon...
I delved a little bit deeper into ruby lately and found it quite elegant--I was marvelling at the lean syntax. Especially when it comes to the equivalent of--let's say--for...in-loops, or the security concept of user input. I'm sure you heard about the developer's framework Ruby on Rails--now this really lives up to the hype.
Being developed by the lead programmer of 37signals, this enabled him to write an application like Basecamp in mere 2 months single-handedly (seeing is believing: check out this video).
Even though Ruby is getting some support lately in Germany--alas, most service providers will not offer Ruby at the given time. I have some webspace at Host Europe, who are supporting Ruby--but only a very old version 1.6.2, blank without embedded Ruby or anything (I guess they will only upgrade when updating their Linux-servers).
You will need the following stuff for an installation: OS X 10.3.x and Xcode Tools for compiling (should be on your Mac Software CD), Ruby source and Rubygems (a handy tool to manage third party Ruby-plugins). There are precompiled Ruby-binaries, but they didn't work on my machine, dunno...
Windows-users should check out Instant Rails, a drag-and-drop Ruby-Rails-Apache-MySQL solution, all preconfigured and ready to run.
You may want to consider downloading the MySQL/Ruby API Module, which allows Ruby scripts to talk with a MySQL Database.
Compiling
Open the Terminal and hop into the folder where the Ruby source resides (by typing cd and the path). I'd propose you choose the folder /usr/local to compile into. This leaves your original Apple-installed Ruby untouched. Type in the following command:
./configure --prefix=/usr/localThat was it already. You can check over by typing the following:
make
sudo make install
/usr/local/bin/ruby -vAnd you should see something like this:
ruby 1.8.2 (2004-12-25) [powerpc-darwin7.8.0]Now we just need to set our shell’s path environment variable so that it will call the new version of Ruby first, rather than the Apple-distributed version. Use a text editor to create or edit a hidden file in our home folder named .bash_login (note the preceding “.”). Enter the following two lines into the file:
PATH="/usr/local/bin:/usr/local/sbin:~/bin:$PATH"Now close our existing Terminal window and open a new one in order to “refresh” the newly set path. In the new window, type the following line:
export PATH
ruby -vIf you see something else than in the first run – namely an older version (say 1.6.8), we haven’t set our path correctly. This is important for the next steps, so make sure it’s right.
Rubygems
Type in the following lines into the Terminal to install Rubygems:
tar xzvf rubygems-0.8.8.tgzNow you should get a message reporting that you have successfully built Rubygem. Type gem -v at the prompt to check over.
cd rubygems-0.8.8
sudo ruby setup.rb
Rails
Thanks to Gems, installing Rails is even easier:
sudo gem install railsAnswer yes by typing “Y” when prompted to all of the dependencies it asks about.
That it already, we have a working Ruby distribution now. But hey, it's slow! Well, as Ruby is a CGI-language that has to be interpreted, Apache needs to start the interpreter every now and then. You can speed up this process by installing FastCGI (download 1, 2, 3).
FastCGI
To untar and install type in the following Terminal-commands:
tar xzvf fcgi-2.4.0.tar.gzNow we need to install the FastCGI bindings for Ruby:
cd fcgi-2.4.0
./configure --prefix=/usr/local
sudo make
sudo make install
tar xzvf ruby-fcgi-0.8.5.tar.gzThen, just to make sure that Rails knows about and can access these libraries, we’ll install them to Rails with Gems:
cd ruby-fcgi-0.8.5
/usr/local/bin/ruby install.rb config --prefix=/usr/local/
ruby install.rb setup
sudo ruby install.rb install
sudo gem install fcgiThe last step in enabling FastCGI under Apache is to compile and install the mod_fastcgi Apache module:
tar xzvf mod_fastcgi-2.4.2.tar.gzOpen up the main apache configuration file located in /etc/httpd/httpd.conf, and add the following lines:
cd mod_fastcgi-2.4.2
apxs -o mod_fastcgi.so -c *.c
sudo apxs -i -a -n fastcgi mod_fastcgi.so
In order to enable FastCGI for the Rails application, edit the .htaccess file in the public folder, and find the line that reads:[IfModule mod_fastcgi.c] [/IfModule]
FastCgiIpcDir /tmp/fcgi_ipc/
AddHandler fastcgi-script .fcgi
RewriteRule ^(.*)$ /dispatch.cgi?$1 [QSA,L]Change it to:
RewriteRule ^(.*)$ /dispatch.fcgi?$1 [QSA,L]Restart Apache with he sudo apachectl graceful command, and we’re up and running with FastCGI.
MySQL/Ruby API
You will very probably want Ruby to talk to MySQL, huh? So let’s install the MySQL/Ruby API now:
tar xzvf mysql-ruby-2.5.2.tar.gzThe previous command expects that our MySQL installation is under /usr/local/mysql. If it’s somewhere else, just specify the location in the command above.
cd mysql-ruby-2.5.2
/usr/local/bin/ruby extconf.rb --with-mysql-dir=/usr/local/mysql
make
Assuming that MySQL is running, we can test the new API before installing it:
ruby -I. ./test.rb hostname username passwordIf that worked, we’re finally ready to install the API:
sudo make installWe can now get a connection to a MySQL server in our Ruby script like this:
require 'mysql'I really recommend Ruby. The language is very easy understandable and consistent. Check out these links, that I bookmarked for myself:
con = Mysql.new(
"myserver.domain.com",
"username",
"password",
"mydatabase"
)
Suggested links
Ruby on Rails
Ruby handbook (en)
Ruby Tutorials
Ruby Application Archive
Ich habe mich in der letzten Zeit ein wenig mit Ruby beschäftigt und fand die Sprache ziemlich elegant -- besonders die sehr schlanke Syntax. Beispielsweise das Ruby-Äquivalent für Loops oder das Sicherheits-Handling von Benutzer-Eingaben ist toll gelöst.
Ihr habt sicherlich auch schon vom Ruby-Entwickler Framework Rails gelesen. Das ist wirklich so gut wie sein Ruf. Es wurde vom Chefprogrammierer von 37signals entwickelt und ermöglichte es ihm, eine Anwendung wie Basecamp alleine in 2 Monaten zu programmieren (schaut euch das mal hier an, falls ihr es nicht glauben könnt).
Obschon der Ruby-Support sich bei deutschen Providern verbessert, wird man wohl im Moment auf den meisten Servern kein Ruby finden. Ich habe meinen Webspace bei Host Europe, die Ruby zwar anbieten, allerdings bur eine sehr veraltete Version 1.6.2 -- blank, ohne embedded Ruby oder so (schätzungsweise wird sich das erst ändern, wenn sie ihre Linux-Distris mal updaten).
Das folgende ist Voraussetzung für die Ruby-Installation: OS X 10.3.x und XCode Tools für das Kompilieren (findet sich auf der Mac Software CD), Ruby source und Rubygems (ein nützliches Tool, um Drittanbieter-Module für Ruby zu verwalten). es gibt auch vorkompilierte Rubydistributionen, bei mir liefen die allerdings nicht...
Besonders Windows-User können sich mal Instant Rails anschauen, eine komplett vorkonfigurierte Ruby-Rails-Apache-MySQL-Lösung.
Ausserdem solltet ihr vielleicht das MySQL/Ruby API Modul herunterladen, damit Ruby nachher auch auf Datenbanken zugreifen kann.
Kompilieren
Jetzt mal den Terminal öffnen und in den Ordner wechseln, in dem die Ruby-source liegt (mit dem Befehl cd und dem Pfadnamen). Ich schlage den Zielordner /usr/local vor. Auf diese Weise bleibt die originale Apple-Ruby-Distribution unangetastet. Folgende Zeilen eintippen:
./configure --prefix=/usr/localDas war es schon. Testen kann man das ganze mit folgendem Kommando:
make
sudo make install
/usr/local/bin/ruby -vMan sollte folgendes quittiert bekommen:
ruby 1.8.2 (2004-12-25) [powerpc-darwin7.8.0]Damit die Shell unser neues Ruby aufruft, statt die alte Apple-Version, müssen wir die "path environment variable" ändern, und zwar in dem versteckten File .bash_login in unserem Root-Verzeichnis. die folgenden 2 Zeilen müssen per Texteditor hinzugefügt werden:
PATH="/usr/local/bin:/usr/local/sbin:~/bin:$PATH"Jetzt schließen wir das Terminal-Fenster und öffnen ein Neues, damit die Variable auch geupdatet wird. Nun mal folgendes Kommando eintippen:
export PATH
ruby -vMan sollte dieselbe Quittierung erhalten, wie vorher. Wenn nicht (z.B. eine ältere Versionnummer), dann ist irgendetwas schiefgelaufen.
Rubygems
Um Rubygems zu installieren, geben wir folgende Kommandozeilen ein:
tar xzvf rubygems-0.8.8.tgzNun sollte eine Erfolgsmeldung auftauchen. Mit dem Befehl gem -v kann man das Ganze nochmal prüfen.
cd rubygems-0.8.8
sudo ruby setup.rb
Rails
Dank Rubygems geht das Installieren von Rails sehr einfach mit:
sudo gem install railsZu den folgenden Fragen immer "Y" angeben. Damit ist die Installation eingentlich abgeschlossen. Aber Moment: das ganze ist ziemlich langsam! Das liegt daran, daß Ruby eine interpretierte Sprache ist. Apache muss jedesmal den Interpreter starten. Dies lässt sich aber glücklicherweise beschleunigen mit FastCGI (download 1, 2, 3).
FastCGI
Folgende Terminal-Kommandos installieren FastCGI:
tar xzvf fcgi-2.4.0.tar.gzUnd nun die FastCGI bindings für Ruby:
cd fcgi-2.4.0
./configure --prefix=/usr/local
sudo make
sudo make install
tar xzvf ruby-fcgi-0.8.5.tar.gzMit folgendem Befehl stellen wir sicher, daß Ruby auch problemlos auf diese Libraries zugreifen kann:
cd ruby-fcgi-0.8.5
/usr/local/bin/ruby install.rb config --prefix=/usr/local/
ruby install.rb setup
sudo ruby install.rb install
sudo gem install fcgiNun muss auch noch das entsprechende Apache Modul installiert und konfiguriert werden:
tar xzvf mod_fastcgi-2.4.2.tar.gzDie Apache-Konfigurationsdatei liegt unter /etc/httpd/httpd.conf. Hier müssen folgende Zeilen eingefügt werden:
cd mod_fastcgi-2.4.2
apxs -o mod_fastcgi.so -c *.c
sudo apxs -i -a -n fastcgi mod_fastcgi.so
Um FastCGI auch für Rails-Anwendungen freizuschalten, muss in der .htaccess-Datei im Ordner Public die folgende Zeile:[IfModule mod_fastcgi.c] [/IfModule]
FastCgiIpcDir /tmp/fcgi_ipc/
AddHandler fastcgi-script .fcgi
RewriteRule ^(.*)$ /dispatch.cgi?$1 [QSA,L]in
RewriteRule ^(.*)$ /dispatch.fcgi?$1 [QSA,L]geändert werden. Jetzt nur noch Apache mit sudo apachectl graceful neustarten.
MySQL/Ruby API
Allerdings soll Ruby ja auch auf MySQL zugreifen können, hm? Also müssen wir noch das Ruby-MySQL Modul installieren:
tar xzvf mysql-ruby-2.5.2.tar.gzWenn MySQL schon läuft, kann man mal folgenden Test machen:
cd mysql-ruby-2.5.2
/usr/local/bin/ruby extconf.rb --with-mysql-dir=/usr/local/mysql
make
ruby -I. ./test.rb hostname username passwordWenn das funktioniert hat, dann einfach installieren mit:
sudo make installRuby greift auf MySQL mit den folgenden Befehlen zu:
require 'mysql'Ich kann Ruby wirklich empfehlen. Hier noch ein paar Links die ich mir selber als Ruby-Lesezeichen angelegt habe...
con = Mysql.new(
"myserver.domain.com",
"username",
"password",
"mydatabase"
)
Ruby on Rails
Ruby handbook (de)
Ruby Tutorials
Ruby Application Archive
:) <- Lutz
November 16, 2005
Apache, MySQL and Darwin (2)

Not much sense in running PHP without a database, huh? Here's a short tutorial to install a MySQL-database on Mac OS X 10.3.x.
Beware: Syntax in MySQL changed a little bit throughout the last versions. I'm talking here about MySQL 4.1.x--there are a lot of older tutorials on the internet that can result in some syntax errors. To be on the safe side, it would be recommendable to download the latest documentation from MySQL's website.
Read more...
Was wäre PHP ohne dazugehörige Datenbank? Hier also eine kurze Anleitung zum Installieren von MySQL und dem Anlegen einer Datenbank unter Mac OS X 10.3.x
Achtung: die Syntax von MySQL hat sich im Verlauf der letzten Versionen ein wenig verändert. Ich beziehe mich hier auf MySQL 4.1.x -- im Netz geistern noch deutlich ältere Anleitungen herum, deren Befolgen in der Bash zu einem Syntax Error führen können. Am besten ihr ladet euch direkt mal die neueste Dokumentation von der MySQL-Website herunter, dann seid ihr auf der sicheren Seite.
Mehr davon...
Install
Let's start by downloading the installer package. There should be a copy on your Mac OS X install-CD Rom, but don't ask me what version...
Run the installer, and the "startup-item package"--this installs MySQL to be started when the computer is booted. You'll also find a preference-pane in the installer-image. Drag and drop it into your library's PreferencePanes-folder, to get a MySQL preference pane in your system preferences (under "others").
After the installation process, we enter the Terminal again. Type in the follow command-line to start-up MySQL:
shell> sudo /Library/StartupItems/MySQLCOM/MySQLCOM startEnter your OS X-admin-password, if necessary. Then press Ctrl-D (not Apple-D!) to leave the shell. Hopefully MySQL should now be initialised -- which actually was not happening in my case. To find out if you were succesfull, just type
topinto your Terminal-bash. With this you request a listing of all running processes. The server is not yet active, if you can't find any MySQL-entry in this list. Another issue could be: the server started, but you get errors like "can't connect to tmp/mysql.sock". Now, this temporary item should be generated automatically when MySQL is booted.
If you experience problems like this, shut down the server with this bash-command:
mysql.server stopThen try the following procedure (again in the bash):
shell> cd /usr/local/mysql shell> sudo ./bin/mysqld_safeNow MySQL should be up and running. You should get the following message:
(Enter your password, if necessary)
(Press Control-Z)
shell> bg
(Press Control-D or enter "exit" to exit the shell)
"Starting mysqld daemon with databases from /usr/local/mysql/data". Try to just type:
mysqland see what happens. You should see the following lines:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.1.15-max
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
Tryout database
With an empty server, we can now proceed to create a new database. At this step you can also enter a new MySQL-admin-password (please don't confuse this with your OS X-admin-password). After entering your MySQL-Monitor in your Terminal (lines start with a "mysql>"), enter the following command:
create database your_name;MySQL should now respond with "Query OK, 1 row affected (0.00 sec)".
Now we are going to grant ourself some generous rights, with the following lines:
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost'This should be accepted with the same message as above. BTW: you can leave the MySQL-Monitor by just typing "quit".
(press return)
IDENTIFIED BY 'chosen_password' WITH GRANT OPTION;
Done. Now you can enter tables into your new database as you see fit. But here it's really recommended to use a tool with a graphic interface. I'm using the freeware-tool Aqua Data Studio. But this can react a little bit moody when it comes to MySQL-queries. Another one would be CocoaMySQL (thanks, Yves, I tried out this one too, very nice and intuitive).
Done? Well, nearly done...
Happily you start your first PHP-database request and end up with such error-message(s):
"Client does not support authentication protocol requested by server; consider upgrading MySQL client"
or
"Error w/ php: mysql_connect(): Client does not support authentication protocol"
At least this happened to me, and it did cost me some hours of troubleshooting. Obviously this is some bug in PHP's MySQL-module. To solve this problem, you need to "reformat" your MySQL-password with the following bash-command
SET PASSWORD FOR user@localhost = OLD_PASSWORD('your_password');Now everything should be smooth...
Related stuff:
MySQL website
MySQL documentation
MySQL password-bug
CocoaMySQL tool
Installieren
Wir fangen an, indem wir uns das Installationspaket von der MySQL-Seite herunterladen. Es gibt sicherlich auch eine Kopie auf der Mac Installations-CD, aber fragt mich bitte nicht, welche Version.
Dann das Installer-package laufen lassen, danach am besten auch "Startup-item package" -- das sorgt dafür, dass MySQL automatisch beim Hochfahren des Rechners auch gestartet wird. In dem Installationspaket findet sich auch ein MySQL-PreferencePane. Wenn man dieses in den PreferencePanes Ordner in der Library zieht, erhält man ein entsprechendes Kontrollfeld in den Systemeinstellungen (ganz unten unter Sonstige).
Wenn ihr das Startup-item installiert habt, geht es mal wieder an den Terminal. Hier nun folgende Kommandozeile eintippen, um MySQL zu initialisieren:
shell> sudo /Library/StartupItems/MySQLCOM/MySQLCOM startu.U. müsst ihr nun euer OS X-Admin-Password eingeben. Danach Ctrl-D (nicht Apfel-D!) drücken, um die Shell zu verlassen. Mit ein bischen Glück fährt MySQL nun hoch -- war bei mir leider nicht so. Falls im Terminal keine weiteren Hinweise über MySQL erscheinen, könnt ihr einfach mal
topim Terminal-bash eintippen. Dann erhaltet ihr eine Liste aller laufenden Prozesse. Wenn hier der MySQL-Prozess nicht aufgeführt wird, läuft der Server noch nicht.
Es kann auch sein, dass der Server zwar hochfährt, aber ihr Fehlermeldungen erhaltet, wie "can't connect to tmp/mysql.sock". Diese temporäre Datei sollte normalerweise beim Starten des Servers automatisch angelegt werden. In beiden obigen Fällen empfehle ich euch folgendes. Fahrt den Server herunter, indem ihr im Bash folgende Zeile eingebt:
mysql.server stopDanach probiert es mal mit folgender Prozedur, wiederum im Bash:
shell> cd /usr/local/mysql shell> sudo ./bin/mysqld_safeNun sollte MySQL aber auf jeden Fall laufen. Quittiert bekommt ihr das mit folgender Zeile: "Starting mysqld daemon with databases from /usr/local/mysql/data". Nun einfach mal
(OS X-Admin-Password eingeben)
(Ctrl-Z drücken)
shell> bg
(Ctrl-D drücken, um die Shell zu verlassen)
mysqleintippen, und schauen was passiert. Wenn alles geklappt hat, solltet ihr folgende Meldung erhalten:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.1.15-max
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
Datenbank ausprobieren
Nun haben wir einen leeren Server, wir fahren also damit fort, mal probehalber eine Datenbank anzulegen. Das ist auch deshalb wichtig, weil ihr auf dem frisch eingerichteten Server noch kein MySQL-Admin-Passwort angegeben habt (bitte nicht verwechseln mit dem OS X-Admin-Passwort).
Innerhalb des MySQL-Monitors (es steht ein "mysql>" am Anfang der Zeile) folgendes Kommando eingeben:
create database datenbank_name;MySQL meldet sich dann zurück mit so etwas wie "Query OK, 1 row affected (0.00 sec)". Nun richten wir einen Admin-Benutzer für diese Datenbank ein, und zwar mit dem folgenden Kommando:
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost'Auch das wird euch wie oben quittiert. Verlassen kann man den MySQL-Monitor übrigens mit einem einfachen "quit".
(Return drücken)
IDENTIFIED BY 'das_neue_passwort' WITH GRANT OPTION;
Fertig -- nun kann man Tabellen in diese Datenbank schreiben. Aber dafür würde ich wirklich das Arbeiten mit einem grafischen Tool empfehlen. Ich benutze das Freeware-Programm Aqua Data Studio. Das kann sich allerdings beim Eingeben von MySQL-Queries ein bischen zickig anstellen. Eine andere Alternative wäre z.B. CocoaMySQL (danke für den Tip, Yves, ich habe mir das mal installiert -- sieht sehr nett und übersichtlich aus).
Fertig? Fast...
Voller Vorfreude lasst ihr nun euer erstes PHP-Datenbank-Script laufen, und erhaltet fassungslos folgende Fehlermeldung(en):
"Client does not support authentication protocol requested by server; consider upgrading MySQL client"
oder aber
"Error w/ php: mysql_connect(): Client does not support authentication protocol"
Bei mir war das jedenfalls so, und hat mich ein paar Stunden Fummelei gekostet. Das ist offensichtlich ein Bug im PHP MySQL-Modul. Lösen lässt sich das, indem ihr das MySQL-Admin-Passwort "umformatiert". Dazu wieder im Terminal-bash in den MySQL-Monitor gehen und folgendes Kommando eingeben:
SET PASSWORD FOR user@localhost = OLD_PASSWORD('mein_passwort');Dann sollte es klappen...
Mehr Links zum Thema:
MySQL website
MySQL documentation
MySQL password-bug
CocoaMySQL tool
:) <- Lutz
November 14, 2005
Apache, MySQL and Darwin (1)

Ever tried to quickly install and configure MySQL on OS X? Then maybe you have experienced one of your first happy moments typing command-lines into your terminal. Agreed, I'm not a programmer-guy, but maybe you'll find this instructions somewhat helpful to get your Apache and MySQL up and running.
Read more...
Apache, MySQL und Darwin (1)
Schonmal versucht, auf die Schnelle MySQL auf OS X zu installieren und zu konfigurieren? Vielleicht war das ja für euch der erste glückliche Moment, den ihr mit eurem Terminal-Programm verbracht habt. Na gut, ich bin selber auch kein Programmierer, aber vielleicht ist die folgende Anleitung eine kleine Hilfe, wenn ihr Apache und MySQL zum Laufen bringen wollt.
Mehr davon...
Boot Apache and PHP
No need to install Apache on a Mac, you already got 2 distributions on your machine. Unfortunately, folder-structures on Darwin a bit "different", so the usual tutorials are not helpful. This one is for OS X 10.3x.
Apache is pre-installed but deactivated. To boot the server, you got to edit httpd.conf. This file is placed in one of the "hidden" folders--these folders can be made visible with a tool such as Cocktail with a single click. You'll find the httpd-file in the folder /etc/httpd/. Please make sure to first backup the file. Then find the lines
#AddHandler cgi-script .cgiand delete the #, now save. Apache is now ready to be started. We need a single command-line in the terminal-bash to do this. Type in:
#LoadModule php4_module
#AddModule mod_php4
sudo apachectl gracefulEventually bash will ask you to enter your OS X admin-password to execute the command. Then (hopefully) Apache is booted, and you'll receive some information about that. Now you can run PHP-scripts. They need to be located in your folder /Library/Web-Server/Documents, to be found under 127.0.0.1/ or localhost/ with your favorite browser.
If you want to run a self-test for PHP, enter these lines into a texteditor
and save them in /Web-Server/Documents/ (for example as info.php). Open a browser, type in 127.0.0.1/info.php, enjoy...
<?php
phpinfo();
?>
Globals on
Maybe you want to set register_globals = on in PHP? This is often a prerequisite for older scripts. But beware: there is a reason why register_globals are off in newer PHP-versions. They can pose a security-threat.
Darwin has no regular php.ini like on a PC. We need to care about this in httpd.conf again. Scroll to the end and enter the following lines, then save.
<IfModule mod_php4.c>
php_admin_flag register_globals on
</IfModule>
Apache und PHP starten
Apache braucht man auf dem Mac nicht zu installieren, es sind breits 2 Distributionen aufgespielt. Leider sind die Verzeichnisse in Darwin ein bischen "anders", deshalb sind herkömmliche Konfigurationsanleitungen hier wenig hilfreich. Diese hier gelten für OS X 10.3x.
Apache ist zwar vorhanden, per Voreinstellung aber abgeschaltet. Um den Server zu starten, muss die httpd.conf-Datei editiert werden. Die liegt in einem der "versteckten" Ordner -- zunächst mal muss man also diese Dateien sichtbar machen (kann man z.B. mit Cocktail oder einem anderen Dienstprogramm per Knopfdruck erledigen). Die httpd-Datei liegt im Ordner /etc/httpd. Am besten macht ihr erstmal eine Sicherheitskopie davon. Danach muss in den folgenden Zeilen das # gelöscht werden:
#AddHandler cgi-script .cgiDann die Datei abspeichern. Jetzt können wir den Apache-Server starten, dazu müssen wir eine Kommandozeile im Terminal-Bash eintippen. Den Terminal findet ihr unter Programme/Dienstprogramme. Im entsprechenden Eingabefenster folgende Zeile eingeben:
#LoadModule php4_module
#AddModule mod_php4
sudo apachectl gracefulUnter Umständen müsst ihr euer OS X-Admin-Password eingeben, bevor der Befehl ausgeführt wird. Dann bekommt ihr (hoffentlich) das Hochfahren des Servers quittiert. Das war es schon, nun können PHP-Scripte ausgeführt werden. Diese müssen im Ordner /Library/Web-Server/Documents/ abgelegt werden und lassen sich im Browser mit eurer localhost-Adresse aufrufen: 127.0.0.1/ oder localhost/.
PHP lässt sich am besten mit der folgenden kleinen Datei testen:
Diese Zeilen in einen Texteditor einfügen, in reinen Text umwandeln und dann im Verzeichnis /Web-Server/Documents abspeichern (z.B. als info.php). Browser öffnen, 127.0.0.1/info.php eintippen und freuen.
<?php
phpinfo();
?>
Globals On
Vielleicht möchtet ihr die register_globals in PHP einschalten? Besonders für ältere Skripte müssen diese z.B. aktiviert sein. Aber Achtung: es gibt einen Grund, warum die register_globals in neuen PHP-Distributionen abgeschaltet sind -- sie stellen ein potentielles Sicherheitsrisiko dar.
Da es in Darwin keine reguläre php.ini wie auf dem PC gibt, müssen wir nochmal die httpd.conf aufrufen und ändern. Einfach am Ende folgende Zeilen anfügen und dann abspeichern.
<IfModule mod_php4.c>
php_admin_flag register_globals on
</IfModule>
:) <- Lutz
October 20, 2005
Ajax is soo nice ... or is it?

Ajax gets so hyped these days, one could start to think it can heal cancer. Admittedly I'm also a big fan since I ever saw what Google did with this stuff. But Dion Hinchcliff lately posted a very interesting and critical article why there could be better solutions to the existing methods.
Read more...
Ajax ist schön ... oder nicht?
In letzter Zeit wird Ajax dermaßen hochgejubelt, man könnte meinen, dass man damit Krebs heilen kann. Zugegeben -- ich bin auch ein großer Fan, seit ich zum ersten Mal gesehen habe, was Google so mit Ajax angestellt hat. Aber Dion Hinchcliff hat kürzlich einen sehr interessanten und kritischen Artikel darüber geschrieben, welche Dinge bei Ajax zu verbessern wären.
Mehr davon...
In short Don states the following:
1) Ajax and XML, A Match Made by Acronym - Ajax and XML actually aren't necessary for Ajax. Ajax actually prefers JSON--the JavaScript Object Notation. It's a much better way to transfer and parse data over lightweight HTTP services.
2) Ajax Is Faster Than A Wet Dog - In reality, JavaScript these days is mind-bogglingly, scorchingly fast. This means incredible and/or extremely stupid JavaScript tricks can be done to amaze and impress your web site's venture capital investors visitors in the Web client. Or issue thousands and thousands of HTTP requests per second to your unlucky server if you aren't very careful. Either way, lots of people will notice. Use the power wisely.
3) Never, Ever Forget That The Web Is A Real Jungle - HTML is the lowest common denominator, not JavaScript, not XmlHttpRequest, not XML/XSLT.
4) Web 2.0 and Ajax Are Not The Same Thing. Web 2.0 is about collaboration, information sharing, ad hoc enrichment and participation mechanisms. Ajax is a set of technical approaches. Don't mix them.
Um es kurz wiederzugeben:
1) Das XML in Ajax macht den Namen so schön rund. Ajax und XML sind nicht wirklich nötig füreinander. Ajax bevorzugt eher JSON -- Javascript Object Notation. Sehr viel besser für zügige HTTP Datenübertragungen.
2) Ajax ist blitzschnell. Javascript ist heutzutage wirklich extrem schnell. So schnell das man damit beeindruckende Tricks vor den Augen von geldbewährten Kunden machen kann -- oder mit tausenden und abertausenden HTTP-Requests einen Server lahmlegen. Aufgepasst!
3) Vergiss niemals, dass das Web ein echter Dschungel ist -- HTML ist der niedrigste gemeinsame Nenner, nicht JavaScript, oder XML, oder XSLT.
4) Web 2.0 und Ajax sind nicht dasselbe, nicht vergessen! Web 2.0 steht für Zusammenarbeit und das gemeinsame Nutzen von Informationen. Ajax ist eine Sammlung technidcher Lösungen.
:) <- Lutz