Thursday December 15th, 2011
Hi, just released a clone of colors.js but with less code, in Coffee and with more colours:
https://github.com/strathausen/culoare
Here’s the original:
https://github.com/Marak/colors.js
Interesting, by going to Coffee the code lines dropped by around 30% and the code is only half the size in terms of memory. This comparison may not be fair, as I dropped the HTML support, but that’s just about 20 lines but I’ve also added other features.
Posted in Hacking | No Comments »
Thursday September 8th, 2011
Sorry, this entry is only available in Deutsch.
Posted in Hacking, Linux | No Comments »
Tuesday August 17th, 2010
A small picture I’ve made some time ago…

Tags: animal, atomkraft, cow, environmental, fukushima, genetic, mutation, nuclear power, pollution, tchernobil, ucraine, umwelt
Posted in Creativity, Fun | No Comments »
Saturday August 7th, 2010
Tags: batik, einzigartig, handgefärbt, hobby, künstlerbedarf, paramentik, patchwork, prestashop, quilt, stoff, unikatstoff
Posted in Hacking, Creativity, News | No Comments »
Wednesday August 4th, 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. Read the rest of this entry »
Tags: bulk, colour, csv, import, magento, presta, prestashop, python, shop, sort, sorting, xt-commerce, xtcommerce
Posted in Hacking, Linux | No Comments »
Tuesday June 1st, 2010
Edit: This library has moved to it’s own 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:
- Have a render function for every node, no matter how it was created.
- Provide a convenient way to define the custom render function via json code.
- Enhance the overlay property to make it easier to use.
- Enhance the label property for better readability and automatic text aligning.
- Attach a click handler to the nodes to distinguish between drag and click events.
- An option to set a random seed for deterministic layouts.
- Enhancing the layout algorithm to also work with mostly linear graphs.
- Address the bug with numeric IDs.
- 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
Tags: bellman-ford, binary heap, browser, dijkstra, dracula, edge, floyd-warshall, graph, javascript, layout, node, raphael, raphaeljs, svg, tooltip
Posted in Hacking | 1 Comment »
Sunday April 25th, 2010
Edit: I’ve just fixed a small bug in the code!
This extension allows you to attach tool tips to Raphael SVG elements. They appear on mouse over.
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;
};
Use it simply by calling:
var paper = Raphael(10, 50, 320, 200);
paper.circle(100,100,10).tooltip(paper.rect(0,0,20,30));
Since Raphael currently does not offer a way to attach custom functions to set, here’s a less elegant way to get tool tips working on set: by accessing the child elements by its attribute items:
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));
Enjoy.
Tags: javascript, raphael, svg, tooltip
Posted in Hacking | 7 Comments »
Sunday April 11th, 2010
The WordPress-Theme used by this blog is now available for download as a preview version. It is based on the well-known default WordPress theme Kubricks and has been changed to fit my needs. Since I would like to make it available for free to others as well, via the official WordPress theme directory, I want to extend the theme to be more generic. It is flexible and adopts nicely to different screen sizes. Currently, German, English, Hebrew and Romanian is supported. The archive contains SVG source files, a WP-Theme directory and a basic generic HTML version. Enjoy it and please give me feedback!
Download the Retrohappy Beta WordPress theme.
PS: If you really liked the theme, you can thank me by registering for free to the Dropbox online storage service via this link and thereby giving me another free 250MB storage capacity
Retrohappy Beta WordPress ThemeThe WordPress-Theme used by this blog is now available for download as a preview version. It is based on the well-known default WordPress theme Kubricks and has been changed to fit my needs. Since I would like to make it available for free to others as well, via the official WordPress theme directory, I want to extend the theme to be more generic. It is flexible and adopts nicely to different screen sizes. Currently, German, English, Hebrew and Romanian is supported. The archive contains SVG source files, a WP-Theme directory and a basic generic HTML version. Enjoy it and please give me feedback!
Download the Retrohappy Beta WordPress theme.
PS: If you really liked the theme, you can thank me by registering for free to the Dropbox online storage service via this link and thereby giving me another free 250MB storage capacity
Tags: happy, html template, retro, retro stripes, template, vintage, wordpress theme
Posted in Hacking, Creativity | No Comments »
Tuesday March 2nd, 2010
I was searching for an easy way to display graphs in the browser without having to rely on plug-ins like Flash or Java and I found this piece of code named “Graph JavaScript framework, version 0.0.1“. You could simply add some nodes to a graph model, and then layout and having it displayed. Unfortunately, it was soo three years ago and had a PrototypeJS dependency. Besides that, nothing happened to the code since then. So I took the RaphaelJS example to connect some shapes and plugged it together with that code I found. The algorithm used by the Graph Frameork 0.0.1 is quite solid and mostly produces pleasant results. You can now even have fun dragging around the nodes.
Read the rest of this entry »
Tags: browser, graph, javascript, layout, math, raphael, raphaeljs
Posted in Hacking | No Comments »