Gossamer Forum
Home : General : Chit Chat :

Dynamic colors

Quote Reply
Dynamic colors
Try refreshing this post a few times Cool



Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [Jagerman] Dynamic colors In reply to
COOL!
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Heckler] Dynamic colors In reply to
http://jagerman.com?source=1

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com

Last edited by:

Jagerman: Apr 2, 2002, 8:35 PM
Quote Reply
Re: [Jagerman] Dynamic colors In reply to
OSX IE doesn't like that link Crazy

Jag's hot page

openoffice + gimp + sketch ... Smile
Quote Reply
Re: [QooQ] Dynamic colors In reply to
OSX IE sucks then :P

Try http://jagerman.com/index.cgi?source=1

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [QooQ] Dynamic colors In reply to
The fg and bg colors are pretty much random - you'll never see the same http://jagerman.com twice Smile

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [Jagerman] Dynamic colors In reply to
I remember you posting a link to that months and months ago Smile

if ($in->param('source')) {
open my $fh, "<", $0;
print <<HTML;
Content-type: text/html

<html><head><title>jagerman.com main page and image source</title></head>
<body>
<pre>
HTML
local $/;
print $in->escapeHTML(scalar <$fh>);
}

.....hm interesting. Why do you do it that way?

My attempt (its pretty quick reading into a string that way...more so than read()...which I thought was impressive Smile):

open FH, $0;
my $source = do { local $/; <FH> };
close FH;


do{}:

1 wallclock secs ( 0.19 usr + 0.21 sys = 0.40 CPU) @ 12500.00/s (n=5000)

read() is almost twice that.

Last edited by:

Paul: Apr 3, 2002, 1:45 AM
Quote Reply
Re: [Paul] Dynamic colors In reply to
Where do you see read()?

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [Jagerman] Dynamic colors In reply to
I knew you'd say that.....

I wasn't making a criticizm of your code...obviously I know yours is gonna be good, I was just making a comment that I always thought read() was quick but it seems do{} was faster by quite a bit when I did a benchmark.

When I asked why you did it that way, I was asking because I knew there'd be a good reason and was wondering what it was Smile

Last edited by:

Paul: Apr 3, 2002, 11:24 AM
Quote Reply
Re: [Paul] Dynamic colors In reply to
I understand that - I'm just wondering what makes you think I'm using read(). My code is almost exactly the same as yours, except that I don't use a do { } block.

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [Jagerman] Dynamic colors In reply to
I don't/didn't think you are/were using read. It was just a mildy related piece of information I threw in there as it was something I'd encountered recently Unsure

I was however wondering what the reason was for using:

open $fh, ">", $0;

Wont:

open $fh, $0;

...work the same way?

This is all for the purpose of learning, not criticizm.

Last edited by:

Paul: Apr 3, 2002, 11:40 AM
Quote Reply
Re: [Paul] Dynamic colors In reply to
Yeah, but the three argument form of open is the "better" way to do it in 5.6.0 - plus the fact that because all GT code is 5.004_04 compatible, I don't get a chance to use it very often. Wink

'open my $fh, ...' is not the better way (unless you plan on passing the filehandle) - again it's just me justifying the "use 5.6.0" at the top of the script Wink

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [Jagerman] Dynamic colors In reply to
Ok, I thought I'd have a play too...how about this beauty :)

http://www.wiredon.net/...ff0200&c2=0000ff

You can play with the hex colors in the c1/c2 params Cool



Refresh this post if you like :)

Last edited by:

Paul: Apr 16, 2002, 6:32 AM