--- Log opened Wed Jun 23 00:00:44 2010 |
00:23 | | You're now known as TheWatcher[T-2] |
00:26 | | You're now known as TheWatcher[zZzZ] |
00:30 | | Attilla [Attilla@Nightstar-39942dbe.threembb.co.uk] has quit [[NS] Quit: ] |
00:57 | | Orthia [orthianz@Nightstar-960320bf.xnet.co.nz] has joined #code |
01:34 | | Derakon[AFK] is now known as Derakon |
01:45 | | gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has quit [[NS] Quit: Z?] |
02:10 | | cpux [Moo@Nightstar-20a84089.dyn.optonline.net] has joined #code |
02:27 | | Orth [orthianz@Nightstar-f3c7e1b2.xnet.co.nz] has joined #code |
02:28 | | Orthia [orthianz@Nightstar-960320bf.xnet.co.nz] has quit [Ping timeout: 121 seconds] |
02:48 | | Orthia [orthianz@Nightstar-9cb5b016.xnet.co.nz] has joined #code |
02:50 | | Orth [orthianz@Nightstar-f3c7e1b2.xnet.co.nz] has quit [Ping timeout: 121 seconds] |
05:06 | | Orth [orthianz@Nightstar-3f2b1ed2.xnet.co.nz] has joined #code |
05:09 | | Orthia [orthianz@Nightstar-9cb5b016.xnet.co.nz] has quit [Ping timeout: 121 seconds] |
05:20 | | cpux [Moo@Nightstar-20a84089.dyn.optonline.net] has quit [Ping timeout: 121 seconds] |
05:21 | | cpux [Moo@Nightstar-20a84089.dyn.optonline.net] has joined #code |
05:38 | | Orth [orthianz@Nightstar-3f2b1ed2.xnet.co.nz] has quit [Connection reset by peer] |
05:39 | | cpux is now known as shade_of_cpux |
05:49 | | Orthia [orthianz@Nightstar-4c43d4d5.xnet.co.nz] has joined #code |
05:57 | | celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!] |
06:43 | | Derakon is now known as Derakon[AFK] |
07:17 | | AnnoDomini [annodomini@Nightstar-53bd0d0d.adsl.tpnet.pl] has joined #code |
07:17 | | mode/#code [+o AnnoDomini] by Reiver |
07:30 | | Derakon[AFK] [Derakon@Nightstar-5213d778.ca.comcast.net] has quit [Ping timeout: 121 seconds] |
08:07 | | Netsplit *.net <-> *.split quits: shade_of_cpux, PinkFreud |
08:30 | | shade_of_cpux [Moo@Nightstar-20a84089.dyn.optonline.net] has joined #code |
08:37 | | shade_of_cpux [Moo@Nightstar-20a84089.dyn.optonline.net] has quit [Ping timeout: 121 seconds] |
08:47 | | * AnnoDomini scratches his head. |
08:49 | <@AnnoDomini> | I'm using a class as a field in another class. Do I need to initialize it in the constructor, or will the field assume the default constructor for the field's class? |
08:50 | <@McMartin> | Language? |
08:50 | <@AnnoDomini> | C++. |
08:50 | <@McMartin> | Then the answer is complex. |
08:50 | <@McMartin> | One moment. |
08:51 | <@McMartin> | So, if you don't do anything special, it will assume the default constructor. |
08:51 | <@McMartin> | If you want to override that behaviour, though, you can't do it in the normal constructor body |
08:51 | <@McMartin> | You have to do it in the initializers. |
08:51 | <@McMartin> | So, if you have class C { Foo a; Bar b; }... |
08:51 | <@McMartin> | Then you need the constructor to be, say: |
08:52 | <@McMartin> | C::C() : a(constructor_arg_for_a), b(and_for_b) { /* rest of constructor */ } |
08:53 | <@McMartin> | These are called "initializers", and they need to be in the same order in the initializer list as they are in the .h declaration, for the order of declaration in the .h is the order they'll be evaluated in. Order *can* matter if some fields depend on the values in previous ones |
08:54 | <@AnnoDomini> | Can I use initializers in the .h? |
08:56 | <@McMartin> | Where would you be putting them? |
08:57 | <@AnnoDomini> | public:\n C(): a(stuff), b() { /* all else*/}; |
09:00 | | Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has joined #code |
09:00 | | PinkFreud [WhyNot@NetworkAdministrator.Nightstar.Net] has joined #code |
09:25 | | You're now known as TheWatcher |
09:44 | | Orthia [orthianz@Nightstar-4c43d4d5.xnet.co.nz] has quit [Connection reset by peer] |
09:45 | | Orthia [orthianz@Nightstar-4c43d4d5.xnet.co.nz] has joined #code |
09:47 | | Vornicus is now known as Vornicus-Latens |
10:56 | | gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has joined #code |
11:01 | | Orth [orthianz@Nightstar-33ecbd0b.xnet.co.nz] has joined #code |
11:03 | | Orthia [orthianz@Nightstar-4c43d4d5.xnet.co.nz] has quit [Ping timeout: 121 seconds] |
11:16 | | Zed [Zed@510B1D.D9AC8A.100BFB.22D714] has quit [Client closed the connection] |
11:17 | | Syloqs-AFH [Syloq@NetworkAdministrator.Nightstar.Net] has quit [Connection closed] |
11:31 | | Orth [orthianz@Nightstar-33ecbd0b.xnet.co.nz] has quit [Client closed the connection] |
11:35 | | Syloqs_AFH [Syloq@NetworkAdministrator.Nightstar.Net] has joined #code |
11:36 | | Syloqs_AFH is now known as Syloqs-AFH |
11:38 | | Orthia [orthianz@Nightstar-cf1cac2f.xnet.co.nz] has joined #code |
12:23 | | shade_of_cpux [Moo@Nightstar-20a84089.dyn.optonline.net] has joined #code |
12:29 | | Orth [orthianz@Nightstar-111f9a7d.xnet.co.nz] has joined #code |
12:31 | | Orthia [orthianz@Nightstar-cf1cac2f.xnet.co.nz] has quit [Ping timeout: 121 seconds] |
13:13 | | Stalker [Z@3A600C.A966FF.5BF32D.8E7ABA] has quit [Ping timeout: 121 seconds] |
13:13 | | Stalker [Z@3A600C.A966FF.5BF32D.8E7ABA] has joined #code |
13:25 | < Orth> | What is the Principle of Optimality? |
13:26 | | * Orth is trying to think how to summarise it into a One Or Two Line answer for his crib notes. |
13:50 | < EvilDarkLord> | So what's your best attempt so far? |
14:01 | < Orth> | Er. If things hold to the principle of optimality, you can use dynamic programming to solve them |
14:01 | < Orth> | For the principles to hold, they need to obey certain assumptions |
14:03 | | * Orth tries to dig them up out of the pile of paper again >_> |
14:03 | < Orth> | Oh, yes |
14:03 | < Orth> | When a subset of the problem can also be optimal. |
14:06 | | NSJavaGuest-9436 [nsJChat@297948.8B5A65.6234FF.9FFAD1] has joined #code |
14:06 | | NSJavaGuest-9436 [nsJChat@297948.8B5A65.6234FF.9FFAD1] has quit [[NS] Quit: Nightstar's Java Chat http://www.nightstar.net] |
14:19 | | Netsplit *.net <-> *.split quits: Thaqui, PinkFreud |
14:23 | | Orthia [orthianz@Nightstar-97da1f17.xnet.co.nz] has joined #code |
14:25 | | Orth [orthianz@Nightstar-111f9a7d.xnet.co.nz] has quit [Ping timeout: 121 seconds] |
14:37 | | Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has joined #code |
14:37 | | PinkFreud [WhyNot@NetworkAdministrator.Nightstar.Net] has joined #code |
14:37 | | celticminstrel [celticminstre@1526F6.37AB0D.97233B.788A64] has joined #code |
14:39 | | Netsplit *.net <-> *.split quits: celticminstrel, Thaqui, PinkFreud |
14:44 | | Netsplit over, joins: Thaqui |
14:47 | | PinkFreud [WhyNot@NetworkAdministrator.Nightstar.Net] has joined #code |
14:47 | | celticminstrel [celticminstre@1526F6.37AB0D.97233B.788A64] has joined #code |
15:11 | <@AnnoDomini> | How do I get grep to search filenames only? |
15:12 | <@ToxicFrog> | What do you mean by "search filenames only"? |
15:12 | < celticminstrel> | Maybe you should use find instead? |
15:12 | <@ToxicFrog> | You only want it to report the names of files that contain matches? |
15:13 | <@ToxicFrog> | You want to list all files whose names match a given pattern (use 'find' instead, or 'ls | grep') |
15:13 | <@ToxicFrog> | You want a pattern that will only match valid filenames? |
15:13 | < celticminstrel> | The problem with 'ls | grep' is that you don't see the full path of the file. |
15:13 | <@AnnoDomini> | find seems to be what I need. Do I need to specify that it should search all subdirectories? |
15:13 | < celticminstrel> | Which only matters if you use the recursive flag, but whatever. |
15:14 | < celticminstrel> | I think find searches subdirectories by default... |
15:15 | <@AnnoDomini> | "find ./ reynolds" seems to list every file everywhere below my location. |
15:15 | <@AnnoDomini> | What am I doing wrong? |
15:16 | <@ToxicFrog> | 'man find' |
15:16 | <@ToxicFrog> | Specifically, it's 'find paths conditions' |
15:16 | <@ToxicFrog> | The default condition is to find everything. |
15:16 | <@ToxicFrog> | So you told it to find everything in or under './' and 'reynolds'. |
15:16 | <@ToxicFrog> | You probably wanted something like 'find . -name reynolds' |
15:17 | <@ToxicFrog> | (or -iname for a case-insensitive search) |
15:17 | <@AnnoDomini> | Mhm. |
15:17 | <@ToxicFrog> | Also, don't forget about 'locate' |
15:18 | <@ToxicFrog> | Which can be considerably faster than find if you're searching large trees. |
15:19 | <@ToxicFrog> | (drawback being that it won't find recently-created stuff, since on most configurations updatedb only runs once per day) |
15:19 | <@AnnoDomini> | locate worked! |
15:28 | | Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has quit [Client closed the connection] |
15:36 | <@ToxicFrog> | locate is p. sweet. |
15:40 | < celticminstrel> | Except if the database doesn't exist. <_< |
15:40 | <@ToxicFrog> | Then you need to fix your crontab~ |
15:41 | < celticminstrel> | Trying to run locate tells me how to fix it. |
15:42 | <@ToxicFrog> | Yeah, but my point is, most systems have a cron entry that will automatically updatedb daily, and without that there's no benefit to using locate over find / |
15:56 | | Attilla [Attilla@Nightstar-8c6cc3b0.threembb.co.uk] has joined #code |
15:56 | | mode/#code [+o Attilla] by Reiver |
16:45 | <@jerith> | SQLers to me! |
16:46 | <@jerith> | I have a query I can't figure out how to write. |
16:46 | < celticminstrel> | Oh? |
16:46 | <@jerith> | My table has a bunch of rows in it. Basically transactions. |
16:46 | <@jerith> | Any given user might have multiple transactions. |
16:47 | <@jerith> | There is a column for a particular transaction property that should, in theory, be set on one transaction per user. |
16:47 | <@jerith> | There are some users that don't have it set at all. |
16:48 | <@jerith> | Now, I can do something like "SELECT 1 FROM mytable GROUP BY user_id HAVING sum(somefield) = 0;" |
16:48 | <@jerith> | But I can't come up with a way to count the number of rows that would return. |
16:50 | <@ToxicFrog> | jerith: http://www.w3schools.com/sql/sql_func_count.asp |
16:51 | <@jerith> | ToxicFrog: The GROUP BY makes count() happen per-group, not over the groups. |
16:52 | <@jerith> | Although I can use a subquery to do what I want. |
16:53 | <@jerith> | "SELECT count(1) FROM (SELECT 1 FROM mytable GROUP BY user_id HAVING sum(somefield) = 0) x;" |
16:53 | <@jerith> | (The trailing x is because a derived table needs a name, even if it isn't being referenced.) |
16:53 | < celticminstrel> | Why not 'as x'? |
16:54 | <@jerith> | Because it's in a FROM block and thus the AS is optional. I think. |
16:54 | <@jerith> | Something like that. |
16:54 | < celticminstrel> | Okay. |
16:55 | < celticminstrel> | I learned it with the as, then saw it used somewhere without and thought "wait, what?". |
16:55 | <@jerith> | I tend to use that for joins and stuff, because otherwise it gets quite verbose. |
16:55 | < celticminstrel> | It seems odd to be selecting 1... :/ |
16:56 | <@jerith> | There aren't any values I care about in there, but I have to select /something/... |
17:14 | | Attilla [Attilla@Nightstar-8c6cc3b0.threembb.co.uk] has quit [Ping timeout: 121 seconds] |
17:16 | | Attilla [Attilla@Nightstar-ff4a0e06.threembb.co.uk] has joined #code |
17:16 | | mode/#code [+o Attilla] by Reiver |
17:39 | | Vornicus-Latens is now known as Vornicus |
18:04 | | Orthia [orthianz@Nightstar-97da1f17.xnet.co.nz] has quit [Connection reset by peer] |
18:12 | | Orthia [orthianz@Nightstar-97da1f17.xnet.co.nz] has joined #code |
18:26 | | celticminstrel [celticminstre@1526F6.37AB0D.97233B.788A64] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!] |
18:31 | | Orthia [orthianz@Nightstar-97da1f17.xnet.co.nz] has quit [Client closed the connection] |
18:48 | | Orthia [orthianz@Nightstar-97da1f17.xnet.co.nz] has joined #code |
21:26 | | * Orthia goes to his exam. |
21:26 | <@ToxicFrog> | Good luck. |
21:27 | < Orthia> | Thank you *wibble* |
21:41 | | celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has joined #code |
21:42 | <@ToxicFrog> | Ok, this is a new low for p4diff |
21:42 | <@ToxicFrog> | Changes (base/theirs): 0 |
21:42 | <@ToxicFrog> | Changes (base/mine): 2 |
21:42 | <@ToxicFrog> | Conflicts (theirs/mine): 24 |
21:43 | <@AnnoDomini> | Whitespaaaaaaaace. |
21:43 | <@ToxicFrog> | Nope, there's actually 24 and 26 non-whitespace changes respectively. |
22:22 | <@Vornicus> | wtf |
22:53 | <@ToxicFrog> | perforce at work |
22:58 | | Derakon [Derakon@Nightstar-1ffd02e6.ucsf.edu] has joined #code |
22:58 | | mode/#code [+o Derakon] by Reiver |
22:58 | | * Derakon eyes something he's trying to do, annoyed at Python's approach to name binding. |
22:58 | <@Derakon> | http://pastebin.starforge.co.uk/311 |
22:59 | <@Derakon> | I think the desired functionality should be fairly self-evident. |
22:59 | <@Derakon> | Finding a way to achieve that functionality, though... |
22:59 | <@Derakon> | Work closures properly, dangit! |
22:59 | < celticminstrel> | Uh. What. How does that produce that output? |
23:00 | <@Derakon> | "thing" in the for loop is being updated, and therefore updating what the lambdas do. |
23:00 | < celticminstrel> | Oh. |
23:00 | < celticminstrel> | Well, why do you even need the lambdas? |
23:00 | <@Derakon> | They're leftover from the actual implementation details. |
23:00 | <@Derakon> | In this case, I need an event handler. |
23:01 | <@Derakon> | So I have a function that must accept only one argument, and I'd rather use a lambda intermediary than try to use the event object to figure out what I actually want to do. |
23:01 | <@Derakon> | wx.EVT_BUTTON(self, button.GetId(), lambda event: self.doSomethingWith(objectAssociatedWithButton)) |
23:02 | <@Derakon> | (I could bind the event to self.doSomethingWith, but then that function must take an event object and use that to determine the object that actually must be operated on. Clumsy) |
23:05 | <@Derakon> | Anyway, any ideas for a non-clumsy way of getting Python to do what I want here? |
23:42 | < PinkFreud> | yes. switch to perl. |
23:42 | | * PinkFreud ducks. |
23:42 | <@Derakon> | I don't feel like embedding a Perl terp into my Python program here... |
23:45 | < PinkFreud> | :P |
--- Log closed Thu Jun 24 00:00:45 2010 |