Flo in Japan
Flo took some time off and travels through Japan: beautiful temples, capsule hotels, akihabara and more impressions are photo-documented in every detail. And whenever he has some minutes to spare, he hacks on his blog. By the end of the trip it might even have some useful features :)
Check his Tlog (travel blog) out at blog.codeflow.org.
Update: Source code to his tlog available under AGPL.
Last p0st
I have been keeping this blog as a personal diary so I can answer myself questions like
"when did I do X?" - well easy, I just have to search in my blog. Sometimes I
forget solutions to
common problems and having things written down somewhere accessible sure helps.
The major drawback is that writing for an audience, even if its small, requires much
more time than a 'note to self'. I will therefore put this blog 'on hold' for an
indefinite amount of time .
If you would like to read a good blog, I can suggest you Sebu,
Anarchaia, Corsin's Geekness,
Gruber's Daringfireball, Mark Pilgrim,
Cabel Sasser, John Resig,
Ryan Tomayko - a selection
of blogs I have been reading myself and will continue to read.
Is there actually a real equivalent to the first post? Conceptually, this will be a hard thing to do.
A lot of fun with iChat
For our project in software engineering, we evaluated software which would allow us to do conference calls over the internet. Skype can either do audio conference calls or video chat between two participants, but not conference calls between multiple peers. iChat on the other hand, can also handle video conferences with multiple participants (we didn't find another program which could do that). Testing the application ended up being a lot of fun:
Does anyone else know of a program which can do video conferences with multiple participants? It should be free and may also run on Windows.
Internet terminals at the EPFL
What's wrong with the following picture?

Well, this is an internet terminal running Gimp.
So how did we execute an arbitrary program on Firefox? Entering
file:///usr/bin/xterm into the address bar will prompt
you to download the program, but you cannot execute it that way. Someone
(not me) came up with the idea to replace the printer command from
lpr to xterm, since printing a page will
execute a program.
Since Firefox' menu bar is hidden, enter javascript:print()
into the address bar. The printer properties will show up, where you
can enter an arbitratry command such as xterm or
gnome-session.

Now click on print - and voilà!
Working for the LAMP

I am excited about the fact that as of today, Julien and me will be working for the LAMP (the Programming Methods Laboratory) here at the EPFL. We will be doing paid work (as opposed to academic work) on the Scala Compiler. I won't reveal what we will be working on right now, since I prefer to first become comfortable with the compiler's code base and as soon as we have actual results, I will present them to you. For now, suffice to say that our work is funded by Microsoft, so you might already guess what we are supposed to do :)
Useful Keyboard Shortcuts in Finder on OS X
Useful keyboard shortcuts in the finder I didn't know of.
Move up the hierarchy: Cmd + Cursor Up
Open a file/folder: Cmd + O (like "open") or Cmd + Cursor Down
Pressing Cmd while Drag'n'Dropping files: Moving files instead of copying them (quite useful, since there is no Edit→Copy in Finder)
Thanks to: Robert Buluschek, Florian Hillebrand, John Flury.
C++ Tidbits
Type Conversion Constructor
Syntactic sugar for a constructor with a single argument. Given a class definition:
class Complex { private: double real; double im; public: Complex(int r, int i) { real = r; im = i; }; Complex(int r) { real = r; im = 0; }; };
Complex c=5 is a sweetened version of Complex c(5).
C Include Files
#include <math.h> becomes #include <cmath>,
#include <stdio.h> becomes #include <cstdio>
etc. The ".h" is removed from the filename to denote the availability of a library,
instead of the presence of an actual file. "c" is prefixed to libraries of the
Standard C library.
While these headers contain the same methods, the functions are put in the std
namespace.
Testing Amazon S3
With Transmit, using Amazon's Simple Storage Service is as easy as FTP. Your data on S3 is organized into "buckets", which is nothing more than a fancy name for a top-level folder. Buckets help organizing the data into groups, for which you are then later billed individually.
Data uploaded to S3 is by default only readable by you. To make it accessible to the public, mark it as readable by anyone in Transmit:
Your files are then accessible under http://s3.amazonaws.com/ + bucket_name + /path/to/your/file.
I am hosting this image
from this website as a test.
Youscope (oscilloscope demo)
This demo was presented at the Assembly 2007 in the short film compo. Quote from the Youtube comments:
a demo using an oscilloscope to display something. It was third in assembly 2007 shortfilm compo, and won altparty's most original entry prize.
Discovered on random($foo).
Source code for Hangman
About a month ago, I asked the audience (you!) for a solution to the hang man game presented on this website. Of course, as we all know, the solution was Count Rushmore.
Now that the project deadline is over, I can also share some source code with you. I am not entirely sure whether I am allowed to distribute the compiler's source code, since there will be another compiler construction course next year, but I can give you the source code to programs conforming to the vier programming language the and the generated assembler code with it.
You will need the DLX Simulator to run the assembler programs.
Hangman game
Download: hangman.vier and hangman.asm.gz.
Run with ./risc-emu -mem=16777216 hangman.asm.
Screenshot:
_______
|/ |
| (_)
| |
| |
| /
|
___|___
_ o u n t r u s h _ o r e
Enter your guess:
Pascal triangle
Download: pascal.vier and pascal.asm.
Run with ./risc-emu pascal.asm
Screenshot:
1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1 1 6 15 20 15 6 1 1 7 21 35 35 21 7 1 1 8 28 56 70 56 28 8 1 1 9 36 84 126 126 84 36 9 1
Fun with Lists
Download: listfun.vier and listfun.asm.gz.
Run with ./risc-emu -mem=16777216 listfun.asm
Screenshot:
4 7 1 6 2 3 5 5 3 2 6 1 7 4 16 49 1 36 4 9 25 -4 -7 -1 -6 -2 -3 -5
Memory structure
Here is some ASCII art on how the memory is organized. The global memory layout is as follows (you may recognize it in the assembler code. Read from bottom to top):
Memory Layout:
. .
. .
| |
+-------------------------------+
| BEQ 0 start |
| initialisation du glaneur de |
| cellules, du pointer de pile |
init: | et des VMTs |
+-------------------------------+
| SYSCALL 0 0 SYS_EXIT |
start: | expression principale |
+-------------------------------+
| |
| code des méthodes |
| |
+-------------------------------+
| | ^
| tables virtuelles de méthodes | |
| | |
+-------------------------------+ | direction de l'exécution
0 | BEQ 0 init | |
+-------------------------------+ |
The stack frame layout for each method call is as follows (read from top to bottom):
Stack frame layout. Each cell is 1 word. +----------------+ <-- FP | this | +----------------+ | arg 1 | | +----------------+ | | arg 2 | | +----------------+ `.' . . . . +----------------+ | return address | +----------------+ <-- SP
For each instance of an object, memory is allocated on the heap as follows (read from bottom to top):
Object layout (heap). Each cell is 1 word. +----------------+ <-- (objectSize + 1) * WORD_SIZE | Field n | +----------------+ . . ^ . . | +----------------+ | | Field 1 | | +----------------+ | VMT Addr | +----------------+ <-- address returned by SYS_GC_ALLOC
Last modified on 31.07.2008 at 12:30 GMT
