BlogKontaktTagcloud

Zend Framwork 1.5 is out

I know, that's definitely old news. But still it's worth to mention that the Zend Framework 1.5 is out since some weeks. It's a big jump from Zend 1.0 but also they have a lot new features in there (and probably some Zend Developers drink too much Java). They have also a new and cooler website for the project now.

In my point of View specialy the improvment in Zend MVC makes the framework now usable for companies with a lot of developers working on the same project (without patching the code over and over again).

The full list of improvments:
  • New Zend_Form component with support for AJAX-enabled form elements
  • New action and view helpers for automating and facilitating AJAX requests and alternate response formats
  • Infocard, OpenID, and LDAP authentication adapters
  • Support for complex Lucene searches, including fuzzy, date-range, and wildcard queries
  • Support for Lucene 2.1 index file format
  • Partial, Placeholder, Action, and Header view helpers for advanced view composition and rendering
  • New Zend_Layout component for automating and facilitating site layouts
  • UTF-8 support for PDF documents
  • New Nirvanix, Technorati, and SlideShare web services
Ähnliche Beiträge:
Coding Contest addicted
Coding Contest
Array instead of switch-case in php
A eventfull PHP-Week
PHP Programming Contest
Comments (0)  Permalink

Coding Contest addicted

As I allready mentioned I can't let my finger from coding contest. Unfortunately Bob found in a comment in my blog more nasty stuff about links in html comments which makes parsing even harder.

I trimed my script again under the size of the original script (ok, nearly the original), but I think if my regex skills would be a bit better, I could still squeeze some bytes out of it. But as I go finaly to holiday tomorow I will send my script to Paul and hope to get some points for the shortest script, as it will definitely not win any price for speed or beauty (did not wrote so ugly code since ages).

BTW: If you still trim you script, I brought up a new testfile. You should still come up with the same 11 links. This testfile is so ugly that my old konqueror is not able to parse it correct (but the comments are absolutly valid, according to the documentation and the validator).
Ähnliche Beiträge:
Zend Framwork 1.5 is out
Coding Contest
Array instead of switch-case in php
A eventfull PHP-Week
PHP Programming Contest
Comments (0)  Permalink

Coding Contest

Unfortunatly I can not resist if somebody brings up a coding contest. This time Travis and Paul wrote about the coding contest of php architect at planet-php. I did not invest a lot time into it, but still ways more then I planed.

The problem is that the ranking is once by speed and once by size of the script. Two parameters which usually not go well together. After having some great ideas for speeding up my code (even parallel processing, shared memory and map-reduce came to my mind) I decide to let this race to others and fully concentrate to the size. I not even run benchmarks anymore.

Unfortunatly some nasty html special cases (whitespace, case independence, single- and double-quoting, various attributes and so on) blow my perfect sized script a bit. But with some nasty php method tricks it's hopfully still the shortest possible script that gets all valid cases.

Just to let you feel not to save, I wrote a littel nasty html example that might break your own script. (You should get exactly 10 11 links out of it.)
Ähnliche Beiträge:
Zend Framwork 1.5 is out
Coding Contest addicted
Array instead of switch-case in php
A eventfull PHP-Week
PHP Programming Contest
Comments (11)  Permalink

Array instead of switch-case in php

First of all, be warned, this article has no pratical relevance. It even might guide you to bad code. But this week it just popped into my mind that I could use an array instead of a switch-case construct. So see how we can do this. This is the example for the switch in the php manual.

switch ($i) {
case 
0:
    echo 
"i equals 0";
    break;
case 
1:
    echo 
"i equals 1";
    break;
case 
2:
    echo 
"i equals 2";
    break;
}
Now I'm able to implement this in a array, for that I put the code for every case statement in a arrayfield Afterwards I can access the field over the parameter and execute the code in it with eval.Here's the example: (Take care to not forget the semicolon in the code string)

$case[0] = "echo \"i equals 0\";";
$case[1] = "echo \"i equals 1\";";
$case[2] = "echo \"i equals 2\";";
eval($case[$i]);
Looks pretty, but what to do if you have to do the default statment. Nothing easier then that, we just have to look if eval goes ok and if not we do something after AND-short circuit:
eval($case[$i]) === false && print("default");
Ähnliche Beiträge:
Zend Framwork 1.5 is out
Coding Contest addicted
Coding Contest
A eventfull PHP-Week
PHP Programming Contest
Comments (3)  Permalink

Endlich gelesen: The Pragmatic Programmer

"The Pragmatic Programmer" sollte für jeden der mit Software Entwicklung zu tun hat Pflichtstoff werden. Warum ich so lang gehabt habe um dieses Buch zu lesen kann ich mir nur damit erklären das ich denn grössten Teil des Inhalts schon in Vorlesungen und in einem Vortrag von Andy Hunt gehört habe. Die Zusammenfassung des Vortrags, der einen grossen Teil des Buchs abdeckt, findet man in meinem Blog (Teil1, Teil2).

Andy Hunt und Dave Thomas erklären auf nur knapp mehr als 250 Seiten alle wichtigen Paradigmas der modernen Software Entwicklung. Bei so wenig Seiten kann natürlich nicht immer ins Detail gegangen werden, gewisse Themen werden nur angeschnitten und müssen bei Interesse weiter vertieft werden.

Die Tipps wie man ein Projekt zu einem erfolgreichen Abschluss führen kann sind absolut unverzichtbar. "The Pragmatic Programmer" muss man einfach gelesen haben.

Mein nächstes Buch aus dieser Reihe wird, sobald ich es von Mirko endlich bekomme, "My Job went to Serbia India".
Ähnliche Beiträge:
Lesen: iWoz
Gelesen: Afghanische Reise
Buch: Computerlogik
Trockener Code
Pragmatic programming with Andy Hunt (Teil II)
Comments (1)  Permalink

First time PHP5 troubles

Support GoPHP5.orgNach dem ich den Umstieg auf PHP5 immer als sehr problemlos angesehen, hatte ich letzte Woche das erste mal ein PHP5 Problem. Meine Gallery Installation ist hoffnungslos veraltet, zum upgraden bin ich aber nie gekommen.

Als nun ein paar Freunde viele Bilder mit dem Javaclient hochladen wollten ging gar nix. Den Fehler sieht man dann leider nicht so genau, mit ein wenig sniffen bin ich dem Fehler jedoch auf die Spur gekommen. "Fatal error: Only variables can be passed by reference in ..." meldete das Script zurück. Das Problem war relativ leicht aufzuspüren, in PHP 5.0.4 wurde am Reference Handling rumgeschraubt. Folgendes funktioniert dann eben nicht mehr:
function gr_move_album( &$gallery, &$response, &$set_destalbumName ) { }
gr_move_album( $gallery, $response, getRequestVar('set_destalbumName') );
Der ziemlich hässlich Workaround ist in diesem Moment denn Wert einfach einer noch nicht existierenden Variable zuzuweisen:
gr_move_album( $gallery, $response, $foo2=getRequestVar('set_destalbumName') );
Nichts desto trotz, es gilt immer noch "go PHP5". Mit Support für PHP4 is spätestens am 8/8/8 definitv Schluss.
Ähnliche Beiträge:
Zend Framwork 1.5 is out
Coding Contest addicted
Coding Contest
Array instead of switch-case in php
A eventfull PHP-Week
Comments (0)  Permalink

SCJP, now!

Ok, I got it! After a hell lot of work I managed today to get my "Sun Certified Java Programmer". It was just the same like with my lpic, it's really hard if you don't use the topic, you want to certified with,in your every-day-work. SCJP isn't a piece of cake, and after not writing productive Java-Code for more than half a year it was hard to survive in all the Java details they want to know.

Probably the hardest thing was to know if something get a compile- or a runtime error. I think this is also hard to figure out for very-experienced-java-senior-developer™. The other hard thing was to know all the API-Methods. To be honesty you didn't have to learn so many API-Methods, but they test if you you know the Java-Collection-Api quite well. Yeah and that's the point where my missing every-day-use nearly kills me again. And the collection-stuff was also my worst part in the test (got only 60%). And before I forget, you should really know "everthing" about Java 1.5, probably more then the half of my test was somehow related to it.

But on the other end I did quite well in the multithreading-part. Don't get me wrong, it's not easy! But after surviving marines-like "Parallel- und Netzwerkprogrammieren" (the parallelprogramming-course at my school) nothing about java-threads can anymore surprise me.

For preparation I used the "SCJP Sun Certified Programmer for Java 5 Study Guide" from Kathy Sierra and Berth Bates. The book did a quite well job. It's very well written and sometimes it even makes me laugh (not a bad thing for a tech-book). From time to time the description of some topics (specially when you knew them allready) get a bit longish. But the book describes everything you need to know for the exams and the short self test at the end of the chapter helps to find your weakness. Bye the way, the selftests are harder then the exame itself. The book-cd is a bit a crap, the not very nice looking test program (actually it looks nearly as horrible as the original testcenter interface) runs only on windows. Not the way to go for learning a OS-independent language.

And now 10 things I didn't knew about Java, even I thought I knew everything when I left university (or I have allready forgotten since then, I'm getting old):
  • In the case statement you don't have to fully reference your enum (you don't need the type)
  • In the For-Each Loop you can not define the loop-variable befor the loop.
  • You can use covariant return type, but only in Java 5
  • The method with var-args is allways chosen last
  • You can not widen and autobox arguments in one step
  • You can do "if(a = b)" (yes, with only one equals sign!) As long as both types are boolean.
  • binarySearch has the most C-like interface you will find in the Java-API.
  • If you have a "private final" method you can "override" it in the subclass. (Well, not really override, but because the private method do not exist in the subclass you can redefine it)
  • You can instantiate an inner class from the outside with "new Outer().new Inner();" (Ok, this is one I allready knew. But is still the most weird construct in Java and I think if you see this in really life it might mostly refer to a design flaw.)
  • For numberobjects with small numbers (usually bellow 127) java compare the number when you do "==", for bigger numbers java use the object reference. (Do Sun-Engineers smoke Java?)
You asking about score?! It was much better than it has to be, but for sure it wasn't a 99% certificate. But for somebody how drinks no coffee...
Ähnliche Beiträge:
Java Bug: Process.waitFor() hangs
Zend Framwork 1.5 is out
Coding Contest addicted
Coding Contest
Is Dalvik the better J2ME?
Comments (4)  Permalink

A eventfull PHP-Week

The week before the last a group of big php-application developer-communities create the initiative GoPHP5. They decide to finally stop supporting PHP4 at the 5. February 2008 and add the minimal requirement of php 5.2. Some big hosting providers stop there support for php4 at this date as well.

But then the php-(core-)developer decided last week to stop there support for PHP4 at the end of the year. There will be only security bug fix until 8.8.2008 (what a greate date, php4 die and i have birthday as well) and then php4 is (hopefully) finally dead.

But even better, after a long time of silence around PHP6, there is some noise. PHP6 has now Namespace support (we waiting for this for ages). And as I looked in the (inofficial) PHP release managment wiki, theres a lot of work going on. Hopefully we will see PHP6 in the begining of 2008.
Ähnliche Beiträge:
Zend Framwork 1.5 is out
Coding Contest addicted
Coding Contest
Array instead of switch-case in php
PHP Programming Contest
Comments (0)  Permalink

PHP Programming Contest

I just committed my code for the The PHP-Programming-Contest. But I'm not really happy about it. First of all I thought I will do it in an hour, and really after an hour the first version worked. But I had a lot of performance problem and I had to switch the wordlist from a wikipedia based one to an other one. It took me some hours at the end. I'm also not happy about the performance, I took my already implemented breadth-first algorithm. But after all solving this problem this way it's just to slow, I'd rather should take a A* star search algorithm.

But now I just committed my code. It's realy short (beyond 100 LoC without the search algorithm) and not bad programmed (even the userinterface isn't there to win a beauty contest). And I really wonder if some other programmers commit such a crap like I did or if there are only smart-ass-coder that committed some code.
Ähnliche Beiträge:
Zend Framwork 1.5 is out
Coding Contest addicted
Coding Contest
Array instead of switch-case in php
A eventfull PHP-Week
Comments (2)  Permalink

Web-Continuations - Technolgie 2007

Eigentlich wollte ich schon lange über Continuations und die Implementierung in Jetty schreiben. Nun sind mir andere jedoch zuvor gekommen.

Continuations tritt an um das Problem von häufig zu aktualisierenden Seiten zu lösen oder zumindest zu mildern. Der klassische Use-Case dazu ist wohl der HTTP-Chat.

Sollen neue Meldungen "sofort" angezeigt werden müssen diese regelmässig beim Server abgeholt werden, da es mit HTTP keine Möglichkeit gibt diese vom Server an den Client zu senden. Dauerndes Polling mit XMLHttpRequests ist eine "teure" Angelegenheit, damit werden, auch wenn es keine neue Nachrichten gibt, Client, Server und Leitung belastet. Der HTTP-Request kann nun auf dem Server blockiert werden und der Server gibt erst nach einer gewissen Zeit oder bei einer neuen Nachricht antwort. Das entlastet den Client und die Leitung, der Server braucht aber mindestens ebenso viele Ressourcen wie zuvor. Continuations greift nun genau da ein. Die Ausführung des Requests wird bis eine Nachricht auftritt ausgesetzt. Dies ermöglicht dem Server Ressourcen zu sparen.

Da sich im Jahr 2007 der Trend zu desktopähnlichen Webandwendungen fortsetzen wird, wird Continuations (oder ähnliche Techniken) dieses Jahr für Webentwickler wohl sehr wichtig.
Ähnliche Beiträge:
Parallel Request mit AJAX und PHP
Synchroner Aufruf mit XMLHttpRequest in Firefox
Ajax vs. Flash
Faster google maps with JSON
All new webtuesday
Comments (0)  Permalink
Next1-10/46