What I've got to say @astolwijk

About me

I am a Dutch Web and MooTools Developer and I create Websites and WebApps.

I'm also an Embedded Systems student at the TU Delft.

You can find me at other cool places too, like twitter or github.

github.com/arian

Tree Traversal, Depth first and Breadth first in Haskell

Lately I'm really digging Functional Programming, and especially Haskell. I've been reading Real World Haskell, which is a very nice free book about Haskell.

Today I was wondering what Breadth First traversal was. Of course I should know this and it‘s stupid I forgot. To make sure I wouldn’t forget in the future I made a little exercise to improve my Haskell skills, and to make sure I wouldn't forget the Breadth First algorithm anymore.

Dynamic disassembling instructions with ptrace and udis86 for timing analysis

For a University assignment for a course called Real-Time Systems we had to implement a prototype for timing analysis by tracing instructions.

The idea is that when executing a program, ptrace controls the execution and stops after each instruction. After this the actual instruction in the memory can be fetched. Knowing which instruction is executed you could associate this with a certain time, add all times together for each instruction and you could dynamically determine how long a program would run: profit!

I made a prototype that can be viewed on GitHub.

Setting up a MySQL database

This post is just for future reference with a few MySQL commands I can't really remember yet for creating a new database and mysql user. Probably now I posted them here, I will remember them ;). So it might be interesting or less interesting for you.

First, login as root with:

mysql -u root -p

If you forgot your root password, follow these steps:

sudo service mysql stop
sudo mysqld --skip-grant-tables &
mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('YOURNEWPASSWORD') WHERE User='root';
mysql> FLUSH PRIVILEGES; exit;

When logged in, create a new database:

CREATE DATABASE databasename;

And create a user for it, if we want a separate user at least:

GRANT ALL ON databasename.* TO myuser@localhost IDENTIFIED BY 'mypassword';

And that's usually what you need to know.

Reactive Programming

Most programming languages or techniques nowadays are sequential. When executing a statement c = a + b, c is the result of the addition of the current values of a and b. If either one of those variables change their value, c is not changed.

var a = 5;
var b = 10;
var c = a + b;
console.log(c); // logs 15
a = 20;
console.log(c); // still logs 15

I have a Blog!

Usually I don‘t have too strong feelings about certain topics. Still, I wanted to create a place where I can write about stuff, when I’ve created something on GitHub or some other in-dept blogpost. I've written on the MooTools Blog but sometimes I‘d like to write about something else. Don’t expect lots of posts, I'm not a David Walsh ;).

I have a healthy hate for WordPress, and I wanted something simple, so a static blog generator would be really cool, especially if it‘s written in Node. Some people think it wouldn’t be even interesting if it wasn't written in Node or Lua. So this blog is generated by a static blog generator called hexo. I tried a few, but this mostly just worked. It uses Stylus for CSS and ejs for templating, which is really nice. I could‘ve made my own, but hey, sometimes it’s just better to use something what's already there.

I wanted to keep my homepage however. This shows my latest tweets and latest updated GitHub repositories. This was written already in PHP, running on very cheap-ass shared hosting, so I made a little script that it generates an index.php file, which actually isn't static.

Like with a lot of my work, I just put this blog on GitHub, so if you see a typo, you don't have to put it in the comments, but you can send me a pull request!

Some remarkable facts during the production of this blog:

  • I used two spaces!
  • For the bit JS I wrote, I used ) { instead of ){.
  • FTP for “deployment” feels so good.
  • All semicolons are nicely placed after each line of JavaScript.
  • Look Ma, Responsive Design!!11!