• entries
18
21
• views
12192

GAH

## perl

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]

#!/usr/bin/perluse 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 "";$counter++;	}}print FILE "\t\n";close(FILE);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

533 views

Ooooo

By

Penten

, August 2, 2005

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 <_<.

410 views

KERAAAAZY girl part II

By

Penten

, July 31, 2005

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..

346 views

Yay!

By

Penten

, July 31, 2005

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...<_<

381 views

By

Penten

, July 1, 2005

Somewhat important are the Intel manuals:Here.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)

423 views

By

Penten

, June 30, 2005

I hope these are usefull to someone, my OS links:bonafide OSDEV. Down at the moment but most of the documents are mirrored here.The OS wiki. Lots of good informationLinks and codeMore good infoThe megatokyo os board.Yet more good info80386 instruction set.The art of assembly language programming.More info.Some articles and a forum.There. Enjoy.

350 views

OS

By

Penten

, June 30, 2005

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.

459 views

Editor

By

Penten

, April 25, 2005

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.

343 views

Lisp

By

Penten

, April 23, 2005

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)  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)  sum))Here is some output:CL-USER> (sum-between-fast 1 5)The sum of the numbers between 1 and 5 is 1515CL-USER> (sum-between-fast 1 5 1)The sum of the numbers between one and five is fifteen15And 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-five23215525272565185I love ~r. [smile]Feel free to criticise anything.

381 views

germany

By

Penten

, April 17, 2005

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]

312 views

editor

By

Penten

, April 5, 2005

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.Behold!It could do with scrollbars, menus, text selection..

326 views

foobar thingy - again

By

Penten

, April 5, 2005

Well I decided to fiddle with it again. It now shows who the song is by when the mouse hovers over it.I don't think this merits a screenshot so just imagine it.[rolleyes]

303 views

By

Penten

, March 26, 2005

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]

416 views

foobar2k thingy

By

Penten

, March 26, 2005

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 <_<

1 comment
288 views

..

By

Penten

, October 9, 2004

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.

1 comment
351 views

By

Penten

, August 14, 2004

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!

294 views

ping...pong

By

Penten

, August 11, 2004

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

306 views

ping...pong

By

Penten

, August 11, 2004

Well I don't know how to start this journal really so just imagine a witty and clever introduction .There.Now on to my last project. Pong. And you thought Doom III was good looking.Menu:Ingame:You can get the .exe here

1 comment
314 views

Followers
0

GDNet Discord Chat

All Activity

Home

Blogs

0_o

Resources

Articles & Tutorials
Blogs
Calendar
Forums
Gallery

Community

Activity
Guidelines
GameDev Market
GameDev Jobs

Social

Yes, I'll Whitelist

×

Browse

Back

Articles & Tutorials

Back

All Categories

Audio

Game Design

Industry

Programming

Visual Arts

Calendar

Columns

Back

GameDev Unboxed

Event Coverage

Back

All Events

Game Developers Conference

Power Up Digital Games Conference

Gallery

GameDev.Market

Groups

News

Podcasts

Back

All Podcasts

Projects

Store

Archive

Forums

Back

Beginners

Programming

Back

Graphics and GPU Programming

Artificial Intelligence

Math and Physics

Networking and Multiplayer

General and Gameplay Programming

Engines and Middleware

Visual Arts

Back

2D and 3D Art

Critique and Feedback

Back

Career Development

Production and Management

Audio

Back

Music and Sound FX

Game Design

Back

Game Design and Theory

Writing for Games

Community

Back

GameDev Challenges

GDNet Lounge

Coding Horrors

Hobby Project Classifieds

Indie Showcase

Affiliates

Back

NeHe Productions

AngelCode

Topical

Back

Virtual and Augmented Reality

News

All Forums

Blogs

Careers

Back

Contractors

Hobby Projects

Game Jobs

Back

Browse on GameDev.Jobs

Post a Job

Members

Back

Chat

GDNet+ Membership

Guidelines

Online Users

Awards

Search

Back

All Activity

My Activity Streams

Back

Latest Topics

Featured Blogs

Search

Important Information

I accept

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

Sign me up!

";		}		else		{			print FILE "";		}		(my $width, my$height) = imgsize("$dir/$l");		$width = ($width * 128)/$height; print FILE "$l\">\$l\">\n";		print FILE "