> Category: misc ¦ Atom

Visualizing sorting Algorithms with D3

In my Algorithm class, we had to implement our own sorting algorithm as an exercise in pseudo-code. It was very simple: Alternatingly iterate over an array from beginning to end and from end to beginning, always swapping pairs over numbers which are not correctly sorted. Repeat until finished.

In Python (you can also [cached]download a runnable versionspan)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
def sort(a):
  lower_limit = 0
  upper_limit = len(a) - 1

  while(lower_limit != upper_limit ):
    i …

LifeSaver - Game of Life as Screensaver

Recently, I promised you that I'd write my own screensaver. Well, here it is - an implementation of [cached]Conway's Game of Life using [cached]xscreensaver and OpenGL. It's based on the Python implementation I wrote, but quite a bit faster thanks to some trickery. Here's how it looks like:

Screenshot of the Screensaver

Since I need to blit a lot of pixels for each frame (all changed cells + all those that died recently and are fading away), I decided to use an OpenGL texture for drawing. That way, my dense array gets painted directly to the screen. To avoid unecessary copying, I've interleaved the …


A fairly minimal xscreensaver

Today, I wanted to write my own screensaver, so I started looking for frameworks. Quickly, I found [cached]xscreensaver, the de facto standard (?) for screensavers on X11.

The readme does mention two example screensavers developers should use to start out, but they still contain some superfluous stuff (GOTOs !). To get a better understanding of the framework, I set out to reduce them as much as possible. Without further ado, here's the result of my work. Stay tuned for my finished screensaver.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19 …

gzip your Octopress

When I read Hacker News today, I found a very cool post: [cached]Make your website fast. (And why you should). Of course, I wanted to try this out myself - one of the major reasons I went to S3 for hosting was increased speed.

Now by default, octopress doesn't include anything to help you here - S3 requires that you gzip your static content files manually. Aditionally, you have to set the correct content header! Now, a bit of googling quickly led me to an [cached]excellent post from Frank Fusion. (After some trial and error with the aws/s3 gem …


Plotting with julia

Maybe you've already heard it: There's a new language on the block - Julia. She seems to be a hot contender for the new standard scientific computing language, maybe also replacing R for statistical analysis.

Julia is a high-level, high-performance dynamic programming language for technical computing, with syntax that is familiar to users of other technical computing environments. It provides a sophisticated compiler, distributed parallel execution, numerical accuracy, and an extensive mathematical function library.

Of course, it's a very young language, so they standard library is quite small right now. For example, you can also plot to the webinterface, not to …


Protecting your mails with GnuPG

You probably know that you can encrypt and sign your emails using GnuPG, and there's even a bunch of programs and plugins to make it easier for you. However, if you are like me and use Gmail's browser interface, there's no plugin for you. Your only choice is to copy & paste your mails to some external program, encrypt / decrypt them and paste them back into Gmail. Certainly not very comfortable.

Today, I set out to change this. I wrote a small Chrome extension which interfaces with GnuPG so you can encrypt and decrypt your mails directly from the browser. It …


V-Hand

The V-Hand's purpose is to capture all hand and finger movements.

Out of order, but inserted here as reminder for myself: To increase accuracy, the next version of the V-Hand will have a 3-axis compass built in. This can be used to make sure rotation information from the gyroscopes doesn't drift. More or less, the V-Hand is an Inertial Navigation System without external references.

Basically, it's a glove with an Accelerometer, a Gyroscope and Potentiometers for tracking the fingers:

An Arduino Nano comes in handy to process all the data and send it to a PC:

The pictures above show …


Game of Life

Inspired by [cached]a post on reddit, I decided to write this Python implementation of Conway's Game of Life. To spice things up, there's a twist: The outer border continues to randomly seed the field with new cells.

Additionally, newly deceased cells slowly fade back to black to make things more interesting to watch.

Source code is of course available at [cached]GitHub


Retro-Hosting on Amazon S3 - why you don't need a fancy VPS for your website

When I recently searched for a solution to host a large VM for a client to download, I remembered Amazon S3. Why deal with some shitty One-Click Hoster if I can just upload it to Amazon, pay a few cents and enjoy fullspeed and direct downloads?

The following night, I realized that I could just as well use this to host my website. Why waste a VPS on the task if the content hardly ever changed? Just generate the html files in advance and then use S3 to serve them. Obviously, I wasn't the first to come upon this idea …


P2P DNS

I don't really like the direction of the "official" project, especially the part where they decided to use a central authortiy, so I started my own. This is a true distributed approach, for everything else we don't need to develop anything new.

The basic idea is that each and every node of the network caches all the domains we have. Before you cry foul, let's look at how much space this will really need.

Our DNS record has several parts:

  • The domain itself. At 8 bit for one char, we'll assume a generous average length of 50 chars, which leaves …

© Julian Schrittwieser. Built using Pelican. Theme by Giulio Fidente on github. .