Skip to main content
laria.me

Tag: programming

mass-mp3-retag.sh

Published
Tags

I needed to tag some MP3 files to transfer them to my Hi-MD player (I know, I'm a technological caveman sometimes...). Since I have the most important music infos encoded in the directory structure, I could write a little shell script to automate this.

#!/bin/sh

# Mass retagging of mp3 files that don't have ID3 tags.
# The MP3 files must be named like this to use this script:
# ./<first letter of artist>/<artist>/<album>/<track number> - <title>.<file extension(s)>
# ^-- The current working directory

exsomething() { echo "$1" | sed 's#'"$2"'#\1#'; }
exartist() { exsomething "$1" '^\././\([^/]*\)/.*$'; }
exalbum() { exsomething "$1" '^\././[^/]*/\([^/]*\)/.*$'; }
extrack() { exsomething "$1" '^\././[^/]*/[^/]*/0*\([0-9]*\)\s*-.*$'; }
extitle() { exsomething "$1" '^\././[^/]*/[^/]*/[0-9]*\s*-\s*\([^\.]*\)\.[^\.]*$'; }
hasinfo() { id3info "$1" | grep Title >/dev/null; }

retag() { id3tag -a"$(exartist "$1")" -A"$(exalbum "$1")" -s"$(extitle "$1")" -t"$(extrack "$1")" "$1"; }

find -type f | while read fn; do
    if ! hasinfo "$fn"; then
        retag "$fn"
    fi
done

https://gist.github.com/silvasur/4508b9c695a124f239ac

This is why a Unix-style system beats Windows: You can combine simple tools with a simple, yet powerful programming language to automate almost everything if you want to. On Windows you'd probably have to download a 3rd party program for that.

Bret Victor - The Future of Programming

Published
Tags

http://vimeo.com/71278954

Apparently not many big things have happened in the field of programming in the last 40 years. This talk shows many awesome techniques that were invented back then. They still aren't in widespread use.

Via Rob Pike's Twitter

Cruisin 3 by Abyss explained

Published
Tags

https://www.youtube.com/watch?v=NCbb86jphn4

This video explains the magic behind the fantastic Cruisin 3 demo (here is the original video).

mndlbrt

Published
Tags

http://mndlbrt.onekb.net. The link is dead now, so here is a version hosted on this page.

onekb.net offers ultra cheap hosting... if you can fit your stuff into 1024 bytes!

I decided to write a mandelbrot renderer in 1kb. mndlbrt is the result! You can zoom and even share the current image with others (the URL automtaically updates to represent the current area). Also learned a bit about the HTML canvas in the process, which has a surprisingly sane API for webstandards.

Concurrency Is Not Parallelism

Published
Tags

https://www.youtube.com/watch?v=cN_DpYBzKso

A great talk from Rob Pike about concurrency and the Go programming language. Definietely worth the 30 minutes.

Some small Go libraries

Published
Tags

I've published buzhash (a rolling hash implementation) and binproto (a binary protocol). Both were part of a larger project that I will probably never publish or finish. But perhaps these libraries will be useful for someone.

command center: Self-referential functions and the design of options

Published
Tags

very push

Published
Tags

What do you call a group of 8 hobbits?

Published
Tags

A hobbyte!

Updates for biomed

Published
Tags

I have made some improvements to biomed, my biome editor for Minecraft maps:

Read more ...

Dave Baggett's answer to Programming Interviews: What's the hardest bug you've debugged?

Published
Tags

http://www.quora.com/Programming-Interviews/Whats-the-hardest-bug-youve-debugged/answer/Dave-Baggett?srid=pxH3

Dave Baggett describes the horror of hardware bugs. Very interesting read!

mailremind

Published
Tags

https://code.laria.me/mailremind

I've written a web-based service that allows you to send yourself an email based on a schedule: mailremind.

Why? Because I often send myself an email to remind me of something and I thought it would be useful if I could send mails in the future or based on a schedule (e.g. useful for birthdays).

If you also think this is useful, you can have your own installation (it is quite easy to configure), or you can use my public mailremind installation: mailremind.silvasur.net

gomcmap updated

Published
Tags

https://code.laria.me/gomcmap

I updated gomcmap, my Go library for handling Minecraft maps.

  • New Biomes and blocks from the recent snapshots were added.
  • Adding Chunks implemented.
  • Removing chunks implemented.
  • RecalcHeightmap fixed.

biomed was updated

Published
Tags

I updated biomed. A bug in the weather condition fix code was fixed (snow could fall through glass because of Minecrafts weird definition of a height map).

There is now also an experimental minecraft-1.7 branch which adds the new biomes that the recently released snapshots introduced. When Minecraft 1.7 is out, I wil merge that branch into master.

CSS summed up in a GIF

Published
Tags

biomed

Published
Tags

https://code.laria.me/biomed

I've written a GUI Tool that allows you to edit the biomes of your Minecraft maps, biomed.

It is written in Go and uses my gomcmap library and go-gtk as a GUI toolkit.

It currently runs under Windows and Linux and should also run on other operating systems, such as OSX.