green&wich

I tried a new restaurant for lunch today to expand the current set of choices. (not everything on there is good) It is called green&wich, located at C/Villaroel and Gran Via, they don’t seem to have a website yet. The location is nice, the space is open to the busy street, the design is minimal and the chairs and tables are a bit wobbly. They have two menus. I went for the 7.90 one, which gives you a salad, a sandwich, drink and a coffee. I had a rocket, tomato and parmesan salad, which was soggy but still had hard stems in it. A pretty awful combination. The “asia” sandwich was ok, but not much better than the packaged ones you get in the supermarket. Barcelona really does need a Pret-A-Manger to show the locals what fresh a sandwich looks like. I had a cortado for coffee, which still contained coffee powder. The search continues…

October 10, 2008 · 1 min · Christof Damian

comparing class syntax in C++, Java, PHP, Perl and Python

As I recently started learning Python one of the things I noticed which I didn’t like is the class syntax. So I wrote some minimal hello world programs in the languages I recently used to show the difference: C++ hello.cc#include class Hello { private: char value; public: Hello(char newvalue) { value = newvalue; } public: void hello() { std::cout « this->value; } }; int main() { Hello hello(“hello\n"); hello.hello(); } I like the C++ syntax, it is the language which introduced me to OOP and it it clearly states what bits are what without too wordy syntax. Java: hello.java class Hello { private String value; public Hello (String newvalue) { this.value = newvalue; } public void hello(){ System.out.println(this.value); } } class main { public static void main(String args[]){ Hello hello = new Hello (“hello”); hello.hello (); } } Also very nice, a bit clearer than C++. PHP: hello.php «/span>?php class Hello { private $value; function __construct($newvalue) { $this->value = $newvalue; } function hello() { echo $this->value; } } $hello = new Hello(“hello\n"); $hello->hello(); From the dynamic languages this one is the clearest. Except of the __construct() constructor, where I prefer the ClassName() syntax (which still works in PHP5) Perl: hello.pl package Hello; sub new { my ($class,$newvalue) = @_; bless { newvalue => $newvalue }, $class; } sub hello { my $this = shift; print $this->{newvalue}; } package main; $main::hello = new Hello(“hello\n"); $main::hello->hello(); I always hated objects (and functions) in Perl, there is no parameter syntax for functions or methods. Most of it is not enforced and you can use functions in objects in thousands different ways. Python: hello.py class Hello: _value = ”" def init(self,newvalue): self._value = newvalue def hello(self): print self._value; hello = Hello(“hello”) hello.hello() A lot clearer than Perl, but also a lot of convention instead of forced syntax. I got used to the indention by now. But I hate that I have to specify “self” as the first parameters, the init syntax and the underscore prefixing of private or protected variables. At least it has proper function parameters.

September 29, 2008 · 2 min · Christof Damian

phpconference.es

I just returned from the Barcelona phpconference.es . It was a small on day conference, with just a few talks and not many big names. It was also really cheap at 20€. The organization was very good, especially for Spain. It was held at citilab in Cornellà Centre, which is at the very end of one of the metro lines. There were two rooms with parallel talks. The talks were all in english, which was a change from the last PHP conference. Wifi was available everywhere and there were free drinks and food. In the morning I got hassled a bit by companies looking for developers, though nothing which convinced me to quit my job yet. I am glad that there are companies like this available in Barcelona though, as they seem to be interested in improving the communitiy through supporting events like this instead of seeing PHP or open source just as the “free beer” option. I enjoyed the talk about PEAR and the one about xdebug. But none of the talks was really advanced and each one was more or less just an introduction to the topic. One thing I noticed was the number of netbooks in use by the attendees. I would say the distribution was 30% netbooks, 40% mac and 30% for the rest. I just bought a Asus Eee PC, which is my first portable computer – but more about this another time. Overall I must say that I am probably not a conference person. I enjoy the talks, but I am not so much av crowd person and probably could get the same information spending a day in front of firefox and youtube. But I will give it a another try next time.

September 27, 2008 · 2 min · Christof Damian

My music podcast selection

This are the music podcasts I am listening too at the moment. It is mostly techno, but also house and some dub. And whatever last.fm thinks I would enjoy. dailysessionhttp://dailysession.com/?feed=podcast DE:BUG POD - a netaudio podcasthttp://www.de-bug.de/pod/wp-rss2.phpelectro house & house & techno mixhttp://djbene.podspot.de/rssGalaktika Records Podcast: Minimal, Electro and House hottests tunes!http://www.galaktikarecords.com/podcast.xmlIbiza Voice Music Boxhttp://www.ibiza-voice.com/music/rss_podcast.phpLast.fm free recommended downloads for cdamian’shttp://ws.audioscrobbler.com/2.0/user/cdamian/podcast.xmlMinimal(maximal) Techno DJ mixes by Louis de Bourbonhttp://www.graphicjuice.co.uk/podcast/podcast.xmlMinimalNethttp://www.minimalnet.org/feedMinus Podcast:http://m-nus.com/podcast.xmlNetAudio Russiahttp://www.netaudio.ru/feedResident Advisor podcasthttp://www.residentadvisor.net/xml/podcast.xmlStarfrosch - Free MP3 Download - Acidhttp://starfrosch.ch/download_music/acid/feedStarfrosch - Free MP3 Download - Breakshttp://starfrosch.ch/download_music/breaks/feedStarfrosch - Free MP3 Download - DJ-Mixhttp://starfrosch.ch/download_music/dj_mix/feedStarfrosch - Free MP3 Download - Drum and Basshttp://starfrosch.chdownload_music/drum_and_bass/feedStarfrosch - Free MP3 Download - Dubhttp://starfrosch.ch/download_music/dub/feed Starfrosch - Free MP3 Download - Electronichttp://starfrosch.ch/download_music/electronic/feedStarfrosch - Free MP3 Download - Househttp://starfrosch.ch/download_music/house/feedStarfrosch - Free MP3 Download - Minimalhttp://starfrosch.ch/download_music/minimal/feedStarfrosch - Free MP3 Download - Technohttp://starfrosch.ch/download_music/techno/feedthe fabric podcasthttp://feeds.fabriclondon.com/fabricpodcast I would upload the OPML file, but blogger.com doesn’t allow attachments.

September 23, 2008 · 1 min · Christof Damian

Staying with Linux

Recently I was affected by the Steve Job Reality Distortion Field. After watching the demonstration of the iPhone developer kit and the iPhone in general I wanted one too. I thought I get myself a nice Apple Power Book or maybe an Air plus the iPhone and start developing. As it is also very much UNIX based I could still go to the command line if I want too and most of the tools I use every day are available on Max OS X and work very well. My girlfriend has been using her PowerBook Titanium since 2002 and it still works well. She now also got the iPhone, which is the best phone you can buy at the moment. For someone who just wants to use computers, these are perfect. But after seeing the problems software developers have with the AppStore and the sharing of information about iPhone development, I decided that this whole closed source thing is not for me. I have been using Linux since my Amiga days and Red Hat Linux since 3.0.3 and I just can’t imagening using software which doesn’t have the source code available for me to learn and thinker with. Most people now will say that you probably are not going to this, but it is not true for me. I fixed, patched and changed Apache, Rhythmbox, PHP and Perl. I build my own RPMs for the changed versions to keep my system clean and I want to have this option in the future. But it is not only the source. It is also the community and things like open bugtrackers. If I report a bug with some Apple or Microsoft product there is no way of knowing if this was reported before or if someone has a fix already. This just happened to me again with a USB mouse problem on Fedora, I just hat a look at bugzilla and there was already a solution which I was able to apply before the fix goes into the updates. I still need to upgrade my computer though. My Athon XP 2400 (IIRC) just doesn’t do the trick anymore. I also want to switch to an ATI graphics card to use open source drivers. So I decided to spend 1000€ on an upgrade to the machine, which probably consists of: 24" TFT monitorsome AMD four core CPU which doesn’t use too much powera passive cooled ATI card4GB of memoryASUS motherboardtwo 1T hard disks for RAID1all running the Fedora of course. I might also get an OpenMoko phone at some point, but I am not really a phone user so it would be just a toy. The only close source products will be my iPod Classic and iPod shuffle. But they are well supported now in gtkpod and Rhythmbox.

September 22, 2008 · 3 min · Christof Damian