• Advertisement


Sign in to follow this  
  • entries
  • comments
  • views

About this blog


Entries in this blog


Well I decided to learn perl by writing myself an image directory display script thingy.
I haven't bothered to install a file manager yet so I've been using mozilla to look through the directories, but when files are called things like 10215420.jpg it can be difficult to find what you're looking for.

Anyway, here it is in all its horrifying glory. I'm sure you perl gurus out there will find many ways to reduce this to two lines of code but I'm just learning, ok. [grin]


use strict;
use warnings;
use Image::Size;

print "Enter directory :";
my $dir = ;
chomp $dir;
my $filename = "$dir/imgs.html";
my $imgs;
$imgs = `ls $dir`;
my @lines;
@lines = split(/\n/, $imgs);
open(FILE, ">$filename") or die "error opening file\n";
print FILE "\n\n\t\n\n\n";
my $counter = 0;
foreach my $l (@lines)
if ($l =~ /\.jpg|\.bmp|\.png/)
if ($counter%4 == 0)
print FILE "";
print FILE "\t\n";

It requires the Image::Size module. And creates a table with four images per line. Yay! (Oh, and I ecpect that the html is rather iffy as well, but it works!, I love that [grin])

edit: the html file has a title now


Ooooo turns out she was also seeing someone when she was on holiday, and she has the nerve to post it on her blog. That's cheating that is.

Ok I really don't care anymore but still...just to show you what she's like... I mean if he was at least good looking, but he has little chicken arms and no pecs...he looks like he's 7 and she dares say he has a nice body. That's insulting that is, damn she has bad taste...

Ok I've finished boring all who read this journal with this girl. Now she isn't talking to me all day on msn I should be able to get some programming done and/or sit in #gamedev <_<.
Ok so nobody cares, well I care and this is MY journal so im going to tell you ANYWAY. Na.

So crazy girl goes "coucou" to me on msn ("coucou"...COUCOU? YOU JUST DUMPED ME?!!?) and we start "talking" (her saying how boring and pathetic my life is and then refusing to say anything when I asked why, etc.) Anyway, we soon got to the unavoidable criticism-of-other part. Soooo her life is much more interesting now apparently (I had noticed...) because I was pulling her back, and how she only wanted to go out with my out of desperation and how she never really liked me, and misc. insults.
She is going to regret stuff she said tomorrow, it's going to eaaat at her I know her so well, so I didn't say much..she's now taunting me with tails of her recent exploits...fascinating. I hate her so much right now that this isn't even making me jealous...

It will tomorrow though so I'm going to try again with her best friend..hah!

She turned me down once but she seemed interested recently...she seems relatively sane..


I got dumped!

If you consider that we were together at one point... Damn that girl is KERAAAAZYYY..in a bad way, anyway I always feel better after having bitched about it a bit even if nobody cares so here goes.. I've learnt my lesson anyway: Don't bother continuing to try with people like that. 90% of the time when she actually decided to bother meeting me (we live 2km away , I mean come oooon... "I'm doing my homework" (>_<) "my sister might see us" (who cares, it's not like she's going to be undressing me in the street..) "I can't be bothered", "I don't feel happy" aaaaah) she completelty ignores me. We're alone in the damn street and she just looks in the other direction. >_< When I speak to her she replies with one of "Oui", "Non" or "Ah?". Very shy you say? Well she'll go out sometimes (I'm not allowed to come, "parents fault"..sure) and when she comes back she would describe in great detail to me over msn how she rubbed herself against pretty much every guy in the club. Oh and three weeks ago she left for the canary islands, before leaving she said that one "Has to make the most of life" and that "If a guy was interested she wouldn't say no". When I told her that I would rather she wouldn't do so she didn't understand why it should bother me!. As soon as she got back she said that she didn't want to see me anymore, "just because". I've been chasing this 'girl' for a damn year and all I got was one lousy kiss! >_< (ok two but still...)

There, I feel better. I now need a new girl to obsess over...<_<

OS links

Somewhat important are the Intel manuals:


This site also has mirrors, I found the Intel site quite slow so I got them from here when I downloaded them.

(Some more links can be found in the comments)


Well, I haven't posted in a while.

I've started work on an operating system. It is quite pathetic for the moment, but this time I'm sticking with it. An appropriate name would be PentenOperatingSystem really..pOS. Very, very bad joke I know.

Anyway I'm currently working on a slightly more complex memory manager than my current "throw memory at the user untill it runs out, what do you mean, free?" method and am trying to get paging working. I have a working timer and keyboard though, and I'm writing useful functions as I go so it's slowly growing. The design at the moment code wise is one header file for 12 .c files. Ouch. It's only young though.


Well I had an idea while preparing my pizza just now to stop the editor flickering. I just stuck a Sleep(1); in there and it now scrolls nicely without a flicker in sight. This is the second Sleep(); I've used in two projects now though. [rolleyes]
Is it actually bad style or is that just in my head? It always feels somewhat hackish.

Anyway. Pizza time.


Well, I'm back and I've been reading this. I never remember a language unless I use it so I pulled out C++ Primer Plus and looked for an exercise as my first program. I decided to go with something very simple that nevertheless took me a depressingly long time to write: A program that prints the sum of all the numbers between two supplied values.

Here is the result:

(defun sum-between2 (x y &optional (verb 0))
"sum all numbers between suplied vars together - prettier version"
(when (> x y) (rotatef x y)) ;if x > y then sum-between2 (y x)
(let ((sum 0) (iter x)) ;sum = 0
(dotimes (- y x)
(setf sum (+ iter sum))
(incf iter))
(format t "The sum of the numbers between ~[~d~;~r~] and ~[~d~;~r~] is ~[~d~;~r~]~%" verb x verb y verb sum)

And because this was painfully slow I just had to optimise it into this shorter program:

(defun sum-between-fast ( x y &optional (verb 0))
"sum all numbers between suplied vars together fast"
(when (> x y) (rotatef x y))
(let ((sum 0))
(setf sum (/ (* (1+ (- y x)) (+ x y)) 2))
(format t "The sum of the numbers between ~[~d~;~r~] and ~[~d~;~r~] is ~[~d~;~r~]~%" verb x verb y verb sum)

Here is some output:

CL-USER> (sum-between-fast 1 5)
The sum of the numbers between 1 and 5 is 15

CL-USER> (sum-between-fast 1 5 1)
The sum of the numbers between one and five is fifteen

And for kicks:

CL-USER> (sum-between-fast 1 215478654 1)
The sum of the numbers between one and two hundred and fifteen million, four hundred and seventy-eight thousand, six hundred and fifty-four is twenty-three quadrillion, two hundred and fifteen trillion, five hundred and twenty-five billion, two hundred and seventy-two million, five hundred and sixty-five thousand, one hundred and eighty-five

I love ~r. [smile]

Feel free to criticise anything.


Well i'm in Germany right now, compilerless, on a two week long school exchange. GDI was being annoying before I left and this editor thingy really isn't exiting me so...I'm going to drop it ( Yes, I do this a lot ) and learn lisp instead.

Why the hell not? [grin]


Here is my newish project. It is called, I'm very proud of this name, editor!
It doesn't support text editing yet but it is on the way. Hopefully.


It could do with scrollbars, menus, text selection..


I finished the foobar thingy! It now works nicely although I did use a sleep function. <_<
It always seems somewhat hacky. But...it works. [grin]

foobar2k thingy

Well I wanted something to show me what song was playing in foobar, so I wrote my first "usefull" program today.

It's just a little window that sits up on at the top of the window and reads the currently playing song from a text file thanks to the Textwriter plugin.

It looks more obvious here:

I currently have to move the mouse over it before it updates but I'm working on that.

Oh and happy easter if anyone actualy reads this <_<


Ok. I expect that the space invaders game is dead. I haven't written here for ages. I got into PIC programming and forgot about directX for a while.
I'm back at school now so not much time.

That's all.

Space Invaders

Well I've decided to go with Space Invaders for my next game ( Ironically I've never played it, so it won't be very faithfull to the original [grin] ) I'm going for lots of white blobs moving slowly towards a white ship-shaped white blob that shoots white..blobs at them.
To work!


Well I don't know how to start this journal really so just imagine a witty and clever introduction .
Now on to my last project. Pong. And you thought Doom III was good looking.


Well I don't know how to start this journal really so just imagine a witty and clever introduction .
Now on to my last project. Pong. And you thought Doom III was good looking.



You can get the .exe here
Sign in to follow this  
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!
print FILE "
(my $width, my $height) = imgsize("$dir/$l");
$width = ($width * 128)/$height;
print FILE "$l\">$l\">\n";
print FILE "