--- Log opened Fri Oct 01 00:01:00 2010 |
00:04 | | You're now known as TheWatcher[T-2] |
00:07 | | You're now known as TheWatcher[zZzZ] |
00:26 | | Zed [Zed@Nightstar-556ea8b5.or.comcast.net] has joined #code |
01:45 | | Derakon[AFK] is now known as Derakon |
01:45 | | Orthia [orthianz@Nightstar-02d31696.xnet.co.nz] has joined #code |
01:46 | | kwsn [kwsn@Nightstar-a0abd809.dyn.centurytel.net] has joined #code |
02:21 | | gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has quit [[NS] Quit: Z?] |
03:14 | | Kaura|out [kaura@Nightstar-fd82400d.snfc21.sbcglobal.net] has joined #code |
03:14 | | Orthia [orthianz@Nightstar-02d31696.xnet.co.nz] has quit [Client closed the connection] |
03:20 | | Kaura|out is now known as Kaura |
03:22 | | Orthia [orthianz@Nightstar-02d31696.xnet.co.nz] has joined #code |
03:25 | < simon_> | hmm |
03:26 | < simon_> | I have to express some english sentences using propositional logic, but I'm tempted to claim that there is some ambiguity in the sentences. |
03:27 | < simon_> | "Every prize was won by a boy", I encoded as ?x(P(x) -> ?y(B(y)?W(x,y))). |
03:28 | < simon_> | then, "A boy won every prize", I am tempted to assume that the difference is that this is a particular boy, but apparently it isn't, because ?x(P(x) -> W(x,b)) was apparently wrong. |
03:29 | < simon_> | it might be that I should be writing ?x(P(x) -> B(b)?W(x,b)) because b is just a term. |
03:30 | < simon_> | but maybe I don't understand the english sentence. |
03:37 | < Kaura> | Can't read the code (HydraIRC mangles it), but both examples are really vague. Both can be interpreted as "each available prize was won by a set of boys" or "all prizes were won by one boy." |
03:37 | | Orthia [orthianz@Nightstar-02d31696.xnet.co.nz] has quit [Client closed the connection] |
03:45 | | Orthia [orthianz@Nightstar-02d31696.xnet.co.nz] has joined #code |
03:48 | < simon_> | Kaura, I agree. |
03:48 | < simon_> | Kaura, sorry about the unicode. |
03:52 | | Stalker [Z@3A600C.A966FF.5BF32D.8E7ABA] has joined #code |
03:59 | <@Vornicus> | Kaura! |
04:06 | | kwsn [kwsn@Nightstar-a0abd809.dyn.centurytel.net] has quit [[NS] Quit: hey look a bed -thunk-] |
04:10 | | Orthia [orthianz@Nightstar-02d31696.xnet.co.nz] has quit [Client closed the connection] |
04:18 | | Orthia [orthianz@Nightstar-02d31696.xnet.co.nz] has joined #code |
04:22 | | Orthia [orthianz@Nightstar-02d31696.xnet.co.nz] has quit [Client closed the connection] |
04:30 | | Orthia [orthianz@Nightstar-02d31696.xnet.co.nz] has joined #code |
04:30 | | Orthia [orthianz@Nightstar-02d31696.xnet.co.nz] has quit [Client closed the connection] |
04:47 | | Orthia [orthianz@Nightstar-02d31696.xnet.co.nz] has joined #code |
04:47 | | Orthia [orthianz@Nightstar-02d31696.xnet.co.nz] has quit [Connection reset by peer] |
04:48 | < Kaura> | Vorn: Ah, sorry, was eating dinner. |
04:49 | | * simon_ composed song lyrics for a cover song about IPv6. |
04:55 | | Orthia [orthianz@Nightstar-02d31696.xnet.co.nz] has joined #code |
04:56 | <@McMartin> | . |
04:59 | < Orthia> | yoh, McM |
05:01 | <@Vornicus> | Kaura: works for me. Anyway, a challenge for you: Make it so "Draw" works as well as "draw", without adding "Draw" to the dispatch dictionary. there's something in the string library that will make this work. |
05:02 | < Orthia> | Hint: This will probably also accept DRAW and dRaW when you are done |
05:03 | <@Vornicus> | (a /greater/ challenge would be to make it accept "mountain", "Mountain", and "MOUNTAIN". It's on my Crazy Shit List) |
05:05 | < Kaura> | ... |
05:05 | < Kaura> | ...hrn... |
05:06 | <@Vornicus> | Er, the string methods, rather. http://docs.python.org/library/stdtypes.html#string-methods <--- that. |
05:09 | < Kaura> | str.lower(), so as to convert all inputs into lowercase? |
05:12 | <@Vornicus> | Yep. |
05:13 | <@Vornicus> | But don't do it to names of cards or the like. |
05:17 | <@McMartin> | Orthia: ? |
05:18 | < Kaura> | Ah, there we go. Took a while to understand where its proper placement was. return CMND_NAMES[function.lower()](parameter) |
05:20 | < Orthia> | <McMartin> . |
05:21 | < Orthia> | I thought I'd say hi~ |
05:39 | <@Vornicus> | Kaura: exactly. |
05:40 | <@Vornicus> | Hey, do yourself a favor, write a help string. Use """triple quotes""", they let you use multiple lines. |
05:47 | < Kaura> | I would if this computer was cooperating at all. brb, the darn thing's overheating. |
05:47 | | Kaura [kaura@Nightstar-fd82400d.snfc21.sbcglobal.net] has quit [[NS] Quit: HydraIRC -> http://www.hydrairc.com <- Wibbly Wobbly IRC] |
06:09 | | gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has joined #code |
06:13 | | Ortiha [orthianz@Nightstar-679e4bff.xnet.co.nz] has joined #code |
06:16 | | Orthia [orthianz@Nightstar-02d31696.xnet.co.nz] has quit [Operation timed out] |
06:17 | | cpux is now known as shade_of_cpux |
06:21 | | kaura [kaura@Nightstar-fd82400d.snfc21.sbcglobal.net] has joined #code |
06:32 | < Alek> | xxx: What was Pascal's first name? |
06:32 | < Alek> | yyy: uhh... |
06:32 | < Alek> | yyy: Turbo? |
06:36 | < gnolam> | :) |
06:39 | < gnolam> | Joseph-Louis Lagrange, Blaise Pascal and Isaac Newton were playing hide-and-seek. Lagrange was seeking first, so he closed his eyes and started counting. |
06:40 | < gnolam> | Pascal immediately ran off to hide, but Newton just stood there, drawing a box in the sand around his feet, each side exactly 1 meter long. |
06:40 | < gnolam> | Lagrange opened his eyes, immediately saw his friend and said, "Found you, Newton!" |
06:40 | < gnolam> | Newton grinned and said "No you didn't - you found Pascal!" |
06:40 | < Ortiha> | what |
06:41 | < gnolam> | Ortiha: 1 Pa = 1 N/m^2. |
06:42 | < Alek> | ow. |
06:43 | < Ortiha> | >_< |
07:01 | | Derakon is now known as Derakon[AFK] |
07:02 | | gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has quit [[NS] Quit: STORK!] |
07:11 | | Anno[Laptop] [annodomini@Nightstar-58637160.adsl.tpnet.pl] has joined #code |
07:15 | < Alek> | O_O |
07:15 | < Alek> | http://www.techcomedy.com/single/new_stories.php?content_number=84313 |
08:32 | | Ortiha [orthianz@Nightstar-679e4bff.xnet.co.nz] has quit [Connection reset by peer] |
08:36 | | Orthia [orthianz@Nightstar-679e4bff.xnet.co.nz] has joined #code |
08:48 | | You're now known as TheWatcher |
10:07 | | Ortiha [orthianz@Nightstar-b59e4cd7.xnet.co.nz] has joined #code |
10:09 | | Orthia [orthianz@Nightstar-679e4bff.xnet.co.nz] has quit [Ping timeout: 121 seconds] |
10:09 | | Anno[Laptop] [annodomini@Nightstar-58637160.adsl.tpnet.pl] has quit [[NS] Quit: Need to flee.] |
10:42 | | Anno[Laptop] [annodomini@F67919.F326B3.98D923.BDA7B6] has joined #code |
10:50 | | Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has quit [Connection closed] |
11:01 | | Ortiha [orthianz@ServerAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds] |
11:05 | | Orthia [orthianz@Nightstar-959cf91c.xnet.co.nz] has joined #code |
11:22 | | Zed [Zed@Nightstar-556ea8b5.or.comcast.net] has quit [Ping timeout: 121 seconds] |
11:38 | | Ortiha [orthianz@Nightstar-223026ef.xnet.co.nz] has joined #code |
11:40 | | Orthia [orthianz@Nightstar-959cf91c.xnet.co.nz] has quit [Ping timeout: 121 seconds] |
11:59 | | Stalker [Z@3A600C.A966FF.5BF32D.8E7ABA] has quit [Ping timeout: 121 seconds] |
12:16 | | Tarinaky [Tarinaky@Nightstar-f349ca6d.plus.com] has joined #code |
12:54 | | Ortiha [orthianz@Nightstar-223026ef.xnet.co.nz] has quit [Ping timeout: 121 seconds] |
13:02 | | Orthia [orthianz@Nightstar-e37a1bf5.xnet.co.nz] has joined #code |
13:06 | | Anno[Laptop] [annodomini@F67919.F326B3.98D923.BDA7B6] has quit [[NS] Quit: leaving] |
13:39 | | Anno[Laptop] [annodomini@Nightstar-58637160.adsl.tpnet.pl] has joined #code |
15:18 | | Rhamphoryncus [rhamph@FFAAA3.3FB6E7.D3A0EC.A9CC80] has quit [Client exited] |
16:56 | | celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has joined #code |
17:06 | | Zed [Zed@Nightstar-556ea8b5.or.comcast.net] has joined #code |
17:41 | <@jerith> | So, Java people. |
17:41 | <@jerith> | I have need of a small command parser for my Android IRC client. |
17:42 | <@jerith> | Basically, turn "/something some data" into ("something", "some data") and call an appropriate method on it. |
17:43 | <@jerith> | I'm struggling with the second part. |
17:43 | <@jerith> | Is there a better way to do it than a giant if ladder? |
17:43 | <@jerith> | Or anonymous callables stashed in a map at initialisation time? |
17:43 | <@jerith> | The former's ugly. The latter's verbose. |
17:49 | | Zed [Zed@Nightstar-556ea8b5.or.comcast.net] has quit [Ping timeout: 121 seconds] |
17:59 | | * jerith learns annotations. |
18:00 | < celticminstrel> | Java? |
18:01 | | * jerith nods. |
18:08 | < celticminstrel> | I never really understood the utility of Java annotations... |
18:18 | < ToxicFrog> | jerith: write your command dispatcher in Scala instead?~ |
18:19 | <@jerith> | ToxicFrog: I was tempted to learn Scala to write this whole app, but it's *way* too bulky for Android. |
18:20 | <@jerith> | I'm currently fiddling with annotations and reflection. That should keep all the ugliness in one place. |
18:21 | < ToxicFrog> | It doesn't have 6MB to spare for the Scala runtime library? |
18:22 | <@jerith> | It does, if I uninstall a bunch of other apps. |
18:22 | <@jerith> | And the device doesn't really have very many spare computrons. |
18:29 | | Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has joined #code |
18:36 | < ToxicFrog> | Aah. |
18:36 | < ToxicFrog> | I thought Androids were Surprisingly Beefy for smartphones. |
18:36 | <@jerith> | ToxicFrog: They are. |
18:37 | <@jerith> | Still, my app is likely to be heavy enough on its own without adding Yet Another Runtime. |
18:37 | <@jerith> | It's the "for smartphones" part of your statement that's the problem. |
18:38 | < ToxicFrog> | Aah. |
18:39 | | * ToxicFrog doesn't use them and doesn't really have a frame of reference, I figured that a few GB of storage would be typical |
18:40 | <@jerith> | The on-phone storage is typically pretty small. |
18:40 | <@jerith> | You can shove a bloody great SD card into it, but you can't run apps off there. |
18:41 | <@jerith> | (You can /kind of/ run apps from the SD card in the most recent version, but that still requires a chunk to live in phone memory.) |
18:41 | < Namegduf> | RAM is also concerning on Android phones. |
18:42 | <@jerith> | Yeah. If you use a lot of memory, you're likely to be killed a lot when you don't have focus. |
18:42 | <@jerith> | Which is kind of suboptimal for an IRC client. |
18:42 | < Namegduf> | An IRC client could avoid it (I think holding a connection open prevents it?) but using a lot of RAM would make everything *else* be killed a lot. |
18:43 | | * ToxicFrog learns Java annotations |
18:43 | < ToxicFrog> | ...these are nothing like Python decorators :( |
18:43 | <@jerith> | You can set your priority to be higher, but the foreground app wins over pretty much everything else. |
18:43 | <@jerith> | ToxicFrog: Yeah. Java's nothing like Python... |
18:44 | < ToxicFrog> | Well, yes |
18:44 | < ToxicFrog> | But they look similar and seemed to be used in similar ways |
18:44 | < ToxicFrog> | But it turns out they're totally different and not, actually, useful in that way at all |
18:44 | | * jerith nods. |
18:44 | <@jerith> | Well... |
18:45 | <@jerith> | You can kind of get the same effect by doing a bunch of reflection magic. |
18:45 | <@jerith> | But they're a lot more like function attributes in Python. |
18:45 | < ToxicFrog> | Yeah, the whole point of decorators is not to have to do a bunch of reflection magic. |
18:46 | <@jerith> | (And I have a bunch of decorators in various codebases that just set properties.) |
18:47 | | TarinakyKai [Tarinaky@Nightstar-f349ca6d.plus.com] has joined #code |
18:49 | | Tarinaky [Tarinaky@Nightstar-f349ca6d.plus.com] has quit [Operation timed out] |
18:54 | < ToxicFrog> | jerith: do you know of any way to get a decorator effect in Java? |
18:55 | <@jerith> | Nope. You can solve that class of problems in different ways, though. |
18:56 | < celticminstrel> | Yeah, Java annotations are nowhere as useful as Python decorators despite having essentially the same syntax. |
18:59 | < ToxicFrog> | jerith: what ways45rr/? |
18:59 | < celticminstrel> | ...? |
18:59 | <@jerith> | \o/ |
18:59 | <@jerith> | (Hello kitty.) |
18:59 | < ToxicFrog> | Kitty. |
19:00 | <@jerith> | ToxicFrog: By building more verbose infrastructure and adding more layers of indirection. |
19:00 | <@jerith> | (I didn't say they were /nice/ ways. Just that they were ways.) |
19:00 | < ToxicFrog> | ;.; |
19:00 | <@jerith> | Quite. |
19:01 | < ToxicFrog> | I spent a while looking at Scala to see if it something similar, couldn't find anything, and was wondering if that was because Java already had something that Scala could use. |
19:02 | <@jerith> | Nope. |
19:02 | | * Vornicus awakens. |
19:02 | < TarinakyKai> | What's a decorator? |
19:04 | <@jerith> | TarinakyKai: You decorate a function definition with a callable. The defined function is then replaced with the result of calling the decorator with the function as a parameter. |
19:04 | <@jerith> | It's basically syntactic sugar for: |
19:04 | < ToxicFrog> | A function modifier. AIUI, something like this: |
19:04 | <@jerith> | def foo(): pass |
19:04 | < ToxicFrog> | @decorator def f: body |
19:05 | <@jerith> | foo = decorator(foo) |
19:05 | < ToxicFrog> | Translates to ...and jer beats me to it |
19:05 | <@jerith> | Well, we interleaved. :-) |
19:05 | < celticminstrel> | Note that I'm pretty sure every decorator needs to end in a newline. |
19:05 | <@Vornicus> | whut |
19:05 | <@Vornicus> | (to the newline thing) |
19:06 | < celticminstrel> | Well, I seem to remember it not working when I didn't include one, anyway. |
19:06 | <@jerith> | Typcally, your decorators return a modified or wrapped version of the thing they decorate. |
19:06 | <@Vornicus> | Anyway, you can use decorators to get effects like naive memoization, or turning a function into a class or static method, or... |
19:06 | < ToxicFrog> | So you can define, say, an @logged decorator, which logs all calls to and returns from the thing it decorates |
19:07 | < ToxicFrog> | Or a @memoized decorator |
19:07 | < ToxicFrog> | Or so forth. |
19:07 | <@jerith> | (Trace, not log. Important difference.) |
19:07 | < TarinakyKai> | I see. |
19:07 | <@jerith> | (Logs are /useful/. Traces are way too verbose unless you're trying to track down something specific and /weird/.) |
19:08 | <@Vornicus> | Which reminds me, did you guys see the Captain Weirdopants bug Kaura and I stumbled on in Python the other day? |
19:08 | <@jerith> | I did. |
19:09 | < ToxicFrog> | Yeah, that's pretty cool in a :wtc: kind of way. |
19:09 | < ToxicFrog> | gensym(), people! |
19:11 | <@Vornicus> | brb |
19:11 | | Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: Leaving] |
19:11 | < celticminstrel> | What bug? |
19:13 | | Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code |
19:13 | | mode/#code [+o Vornicus] by Reiver |
19:16 | | * Vornicus randomly has a look at how much Yoyo Games actually asks for GM8. that's... about 1/10 what I expected, actually. |
19:16 | <@Vornicus> | ($25) |
19:19 | < ToxicFrog> | celticminstrel: http://stackoverflow.com/questions/3828611/strange-python-behaviour-with-mixing- globals-parameters-and-function-named-top/3828673#3828673 |
19:20 | < ToxicFrog> | In short: the Python compiler uses the name "top" internally for the top level of the compilation unit. |
19:21 | < ToxicFrog> | This causes problems if you entirely reasonably define a function named "top". |
19:30 | | 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!] |
19:36 | | Orthia [orthianz@Nightstar-e37a1bf5.xnet.co.nz] has quit [Ping timeout: 121 seconds] |
19:44 | | Orthia [orthianz@Nightstar-e37a1bf5.xnet.co.nz] has joined #code |
19:46 | | * jerith installs AppInventor. |
20:18 | <@jerith> | So, AppInventor. |
20:18 | <@jerith> | Looks interesting enough, but it's very browser-based. |
20:18 | <@jerith> | With a Java thing for doing the lego-style programming and phone comms. |
20:19 | <@jerith> | Just run through the first tutorial, and it's nice enough for beginners. |
20:19 | <@jerith> | Might be a reasonable UI mockup tool, too. |
20:19 | <@jerith> | No idea if it can output code or layout XML, though. |
20:41 | | TarinakyKai [Tarinaky@Nightstar-f349ca6d.plus.com] has quit [Connection closed] |
20:43 | | Orthia [orthianz@Nightstar-e37a1bf5.xnet.co.nz] has quit [Ping timeout: 121 seconds] |
21:06 | | Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: ] |
21:08 | | Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code |
21:09 | | mode/#code [+o Vornicus] by Reiver |
21:48 | | Zed [Zed@Nightstar-556ea8b5.or.comcast.net] has joined #code |
22:29 | | Anno[Laptop] [annodomini@Nightstar-58637160.adsl.tpnet.pl] has quit [[NS] Quit: leaving] |
23:33 | | celticminstrel [celticminst@Nightstar-f8b608eb.cable.rogers.com] has joined #code |
23:55 | < kaura> | ...ohwhat. You need a smartphone to work with AppInventor? I guess that makes sense but... ;__; |
23:57 | <@McMartin> | 11:16 * Vornicus randomly has a look at how much Yoyo Games actually asks for GM8. that's... about 1/10 what I expected, actually. |
23:58 | <@McMartin> | And if you don't care about in-your-browser play it kind of makes it a no-brainer vs. Flash |
--- Log closed Sat Oct 02 00:00:01 2010 |