Camelia, the Perl 6 bug

IRC log for #mojo, 2013-02-07

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:04 sri marty: i've added $cursor->count
00:04 marty \o/
00:05 marty sir yer awesomer
00:05 sri not sure about semantics yet though
00:05 marty sri even
00:05 * marty looks
00:05 sri the perl driver does ->count; and ->count(1);
00:05 sri first includes skip/limit, the other doesn't
00:06 sri so if you set a limit of 10, you won't get a higher count than 10
00:06 marty Interesting.  I did not know that.  I just eliminated the query in my code and ran count on a find() if I needed total count.  For all others i just get it from the array
00:07 marty that could be usefull
00:07 sri currently i only support "count everything and ignore skip/limit"
00:07 marty that's ok with me.
00:08 sri ->count(1, sub {}) looks stupid
00:08 * marty nods
00:09 sri ->count and ->count_all perhaps :S
00:09 marty that looks pretty good
00:09 sri skip value makes kinda sense, but i don't get why it submits limit
00:11 sri limit seems to only limit the number of documents we can fetch with one message
00:11 sri but not overall
00:12 * sri shrugs
00:12 marty ya, seems weird
00:12 marty ^O^
00:13 sri oh, i got it wrong, it's the other way around, the argument indicates that skip and limit *should* be used
00:14 sri ruby driver seems to support it too, node.js not
00:14 steveo_mich joined #mojo
00:14 marty Ahh ok, that makes more sense
00:14 sri i got it wrong because the argument is called $all -.-
00:14 marty You were correct about everything except your assumptions.  :)
00:15 sri and i discovered another inconsistency ;p
00:15 Molaf_ joined #mojo
00:15 sri most commands go like command(name => 1, arg1 => ...)
00:16 * marty nods
00:16 sri the count command is command(count => $collection_name, arg2 => ...)
00:16 marty any idea why?
00:16 sri soooo... ->command($doc) now also works :p
00:17 marty woo hooo
00:17 sri nobody cared i suppose
00:17 sri i was wondering why their coding guidelines had so strict rules about new commands now :)
00:19 sri pretty sure for a time mongodb was just an -Ofun project and everybody got to commit whatever they like, so stuff is inconsistent and filled with bad code, now they are busy cleaning up
00:21 marty Sounds right.  Even things like the docs are getting cleaned up a bit
00:30 sri one big open design problem is still the single flag for ->delete and the upsert/multi flags for update
00:31 sri s/delete/remove/
00:32 * marty looks at mongo wire protocal
00:32 marty protocol even
00:32 sri i guess it has to be $collection->remove({...}, {single => 1})
00:33 sri and $colelction->update({...}, {...}, {upsert => 1, multi => 1})
00:33 marty Those actually pretty good to my eyes
00:45 tagg joined #mojo
00:47 mire joined #mojo
00:49 xaka people got used to it since perl driver so i think it's not as bad as it might look like
00:52 jzawodn joined #mojo
01:13 ka2u joined #mojo
01:39 Miked joined #mojo
01:42 bluescreen joined #mojo
01:52 mattastrophe joined #mojo
02:00 d4rkie joined #mojo
02:16 TitanOfOld joined #mojo
02:29 xaka joined #mojo
03:00 sri and single/multi/upsert are working too now :)
03:02 marty you my good fellow, are a machine.  :)
03:02 marty sri++
03:02 sri yay for machines \o/
03:02 marty talk about a productive day, whew
03:03 * marty is syncing his mango and notices sri has 13 commits today.
03:03 * marty shudders
03:04 sri not many lines that didn't change today :)
03:25 ka2u joined #mojo
04:01 * marty is having trouble getting ->limit to work
04:12 sri i probably implemented it wrong
04:14 sri i was expecting it to be a server side limit, but that might not be the case
04:14 marty ahhh.  ok.
04:14 marty so I guess that was my first official mango bug report.  :)
04:14 sri i have no clue how it works
04:15 sri please include how it should work in your bug report ;p
04:15 marty lol
04:20 marty yep, according the wire protocal page, limiting the number of returned documents is up to the driver
04:26 sri hmm
04:45 Miked joined #mojo
04:45 sri ah, looks like the official driver might be broken, that's why i mixed up batch_size and limit
05:03 ka2u joined #mojo
05:14 rem_lex| joined #mojo
05:14 ka2u joined #mojo
05:39 sri marty: limit should be working now :)
05:42 spleenjack joined #mojo
05:42 sri now i think it makes sense again to include skip/limit on ->count though
06:04 connor_goodwolf joined #mojo
06:04 sivoais_ joined #mojo
06:25 ver joined #mojo
06:40 yakudza joined #mojo
06:52 * tempire installs mango
06:56 * crab eats mango, though it's out of season
07:00 Vandal joined #mojo
07:09 Mike-PerlRecruiter_ joined #mojo
07:13 * sri eats a mango granola bar
08:04 spleenjack joined #mojo
08:19 ACE joined #mojo
08:19 ACE hi there
08:20 ACE i have a question to mojo
08:20 ACE can you answer me?
08:22 dod joined #mojo
08:24 dod joined #mojo
08:31 dod joined #mojo
08:31 pierrick joined #mojo
08:42 ObseLeTe joined #mojo
08:42 Britzel ACE: http://www.urbandictionary.com​/define.php?term=metaquestion
08:50 daxim joined #mojo
08:56 ComLock joined #mojo
09:04 fhelmber_ joined #mojo
09:07 hmepas joined #mojo
09:09 hmepas Hey guys, there is two usefull features I am trying to put together, first is bridges I am using for authorization and the 2nd is resourceful routes which i am using to edit objects in authorized area. The problem is, I can't create resourceful routes under the bridge. Seems like trivial feature, so may be I am just doing it wrong?
09:15 xxtjaxx wircus: Do you have a mail/Jabber account?
09:17 wircus xxtjaxx: marcus@nordaaker.com
09:26 xxtjaxx wircus: Thats Mail?
09:26 wircus yupp
09:27 xxtjaxx Cool
09:32 nicomen joined #mojo
09:43 ACE Britzel: thx
09:47 nelio joined #mojo
10:09 mugenken joined #mojo
10:12 xxtjaxx wircus: you should have mail in a bit.
10:13 mire joined #mojo
10:14 suy joined #mojo
10:24 ka2u_ joined #mojo
10:58 drift joined #mojo
11:16 SmokeMachine joined #mojo
11:27 drift joined #mojo
11:34 drift joined #mojo
11:37 ka2u joined #mojo
11:45 ObseLeTe joined #mojo
11:46 ObseLeTe joined #mojo
11:47 drift joined #mojo
11:57 dbr joined #mojo
12:01 drift joined #mojo
12:25 marty sri++
12:25 marty limit is working perfectly
12:47 hmepas2 joined #mojo
12:57 SmokeMachine joined #mojo
12:58 Miked joined #mojo
13:00 SmokeMac_ joined #mojo
13:04 moltar joined #mojo
13:29 marty joined #mojo
13:37 dhg joined #mojo
13:41 inokenty joined #mojo
13:43 D4RK-PH0ENiX joined #mojo
13:49 Britzel_ joined #mojo
13:53 marty boolean values and automatic stringification of oid in mango are working wonderfully!  saving me sooo much time.
14:01 mire joined #mojo
14:31 dod joined #mojo
14:32 gryphon joined #mojo
14:56 sri \o/
14:57 sri marty: i wasn't sure how to stringify oids for JSON
14:57 marty Then you made a pretty good guess.   They are working perfectly on my setup.
14:57 sri official drivers have a TO_JSON thingy that results in {'$oid' => "1234567890"}
14:58 SmokeMachine joined #mojo
14:58 * marty nods
14:58 TitanOfOld joined #mojo
15:00 dhg joined #mojo
15:01 dod joined #mojo
15:07 dbr joined #mojo
15:07 ka2u joined #mojo
15:09 sri tempire: didn't you say you would make a new screencast if i released a mongodb client? :D
15:10 Molaf__ joined #mojo
15:10 inokenty =)
15:10 inokenty tempire: please make a new mojocast!
15:12 mire joined #mojo
15:16 vervain Anyone familiar with Mr. Wo on our e-mail list ( trying to give away books ).  This smacks of social engineering to me.
15:20 sri oh, i've not seen that thread yet
15:23 Pizentios joined #mojo
15:23 Pizentios good morning
15:25 sri vervain: i'm ending the thread
15:26 vervain sri++
15:28 HtbaaPi_ joined #mojo
15:34 bluescreen joined #mojo
15:35 good_news_everyone joined #mojo
15:35 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/E_y7Lw
15:35 good_news_everyone mojo/master 0cc36c0 Sebastian Riedel: no more smartmatch
15:35 good_news_everyone left #mojo
15:36 d4rkie joined #mojo
15:37 sri odds are that will generate a deprecation warning in 5.18
15:39 dod joined #mojo
15:46 xxtjaxx Maybe I'm opening a can of worms. But whats Mango?
15:48 xxtjaxx sri: Do you have a macro for feature request answers on github?
15:53 sri http://www.infoq.com/news/2013/0​2/MongoDB-Fault-Tolerance-Broken # for those following the hyperdex drama
15:54 sri this is mango https://github.com/kraih/mango
15:58 r0b3rt joined #mojo
15:59 steveo_mich joined #mojo
16:00 jberger sri: mojo was the only project that I knew that actually used smartmatch. I was wondering how long you would keep it. Probably the best choice.
16:00 sri it was used in more places in the past
16:01 sri the next incarnation of smartmatch was supposed to keep regex and sub matching the same, so i kept those two
16:02 sri but nobody implemented that, so it might just get deprecated now
16:03 jberger honestly I think thats best, or else the simplified version someone proposed (was it rjbs?)
16:03 sri ye
16:03 jberger I never use it, 1) because I never know what its supposed to do on which version and 2) fear of that getting worse in the future
16:04 jberger sounds like a dead feature to me
16:04 jberger I mentioned it in my response to the Perl 7 stuff yesterday
16:07 tempire I did, didn't I?
16:07 tempire Of course, that was before it was a reality :)
16:07 tempire When I get settled in to my new crib, I'll look into it.
16:08 * sri releases Mango 0.02 in the meantime
16:08 sri tempire++
16:09 Mad_Dud joined #mojo
16:09 ka2u joined #mojo
16:10 dhg joined #mojo
16:11 * sri wonders how to test tailable cursor support
16:11 * marcus ponders some small open source project to show off mango.
16:12 sri just don't forget to read the disclaimer :) https://metacpan.org/module/Mango#DESCRIPTION
16:14 marcus sri: yeye, I will blame you when you change the smallest thing and quit in a huff.
16:14 marcus disclamers are for girls.
16:14 sri i guess whatever tempire uses in the mojocast will be stable though :o
16:14 marcus :D
16:20 ComLock joined #mojo
16:22 labrown joined #mojo
16:26 yakudza joined #mojo
16:36 mugenken joined #mojo
16:40 SmokeMachine joined #mojo
16:44 ka2u joined #mojo
16:49 nuba joined #mojo
16:50 sri the list of features mango has but the official perl driver doesn't is growing :)
16:57 bpmedley_ joined #mojo
17:07 xaka joined #mojo
17:13 SmokeMachine joined #mojo
17:16 dod joined #mojo
17:19 ka2u joined #mojo
17:32 hmepas joined #mojo
17:32 marty mojo + mango + mongo = mmm
17:33 sri mangolicious
17:34 laidback_01_work joined #mojo
17:38 ka2u joined #mojo
17:41 vervain sri: How did you resist the name pongo?
17:41 sri d'oh!
17:44 dod joined #mojo
18:07 laidback_01__work joined #mojo
18:08 sri hmm, ->batch_size(...)->sort(...) seems odd
18:11 sri ah, seems to be a known bug
18:21 SmokeMachine joined #mojo
18:35 sri has anyone tested mango on windows yet?
18:36 * sri would really like to know if 32bit activeperl and strawberry support quads
18:38 sri perl -MConfig -E 'say !!(($Config{use64bitint} // "") eq "define" || $Config{longsize} >= 8)'
18:39 sri perl -E 'say unpack "b*", pack("q<", 23)'
18:39 sri perhaps someone can run thsese two oneliners to test it for me? :)
18:43 Vandal http://www.sandraandwoo.com/
18:57 HtbaaPi happy to announce the birth of a new Mojolicious powered website: http://www.keukens.nl!
18:58 sri HtbaaPi++
18:58 HtbaaPi very happy with using Mojolicious for it. For once doing a website/app was fun again
18:59 HtbaaPi though at the moment I'm a bit less happy about the response times, but for that I've got to blame the database stuff. Will be optimized though!
18:59 HtbaaPi so Mojolicious is not at fault there :P
19:00 marty HtbaaPi++
19:08 jberger HtbaaPi++
19:08 jberger it looks great, can you comment on the layout/style/template/whatever?
19:09 Mike-PerlRecruiter_ joined #mojo
19:10 sr joined #mojo
19:13 HtbaaPi jberger: thanks. The design was done by someone else. I've used a combination of normalized.css and Twitter Bootstrap for sanity (CSS)
19:14 HtbaaPi not using any fancy HTML5 stuff yet. Templating engine is EPL, I really like that one a lot
19:15 HtbaaPi database backend is MySQL (mostly because of legacy reasons) and it uses Redis to keep track of click counts of several things such as asking for a phonenumber and such
19:15 wircus HtbaaPi: Nice kitchens
19:16 HtbaaPi wircus: yeah it's a website for companies who build, sell or install kitchens
19:17 HtbaaPi my client earns his money with selling ads on the website as well as extended profiles
19:18 HtbaaPi the previous website (which was REALLY old) was owned by the company I work for, but sold it a couple of years to the current client. Which in turn has let us develop the new website :)
19:22 pierrick sri: C:\Windows\System32>perl -MConfig -E "say !!(($Config{use64bitint} // '') eq 'define' || $Config{longsize} >= 8)" result:  1
19:23 pierrick C:\Windows\System32>perl -E "say unpack 'b*', pack('q<', 23)"  result : 11101000000000000000000000000000​00000000000000000000000000000000
19:23 sri pierrick: thanks! is that strawberry 32bit?
19:23 pierrick sri: no 64bit
19:24 sri ah, ok, then the result is expected :)
19:24 pierrick good :)
19:25 pierrick i can test on a 32bit version too if you need
19:25 sri that's exactly what i need ;)
19:26 pierrick ok i give you the result soon
19:30 yko joined #mojo
19:34 dhg joined #mojo
19:35 yko joined #mojo
19:45 pierrick sri: first oneliner : nothing return, second oneliner return: Invalid type 'q' in pack at -e line 1.
19:48 SmokeMachine joined #mojo
19:48 maxhq joined #mojo
19:50 sri aww :(
19:50 sri pierrick++
19:50 basic6 joined #mojo
19:57 Britzel joined #mojo
19:57 rem_lex| joined #mojo
19:59 nelio joined #mojo
20:10 mire joined #mojo
20:14 SmokeMachine joined #mojo
20:26 lukep joined #mojo
21:13 dhg joined #mojo
21:18 xaka joined #mojo
21:35 dhg joined #mojo
22:00 mire joined #mojo
22:00 rihegher joined #mojo
22:01 PanzerBjorn joined #mojo
22:02 PanzerBjorn Hey guys. Question: you can include a partial template with $self->render('name', partial => 1) but is there a way to render from the controller level instead of the template?
22:02 PanzerBjorn I.e. I want to call the partial render on the controller level so that it loads the appropriate data for the template, etc.
22:06 PanzerBjorn The reason for this is that I have an expander in a page whose content is normally not loaded until the user opens the expander, the content is loaded by AJAZ using jQuery, etc. But I want a GET parameter to instruct the content to be pre-loaded into the page along with the rest of the page content so that #anchors in the URL can jump to desired content.
22:06 PanzerBjorn AJAX
22:08 PanzerBjorn Is there a simple way to call a controller from another route from within another controller and have it do a partial render?
22:10 marty PanzerBjorn:  I'm not sure I understand the question but have you looked at bridges?  http://mojolicio.us/perldoc/Moj​olicious/Guides/Routing#Bridges
22:10 PanzerBjorn Yes, I'm using Bridges already, no that's not what I'm asking.
22:11 PanzerBjorn I want to render a partial template at the Controller level instead of at the EP level. I'm asking if there's a simple known way to facilitate that or I should work on rolling my own.
22:13 rihegher Hello
22:14 rihegher I wanted to access the mojo screencast videos but I keep getting a timeout message from http://mojo.elbowrage.com/
22:14 rihegher Do you guys are able to reach this website?
22:16 * sri can confirm that mojocasts appear to be down atm
22:16 marty rihegher:  it's down for me also
22:16 marty are looking for the mojocasts that were done by tempire?
22:16 marty if so.  they are here.    http://mojocasts.com
22:16 Britzel that site is down.
22:17 Britzel At least the video contents.
22:17 tempire the site is up
22:17 tempire looks like the files being hosted by elb0w are gone
22:17 rihegher mojocasts.com is up
22:18 rihegher but the files are hosted on http://mojo.elbowrage.com/
22:18 tempire rihegher: you can watch them by clicking the flash link
22:18 tempire as a temporary solution
22:18 tempire which directs you to vimeo
22:18 mire joined #mojo
22:18 tempire this may present a problem, since I just dropped my media hard drive the other day.
22:19 rihegher Thank you will do
22:20 PanzerBjorn So that's a no on Controller level partial rendering?
22:20 * tempire hopes they're still on the russian server, since the original files are gone.
22:20 rihegher tempire:hope there are not lost
22:21 rihegher It should be possible to get them from vimeo or itunes
22:22 tempire sweet.  russia has saved the day.
22:23 rihegher I wanted to make a presentation of Mojolicious tomorrow morning
22:24 rihegher So it's always better when everything works as expected
22:24 tempire I'll transfer the files and have it working this evening
22:25 rihegher thank you :)
22:25 rihegher I'll use vimeo if it's not but it everything is back to normal it would be cool
22:27 baton8 joined #mojo
22:29 rihegher left #mojo
22:31 PanzerBjorn So I've gilded my Controller methods with extra framework to accept a partial parameter and render partial back in the return value if partial is requested. Does this sound reasonable to you guys?
22:41 * jberger hums "Back in the USSR"
22:41 PanzerBjorn Hmm, there appears to be an issue with calling another controller from within a controller.
22:45 sri https://github.com/kraih/mango/commit/bfa5a​50fe59a268ef3ca47272f4ed4c1aa528053#L3R250
22:45 sri those methods could use better names i suppose
22:47 PanzerBjorn Is there a way through $self in a Controller to call another Controller in the same application?
22:47 marty sri++
22:48 marty the await_capable method sticks out to me
22:51 sri it's a flag, no method
22:51 marty ahhh, I see.  and it matches the mongo wire name also
22:51 marty my bad
22:51 sri and it's mystery why await_capable is not set for mongohq :/
22:52 marty that seems odd.
22:52 baton8 joined #mojo
22:52 Skylos_ joined #mojo
22:52 PanzerBjorn o/ Skylos
22:53 Skylos_ Hail Panzer
22:53 sri marty: could you add a "warn Dumper $reply;" in sub Mango::_finish and see if it is set for you? :)
22:53 marty ok.
22:53 sri any operation should do
22:56 PanzerBjorn So I'm trying to call another controller to do a partial render from within the routed controller and I don't see a way to do that cleanly. Anyone have any pointers?
22:59 marty sri:  'await_capable' => 1,
22:59 sri nooooo!
23:00 sri wait
23:00 sri marty: did you upgrade to latest version from github?
23:00 marty Um.  nope
23:00 sri ah, that changes everything :)
23:00 sri it was bugged before
23:00 sri phew
23:00 marty hehe. sorry. I'll upgrade now.  :)
23:01 marty sorry for the scare. :)
23:02 * sri nearly got a heart attack
23:03 marty sri:  'await_capable' => 0,
23:04 sri how very odd
23:04 sri marty++
23:04 marty :)
23:04 sri ah, it's because i'm a moron
23:04 sri \o/
23:04 marty \o/
23:07 sri i mixed up bit 3 and 4
23:08 Skylos can you execute a route and get its result in a scalar instead of on an output channel?
23:25 Revlin joined #mojo
23:32 mire joined #mojo
23:33 marty Skylos:  what is it you're trying to accomplish?
23:34 mattastrophe joined #mojo
23:35 Skylos marty - I'm trying to help my friend.  I can't say I'm fully cognizant of what he wants to do.
23:36 Skylos it seems that he has a route that outputs a page segment
23:36 Skylos and he wants to insert that in the processing of a different route entirely.
23:36 PanzerBjorn I want to render a route as a scalar from within another route.
23:36 PanzerBjorn Conditionally.
23:37 PanzerBjorn Think of partial template rendering but at the Controller level instead of an EP template.
23:39 PanzerBjorn Because the controller loads up the data and populates the stash for the template, without calling the Controller the template won't have the data it needs.
23:39 marty Skylos: I suppose you could us mojolicous useragent from within your route and then capture the contents.   http://mojolicio.us/perldoc/Mojol​icious/Guides/Cookbook#USER_AGENT
23:40 marty Maybe use a callback
23:41 Skylos hmm.
23:41 Skylos callback that does what?
23:43 marty http://mojolicio.us/perldoc/Mojolici​ous/Guides/Routing#Route_to_callback
23:43 marty in your callack you can do just about anything you want.
23:45 marty for ecample, call useragent which calls another route.  capture the contents and route to a different route.   I've never done it but I *think* it should be possible.  :)
23:45 marty s/ecample/example/
23:45 Skylos how do you route to a different route?
23:46 marty ahhh ya.  sorry, semantics.  I mean you can render from within the callback
23:47 Skylos but render implies output
23:47 Skylos correct?  It side-effect ships off the results of the template render out the output channel
23:48 marty yes, maybe redirect_to will help.  http://mojolicio.us/perldoc/Moj​olicious/Controller#redirect_to
23:48 Skylos bounces off teh browser though
23:48 Skylos can you redirect internally without hitting the broweser
23:49 Skylos ah, redirect_to(routename)
23:49 Skylos right?
23:49 * marty nods
23:49 Skylos so does it get the path from the definition of the route?
23:49 Skylos or are the routes always defined with paths?
23:50 Skylos using url_for I think I mean
23:51 marty redirect_to can take a named route or a path
23:52 marty http://mojolicio.us/perldoc/Mojoli​cious/Guides/Routing#Named_routes

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary