code logs -> 2009 -> Thu, 22 Jan 2009< code.20090121.log - code.20090123.log >
--- Log opened Thu Jan 22 00:00:49 2009
00:07 You're now known as TheWatcher[t-2]
00:11 You're now known as TheWatcher[zZzZ]
00:34 Attilla [~The.Attil@Nightstar-9469.cdif.cable.ntl.com] has quit [Quit: <Insert Humorous and/or serious exit message here>]
00:44 Consul [~consul@Nightstar-2598.dsl.sfldmi.ameritech.net] has joined #code
00:44 mode/#code [+o Consul] by ChanServ
01:06 Derakon[AFK] is now known as Derakon
02:23 gnolam [lenin@Nightstar-1382.A163.priv.bahnhof.se] has quit [Quit: ?]
03:00
< Derakon>
...WTF, Python will throw an exception if you try to convert the string "87.7167" into an int.
03:00
< Derakon>
Just truncate the thing!
03:00
< Derakon>
Am I going to have to do int(float(str)) here?
03:01
<@Vornicus>
Probably.
03:01
<@Vornicus>
Python kvetches about strings that cannot be completely converted.
03:01
< Derakon>
That's absurd.
03:02
<@Vornicus>
There may be a way to do it, but I'm not sure off the top...
03:03 * Vornicus searches the documentation.
03:07
<@Vornicus>
Hrm. I don't see anything. That's not cool.
03:07
< Derakon>
Yeah, me neither. :\
03:17
<@Vornicus>
#python does not seem to think any such thing exists in the stdlib.
03:17
< Derakon>
Well, thanks for investigating.
03:17 * Derakon just nests function calls. :\
03:17
< Derakon>
Now to get text alignment on the highscores display working.
03:19
< Derakon>
Ah hah. The font claimed to be fixed-width but in fact was not.
03:19
< Derakon>
Silly font!
03:30
< Derakon>
Right. Highscores display and recording is done.
03:30
< Derakon>
Also I'm no longer using the built-in Pygame font.
03:33
<@Vornicus>
yey
03:33
<@McMartin>
Huzzah
03:52
< Derakon>
Hm. I need an expression that is 1 if x is less than 4 and 0 otherwise.
03:52
< Derakon>
Using basic math, the int() function, etc. No if/then/else.
03:53 * Derakon is making a minefiled pattern. It is deliciously hard.
03:53
< Derakon>
s/le/el/
03:53
<@Vornicus>
What is the acceptable domain of x, are we using integer division, and do we have min() and max()
03:54
< Derakon>
x is in [0, infinity], we can use integer or float division, we do have min and max.
03:54
< Derakon>
Basically this expression will get eval'd by Python.
04:01
<@McMartin>
Hm. What's Python's equivalent of sgn?
04:02
<@McMartin>
min(0, -sgn(x-4)) should do it
04:03
<@Vornicus>
Der: okay: 1 - min(x, 4)//4 <--- first approximation
04:04
<@Vornicus>
I don't know if python /has/ sgn; I find that most languages for some reason do not.
04:04
< Derakon>
// is integer division?
04:04
<@Vornicus>
Yes. Works in 2.3 and better, iirc.
04:06
< Derakon>
Looks good! Thanks.
04:07
< Derakon>
I really need to make this pattern easier. ;.;
04:09
<@Vornicus>
2.2 and better, apparently; usually / in 2.x means "mixed division" - it will floor for all-integer inputs, and float division otherwise. 3.0 and from future import division makes float division always.
04:10
<@Vornicus>
http://www.python.org/dev/peps/pep-0238/ <--- specified in pep 238.
04:12 * Derakon snerks at "from __future__ import division".
04:13
<@Vornicus>
IN THE FUTURE THERE WILL BE DIVISION
04:13
<@Vornicus>
cmp(x, 0) appears to work as sgn
04:28
< Derakon>
Okay, I'll call that good for version alpha-9.
04:28 mode/#code [+o Derakon] by ChanServ
04:28
<@Derakon>
http://derakon.dyndns.org/~chriswei/temp/bulletml9.tgz
04:28
<@Derakon>
(Includes the scripts, McM)
04:29
<@McMartin>
Hoorj
04:29
<@McMartin>
But first, laundry
04:29
<@McMartin>
Also, Kai Grandmastery
04:29
<@Derakon>
You move quickly.
04:29
<@Derakon>
I stopped reading the thread yesterday when it looked like the obsessive min/maxer with bad grammar was going to take over. Did he actually do so?
04:32
<@Derakon>
Okay. Kid looks a bit young for that, but oh well.
04:32
<@Derakon>
Mischan.
04:33
<@McMartin>
Not really.
04:34
<@McMartin>
The consensus is strongly towards Maximum lewtz.
04:34
<@McMartin>
And hilarious instadeaths, but they've mostly been coming one turn away from them then ducking aside.
04:34
<@Derakon>
Okeyden.
04:35
<@McMartin>
I can see where the min/maxers are coming from, though.
04:36
<@McMartin>
They were clearly traumatized by trying to play honestly their first times through. -_-
04:36
<@Derakon>
Heh.
04:36
<@Derakon>
I don't think I ever didn't cheat at Lone Wolf.
04:37
<@Derakon>
I remember keeping my eyes half-open while selecting numbers from the random number table in the back of the book so I'd always get a 9 or 0.
04:37
<@McMartin>
The main "cheat" going on in this thread is that use of the Laser Sword is not mandatory.
04:37
<@Derakon>
They left it at home, hey?
04:37
<@McMartin>
Especially since it occasionally causes you to do suicidally stupid things, or forces you to bypass critical clues.
04:37
<@McMartin>
No.
04:37
<@Derakon>
Ah.
04:38
<@McMartin>
They're keeping their laser sword, however, he's rewriting all "If you have the laser sword turn to X" to "If you have the laser sword and wish to use it turn to X"
04:38
<@Derakon>
Ah hah.
04:38
<@Derakon>
That doesn't really make sense in e.g. Castle Death, where there's special text about the Swerd getting taken away from you if you have it.
04:38
<@McMartin>
In places where you have a choice of which way to go and having the sword forces you to go the wrong fucking way, which IIRC happens twice he rewrites the passage so the choice is always present.
04:38 * Derakon nods.
04:38
<@McMartin>
Oh, he made an exception for those.
04:39
<@McMartin>
If it's text involving carrying it, he forces the choice.
04:40
<@McMartin>
That said, 90% of the fun of this thread is the commenters, for once.
04:40
<@McMartin>
"Pah, risk assessments are nothing but nanny-statism! Political Correctness Gone Mad! When I was a young Druid we didn't need to fill out 15 forms and present the results of a blood test to rip the living heart out of someone on a Sacrificial Stone! We didn't have Clean Air Acts interfering every time we burnt a Wicker Man, demanding environmental impact assessments, waiver forms and qualified fire safety officers on-site! It's th
04:40
<@Derakon>
"It's th..."
04:41
<@McMartin>
"It's the vile influence of Ishi at work, I say!"
04:41 Vornicus [~vorn@Admin.Nightstar.Net] has quit [Quit: ]
04:46
<@McMartin>
AHAHAHAHA
04:51
<@Derakon>
Oh, yes -- at some point, I'm going to want to implement recording~
04:51
<@Derakon>
Anyone know if Python's RNG is dependent on the system?
04:52
<@McMartin>
My guess is no, provided it is hand-seeded.
04:52
<@McMartin>
But let us test!
04:52
<@McMartin>
Name a seed and a random function and let's compare 20 runs.
04:53
<@Derakon>
Seed 0, random.random().
04:53
<@McMartin>
Looks like it's using its own Mersenne TWister, so...
04:54
<@Derakon>
Here's my results: http://paste.ubuntu.com/108115/
04:54
<@Derakon>
For, uh, 19 iterations. >.>
04:55
<@McMartin>
The first five appear to match.
04:55
<@McMartin>
Laziness then wins
04:55
<@Derakon>
Well, check the last one.
04:55
<@Derakon>
But sounds good!
04:55
<@Derakon>
So I can just stick an invocation to random.random() into menuLoop(), seed it at 0, and add input recording.
04:56
<@Derakon>
(Then I add frame-advance and savestates and...)
04:58
<@McMartin>
Last one also matches, though I made 20 =P
04:58
<@McMartin>
So your last matches my penultimate
05:01
<@Derakon>
Right.
05:32
< simontwo>
here's a challenge I'm working with. what's a good way to create a web application that tests if a visitor's DNS entry to some other hostname is broken?
05:36
<@Derakon>
Er...
05:36
<@Derakon>
Do you control access to the content on that host?
05:36
<@Derakon>
You could have them retrieve a script from it that modifies state on your page.
05:37
<@Derakon>
I wouldn't call this a good way, but it'd work.
05:59
<@Derakon>
...why is someone digging through the Apache documentation on my default site installation?
05:59 * Derakon eyes his httpd access logs.
06:01
<@Derakon>
I see that the Dwarf Fortress thread on excessively-decorated items has been bumped, too.
06:01
<@Derakon>
(http://derakon.dyndns.org/~chriswei/temp2/df/tubeofdoom.png)
06:11
<@McMartin>
What the Christ
06:13
<@Derakon>
That's what you get when you order every type of gemstone the Mountainhomes have and lock a jeweler in with them.
06:14 gnolam [lenin@Nightstar-1382.A163.priv.bahnhof.se] has joined #Code
06:14 mode/#code [+o gnolam] by ChanServ
06:40 Derakon is now known as Derakon[AFK]
06:48 UndeadAnno [~farkoff@Nightstar-29103.neoplus.adsl.tpnet.pl] has joined #Code
08:56 Rhamphoryncus [~rhamph@Nightstar-7184.ed.shawcable.net] has quit [Quit: Rhamphoryncus]
08:57 You're now known as TheWatcher
10:53 * gnolam adds "Bad day at the office" to the list of classic video clips he's seen used in an official lecture.
11:34 Vornicus [~vorn@Admin.Nightstar.Net] has joined #code
11:34 mode/#code [+o Vornicus] by ChanServ
11:37 Attilla [~The.Attil@Nightstar-9469.cdif.cable.ntl.com] has joined #code
11:37 mode/#code [+o Attilla] by ChanServ
15:03 Bobsentme [~Bobsentme@Nightstar-14642.lightspeed.livnmi.sbcglobal.net] has joined #code
15:04
< Bobsentme>
is there a web developer in the house?
15:05
<@Vornicus>
I play one on TV
15:05
< Bobsentme>
heh
15:06 * Bobsentme is having trouble removing a white box from the upper right corner of a page.
15:06
< Bobsentme>
php and css are involved.
15:06
< Bobsentme>
Google's been unhelpful.
15:07
<@Vornicus>
Pastebin the generated source.
15:07
<@Vornicus>
Or, you know. Put the page somewhere we can see.
15:08
<@Vornicus>
Also, what browser(s) does this box appear in?
15:08
< Bobsentme>
both FF and IE.
15:09 mode/#code [+oooooo Alek ASCIISkull Bobsentme C_tiger crem_ simontwo] by Vornicus
15:09
<@Bobsentme>
Site is here: http://cis.hfcc.net/~cegeimer/cis222/assignment1/indexx.php
15:09 mode/#code [+vvooo KarmaBot moocow Syloqs-AFH Tarinaky UndeadAnno] by Vornicus
15:09
<@Vornicus>
Aha, let me see.
15:10
<@Bobsentme>
I believe it has something to do with the "width: 100%" in my style sheet.
15:11
<@Vornicus>
Yes. Try removing the width: 100% from the body style.
15:11
<@Bobsentme>
Done...and my background color completely dissappears.
15:12
<@Vornicus>
Flergbota.
15:12
<@Vornicus>
uh.
15:12
<@Bobsentme>
And now you understand my problem. :P
15:12
<@Vornicus>
put in the body tag a thing that declares the background color to be black for the entire page.
15:13
<@Vornicus>
THis makes it so that any gaps get the body color, they'll show up black.
15:13
<@Vornicus>
(also you're not testing on a very tall thing, or you'd see that there is white below the bottom too.)
15:13
<@Bobsentme>
Done...still no black showing up.
15:14
<@Vornicus>
In the body tag? in the html?
15:14
<@Bobsentme>
Well, I'm using php. The background color is set in the style sheet.
15:14
<@Bobsentme>
Though I guess I could do it in the indexx.php.
15:15
<@gnolam>
Isn't it just the margin showing up?
15:15
<@gnolam>
Err, s/margin/padding
15:15
<@gnolam>
Or possibly both. I'm sleep deprived.
15:15
<@gnolam>
Try with a padding = 0; margin = 0; in the body.
15:15
<@gnolam>
And of course, = should be :.
15:15
<@gnolam>
Did I mention I was sleep deprived?
15:16
<@Bobsentme>
heh. No worries.
15:16
<@Vornicus>
The background color of the /whole body/ is white. THis is wrong if you want your page to be black.
15:16
<@Vornicus>
Set the color of the body tag, probably using css on the tag "body" and not "#body"
15:17
<@Vornicus>
You can also remove the margin tags from the php and put them into the css in the tag "body"
15:17
<@Vornicus>
RIght now, if the browser window is tall enough that it reaches the bottom of the left side image without scrolling, the area below that is white, and that's wrong.
15:18
<@Bobsentme>
THAT was it.
15:19
<@Bobsentme>
Thanks Vornicus, there is a "body {background-color: white;}" and "#body" tags inside the css.
15:20 * Bobsentme was busy concentrating on #body to see the first one at the top of the style sheet.
15:25
<@Vornicus>
Generally you don't want to coat the page one block at a time; you're very likely to miss spots.
15:25
<@Alek>
but that's easy to check. load it up and see what's not coated. :P
15:26
<@Bobsentme>
hehe
15:26
<@Vornicus>
WEll, yes. Make it hot pink and you can see. :) But then you have to make sure that works on all browsers and on all pages. Much less effort to just set the background once and have done with it.
15:26
<@Bobsentme>
I can see that. Not the hot pink thing...ok, maybe the hot pink thing.
15:27
<@Vornicus>
We're debugging. Hot pink is appropriate.
15:27
<@Bobsentme>
LOL
15:28
<@Bobsentme>
If I may ask: Anyone got a clue on how to stretch the left.php all the way down the page (ie, no scroll bar unless needed in the body?)
15:29
<@Alek>
height="100%" or something along those lines?
15:29
<@Bobsentme>
I've actually got the height="100%".
15:30
<@Bobsentme>
Apparently, web browsers don't know what 100% means. >.>
15:30
<@Alek>
if it's CSS, it'll be different.
15:30
<@jerith>
CSS layout stuff is a mess.
15:30
<@Alek>
anyway.
15:30
<@Alek>
can't really tell without a sample.
15:30
<@Alek>
and I'm getting ready for werk. >_<
15:30
<@Alek>
ask me again in... 7 hours.
15:31
<@Bobsentme>
hopefully I'll have it figured out by then. :P
15:44
<@gnolam>
Also, use Firebug.
15:51
<@Bobsentme>
that looks handy. Thanks,
15:58
<@Bobsentme>
613px. FF removes the scroll bar, IE leaves it, but at least my left bar is now touching the bottom of the page (or the black space is unnoticable)
16:00
<@Alek>
try scrolling="yes|no"
16:01
<@Bobsentme>
don't you have to get to work? :P
16:03
<@Alek>
I was showering.
16:06 * Bobsentme bah's at his css, and moves on.
16:06
<@Bobsentme>
At least now the page is displaying mostly properly. I'll take it, and hope the teacher isn't a stickler.
16:16 ToxicFrog [~ToxicFrog@Admin.Nightstar.Net] has quit [Operation timed out]
16:31 KBot [AnnoDomini@Nightstar-29117.neoplus.adsl.tpnet.pl] has joined #Code
16:32 UndeadAnno [~farkoff@Nightstar-29103.neoplus.adsl.tpnet.pl] has quit [Ping Timeout]
16:33 KarmaBot [AnnoDomini@Nightstar-29103.neoplus.adsl.tpnet.pl] has quit [Ping Timeout]
16:33 ToxicFrog [~ToxicFrog@Admin.Nightstar.Net] has joined #code
16:33 mode/#code [+o ToxicFrog] by ChanServ
16:34 KBot is now known as KarmaBot
16:40 UndeadAnno [~farkoff@Nightstar-29117.neoplus.adsl.tpnet.pl] has joined #Code
17:08 You're now known as TheWatcher[afk]
17:37 Attilla [~The.Attil@Nightstar-9469.cdif.cable.ntl.com] has quit [Ping Timeout]
17:37 Attilla [~The.Attil@Nightstar-9469.cdif.cable.ntl.com] has joined #code
17:37 mode/#code [+o Attilla] by ChanServ
18:06 Rhamphoryncus [~rhamph@Nightstar-7184.ed.shawcable.net] has joined #code
18:13 You're now known as TheWatcher
20:51 * Vornicus randomly ponders Youtube videos of people doing sorting algorithms by hand.
20:51
<@Vornicus>
At like 10x speed.
20:52
< UndeadAnno>
That would be cool.
20:52
<@EvilDarkLord>
And the recursive ones can have lots of people.
20:53 * UndeadAnno randomly ponders how to make DF actually respect the population cap.
21:37
<@McMartin>
Hah. TortoiseSVN is apparently maintaining a version of grep for Windows.
21:38
<@ToxicFrog>
How many is that now?
21:39
<@ToxicFrog>
UndeadAnno: AIUI, there is no hard population cap.
21:39
<@ToxicFrog>
There is "no more births/immigrants once population is above this point"
21:39
< UndeadAnno>
I'd settle for a soft cap.
21:39
< UndeadAnno>
But it doesn't work.
21:39 * McMartin eyes his inbox
21:40
<@McMartin>
I see VirtualBox 2.1.2 is out. I wonder if it crashes less than 2.1.0 does.
21:40
< UndeadAnno>
I set it to 1, killed 6 of the starting dorfs, and got three waves of immigration ANYWAY.
21:43
<@Vornicus>
uh-huh
21:43
<@EvilDarkLord>
Just feed'em to the carps, Anno.
21:43
<@EvilDarkLord>
I know how you like your named carps.
21:43
< UndeadAnno>
I do. ;_;
21:44
< UndeadAnno>
But there's a child who I can't tell to do anything and the carps seem to dislike dorf children.
21:44
< UndeadAnno>
And I find myself spending way too much of my time killing the immigrants.
21:47
<@McMartin>
You have to fatten the kids up before the carps will eat them!
21:49
<@EvilDarkLord>
Can you just move away when you get immigrants?
21:49
<@EvilDarkLord>
That would be a very Hermit thing to do.
21:51
< UndeadAnno>
Move away?
21:51
< UndeadAnno>
I pondered starting on an island, but it seems I'd get dorf caravans ANYWAY.
21:52
<@EvilDarkLord>
Well, yeah. Take your one dorf and bugger off when the people come to annoy you.
21:52
< UndeadAnno>
That's not possible yet, I'm afraid.
21:53
< UndeadAnno>
I think I may need to figure out some sort of elaborate deathtrap just for the purpose of killing off migrants.
21:54
<@EvilDarkLord>
Doom Lever.
21:55
< UndeadAnno>
Like a large pit with a designated meeting area, with one end being sealed off by Lever 1 controlled floodgates, and the other housing a pit-sized Dwarven Atom Smasher controlled by Lever 2.
21:56
< UndeadAnno>
Draft the wankers, put them into the pit, make sure the undraftables are inside the meeting area too, then use L1 by my hermit (setting the levers to be only usable by him) shutting them in.
21:56
< UndeadAnno>
Then, it's doom-time.
21:57
< UndeadAnno>
In fact, I think I will just HAVE to make such a contraption.
21:58
<@EvilDarkLord>
Will you do it with your one dorf?
21:58
< UndeadAnno>
Yes.
21:58
< UndeadAnno>
HE IS A MASTER OF ALL SKILLS (in training).
21:58
<@EvilDarkLord>
I love how the hermit spends his days building a giant machine for killing anyone who gets near him.
21:58
<@EvilDarkLord>
Then again, this is the definition of a fortress.
22:00
< UndeadAnno>
:)
22:26
< UndeadAnno>
Aaaah. Kid goes in.
22:26
< UndeadAnno>
L1 is pulled! The kid is trapped!
22:27
< UndeadAnno>
L2 is designated to be pulled... and my hermit goes to sleep.
22:28
< UndeadAnno>
A goblin ambush happens!
22:28
< UndeadAnno>
Child is crushed by drawbridge. Doors are locked against the goblins.
22:28
<@EvilDarkLord>
Yay for blow-by-blow.
22:28
< UndeadAnno>
Who are chasing the camel.
22:29
< UndeadAnno>
An elven caravan arrives!
22:29
< UndeadAnno>
Goblins chase the horse now. Camel's dead.
22:30
< UndeadAnno>
Elven merchants are routed!
22:30
< UndeadAnno>
Hmm. I have enough provisions to last a while... but I need a plan.
22:32 * UndeadAnno goes bathe now, will probably continue after that.
22:38
<@McMartin>
Hah. Someone on the Lua mailing list was apparently complaining that 0/1 yields 0.
22:39
<@ToxicFrog>
...
22:47
< UndeadAnno>
With the elves dead, I think the goods fall to me.
22:48
< UndeadAnno>
Hmm. Seven ambushers.
22:48
< UndeadAnno>
Need lots of stone-fall traps.
22:48
< UndeadAnno>
...
22:48
< UndeadAnno>
MIGRANTS.
22:51
< UndeadAnno>
Wow. They won against the Goblins.
22:52
< UndeadAnno>
But anyway, they're not welcome here.
22:52
< UndeadAnno>
Into the pit you go.
22:55
< UndeadAnno>
RIGHT. With all these bothersome creatures come to bother my hermit, I can get back to work.
22:55
< UndeadAnno>
+gone
23:12
< UndeadAnno>
Wow. That was a CLOSE call.
23:12
< UndeadAnno>
Kobold ambush. Fortunately, human traders shot them to death.
23:33
< UndeadAnno>
Fuck. Had a close call there, kobold ambush.
23:33
< UndeadAnno>
They passed right through forbidden doors, and traps.
23:33
< UndeadAnno>
They got to the hermit, but he was TOO AWESOME and killed all four in hand to hand combat.
23:35
< UndeadAnno>
Unfortunately, he sustained yellow wounds to his lower body. I don't know if he'll pull through. :(
23:36
< UndeadAnno>
At least I think they're yellow. I fiddled with the colours.
23:37
< UndeadAnno>
:(
23:37
<@EvilDarkLord>
DEATH?
23:38
< UndeadAnno>
He's dying.
23:38
< UndeadAnno>
But maybe not! Migrants have arrived, so they will live so long as he recuperates.
23:40
< UndeadAnno>
...
23:41
< UndeadAnno>
I think it's the wrath of the migrants.
23:41
< UndeadAnno>
There's one, but he's not moving from the spot he entered.
23:47
< UndeadAnno>
On this item is an image of a dwarf and a dwarf. The dwarf is standing on a hill. The dwarf is in a fetal position.
23:48
< UndeadAnno>
R.I.P. Kogan Nobbomrek.
23:49
< UndeadAnno>
Now that Kogan is dead, the migrant moves.
23:49
< UndeadAnno>
YOU BASTARD.
23:53 UndeadAnno [~farkoff@Nightstar-29117.neoplus.adsl.tpnet.pl] has quit [Quit: I Make Stuff Up. From the moon. Made by mooninites. They wear moonboots.]
--- Log closed Fri Jan 23 00:00:01 2009
code logs -> 2009 -> Thu, 22 Jan 2009< code.20090121.log - code.20090123.log >