--- Log opened Sat Nov 22 00:00:22 2014 |
00:44 | | mac [macdjord@Nightstar-c0i1dq.cable.rogers.com] has joined #code |
00:44 | | mode/#code [+o mac] by ChanServ |
00:46 | | Derakon[AFK] is now known as Derakon |
00:47 | | macdjord|slep [macdjord@Nightstar-c0i1dq.cable.rogers.com] has quit [Ping timeout: 121 seconds] |
01:36 | | VirusJTG_ [VirusJTG@Nightstar-lsl.j5i.46.174.IP] has joined #code |
01:37 | | VirusJTG__ [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has joined #code |
01:39 | | VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has quit [Ping timeout: 121 seconds] |
01:41 | | VirusJTG_ [VirusJTG@Nightstar-lsl.j5i.46.174.IP] has quit [Ping timeout: 121 seconds] |
02:01 | | Derakon is now known as Derakon[AFK] |
02:23 | | Checkmate [Z@Nightstar-484uip.cust.comxnet.dk] has quit [Ping timeout: 121 seconds] |
03:58 | | mac [macdjord@Nightstar-c0i1dq.cable.rogers.com] has quit [Ping timeout: 121 seconds] |
03:59 | | celticminstrel [celticminst@Nightstar-l2rg83.dsl.bell.ca] has joined #code |
03:59 | | mode/#code [+o celticminstrel] by ChanServ |
04:10 | | mac [macdjord@Nightstar-c0i1dq.cable.rogers.com] has joined #code |
04:10 | | mode/#code [+o mac] by ChanServ |
04:12 | | VirusJTG__ [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has quit [[NS] Quit: Program Shutting down] |
04:26 | | Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: Leaving] |
05:28 | | Derakon[AFK] is now known as Derakon |
06:09 | | Derakon is now known as Derakon[AFK] |
06:31 | | gizmore [kvirc@Nightstar-f1n405.pools.vodafone-ip.de] has quit [[NS] Quit: KVIrc 4.3.1 Aria http://www.kvirc.net/] |
06:55 | | himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds] |
07:14 | | celticminstrel [celticminst@Nightstar-l2rg83.dsl.bell.ca] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!] |
07:18 | | Kindamoody[zZz] is now known as Kindamoody |
07:58 | | gizmore [kvirc@Nightstar-f1n405.pools.vodafone-ip.de] has joined #code |
08:19 | <@Julius> | TheWatcher: You here? |
08:20 | <@Julius> | I want to detect, in a Perl string, whether someone said "stripe" but not "stripes". What I've got currently is "($arg =~ /stripe /i)" but that doesn't quite cut it. |
08:22 | <@Julius> | Case is not important. |
08:24 | <@Julius> | Also, what would you suggest for a time-out mechanism? I'd want to have it so that a function cannot be triggered again until a certain time has passed (but not refreshed by triggers during the timeout). |
08:32 | <@froztbyte> | what about /stripe(^s)/ ? |
08:32 | <@froztbyte> | mayhaps with a ? or something thrown in |
08:38 | | himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code |
08:38 | | mode/#code [+o himi] by ChanServ |
08:39 | <@Julius> | That detects neither. |
08:40 | <@froztbyte> | well, some kind of character grouping application |
08:40 | <@froztbyte> | I'm way too friggin tired to regex right now :) |
08:40 | <@froztbyte> | but you basically want to add a condition of "match anything but s" |
08:41 | <@froztbyte> | so you'll get "stripeasdasdqwe", "stripe?", etc |
08:50 | | Orthia [orthianz@Nightstar-guubpc.callplus.net.nz] has quit [Ping timeout: 121 seconds] |
08:54 | | Orthia [orthianz@Nightstar-jc7.74u.224.119.IP] has joined #code |
08:54 | | mode/#code [+o Orthia] by ChanServ |
08:58 | | Orthia [orthianz@Nightstar-jc7.74u.224.119.IP] has quit [Ping timeout: 121 seconds] |
09:03 | | Orthia [orthianz@Nightstar-guubpc.callplus.net.nz] has joined #code |
09:03 | | mode/#code [+o Orthia] by ChanServ |
09:14 | <&jerith> | Julius: /stripe(?!s)/ |
09:14 | <&jerith> | http://www.regular-expressions.info/lookaround.html |
09:17 | <@Julius> | That doesn't detect either either. |
09:20 | <&jerith> | It works for me. |
09:20 | <@Julius> | Wait, I might have messed up. |
09:20 | <@Julius> | OK, it DOES work. |
09:20 | <@Julius> | Thanks! |
09:21 | <&jerith> | \o/ |
09:22 | <@Julius> | Now to figure out how to do a timeout. |
09:22 | <&jerith> | Negative lookahead assertions are great. |
09:22 | <&jerith> | (Except beware performance.) |
09:57 | <&McMartin> | Oh god |
10:00 | <&jerith> | McMartin: Do you mean Azathoth or Shub Niggurath? |
10:06 | <&McMartin> | Azathoth. Shubby governs the use of fork bombs as intentional parallelization techniques. |
10:06 | <&McMartin> | And expanded her domain to parallelization and synchronization in general. |
10:10 | <@Julius> | jerith: Found a problem. It detects "stripes stripes stripes" as matching. I don't want it to do that. |
10:13 | <&jerith> | [12:13|jerith@minbar] ~% perl -e 'print (("stripes stripes stripes" =~ /stripe(?!s)/) ? "t\n" : "f\n")' |
10:13 | <&jerith> | f |
10:14 | <&jerith> | [12:13|jerith@minbar] ~% perl -e 'print (("stripes stripe stripes" =~ /stripe(?!s)/) ? "t\n" : "f\n")' |
10:14 | <&jerith> | t |
10:14 | <@Julius> | That's strange. |
10:18 | | Orthia [orthianz@Nightstar-guubpc.callplus.net.nz] has quit [Ping timeout: 121 seconds] |
10:23 | | Orthia [orthianz@Nightstar-q9h.84h.224.119.IP] has joined #code |
10:23 | | mode/#code [+o Orthia] by ChanServ |
10:36 | | gnolam [lenin@Nightstar-utbkuh.cust.bredbandsbolaget.se] has quit [[NS] Quit: Gone] |
10:37 | | * TheWatcher readsup |
10:39 | <@Julius> | I actually solved the timeout by refering to time(). |
10:39 | <@TheWatcher> | M'kay |
10:41 | <@TheWatcher> | I note that using /stripe(?!s)/ will have the possible side-effect that it'll allow "pinstripesuit" |
10:41 | <@TheWatcher> | You might need \b to check word boundaries |
10:42 | <@Julius> | Like how? Before and after? |
10:43 | <@Julius> | Will that detect punctuation as 'word end'? |
10:44 | | gizmore [kvirc@Nightstar-f1n405.pools.vodafone-ip.de] has quit [The TLS connection was non-properly terminated.] |
10:44 | <&jerith> | TheWatcher: It doesn't match "pinstripesuit" for me. |
10:44 | <@TheWatcher> | Oh, yeah, because of th es in suit |
10:44 | <@TheWatcher> | (nb: I've been awake for 10 minutes, and have yet to have any tea whatsoever, so) |
10:45 | <@TheWatcher> | But it could match other embedded 'stripe's anyway. |
10:45 | <@TheWatcher> | And yeah, "A word boundary (\b ) is a spot between two characters that has a \w on one side of it and a \W on the other side of it (in either order)," |
10:46 | <@TheWatcher> | So \bstripe(?!s)\b |
10:46 | <@TheWatcher> | Now, tea |
10:46 | | Kindamoody is now known as Kindamoody|afk |
10:51 | | gizmore [kvirc@Nightstar-f1n405.pools.vodafone-ip.de] has joined #code |
11:17 | <@Tarinaky> | Hmm, I thought zip(vector,scalar) would result in the scalar being repeated for each element of the vector |
11:17 | | VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has joined #code |
11:17 | <@Tarinaky> | Maybe that was Haskell. |
12:16 | | Kindamoody|afk is now known as Kindamoody |
12:25 | | Checkmate [Z@Nightstar-484uip.cust.comxnet.dk] has joined #code |
12:25 | | mode/#code [+o Checkmate] by ChanServ |
12:35 | | Kindamoody is now known as Kindamoody|out |
12:41 | | Checkmate [Z@Nightstar-484uip.cust.comxnet.dk] has quit [Ping timeout: 121 seconds] |
15:05 | | Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code |
15:05 | | mode/#code [+qo Vornicus Vornicus] by ChanServ |
16:36 | <@Tarinaky> | So. Anyone have opinions on Python's namedtuple vs regular tuples? |
16:52 | <~Vornicus> | I generally start by hacking along with regular tuples, and then will switch up to a namedtuple as it gets hairier |
16:52 | <~Vornicus> | -- this, if the names would make sense. |
16:54 | <~Vornicus> | Remember this: http://thecodelesscode.com/case/19 |
16:54 | | celticminstrel [celticminst@Nightstar-l2rg83.dsl.bell.ca] has joined #code |
16:55 | | mode/#code [+o celticminstrel] by ChanServ |
16:57 | <@celticminstrel> | I'm trying to figure out how to decide what level a monster should be based on its stats and abilities... |
17:10 | <&jerith> | Tarinaky: I've never really found namedtuple to be useful. |
17:10 | <&jerith> | I either use a tuple, a dict, or a custom object. |
17:10 | <@Tarinaky> | It seems more awkward to use than just packing and unpacking a regular tuple. |
17:11 | <@Tarinaky> | And I'm not sure there's any gains being made here. |
17:22 | | Derakon[AFK] is now known as Derakon |
17:47 | <@Azash> | Named tuples look like they might be useful for ORMs |
17:48 | <~Vornicus> | Usually when I've got a tuple I'm using it specifically for its immutability and comparability. Dictionaries don't do that, and objects I need to write more code to make that happen. |
17:50 | | Kindamoody|out is now known as Kindamoody |
18:15 | | Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: Leaving] |
18:15 | | * Derakon readsup. |
18:15 | <&Derakon> | Named tuples come in handy for concisely defining the equivalent of a C struct -- a datastructure with no logic attached to it. |
18:16 | <&Derakon> | THis doesn't happen all that often, but it can be nice. |
19:00 | | Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code |
19:00 | | mode/#code [+qo Vornicus Vornicus] by ChanServ |
19:03 | | Alek [omegaboot@Nightstar-c8t.a00.36.73.IP] has quit [Ping timeout: 121 seconds] |
19:13 | | Checkmate [Z@Nightstar-484uip.cust.comxnet.dk] has joined #code |
19:13 | | mode/#code [+o Checkmate] by ChanServ |
19:41 | | Alek [omegaboot@Nightstar-c8t.a00.36.73.IP] has joined #code |
19:41 | | mode/#code [+o Alek] by ChanServ |
21:36 | | Kindamoody is now known as Kindamoody[zZz] |
--- Log closed Sun Nov 23 00:00:38 2014 |