Archive for February, 2007

Feb 25 2007

Geändertes Teledienstgesetz

Published by Mathias Bank. Filed under: Foren-Welt

Der ein oder andere hat es sicher mitbekommen: ab dem 01. März tritt das geänderte Teledienstgesetz in Kraft. Damit ergeben sich auch für Forenbetreiber Änderungen: so ist nun - neben dem Impressum - eine Datenschutzerklärung abzugeben. Law-Blog hat hier ein sehr schönes Beispiel erstellt.

Sollte auf jeden Fall berücksichtigt werden. Könnte sonst sein, dass man es manchen Leuten mit Abmahnungen zu einfach macht.

Und bevor jemand meckert: das neue Gesetz heißt nicht mehr Teledienstgesetz. Dieses wird zusammen mit dem TDDSG und MDStV zum Telemediendienst.

1 Star2 Stars3 Stars4 Stars5 Stars
Loading ... Loading ...
No responses yet

Feb 22 2007

Apple, DRM and the truth

Published by Mathias Bank. Filed under: marketing

Well, I think all of you have read the open letter of Apple’s Steve Jobs, in which he complains about DRM (Thougts on music).

It is a really interesting article in which the music industry is responsible for DRM and Apple wants to sell and use free music. Really good, Mr. Jobs. You can be my hero!

But, there is one little thing, which irritates me: If Apple loves music and if Apple wants to sell free music, why is the iPod not able to play free formats?

Some examples?

  • ogg
  • flac - not supported natively

I really agree with the words, Steve Jobs has chosen. But if you think about the things he says and the things Apple does, it sounds a little bit like a marketing gag.

It would be interesting to see, what Apple will do. Currently, Apple takes me for a fool?!

1 Star2 Stars3 Stars4 Stars5 Stars
Loading ... Loading ...
One response so far

Feb 21 2007

Students are spendthrift fat cats!

Published by Mathias Bank. Filed under: study

Obviously, the university of Ulm thinks, that this is the truth. Today, I have found this paper at the window of my car:

parking at uni ulm

Everyone, who wants to go to university by car has to park somewhere. But now: that’s the problem. One parking place was destroyed to build a new building, one was destroyed for a new parking garage for which you have to pay. And now, the old parking garage is also a subject of fee.

Of course, the students will use the remaining parking places. That can ran short. Sometimes, there is a reason why you have to use the car and not to use the bus.

I cannot realize, what’s the goal? We have to pay each semester:

  • 500 € semester fee
  • 40 € administrative charges (only god knows, why we have to pay this)
  • 50 € goes to the student union
  • 78 € ticket fee for students (bus and train)
  • 60 € to use the parking garage

That is really a method to get rid of students! That’s really necessary, because in Germany there are sooo much students (I hope, everyone will recognize the irony).

But the university needs money!

1 Star2 Stars3 Stars4 Stars5 Stars
Loading ... Loading ...
No responses yet

Feb 14 2007

How to debug PHP with Firebug

Published by Mathias Bank. Filed under: Programming

Dieser Beitrag ist auf mehrfachen Wunsch auf Englisch geschrieben und stellt einen bereits veröffentlichten Beitrag auf deutsch dar.

Each software developer knows the problem: writing software is just one part, testing and debugging is the other one. In php, there are some ways:

  • you can use a debugger tool (like xdebug or dbg)
  • or you can just print your variables to the output.

I love to develop my code with objects. I have to output these objects to check, if they have the expected values because there is no really good free debugger tool for current PHP versions. All of you know, that this can be done with this code:

var_dump($obj);

If you have complex objects, the output is annoying. The extension xdebug could help because it prints var_dump code in a readable way with colors.

But there is still one problem: the debug output will destroy your layout and you cannot check your system without destroying the design. There must be another solution: here it is:

If you are developing JavaScript code, you surely know the Firefox extension Firebug (documentation). This extensions is a fantastic tool to test your code, your output and your background traffic. But it also allows you to print debug messages with types:

  • log
  • info
  • warning
  • error

This script….

<script type="text/javascript">
console.log("Log-Nachricht");
console.info("Info-Nachricht");
console.warh("Warnungs-Nachricht");
console.error("Fehlermeldung");
</script>

…creates:
Firebug-Konsole

You can see, that each message type has it’s own color.

You can print simple messages, but Firebug can do more: it can output objects: This script…

<script type="text/javascript">
var obj = new Object();
obj.var1 = "test";
obj.var2 = 3;
console.log(obj);
</script>

… creates…
objekt output
with details:
Object details

Now, it would be fantastic, if such behaviour would be possible in PHP. And the good message is: it is possible. You only need the possibility to use JSON (which is part of PHP 5.2 and can be loaded in previous versions - PECL).

Now, I have written a little function, which will help you to debug your PHP code. You can download the debug function for firebug freely, of course.

The debug function helps you to print the variable name, simple variables, arrays and even objects. Here you can see an example:

class test {
public $var1;
public $var2;
public $var3;
}
$test = new test();
$test->var1="function";
$test->var2=4;
$test->var3="you";
debug("testClass",$test,DEBUG_TYPE_WARN);

You will get the output:
php object in Firebug

You can view each detail of the object like a JavaScript object:
php object details in Firebug

There are a lot of situations to use this function: p.e. “set_exception_handler”:

function handleExceptionError($exception) {
debug("ExceptionHandler",$exception->getMessage(),DEBUG_TYPE_ERR);
debug("File/ Line",str_replace("\\","/",$exception->getFile()) . "::" . $exception->getLine(),DEBUG_TYPE_ERR);
}
set_exception_handler('handleExceptionError');

In this way, you can test and debug your code without destroying your layout.

Have fun!

1 Star2 Stars3 Stars4 Stars5 Stars
Loading ... Loading ...
10 responses so far

^