Drei

17. August 2010

Hier ist ein kleines Bild, welches ich vor einiger Zeit gezeichnet habe.

Aller guten Dinge sind drei

Gutscheine für Prosite (Web-Hosting)

16. August 2010

Neulich fiel mir auf, dass ich von meinem netten Webhoster (prosite.de) eine Menge Gutscheine bekommen habe, die ich gar nicht benutzt bzw. verbraucht habe. Diesen Beitrag weiterlesen »

Mein neuer Netzladen: Handgefärbte Stoffe für Quilts und Patchworks

7. August 2010

Liebe Leute.

Soeben habe ich meinen ersten Online-Shop eröffnet, welcher ab sofort eine Vielzahl einzigartiger, handgefärbter Stoffe bietet! Besonders für KünstlerInnen, welche Quilts und Patchworks arbeiten, werden sich dafür interessieren. Die Adresse ist unikatstoff.de !

Diesen Beitrag weiterlesen »

(English) Sort products by colour in web shops

4. August 2010

Many on-line shop systems, like Magento, Prestashop or xt-commerce, lack the ability to automatically sort products by colour.

In order to solve this, I wrote a little python script that transforms the average colour of a product image into a scalar, then generates a CSV file including the colour value in some property, allowing it to be sorted easily by the web shop system of your choice. Images with many different colours are not sorted very well, but it worked for most of the products in my case.

You can see the script in action at shop.paramentextil.de. It generates a CVS file which can be imported by most e-commerce systems. You will certainly have to change the script to your needs, but this should be easy to do even with little programming experience. Changing the sorting mechanism may also be appropriate in some cases. Enjoy. Diesen Beitrag weiterlesen »

(English) Dracula Graph Library 0.0.3alpha

1. Juni 2010

Edit: This library moved to it’s own a web site: graphdracula.net

Hello People!

Please have a look at the latest alpha version of my graph library. There are some changes, like now you have a simple option to add labels to connections by passing a label property when creating an edge and a simple overlay option for nodes. Note that the file names have also changed, but this shouldn’t be too hard to adopt to. Some source code refractoring has been done too and the getShape is now called render.

The biggest changes however are some search algorithms I implemented to work with the framework, Dijkstra, Bellman-Ford and Floyd-Warshall along with a priority queue based on a binary heap. I’m just doing this because I have to learn it, but my plans are to break these algorithms down into steps and have them explained visually to the user.

Here are the issues I’m working on until removing the alpha badge, some already pointed out by some of you:

  1. Have a render function for every node, no matter how it was created.
  2. Provide a convenient way to define the custom render function via json code.
  3. Enhance the overlay property to make it easier to use.
  4. Enhance the label property for better readability and automatic text aligning.
  5. Attach a click handler to the nodes to distinguish between drag and click events.
  6. An option to set a random seed for deterministic layouts.
  7. Enhancing the layout algorithm to also work with mostly linear graphs.
  8. Address the bug with numeric IDs.
  9. Better re-using existing connections.

Some of the issues I will address in the future:

  • Hide/show nodes
  • Set fixed positions for some nodes
  • Different layout options
  • An algorithm showroom, e.g. for search algorithms, binary trees, minimal spanning trees, maximum flows, etc. (working on it), like all those educational Java applets from the 90′s out there…
  • Animations (maybe)
  • A web site (working on it)
  • Data adaptors
  • Different connection modes
  • As this library is growing, and not everyone might need everything, some kind of a really basic dependency list would be nice..
  • Some measurement method to calculate the quality of some randomly created layouts and then picking the best one
  • Use currying wherever it makes sense and results in cleaner code. I love currying!

Here’s what it looks like in action currently (the tool-tip is just a dummy rounded square):

And the Dijkstra algorithm to search the shortest paths from Berlin to any city in the world:

See you next week!

Download

Raphael SVG Tooltip

25. April 2010

Achtung: Ich habe einen kleinen Fehler behoben!

Mit dieser Erweiterung können in Raphael Elemente als Tooltips an andere Elemente angehängt werden. Sie erscheinen, sobald man mit der Maus darüber fährt.

Raphael.el.tooltip = function (tp) {
    this.tp = tp;
    this.tp.ox = 0;
    this.tp.oy = 0;
    this.tp.hide();
    this.hover(
        function(event){ 
            this.mousemove(function(event){ 
                this.tp.translate(event.clientX - 
                    this.tp.ox,event.clientY - this.tp.oy);
                this.tp.ox = event.clientX;
                this.tp.oy = event.clientY;
            });
            this.tp.show().toFront();
        }, 
        function(event){
            this.tp.hide();
            this.unmousemove();
            });
    return this;
};

Verwendet wird das dann einfach so:

var paper = Raphael(10, 50, 320, 200);
paper.circle(100,100,10).tooltip(paper.rect(0,0,20,30));

Leider funktioniert das nicht mit set und ich habe auch nicht herausbekommen, wie man set um Funktionen erweitern kann. Eine weniger schöne Möglichkeit ist, die Elemente über das Attribut items anzusprechen:

var st = paper.set();
st.push(
    paper.circle(10, 10, 5),
    paper.circle(30, 10, 5)
);
st.items[0].tooltip(paper.rect(0,0,20,30));

Viel Spaß damit.

Retro WordPress Motiv

11. April 2010

Retrohappy Beta WordPress ThemeDas Motiv dieses Blogs gibt es nun als noch unfertige Version zum herunterladen. Es basiert auf dem bekannten WordPress-Motiv Kubricks und wurde stark an meine Bedürfnisse angepasst. Da ich es über dem offiziellem WordPress-Verzeichnis auch anderen frei zur Verfügung zu stellen will, möchte ich es noch erweitern und verallgemeinern. Es ist bereits flexibel, passt sich gut verschiedenen Auflösungen an und unterstützt Deutsch, Englisch. Hebräisch und Rumänisch. Das Archiv enthält die SVG-Quellen, ein WordPress-Motiv-Verzeichnis und eine allgemeine HTML-Version. Viel Spaß damit. Ich freue mich auf Wünsche und Rückmeldungen!

Download Retrohappy Beta WordPress Theme

PS: Wenn Dir dieses Motiv sehr gefallen hat, kannst Du Dich über diesen Link kostenlos und unverbindlich bei Dropbox anmelden und mir (und Dir) damit 250MB kostenlosen Online-Speicherplatz schenken :-)

PPS: Der Download-Link funktioniert wieder! :-)

Eine JavaScript-Bibliothek zum Darstellen von Graphen

2. März 2010

layouted graphAuf der Suche nach einem einfachen Weg, generische Graphen und Netze im Browser hübsch darzustellen, ohne jedoch auf Plugins wie Java oder Flash angewiesen zu sein, stieß ich auf diesen Code mit dem Namen „Graph JavaScript framework, version 0.0.1“. Es erlaubt das einfache Erstellen eines Graphenmodells, verteilt die Knoten dann schön und zeigt das Modell im Browser an. Leider war der Code so etwas von 2006 und verlangte zudem nach PrototypeJS.
Außerdem war seither nichts mehr damit geschehen.

Also nahm ich ein Raphael-JS-Beispiel zum verbinden geometrischer Formen und kombinierte es mit dem eben gefundenen Code. Der Layout-Algorithmus erzielte ganz ordentliche Ergebnisse. Nun kann man sogar Spaß haben und die Knoten mit der Maus umherziehen.

Diesen Beitrag weiterlesen »

Ein Tag im Paradies

11. Dezember 2009

Wie ist es, in Israel zu leben? Lustig ist es, und es macht unglaublich Spaß – zumindest als Freiwilliger. Von 2002 bis 2003 habe ich in Israel meinen Zivildienst in einer Kibbutz-ähnlichen Einrichtung für Behinderte abgeleistet. Ein beispielhafter Tag des Zivildienstes sei hier kurz zusammengefasst.

Diesen Beitrag weiterlesen »

Wie blendet man die Symbolleiste der LaTeX-Erweiterung von Gedit aus?

5. Mai 2009

Einfach und schnell geht das so: Man bearbeite die Datei der Erweiterung decorators.py, zum Beispiel mit

sudo nano /usr/lib/gedit-2/plugins/GeditLaTeXPlugin/src/base/decorators.py

oder je nachdem, wo es installiert ist, eben woanders. Um die Zeilen 307-310 müsste der Quelltext folgendermaßen angepasst werden (die Bedingung habe ich auskommentiert):

# FIXME: a hack again...
# the toolbar should hide when it doesn't contain any visible items
#if extension == ".tex":
# self._toolbar.show()
#else:
self._toolbar.hide()

Scheint ohnehin ein unsauberer Quelltext zu sein. Diese Gedit-Erweiterung wurde wohl gerade erst umgeschrieben. Nun ist man die LaTeX-Symbolleiste jedenfalls los.