code logs -> 2009 -> Mon, 20 Apr 2009< code.20090419.log - code.20090421.log >
--- Log opened Mon Apr 20 00:00:49 2009
00:03 AnnoDomini [~farkoff@Nightstar-29619.neoplus.adsl.tpnet.pl] has joined #Code
00:03 mode/#code [+o AnnoDomini] by ChanServ
00:06
<@AnnoDomini>
I think I need to set up the thing over in GlassFish.
00:06
<@AnnoDomini>
Huh. The help file was actually useful for my dilemma.
00:16
<@AnnoDomini>
Different error message. Yay.
00:44
<@AnnoDomini>
Gnrar.
00:46
<@AnnoDomini>
"Error in allocating a connection. Cause: Class name is wrong or classpath is not set for: org.postgresql.ds.PGSimpleDataSource"
00:47
<@AnnoDomini>
I have a driver that has this class in it. I'm stumped as to how to I make GlassFish see it.
00:51
<@AnnoDomini>
Nevermind. I think I got it.
01:12
<@AnnoDomini>
Hmm. 'Privileges' isn't an SQL keyword, right?
01:14
<@AnnoDomini>
'Desc' seems to be, somehow, and that's causing the SQL parser to go batshit.
01:23
<@AnnoDomini>
Descending, I think. WTF? The bloody database LET ME NAME THE FIELD SO. >:(
01:41
<@AnnoDomini>
FUCKING FINALLY.
01:41
<@AnnoDomini>
It displays a table mostly correctly.
01:42
<@AnnoDomini>
Stupid Power Designer. Couldn't you give me some sort of hint? "Hey, you're using keywords for names! That's not very good!"
01:49 AnnoDomini [~farkoff@Nightstar-29619.neoplus.adsl.tpnet.pl] has quit [Quit: The weak suffer. I endure.]
01:50 Reiver [~reaverta@Nightstar-22465.xdsl.xnet.co.nz] has quit [Quit: Changing servers]
01:52 Reiver [~reaverta@Nightstar-22465.xdsl.xnet.co.nz] has joined #Code
01:52 mode/#code [+o Reiver] by ChanServ
02:10 gnolam [lenin@Nightstar-1382.A163.priv.bahnhof.se] has quit [Quit: Z?]
02:27 Consul [~consul@Nightstar-1864.dsl.sfldmi.ameritech.net] has joined #code
02:27 mode/#code [+o Consul] by ChanServ
02:32 Consul [~consul@Nightstar-1864.dsl.sfldmi.ameritech.net] has quit [Quit: Leaving]
02:39 Consul [~consul@Nightstar-1864.dsl.sfldmi.ameritech.net] has joined #code
02:39 mode/#code [+o Consul] by ChanServ
06:03 Syloqs-AFH [Syloq@ServicesAdmin.Nightstar.Net] has quit [Connection reset by peer]
06:08 * Reiver hunts McM.
06:09
<@Derakon>
Why McM in particular?
06:12
<@Reiver>
He knows Haskell, and I am having some conceptual issues.
06:18
<@Derakon>
Fair enough.
06:21
<@Reiver>
Well, functional programming ones anyway.
06:21
<@Reiver>
To whit: Take a list [a], split it into two sublists half as long. So [1,2,3,4,5,6] ends up [1,2,3] [4,5,6]
06:22
<@Reiver>
Every time I think of it it ends up just being a for loop that runs length/2 times
06:22
<@Reiver>
And that worries me~
06:27
<@Derakon>
If you could do pointer math you could do it in constant time, though the lists would be arrays instead of lists.
06:29
<@Vornicus>
What, no list slicing?
06:32 gnolam [lenin@Nightstar-1382.A163.priv.bahnhof.se] has joined #Code
06:32 mode/#code [+o gnolam] by ChanServ
06:48 Syloqs_AFH [Syloq@Admin.Nightstar.Net] has joined #code
06:49 Syloqs_AFH is now known as Syloqs-AFH
06:53
<@Reiver>
Vorn: This is a programming puzzle.
06:53
<@Reiver>
I'm sure there's a way to slice, but I'm doing it myself~
07:03 Syloqs-AFH [Syloq@ServicesAdmin.Nightstar.Net] has quit [Ping Timeout]
07:05 * Derakon ponders how to iterate over permutations of a list.
07:15 NSGuest-558 is now known as EvilDarkLord
07:18 * EvilDarkLord is ashamed of his O(N^3)-ness, edits.
07:21
< EvilDarkLord>
Yay for depth-first letting me recycle lists all the time.
07:30 Derakon is now known as Derakon[AFK]
07:47
<@Vornicus>
Der: there's the "plain changes" way, which is a recursive one; it does not handle duplicates well though.
07:47
<@Vornicus>
There's also the lexicographic permutation generator which works better with duplicates.
07:55
<@Vornicus>
Plain changes is very simple: def plain_changes(seq): if len(seq) == 1: yield seq;; for perm in plain_changes(seq[:-1]): for k in range(len(seq) + 1): yield perm[:k] + (seq[-1],) + perm[k:]
07:57
<@Vornicus>
this actually isn't the full plain changes - the actual one reverses the order the last item gets inserted in for each permutation.
07:57 somnolence [~somnolenc@Nightstar-3790.hsd1.ca.comcast.net] has quit [Connection reset by peer]
08:00
<@Vornicus>
and I screwed it up anyway - should be just len(seq) instead of len(seq) + 1, or len(perm) + 1
08:00 somnolence [~somnolenc@Nightstar-3790.hsd1.ca.comcast.net] has joined #code
08:00
<@Vornicus>
(also the full plain changes uses seq[1:] and seq[0] instead of seq[:-1] and seq[-1])
08:05
<@Vornicus>
Knuth has put out a whole fascicle on generating all permutations.
08:12
< EvilDarkLord>
I should get around to reading Knuth.
08:15
<@Vornicus>
I... do not think "reading" is what one does with TAoCP
08:17
<@Vornicus>
or more precisely: if you're just /reading/ it, you're going to get yourself totally lost.
08:35 * simontwo gave it a bad review for having very incoherent connections between the... uh, chapters.
08:42 Vornicus [Vornicus@Admin.Nightstar.Net] has quit [Quit: ]
09:06 You're now known as TheWatcher
09:18 AnnoDomini [~farkoff@Nightstar-29619.neoplus.adsl.tpnet.pl] has joined #Code
09:18 mode/#code [+o AnnoDomini] by ChanServ
09:29 Namegduf [namegduf@86.25.56.ns-4159] has joined #code
10:02 * gnolam stabs humanity in general.
10:03
<@AnnoDomini>
Ow. I just had a phantom pain in my phantom association with the human race.
10:22 * simontwo stabs in your general direction.
10:41 Rhamphoryncus [~rhamph@Nightstar-7184.ed.shawcable.net] has quit [Quit: Rhamphoryncus]
16:01 Syloqs_AFH [Syloq@Admin.Nightstar.Net] has joined #code
16:03 Syloqs_AFH is now known as Syloqs-AFH
16:30 You're now known as TheWatcher[afk]
16:38 Derakon[AFK] is now known as Derakon
18:15 NSGuest-560 is now known as C_tiger
18:25 You're now known as TheWatcher
18:46 Gruber [lenin@Nightstar-1382.A163.priv.bahnhof.se] has joined #Code
18:46 * Derakon writes "if reduce(add, [len(foo) for foo in [num, m1, m2]], 0) == 10:" to avoid writing "len(str(foo))" three times.
18:48 gnolam is now known as NSGuest-579
18:48 Gruber is now known as gnolam
18:49 NSGuest-579 [lenin@Nightstar-1382.A163.priv.bahnhof.se] has quit [Ping Timeout]
18:54 * TheWatcher bleghs, gets back to work on session code
19:16 Rhamphoryncus [~rhamph@Nightstar-7184.ed.shawcable.net] has joined #code
20:08 Brian [~chatzilla@Nightstar-25527.renf.cable.ntl.com] has joined #code
20:10 Brian [~chatzilla@Nightstar-25527.renf.cable.ntl.com] has quit [Connection reset by peer]
20:12 Brian [~chatzilla@Nightstar-25527.renf.cable.ntl.com] has joined #code
20:18 Brian [~chatzilla@Nightstar-25527.renf.cable.ntl.com] has left #code []
20:25 duckie [~ture@Nightstar-10159.h195-5-116-185.fiber.ee] has joined #code
20:25 duckie [~ture@Nightstar-10159.h195-5-116-185.fiber.ee] has left #code [/!\ http://VeryGoodScript.tk /!\]
20:34 * Derakon tries to remember how to apply dynamic programming to this problem.
20:35
<@Derakon>
It's the "how many ways can you make up this amount of money given these denominations of currency."
20:35
<@Derakon>
(Project Euler #31, if you're curious)
20:36
<@Derakon>
I thought I could do it by "for n in range(1, target): if n has a coin assigned to it, add 1 to number of ways; for each coin value a less than n: add number of ways to make a to number of ways"
20:36
<@Derakon>
But that overcounts.
20:37
<@Derakon>
For example, if you have coins of denomination 1 and 2, then there are 2 ways to make 2, but not 3 ways to make 3.
20:37
<@McMartin>
Careful with this one; greedy algorithms work for US currency but don't work in general.
20:37
<@McMartin>
Also, look at products, not sums~
20:37
<@McMartin>
Also also, if you're a filthy cheater, this is a worked example in SICP for dynamic programming.
20:38
<@MyCatVerbs>
Remind me something. Don't C++ exceptions carry a stack trace with 'em?
20:39
<@Derakon>
I don't think I'm doing a greedy algorithm here...
20:39
<@McMartin>
Not the way Java ones do; you need OS support.
20:39
<@McMartin>
Which exists for GNU but I forget offhand what it is.
20:40
<@Derakon>
It should be true for any coinage system that the number of ways to make a target n is based on the number of ways to make values less than n that, when a coin is added to them, make n.
20:40
<@McMartin>
Game Programming Gems has a reasonably generic way of making one with the preprocessor, but it (naturally) adds function call overhead.
21:37
<@MyCatVerbs>
McMartin: thank you. One gets so used to having nice features in languages these days, going back to the anachronistic crap is barely thinkable.
21:57 You're now known as TheWatcher[t-2]
22:02 Consul [~consul@Nightstar-1864.dsl.sfldmi.ameritech.net] has quit [Client exited]
22:04 You're now known as TheWatcher[zZzZ]
22:33 Consul [~consul@Nightstar-1864.dsl.sfldmi.ameritech.net] has joined #code
22:33 mode/#code [+o Consul] by ChanServ
23:05 AnnoDomini [~farkoff@Nightstar-29619.neoplus.adsl.tpnet.pl] has quit [Quit: Oh, I'm no end-table. I'm a nightstand.]
23:19 Rhamphoryncus [~rhamph@Nightstar-7184.ed.shawcable.net] has quit [Ping Timeout]
23:26 Rhamphoryncus [~rhamph@Nightstar-7184.ed.shawcable.net] has joined #code
23:33 Rhamphoryncus [~rhamph@Nightstar-7184.ed.shawcable.net] has quit [Ping Timeout]
23:40 Rhamphoryncus [~rhamph@Nightstar-7184.ed.shawcable.net] has joined #code
23:57 KBot [AnnoDomini@Nightstar-29122.neoplus.adsl.tpnet.pl] has joined #Code
23:58 KarmaBot [~karma.bot@Nightstar-29619.neoplus.adsl.tpnet.pl] has quit [Ping Timeout]
--- Log closed Tue Apr 21 00:00:03 2009
code logs -> 2009 -> Mon, 20 Apr 2009< code.20090419.log - code.20090421.log >