php

School of Programming

I still got the idea of founding a real "school of programming". These topics come into my mind, for a course about Web Development:

- Time Estimations
- Self Management
- Relational databases and high-performance SQL
- Design Patterns (incl. MVC)
- JavaScript and AJAX

PHP Magazin: Parlez-vous Zend?

php_mag.gif Wer sich fuer mehrsprachige Unternehmens-Anwendungen mit Zend Framework interessiert, findet im aktuellen PHP Magazin (5.07) einen Artikel von mir. Anhand eines Fallbeispiels wurde gezeigt, wie die Neuentwicklung einer PHP Anwendung mit modernen Technologien ablaufen kann und was es zu beachten gibt.

plat_forms 2007 results

The results of the plat_forms contest are finally published! PHP was the best platform in terms of completeness, maintainablity and security. Also, the differences between the PHP teams were small compared to Perl and Java - that means, our Team 8 was quite good, even if OXID (Team 6) is the winning team for PHP: Congratulations :)

I'd like to mention that we had almost no defects in our solution:

plat_forms_incorrectness.png

Fun with SQL

I had heaps of fun with SQL today (again). Ever heard of Common Table Expressions? Here is an example of a recursive query:


WITH
  nodeCTE (nodeId, nodeName)
AS (
  SELECT 
    a.nodeId, 
    nodeName = CONVERT(varchar(8000), nodeName) 
    FROM 
    nodeNames a JOIN nodes b ON a.nodeId = b.nodeId 
    AND a.locale = 'en' AND b.parentId = 0 
  UNION ALL SELECT y.nodeId, 
    x.nodeName + ' -> ' + CONVERT(varchar(8000),
    z.nodeName)
    FROM 
    nodeCTE x JOIN nodes y ON y.parentId = x.nodeId      
    JOIN nodeNames z ON z.nodeId = y.nodeId AND 
    z.locale = 'en'
)
SELECT * FROM nodeCTE;

Want to work at GROU.PS?

I just found this funny job ad on http://grou.ps/jobs.do:

$q1 = Are you a master PHP Ninja?
$q2 = Excel at object oriented PHP, MVC pattern, Smarty template engine, caching practices and PEAR?
$q3 = Familiar with CSS, Javascript, XHTML, MySQL?
$q4 = Experienced with Zend Studio, Subversion, wikis?
$q5 = Love open source? Aware of RSS, XML-RPC, web services, memcached and all other geeky stuff?
$q6 = Keen to learn much more?
$q7 = Ready to move to Silicon Valley?

if ( $q1 && $q2 && $q3 && $q4 && $q5 && $q6 ) {
echo "YOU SHOULD <strong>JOIN</strong> US! drop your resume to [email protected] <br />";
echo "please include some php and javascript code snippets or refer us to an open source project you've";
echo "already made. tell us our coding mistakes in this call and let us know what you know about";
echo "the new javascript 1.7, mysql 5.2 and php 6. thanx,";
exit;
}

else {
die("maybe next time...");
}

Zend Framework: Unicode DB adapter for SQL Server

Yeah, I finally got it managed to publish my proposal for the Zend Framwork ODBTP database adapter component:

http://framework.zend.com/wiki/display/ZFPROP/Zend_Db_Adapter_Odbtp_Mssql

The default MS SQL database driver does not work with Unicode, as SQL Server expects Unicode strings in the UCS-2 encoding (UCS-2 contains null bytes and the driver is not binary-safe). ODBTP works as layer between PHP and SQL Server and accepts Unicode strings in the UTF-8 encoding.

plat_forms photos online

Some of the photos from the plat_forms 2007 contest are published on this website now!

plat_forms.jpg

I'm a Drupal user now

I just installed drupal as blog software and converted the old blog entries to the new table format.

This is (a part of) the SQL code:

INSERT INTO node_revisions SELECT a.id, a.id, 1, c.value, b.value, SUBSTRING_INDEX(b.value, '.', 6), null, changed, 4 FROM public_websites.ndev_liveContent a JOIN public_websites.ndev_liveContentData b ON a.id = b.content_id JOIN public_websites.ndev_liveContentData c ON a.id = c.content_id WHERE b.name = 'body' AND b.language_id = 1 AND c.name = 'title' AND c.language_id = 1 AND a.parent_id = 1 AND a.type_id = 9;

Passwoerter fuer's Web erzeugen

Da es ja gerade total angesagt ist fuer jede Website ein anderes Passwort zu verwenden, habe ich ein kleines PHP Script geschrieben, dass einen Hash verwendet um aus einem einzigen Passwort und der Domain ein sicheres Passwort zu erzeugen:


#!/usr/local/bin/php
<?php

if($argc < 2) {
    echo "Usage: getpw [domain]\n";
    }

echo "Master Password: ".substr(base_convert(md5(fgets(STDIN).$argv[1]), 16, 36), 0, 8)."\n";
?>

XSS Bug in PEAR::Text_Wiki 1.1.0

Gestern habe ich durch Zufall einen XSS Bug in Text_Wiki entdeckt... wundert mich, dass das vor mir niemand aufgefallen ist... mal sehen, ob es auch eine News-Site melden wird - so oft verwendet wird Text_Wiki wohl nicht...

Siehe:


Theme & Icons by N.Design Studio
© 2000-2007 Michael Mayer
Syndicate content