Camelia, the Perl 6 bug

IRC log for #mojo, 2013-09-20

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

All times shown according to UTC.

Time Nick Message
00:28 memowe_ joined #mojo
00:47 asarch joined #mojo
00:55 KindOne joined #mojo
01:21 sri joined #mojo
01:27 KindOne joined #mojo
01:37 TitanOfOld joined #mojo
01:52 MisterHatt joined #mojo
01:53 shmuel joined #mojo
02:01 d4rkie joined #mojo
02:01 HtbaaPi joined #mojo
02:02 laouji joined #mojo
02:11 egopro joined #mojo
02:40 shmuel joined #mojo
02:49 laouji joined #mojo
02:49 dvinciguerra joined #mojo
02:56 laouji joined #mojo
02:56 laouji_ joined #mojo
03:03 preflex_ joined #mojo
03:18 d4rkie joined #mojo
03:31 shmuel joined #mojo
03:53 dqw joined #mojo
03:53 tempire fingerprints!
03:54 SmokeMachine joined #mojo
03:54 good_news_everyone joined #mojo
03:54 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/txZcgQ
03:54 good_news_everyone mojo/master 83a2022 Sebastian Riedel: added siblings method to Mojo::DOM
03:54 good_news_everyone left #mojo
03:55 * sri fingerprints tempire
03:55 * tempire squeals
03:56 shmuel joined #mojo
03:56 sri something something terrorism
03:59 egopro joined #mojo
04:01 preflex_ joined #mojo
04:12 laouji joined #mojo
04:29 shmuel joined #mojo
05:05 basic6 joined #mojo
05:12 two_tired joined #mojo
05:17 dqw2 joined #mojo
05:21 egopro joined #mojo
05:23 dotandimet joined #mojo
05:39 damaya joined #mojo
05:41 damaya Question: I am trying to get data from 10 URLs that are of type text/plain. I am doing this use parallel non-blocking requests and trying to render the output from the pages to the screen. However, I am only getting the output from the first page.
05:42 damaya I've attempted this in many ways, here's my most recent: http://pastebin.com/EmMzgP5u
05:42 damaya I prefaced my first sentence with "Question" when it was in fact not a question. Here's the question: How exactly can I accomplish this?
05:44 dqw3 joined #mojo
05:47 good_news_everyone joined #mojo
05:47 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/9N4KpQ
05:47 good_news_everyone mojo/master 3609300 Sebastian Riedel: added flatten method to Mojo::Collection
05:47 good_news_everyone left #mojo
05:52 sri damaya: http://mojolicio.us/perldoc/Mojoliciou​s/Guides/Cookbook#Backend_web_services
05:52 damaya ok, odd, I had to set the type as json rather than data or text for render(); and now I get everything.
05:53 damaya Thanks for the link sri, that's good stuff
05:54 sri either you're using a server that doesn't support parallel non-blocking, or it can't work
05:54 damaya I am using morbo.
05:55 damaya no, it works perfectly fine if I do $self->render(json => \@titles); but does not work if I do it any other way.
05:55 sri then you pasted different code
05:56 damaya Ah, yes... the code is always changing.
05:57 damaya God damn I love, love, love Mojolicious
05:57 damaya later, gonna go read the Backend_web_services link you gave me
05:57 sri :)
06:03 n0n joined #mojo
06:06 dqw3 joined #mojo
06:11 dotandimet1 joined #mojo
06:20 Vandal joined #mojo
06:22 marcus wsri: Why not both?
06:23 marcus I was actually thinking iPhone + new Nexus 7
06:23 marcus as my new combo
06:30 damaya Is it possible to render json data as plain text? The escaping and whatnot is somewhat messing up what I am trying to do with it.
06:31 damaya But, when I try to render as text I get: ARRAY(0x8c3fb00)
06:32 damaya As JSON it escapes and adds a bunch of newlines for some reason (literally \n)
06:40 batman damaya: why do you want to do that?
06:40 damaya datatables
06:41 damaya I am using server-side processing and outputing the json, but it has to be plain text, something like Data::Dumper would give, or with CGI printing a json::xs encoded array of hashrefs.
06:41 batman when is json not plain text?
06:42 damaya I mean it has to be not escaped with \n's all over the place
06:42 damaya for some reason datatables croaks on it
06:43 damaya I have another set up using CGI and pretty printing with json::xs to the browser, and that works perfectly fine... but if I do not pretty print (i.e., I get what I am getting with mojo), then datatables croaks
06:46 batman datatables?
06:46 damaya ohh, a jquery plugin
06:46 damaya it's no big deal, I can figure it out
06:46 damaya just wanted a print pretty on JSON text ;D
06:47 batman you never want to pretty print your raw data.
06:47 batman use a browser plugin to do that
06:47 batman datatables must be messed up. i would rather fix datatables instead of messing up the origin json
06:48 damaya I am going to fix datatables.
06:49 batman sane solution. messing up the output from mojo will get you into trouble later on
06:49 batman at least if you ever want to use the data for something else
06:50 batman i'm seeing a lot of stackoverflow discussions about datatables and json. you probably want to look at those
06:51 damaya Ahh, I see what is messing it up! It's not what I was thinking.
06:52 damaya OK, glad it's not that.
06:52 batman :)
06:53 damaya :P
06:54 dqw3 joined #mojo
06:56 basiliscos joined #mojo
06:59 gtodd joined #mojo
07:11 egopro joined #mojo
07:20 dotandimet joined #mojo
07:32 hrupp joined #mojo
07:33 trone joined #mojo
07:37 McS joined #mojo
07:37 McS Hoi alltogether
07:39 McS I try to use a lite app as cgi, I set app->mode('production');, but it's still writing debug to apache error.log. Do you have a hint for me?
07:42 basiliscos joined #mojo
07:45 batman McS: app->log->level('info');
07:45 batman or $ENV{MOJO_LOG_LEVEL} = 'info';
07:48 McS batman: Thanks a lot (again :-)
07:48 batman :)
07:54 Lee joined #mojo
08:01 fhelmber_ joined #mojo
08:15 mire__ joined #mojo
08:23 dod joined #mojo
08:27 themage joined #mojo
08:38 dpetrov_ joined #mojo
08:41 maxhq joined #mojo
08:51 nic Anyone tried out p5-mop?  Looks like it's ready for tasting
08:52 nic Only thing making me hesitate is the lack of an 'exists' test
09:01 HtbaaPi joined #mojo
09:11 batman exists?
09:21 nic You can't tell the difference between has-value-undef and has-never-had-a-value
09:24 batman right. not sure if i'm a huge fan.
09:33 nic (I'm not dissing it, merely curious how Mojolickers are adapting to it)
09:54 denis_boyun joined #mojo
09:55 dod joined #mojo
09:56 basiliscos joined #mojo
09:57 McS joined #mojo
09:58 ver joined #mojo
10:03 kwa joined #mojo
10:04 Vandal joined #mojo
10:04 kwa Howdy, I know no one missed me, but I'm back after 10 weeks paternity. :P
10:05 kwa sri: Interesting to see your detach example on twitter after hearing your lack of love for it on here. :)
10:16 punter joined #mojo
10:28 yakudza joined #mojo
10:39 dod joined #mojo
10:57 marcus nic: If it goes into the perl5 core, surely we will support it.
10:59 denisboyun joined #mojo
11:10 nic kwa: That sounds good. Is 10 weeks common there? (Only 2 weeks here, but you can swap-in some of the mother's leave.)
11:11 nic marcus: Have you tried it yet?
11:11 kwa nic: Not common. I'm in the UK and only get 2 weeks, had to take more time off because the misses had a c-section and was immobile for a bit. :/
11:11 asarch joined #mojo
11:11 marcus nic: Not the redux version no, I did work a little bit on the abandoned first version. I did read the articles tho
11:12 judioo left #mojo
11:13 nic kwa: ah, that sounds tricky. Hope she's good now. Best wishes to your family
11:14 kwa nic: Cheers fella. She had to walk upstairs backwards for a couple of weeks because of the pain, but can do "post pregnancy squats" so everything is good now I think. :)
11:22 n0n joined #mojo
11:45 sixBB joined #mojo
12:44 ryozi joined #mojo
13:06 zivester joined #mojo
13:32 n0n joined #mojo
13:49 mire__ joined #mojo
13:52 bowtie_ joined #mojo
14:00 dqw3 joined #mojo
14:17 fhelmbe__ joined #mojo
14:24 zeep joined #mojo
14:27 McS Tonight I am going to deploy my first mojo lite app :-) Thank You all for Your help!
14:27 dqw4 joined #mojo
14:29 nic \o/
14:29 nic Tonight I am going to be Donna Summer
14:31 sri any thoughts on the latest additions? https://github.com/kraih/mojo/compare/3e8​9db40bf5fa947b05199cbc43457a3fa7752aa...3​6093007f667cbab3a10cd2b39bc27182dffb8d6
14:32 Vandal joined #mojo
14:33 hummeleBop joined #mojo
14:36 gryphon joined #mojo
14:36 tianon sri: +1 for siblings :D
14:42 hummeleBop joined #mojo
14:43 hummeleBop joined #mojo
14:56 batman why is _flatten a function?
15:08 d4rkie joined #mojo
15:10 sri batman: if you can make it shorter be my guest
15:11 batman sri: i just don't get why the _flatten code isn't inside flatten() instead :(
15:11 sri recursion
15:13 batman bah!
15:13 * batman cleans his glasses
15:15 sri btw. siblings() is once again stolen from jquery
15:17 basiliscos joined #mojo
15:21 sh4 joined #mojo
15:24 sri slowly running out of things to steal from jquery :o
15:26 n0n joined #mojo
15:28 denisboyun joined #mojo
15:29 tianon sri: that's what makes Mojo::DOM so comfortable to use - I already know most of the methods, but this time they're in Perl, so <3 :)
15:30 sri :)
15:44 nic batman: That's a cool pic on the About page -- not sure about the one of markus tho :)
15:45 batman nic: why not the one about markus?
15:45 batman :)
15:45 batman nic: it's our facebook pictures...
15:46 nic Does Lionel know he's mispelling "YOU'RE"?
15:46 batman lionel?
15:46 nic Mr Ritchie
15:47 * batman is lost
15:47 nic "Is it me your looking for?"
15:48 nic The man whose image you're abusing :D
15:50 batman haha! right :D
15:50 batman sorry. i'm not the best task switcher :/
15:51 batman we where not aware of that until now.
15:52 nic not sure it matters
15:52 batman i was supposed to read the posters before we printed them, but then suddenly we ran out of time
15:52 batman *then we
15:52 batman no, i'm 100% sure it doesn't matter. except for me and markus :)
15:52 nic it might actually be funnier/better with the typo
15:53 nic but s/continouse/continuous/ -- that's going to break your app
15:53 batman where's that typo?
15:53 batman about page?
15:54 nic I think so (I've closed the tab)
15:54 nic near "integration"
15:54 batman i think it's the blog
15:54 nic true
15:55 batman i will let markus know :)
15:57 batman so...can i poke you next i need someone to proof read nic? ;)
15:59 nic it's all I'm good for
15:59 batman haha
15:59 batman sweet ;)
15:59 batman i need to make dinner.
15:59 batman thanks 1e6 for the feedback
16:03 tianon not to be confused with 1d6 :)
16:11 batman hehe
16:20 sri btw. flatten() is for stuff like this
16:20 sri perl -Mojo -E 'say g("mojolicio.us")->dom->find("h1, h2, h3")->ancestors->flatten->type->uniq'
16:20 sri this one gets you all the unique ancestor types for header elements
16:20 sri ->find()->ancestors() results in a collection of collections
16:30 nic sri++ # it's fantastic that we have that power
16:33 sri \o/
16:37 sri batman: wirc is down :O
16:54 marcus joined #mojo
16:55 wsri joined #mojo
17:06 dvinciguerra joined #mojo
17:16 dod joined #mojo
17:18 KindOne joined #mojo
17:38 btyler joined #mojo
17:53 Gedge joined #mojo
18:07 mire__ joined #mojo
18:23 * sri still wonders if the documentation browser should have a source link
18:25 sri biggest problem is still that i have no clue where to place it :o
18:38 senthil joined #mojo
18:43 dotandimet joined #mojo
18:49 tianon sri: for what it's worth, I would use it a lot - I love looking at the beauty that is the source of Mojo <3
18:49 tianon you do good work :)
18:49 tianon can't be stated enough :P
18:51 sri http://files-cdn.formspring.me/ph​otos/20130520/n519ab79fa4dbc.png
18:51 senthil hi all ..
18:52 senthil does anyone know how to deploy mojolicious project in openshit
18:52 jzawodn hah
18:56 senthil I tried this https://github.com/degtyarev-​dm/mojolicious-lite-openshift ..
18:56 senthil but no luck
18:56 tianon rofl
19:02 senthil left #mojo
19:12 * tempire thinks the pod browser should have a source link
19:15 sri BUT WHERE?!
19:25 Lee joined #mojo
19:36 human39 joined #mojo
19:37 asarch joined #mojo
19:39 fildon joined #mojo
19:45 marty joined #mojo
19:54 jnbek joined #mojo
19:58 marcus Sri: everywhere!
20:03 sri marcus: that actually gave me an idea ;p
20:04 KindOne joined #mojo
20:05 human39 joined #mojo
20:26 human39 joined #mojo
20:32 good_news_everyone joined #mojo
20:32 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/sQhF8A
20:32 good_news_everyone mojo/master 1b080a1 Sebastian Riedel: improved documentation browser with source links
20:32 good_news_everyone left #mojo
20:33 sri http://mojolicio.us/perldoc/Mojolicious/Lite # right at the top
20:34 sri when marcus said everywhere... i thought it might be nice to be able to jump to parents
20:38 tianon <3!
20:38 rem_lex| joined #mojo
20:40 good_news_everyone joined #mojo
20:40 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/PHQ0Nw
20:40 good_news_everyone mojo/master 29b23bf Sebastian Riedel: make documentation links look more Perl-ish
20:40 good_news_everyone left #mojo
20:43 sri wish we could do more for navigation... like a module name live search box... but POD tools are rather limited
20:47 good_news_everyone joined #mojo
20:47 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/bFdMOw
20:47 good_news_everyone mojo/master b89e101 Sebastian Riedel: better start with the guides
20:47 good_news_everyone left #mojo
20:49 sri just noticed this little gem... https://github.com/kraih/mojo/bl​ob/master/lib/Test/Mojo.pm#L304
20:49 sri wonder if it should be moved to Mojo::Message as a public method
20:50 * sri can't think of a name that doesn't suck though
20:50 sri $res->decoded_body :S
20:51 sri the code actually exists twice... so making it public would be less code
21:04 good_news_everyone joined #mojo
21:04 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/cM3FNA
21:04 good_news_everyone mojo/master 3297522 Sebastian Riedel: added decoded_body method to Mojo::Message
21:04 good_news_everyone left #mojo
21:05 sri BETTER HELP ME FIND A NEW NAME!
21:07 Adura db
21:09 good_news_everyone joined #mojo
21:09 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/dHEzJg
21:09 good_news_everyone mojo/master 5fc9b8a Sebastian Riedel: mention how the charset is extracted
21:09 good_news_everyone left #mojo
21:14 sri perhaps something in the spirit of ->extract ->transform... you get the idea
21:15 Adura Mine has much less characters.
21:15 sri db is totally not confusing
21:17 tianon entire databases transferred using Mojo::Message :D
21:17 tianon client-side storage, anyone? :)  "please leave your browser open - you're now part of our distributed database network"
21:17 Adura The cloud.
21:19 tianon it's web scale! \o/
21:20 sri hmm... not used much http://grep.cpan.me/?q=sub+decoded_
21:23 Adura Dang, mo.jobs is already registered.
21:24 sri ->text_body
21:24 sri ->text
21:24 * sri starts to like that
21:24 sri if we can decode it then it has to be some kind of text
21:25 sri goes well with ->json  and ->dom
21:25 Adura Hmm, someone owns mo.jo, it seems.
21:27 tianon sri: ->text sounds pretty darn slick to me, and will make for beautiful one-liners through ojo ;)
21:29 good_news_everyone joined #mojo
21:29 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/1PXvEg
21:29 good_news_everyone mojo/master 0ad8bf8 Sebastian Riedel: renamed decoded_body method to text
21:29 good_news_everyone left #mojo
21:30 good_news_everyone joined #mojo
21:30 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/n2jkUg
21:30 good_news_everyone mojo/master 536f6ad Sebastian Riedel: mention text method in Mojolicious::Controller
21:30 good_news_everyone left #mojo
21:32 sri \o/
21:33 tianon now we need a pretty one-liner to get some project gutenberg "text" :D
22:19 dweeble joined #mojo
22:19 dweeble I have URLs in a page that look like this "<a href="http://..."
22:19 dweeble damn keyboard
22:20 dweeble <a href="http://..." target="ui">text</a>
22:20 dweeble I am trying to extract the url from URLs where target is ui. I am wondering how this is done with Mojo::UserAgent.
22:21 dweeble Also, the URL has a question mark in it and the question mark and everything after is getting cut from JSON output.
22:25 dweeble Basically this: $tx->res->dom('a[href]')->each, but saying ('a[href] target=ui').
22:27 rem_lex| joined #mojo
22:29 sri that's a css selector question... a[href][target="ui"]
22:46 dweeble hrmph
22:53 dweeble Sorry, my question is how to get the URL itself, because I am getting all sorts of other crap too.
22:53 dweeble And I want to normalize the url too.
22:54 dweeble $end->($tx->res->dom('a[href][target="UI"]')); has been working, but not getting just the link "http://..."
22:54 dweeble I was not very clear/
22:55 go|dfish ->each( sub { say $_->{href} } )
22:56 dweeble ohh, you're hot
22:58 dweeble meh, using this $end-> in non-block asynch requests I don't know how
22:58 dweeble to return each url that is
22:58 dweeble bye
23:19 dweeble $end->($self->ua->get($url => \&get_callback)); and callback is actually printing URLs to debug terminal (morbo)... interesting, but not sure how to return them still.
23:19 dweeble getting closer though ;)
23:20 dweeble return them to this: my $delay = Mojo::IOLoop->delay(sub { my ($delay, @links) = @_; $self->render(json => \@links); });
23:20 dweeble that is
23:57 good_news_everyone joined #mojo
23:57 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/8LcOlQ
23:57 good_news_everyone mojo/master 00c420b Sebastian Riedel: more consistent examples
23:57 good_news_everyone left #mojo

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