Categories
development web

My whereabouts (preface to DOM manipulation with Javascript)

Hi there, for a long time I didn’t blog here. That’s partly because in June I changed my working field from pre-development to development for the mass production. This has been a great opportunity – connected with a permanent hiring at my alltime-favourite car company: Audi.

But now I’m enjoying my winter holidays at my parent’s place – and I’ve got time to checkout something that had interested me for quite a time: Javascript. Some years ago I already did take a few steps with JS – but then it wasn’t really comfortable at all.

Now – a few years later, there are interesting libraries available that cover a wide variety of  common tasks – mostly driven by developers from the AJAX movement.
But not only are there some libs – there are great IDEs that allow a fast and efficient development.

After asking a few fellow developers, I decided to try the Eclipse based Aptana IDE together with jQuery – a lightweight library that seemed to suite my needs quite well. I also took a glance at dojo – but the small distribution package of jQuery (one single .js file) was exactly what I was searching for.

Categories
development web

jQuery

As I already told, I’m doing my tests within the Eclipse based Aptana IDE.
During creating the project, you can already decide which Javascript libraries to use (I chose jQuery).

My use case: Filtering the rows of a big HTML table on client side. Of course, this usually calls for a database driven solution, but as a matter of fact I wanted to support the filtering even in offline situations.

Preparing the HTML file

<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="myFilter.js"></script>
<title>My HTML page with client side filtering</title>
...
</html>

myFilter.js

Within myFilter.js we can define our own user functions. By the way: I really love object orientated development – but this time is not the day of OO. So please don’t be disappointed if you’ll see classic procedural style in this blog entry. Maybe some day I’ll find out how to do nice and lean OO within Javascript. 😉

There’s one special callback function that is called from jQuery core after the page has completed loading:

$(document).ready(function(...){});

Within this anonymous method, all the magic is taking place. Within there we’ll even define our own methods, such as

filterTable = function()
{
   //your code goes here
}

Selectors

One of the base concepts of jQuery (next to Chaining) are Selectors. With selectors one defines the subset of the DOM that you want to manipulate, e.g.:

$('#traceTable > tbody > tr')

Selects all rows of the HTML table with the id=’traceTable’.

Chaining

A typical jQuery command is chained. That means that a method call to a jQuery object returns another jQuery object. This may look a  bit weird at first glance, but it’s quite comparable to piping in Unix environments, e.g.:

$('#traceTable > tbody > tr').each(function (i) //execute the function for all <tr> elements of tbody in #traceTable
{
   filterRow($(this), filterText);
});

What you can see here is a combination of several techniques. Both the selector $(‘…’) and the each() function are returning objects of type jQuery. Within each() an anonymous function is called for every element of the selector. Note: In the context of each() there’s also a context change of $(this). It references to the currently traversed element of the selector!

Categories
Uncategorized

EM 2008 – die Blumentopf Reportagen

Wie schon vor zwei Jahren – zur WM 2006 – berichtet das “Blumentopf Experten Team” zu allen Deutschland-Spielen in Form von kurzen HipHop-Songs, die erkennen lassen, wie viel Potential die Münchener Jungs haben:

GER – POL (8. Juni, 2:0)
GER – CRO (12. Juni, 1:2)
GER – AUT (16. Juni, 1:0)
GER – POR (19. Juni, 3:2)

Categories
Uncategorized

SVN mit Apache (HTTP) und SSL (HTTPS) installieren

1) APACHE installieren.

http://apache.mirror.clusters.cc/httpd/binaries/win32/apache_2.2.8-win32-x86-openssl-0.9.8g.msi
(Standard-Installation -> Port 80 (anderer auch möglich, aber firewalltechnisch problematisch)

2) SVN herunterladen und installieren
http://subversion.tigris.org/files/documents/15/41687/svn-1.4.6-setup.exe

3) die .so-Module aus dem bin-Verzeichnis von SVN in das modules-Verzeichnis des Apache kopieren.

4) httpd.conf von Apache (im Ordner /conf) bearbeiten.

Folgende Zeilen müssen (natürlich nicht auskommentiert) in der httpd.conf stehen
(die erste müsste schon vorhanden sein und muss lediglich noch einkommentiert werden)

LoadModule dav_module modules/mod_dav.so
LoadModule dav_svn_module modules/mod_dav_svn.so
LoadModule authz_svn_module modules/mod_authz_svn.so

5) Ein Repository anlegen (z.B. mit TortoiseSVN)
5.1)
Es empfiehlt sich, einen Parent-Path für alle Repositories einzurichten.
z.B.: D:\development\svn
5.2) In diesem Pfad ein (oder mehrere) Verzeichnisse anlegen, die dann die Repositories beinhalten.
z.B.: D:\development\svn\main
5.3) Mit installiertem TortoiseSVN gehts am einfachsten (siehe Abschnitt ‘Web-Links’). Auf den neuen
Ordner im Explorer rechtsklicken > TortoiseSVN > Create repository here…
Als Dateisystem empfehle ich FSFS.

6) Repositories im Apache bekannt machen
Folgenden Abschnitt (mit korrektem Pfad) AM ENDE der httpd.conf einfügen:
<Location /svn>
DAV svn
SVNParentPath D:/development/svn
</Location>

Ab diesem Zeitpunkt haben wir ein prinzipiell lauffähiges Subversion-System.

7) Zugriffsrechte regeln
Grundsätzlich kann ein bestehendes DHCP-Verzeichnis angebunden werden.
7.1) Das Tool htpasswd.exe aus dem Verzeichnis “Apache/bin” in das Repository-Hauptverzeichnis kopieren.
Alternativ kann man es auch in die Path-Variable aufnehmen.
7.2) Auth-File mit dem ersten user erzeugen: htpasswd -cm svn-users chle
Es erscheint eine Passwort-Abfrage für den neuen Nutzer.
7.3) Weitere User werden mit dem Kommando ‘htpasswd -m NEUERBENUTZER’ angelegt.
7.4) Auth-File im Apache bekanntmachen (Erweitern der Location-Definition ‘svn’ in httpd.conf)

<Location /svn>
DAV svn
SVNParentPath D:/development/svn
AuthType Basic
AuthName “Subversion repository”
AuthUserFile D:/development/svn/svn-users
Require valid-user
</Location>

8.) HTTPS-Verschlüsselung einrichten
Da die Authentifizierung über das Verfahren ‘HTTP-Basic’ im Plain-Text geschieht,
ist es notwendig, eine zusätzliche Sicherheitsschicht zu verwenden. HTTPS wird
von Apache unterstützt.

8.1) Die OpenSSL Konfiguration muss interessanterweise noch zusätzlich geladen werden
und in den bin-Ordner von Apache kopiert werden: http://www.neilstuff.com/apache/openssl.cnf
Das Kommandline-Tool ‘openssl.exe’ (apache/bin) wird in den folgenden Schritten Mittel der Wahl sein.

8.2) Erstellen eines Self-Signed Certificates

8.2.1) Erstellen des Certificate Requests
openssl req -config openssl.cnf -new -out svnserver.csr -keyout svnserver.pem

Das Tool fragt an dieser Stelle nach vielen Informationen. Allerdings muss keine angegeben werden.
Vor allem das Passwort ist an dieser Stelle nicht nötig, das wird später Apache übernehmen.
Es ist sinnvoll, ein paar Informationen (wie Host, Land, Firma, …) anzugeben, da diese später
im Zertifikat nachlesbar sind.

8.2.2) Erstellen eines passwort-losen Schlüssels für Apache
openssl rsa -in svnserver.pem -out svnserver.key

8.2.3) Datei ‘.rnd’ löschen. Diese könnte u.U. für Cracking-Zwecke missbraucht werden

8.2.4) Zertifikat erzeugen
openssl x509 -in svnserver.csr -out svnserver.cert -req -signkey svnserver.key -days 3650
(Die Gültigkeitsdauer von 10 Jahren ist etwas hoch, aber naja)

8.3) SSL in Apache aktivieren

8.3.1) SSL Modul aktivieren (httpd.conf, Zeile einkommentieren)
LoadModule ssl_module modules/mod_ssl.so

8.3.2) Include httpd-ssl.conf: (Zeile in httpd.conf einkommentieren)
Include conf/extra/httpd-ssl.conf

8.3.3) Zertifikat kopieren
Das erzeugte Zertifikat (bestehend aus den beiden Dateien ‘svnserver.key’ und ‘svnserver.cert’)
in ein neues Verzeichnis conf/ssl kopieren

8.3.4) conf/extra/httpd-ssl.conf anpassen:
Die Einträge ‘SSLCertificateFile’ und ‘SSLCertficateKeyFile’ müssen auf die jeweiligen Files zeigen:

SSLCertificateFile “C:/Program Files/Apache Software Foundation/Apache2.2/conf/ssl/svnserver.cert”
SSLCertificateKeyFile “C:/Program Files/Apache Software Foundation/Apache2.2/conf/ssl/svnserver.key”

9) Fertig.
Im Browser kann man unser Beispiel-Repository z.B. unter https://localhost/svn/main erreichen. In Toirtoise-SVN gibt man dieselbe Adresse als URL an.

WEB-LINKS
1) http://svnbook.red-bean.com/en/1.4/svn-book.pdf
2) TortoiseSVN http://tortoisesvn.net/downloads
3) Anleitung “Subversion unter Windows” http://svn.spears.at/
4) Anleitung “Apache mit SSL unter Windwos” http://www.netzadmin.org/server/apache/apache-ssl.htm

Wichtiger Hinweis:
Rechte-Vergabe unter Windows. Apache sollte als Dienst laufen, der die Rechte eines nicht-privilegierten Users besitzt.
Die Zugriffsrechte für die entsprechenden Verzeichnisse müssen dementsprechend angepasst werden.

Es ist sinnvoll, den Zugriff auf das Repository auf HTTPS zu begrenzen (also kein unverschlüsseltes HTTP zu erlauben).

Categories
Uncategorized

setting display properties in windows via script

if you need to set your screen settings and don’t want to go all the long hard road within the control panel, there are several possibilities. two that i have found:

  •  open the display properties panel by executing ‘control.exe desk.cpl,Settings,@Settings’
  • use Anders Kjersems tool ‘QRes’ http://www.aksoftware.tk/ It’s just perfect!
Categories
Uncategorized

die häufigsten straßennamen in deutschland

Wer sich schon immer gefragt hat, welche Straßennamen in Deutschland wohl am häufigsten sind, hat hier die Antwort schwarz auf weiß:

9961 x hauptstraße
8111 x dorfstraße
5931 x schulstraße
5902 x bahnhofstraße
5278 x gartenstraße
4800 x bergstraße
3504 x lindenstraße
3428 x birkenweg
3347 x waldstraße
3089 x kirchstraße
2779 x ringstraße
2416 x wiesenweg
2281 x schillerstraße
2215 x goethestraße
2171 x mühlenweg
2170 x amselweg
2168 x feldstraße
2065 x wiesenstraße
2043 x jahnstraße
2010 x am sportplatz
1966 x buchenweg
1926 x friedhofstraße
1888 x eichenweg
1808 x finkenweg
1807 x ahornweg
1765 x mühlenstraße
1705 x rosenstraße
1686 x talstraße
1665 x erlenweg
1652 x blumenstraße
1652 x brunnenstraße
1641 x kirchweg
1640 x lindenweg
1640 x raiffeisenstraße
1631 x bachstraße
1617 x industriestraße
1600 x tannenweg
1485 x mittelstraße
1478 x gartenweg
1475 x rosenweg
1463 x mozartstraße
1455 x am bahnhof
1455 x lerchenweg
1448 x waldweg
1396 x drosselweg
1392 x poststraße
1337 x schlossstraße
1335 x neue straße
1323 x mühlweg
1319 x kirchplatz
1296 x beethovenstraße
1275 x kirchgasse
1271 x burgstraße
1236 x schulweg
1232 x breslauer straße
1212 x im winkel
1206 x birkenstraße
1192 x meisenweg
1191 x lessingstraße
1187 x fliederweg
1179 x kiefernweg
1173 x grüner weg
1168 x königsberger straße
1166 x berliner straße
1165 x fasanenweg
1163 x parkstraße
1145 x uhlandstraße
1143 x schützenstraße
1128 x römerstraße
1112 x kapellenweg
1105 x kastanienweg
1096 x marktplatz
1078 x danziger straße
1076 x tulpenweg
1074 x heideweg
1042 x mittelweg

Categories
operating system

Vista: verlorene Funktionen

Nach intensivem Gebrauch von Vista musste ich erstaunt feststellen, dass ich manche nützliche Funktionen von XP vermisse:

  •  Web-Veröffentlichungsassistent
  • TCP over Firewire
  • Windows Update in Kombination mit 2-Wege-Firewall
Categories
photo

ich will aufwärts

ich will aufwärts Originally uploaded by krizleebear.
prof. michael stoll von der gestaltungs-fakultät der fh augsburg (der ich auch bis vor kurzem angehörte) hat eine nette flickr-group gegründet, in der photos des alten gestaltungs-baus gesammelt werden.bis jetzt befand sich die gestaltung nämlich im ehemaligen krankenhaus vincentinum an der henisiusstraße. doch in den nächsten wochen steht der umzug in ein modernes gebäude an.

ein lebewohl (um nicht nachruf zu schreiben) an ein altes gebäude, in dem man etwas zeit verbracht haben muss, um es gern zu haben. ich habe es geliebt und widme ihm deshalb dieses bild (s.o.).

zur flickr-group:
http://www.flickr.com/groups/old-g/

Categories
development

Rundfunker reaktiviert

rundfunker Originally uploaded by krizleebear.
Hallo liebe Rundfunker-Freunde.
Wir haben unser Siebtsemesterprojekt “Rundfunker” vor einigen Tagen auf berlios.de reaktiviert: https://developer.berlios.de/projects/rundfunker/
Für die, die ihn noch nicht kennen:
Der Rundfunker ist ein stationärer MP3-Player, der das WLAN nach lokalen Audioquellen durchsucht und dort freigegebene Audio-Dateien abspielt. Er besitzt ein eingebautes 2-Wege-Lautsprecher-System, ein LC-Display und ein überraschend simples und gleichzeitig mächtiges Bedienkonzept. Dabei benötigt das Gerät keinerlei externe Peripherie, ein einfacher Stromanschluss genügt – die komplette Hardware befindet sich bereits im optisch ansprechenden Designer-Gehäuse mit edler Aluminium-Frontplatte.

Unser Fünf-Mann-Team (Mathias Bauer, Christoph Beckmann, Christian Leberfinger, Stefan Loibl, Jan Peuker) hat damals die komplette Software konzipiert, implementiert und als Open-Source zur Verfügung gestellt; außerdem haben wir zwei komplett funktionstüchtige Prototypen gebaut.

Categories
operating system

Sophos Antivirus unter Windows Vista

Die neue Version 6.5 von Sophos Antivirus ist grundsätzlich kompatibel zu Windows Vista.
Sophos Antivirus empfiehlt sich für bayerische Studenten, da das Leibniz Rechenzentrum eine Landeslizenz für bayerische Hochschulen erworben hat, die Studenten zur Nutzung berechtigt:

Die Installation des Virenscanners hat allerdings einen kleinen Haken (Error #3057), deshalb hier eine detaillierte Anleitung: