--- Log opened Sun Jun 13 00:00:33 2010 |
00:39 | | AnnoDomini [annodomini@Nightstar-67c2de4d.adsl.tpnet.pl] has quit [[NS] Quit: leaving] |
00:45 | | Rhamphoryncus [rhamph@Nightstar-bbc709c4.abhsia.telus.net] has quit [Client exited] |
00:51 | | Attilla [Attilla@Nightstar-d9456080.threembb.co.uk] has quit [[NS] Quit: ] |
02:28 | | Vornicus-Latens is now known as Vornicus |
02:57 | < gnolam> | Drunken bugfixes++ |
03:48 | | gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has quit [[NS] Quit: Z?] |
04:40 | < celticminstrel> | Is there an easy way to transform a list of dictionaries into a dictionary of lists? |
04:40 | < Derakon> | What would you use as the keys? |
04:40 | < celticminstrel> | The keys of the sub-dictionaries. |
04:40 | < Derakon> | Or are you saying you have multiple dicts that all have the same sets of keys, and you want to make a single dict that maps those keys to the lists of values? |
04:40 | < celticminstrel> | Yes. |
04:41 | < celticminstrel> | Something like that. |
04:41 | < celticminstrel> | ...on second though, maybe that's not quite what I want... |
04:41 | < celticminstrel> | . |
04:41 | < celticminstrel> | ^thought |
04:42 | < Derakon> | Incoming mini-paste. |
04:42 | < Derakon> | listOfDicts = [...] |
04:42 | < Derakon> | mainDict = dict() |
04:42 | < Derakon> | for foo in listOfDicts: |
04:42 | < Derakon> | for key, value in foo.iteritems(): |
04:42 | < Derakon> | if key not in mainDict: |
04:42 | < Derakon> | mainDict[key] = [] |
04:42 | < Derakon> | mainDict[key].append(value) |
04:42 | <@Vornicus> | from collections import defaultdict; mainDict = defaultdict(list), then the if key... bit is not needed. |
04:43 | <@Vornicus> | THough that does have an issue! |
04:43 | <@Vornicus> | If some keys aren't present in some dicts, then your lists will be out of phase. |
04:43 | < Derakon> | Aye. |
04:44 | < Derakon> | Though if you're depending on the lists to be in phase, then I don't think this is a great approach. |
04:44 | < Derakon> | Keeping the lists in-synch will be a pain. |
04:50 | <@Vornicus> | If you want it to be reasonably performant you'd convert from dictionaries to objects with __slots__ |
05:47 | | Tarinaky [Tarinaky@Nightstar-58238565.adsl.virginmedia.net] has quit [Client closed the connection] |
06:05 | | celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has quit [[NS] Quit: *hums* Can't stay now!] |
06:29 | | celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has joined #code |
06:32 | | celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has quit [[NS] Quit: *hums* Can't stay now!] |
06:34 | | Netsplit *.net <-> *.split quits: Alek, Namegduf, EvilDarkLord, PinkFreud, SmithKurosaki, McMartin, simon__, 459AAEB09 |
06:38 | | simon [simon@Nightstar-a12ff716.gjk.dk] has joined #code |
06:38 | | Netsplit over, joins: Namegduf |
06:41 | | Alek [omegaboot@Nightstar-c5f3565b.il.comcast.net] has joined #code |
06:47 | | EvilDarkLord [jjlehto3@Nightstar-f1ccbb45.hut.fi] has joined #code |
06:47 | | mode/#code [-o TheWatcher[zZzZ]] by ChanServ |
06:47 | | Alek is now known as NSGuest2983 |
06:48 | | SmithKurosaki [Smith@Nightstar-ceab0ca8.dsl.teksavvy.com] has joined #code |
06:48 | | McMartin [mcmartin@Nightstar-dd07698f.pltn13.sbcglobal.net] has joined #code |
06:49 | | PinkFreud [WhyNot@NetworkAdministrator.Nightstar.Net] has joined #code |
06:55 | | NSGuest2983 is now known as Alek |
07:31 | | gnolam [lenin@Nightstar-38637aa0.priv.bahnhof.se] has joined #code |
07:32 | | Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has joined #code |
07:48 | | Derakon is now known as Derakon[AFK] |
08:09 | | AnnoDomini [annodomini@Nightstar-67c2de4d.adsl.tpnet.pl] has joined #code |
09:17 | < simon> | kademlia: if the distance between two node IDs a,b is the number of the most significant bit of (a xor b), then there's a 1/2 probability that the distance is 160 (for 160-bit keys), 1/4 that it's 159, 1/8 that it's 158 and so on... that seems wrong, since the low-order k-buckets will never be filled. |
09:23 | | You're now known as TheWatcher |
09:59 | | Zed [Zed@Nightstar-e4835f03.or.comcast.net] has joined #code |
10:04 | <@Vornicus> | If by "number of the most significant bit" for, say, all 1s, is 160, then the distance is 160 half the time, yes. |
10:39 | | Tarinaky [Tarinaky@Nightstar-65dff03c.adsl.virginmedia.net] has joined #code |
12:09 | | Kazriko [kaz@Nightstar-e09690fa.client.bresnan.net] has quit [Ping timeout: 121 seconds] |
13:04 | | Vornicus is now known as Vornicus-Latens |
13:39 | | RichardBarrell [mycatverbs@Nightstar-58acb782.cable.virginmedia.com] has joined #code |
13:45 | | Serah [Z@3A600C.A966FF.5BF32D.8E7ABA] has quit [Ping timeout: 121 seconds] |
14:04 | | Thaqui [Thaqui@27B34E.D54D49.F53FA1.6A113C] has quit [Client closed the connection] |
14:21 | | Serah [Z@26ECB6.A4B64C.298B52.D80DA0] has joined #code |
14:49 | | celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has joined #code |
17:24 | | celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has quit [[NS] Quit: *hums* Can't stay now!] |
17:29 | | Derakon[AFK] is now known as Derakon |
17:55 | | Kazriko [kaz@Nightstar-e09690fa.client.bresnan.net] has joined #code |
18:32 | | celticminstrel [celticminstre@Nightstar-f8b608eb.cable.rogers.com] has joined #code |
19:16 | | Attilla [Attilla@Nightstar-ed29df39.threembb.co.uk] has joined #code |
20:04 | | aoanla [AndChat@37647E.0002A6.6691A5.71E521] has joined #code |
20:16 | < simon> | what's a good tool for generating graphs containing dates on the x-axis? |
20:33 | | Vornicus-Latens is now known as Vornicus |
20:46 | <@Vornicus> | Excel. |
20:49 | <@ToxicFrog> | gnuplot. |
21:11 | | Vornicus is now known as Finerty |
21:55 | | Attilla [Attilla@Nightstar-ed29df39.threembb.co.uk] has quit [Ping timeout: 121 seconds] |
21:56 | | Attilla [Attilla@Nightstar-ed29df39.threembb.co.uk] has joined #code |
22:02 | < AnnoDomini> | Hm. |
22:02 | < PinkFreud> | .mH |
22:02 | < AnnoDomini> | I have installed Irfan View using WINE. I want to set image files to be opened with that by default. |
22:02 | < PinkFreud> | which distro? |
22:03 | < PinkFreud> | and, for that matter, which desktop? |
22:03 | < AnnoDomini> | Debian 5. Gnome, I think. |
22:05 | < PinkFreud> | bleh. I can tell you what to change in xfce, but I don't use gnome much. |
22:06 | < AnnoDomini> | Alternatively, simply having an alternative listed under Open With... would work. |
22:06 | < AnnoDomini> | But I'm not sure how to phrase the command. |
22:07 | < AnnoDomini> | wine 'path/to/iview.exe' <???> |
22:07 | < AnnoDomini> | I think, but I dunno what to put in that last part. |
22:10 | < PinkFreud> | that may or may not allow arguments. |
22:11 | < PinkFreud> | where is that, firefox? |
22:12 | < AnnoDomini> | No, the open with stuff. Like, RMB, Open With..., Choose Application. I get to type in a command if the options listed ar unsatisfactory. |
22:15 | < PinkFreud> | ahh. |
22:15 | < PinkFreud> | try wine 'path/to/iview.exe' then |
22:17 | < AnnoDomini> | That opens up Irfan View, but doesn't automatically load the image. |
22:18 | < AnnoDomini> | I think the logical way this might work is passing an argument. I don't know the syntax for that. |
22:28 | <@ToxicFrog> | 'man wine' |
22:28 | <@ToxicFrog> | Right at the top of the man page: "For instructions on passing arguments to Windows programs, please see the PROGRAM/ARGUMENTS section of the man page." |
22:29 | <@ToxicFrog> | And it basically just says "slap them on the end of the command line" |
22:29 | <@ToxicFrog> | I would suggest running iview from the terminal and making sure that wine iview.exe filename actually works as expected. |
22:40 | < AnnoDomini> | Doing 'wine path/to/i_view32.exe filename.png' works just fine. |
22:41 | < AnnoDomini> | But I don't want to have the custom command load me a hardcoded file. |
22:41 | < AnnoDomini> | I was the file I right-clicked. |
22:41 | < AnnoDomini> | *want |
22:54 | <@ToxicFrog> | Just entering 'wine path/to/i_view32.exe' as the custom command should work, then. |
22:54 | <@ToxicFrog> | Odd. |
22:56 | < AnnoDomini> | I'm thinking the filename may be passed as the first argument or something. How do I denote that the first argument ought to be used at the end of the command? |
22:56 | < McMartin> | Hmm. Does your Desktop environment need a wacky syntax for ARG GOES HERE or something? |
22:56 | < AnnoDomini> | I dunno. |
22:56 | < McMartin> | ... Oh dear |
22:56 | < McMartin> | Maybe it's trying to run wine\ path/to/i_view32.exe |
22:57 | < AnnoDomini> | When I put in 'wine path/to/i_view32.exe' in the custom command field, and use it, it launches Irfan View without a loaded image. |
22:58 | < McMartin> | Oh, I see. |
22:58 | < McMartin> | Sorry, I missed a little context. |
22:58 | < McMartin> | Hmmm |
22:58 | < McMartin> | What happens if you throw together a little bash script that just calls wine path/to/i_view32.exe $1? |
22:59 | < AnnoDomini> | Can I put that in the custom command field? |
22:59 | < McMartin> | ... That's an interesting question, and it might depend on your desktop environment |
22:59 | < McMartin> | How do associations for, say, text files look? |
23:00 | < AnnoDomini> | When I select them, the command changes to just the application name. |
23:00 | < AnnoDomini> | So when I select the Text Editor, it changes to 'gedit', nothing else. |
23:01 | < McMartin> | Mmm. |
23:01 | < McMartin> | Yeah, see if you can make a script that acts that way and if that works. |
23:01 | < McMartin> | If it does, then you have a short answer while one might be able to poke later on |
23:01 | < AnnoDomini> | I just put the line you told me in a text file, yes |
23:01 | < AnnoDomini> | ? |
23:02 | < McMartin> | Well, name it something like irfanview.sh, make it +x, and then associate .png with that .sh |
23:04 | < AnnoDomini> | I did, and it launches only an empty Irfan View. |
23:04 | < McMartin> | Hrm. |
23:04 | < AnnoDomini> | I don't need to invoke any special magic to make the script file work, do I? |
23:05 | < McMartin> | I don't *think*, so, but my experiences with Wine have generally ended in hilarious disaster, so just to make sure I'm not on crach, does "./irfanview.sh test.png" actually work? |
23:05 | < McMartin> | *on crack |
23:07 | < AnnoDomini> | It does. |
23:07 | < McMartin> | That is 47 different kinds of bizarre. =/ |
23:07 | < McMartin> | Step 2: replace $1 with "$@", quotation marks included. |
23:09 | < AnnoDomini> | Doesn't work. |
23:09 | < AnnoDomini> | Well, it does exactly what it did last time. |
23:09 | < McMartin> | Crud. In that case, I got nothin'. |
23:09 | < McMartin> | (If the right click were somehow adding different... wait) |
23:10 | < McMartin> | While iview is up, what does its commandline in ps say? |
23:10 | < AnnoDomini> | You mean what's in the custom command text field when I select the script? |
23:10 | < McMartin> | No, I mean, what is actually being run as the process |
23:11 | < McMartin> | ps ax | grep i_view should do it |
23:11 | < AnnoDomini> | 6425 ? S 1:22 C:\Program Files\IrfanView\i_view32.exe |
23:12 | < McMartin> | .... and it's suspended? |
23:12 | < McMartin> | And there's no wine script. Curiouser and curiouser. |
23:12 | < McMartin> | I guess I do got nothin'. |
23:12 | < McMartin> | Sorry. |
23:14 | < AnnoDomini> | That's one I had up before. |
23:14 | < AnnoDomini> | When I run one from the script via Open With, I get: |
23:14 | < AnnoDomini> | 6862 ? S 0:00 /home/myuser/.wine/drive_c/Program Files/IrfanView/i_view32.exe /home/myuser/bin/6HUUY.jpg |
23:14 | < AnnoDomini> | It doesn't display the file, though. |
23:15 | < AnnoDomini> | The former one got launched by the shortcut created by WINE when I installed it. |
23:15 | | * McMartin nods. |
23:15 | < McMartin> | And when you run from terminal, where you get the expected result, does it still look like that? |
23:16 | < AnnoDomini> | 6878 pts/3 S+ 0:00 /home/myuser/.wine/drive_c/Program Files/IrfanView/i_view32.exe 6HUUY.jpg |
23:17 | < McMartin> | OK, step 2 is I guess to try "irfanview.sh /home/myuser/bin/6HUUY.jpg" |
23:18 | < AnnoDomini> | It fails in the familiar manner. |
23:18 | < McMartin> | SCIENCE. |
23:19 | < AnnoDomini> | Curious. |
23:19 | < McMartin> | So it looks like WINE hates absolute paths. |
23:19 | < AnnoDomini> | It's distinct from the result I get when I give it a wrong filename or something, but it would otherwise work if I had given it a good path. |
23:19 | <@jerith> | It's probably looking at those relative to c:\ |
23:20 | < AnnoDomini> | In this case, there's no error, no nothing, just normal activation. |
23:20 | < AnnoDomini> | In the other case, IV launches an error prompt: "invalid file or something". |
23:20 | < Namegduf> | Does WINE have the Z:\ drive as nromal? |
23:20 | <@jerith> | Try /Program\ Files/something.jpg or whatever. |
23:21 | < AnnoDomini> | jerith: You mean a file within WINE's internal directory structure? |
23:21 | <@jerith> | Something under .wine/drive_c |
23:23 | <@ToxicFrog> | AnnoDomini: does 'irfanview.sh Z:/home/myuser/bin/6HUUY.jpg' work? |
23:24 | | AbuDhabi [annodomini@Nightstar-f537044a.adsl.tpnet.pl] has joined #code |
23:24 | < AbuDhabi> | jerith: You mean a file within WINE's internal directory structure? |
23:24 | < AbuDhabi> | Namegduf: Mine seems to have a C:. |
23:24 | < AbuDhabi> | "./iview.sh C:/6HUUY.jpg" launches the image properly. |
23:24 | < Namegduf> | AbuDhabi: It should have a Z:\, as well. |
23:24 | <@jerith> | Something under .wine/drive_c |
23:24 | < Namegduf> | AbuDhabi: Which normally mounts / |
23:24 | < Namegduf> | And is possibly what it translates absolute paths to |
23:25 | <@ToxicFrog> | AnnoDomini: does 'irfanview.sh Z:/home/myuser/bin/6HUUY.jpg' work? |
23:25 | < Namegduf> | By "should" |
23:25 | < Namegduf> | I meant "is still configurable, I think" |
23:25 | | AnnoDomini [annodomini@Nightstar-67c2de4d.adsl.tpnet.pl] has quit [Ping timeout: 121 seconds] |
23:25 | < Namegduf> | Might want to check out winecfg, Drives |
23:25 | < Namegduf> | See if Z: is there. |
23:26 | < AbuDhabi> | ToxicFrog: Yes, it does. |
23:26 | < Namegduf> | Aha. |
23:26 | < Namegduf> | So my theory is wrong. |
23:26 | < McMartin> | But! It gives us a possible solution. |
23:26 | < Namegduf> | Z:\ exists, but absolute paths don't work. |
23:26 | < Namegduf> | Huh. |
23:26 | < Namegduf> | It does, yeah. |
23:27 | < McMartin> | It might be enough to just make the line be .... z:$1 |
23:27 | < McMartin> | or we might have to play games with an extra variable in order to ensure that any spaces in the filename are preserved. |
23:27 | < McMartin> | Or will "Z:$1" cover that? |
23:28 | <@ToxicFrog> | It will. |
23:28 | < AbuDhabi> | With the quotes? |
23:29 | <@ToxicFrog> | They're kind of important, yes. |
23:29 | < AbuDhabi> | It loads something. It's not what I want, but some kind of text file from elsewhere. |
23:30 | <@ToxicFrog> | Where? |
23:30 | <@ToxicFrog> | Also, "it" == ? |
23:31 | < AbuDhabi> | Trying to use the script with RMB + Open With, instead of opening the clicked file, loads up 'gamelog.txt', which I'll try to find right now. |
23:32 | < AbuDhabi> | It's in my user home directory. |
23:37 | <@ToxicFrog> | What's the command ine reported by ps? |
23:38 | < AbuDhabi> | 7042 ? S 0:00 /home/myuser/.wine/drive_c/Program Files/IrfanView/i_view32.exe Z:/home/myuser/bin/6HUUY.jpg |
23:42 | <@ToxicFrog> | And the thing is in /home/myuser/bin? |
23:42 | < McMartin> | You didn't accidentally hit space or left/right-click in the window, did you? |
23:42 | < McMartin> | IrfanView will happily scroll you to text files in the same directory |
23:43 | < AbuDhabi> | I did not. This behaviour is consistent every time I do it. |
23:43 | < AbuDhabi> | ToxicFrog: No. It's /home/myuser/gamelog.txt |
23:45 | <@ToxicFrog> | AbuDhabi: is 6HUUY.jpg in ~/bin? |
23:45 | < AbuDhabi> | Yes. |
23:45 | <@ToxicFrog> | ...and if you run the shscript from the terminal, the command line is the same and it works? |
23:46 | < AbuDhabi> | Running "./iview.sh /home/myuser/bin/6HUUY.jpg" in command line works. |
23:48 | <@ToxicFrog> | Is the command line the same? |
23:48 | < AbuDhabi> | You mean what I get from ps? |
23:48 | <@ToxicFrog> | Yes. |
23:49 | < AbuDhabi> | 7094 pts/3 S+ 0:00 /home/myuser/.wine/drive_c/Program Files/IrfanView/i_view32.exe Z:/home/myuser/bin/6HUUY.jpg |
23:49 | < AbuDhabi> | 7100 ? S 0:00 /home/myuser/.wine/drive_c/Program Files/IrfanView/i_view32.exe Z:/home/myuser/bin/6HUUY.jpg |
23:49 | < AbuDhabi> | First is command line, second is Open With. |
23:51 | <@ToxicFrog> | ...what happens if you cd to a different directory, then run it from there? |
23:51 | <@ToxicFrog> | Eg, "cd /; ~/bin/iview.sh /home/myuser/bin/6HUUY.jpg" |
23:52 | < AbuDhabi> | It loads gamelog.txt in IV. |
23:54 | <@ToxicFrog> | Add this to the script, before you invoke irfanview: |
23:54 | <@ToxicFrog> | cd $(dirname "$1") |
23:54 | < AbuDhabi> | This is all? |
23:56 | < AbuDhabi> | It works. |
23:56 | | You're now known as TheWatcher[T-2] |
23:56 | < AbuDhabi> | ...only in the ~/bin directory. |
23:57 | <@ToxicFrog> | o.O |
23:57 | < AbuDhabi> | Wait, wait, it works in my /home/myuser/internets/ too. |
23:58 | < AbuDhabi> | But not on a drive that's in /mnt/. |
23:59 | <@ToxicFrog> | Those may not be under Z: |
23:59 | <@ToxicFrog> | What happens if you rewrite the script to be: |
23:59 | <@ToxicFrog> | cd $(dirname "$1") |
23:59 | <@ToxicFrog> | wine /path/to/iview $(basename "$1") |
--- Log closed Mon Jun 14 00:00:34 2010 |