BenBE's humble thoughts Thoughts the world doesn't need yet …

22.04.2012

Polen am Bau

Filed under: Fun — Schlagwörter: , , — BenBE @ 01:10:30

Wer kennt das nicht: Wieder einmal ist der Abfluss verstopft und die Küche könnte auch einmal einen neuen Anstrich vertragen. Nunja: Alles kein Problem!

http://www.youtube.com/watch?v=NxWNQ2paWO4&feature=related

Also viel Spaß beim nächsten Ruf der Handwerker!

Flattr this!

15.04.2012

DCPU-16 highlighting

Filed under: GeSHi — Schlagwörter: , , , — BenBE @ 00:55:54

Not quite 0x0001 0000 0000 0000 years since the last post in this category but still long enough to justify emitting a new sign that there’s still some developement going on with GeSHi. And it’s quite a coincidence that Markus „Notch“ Persson is taking over GitHub with its own new language now being highlighted. And since most assembly languages are quite easy to highlight it’s only natural to add support for highlighting of this new language for GeSHi.

So there it is: After only about 10 minutes looking at the language specs the basic structure looked simple enough and since GeSHi already supported a bunch of different assembly languages it’s only natural to use another one of them as the template. In this case I decided go for Z80 assembly as the ZiLOG Z80 instruction set is quite simple and still the language file was elaborate enough to support all the features required by Notch’s new assembly language. Actually: I even could remove some features not required to properly highlight DCPU-16.

After a short clean-up of the language file – removing all the old instructions, registers and directives – it took only few more steps to fill in the list of supported instructions: In the case of the DCPU-16 instruction set this is a quite small set of only 16 instructions, 11 registers and 3 „memory shortcuts“. Thus there was not that much to copy from the specs, althoug the example given there looks quite nice when rendered with this new language file:

; Try some basic stuff
              SET A, 0x30              ; 7c01 0030
              SET [0x1000], 0x20       ; 7de1 1000 0020
              SUB A, [0x1000]          ; 7803 1000
              IFN A, 0x10              ; c00d 
                 SET PC, crash         ; 7dc1 001a [*]
              
; Do a loopy thing
              SET I, 10                ; a861
              SET A, 0x2000            ; 7c01 2000
:loop         SET [0x2000+I], [A]      ; 2161 2000
              SUB I, 1                 ; 8463
              IFN I, 0                 ; 806d
                 SET PC, loop          ; 7dc1 000d [*]

; Call a subroutine
              SET X, 0x4               ; 9031
              JSR testsub              ; 7c10 0018 [*]
              SET PC, crash            ; 7dc1 001a [*]

:testsub      SHL X, 4                 ; 9037
              SET PC, POP              ; 61c1
                
; Hang forever. X should now be 0x40 if everything went right.
:crash        SET PC, crash            ; 7dc1 001a [*]

; [*]: Note that these can be one word shorter and one cycle faster by using the short form (0x00-0x1f) of literals,
;      but my assembler doesn't support short form labels yet.     

There were no major problems, except for some trouble with two regular expressions which broke rendering; but since those weren’t needed I could just simply remove them.

If you like to try out the language file for yourself just visit the main GeSHi site or grab a copy of the language file directly from the SVN trunk.

Flattr this!

29.03.2012

Nicht verfügbar

Filed under: Fun — Schlagwörter: , , — BenBE @ 19:00:19

Manchmal sieht man solch eine Meldung gerne:

Diese Partei ist in deinem Bundesland nicht verfügbar. Das tut uns leid.

Ach ja, wäre noch zu klären: „Ist die FDP noch im Landtag?“ Fragt sich nur wie lange noch.

(via)

Flattr this!

25.02.2012

Printer Music

Filed under: Fun — Schlagwörter: , , , — BenBE @ 21:12:36

Hier mal die Laufschrift auf dem kleinen Display am unteren Rand, da die doch an einigen Stellen recht schnell durchscrollt:

Loading …

Welcome to this oldskool demo presented at DreamHack Winter 2002 in Elmia. Jönkoping, Sweden.

The hardware you see is an old typewriter from the mid 80’s (probably 1985) called Brother BP-30.

It is interfaced through a home built platform based on two 8-bit microcontrollers and a TINI, an ethernet-connected microcontroller running Java. The music you hear (if you ignore the noise made by the typewriter) is a stripped-down XM file and is loaded into one of the two 8-bit microcontrollers, making it a true chiptune (har har), namely an Atmel mega163 running at 3.69 Mhz with a memory of 16 kB flash and 1 kB SRAM.

The XM playing code itself takes 1084 bytes and generates music at a sample rate of 11025 Hz, leaving only 334 clock cycles for each sample. The sound is converted from digital to analogue output through a custom built DAC consisting of 27 resistors and an amplifier from an old soundcard. The air is energized with sound waves using an old PC-speaker.

The microcontroller interfacing the typewriter motors and LCD controller is an Atmel 9098515 also running at 3.69 MHz. The demo code itself is loaded into the TINI as compressed Java bytecode and makes together with graphics data up a total of 17 kB.

TINI runs a very stripped-down Java environment (no built-in sine functions for instance) based on JRE 1.1.8 and stores both file system and program memory on 1 MB of RAM.

***

Credits:
Idea, hardware, code: psykotron

Music: flydoe

Drawn art: psychonaut

Additional code & art: treo

Special thanks to Flare for releasing XM player source to the public.

***

Well, what can we fill this scroller now then..? Perhaps some project history.

The project started this summer when the typewriter motors were successfully interfaced using a BS2SX microcontroller which was later abondoned for the Atmel microcontroller.

Java based demo parts were continiously added during the fall.

Creation of the XM player started 20 days ago.

The final hardware platform was soldered last weekend. Music and graphics were created the last days before DreamHack. The final composition started some hours before the deadline.

***

Greetz to Razor 1911, Fyllecell, Scania, DRM, d4rkn3ss, Kaotix and all other oldskoolers out there.

***

Ok, now let’s do a complete round-up of the hardware. Brother BP-30 typewriter, ATmega163, AT9098515, 3.6864 MHz oscillator, TL074CN Op-Amp, a number of resistors, 0.5 W 8 Ohm PC-speaker, DSTINI1+1MB, TINI Socket E10, prototyping PCB, wires (for instance some old IDE and floppy cables).

As you probably have noticed, the typewriter loads four differently coloured pens, which are cycled automatically by taking the pen to the rightmost position and then back. The pens have been used sparingly during testing as a large quantity of replacement pens cannot be guaranteed to exist.

***

***

Unfortunately, our 5 minutes are up. We hope you have enjoyed this oldskool demo and thank you for watching.

Auf jeden Fall genial gemacht!

Flattr this!

29.01.2012

Cat Desk Bed

Filed under: Fun — Schlagwörter: , , — BenBE @ 16:28:18

Für manche Probleme, wie etwa die Beziehung von Katzen zur eigenen Tastatur:

Its very hard to code with one hand and pet a cat who is half on your keyboard w/ the other. I need Dan to come home, take care of the kids.

gibt es ganz einfache Lösungen:

You need the cat desk bed! (of course, cat won’t use it anyway)

(via hier und Twitter)

Flattr this!

28.09.2011

Überblick über Projektaktivität gewinnen

Filed under: Software — Schlagwörter: , , , , — BenBE @ 22:13:15

Manchmal hat man ein Projekt, von dem man gerne wissen möchte, ob noch aktiv an diesem entwickelt wird. Aber nicht immer sind entsprechende Grafiken mit aussagekräftigen Zahlen verfügbar. Eine recht einfache Möglichkeit, dennoch einen Überblick zu bekommen, ist ein Blick in die Commit Logs des Projektes. Wenn diese viel Aktivität zeigen, ist ein Projekt mit sehr hoher Wahrscheinlichkeit noch aktiv. Aber stupide Datumswerte sind oftmals recht schwer zu überblicken. Etwas mehr Grafik wäre hier wünschenswert. Und genau hier kann man mit etwas Bash Magic und ein wenig RRDTool nachhelfen. (more…)

Flattr this!

04.09.2011

Neue Türen für alte Züge

Filed under: Fun — Schlagwörter: , — BenBE @ 21:50:10

Graffiti sind immer wieder ein Ärgernis für das Stadtbild. Während man häufig nur irgendwelche Schmierereien mit wenigsagendem Inhalt findet, gibt es doch auch hin und wieder einmal die Künstler unter den Leuten mit der Sprayflasche. So geschehen mit einem Zug der deutschen Bahn in München, bei dem der äußere Anstrich etwas korrigiert wurde:

Die Tür ist nicht, wo sie scheint

Na, wo würden Sie einsteigen? Na? Die richtige Antwortet lautet hier: Bei den schmalen Doppelfenstern. Wie? Schauen wir doch einmal aus einer etwas anderen Perspektive auf die Dinge:

Bei genauerem Hingucken ist die virtuelle Tür erkennbar

Sollte auch dieser Blick noch nicht beim Einsteigen helfen, sollte man sich die vermeintliche Tür einmal aus nächster Nähe betrachten, denn diese ist in sich ein wahres Meisterwerk!

Die Künstler wahren Detailverliebt!

Schaut man genau hin, fallen der etwas zu kräftige Türöffner-Knopf und die etwas unsauber umgesetzten Gummi-Einrahmungen der Fenster zwar auf; insgesamt hat sich der Künstler aber alle Mühe gegeben. Soetwas sieht man nur selten im Stadtbild! Respekt!

Story via Firewulf, Bilder via ilovegraffiti.

Flattr this!

03.09.2011

Technische Notwendigkeit

Filed under: Server — Schlagwörter: , , , , , — BenBE @ 02:50:29

Ich habe mir da einen neuen Server geholt und eine der Sachen war nun, dass abzusehen war, dass mehrere der zu installierenden Dienste sich ins Gehege kommen würden. Also grob gesagt: Es gab 3 Dienste, die liebend gerne auf Port 53 laufen wollen. Nun sind IPv4-Adressen knapp und der neue Hoster achtet etwas strenger drauf, wofür man die haben möchte. Da ich aber wenig Lust auf irgendwelche Sonderkonfigurationen hatte, um jeden Service auf einem andere Port zu betreiben und am Ende alles irgendwie zu verdrahten, habe ich mir also überlegt:

  • Auf der Haupt-IP des Servers wird der gesamte Web-Krams, sowie Public-Services laufen. Hier läuft auch der erste der konfliktierenden Services: Ein offener DNS-Recursor, den jedermann als DNS-Server in seinem Router eintragen kann. Soweit unspannend also.
  • Die erste spannende Geschichte läuft nun auf der ersten Zusatz-IP. Diese beherbergt (zur Zeit) einen autoritiven DNS-Server, der auf eine Reihe von meinen eigenen Zonen autoritiv antwortet, was u.a. meine Blacklist für Client-IPs betrifft, die über meinen Mailserver relayn wollten.
  • Und bei der zweiten zusätzlichen IP schließlich laufen eine Reihe von VPN-Dienste, die in Kooperation mit dem Freifunk Chemnitz bereitgestellt werden.

Man geht also beim Provider in das Webinterface und bestellt über das verfügbare Interface die IPs. Als Teil dieser Prozedur wird dann auch bereits nach einer Begründung gefragt. Was aber noch nicht verraten wird, ist die Angabe, um welches der zahlreichen RIPE-Dokumente es sich bei den erwähnten Vergabe-Richtlinien handelt, anhand derer die Vergabe entschieden wird. (more…)

Flattr this!

24.08.2011

Schleifchen erwartet

Filed under: Software — Schlagwörter: , , , — BenBE @ 12:30:50

Unter der Kategorie Kuriositäten kann man glaube folgenden GCC-Bug abhandeln, der bei mir mit folgendem Source auftrat:

        // Run the job we've taken
        if(cleanup_func) {
            pthread_cleanup_push(cleanup_func, cleanup_arg);
        }

        job_func(job_arg);

        if(cleanup_func) {
            pthread_cleanup_pop(1);
        }

Wobei job_func ein normaler Callback-Typ der Form

typedef void (* dispatch_func_t)(void *);

ist, also einen Pointer entgegen nimmt und nix zurückliefert. Nunja. Versucht man obigen Source (im Zusammenhang mit etwas mehr Source eines Thread-Pools zu compilieren, erhält man recht überraschend eine Fehlermeldung vom GCC (4.6.1-4):

gcc -g -Wall -Werror -std=c99 -I./src -O9 -o ./obj/threadpool.o -c ./src/threadpool.c
./src/threadpool.c: In Funktion »_threadpool_dowork«:
./src/threadpool.c:120:9: Fehler: expected »while« before »job_func«

Und ja: Der will da wirklich ne While-Schleife haben! Geben wir sie ihm also:

        // Run the job we've taken
        if(cleanup_func) {
            pthread_cleanup_push(cleanup_func, cleanup_arg);
        }

        //GCC fails if I DON'T write a while loop here. Let's make it happy!
        while(0);

        job_func(job_arg);

        if(cleanup_func) {
            pthread_cleanup_pop(1);
        }

Und der GCC ist zufrieden.

Flattr this!

02.08.2011

FizzBuzz BrainFuck

Filed under: Fun,GeSHi — Schlagwörter: , , — BenBE @ 01:17:35

Well yeah, after some nasty person dropped a link about why programmers are so bad at programming I somehow got to have a look at the Rosetta Code project’s site detailling this task and found (not to my surprise) that noone had solved that task — yet! So I sat down and implemented it. Usually this task should take you only about a few minutes but since I hardly ever programm anything in BrainFuck it took me roughly 45 minutes to complete. But well: Here’s the result (Beware: Ugly code)! (more…)

Flattr this!

« Newer PostsOlder Posts »

Powered by WordPress