Camelia, the Perl 6 bug

IRC log for #mojo, 2013-03-07

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

All times shown according to UTC.

Time Nick Message
00:09 egopro joined #mojo
00:17 Mike-PerlRecruiter_ joined #mojo
00:22 MeierM joined #mojo
00:27 alnewkirk joined #mojo
00:45 hesperaux joined #mojo
00:53 shmuel joined #mojo
01:16 hlin joined #mojo
01:22 ka2u joined #mojo
01:34 egopro joined #mojo
01:59 KindTwo joined #mojo
02:01 d4rkie joined #mojo
02:09 alnewkirk joined #mojo
02:16 hesperaux_ joined #mojo
02:19 D4RK-PH0ENiX joined #mojo
02:27 jberger__ left #mojo
03:07 jb360 left #mojo
03:18 mattastrophe joined #mojo
03:22 duncanthrax joined #mojo
03:37 nour joined #mojo
03:41 bjoernfan joined #mojo
03:45 zdk joined #mojo
03:56 mattastrophe joined #mojo
04:19 stephan48 joined #mojo
04:20 sawtooth joined #mojo
04:20 augensalat joined #mojo
04:20 Foxcool joined #mojo
04:21 sri joined #mojo
04:32 rafl joined #mojo
04:42 ka2u joined #mojo
04:55 preflex_ joined #mojo
05:37 baton8 joined #mojo
05:43 basiliscos joined #mojo
05:55 ka2u joined #mojo
06:06 basiliscos joined #mojo
06:07 arpadszasz joined #mojo
06:23 ObseLeTe joined #mojo
06:46 yakudza joined #mojo
07:00 hrupp joined #mojo
07:03 Mike-PerlRecruiter_ joined #mojo
07:03 ver joined #mojo
07:07 xaka joined #mojo
07:15 dpetrov_ joined #mojo
07:21 nour joined #mojo
07:22 jzawodn joined #mojo
07:22 egopro joined #mojo
07:29 yakudza joined #mojo
07:34 davido joined #mojo
07:52 ObseLeTe joined #mojo
08:03 mtths joined #mojo
08:07 suy joined #mojo
08:27 jpn joined #mojo
08:29 arpadszasz joined #mojo
08:39 Vandal joined #mojo
08:40 daxim joined #mojo
08:47 fhelmber_ joined #mojo
08:49 nicomen joined #mojo
09:00 mtths joined #mojo
09:09 egopro joined #mojo
09:33 ObseLeTe joined #mojo
09:34 shmuel joined #mojo
09:40 egopro joined #mojo
09:51 maxhq joined #mojo
10:39 hesperaux joined #mojo
10:45 egopro joined #mojo
11:04 hesperaux_ joined #mojo
11:06 al802 joined #mojo
11:06 al802 Hi guys
11:07 al802 does anyone know how I can donate to this project?, I cannot find any links for that sort of thing
11:29 d4rkie joined #mojo
11:54 marty al802:  https://metacpan.org/author/SRI
11:59 phips_ joined #mojo
12:01 diegok o/
12:02 diegok I'm using UA on a site not respecting HTTP RFC :-/
12:02 diegok It does some redirects breaking this: For 3xx responses, the location SHOULD indicate the server's preferred URI for automatic redirection to the resource. The field value consists of a single absolute URI.
12:02 diegok header just says, Location: thing.php
12:02 wk joined #mojo
12:03 diegok Referral is a POST to /something/page.php
12:04 diegok All browsers use this bad 302 response going to /something/thing.php, but UA is going to /thing.php
12:06 diegok I'm fixing on my side setting max_redirects(0) and then looking into the 302 response...
12:06 diegok shouldn't this be fixed on the UA directly?
12:13 SmokeMachine joined #mojo
12:19 baton8 joined #mojo
12:31 diegok ^ my bad. It's already fixed on last version :-)
13:02 sh4 joined #mojo
13:16 sh4|2 joined #mojo
13:53 Vandal joined #mojo
13:54 mire joined #mojo
13:55 ladnaV joined #mojo
13:58 daxim joined #mojo
14:16 bluescreen joined #mojo
14:21 diegok I have reproduced on a single script the problem I have with Resque and Mojo::UserAgent since version 3.40. I can reproduce it changing $0 before loading Mojo::UserAgent -> https://gist.github.com/diegok/5108275
14:21 diegok sri: ^
14:22 ryozi joined #mojo
14:24 sri diegok: ?
14:25 GabrielVieira joined #mojo
14:25 diegok hi :)
14:26 sri why should that be of interest to me?
14:26 sri havn't we established that it's not a bug?
14:27 diegok Well... last time you showed me it works and it was OK for me. So I've investigated further before coming back...
14:27 diegok You've told me that Server is only loaded on testing IIRC
14:28 diegok your example was using UA and then changing $0. That's fine.
14:28 diegok but it fails to load after changing $0 (like in this gist)
14:29 diegok that's why I come back with a single script that reproduce this. It works on 3.39, it fails from 3.40 up to last version.
14:33 sri which is where we fixed FindBin support, if you break FindBin that's your bug imo
14:38 diegok Ok, that also makes sense :-(
14:38 diegok then I should break Resque I think...
14:39 sri wouldn't you have perfectly working resque support if you did "use FindBin" before changing $0?
14:39 sri *FindBin support in resque
14:39 diegok I'll try...
14:40 diegok \o/
14:40 diegok <3
14:40 sri :)
14:40 * diegok feels stupid but also happy !
14:45 Vandal joined #mojo
14:52 mire joined #mojo
14:56 btyler joined #mojo
15:07 anaio joined #mojo
15:14 alester joined #mojo
15:14 gryphon joined #mojo
16:01 salparadise so what do people usually use as a production web server for mojo? I saw the options, its hypnotoad standalone good enough? (thinking logs,ACLs,etc)
16:01 sri nginx + hypnotoad
16:02 sri marcus: maybe we should add websocket support to the cookbook nginx recipe
16:06 * sri wonders what the most minimal configuration looks like
16:08 sri proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade";
16:09 sri would adding that to the existing example be enough for websockets to "just work"?
16:11 * sri shakes marcus
16:18 r0b3rt joined #mojo
16:28 salparadise sri: cool
16:30 sri neat, the mongodb book by the sqlalchemy guy is out http://shop.oreilly.com/product/0636920027041.do
16:41 sh4|2 joined #mojo
16:54 labrown joined #mojo
16:56 btyler joined #mojo
17:00 rihegher joined #mojo
17:06 xaka joined #mojo
17:15 SmokeMachine joined #mojo
17:22 asarch joined #mojo
17:23 GabrielVieira2 joined #mojo
17:38 xaka joined #mojo
17:47 webar7 joined #mojo
17:48 webar7 hello ... I'm doing this :
17:48 webar7 $dom->find('span.title a, span.subTitle, span.author a, span.callNumber')->pluck('text')->each
17:48 webar7 is the each supoosed to let me iterate over the results?
17:50 webar7 do I get a list or array hash I need to split up ?
17:52 mitch joined #mojo
17:53 webar7 Dumper shows it as undef ... but if I run the script normally itdumps all the text at one (there's list of 50 or so "span class=author" elements
17:54 mitch Anybody know how to turn on JSON pretty printing in Mojolicious?
17:56 nour joined #mojo
17:57 hesperaux joined #mojo
18:01 al802 JSON pretty - strange you should say that
18:01 al802 I was just testing:  Syntax::Highlight::JSON;
18:02 al802 did not know it was built into Mojo?, is it
18:03 komodo joined #mojo
18:04 mitch With JSON::XS, you can simply $json->pretty(1) to turn it on.. I'm wondering if their is something similar in Mojo::JSON
18:07 al802 i see, maybe something via JSONConfig.pm
18:09 webar7 tempire: I'm doing this ...  $dom->find('span.title a, span.subTitle, span.author a, span.callNumber')->pluck('text')->each
18:09 webar7 tempire, oops
18:09 mitch @a1802 Thanks, I'll check it out and see if it works.
18:10 webar7 tempire, I meant to ask where can I get an annimated gif of the hypnotoad?
18:10 sh4|2 joined #mojo
18:10 hesperaux joined #mojo
18:11 rihegher left #mojo
18:12 wk joined #mojo
18:13 BeDa joined #mojo
18:29 mitch left #mojo
18:31 webar7 I take it that instead if doing:    my $bibliography =  $dom->find('span.title a, span.subTitle, span.author a, span.callNumber')->pluck('text')->each  or looping on the dom->find() I should be making a collection so as to somehow get an array as a result
18:34 webar7 but how ?  :-\ can I use a collection and dom constructor simultaneously?
18:49 basic6 joined #mojo
18:50 mire joined #mojo
18:59 btyler joined #mojo
19:00 hesperaux joined #mojo
19:04 Mike-PerlRecruiter_ joined #mojo
19:14 Akron joined #mojo
19:15 Akron webar7: find returns a Mojo::Collection - there is no other magic there. Pluck also returns a collection.
19:16 jberger_atwork joined #mojo
19:16 webar7 hmm
19:16 jberger_atwork webar7: ->find returns a collection
19:17 webar7 is a collection a list/array?
19:17 jberger_atwork and pluck is a collection method which is shorthand for ->map
19:17 Akron A blessed array ref-
19:17 jberger_atwork its a blessed array ref
19:17 jberger_atwork it has methods which are similar to standard array actions like map and grep etc
19:18 jberger_atwork each turns the collection into a list or else does some callback on each element
19:19 jberger_atwork I should say ->find returns a Mojo::Collection of Mojo::DOM objects which represent the selected sections of the tree
19:20 webar7 oh .. so I could do:    my $bibliography =  $collection->find('span.title a, span.subTitle, span.author a, span.callNumber')->pluck('text')->each    ;  # (group/collect the scrapings since each group of three span tags constitutes a "bibliographic item" (author title call number)
19:20 jberger_atwork you might try dumping the result of find using Data::Printer, though it might be a lot of output :-)
19:21 sri http://mojolicio.us/perldoc/Mojo/DOM#find
19:21 jberger_atwork pluck('text') is equivalently ->map(sub{$_->text}) btw if that makes more sense
19:21 webar7 and then somehow get the grouped together elements out of  there
19:21 sri it says so right in the documentation
19:22 Akron webar7: Yes you can, although I am not sure regarding the order of the ','-CSS3 operator.
19:22 webar7 ok
19:23 Akron So I guess it will return everything in the depth-first-search order in the tree - not in the order you define them in your css selector.
19:24 jberger_atwork IIRC CSS3 doesn't define a return order
19:25 jberger_atwork if order matters, don't pluck the text first, inspect the element you get, perhaps sort, then get the text
19:26 Akron Right - I wanted to response to the "(author title call number)" assumption.
19:27 webar7 was in vi and hmm had a typo in my Data::Dumper line ... switched to color vim  and found it ... :-)
19:29 jberger_atwork ok back to $work
19:29 jberger_atwork left #mojo
19:29 webar7 bascially the dump shows what the "say" and "print" lines give as output ... the page consists of a listing of about 50 books where those 3 elements describe them ('span.title a, span.subTitle, span.author a, span.callNumber')
19:29 webar7 they appear in order  as ~ 150 $VAR=  lines
19:29 Akron jberger_atwork: CSS selector API defines document order, so I assume we can rely on depth first.
19:30 webar7 and I want them to be 50 $VAR= with 3 members each)
19:31 Akron webar: They are not nested further? like in <div /> so you could first iterate through each book and then collect all information as a hash or something?
19:31 webar7 so I just need a way to create that data structure from the find()
19:41 garu jberger: maybe we should create a Data::Printer::Filter::Mojolicious for the most common objects being dumped
19:42 webar7 so one never has to have  use Mojo::Collection in the mainline is you've got   use Mojo::DOM
19:44 webar7 I think perltidy can help me do the rest ;-)
19:44 webar7 thanks
19:44 webar7 for the pointers
19:53 jberger_atwork joined #mojo
19:54 jberger_atwork garu, I think filters for Mojo::DOM and Mojo::Collection make sense
19:54 jberger_atwork perhaps also for the request/response structures
19:55 jberger_atwork garu, someone ran with my PDL filter too! : https://metacpan.org/module​/Data::Printer::Filter::PDL
19:57 jberger_atwork Akron, cool, I didn't know there was a defined order
19:57 jberger_atwork (guess I should look before I post)
20:07 garu jberger_atwork: I was surprised, thought you guys were going to integrate it seamlessly to pdl via sub _data_printer
20:08 jberger_atwork garu: we were, but it was taking too long waiting for a PDL release
20:09 jberger_atwork in the meantime someone decided to release it like this
20:09 jberger_atwork I still hope to move it to the PDL core as I think it would be much more useful there
20:10 jberger_atwork PDL has many other major projects going on, this kinda got lost in the shuffle
20:12 garu cool
20:12 sh4 joined #mojo
20:50 phillipadsmith Is there an equivalent of Mason's <% $string | u %> in Mojo templates, i.e., a flag to URL encode the output?
21:12 xaka joined #mojo
21:14 perlite_ joined #mojo
21:16 berov joined #mojo
21:18 berov Hi, I was wondering How can I forward to another action in Mojolicious within the same request (without external redirect)?
21:20 jberger_atwork left #mojo
21:37 GabrielVieira joined #mojo
21:44 marcus Sri: yes
21:45 sri marcus: yes to which one? :)
21:47 berov " forward"? anyone?
21:50 nour joined #mojo
22:31 marcus maybe we should add it, and all I did was what you wrote.
22:31 marcus (sri^)
22:33 sri marcus: ah, so just by adding those lines it works for both, normal http requests and websockets?
22:33 marcus sri: yepp. I have it for location /
22:33 sri (just making sure you don't have a separate location for websockets)
22:33 sri cool
22:34 marcus sri: btw, one thing we were wondering yesterday, doesn't mongodb collection have a find_or_create or similar?
22:35 sri marcus: ->save might be what you want
22:35 sri it's update_or_insert though
22:36 marcus sri: update_or_insert is what I wanted, but it only works for _id ?
22:36 sri yes, it only checks _id
22:36 sri it's how it's supposed to work
22:40 marcus sri: https://github.com/marcusramberg/perl_tent is what we managed to do during the oslo.pm session yesterday btw :)
22:41 sri neat :)
22:42 sri i like the mango model abstraction
22:43 marcus sri: https://github.com/marcusramberg/perl_te​nt/blob/master/lib/PerlTent/Model.pm#L14 is where we were wondering if there was a easier way (update_or_create or whatever)
22:43 sri ah, yea, there is no such operation to my knowledge
22:44 sri or wait
22:44 * sri scratches head
22:44 sri of course there is :)
22:44 sri marcus: you want an upsert!
22:45 ka2u joined #mojo
22:45 sri which is an ->update with upsert option
22:45 marcus oh, neat.
22:45 sri "Insert document if none could be updated."
22:45 marcus mm
22:46 phips joined #mojo
22:46 marcus that's perfect.
22:49 good_news_everyone joined #mojo
22:49 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/5uvrKg
22:49 good_news_everyone mojo/master c071eb2 Sebastian Riedel: added WebSocket support to Nginx cookbook recipe
22:49 good_news_everyone left #mojo
22:51 phips_ joined #mojo
22:52 sri is it "behind a Nginx reverse proxy" or "behind an Nginx reverse proxy"?
22:52 sri google says 25k for "an" and 15k for "a"...hmmm
22:55 berov left #mojo
22:57 Meiermann joined #mojo
22:57 btyler I'd say "an". everyone pronounces it as if it were spelled "engine X"
22:58 marcus wikipedia says it's pronounced that way even.
22:59 good_news_everyone joined #mojo
22:59 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/mPKAeA
22:59 good_news_everyone mojo/master c07b634 Sebastian Riedel: fixed typo in cookbook
22:59 good_news_everyone left #mojo
23:12 jberger joined #mojo
23:15 asarch joined #mojo
23:21 kongelaks my Mojo::UserAgent application broke after upgrading from .87 to .89... something having to do with the default scheme of a Mojo::URL and its to_string functionality. was that planned?
23:22 sri there should have been no breakage
23:22 kongelaks hmm... odd
23:22 sri do you have a minimal test case?
23:22 kongelaks i can try to whip one up for you
23:24 * sri expects something that was never supposed to work though
23:24 kongelaks heh
23:31 rem_lex joined #mojo
23:32 kongelaks http://pastebin.com/Ke0QDaMf
23:32 kongelaks sri: ^^
23:34 sri kongelaks: i don't understand
23:34 sri what's wrong with it?
23:36 sri ah
23:36 sri kongelaks: your URL is invalid
23:36 sri no scheme
23:36 kongelaks yes, i know
23:36 kongelaks but it didn't have that behavior before
23:36 sri just a side effect that it worked before, not a feature
23:37 kongelaks now it makes the request to localhost:48150
23:37 sri yes, that's fine
23:38 kongelaks k
23:39 sri it's actually more correct now, since the responsible code now uses Mojo::URL->is_abs
23:39 sri https://github.com/kraih/mojo/b​lob/master/lib/Mojo/URL.pm#L74
23:42 ka2u joined #mojo
23:45 kongelaks should the validity of the url be something that is verified by mojo? instead of successfully starting and finishing the transaction?
23:46 sri documentation says relative URLs are processed against the app, that's just what's happening
23:47 kongelaks i see
23:48 kongelaks it was just very strange for me to see the req/res going to/from localhost when i have not touch any server side mojo
23:49 kongelaks s/touch/touched/

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