Every programmer should learn a new programming language once in a while. Be it for inspiration or just for fun. After some homework in C# some years ago and quite some Java at university (again), Python was my language of choice. This is the first article in a series I plan to write about what I like in Python, what is disturbing but works out and what is really evil. In this article I give a short overview on my motivation to dig into Python and start with a first topic: The missing braces. [Read full post…]
phpDocumentor for VIM (PDV) is a project which resulted from my efforts to create a comfortable programming environment for PHP in the VIM editor. Since the server which hosted the SVN repository is to be switched off the next days, I finally moved development over to github.In addition to that, I seized the chance to rename the project itself to VIP (VIM integration for PHP). The repository does not only contain the PDV script iself, but also a filetype plugin for PHP, some useful color schemes, a PHP skeleton file, settings for other (related?) programming languages and more. [Read full post…]
I recently had the problem that I wanted to retrieve the smallest items from a stream of data. When talking about a stream here, I refer to a data set that I do not want to load into memory completely, since it has quite a few elements. The best way to process such data is a stream approach, where you work always on a single item at a time, iteratively, without loading the full data set.In my special case, I had a database with 140,000 records. The processing of these records could not happen in the DB, since I needed to create vectors from text and perform calculation on these. Basically, I needed to check each vectors distance to a reference vector and keep only the k closest ones.So, what is a good approach to solve such a task? I decided to implement a custom data structure based on a max heap to solve the problem. In this article, I present the solution and compare it to two different other approaches in terms of a small benchmark. [Read full post…]
Attention: This blog post is in German, due to the fact, that the book is also in German. In short: Kores and my book about eZ Components can now completely be found online, for free. Das von Kore und mir verfasste eZ Components Buch, gibt es jetzt als Open Book komplett online zu lesen. [Read full post…]
Ilia recently brought up the topic of scalar type hints again. I would love scalar type hints, but a sensible implementation is not easy. I summarize some approaches in this post and talk about the problems they raise. [Read full post…]
Derick was always bitching at me when doing releases for the huge amount of time needed to process the Webdav components sub directory. We always supposed, that the Subversion performance issues here resulted from the Webdav test suite, which consists of an awful lot of small test files and some sub-directories. I finally found the time to refactor the tests and the performance improvement is astonishing. [Read full post…]
At this weeks IPC, I attended the talk "Framework? No thank you, I will use my own!". In this article I take up my controversal thesis, that it might be wise to create your own framework, and explain my view in detail. In addition, I analyze, what a framework actually is and how it is typically seen in the PHP world. Do you use an OSS framework? Or did you build your own? [Read full post…]
Since version 5.3 PHP supports the GOTO statement. While this statement is useful to solve daily programming tasks like implementing finite state machines, it has some serious drawbacks against other programming languages that support the structured programming paradigm. Therefore the PHP core developers decided with one voice to enhance the language by a GOSUB statement. [Read full post…]
Last year, Jakob and me had to write an elaboration about XPath. This one should enable the members of our university project group to get into the general XML topic and to use XPath and related technologies during the project. This document is the result of our work and represents a comprehensive tutorial on XPath.XPath is the standard language for addressing parts of XML documents. This document gives a comprehensive introduction into and an overview on XPath. Starting with the XML tree model, different ways of addressing are explained. A dedicated chapter describes the possible addressing axis, their meaning and usage. A rough overview on important XPath functions and how to use functions in XPath in general is given. The last chapter concludes with a practical use case of XPath in XSLT. [Read full post…]
It's interessting to see more people abandoning Ruby on Rails. Not that I have something against Ruby itself, but it really seems to me that RoR does not scale. Hope Twitter tries with PHP. ;) [Read full post…]