lseek()

If you ever wonder how to use basic open, seek, read/write operations on native file descriptor (in Linux), here's a brief example. It should give general overview on how it's done.
I was actually not quite sure how to lseek() before writing this post myself.

#include <unistd.h>
#include <fcntl.h>


int fd;
int main(){
    fd = open("foo",O_WRONLY | O_CREAT, S_IRWXU);
    lseek(fd, 0, SEEK_END);
    write(fd,"abc\n",4);
    }


See, the offset and whence value can be played around. I can do {SEEK_SET, SEEK_END} to get exactly the same result. :D

Anyway, it's nice to see OR operation on enum values.

IBM 7094 Daisy Bell

It was dubbed "first computer to sing"; a bunch of guys hacked into IBM 7094 to make it sing (or make some mass-understandable beeps in this regards). It probably involved some degree of speech and music synth. The song was Daisy Bell (A Bicycle Built for Two) written in 1892 by Harry Dacre.



Daisy, Daisy,
Give me your answer do!
I'm half crazy,
All for the love of you!
It won't be a stylish marriage,
I can't afford a carriage
But you'll look sweet upon the seat
Of a bicycle made for two.
...
  Harry, Harry, here is my answer true
  You're half crazy if you think that that will do
  If you can't afford a carriage
  There won't be any marriage
  Cause I'll be switched if I'll get hitched
  On a bicycle built for two


I wish she's willing to be my stoker.