code logs -> 2009 -> Mon, 02 Mar 2009< code.20090301.log - code.20090303.log >
--- Log opened Mon Mar 02 00:00:40 2009
00:01
<@Derakon>
Ehhh, more important fish to fry right now.
00:01
<@Derakon>
I'll return to this later.
00:05
<@Finerty>
Alternatively you can make Really Cheap images to load for testing purposes.
00:08
<@Derakon>
Yeah...
00:09
<@gnolam>
Is it possible to write use cases that don't read like really poor children's stories?
00:10
<@Finerty>
heh
00:10
<@Derakon>
Don't put "And everyone worked happily ever after" at the end~
00:11
<@Derakon>
...heh.
00:11
<@Derakon>
If I try to send a score of 0 to the server, it complains that it's missing the required parameter 'score'.
00:11
<@gnolam>
Hah.
00:11 * Derakon slips a 'defined' into a conditional.
00:13
<@gnolam>
Strangely, it's even worse when you're writing use cases with non-human actors.
00:14
<@Derakon>
We have a tendency to anthropomorphize computers and programs.
00:14
<@gnolam>
You just can't avoid the "See Spot run"-ness of it.
00:14
<@Derakon>
Though in my case it's usually things like "The script will gleefully overwrite half the database if X happens..."
00:15
<@gnolam>
"The radiation source sends a dose quantum to the player. See the radiation source irradiate!"
00:16 * Derakon snickers.
00:16
<@Derakon>
Irradiate, source, irradiate!
00:21
<@Derakon>
...why is urllib.urlencode postpending "-0-1%0A" to my query string?
00:22
<@Finerty>
O.o
00:23
<@Derakon>
The last thing in the query string is the course key, IHjR0wG6jZoIcKIRr1zMPw.
00:23
<@Derakon>
But there's no special characters in that.
00:24 * TheWatcher[zZzZ] eyes Dera, reminds him to check unless(defined($score)) rather than just unless($score), given that undef, "" and 0 are all false
00:24
<@Derakon>
TW: yeah, got that already~
00:25
<@Derakon>
I wouldn't consider it a problem for scores of 0 to be invalid, but your loop could also be 0.
00:25
<@TheWatcher[zZzZ]>
Just making sure, the number of times that's caught me befor enow and caused a facepalm ¬¬
00:30 ToxicFrog [~ToxicFrog@Admin.Nightstar.Net] has quit [Ping Timeout]
00:46
<@gnolam>
Man, more forums should have built-in LaTeX functionality.
01:06 ToxicFrog [~ToxicFrog@Admin.Nightstar.Net] has joined #code
01:06 mode/#code [+o ToxicFrog] by ChanServ
01:36 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has quit [Quit: <Insert Humorous and/or serious exit message here>]
01:40
<@Derakon>
...d'oh. The -0-1 stuff was added by me to indicate turbo and inflector locks.
01:40
<@Derakon>
Go me!
01:42 * gnolam stabs OpenUP with a serrated knife.
01:49
<@Derakon>
Man, Homebullet gets spastic on high-level turbo.
02:02 gnolam [lenin@Nightstar-1382.A163.priv.bahnhof.se] has quit [Quit: I'm beginning to doubt that I'll survive this week.]
02:15 Finerty is now known as Vornicus
02:21
<@Derakon>
What's the proper way to determine if a number is a valid index into a list in Python?
02:21
<@Derakon>
Just check it against the length?
02:21
<@Derakon>
I was going to do "foo in bar", but that would check against bar's values, not indices.
02:22
<@Vornicus>
Essentially, yes.
02:22
<@Vornicus>
-len(l) <= i < len(l)
03:01 * Derakon finishes rewriting scores display to make room for the leaderboard.
03:01
<@Derakon>
Now I just have to write get-scores.cgi, the appropriate client code in Fusillade, and a button for the main page to switch display modes.
03:31 Reiv [~82d94c4d@Nightstar-29731.dsl.in-addr.zen.co.uk] has joined #Code
03:32 * Reiv appears from Uni.
03:32
< Reiv>
So: Haskell. Any opinions/expertise?
03:34
<@McMartin>
It's basically the Academic Pure Functional Language.
03:34
<@McMartin>
If you're doing something real, use OCaML instead.
03:34
<@McMartin>
Haskell's type system is awesome, though.
03:34
<@McMartin>
And has a tendency to spoil you forever when you go back to other languages, as TF can attest
03:35
< Reiv>
So, a pretty decent thing to learn all the same?
03:36
< Reiv>
(Any particular reason it's remained Pure Acadamia?)
03:37
<@McMartin>
(Extremely abstract, ML's compilers are Just Better)
03:37
<@McMartin>
The stuff it's really good at is mostly the kinds of things researchers care about rather than industrialists.
03:38
< Reiv>
Aw. Okay den.
03:39
< Reiv>
Do you know if there's liable to be any issues regarding cross-compatability between windows and linux compilers?
03:40
<@McMartin>
I've only ever used Linux compilers, so no idea
03:40
< Reiv>
Okay.
03:43
< Reiv>
I shall have to See, and Hope, because the linux box at home is a bit of a pain to work with.
03:59 Reiv [~82d94c4d@Nightstar-29731.dsl.in-addr.zen.co.uk] has quit [Quit: Hometiem]
04:02
<@Derakon>
Hrm. SQL query to get the top 3 elements, plus the 4 elements whose value in column A is closest to some provided value.
04:02
<@Derakon>
Sounds like I want to sort by min(abs(row.value - targetvalue)). >.<
04:57 Serah is now known as Xuttslupoxwasznokxlap
05:15 Xuttslupoxwasznokxlap [~Z@Nightstar-21302.atm2-0-1041217.boanxx12.customer.tele.dk] has left #code []
05:59 Rhamphoryncus [~rhamph@Nightstar-7184.ed.shawcable.net] has joined #code
06:02 Syloqs-AFH [Syloq@ServicesAdmin.Nightstar.Net] has quit [Connection reset by peer]
06:39 gnolam [lenin@Nightstar-1382.A163.priv.bahnhof.se] has joined #Code
06:39 mode/#code [+o gnolam] by ChanServ
06:40 AnnoDomini [~farkoff@Nightstar-29119.neoplus.adsl.tpnet.pl] has joined #Code
06:40 mode/#code [+o AnnoDomini] by ChanServ
07:02 Alek|GoneForWeekend is now known as Alek|gone
07:02 Alek|gone is now known as Alek
07:29 Derakon is now known as Derakon[AFK]
08:46 Vornicus [~vorn@Admin.Nightstar.Net] has quit [Quit: ]
09:02 You're now known as TheWatcher
13:04 Rhamphoryncus [~rhamph@Nightstar-7184.ed.shawcable.net] has quit [Quit: Rhamphoryncus]
13:45 ToxicFrog [~ToxicFrog@Admin.Nightstar.Net] has quit [Client exited]
14:44 ToxicFrog [~ToxicFrog@Admin.Nightstar.Net] has joined #code
14:44 mode/#code [+o ToxicFrog] by ChanServ
15:11 KBot [AnnoDomini@Nightstar-29997.neoplus.adsl.tpnet.pl] has joined #Code
15:12 KarmaBot [AnnoDomini@Nightstar-29119.neoplus.adsl.tpnet.pl] has quit [Ping Timeout]
15:12 AnnoDomini [~farkoff@Nightstar-29119.neoplus.adsl.tpnet.pl] has quit [Ping Timeout]
15:14 KBot is now known as KarmaBot
15:19 AnnoDomini [~farkoff@Nightstar-29997.neoplus.adsl.tpnet.pl] has joined #Code
15:19 mode/#code [+o AnnoDomini] by ChanServ
16:03 Syloqs_AFH [Syloq@Admin.Nightstar.Net] has joined #code
16:04 Syloqs_AFH is now known as Syloqs-AFH
16:17 You're now known as TheWatcher[afk]
16:40
<@gnolam>
Aaaand /of course/ Visio's SVG export isn't compatible with Inkscape.
16:43 Vornicus [~vorn@Admin.Nightstar.Net] has joined #code
16:43 mode/#code [+o Vornicus] by ChanServ
16:43
<@gnolam>
GARGH
16:45
<@Vornicus>
Okay.
16:46
<@AnnoDomini>
Oh, no! Our comrade, Space Viking gnolam has been killed in the night by a Space Werebear!
16:46
< EvilDarkLord>
Rejoice.
16:49
<@gnolam>
Oh joy, handling humongous bitmaps instead. :P
17:28 Molgorn [~moltare@Nightstar-16368.plus.com] has joined #code
17:28
< Molgorn>
y halo
17:33
<@Vornicus>
hola.
17:47 Derakon[AFK] is now known as Derakon
18:00 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has joined #code
18:00 mode/#code [+o Attilla] by ChanServ
18:02 Finale [c0cb88fd@Nightstar-14595.mibbit.com] has joined #code
18:02
< Finale>
<gray> fsck. Two hours I looked for the bug. Typo in one symbol.
18:03
< Finale>
<Fester> I know the pain. Be thankful it wasn't APL. :D
18:03
< Finale>
<gray> Two screens of regexp :)
18:03
< Finale>
<Fester> I withdraw my comment. :)
18:05
<@ToxicFrog>
Pffft
18:15
< Finale>
xxx: I was thinking it's illogical to call images on the desktop, wallpaper. They should be called tablecloths.
18:26 Gruber [lenin@Nightstar-1382.A163.priv.bahnhof.se] has joined #Code
18:27 gnolam [lenin@Nightstar-1382.A163.priv.bahnhof.se] has quit [Ping Timeout]
18:28 Gruber is now known as gnolam
18:29 You're now known as TheWatcher
18:33
< Molgorn>
quick question! in PHP, how can I do "$_GET this variable from the URL, or if it's not specified use some_default"?
18:34
<@Derakon>
I believe "$foo = $_GET['bar'] || 'some_default';" works.
18:34
<@TheWatcher>
$foo = $_... what dera said
18:35
< Molgorn>
ah, thank you
18:42 Finale [c0cb88fd@Nightstar-14595.mibbit.com] has left #code []
18:45 gnolam [lenin@Nightstar-1382.A163.priv.bahnhof.se] has quit [Ping Timeout]
18:46 gnolam [lenin@Nightstar-1382.A163.priv.bahnhof.se] has joined #Code
18:46 mode/#code [+o gnolam] by ChanServ
18:46
<@ToxicFrog>
Molgorn: why are you using PHP, incidentally?
18:47
<@Derakon>
Hell, I wasn't aware that you did programming at all.
18:47
< Molgorn>
I'm using PHP scripts to grab data from a MySQL db and output it as XML so it'll play nice with XUL for a Firefox extension
18:47
< Molgorn>
in theory
18:48
< Molgorn>
Der: I don't, as much as I can help
18:48
<@ToxicFrog>
Well, that's what, but it doesn't answer why
18:48
<@ToxicFrog>
PHP is full of spiders ;.;
18:48
< Molgorn>
Because I know even less of any other potential thing I could use to achieve the same end.
18:48
<@AnnoDomini>
ToxicFrog: That emoticon is a spider.
18:52
<@Derakon>
Heh. So it is.
18:52
<@Derakon>
Oh, hey, it's March!
18:52
<@Derakon>
I can download sounds again! <3
18:55
< Molgorn>
Hm. My current incarnation will happily take "grabUser.php?field=user_id&value=1" and return the information for the user with id 1; but it won't take "grabUser.php?field=firstname&value=Test" and return the same information
18:55
< Molgorn>
Given that the user with id 1 is Test Testerson, I find this odd
18:55
<@AnnoDomini>
Check for spaces in the entry?
18:57
< Molgorn>
The DB entry?
18:57
<@AnnoDomini>
Yes.
18:57
< Molgorn>
None there
18:58
<@TheWatcher>
Are you quoting appropriately?
18:58
<@TheWatcher>
In your sql query
18:58
<@ToxicFrog>
Also, is it matching literally?
18:58
<@ToxicFrog>
Oh, wait
18:58
<@ToxicFrog>
Sorry, misread the field
18:59
<@TheWatcher>
(see also: why I absolutely hate php's database support, especially compated to perl's DBI)
19:00
<@TheWatcher>
*compared
19:02
< Molgorn>
The query that worked for user_id is $query = SELECT * FROM User WHERE ".$field." = ".$value;
19:02
<@Derakon>
Eeeegh.
19:02
<@Derakon>
Okay, you need to escape your variables.
19:02
<@TheWatcher>
Mol, where's this running?
19:02
<@Derakon>
http://us3.php.net/mysql_real_escape_string
19:02
< Molgorn>
I'd link, but no voice
19:02
<@Derakon>
Run that on everything you use as a query variable.
19:02 mode/#code [+o Molgorn] by Derakon
19:03
<@TheWatcher>
Because I'd very much like to set value to '1; DROP TABLE User;' ¬¬
19:03
<@Molgorn>
http://people.bath.ac.uk/ajf28/elcano/grabUser.php?field=user_id&value=2
19:03
<@Derakon>
And $field should be chosen from an associative array or something to make certain that it's valid.
19:03
<@Molgorn>
Only 'cos you've seen XKCD
19:03
<@Molgorn>
Der, there'll be time for shiny stuff once I've got a cacky version that does something ¬¬
19:04
<@Derakon>
The cacky version must include escaping variables.
19:04
<@AnnoDomini>
TheWatcher: This is why I name my tables arcanely. :P
19:04
<@Derakon>
This is not shiny. This is a fundamental requirement.
19:04
<@Molgorn>
I don't give a toss about security, inefficiency, horrible practice or the like; I just want something that grabs the info
19:04
<@TheWatcher>
AD: This is why you should *never ever* allow user access to that sort of thing.
19:05
<@AnnoDomini>
Yes.
19:05
<@TheWatcher>
And you should make damned sure to sanitise all user input through the strictest rules
19:05
<@Derakon>
Anyway, must go AFK for a bit.
19:05
<@AnnoDomini>
LETTERS AND NUMBERS ONLY. FINAL DESTINATION.
19:05 Derakon is now known as Derakon[AFK]
19:08
<@Molgorn>
whoops, doesn't work at all now
19:08
<@Molgorn>
Just returns the outermost XML tags
19:10 Syloqs-AFH [Syloq@ServicesAdmin.Nightstar.Net] has quit [Ping Timeout]
19:14 Syloqs_AFH [Syloq@Admin.Nightstar.Net] has joined #code
19:14
<@Molgorn>
http://people.bath.ac.uk/ajf28/elcano/grabUser.txt is a copy of the code, idly
19:14 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has quit [Ping Timeout]
19:15 Syloqs_AFH is now known as Syloqs-AFH
19:15 Derakon[AFK] is now known as Derakon
19:16
<@Derakon>
Okay, thoughts on client/server interactions for scoring. Ramble incoming.
19:17
<@Derakon>
Client sends most recent scores to server. Server saves client score to database, retrieves top 3 scores plus 1 score on either side of client's score. Returns each score. A score entry consists of the rank, name, score, survival time, loop number, and final pattern.
19:17
<@Derakon>
Client can also request scores from the server. In that case, server returns top 3 scores plus 1 score on either side of client's highest-ever score.
19:17
<@Derakon>
In either case, server also tells client the client's highest-ever rank.
19:18
<@Derakon>
Does this all sound plausible?
19:20 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has joined #code
19:20 mode/#code [+o Attilla] by ChanServ
19:29 * Derakon ponders MySQL.
19:30
<@Derakon>
The highscores table has a column 'score', naturally. I have a score. I want to find where that score goes in the table, as well as what "rank" it has compared to adjacent scores.
19:31
<@Derakon>
E.g. a table having scores [15, 12, 9, 6, 3] and a new score 8, I want to get 9 and 6 out, and know that the ranks are 3, 4, and 5.
19:31
<@Derakon>
How the hell do I do that?!
19:32
<@AnnoDomini>
Bubble sort?
19:32
<@Derakon>
Let me rephrase: how do I do this without pulling the entire contents of the database down?
19:40
<@MyCatVerbs>
Hrmn. Don't most databases use b-trees for indexes?
19:40 * gnolam smacks AnnoDomini.
19:41
<@MyCatVerbs>
And most enough any search-tree structure gives you "find next" and "find previous" with pretty good time bounds, provided the nodes have parent pointers.
19:42
<@AnnoDomini>
gnolam: WHAT.
19:43
<@MyCatVerbs>
AnnoDomini: perhaps just the sheer lack of situations in which bubble sort is appropriate? Not to mention the idea of pulling down the whole database.
19:43
<@MyCatVerbs>
AnnoDomini: I mean you may as well suggest towers-of-hanoi-sort.
19:45 * AnnoDomini tries to think of less efficient sorts.
19:46 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has quit [Ping Timeout]
19:46
<@gnolam>
Bogo sort. :P
19:47
<@Derakon>
Random sort.
19:47
<@Derakon>
Permute the list randomly. Check: is it sorted? If not, repeat.
19:47
<@AnnoDomini>
Slim Shady Sorting Algorithm!
19:47
<@Vornicus>
Der: select count(score), min(score) from high_scores where course = my_course AND score > my_score;
19:47
<@Vornicus>
Will get you most of that.
19:48
<@Vornicus>
oh, there's some random-ass group by you have to add, but I don't remember how to group on all of them.
19:49
<@Derakon>
That query's intended to get me, what?
19:49
<@Derakon>
The number of scores and the lowest score?
19:49
<@gnolam>
XKCD's "ass" comic strikes again.
19:49
<@Derakon>
Oh, the scores above the score I'm inserting, I see.
19:49
<@Vornicus>
A random ass-query.
19:52 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has joined #code
19:52 mode/#code [+o Attilla] by ChanServ
19:55 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has quit [Ping Timeout]
20:01 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has joined #code
20:01 mode/#code [+o Attilla] by ChanServ
20:03
<@Derakon>
Argh, MySQL Query Browser is a damn sight better than commandline access, but I really hate how its error console a) is three lines tall, b) puts new errors on the bottom, and c) cannot be cleared.
20:05
<@TheWatcher>
Derakon: install phpMyAdmin
20:07
<@TheWatcher>
needs no admin work by your hoster (edit config.inc.php before uploading), and it makes life vastly easier
20:07
<@Derakon>
What does it do?
20:08
<@TheWatcher>
Gives you a web interface to your databases. Give me a sec and I can show you
20:08
<@Derakon>
Ahh.
21:17 Rhamphoryncus [~rhamph@Nightstar-7184.ed.shawcable.net] has joined #code
21:40 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has quit [Connection reset by peer]
21:40 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has joined #code
21:40 mode/#code [+o Attilla] by ChanServ
21:41 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has quit [Connection reset by peer]
21:41 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has joined #code
21:42 mode/#code [+o Attilla] by ChanServ
21:56
<@Derakon>
I'm having a serious motivation problem with the leaderboard. :\
21:59 Reiv [~82d94c4d@Nightstar-29731.dsl.in-addr.zen.co.uk] has joined #Code
21:59
< Reiv>
So, um.
21:59
<@AnnoDomini>
Soso.
21:59
< Reiv>
I need an Idiots Guide To Tree Structures In Java.
22:00
< Reiv>
I'm not sure why, but while the concept of a tree on paper seems trivial, how to get it working in actual code baffles me.
22:01
<@TheWatcher>
They're kinda like trees everywhere else, except that they are well adapted to the volcanic soils.
22:01
<@TheWatcher>
¬¬
22:02 * Derakon facepalms.
22:02
<@Derakon>
So what's giving you difficulties?
22:02
<@Derakon>
I haven't looked specifically at Java trees, but as a general rule you should have insert, find, and traverse functions.
22:03
< Reiv>
Just... Okay, so you have a cute little object that stores your relevant data that you want to store.
22:03
< Reiv>
How do you get it to attach to other nodes, and attach other nodes to it, so that you can insert/find/delete/traverse?
22:04
<@TheWatcher>
Also, are you writing your own, or using the TreeMap/TreeSet classes?
22:04
< Reiv>
I can't help but think this is a blatantly obvious technical detail that I'm missing.
22:04
<@Derakon>
If the tree is properly abstracted, then you should just call something like tree.insert(other_object) to add to it.
22:04
<@Derakon>
Or if you have two trees, something like tree.extend(other_tree)
22:05
<@Derakon>
And presumably it has an iterator to go over the elements of the tree in order.
22:07
<@Vornicus>
Reiv: your tree node has a parent, a left, and a right. These are references, initially null, to treenodes.
22:07
< Reiv>
Vorn: Does this apply for arbitary number of leaves per node?
22:07
<@Vornicus>
Oh, and it also has a data field which is a container for your data; the data field should implement Collatable or whatever the hell it's called
22:08
<@Vornicus>
Reiv: well in that case you need a list of leaves and a list of datas.
22:08
< Reiv>
Okay. Hrm.
22:12 * Derakon tries to figure out how to clean up this sound effect.
22:13
<@Derakon>
It's so close to perfect but right at the end there's some rattle in it. :\
22:13 * TheWatcher vaguely stabs chomp(), writes a replacement
22:13
<@Derakon>
http://www.soundsnap.com/node/18109 is the sound; I want to use it for the charging deflector.
22:14
< Reiv>
2 minutes long?
22:15
<@Derakon>
Only part of it.
22:15
< Reiv>
Ah.
22:15
<@Derakon>
12s for the charge, and then a 1-2s loop for fully-charged.
22:16
<@Derakon>
Unfortunately, the rattle is not higher-frequency than the tone I want to get.
22:17
<@Derakon>
(Nor lower)
22:17
< Reiv>
I'm still puzzled why you're hardcoding the timer instead of letting it charge like the old way.
22:18
<@Derakon>
I feel this plays better.
22:18
< Reiv>
Okay den.
22:18
<@Derakon>
You still have plenty of incentive to inflect bullets, since that's the only way to increase your multiplier and sparks are a huge portion of your end-of-loop score.
22:19
< Reiv>
Yeah, but just running it in general?
22:19
<@Derakon>
Also, given that I want to have a sound effect for the charging deflector, it's much easier to have the charge length be constant.
22:19
< Reiv>
Well, that's fair, I suppose.
22:19
<@Derakon>
Reiver: so you have to find holes in the pattern where you can safely inflect.
22:19
< Reiv>
How's the sound effect sound if you keep start/stopping it?
22:19
<@Derakon>
I haven't gotten that far yet.
22:19
< Reiv>
Hit play/pause a lot~
22:20
<@Derakon>
Sounds about like I'd expect it to. *shrug*
22:23
<@Derakon>
Oh, I linked the wrong sound earlier. http://www.soundsnap.com/node/17588
22:43 AnnoDomini [~farkoff@Nightstar-29997.neoplus.adsl.tpnet.pl] has quit [Quit: Black, the colour of despair.]
22:50 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has quit [Connection reset by peer]
22:50 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has joined #code
22:50 mode/#code [+o Attilla] by ChanServ
22:58
<@gnolam>
http://retr0bright.wikispaces.com/
22:59 You're now known as TheWatcher[t-2]
23:07 You're now known as TheWatcher[zZzZ]
23:22 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has quit [Connection reset by peer]
23:22 Attilla [~The.Attil@Nightstar-9147.cdif.cable.ntl.com] has joined #code
23:22 mode/#code [+o Attilla] by ChanServ
23:57 Reiv [~82d94c4d@Nightstar-29731.dsl.in-addr.zen.co.uk] has quit [Quit: CGI:IRC (EOF)]
23:58 * gnolam adds Aleksandr Litvinenko to the team roster as "Alpha Tester".
--- Log closed Tue Mar 03 00:00:52 2009
code logs -> 2009 -> Mon, 02 Mar 2009< code.20090301.log - code.20090303.log >