--- Log opened Sat Feb 27 00:00:05 2010 |
00:05 | | AnnoDomini [annodomini@Nightstar-b32b74b5.adsl.tpnet.pl] has quit [[NS] Quit: Sleep.] |
00:19 | | night98 [night98@Nightstar-5f83df92.dhcp.embarqhsd.net] has joined #code |
00:21 | | night98 [night98@Nightstar-5f83df92.dhcp.embarqhsd.net] has quit [[NS] Quit: night98: king of the night sky :D] |
00:27 | | celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has quit [[NS] Quit: *hums* Can't stay now!] |
00:41 | | Attilla [Attilla@FBC920.65CFFF.ADEEA3.DBDA33] has quit [Connection reset by peer] |
00:50 | | Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has joined #code |
00:54 | | Orth [orthianz@Nightstar-e3bd5a63.xnet.co.nz] has quit [Connection reset by peer] |
02:31 | < Kazriko> | Vornicus, First step in prime factorization is to have a list of primes to use, eh? |
02:31 | < Kazriko> | i can see a simple way with python... |
02:32 | <@Vornicus> | Well, it's not the prime factorization so much as that i am doing it in parallel on two numbers at once. |
02:33 | < Kazriko> | that doesn't seem too horrific... |
02:33 | < Kazriko> | but I can see it definitely being larger than 3 lines. |
02:38 | < Kazriko> | ugh. idle is really broken on windows 7... |
02:39 | < Kazriko> | so you're basically trying to find a list of all common prime factors eh? |
02:40 | <@Vornicus> | Essentially |
02:41 | <@Vornicus> | Which means, for approximate efficiency, that I factor both until one runs out. |
02:44 | < Kazriko> | I think i have it here, lemme check... |
02:44 | < Kazriko> | no, a little broken... |
02:46 | < Kazriko> | well, it works, but it doesn't factor the second number more than it needs to based on the first. heh |
02:48 | < Kazriko> | http://pastie.org/845182 |
02:48 | <@Vornicus> | Fully factoring both in parallel means that I reduce as much as possible the number of primes to check. |
02:48 | < Kazriko> | Yeah, that would probably speed this up by a tiny bit if the second number were larger. |
02:50 | < Kazriko> | To do it right, I'd need to have the while loop loop until both of them had exhausted their current prime. |
02:50 | <@Vornicus> | Right. |
02:50 | < Kazriko> | instead of just until the first number had. |
02:50 | < Kazriko> | *shrug* :) |
02:51 | < Kazriko> | both statements in while, 3 if statements. |
02:54 | <@Vornicus> | Oh, and you get to stop when p**2 > a or p**2 > b, but either way you have to check the remaining a or b against its counterpart |
02:54 | < Kazriko> | http://pastie.org/845187 |
02:55 | < Kazriko> | it probably provides more info than needed. |
02:55 | < Kazriko> | that last elif can just be an else. heh |
02:57 | <@Vornicus> | Now all I have to do is make it so it counts divisions properly. :) |
02:58 | | * Kazriko spent a little time today trying to learn Boo |
02:59 | < Kazriko> | one annoyance, x=1 then x=1.0... i believe that will throw an error in boo... |
03:01 | < Kazriko> | ahh, nope, but it x=1.5 silently truncates... heh |
03:01 | <@Vornicus> | heh |
03:02 | < Kazriko> | I think I'm not going to let boo decide what type variables are if I use it... |
03:03 | < Kazriko> | Was hoping it would be easy to port python code to boo to make our libraries work with c#, but it'd probably be nearly as much effort as porting it straight to c# |
03:07 | < Kazriko> | and prone to all kinds of wierd, hard to spot bugs... |
03:35 | | celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has joined #code |
03:50 | | gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has quit [[NS] Quit: Z?] |
--- Log closed Sat Feb 27 04:23:15 2010 |
--- Log opened Sat Feb 27 04:28:29 2010 |
04:28 | | TheWatcher[zZzZ] [chris@Nightstar-b4529b0c.zen.co.uk] has joined #code |
04:28 | | Irssi: #code: Total of 19 nicks [1 ops, 0 halfops, 0 voices, 18 normal] |
04:29 | | Irssi: Join to #code was synced in 48 secs |
04:34 | | Serah [Z@3A600C.A966FF.5BF32D.8E7ABA] has quit [Ping timeout: 121 seconds] |
04:38 | | mode/#code [+qo Reiver Reiver] by ChanServ |
05:38 | | celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has joined #code |
05:49 | | celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has quit [[NS] Quit: *hums* Can't stay now!] |
06:08 | | Vornicus is now known as Vornicus-Latens |
07:45 | | Zed_ [Zed@Nightstar-d0088b95.or.comcast.net] has quit [Client closed the connection] |
07:57 | | Attilla [Attilla@FBC920.65CFFF.ADEEA3.DBDA33] has joined #code |
07:57 | | mode/#code [+o Attilla] by Reiver |
08:08 | | crem [moo@Nightstar-8ca3eea7.adsl.mgts.by] has quit [[NS] Quit: Ep0xa 1.2v] |
08:17 | | AnnoDomini [annodomini@Nightstar-b32b74b5.adsl.tpnet.pl] has joined #code |
08:17 | | mode/#code [+o AnnoDomini] by Reiver |
09:22 | | You're now known as TheWatcher |
09:28 | | Orthia [orthianz@Nightstar-fc351cd9.xnet.co.nz] has joined #code |
10:11 | | Tarinaky [Tarinaky@Nightstar-5becfdd0.adsl.virginmedia.net] has quit [Ping timeout: 121 seconds] |
10:25 | | Tarinaky [Tarinaky@Nightstar-67136ba7.adsl.virginmedia.net] has joined #code |
10:54 | | gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has joined #code |
12:01 | | You're now known as TheWatcher[afk] |
13:33 | | Serah [Z@3A600C.A966FF.5BF32D.8E7ABA] has joined #code |
13:55 | | Rhamphoryncus [rhamph@Nightstar-8931f88f.abhsia.telus.net] has quit [Client exited] |
14:03 | | Vornicus-Latens is now known as Vornicus |
14:14 | | celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has joined #code |
14:50 | < gnolam> | http://www.communities.hp.com/securitysoftware/blogs/rafal/archive/2010/02/25/a- big-case-of-oops.aspx |
15:01 | < Namegduf> | Heh. |
15:38 | | Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has quit [Connection closed] |
--- Log closed Sat Feb 27 16:14:12 2010 |
--- Log opened Sat Feb 27 16:14:16 2010 |
16:14 | | TheWatcher[afk] [chris@Nightstar-b4529b0c.zen.co.uk] has joined #code |
16:14 | | Irssi: #code: Total of 20 nicks [3 ops, 0 halfops, 0 voices, 17 normal] |
16:15 | | Irssi: Join to #code was synced in 50 secs |
16:36 | | AbuDhabi [annodomini@Nightstar-a5f94122.adsl.tpnet.pl] has joined #code |
16:38 | | AnnoDomini [annodomini@Nightstar-b32b74b5.adsl.tpnet.pl] has quit [Ping timeout: 121 seconds] |
16:39 | | Tarinaky [Tarinaky@Nightstar-67136ba7.adsl.virginmedia.net] has quit [Connection closed] |
16:45 | | Bobsentme [Bobsentme@Nightstar-79f8b1cd.livnmi.sbcglobal.net] has joined #code |
16:45 | < Bobsentme> | Anyone familiar with / have a good resource for a beginner in JSP? I'm trying to add variables to an array, and I'm completely lost. |
16:50 | | Orthia [orthianz@Nightstar-fc351cd9.xnet.co.nz] has quit [Ping timeout: 121 seconds] |
16:59 | | PinkFreud [WhyNot@NetworkAdministrator.Nightstar.Net] has joined #code |
17:06 | < Vornicus> | The full common-factors-by-prime-factorization is 32 lines. |
17:13 | | Syloqs-AFH [Syloq@NetworkAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds] |
17:14 | | Syloqs_AFH [Syloq@NetworkAdministrator.Nightstar.Net] has joined #code |
17:15 | | Syloqs_AFH is now known as Syloqs-AFH |
17:16 | | * Vornicus now adds some Well Duh optimizations: if a is 1 or b, then you don't have to do that division, so don't count it. |
17:21 | | You're now known as TheWatcher |
17:22 | < Vornicus> | (in case you're wondering: I'm doing this to demonstrate how many divisions you need for common-factor-by-prime-factorization.) |
17:23 | < Vornicus> | (it is a lot more than I expected.) |
17:28 | < Vornicus> | There. I /think/ that's all the "common-sense" optimizations I can make. |
17:37 | < gnolam> | Answer: 2 armor, 1 infantry. |
17:38 | < Bobsentme> | 3: Go directly to jail. Do not pass go. |
17:38 | < Vornicus> | The results are... depressing. |
17:38 | < Vornicus> | With absolutely no optimizations, euclid starts beating optimized-to-hell prime factorization at /4/ |
17:39 | < gnolam> | Heh. |
17:40 | < gnolam> | Studying the pattern made Euclid conscious of itself. I had to... before it died it spit out the number. That consciousness is the number? |
17:54 | < gnolam> | (Quote from "Pi") |
17:57 | | * Vornicus was trying to remember where he remembered it. |
18:00 | | gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has quit [[NS] Quit: Arriba arriba andale andale!] |
18:31 | < Bobsentme> | Well, I think I'm screwed. |
18:32 | < Bobsentme> | If only 1 resultset can be used at a time, then it's gonna be impossible to use one to hit the Publication table, and another, sub resultset to find authors for a particular publication. |
18:32 | | * Bobsentme shakes fist at JSP. |
18:32 | < Bobsentme> | It's frakkin useless I tell you. |
19:07 | | * Bobsentme sighs |
19:07 | < Bobsentme> | Ok, initialization of a Java Array is done like this, correct? |
19:08 | < Bobsentme> | String[] NameOfArray; |
19:08 | < Namegduf> | That's declaration, not initialisation. |
19:09 | < Namegduf> | (Or definition, but the point is, no, it doesn't initialise it) |
19:13 | < Alek> | http://pastie.org/845920 |
19:13 | < Alek> | what's wrong with this code? |
19:13 | < Alek> | ¬_¬ |
19:15 | < Namegduf> | Well, for some reason you're declaring first and second as signed |
19:17 | < Namegduf> | Your "if (first > second)" is redundant, because if you run the algorithm with them the other way around, they just switch places after the first cycle. |
19:19 | < Namegduf> | But no source of outright failure is obviously shouting at me aside you not outputting the result. |
19:19 | < Namegduf> | So what's the behaviour it's showing that it shouldn't? |
19:25 | < Vornicus> | Also you seem to have forgotten to output the result. |
19:29 | < Alek> | oh yeah. doh. yes, that. |
19:30 | < Alek> | I seem to have erased that along with the debug output. |
19:32 | | Tarinaky [Tarinaky@Nightstar-67136ba7.adsl.virginmedia.net] has joined #code |
19:32 | < Alek> | I declared them as signed so I'd be able to check for negative numbers and make them ask again. |
19:33 | < Alek> | ok, that's just wrong. |
19:33 | < Alek> | the factor of 5 and 3 is 2, according to the program. |
19:35 | < Alek> | oh, nm. got it now. |
19:36 | < Alek> | http://pastie.org/845920 |
19:36 | < Alek> | now? |
19:37 | < Namegduf> | Have you tried running it through using gdb before asking? |
19:38 | < Alek> | well, it seems to work now, I'm just asking on how it looks, if there's any inaccuracies in the code, stuff that can be optimized. -_- |
19:38 | < Alek> | sorry |
19:40 | | celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has quit [[NS] Quit: *hums* Can't stay now!] |
19:40 | < Alek> | like is there a simpler way to force positive, nonzero input? |
19:40 | | * Alek doesn't QUITE trust unsigned to force that. |
19:40 | < Alek> | especially since it can't force nonzero. |
19:43 | | Orthia [orthianz@Nightstar-6607c026.xnet.co.nz] has joined #code |
19:44 | < Tarinaky> | if (value <1)? |
19:45 | < Alek> | thought that was what I did with the do-while? |
19:45 | < Tarinaky> | I didn't look at the code. |
19:46 | < Alek> | bah. |
19:46 | < Tarinaky> | But it's just as easy to check for zero as negative. |
19:46 | < Tarinaky> | Well, unless you're doing it bit-wise but w/e. |
19:46 | < Namegduf> | Why would you do it bitwise? |
19:47 | < Tarinaky> | No idea. |
19:47 | < Namegduf> | Don't most architectures (x86, at least) provide a "If non-positive" branching instruction? |
19:47 | < Tarinaky> | I didn't suggest that you -should- do it bitwise. Just that you could. |
19:51 | < Alek> | anyway, I did the (value < 1) comparison to force a re-entry, so yeah. just was wondering. |
19:52 | < Alek> | but that was why the entry vars were signed. and I made the operating vars unsigned, but I'm wondering if I should have bothered. |
19:53 | < Vornicus> | what happens if you declare the number unsigned and then put in a negative? |
19:53 | < Vornicus> | (I don't know what will happen, but I suspect it won't give you anything |
19:55 | < Alek> | it takes the negative, but it stores it as the wraparound positive value. |
19:56 | < Alek> | and apparently remainder is a system word in C but not in C++? |
19:57 | < Alek> | cause pastie highlights it as a system word (like unsigned and int), but in C++ it doesn't throw an error, just works fine. |
19:57 | < Namegduf> | "keyword" |
19:57 | < Namegduf> | And no theory. |
19:57 | < Alek> | and system. :P |
19:57 | < Alek> | unsigned, int, system, and remainder are all highlighted the same. <_< |
19:58 | < Alek> | anyway, thanks all. |
19:58 | < Alek> | this has been a productive couple hours. >_> |
20:44 | | Tarinaky [Tarinaky@Nightstar-67136ba7.adsl.virginmedia.net] has quit [Connection closed] |
22:11 | | * Alek twitches |
22:11 | < Alek> | var reg: RegExp = /\[([biu])\](.*?)(?=\[\/\1\])\[\/\1\]/gi; |
22:11 | < Alek> | what does this parse to, again? |
23:13 | < ToxicFrog> | Matched [b][/b], [i][/i], and [u][/u] pairs, I think |
23:36 | | celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has joined #code |
23:53 | < Serah> | Regex seems like a really smart invention. But wouldn't it have been smarter if it were simpler? |
23:58 | < ToxicFrog> | It is simpler. |
23:58 | < ToxicFrog> | Regular expressions are actually really simple. |
23:59 | < ToxicFrog> | Most regex implementations, however, bolt on lots of extra stuff to make them more powerful. |
23:59 | < ToxicFrog> | Personally, I think if you need that much more power you're better off with PEGs, but. |
--- Log closed Sun Feb 28 00:00:07 2010 |