Pavol Rusnak #cypherpunk #hacker #openhw #privacy #bitcoin #newmediaart

Idea Factory - Mycelium Animated Photos

This post is a part of Idea Factory series.

One evening I found really nice work by Ryan Alexander where images are created by simulating a life of mycelium. I was wondering how it was done and I came up with my own Processing sketch that creates something similar (although not as quite nice as the original work).

The principle is simple: you take an image and convert it to grayscale. The brighter (or darker) is the pixel, the more food you put on that particular position. Then you run several autonomous agents that feed from this food, move randomly, die if they are starving and multiply if they are well enough. The original photos and the mycelium growing process can be seen here:


The idea is to create a mobile phone application that is able to take a photo from a camera (and/or open a gallery photo) and runs the described process on it. The final result or animated GIF of the process could be then uploaded to the Internet and shared among your friends.

Idea Factory - Semantic Patches on Github

This post is a part of Idea Factory series.

Two years ago someone sent me quite weird pull request on Github. It took me some time to realize that the only change was the removal of whitespace at the end of the lines of all files. Commit message contained a link to some software development company so the whole effort could be considered as some kind of spam or publicity stunt.

But it sparked an idea!

When I was at FOSDEM I saw a great talk about Coccinelle which is a tool for semantic patches. These are similar to normal patches, but they contain something like expressions which are being matched during applying of the patch. That way they apply the change to usually more places of the codebase not just one (which is the case when using “normal” patches). Basically, you want to come up with most generic “rule” that fixes one particular issue, but it’s not triggered at any other time. Some examples how Coccinelle was used in Linux kernel development are here.

Another quite common example (which I’ve seen at many, many places while working as a package maintainer at SUSE) is the wrong usage of strncpy function. The last argument has quite different meaning than the one used in strncat function. It is the maximum length of the appended string, not the size of the whole output buffer. The patch fixing this issue is similar to the following:

--- source.c
+++ source.c
@@ -34,7 +34,7 @@
   return 0;
-strncpy(buf, player, sizeof(buf));
+strncpy(buf, player, sizeof(buf) - sizeof(player) - 1);
 if (verbose)

This patch obviously fixes the problem only at one particular place. Semantic patch that fixes all wrong usages of the function might look like this (but please don’t take my words for granted, I have not tested it):

identifier dest, src;
-strncpy(dest, src, sizeof(dest));
+strncpy(dest, src, sizeof(dest) - sizeof(src) - 1);

So back to the idea:

  1. Collect the most common programming mistakes people make.
  2. Create semantic patches for fixing them.
  3. Write a bot that scans Github for these issues and creates a pull request when necessary.
  4. PROFIT!

While writing this post I found this article which says that bots are generally not welcome on Github. But I think if the pull requests are reviewed by a person and the fixing rules are beneficial to everyone, then it might really be worth a try!

Idea Factory - Facebook Random Comics

This post is a part of Idea Factory series.

Recently my friend sent me a link to this great random comic generator at Pandyland. My idea is to create a similar application but instead of the drawn figures it would use your friends photos from Facebook. One could check which of his/hers friends should appear in the comic (or leave it to a random chance), select the layout of the comic strip (e.g. 3x1 frames, 2x2 frames, etc.) and click the generate button. The application then calls the Facebook API which returns reasonable photos together with their metadata (such as who is in the picture and at what pixel position, the API already includes that kind of info in the results). Next step is to add speech bubbles filled in with either random sentences or leaving the bubbles empty so one can add his/hers own replicas. Lastly, a nice frames and a title are added, so the result could be shared back to Facebook or any other webiste as one image.

Idea Factory - Coin Counter

This post is a part of Idea Factory series.


The idea is simple: create a mobile phone application that is able to count coins (and their values) from the photo. You pour coins from your wallet on the table, make sure they don’t overlap by spreading them, take a photo and voila the phone will tell you exactly how much money in coins you have. User can select what currency is she using (dollars/cents, euros/cents, etc., to make the recognition easier). Using OpenCV or some other computer vision library should make this task pretty easy.

Special points awarded if the application is using realtime augmented reality, but for this particular case it is not necessary.

Idea Factory

From time to time I come up with the “ultimate idea”, but because I don’t have usually time to implement it right away I put it in my backlog. Unfortunately, the backlog is growing bigger and bigger and I started to realize there are some ideas on the list to which I’ll never return, but still they would be nice to have. There are lots of bright minds out there, so I decided to start publishing the ideas from the backlog list. Maybe someone will find them interesting enough and implement them. Heck, maybe someone will be able to build a successful startup around some of them. For that case I put the donate section in the sidebar, so you can do me a favor once you are a millionaire. :-)

But, enough talking, here are the ideas! I’ll keep adding links to this list in the future:

  1. Coin Counter
  2. Github Semantic Patches
  3. Pack My Stuff
  4. Mycelium Animated Photos
  5. Facebook Random Comics