/srv/irclogs.ubuntu.com/2010/04/02/#ubuntuone.txt

rickspencer3thanks aquarius00:16
rickspencer3that is what I mean :)00:16
nhainesIteration + list comprehensions = I <3 python00:24
aquariusactually, list(db._server) would be better, probably :)00:32
kenvandineCardinalFang, ping03:10
CardinalFangkenvandine, hi03:10
kenvandineyo... so weird thing03:10
kenvandinerickspencer3 wrote a little app for finding dbs in couch03:10
kenvandinewell, when he accesses gwibber_preferences with his app (does a get_records call), it causes a CPU spike in desktopcouch-service and gwibber-service03:11
kenvandineand they don't recover... they just stay pegged03:11
rickspencer3kenvandine, desktopcouch-se is pegged right now03:11
rickspencer3and so far as I know *nothing* is using it03:11
kenvandinehe doesn't appear to be doing anything that changes any records03:11
rickspencer3let me reboot03:12
kenvandineCardinalFang, however... i have been suspecting this was the keyring bug... but it has been pegging my CPU too03:12
rickspencer3brb03:12
kenvandineuntil today when i deleted the keys from the keyring03:12
kenvandineand my desktopcouch-service is under control again03:12
kenvandinenot sure if it could be related to the keyring problem03:12
kenvandinebut gwibber-service shouldn't even know his slip-cover application is even querying it03:13
CardinalFanggwibber-service?  I don't get that.03:13
kenvandineyeah03:14
CardinalFang(I barely get the desktopcouch-service one.)03:14
kenvandinegwibber does have the monitoring stuff, so it would see changes03:14
kenvandinebut he isn't changing stuff03:14
kenvandinebut he can reliably repro it03:14
kenvandinei can't :)03:14
rickspencer3kenvandine, I'll try writing the smallest repro script that I can03:15
kenvandineCardinalFang, i was reliably getting the CPU pegged thing in desktopcouch most of the week :)03:15
kenvandinecool03:15
kenvandinegive it to CardinalFang03:15
* kenvandine has to go, thx guys!03:15
CardinalFangYes, please do.03:15
CardinalFangthanks, kenvandine.03:15
kenvandinei'll be back though... got long ass python/gwibber stacktraces to read tonight :)03:16
CardinalFangrickspencer3, do you still have many  libgnome-keyring0  debs in your /var/cache/apt ?03:16
rickspencer3no idea03:17
CardinalFangrickspencer3, I want to know if it still happens with the version from 3 weeks ago.03:17
kenvandineCardinalFang, good idea03:17
rickspencer3CardinalFang, how can I check for you?03:17
CardinalFang$ find /var/cache -ls |grep /libgnome-keyring003:17
kenvandineCardinalFang, or just find the version you want and install it with apt03:18
kenvandinein fact... tell me what version too03:18
CardinalFangWell, finding it may be the problem.03:18
CardinalFangI have it.03:18
kenvandineapt-get install libgnome-keyring0=VERSION03:18
kenvandinesomething like that03:18
rickspencer3rick@rick-desktop:/var/cache/apt/archives$ sudo find /var/cache -ls |grep /libgnome-keyring003:18
rickspencer3[sudo] password for rick:03:18
rickspencer3313331   56 -rw-r--r--   1 root     root        53576 Apr  1 08:05 /var/cache/apt/archives/libgnome-keyring0_2.30.0-0ubuntu2_i386.deb03:18
kenvandinewhat versionis it?03:18
CardinalFang/var/cache/apt/archives/libgnome-keyring0_2.29.4git20100224-0ubuntu2_i386.deb03:18
CardinalFangThat, 224...2 at least.03:19
kenvandinehumm03:19
CardinalFanghttp://sandbox.chad.org/libgnome-keyring0_2.29.4git20100224-0ubuntu2_i386.deb03:19
rickspencer3oh crap03:20
rickspencer3so gwibber-sevice and desktopcouch-se are pegged at 100% again03:21
rickspencer3just be gwibber auto-running03:21
rickspencer3hmm, unless just asking desktopcouch in python for a list of database caused it03:21
kenvandinehttps://edge.launchpad.net/ubuntu/+source/libgnome-keyring/2.29.4git20100224-0ubuntu203:21
rickspencer3brb03:22
kenvandinejust click on the build you want03:22
kenvandinebrb03:22
rickspencer3re03:24
rickspencer3so it looks like gwibber-service and desktopcouch-se add a little load at start up03:25
rickspencer3but like 3-6% while working03:25
CardinalFangThat's about right for normal wear.03:26
rickspencer3right03:26
rickspencer3ok and asking gwibber preferences for records it didn't have, no spike03:27
CardinalFangrickspencer3, okay.  Beware that spikes don't happen every time, AFAICT.03:27
rickspencer3true03:27
rickspencer3let me try my harmless test app a bunch of times then03:28
CardinalFangBut, i want some objective third-party eyes in my little spat with seb128 about this change to libg-kr0.03:29
rickspencer3there it is03:29
rickspencer3afer the thrid time03:29
rickspencer3I have 3 instances of gwibber-services03:29
rickspencer3and one of them is peggin at 10003:29
rickspencer3but weirdly desktopcouch is not03:30
rickspencer3CardinalFang, here's my script:03:30
rickspencer3from desktopcouch.records.server import CouchDatabase03:30
rickspencer3db = CouchDatabase("gwibber_preferences")03:30
rickspencer3records = db.get_records("boo",True)03:30
rickspencer3print len(records)#should be zero03:30
CardinalFangI don't get that part -- gwibber-services.03:30
rickspencer3weirdly, desktopcouch is *not* spiking this time03:31
rickspencer3maybe if I call it a few more times03:31
CardinalFangRight -- desktopcouch-service is all I know about as spiking.03:31
rickspencer3CardinalFang, you mean gwibber-service?03:32
CardinalFangBut, unless you kill desktopcouch-service and restart it, you're not testing the code I have been looking at.03:32
rickspencer3CardinalFang, I'm just trying to create a simple repro script03:33
CardinalFangrickspencer3, no, I saw you and ken say that earlier, but I haven't noticed that or worked on it.03:33
CardinalFangRight.03:33
kenvandineCardinalFang, that version of libgnome-keyring0 doesn't fix gwibber03:33
CardinalFangFor me, and many, desktopcouch-service spins out of control when it asks for keyring creds.03:33
kenvandineCardinalFang, yesterday we uploaded gwibber with keyring password storage03:34
kenvandineif i keep the passwords in plaintext in couchdb, all is fine03:34
rickspencer3CardinalFang, well, I had assumed that asking Gwibber for account stuff caused Gwibber to ask the keyring for stuff03:34
CardinalFangHrm.  Then you may have the same problem as I have.03:34
kenvandinebut saving them in the keyring and gwibber uses 100% CPU03:35
kenvandineCardinalFang, i do :)03:35
kenvandinedobey, worked around it in ubuntuone-client, but his work around didn't work in gwibber03:35
kenvandinewe use python multiprocessing03:35
CardinalFangHe worked around it by not using threads any more.03:35
kenvandinefor threading the refreshes and such03:35
kenvandinejust for that03:35
kenvandinebut yeah03:36
CardinalFangI suspect that anything multithreaded that uses python-gnomekeyring will have this problem.03:37
rickspencer3kenvandine, so I killed gwibber-services03:37
rickspencer3and then ran my repro script 20 times with no symptoms03:37
CardinalFangrickspencer3, are you running that version of libgnome-keyring0 that I pointed to?03:38
rickspencer3CardinalFang, no, I didn't know that was for me03:39
rickspencer3hold on03:39
CardinalFangI don't know which version is the cause, but these problems started recently, and I think that one -- 2.29.4git20100224-0ubuntu2 -- is the last sane one.03:40
rickspencer3aaarg03:41
rickspencer3this is the *moat* frustrating bug to reproduce *ever*03:41
CardinalFangWelcome to my last ten days.03:41
rickspencer3so:03:41
rickspencer31. I boot up03:41
rickspencer32. gwibber/desktop couch start normally03:42
rickspencer33. I thought the CouchDB for the gwibber perference 3 times03:42
rickspencer3the CPU pegs03:42
rickspencer3with gwibber-services03:42
rickspencer34. I kill gwibber-services03:42
rickspencer35. I run the repro script 100 times03:42
rickspencer3nothing happens03:43
rickspencer36. I run gwibber again03:43
rickspencer37. I run the script 100 times03:43
rickspencer3nothing happens03:43
rickspencer3CardinalFang, ok, what did you want me to install specifically?03:43
CardinalFangrickspencer3, I was saying that I think desktopcouch-service will not beg the CPU with libgnome-keyring0_2.29.4git20100224-0ubuntu2 or earlier.03:44
CardinalFangpeg03:44
kenvandineCardinalFang, yeah... but gwibber still does03:44
kenvandinewhich is damn weird03:44
kenvandinethe code we use to query it is the same03:45
kenvandineour threading is different though03:45
rickspencer3oops03:46
rickspencer3I stand corrected03:46
rickspencer3I notice that gwibber-service is pegged again03:46
rickspencer3but not desktopcouch-service03:46
* CardinalFang sighs.03:47
CardinalFangDoes gwibber use twisted?03:47
kenvandineno03:48
kenvandineit's driving me nuts though03:48
CardinalFangDang.03:48
CardinalFangkenvandine, Make sure it is gnomekeyring.find_keys() or whatever.03:49
CardinalFangReplace that with a dict of the same value.03:49
rickspencer3I just pegged beam.smp03:51
rickspencer3calling get_records() on the gwibber_accounts database03:52
CardinalFangEr, that's different.03:53
rickspencer3I killed gwibber-service, but beam is still pegged03:53
rickspencer3unfortunately, I have to go03:54
rickspencer3sorry I couldn't help more03:54
rickspencer3oh, it was gwibbermessages,actually03:55
rickspencer3maybe beam.smp was just working03:55
rickspencer3since I just asked for every record it's had stored from messages03:55
CardinalFangYeah, that may be it.  Just a huge BD.03:59
CardinalFangDB03:59
CardinalFangI must go too. 2300.03:59
rickspencer3we'll lick this tomorrow03:59
CardinalFangLaters, rickspencer3 and kenvandine.  See you in ~8 hours.  *sigh*03:59
rickspencer3beam is still pegging the CPU, btw ;)04:00
rickspencer3g'night CardinalFang04:00
rickspencer3I guess asking for every record from a HUGE db is not too optimized04:00
=== kermiac_ is now known as kermiac
DanaGsay "honk"?  Anyway, my question: how do I set up ubuntuone on a headless box (with ssh -X)?05:11
duanedesignDanaG: most everyone is not on or asleep. You can try again tommorrow between 12:00 and 20:00 UTC. That is when most are on. Or file a Launchpad Answer.05:20
DanaGThu Apr  1 21:21:01 PDT 201005:21
DanaGgmt minus 8...05:21
DanaGah, noon-ish.05:21
duanedesignDanaG: i have heard 'rye' mention what you are asking about05:22
duanedesignhe is the one who responds to honk as well :)05:22
=== JanC_ is now known as JanC
kermiacbug 487257 added to https://wiki.ubuntu.com/UbuntuOne/Bugs   - please advise if anything needs to be changed08:23
ubottuLaunchpad bug 487257 in ubuntuone-client "The client gets stuck into STANDOFF state" [High,Fix committed] https://launchpad.net/bugs/48725708:23
=== kermiac is now known as kermiac_
ryehm I wonder whether we need to query for current syncdaemon state/last states according to MARKs in the log file in apport hook09:30
=== kermiac_ is now known as kermiac
=== kermiac is now known as kermiac_
ryeGrrr, i swapped UbuntuOneUserSyncdaemonConfig with UbuntuOneSyncdaemonConfig in apport10:55
ryehmmm10:55
ryegrrr10:55
statikhi rye, i was able to view the music store briefly earlier today, but now rhythmbox just tells me "could not load music store". Do you see the same problem, or is there something I should look at to see why it won't load?11:43
ryestatik, checking... will be ready to answer in 10 minutes when syncdaemon finished loading metadata :(11:45
ryeah, no, faster11:45
ryestatik, are you unable to view the initial page of ubuntuone music store? Does it have OOPS?11:46
ryewell, my rb hangs until syncdaemon finally starts :(11:46
statikrye: I just realized I wasn't actually exiting rbox. It seems that when I pressed play on a music video (despite seeing a warning that it was not in mp3 format) the music store got into a weird state. it did not show any oops id or anything like that.11:49
=== kermiac_ is now known as kermiac
ryelp, +1 hour of outage :(12:03
kermiacrye: yeah, just notcied that too :(12:03
kermiacthe LP identica status page warned of 15 mins downtime - but now it seems it's going to be at least 3 hrs.12:04
=== kermiac is now known as kermiac_
ryekermiac, I need to fix my bugpatterns but OTOH the bugs can not be submitted right now...12:07
VoytechHello guys.13:14
=== kermiac_ is now known as kermiac
=== kermiac is now known as kermiac_
PaulGitvds: ping13:43
qenseUbuntu One doesn't remember it when I select "Synchronise this folder with Ubuntu One" (or something similar). Each time I have to select that option again. Is that a known issue?13:44
mattgriffinqense: when you type 'u1sdtool --list-folders' in a terminal, does it list the folder that you want synchronized?13:46
mattgriffinqense: i think i have a similar issue. ubuntu one is actually syncing the folder but nautilus doesn't show this setting correctly.13:47
qensemattgriffin: Yes, that does work.13:52
qensemattgriffin: That's good news.13:52
vdsPaulGit: pong14:23
PaulGitvds: Hi mate, just wondering if you pushed any extra logging code to servers yet?14:23
vdsPaulGit: not yet, we are going to sprint on that next week14:28
vdsPaulGit: but in the meanwhile I fixed a lot of things related to duplicate and twins14:28
vdsPaulGit: so it would be cool if you can try again14:28
PaulGitvds: OK, I will give it a try and let you know how I get on.14:29
vdsPaulGit: thanks a lot!14:29
CardinalFangmoin, rickspencer315:18
rickspencer3hi CardinalFang15:18
ryeok, got tired of these notes bugs. Blank note fix for tomboy is 2 line fix. Doing that right now15:29
mesulaUbuntu One has turned one of my documents into a .u1conflict file and I can't get into it now. :(15:29
rye+ tests, which I don't know how to write since I am not a developer actually...15:30
mesulaI can't seen to extract the .u1conflict file either. :(15:30
ryemesula, what is the size of u1conflict file?15:30
ryemesula, did you edit that file on a different machine?15:30
mesularye: 12.3KB15:30
mesularye: No.15:30
ryemesula, could you please try moving this file out of Ubuntu One directory and removing .u1conflict suffix?15:31
ryeis it possible for you to share the file name here? i.e. what name this file has?15:31
mesulaBus fare.gnumeric.u1conflict15:31
mesularye: Yeah, you solved the problem. :)15:31
ryemesula, hm, gnumeric... need to check whether it does something strange for ubuntuone during editing15:32
ryeadding to TODO15:32
mesularye: I've edited this file lots before and haven't had this problem.15:32
mesularye: I've always edited it from the same PC, too.15:33
ryemesula, could you please paste ~/.cache/ubuntuone/log/syncdaemon.log to http://paste.ubuntu.com ?15:33
CardinalFangthat change to libgnome-keyring0 is so close to working.15:40
mesulaA really fit 14 year old girl just came round my house and I gave her an Easter egg. :)15:47
mesularye: Sorry, my text editor doesn't want to open that file.15:48
mesula50% memory usage and rising...15:48
mesulaCorrection, 50% memory usage and stagnating.15:48
ryemesula, ok, could you please kill the editor, there is a commandline app called pastebinit that needs to be adjusted a little bit to be used with paste.ubuntu.com15:51
ryemesula, quick test - could you please copy (not move, but copy) the offending file back to Ubuntu One directory and check whether it works15:51
CardinalFangafk for breakfast.  back in ~4515:52
mesularye: Too late, I already moved it back.15:52
mesularye: It's a custom Ubuntu One directory.15:52
mesularye: I'm running Lucid, you see.15:53
ryemesula, ah, ok, and the it appeared on the server, right?15:53
mesularye: It's there but the last modified version was 12 days ago despite it being updated nearly every day since.15:55
mesulahttp://pastebin.com/D2GL6ucZ15:56
ryemesula, ok, will wait for my firefox to unfreeze :)15:57
mesularye: LOL15:57
mesularye: Yeah, my Midori doesn't like it either.15:57
ryehm15:58
ryemesula, what's your local time now?15:58
mesularye: 15:5815:58
ryemesula, was that syncdaemon.log or syncdaemon.log-something ?15:58
ryemesula, that's the last time we heard from syncdaemon - 2010-04-02 12:25:16,84215:59
mesularye: samuel@samuel-desktop:~$ pastebinit ~/.cache/ubuntuone/log/syncdaemon.log15:59
ryehmmmm15:59
rye2010-04-02 12:25:16,842 - ubuntuone.SyncDaemon - DEBUG - Signal received 1515:59
ryemesula, ps aux | grep [s]yncdaemon ?16:00
mesularye: No output.16:00
ryemesula, hm16:00
ryeit died16:00
ryewell, it was terminated and..16:00
ryei know16:00
ryemesula, could you please start it - u1sdtool --connect16:00
ryemesula, I believe it does not autostart now, since the autostart script is not yet packaged in lucid16:01
ryemesula, did you reboot your computer @ 12:25? :)16:01
mesularye: I haven't rebooted my computer today.16:01
ryemesula, logout?16:01
mesulasamuel@samuel-desktop:~$ uptime16:01
mesula 16:01:50 up  3:35,  3 users,  load average: 4.47, 2.51, 1.7616:01
mesulaMaybe I did...16:02
ryemesula, hm, something terminated syncdaemon16:02
mesularye: I must have logged out or rebooted or something, judging by the uptime.16:05
mesularye: Sorry, I couldn't remember doing it.16:05
ryemesula, ok, so now you will need to start syncdaemon so that it could sync the file16:05
ryebut I wonder why it is 12 days ago, if syncdaemon was working today...16:06
mesularye: I don't really care about syncing since I only use Ubuntu One with one PC ATM.16:06
mesularye: Probably because it's tstill struggling to sync a 1.5GB directory16:06
mesularye: I mainly want an online backup for if my HDD crashes.16:07
mesulas/crashes/dies/16:07
ryemesula, what's the number of the files in that 1.5 GB dir?16:09
mesularye: About 8,000 IIRC16:10
mesularye: I think I was told it's a known bug causing it not to sync properly.16:10
ryemesula, u1sdtool --waiting-meta | wc -l ; u1sdtool --waiting-content | wc -l16:11
mesulaTraceback (most recent call last):16:12
mesulaFailure: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.16:12
mesula216:12
mesula116:12
mesulasamuel@samuel-desktop:~$16:12
ryemesula, u1sdtool --status?16:12
mesulaOops, an error ocurred:16:13
mesulaTraceback (most recent call last):16:13
mesulaFailure: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.16:13
ryemesula, ok, what's in ~/.cache/ubuntuone/log/syncdaemon.log16:14
ryeI definitely need to get the numbers that indicate the number of files that are comfortable to sync...16:14
mesularye: Didn't I already just pastebin that?16:15
ryemesula, it rotates every time syncdaemon is restarted16:15
mesularye: After I pastebin this, I have to go; I need to chase after a really fit 14 year old girl and make her my girlfriend.16:16
rye:-)16:16
mesulahttp://pastebin.com/bTkJ9YdF16:16
mesulaG2G now: love calls16:16
ryeok, it is still doing local rescan16:17
Technovikingdobey: is 1.9.11 in a ppa or is it coming down the upgrade pipe16:37
dobeyTechnoviking: 1.1.91 was post-b2 freeze, but it is in the review queue. i think it's just waiting for release team approval16:38
Technovikingdobey: yeah, figure that16:41
dobeyTechnoviking: it was sponsored, so i guess it should get built/pushed today i hope16:42
mesularye: Back.17:11
mesularye: I found that really fit 14 year old girl and asked her out to dinner or to the cinema. I walked her the rest of the way to her house, in the sunshine, and it started tipping down with rain as I began to walk home.17:12
mesula1rye: Back.17:14
mesula1rye: I found that really fit 14 year old girl and asked her out to dinner or to the cinema. I walked her the rest of the way to her house, in the sunshine, and it started tipping down with rain as I began to walk home.17:14
ryemesula, mesula1, welcome back! :)17:14
mesula1rye: mesula is a ghost.17:15
CardinalFangmesula, hi, why don't you have a seat right over there.17:15
mesula1CardinalFang: Hi.17:16
=== mesula1 is now known as mesula
rockstarrye, hi.  aquarius seems to have forgotten about me yesterday.  Is there someone around today that could help?17:23
ryerockstar, no files on the web interface, right?17:24
rockstarrye, correct.17:24
rockstarStill saying "transferring to your Ubuntu One storage"17:24
rockstarI bought the album on Tuesday.  :)17:24
statikrockstar, aquarius is on vacation until tuesday, when we start sprinting on music store bugs again17:26
rockstarstatik, do I have to wait 'til Tuesday to get my album?  :(17:26
statiknot sure we will be able to fix that for you today17:27
statikrockstar: there has been a problem where 7d was giving 200 ok for errors17:27
rockstarstatik, epic fail17:27
statikand we've written some logging code and come up with a strategy to handle it17:27
=== mesula is now known as askidjhfg
rockstarstatik, okay, it's not a huge deal.  I mean, this is beta right?  I'm a guinea pig for a reason.  :)17:28
statikbut unfortunately today is a holiday so the right people are not around to help you get your music right away - we absolutely will be fixing it though17:28
askidjhfgIs the online music collection limited to 2GB like the rest of my files?17:29
ryeCardinalFang, what if I get ERROR:gkr-operation.c:169:gkr_operation_set_result: assertion failed: ((int) res != INCOMPLETE)17:29
ryeCardinalFang, and then coredump from desktopcouch-service ?17:29
CardinalFangrye, I see it too.  I'm filing a bug report.  Give me ~=10 min.17:29
ryeCardinalFang, ok, it's just why it fails in vm but not here, in host system which happily replicates...17:30
ryewell, for now at least17:30
duanedesignhave a few bug reports I have been meaning to get too in regards to people using U1 as root.17:32
ryeduanedesign, as root user or starting applets/preferences/syncdaemon with sudo ?17:34
duanedesignrye: it appears they are from users that use root as their user.17:35
ryeduanedesign, first question - why? :)17:35
duanedesignlol, i know17:37
duanedesignrye: i thought the appropriate response might be trying to tell them why that is not a great idea.17:38
duanedesignrye: there are a handful and most seem to have the error. Launch helper exited with unknown return code 117:38
statikaskidjhfg, yes it is limited to 2GB if you are using the free plan. if you buy too much music to fit in the 2GB space you can upgrade or move some of the MP3s into another folder that is not synced with ubuntu one.17:38
CardinalFangrye, subscribed you.  https://bugs.edge.launchpad.net/ubuntu/+source/libgnome-keyring/+bug/55407717:39
ubottuUbuntu bug 554077 in libgnome-keyring "gkr-operation assertion failures from dbus-using, multithreaded Python apps" [Undecided,New]17:39
askidjhfgstatik: Na, I don't think I'll bother paying for online file syncing.17:39
duanedesignstatik: i moved the Ubuntu One, CouchDB, Desktopcouch Projects wiki page from my wiki to the Ubuntu wiki. https://wiki.ubuntu.com/UbuntuOne/ThirdPartyProjects17:51
statikduanedesign, thanks!18:01
statikduanedesign, are you doing anything in summer of code?18:01
duanedesignstatik: i am not. It sounds like a lot of fun though.18:23
ryereboot!18:28
titeuf_87I have a small question about ubuntu one: can I see what databases in couchdb are synchronized? Or see what is all stored on the ubuntu one's servers?18:35
solexioushonk18:47
solexiousWhats the best way to remove ubuntu one, and all config's and files and start again?18:48
solexious(from one connected computer, other connected computers with my account are fine)18:49
duanedesignsolexious: hello20:16
solexiousduanedesign: hia20:19
duanedesignsolexious: https://answers.launchpad.net/ubuntuone-client/+faq/77820:23
=== kklimonda is now known as kklimonda|G1
solexiousduanedesign: thanks20:26
rickspencer3CardinalFang, hey21:29
rickspencer3can I ask you a quick question about using desktopcouch?21:30
CardinalFangrickspencer3, sure.21:30
rickspencer3CardinalFang, ok, my proximate goal is to get a list of unique record types from a database21:31
rickspencer3I think I need to map_js = select the record type from each record21:31
rickspencer3then21:31
rickspencer3reduce_js = take the list of record_types, and return the unique list21:32
rickspencer31. sound approach?21:32
CardinalFangrickspencer3, yes, that sounds perfect.21:32
rickspencer32. How do I do the reduce_js? is there a unique() like sum()21:32
rickspencer3?21:32
CardinalFangHrm, I'd put items in a assoc-list / dictionary with key of record types and valuse of null.21:34
CardinalFangLet me eyeball the reduce interface.21:34
CardinalFang...21:34
rickspencer3it hated this, btwL21:35
rickspencer3 (500, ('compilation_error', 'expression does not eval to a function. (function(record_type) return unique(record_type))'))21:35
CardinalFangI think you need braces around the body.21:36
rickspencer3CardinalFang, do yo know where the functions I am allowed to use in the reduce function are defined?21:41
CardinalFangHah.21:41
rickspencer3for instance, where is sum() defined as a valid function to call in the reduce function?21:41
rickspencer3I21:41
rickspencer3m hoping this tells me what to use for "unique()"21:41
rickspencer3or do I go:21:42
rickspencer3unique view = []21:42
rickspencer3if result not in unique view21:42
rickspencer3unique view.append(result)21:42
rickspencer3like, put a loop in the reduce function?21:42
rickspencer3(sorry, I really have no clue how I am supposed to approach this)21:43
CardinalFangOkay, I think you should have your map() function return the record_id as the key.  Then, I'd use the built-in grouping.  Create the view.  Then execute the view with extra param,  group=True .21:46
CardinalFangThis avoids your question about a reduce function, though.21:46
rickspencer3CardinalFang, uh21:47
rickspencer3does this map function return the record_id as the key?21:48
CardinalFangYes,  The pair { record_id, null } will suffice21:48
CardinalFangSorry.21:48
CardinalFangRecord_type.21:48
CardinalFangThat's what you want.21:49
rickspencer3map_js = """function(doc) { emit(doc.record_type, null) }"""21:49
CardinalFangYes.21:49
rickspencer3ok21:49
rickspencer3so then just NULL for the reduce_js21:49
CardinalFangYes.  None.21:50
rickspencer3and then add group=True when I do execut_view21:50
rickspencer3this sounds doable21:50
CardinalFangExactly.21:50
rickspencer3on more quick question ...21:50
rickspencer3what is the design_document for?21:50
rickspencer3I don't know how to name it, as I don't know what it's for :/21:50
CardinalFangIt's a place to group functions that are similar.  A library name, so to speak.21:51
CardinalFangrickspencer3, the default in desktopcouch is to name it the same as the function.21:51
rickspencer3so like a namespace21:51
rickspencer3to tell other developers what you are using the view for?21:52
CardinalFangYes.  Or schema or whatever the kiddie DBAs say these days.21:52
rickspencer3I'll go give this a try21:52
CardinalFangEr, yes, maybe.  It's a step to help organize.  How one uses it is a social question.21:52
rickspencer3frig21:55
rickspencer3can't use group for "non reduced views"21:55
rickspencer3:/21:55
CardinalFangCrapshit.21:55
CardinalFangOkay, one minute.21:56
CardinalFangreduce func:  """function(keys, values) { return null; }"""21:57
rickspencer3sneaky21:57
rickspencer3woiks!21:58
CardinalFangSweet.21:58
rickspencer3CardinalFang, is it considered rude of my to leave views in databases I didn't create?21:59
CardinalFangrickspencer3, probably.  If you name the design document with something descriptive, no one should care.  com.canonical.rickspencer.uniq or something.22:00
rickspencer3ok22:01
CardinalFangrickspencer3, the indexes on views are built at insert time of the records (amortized), or at insert time of the design doc (all at once).  There's a benefit to leaving them around if you're using it often.22:02
rickspencer3ok22:02
rickspencer3well, I am building a developer tool22:03
rickspencer3so I'll leave them for now22:03
CardinalFangRgr.  I'm out.  Have a nice weekend, rickspencer3 .22:06
rickspencer3bye bye22:07
rickspencer3thanks CardinalFang22:07

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!