--- Log opened Fri Oct 22 00:00:01 2010 |
00:05 | | Tarinaky [Tarinaky@Nightstar-f349ca6d.plus.com] has joined #code |
00:16 | | Zed [Zed@Nightstar-556ea8b5.or.comcast.net] has joined #code |
00:29 | | You're now known as TheWatcher[zZzZ] |
00:36 | | Orthia [orthianz@Nightstar-abd01713.xnet.co.nz] has quit [Ping timeout: 121 seconds] |
00:40 | < Anno[Laptop]> | http://tlog.4zal.net/post/83018120/Unix-Magic |
00:41 | < Tarinaky> | What's oregano? |
00:41 | < Anno[Laptop]> | A herb. |
00:42 | < Anno[Laptop]> | It's sorta spicy. |
00:42 | < Tarinaky> | All the other jars are labelled with UNIX 'things'. |
00:42 | < Tarinaky> | I don't recognise oregano though. |
00:43 | | Orthia [orthianz@Nightstar-37b4fc04.xnet.co.nz] has joined #code |
00:55 | | Anno[Laptop] [annodomini@Nightstar-15c1c53b.adsl.tpnet.pl] has quit [[NS] Quit: The sleep ray hits you...] |
01:00 | <@McMartin> | Oregano is common in pizza sauce. |
01:03 | < Tarinaky> | Apparently it's an electronics simulator. |
01:03 | < Tarinaky> | For GNOME. |
01:15 | | Vornicus-Latens is now known as Vornicus |
01:31 | | Rhamphoryncus [rhamph@Nightstar-473f8685.abhsia.telus.net] has joined #code |
01:32 | | Tarinaky [Tarinaky@Nightstar-f349ca6d.plus.com] has quit [Client closed the connection] |
01:58 | | Derakon[AFK] is now known as Derakon |
02:11 | | gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has quit [[NS] Quit: Z?] |
02:47 | < celticminstrel> | Will if(/^@/) { func(substr $_1 ) } have the desired effect of "if the line begins with @, pass the line minus the initial @ to the function"? |
02:47 | < celticminstrel> | ...oh, add a semicolon of course. |
02:47 | | Zed_ [Zed@Nightstar-556ea8b5.or.comcast.net] has joined #code |
02:47 | < celticminstrel> | Also, it's Perl in case that's not obvious. |
02:48 | | Netsplit *.net <-> *.split quits: cpux, Zed, @Vornicus, Orthia, @Kazriko, Stalker, kwsn, froztbyte, @jerith, Reiver |
02:54 | | Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code |
02:55 | | kwsn [kwsn@Nightstar-1def9d24.dyn.centurytel.net] has joined #code |
02:55 | | Orthia [orthianz@Nightstar-37b4fc04.xnet.co.nz] has joined #code |
02:56 | | Reiver [reaverta@ServerAdministrator.Nightstar.Net] has joined #code |
02:56 | | mode/#code [+qo Reiver Reiver] by ChanServ |
02:57 | | cpux [chatzilla@Nightstar-c978de34.dyn.optonline.net] has joined #code |
02:57 | | Stalker [Z@26ECB6.A4B64C.298B52.D80DA0] has joined #code |
02:57 | | Kazriko [kaz@Nightstar-e09690fa.client.bresnan.net] has joined #code |
02:57 | | mode/#code [+o Kazriko] by Reiver |
03:00 | | froztbyte [froztbyte@Nightstar-dc394964.za.net] has joined #code |
03:00 | | jerith [jerith@Nightstar-bf52129d.slipgate.za.net] has joined #code |
03:00 | | mode/#code [+o jerith] by Reiver |
03:02 | < celticminstrel> | No-one here then? |
03:03 | | Orthia [orthianz@Nightstar-37b4fc04.xnet.co.nz] has quit [Ping timeout: 121 seconds] |
03:26 | | * celticminstrel pokes the channel. |
03:27 | < Vornicus> | ? |
03:27 | < celticminstrel> | Perl question. |
03:28 | <@Derakon> | I don't know the answer, but I suspect using '@' in a regex would get you into trouble because Perl would think you were trying to refer to a list. |
03:28 | <@Derakon> | Also I don't think you should be trying to be so compact. |
03:28 | < celticminstrel> | Hm, okay... |
03:29 | < celticminstrel> | I was testing with "perl -" <_< and backslashing the @ didn't seem to help. |
03:29 | < Vornicus> | Oh, you're doing this from the command line. yOu may need to backslash the hell out of it, @ I think is one of the special ones. |
03:30 | < celticminstrel> | It also doesn't work if I replace @ with some other character (I tried & ). |
03:30 | <@Derakon> | Yeah, mixing Perl and the commandline gets...interesting sometimes. |
03:30 | <@Derakon> | & may also be special. |
03:31 | < celticminstrel> | I'm actually just using stdin as the file, so shell syntax shouldn't be a problem. |
03:31 | < celticminstrel> | This is just to test until I find the one with the desired effect. |
03:31 | < Vornicus> | Shell syntax will affect your perl - line. |
03:32 | < celticminstrel> | ...once I type "perl -" and press Enter, the shell is no longer active. |
03:32 | < celticminstrel> | Replacing it with "m" didn't even work. |
03:33 | < celticminstrel> | my $line = "mSomeSampleLine"; if($line =~ /^m.*$/) { print substr($_, 1); } is what I have currently, if that makes any difference. |
03:34 | < Vornicus> | And what do you mean by doesn't work? what's it doing? |
03:34 | <@Derakon> | Why not "if ($line =~ /^m(.*)$/) {print "$1\n"}" |
03:34 | < celticminstrel> | It does absolutely nothing, which is to say nothing is printed. |
03:34 | <@Derakon> | Remember that Perl does not include newlines for you automatically when you make print statements. |
03:34 | < celticminstrel> | Yeah, but that's not particularly important here. |
03:35 | < celticminstrel> | Once it works, I'll be passing it to a function rather than printing it. |
03:36 | < Vornicus> | try putting else print "nothing!" at the end there. |
03:37 | < celticminstrel> | I did that. Also, for some reason, Derakon's suggestion made it work. :| |
03:37 | < Vornicus> | oh I know what's happening. |
03:37 | <@Derakon> | That's because I made use of regex capturing. |
03:37 | < Vornicus> | Oh, or that. |
03:38 | <@Derakon> | Surrounding something in a regex with parentheses will dump its contents to the variables $1 $2 $3 etc. |
03:38 | < celticminstrel> | Perhaps I was wrong about what $_ was. |
03:38 | <@Derakon> | You can also do e.g. "($foo, $bar) = $line =~ /(apples) (bananas)/;" |
03:38 | <@Derakon> | $_ is whatever the devs decide is most appropriate in the most recent context. |
03:38 | < Vornicus> | (but the \n thing might hurt too - many systems won't actually write to the console until you hit a newline.) |
03:38 | <@Derakon> | It's an implicit variable. |
03:39 | < Vornicus> | (unless you explicitly tell it to flush.) |
03:39 | < celticminstrel> | Isn't it normal to flush before exit, though? |
03:39 | <@Derakon> | I wouldn't rely on it. |
03:39 | < celticminstrel> | Okay. |
03:42 | | * Vornicus fiddles with GameMaker and his Ducks Ahoy thing, has figured out that there's a lot going on with these ducks. |
03:42 | < Vornicus> | Bunnies. |
03:43 | < celticminstrel> | Now that this works, I can avoid Perl until next time I want to tweak something. <_< |
04:09 | | Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has joined #code |
04:22 | | KM [---@Nightstar-4764665d.tbcn.telia.com] has quit [Client exited] |
04:25 | | Stalker [Z@26ECB6.A4B64C.298B52.D80DA0] has quit [Ping timeout: 121 seconds] |
04:50 | | Stalker [Z@3A600C.A966FF.5BF32D.8E7ABA] has joined #code |
05:59 | | SmithKurosaki [Smith@Nightstar-8ff23d84.dsl.teksavvy.com] has joined #code |
06:03 | | Orthia [orthianz@Nightstar-1f9ecb95.xnet.co.nz] has joined #code |
06:06 | | cpux [chatzilla@Nightstar-c978de34.dyn.optonline.net] has quit [Client closed the connection] |
06:09 | < Vornicus> | So, ducks follow specific paths. Problem is that a duck's path kinda skips around - they go down the stairs within buildings, and you can't see them while they do that. |
06:11 | | cpux [chatzilla@Nightstar-c978de34.dyn.optonline.net] has joined #code |
06:20 | | SmithKurosaki [Smith@Nightstar-8ff23d84.dsl.teksavvy.com] has quit [Ping timeout: 121 seconds] |
06:27 | | celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has quit [Client closed the connection] |
06:27 | | celticminstrel [celticminst@Nightstar-f8b608eb.cable.rogers.com] has joined #code |
06:27 | < celticminstrel> | Did I miss anything interesting? |
06:29 | <@Derakon> | And on that note, T-2 all. |
06:31 | | Derakon is now known as Derakon[AFK] |
06:33 | < Vornicus> | no. |
06:53 | | celticminstrel [celticminst@Nightstar-f8b608eb.cable.rogers.com] has quit [[NS] Quit: KABOOM! It seems that I have exploded. Please wait while I reinstall the universe.] |
06:53 | | celticminstrel [celticminst@Nightstar-f8b608eb.cable.rogers.com] has joined #code |
06:58 | | celticminstrel [celticminst@Nightstar-f8b608eb.cable.rogers.com] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!] |
07:16 | | cpux is now known as shade_of_cpux |
07:16 | < Vornicus> | You know I should stop futzing with this until I have something visible to place. |
07:26 | < Vornicus> | But I suck at drawing. |
07:26 | <~Reiver> what size sprites? |
07:27 | < Vornicus> | Well, the buildings are 128x128 with a overflow area of 160x160. Or so. Then there's the bunnies, which are... 24? 32? One of those. |
07:47 | | kwsn is now known as kwsn\t-2 |
07:52 | | kwsn\t-2 is now known as kw-sleep-n |
08:15 | | Anno[Laptop] [annodomini@Nightstar-0150ae5b.adsl.tpnet.pl] has joined #code |
08:23 | | Orthia [orthianz@Nightstar-1f9ecb95.xnet.co.nz] has quit [Client closed the connection] |
08:31 | | Orthia [orthianz@Nightstar-1f9ecb95.xnet.co.nz] has joined #code |
08:31 | | Orthia [orthianz@Nightstar-1f9ecb95.xnet.co.nz] has quit [Client closed the connection] |
08:40 | | Orthia [orthianz@Nightstar-1f9ecb95.xnet.co.nz] has joined #code |
08:41 | | Orthia [orthianz@Nightstar-1f9ecb95.xnet.co.nz] has quit [Client closed the connection] |
08:45 | | Vornicus is now known as Vornicus-Latens |
08:49 | | Orthia [orthianz@Nightstar-1f9ecb95.xnet.co.nz] has joined #code |
08:49 | | Orthia [orthianz@Nightstar-1f9ecb95.xnet.co.nz] has quit [Client closed the connection] |
08:57 | | Orthia [orthianz@Nightstar-1f9ecb95.xnet.co.nz] has joined #code |
08:57 | | Orthia [orthianz@Nightstar-1f9ecb95.xnet.co.nz] has quit [Connection reset by peer] |
09:05 | | Orthia [orthianz@Nightstar-1f9ecb95.xnet.co.nz] has joined #code |
09:11 | | Orthia [orthianz@Nightstar-1f9ecb95.xnet.co.nz] has quit [Connection reset by peer] |
09:31 | | You're now known as TheWatcher |
09:35 | | Orthia [orthianz@Nightstar-1f9ecb95.xnet.co.nz] has joined #code |
09:40 | | Orthia [orthianz@Nightstar-1f9ecb95.xnet.co.nz] has quit [Client closed the connection] |
09:57 | | Orthia [orthianz@Nightstar-1f9ecb95.xnet.co.nz] has joined #code |
09:57 | | Orthia [orthianz@Nightstar-1f9ecb95.xnet.co.nz] has quit [Client closed the connection] |
10:05 | | Orthia [orthianz@Nightstar-1f9ecb95.xnet.co.nz] has joined #code |
10:05 | | Orthia [orthianz@Nightstar-1f9ecb95.xnet.co.nz] has quit [Connection reset by peer] |
10:09 | | Anno[Laptop] [annodomini@Nightstar-0150ae5b.adsl.tpnet.pl] has quit [[NS] Quit: I go.] |
10:10 | | Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has quit [Connection closed] |
10:14 | | Orthia [orthianz@Nightstar-1f9ecb95.xnet.co.nz] has joined #code |
10:44 | | Anno[Laptop] [annodomini@F67919.F326B3.98D923.BDA7B6] has joined #code |
10:57 | | Tarinaky [Tarinaky@Nightstar-f349ca6d.plus.com] has joined #code |
11:06 | | Ortiha [orthianz@Nightstar-8986f23d.xnet.co.nz] has joined #code |
11:06 | | Orthia [orthianz@Nightstar-1f9ecb95.xnet.co.nz] has quit [Ping timeout: 121 seconds] |
11:42 | | Stalker [Z@3A600C.A966FF.5BF32D.8E7ABA] has quit [Ping timeout: 121 seconds] |
12:09 | | gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has joined #code |
12:24 | | Tarinaky [Tarinaky@Nightstar-f349ca6d.plus.com] has quit [Client closed the connection] |
12:49 | | Ortiha [orthianz@Nightstar-8986f23d.xnet.co.nz] has quit [Connection reset by peer] |
12:59 | | Orthia [orthianz@Nightstar-8986f23d.xnet.co.nz] has joined #code |
13:18 | | celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has joined #code |
13:35 | | Orthia [orthianz@Nightstar-8986f23d.xnet.co.nz] has quit [Client closed the connection] |
13:43 | | Orthia [orthianz@Nightstar-8986f23d.xnet.co.nz] has joined #code |
13:48 | | Orthia [orthianz@Nightstar-8986f23d.xnet.co.nz] has quit [Client closed the connection] |
13:48 | | Anno[Laptop] [annodomini@F67919.F326B3.98D923.BDA7B6] has quit [[NS] Quit: Time for me to head home.] |
13:52 | | Zed_ [Zed@Nightstar-556ea8b5.or.comcast.net] has quit [Ping timeout: 121 seconds] |
13:54 | | Orthia [orthianz@Nightstar-8986f23d.xnet.co.nz] has joined #code |
13:56 | | Orthia [orthianz@Nightstar-8986f23d.xnet.co.nz] has quit [Client closed the connection] |
14:02 | | Orthia [orthianz@Nightstar-8986f23d.xnet.co.nz] has joined #code |
14:06 | | Orthia [orthianz@Nightstar-8986f23d.xnet.co.nz] has quit [Client closed the connection] |
14:14 | | Orthia [orthianz@Nightstar-8986f23d.xnet.co.nz] has joined #code |
14:14 | | Orthia [orthianz@Nightstar-8986f23d.xnet.co.nz] has quit [Client closed the connection] |
14:23 | | Orthia [orthianz@Nightstar-8986f23d.xnet.co.nz] has joined #code |
14:25 | | Anno[Laptop] [annodomini@Nightstar-0150ae5b.adsl.tpnet.pl] has joined #code |
14:54 | | 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!] |
15:45 | | Derakon[AFK] is now known as Derakon |
16:00 | | kw-sleep-n is now known as kwsn |
16:49 | | Attilla [Some.Dude@Nightstar-2074a458.threembb.co.uk] has joined #code |
16:49 | | mode/#code [+o Attilla] by Reiver |
16:49 | | gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has quit [Ping timeout: 121 seconds] |
16:51 | | gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has joined #code |
17:03 | | Zed_ [Zed@Nightstar-556ea8b5.or.comcast.net] has joined #code |
17:10 | | Orthia [orthianz@Nightstar-8986f23d.xnet.co.nz] has quit [Ping timeout: 121 seconds] |
17:42 | | Stalker [Z@26ECB6.A4B64C.298B52.D80DA0] has joined #code |
17:52 | | Attilla [Some.Dude@Nightstar-2074a458.threembb.co.uk] has quit [[NS] Quit: ] |
18:05 | < Anno[Laptop]> | I have a Java problem. I have a class that has a run() method, which starts calculations and stuff. The calculations may take several minutes, or even hours. I want to press a button on the form I have, to start the calculations, and have the button's code finish, so the application can continue to be accessible, and the calculations would run in the background, with status messages being sent to a text area on the same form. |
18:06 | < Anno[Laptop]> | I understand I need to employ threading here. I've tried implementing Runnable on the calculation class, and run()-ing it from the button code. This did not give the expected results - the calculations finished properly, but the form was still locked, with the button depressed, as if I wasn't using threading. |
18:06 | < Anno[Laptop]> | Tips? |
18:09 | < Vornicus-Latens> | call start, not run. |
18:10 | <@ToxicFrog> | Runnable just says "you can run this by calling run()"; it doesn't imply any sort of threading. |
18:10 | <@ToxicFrog> | Either subclass Thread and call start(), or pass an instance of your Runnable to the constructor for Thread and then call start() on the constructed thread. |
18:11 | < Anno[Laptop]> | Uh, yeah, I did what you said. |
18:11 | < Anno[Laptop]> | That is, I put the instance of the class as the parameter of the Thread's constructor. |
18:11 | < Anno[Laptop]> | And then start()-ed it. |
18:12 | < Anno[Laptop]> | The result was that calculations have completed, but the form was not unlocked. |
18:12 | <@ToxicFrog> | Pastebin? |
18:13 | < Anno[Laptop]> | http://pastie.org/1241146 |
18:15 | | Zed_ [Zed@Nightstar-556ea8b5.or.comcast.net] has quit [Ping timeout: 121 seconds] |
18:31 | | Tarinaky [Tarinaky@Nightstar-f349ca6d.plus.com] has joined #code |
18:44 | <@ToxicFrog> | Um |
18:45 | <@ToxicFrog> | So you start the thread, then sit in a loop waiting for it to finish? |
18:45 | < Anno[Laptop]> | Yeah. |
18:45 | <@ToxicFrog> | That explains why the form isn't unlocking. |
18:45 | < Anno[Laptop]> | But when it finishes, it should unlock, right? |
18:46 | <@ToxicFrog> | Assuming that your loop terminates correctly and whatnot, it should do, yes |
18:46 | <@ToxicFrog> | But this won't solve the problem you stated earlier, which is that you need it to be usable while the calculations are running. |
18:49 | < Anno[Laptop]> | Mhm. Would putting the instances as fields in the frame class, and only firing start() in the button handling code work for unlocking the form while this runs? |
19:04 | | You're now known as TheWatcher[afk] |
19:06 | <@ToxicFrog> | Expand on that? |
19:07 | <@ToxicFrog> | The issue is that the form doesn't unlock until the button handling code returns; if it's spinning there waiting for the calculations to finish, there you go. |
19:09 | < Anno[Laptop]> | I'll try that. |
19:15 | | Rhamphoryncus [rhamph@Nightstar-473f8685.abhsia.telus.net] has quit [Client exited] |
19:34 | | Tarinaky [Tarinaky@Nightstar-f349ca6d.plus.com] has quit [Client closed the connection] |
20:23 | | kwsn is now known as kws-not-here |
20:24 | | Vornicus-Latens is now known as Vornicus |
21:04 | | Zed_ [Zed@Nightstar-556ea8b5.or.comcast.net] has joined #code |
21:11 | | Stalker [Z@26ECB6.A4B64C.298B52.D80DA0] has quit [Ping timeout: 121 seconds] |
21:23 | < Anno[Laptop]> | Is it possible, under Debian, to assign a processor on a multicore computer to handle just one program? I'd like to do that with DF, and I know it's possible under some OS, but don't know which one. |
21:28 | <@TheWatcher[afk]> | you'll need to have the schedutils package installed (IIRC). Then do `taskset -c 1 /path/to/df <args to df>` |
21:28 | | You're now known as TheWatcher |
21:32 | < Anno[Laptop]> | This package has no description, it seems. |
21:32 | < Anno[Laptop]> | And when I try to install, it installs nothing. |
21:34 | < Anno[Laptop]> | Seems I have this utility, since using your instruction works. |
21:44 | | Stalker [Z@2C3C9C.B2A300.F245DE.859909] has joined #code |
22:09 | <@ToxicFrog> | That's not the same thing unless you also give it realtime priority with "nice". |
22:09 | <@ToxicFrog> | Taskset configures the affinity; taskset -c 1 says "this program can only run on CPU 1", but doesn't prevent CPU 1 from also running other things. |
22:14 | < Anno[Laptop]> | So how would I do it properly? |
22:16 | <@ToxicFrog> | Use nice. |
22:17 | <@ToxicFrog> | You probably need to be root to set realtime priority. |
22:17 | <@ToxicFrog> | What's your underlying goal here? |
22:18 | < Anno[Laptop]> | The endless quest of making DF run faster. |
22:19 | <@ToxicFrog> | Setting it to realtime won't really help unless your other cores are all maxed; DF will use the entire core, and the OS will schedule everything else elsewhere. |
22:40 | | celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has joined #code |
--- Log closed Sat Oct 23 00:00:03 2010 |