The WebKit-rendering plugin for Liferea has received an update in trunk and in the 1.4-branch: I’ve added a hacky version to support zoom, which works well until #14998 has been fixed. If you want to compile the WebKit plugin, use the following configure line:
$ ./configure --disable-gecko --disable-gtkhtml2 --enable-webkit
Filed under GNOME. Liferea, WebKit & two comments & no trackbacks

Garvin Hicking asked me to promote his book featuring Serendipity, the world’s best weblog engine. Garvin is the maintainer of Serendipity and you can assume he didn’t spend less energy in writing this book as in coding Serendipity. So it must be worth buying it.
So preorder now!
Full disclosure: I’m using Serendipity, I like this project and maybe I’m getting a copy of this book for free.
Filed under PHP, Serendipity & three comments & no trackbacks
In PHP 5.3 there will be another magic constant __DIR__. Until 5.3 a typical pattern to include files was to do something like this:
[geshi lang=php]The extra dirname()-call will be gratuitous: [geshi lang=php]__DIR__ always references the directory which contains the current file. In case of /var/www/host/app/foo.php the __DIR__ will reference /var/www/host/app.Filed under Magic constant, PHP & 13 comments & no trackbacks
From tomorrow on I’m officially working as a senior software developer for the Media Ventures GmbH. The Media Ventures GmbH has owned the Neu.de GmbH, my former employer. Neu.de was aquired last year by Meetic Corp. for 25 Mio. I wish Meetic all the best with Neu.de.
The good thing is, our team will stick together, even my office stays the same. So no big deal.
It was a unique experience to work on the high-traffic portal Neu.de and the learning curve was so incredible. With our gathered experience we are just building the next big thing. Stay tuned!
Filed under Job, Me, Media Ventures GmbH, Meetic, Neu.de & two comments & no trackbacks
The Zend Framework provides a neat function in its request object called isXmlHttpRequest(). The following is therefore possible:
public function someAction()
{
if ($this->getRequest()->isXmlHttpRequest()) {
// AJAX request specific parts
}
}
Zend_Controller_Request_Http::isXmlHttpRequest() checks internally if the request header X-Requested-With is set to “XMLHttpRequest”. If this condition is fullfilled, the request is considered an XH request. However, Prototype, jQuery and YUI set this request in their XHR abstractions, Dojo does not. The following snippet helps to set this in Dojo:
dojo.xhrGet({
url: <url>,
load: <callback>,
headers: {"X-Requested-With": "XMLHttpRequest"}
});
This stucks the X-Requested-With header into the XMLHttp-request and isXmlHttpRequest() will return bool(true).
Interesting to see that Rails is a bit more generous in what it accepts as an XHR. As this header is a pseudo standard it would be worth doing it exactly the same way as Rails does it. Nothing is worse than a pseudo standard with slightly different implementations.
def xml_http_request?
!(@env['HTTP_X_REQUESTED_WITH'] !~ /XMLHttpRequest/i)
end
The RequestHandlerComponent from CakePHP provides a method isAjax() in the stricter Zend Framework variant. Django, Pylons and TurboGears seem not to provide such helpers.
Filed under AJAX, Django, PHP, Pylons, Ruby On Rails, TurboGears, Zend Framework & four comments & no trackbacks
I’ve read a bit and played around with Scala and Arc recently. I always recommend to learn other languages. Nobody is forced to get productive tomorrow in a language one learns but it always makes you a better programmer. This sounds trivial but I often met programmers who did only Java or only PHP or … you name it. There is nothing wrong with focusing on a language and getting really good at it, but ignorance is wrong. A good programmer always wants to learn, he basically defines himself through his fast ability to adopt new stuff. Everytime I look at different languages outside of my daily scope (which is mostly PHP and C, Ruby and Python for fun), especially on those who look exotic from the first view, I get something better. When I’ve tried to learn Erlang – even I totally failed at really getting it – I looked completely different afterwards at PHP constructs like array_filter(), array_walk() and the general concept of callbacks. When you halfway know both worlds, the functional as well as the object oriented, you just get more effective in applying the adequate methodology to solve an issue.
Back to Scala. Scala comes with a really feature rich object model. It provides classes, a concept well known to those who do Java or C++. Classes and methods may even be abstract. So far nothing new. But Scala provides a language feature so called traits. It addresses the issue that single inheritance is often too limited when it comes to stable (and convenient) compositions while mixins as in Ruby or classical multiple inheritance as in Python induce fragile, hardly maintanable hierarchies. The answer are traits. Traits allow stable compositions. A trait is basically a container for functionality. A class may extend from multiple traits, rename or overrride methods. Think on a debugging functionality – in this case implemented as a debugging trait – which should be used in a number of classes while each class has its own hierarchy. The debugger is than easily composited with the debugging consumer class while the class hierarchy is kept and the composition is stable itself. In PHP we do big wrenches to do composition. We introduce broker components to handle composited objects and what not. Traits are an elegant solution to the problem, a really impressive language construct.
Scala also provides generics. Generics are datatypes that can take other types while keeping type safety. Think you have an array and can enforce it to only accept instances of the class “Foo”. C#, Java and C++ implement that concept for a long time but nevertheless it is really handy.
I’m not really sure, how handy that would be in practice, but Scala enforces to explicitly overrride methods. I have the feeling that after a while one would do “override def method()” with the same implicitness as we do it today. Maybe this feature will be good for teaching object oriented programming.
The general syntax is a best of both worlds, the Java and the Ruby world. It is also possible to reuse existing Java libraries in Ruby, which makes it pretty attractive and lowers the entry barrier as a full stack of libraries are already present.
Arc is the newest baby by Paul Graham, the inventor of the bayesian spamfilter which mildens the pain for everyone of us dealing with email. Graham loves Lisp and it relatives. This is why Arc is very lisp’ish including polish notation for mathematical expressions. Actually the code examples are so incredible short to do a lot of stuff I guess I will try some sort of prototyping with it in the future. The plan is to design Arc to be useful in 100 years. This means time for adoption.
Filed under Arc, Development, Java, OOP, PHP, Python, Ruby, Scala & six comments & no trackbacks
If you provide a search form on your site name the text input field “q”. Why? Just because Google does it too and therefore the search term history of Firefox will work with your site too. Simple stupid but pretty helpful for the user.
Filed under Best practice, Firefox, Google, Search, UI & one comment & no trackbacks