Get character from ASCII code in PHP, Java and JavaScript

The lower case letter „a“ has ASCII code „97“ and can be generated in PHP like this:

<?php
  $a = chr(97);
  echo $a;
?>

In JavaScript, the same can be accomplished by:

<script type="text/javascript">
  var a = String.fromCharCode(97);
  document.write(a);
</script>

And this is how it works in Java:

public static void main(String[] args){
  String a = new Character((char) 97).toString();
  System.out.println(a);
}

JavaScript AMD Example with RequireJS

One line of code is worth ten thousand words.

./index.html

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>Asynchronous Module Definition Example with RequireJS</title>
  </head>
  <body>  
    <!-- Let's use RequireJS as module loader (there are also others!) -->
    <script src="./js/require-1.0.4.js"></script>
    <script>
      require(['js/my_amd_module'], // Requires ./js/my_amd_module.js
      function(myModule)
      {
        myModule.sayHello();
        myModule.doSomething();        
      });
    </script>
</html>

./js/my_amd_module.js

define('js/my_amd_module', // module name, has to match filename (without .js)
  ['js/jquery-1.7.min'], // requirements of this module (./js/jquery-1.7.min.js)
  function($) // $ for jQuery
  {
    return {
      sayHello: function()
      {
        alert('Hello World!');
      },
      doSomething: function()
      {
        alert('I did.');
      }
    };
  });

Create thumbnail images with PHP

I developed a function which creates a thumbnail for a given image in a predefined size. Please note that this function was created to be used within a WordPress plugin so it uses paths related to WordPress but these paths can be easily adapted to be used without WordPress.
Create thumbnail images with PHP weiterlesen

Java Util Logging Logger Beispiel

Für das Debugging von Java-Applikationen wird während der Entwicklung oft Gebrauch von system.out.println() gemacht. Das ist eine schnelle Möglichkeit, um sich Werte des eigenen Programms ausgeben zu lassen. Für wirklich produktive Projekte sollte darauf aber verzichtet werden, da system.out.println() das Multithreading behindert.

Statt der Ausgabe auf der Kommandozeile, empfiehlt sich der Logger aus dem Package java.util.logging. Dieser ist außerdem konfigurierbar, leicht abschaltbar und bietet mehrere Logstufen.
Java Util Logging Logger Beispiel weiterlesen

Strato Gutschein Code für Virtual Server

Mit dem Strato Gutscheincode „VPS20PP“ bekommt man noch bis Ende April 2010 genau 20 EUR Rabatt auf alle Virtual Server Angebote. Besonders praktisch ist das für den aktuellen V-PowerServer S.

Der STRATO V-PowerServer S garantiert 512 MB Arbeitsspeicher (dynamisch sogar bis 2 GB), 25 GB Festplatte und 3.000 GB Traffic. Das Paket beinhaltet eine Gratis-Domain und kostet monatlich dauerhaft nur 9,90 EUR. Für dieses Paket gibt es keine Mindestvertragslaufzeit und die einmalige Einrichtungsgebühr beträgt 19,90 EUR.

Mit dem Gutschein Code VPS20PP (20 EUR) hat man jedoch keine Einrichtungsgebühr mehr und kann sofort loslegen! Ideal für den Start ins Serverleben.

Hinweis: Inzwischen ist der Gutschein Code „VPS20PP“ abgelaufen aber hier gibt es noch weitere Strato Gutscheine.

Rabatt für Polystyle Source Code Formatter

Der geniale Source-Code-Formatierer von Polystyle ist dank eines Tricks günstiger zu bekommen.


Neuer Preis für den Polystyle Source Code Formatter
[audio:https://www.bennyn.de/wp-content/uploads/5.-Benny-Neugebauer-Neuer-Polystyle-Source-Code-Formatter-Preis.mp3|titles=5. Benny Neugebauer – Neuer Polystyle Source Code Formatter Preis]