Camelia, the Perl 6 bug

IRC log for #mojo, 2013-06-09

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

All times shown according to UTC.

Time Nick Message
00:07 hotsnow joined #mojo
00:08 moltar joined #mojo
00:14 good_news_everyone joined #mojo
00:14 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/IXmr7w
00:14 good_news_everyone mojo/master adea1fd Sebastian Riedel: documentation tweaks
00:14 good_news_everyone left #mojo
00:18 tba i keep getting errors from Mojo::Reactor::Poll (using the Mojo::IOLoop::Server starttls patch, after a new handle/stream are created once tls completes) - I've stolen the handle and closed the stream and handle for the previous connection, these are the errors: http://pastebin.com/h7Fb2PDc
00:19 tba any idea what I've forgotten to do?
00:19 tba (and I've removed it from the reactor, I think!)
00:24 good_news_everyone joined #mojo
00:24 good_news_everyone [mojo] kraih tagged v4.13 at 9d30b89: http://git.io/b1JcvQ
00:24 good_news_everyone left #mojo
00:54 drift joined #mojo
00:58 TitanOfOld joined #mojo
01:22 jberger wow, lots of commits! sri++
01:24 sri \o\
01:24 sri /o/
01:30 btyler joined #mojo
01:57 Meiermann joined #mojo
02:40 whitebook joined #mojo
03:06 preflex_ joined #mojo
04:11 mattastrophe joined #mojo
04:31 btyler joined #mojo
05:09 hotsnow joined #mojo
05:46 asarch joined #mojo
05:49 Britzel_ joined #mojo
06:29 Phil21 joined #mojo
06:33 d4rkie joined #mojo
06:34 d4rkie joined #mojo
06:44 Phil21 where is a good mojo noob resource? :) just found it, and having fun building some stuff - but have a lot of questions too
06:44 Phil21 went through most of the wiki and tutorials
06:52 Vandal joined #mojo
07:01 dotan joined #mojo
07:12 buu Phil21: The documentation that comes with it?
07:50 basiliscos joined #mojo
08:02 jzawodn joined #mojo
08:15 Vandal joined #mojo
08:17 denisboyun_ joined #mojo
08:46 cpk joined #mojo
08:46 cpk hi there
08:46 cpk i'm searching for preforking web server which is working under windows
08:47 cpk after searching on CPAN, it seems that the only solution is Catalyst-Engine-HTTP-Prefork
08:47 cpk do you know why starman (which seems to be a port of this module) doesn't run under windows ?
08:48 cpk what could you suggest as an alternative ?
08:50 cpk I have the feeling I'm stuck with a single process perl web app under windows...
08:52 moritz maybe because windows doesn't support forking?
08:57 cpk moritz: ok but why "Catalyst-Engine-HTTP-Prefork" seems to work on this platform ?
09:15 moritz I have no idea.
09:53 hotsnow joined #mojo
09:58 bpmedley Phil21: Do you have what you need to get started?
10:00 hotsnow joined #mojo
10:26 dpetrov_ joined #mojo
11:03 JiYu joined #mojo
11:03 inokenty1 joined #mojo
11:10 denisboyun joined #mojo
11:22 Vandal joined #mojo
11:37 suy joined #mojo
11:49 sawtooth is there a way to set a taghelper value from the controller? using stash maybe?
11:51 denisboyun joined #mojo
13:03 whitebook joined #mojo
13:03 cpk left #mojo
13:08 mire joined #mojo
13:09 Vandal joined #mojo
13:20 Akron joined #mojo
13:52 marty joined #mojo
13:56 moltar joined #mojo
13:57 asarch joined #mojo
14:07 gryphon joined #mojo
15:40 sh4 joined #mojo
15:43 d4rkie joined #mojo
15:46 good_news_everyone joined #mojo
15:46 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/-5HqmQ
15:46 good_news_everyone mojo/master 933f61d Sebastian Riedel: the trailing slash is always optional
15:46 good_news_everyone left #mojo
16:06 daemonic joined #mojo
16:25 KindOne joined #mojo
16:28 bpmedley https://github.com/brianmed/InfoServant-Feeds  <-- Thoughts on my Mojolicious project?
16:40 jberger bpmedley, I see SQL interpolation!!
16:40 bpmedley jberger: May I ask where?
16:40 jberger https://github.com/brianmed/InfoServant​-Feeds/blob/master/bin/feed_mgmt.pl#L53
16:41 jberger unless it does some escaping magic
16:41 jberger but I would see that and worry
16:41 bpmedley jberger: Understood.  All that does it create question marks.
16:42 jberger oh ok
16:42 bpmedley jberger: It's also a command line utility.  Sorry for the confusion and thanks for looking!
16:42 bpmedley jberger: Thoughts on improvement?
16:42 jberger I'm still looking it all over
16:42 jberger I have no idea what it does, I'm just looking for code smells
16:42 jberger :-)
16:42 bpmedley lol.. thx
16:47 jberger https://github.com/brianmed/InfoServan​t-Feeds/blob/master/bin/feeder.pl#L50
16:47 jberger why build a new UA every loop?
16:48 bpmedley jberger: I debated that.  I wasn't sure if in the future a site would need specific $ua flags and whatnot.
16:48 bpmedley jberger: Also, I wasn't sure of best practice.
16:48 jberger ok, and Mojo::Base based objects are really fast to create
16:49 jberger part of the question was going to lead to, had you considered using a non-blocking formalism for this code?
16:49 jberger though with a 5 sec sleep, maybe you spend more time in sleep than you do waiting for the response
16:50 bpmedley Yes, I was thinking about using Mojo::IOLoop (if that's what you're referring to); however, I wasn't sure if I need that complexity just yet.
16:50 bpmedley All that code is doing is looping over a set of directories and processing the ones that are 15 minutes old.
16:51 bpmedley The feeder.pl script is ran via upstart.
16:52 jberger yeah, it could be overkill at this point
16:55 jberger then again, things like exteral scripts could often be made part of the actual codebase and connected to the app with their own route (maybe your upstart job hits it every 15 mins) or even and IOLoop timer could fire it then too
16:55 bpmedley Yes, that would be really awesome.
16:55 jberger its my style (and not everyone's certainly) to have all of my dependent code all unified
16:56 bpmedley The end goal is a completely self-contained code base that can be installed with a git clone.
16:57 jberger yeah, then in that case, I would definitely try to turn those other scripts into modules (don't need to change much) and then either expose a route which when called runs the function (formerly script) or as I said, you could just setup a timer which does the same
16:58 jberger <3 IOLoop
16:59 bpmedley Very cool.  Thank you.
16:59 jberger I see you are using Moose
16:59 jberger do you ever use ->meta (other than for make_immutable)?
17:00 sri the whole approach doesn't seem that good, i'd use parallel non-blocking HEAD requests to check for updates
17:01 bpmedley sri: The approach of the app?
17:01 bpmedley jberger: I use minimal Moose features.  I don't believe I use the meta stuff.
17:01 sri feeder.pl
17:01 bpmedley I agree feeder.pl needs some thought.  I threw it in there to get things working.
17:01 jberger yeah, I'm reading the code for the code's sake, sri can haz opinionz on the desgin :-)
17:02 sri that approach will just get you banned
17:02 bpmedley banned?
17:02 sri also you should really check robots.txt
17:02 jberger I assume that the sleep 5 was there to prevent banning
17:02 sri if you waste peoples bandwidth, they will blacklist you
17:03 jberger ah, hmmm good advice
17:03 sri big ass xml feed every 5 seconds
17:03 bpmedley No, it's every 15 minutes.  Sorry, I'm not that bad.. :)
17:03 bpmedley Although, I like the HEAD request idea.  I will implement that.
17:04 jberger and hey, I learned something too, I wouldn't have thought of that (at least at first) :-) sri++
17:04 jberger anyway, bpmedley, have you looked at Moo (and possibly Type::Tiny)?
17:05 jberger if you like Moose, but don't use meta, its a good call
17:05 bpmedley jberger: I have not heard of Type::Tiny.  I was considering Moo.
17:05 jberger and if you aren't using really magical Moose extensions
17:05 jberger the problem with Moo is that its type system isn't as nice as Moose's, but Type::Tiny is good for that
17:06 jberger just an idea, I'm not a Moo over Moose militant (at least not in non-CPAN code)
17:07 jberger for CPAN code I'm starting to push for Moo when possible (dependency radius)
17:08 bpmedley Understood, I'll look into them.
17:28 jamesw MooX::Types::MooseLike too
17:35 good_news_everyone joined #mojo
17:35 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/cBxpGw
17:35 good_news_everyone mojo/master 7e3fbea Sebastian Riedel: a few more url_for tests
17:35 good_news_everyone left #mojo
17:36 daemonic joined #mojo
17:52 Phil21 hrm, this may be a stupid question..  I have a mojo "server" and a mojo "client" - the client simply makes http calls to the server to more or less update key/value pairs about itself
17:52 Phil21 what is the best way to pass json between eachother on this setup?
17:53 Phil21 been using params up to now, but they are getting unwieldy as data grows
17:53 ghandi joined #mojo
17:53 ghandi Hi there.
17:53 ghandi What's the way to go in 2013 when i want to validate forms but don't want to touch the HTML::FormFu beast? :D
17:54 Phil21 the server response and client handling looks pretty straightforward for json, but I don't see much about how to parse client-provided json on the server side :)
17:56 Phil21 certainly not 2013, but if you just had some very basic stuff to validate maybe http://search.cpan.org/~frajulac/Form​Validator-0.11/HTML/FormValidator.pm would work
17:57 ghandi thanks, i'm having a look at it
18:05 bpmedley Phil21: http://search.cpan.org/~sri/Moj​olicious-4.13/lib/Mojo/JSON.pm  <-- Something like this?
18:14 duncanthrax joined #mojo
18:19 good_news_everyone joined #mojo
18:19 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/mV4EFA
18:19 good_news_everyone mojo/master cb5822b Sebastian Riedel: fixed bug where render_later method was not hidden from the router
18:19 good_news_everyone left #mojo
18:26 good_news_everyone joined #mojo
18:26 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/Mrat0Q
18:26 good_news_everyone mojo/master 60059ca Sebastian Riedel: fixed bug where match attribute was not hidden from the router
18:26 good_news_everyone left #mojo
18:27 Phil21 bpmedley: yeah, I definitely read that - the json bits seem to work
18:27 Phil21 I guess I'm asking what is best practice for getting that json into an object, when the client is sending you it
18:28 rem_lex|pivo joined #mojo
18:29 bpmedley Phil21: Can you just access the JSON string via a param or somesuch?
18:29 Phil21 yeah, I can - what I'm doing now
18:29 Phil21 just seemed a bit kludgy
18:31 jberger jamesw, https://metacpan.org/module/Type:​:Tiny::Manual#TYPE::TINY-VERSUS-X
18:31 sh3 joined #mojo
18:37 jberger Phil21, is this what you are looking for? https://metacpan.org/module/Mojo::Message#json
18:38 jberger my $json = $c->req->json
18:39 Phil21 jberger: hmm, yeah I think so. nice.
18:39 Phil21 let me try it
18:52 jberger Phil21, server:
18:52 jberger perl -Mojo -E 'a("/" => { text => "done" } => sub { print r(shift->req->json) })->start' daemon
18:52 jberger Phil21, client request:
18:53 jberger perl -Mojo -E 'say g("localhost:3000" => json => { hello => "world" })->body'
18:53 jberger the server prints JSON decoded by Mojo::JSON then serialized with Data::Dumper, it returns "done" to the client
18:54 jberger the client sends the json document { "hello":"world" }
18:59 jberger here's a better server, it echoes the request back to the client, so you can see the json document
18:59 jberger perl -Mojo -E 'a("/" => sub { my $c = shift; r($c->req->json); $c->render( text => $c->req->body ) })->start' daemon
19:00 Phil21 hehe, nice thanks
19:01 jberger <3 ojo
19:01 jberger oh shoot, that last one is missing "print" before r()
19:07 Phil21 works too :)
19:07 Phil21 interesting, thank you
19:08 basiliscos joined #mojo
19:10 good_news_everyone joined #mojo
19:10 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/Qa-EqQ
19:10 good_news_everyone mojo/master ed7f63e Sebastian Riedel: better tests for mixed case actions and templates
19:10 good_news_everyone left #mojo
19:13 moltar joined #mojo
19:27 good_news_everyone joined #mojo
19:27 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/602VmA
19:27 good_news_everyone mojo/master e72030f Sebastian Riedel: no need for separate log messages
19:27 good_news_everyone left #mojo
20:32 Phil21 jberger: what's the r() mean in print r($c->req->json);
20:33 jberger look at the documentation for 'ojo' which is Mojolicious' one-liner sugar
20:33 Phil21 ah, thanks
20:33 jberger r is dump with Data::Dumper
20:33 jberger but that's where you find the doc
20:33 jberger you'll also see a and g which I used in those examples
20:33 Phil21 neat
20:33 jberger very neat
20:33 Phil21 I assumed that was abbreviation for 'any' :)
20:34 Phil21 but r didn't parse
20:34 jberger I believe that d was already taken
20:34 jberger yeah, d is a DELETE request
20:36 jberger PATCH and PUT also get strange letters
20:36 jberger t and u respectively
20:36 Phil21 man, so much to learn
20:36 Phil21 cool stuff though, having fun
20:36 jberger eh, you get your favorite ojo letters
20:37 Phil21 mojo made me interested, and .ep sealed the deal :)
20:37 jberger on of my proud achievements was conning sri into getting j out of ojo and into Mojo::JSON
20:37 Phil21 best templating language I've used
20:37 Phil21 we heavily use TT here, and I hate it
20:37 jberger ep is great
20:37 sri :o
20:38 jberger :-P
20:38 jberger <3 j
20:39 jberger though with the new json handling spread everywhere, I don't need to use it quite as often
20:45 libsysguy joined #mojo
20:46 libsysguy so I was running through the mango
20:47 libsysguy and I had to call a render later in the sub to let the callback finish.  Is that normal?
20:49 jberger libsysguy, yes, otherwise the automatic rendering kicks in
20:49 jberger sri: I know its a long time off, but I'm thinking that for YAPC::NA 2014 I might want to present on Mojo::IOLoop::Delay
20:50 jberger I will probably try a test run in chicago.pm in the coming months
20:50 libsysguy YAPC::NA orlando!!
20:50 jberger yup!
20:50 libsysguy I guess if I wanted to have an event loop I should have specified a websocket rather than a get request
20:51 jberger the wife is excited, hopefully school will have let out by then so she can come (she's a teacher)
20:51 jberger libsysguy, ?
20:51 jberger get requests can have callbacks
20:52 libsysguy well, I just started and I wanted to set up Mojo as a backend api to an angular model
20:52 libsysguy and I didn't want mojo trying to render a template
20:52 jberger all blocking features of Mojo::UserAgent are actually non-blocking, with a blocking wrapper
20:52 libsysguy I know my gf is excited about orlando
20:53 jberger I haven't used angular or the like yet, but yeah, I think websockets are probably well suited
20:53 jberger that said, you can certainly use get etc
20:53 libsysguy its just something I am playing with
20:54 libsysguy it worked like I expected in a Mojo::Lite app
20:54 libsysguy but in the full version I guess the callback was getting delayed too long
20:55 sri you must be misunderstanding something
20:55 libsysguy probably :-/
20:56 libsysguy either way, the automatic render was waiting after I i told it to render later and the callback was able to finish
20:57 libsysguy http://pastebin.com/fmb0x2jT
21:07 jberger sri: it shouldn't matter when you call render_later, correct?
21:08 jberger meaning in the example shown, the fact that render_later at the end of the method?
21:08 jberger I have always used it right away
21:08 jberger shouldn't matter though right?
21:09 Caelum anyone written a blog in mojo yet?
21:09 stephan48 bootylite
21:09 stephan48 by memowe
21:09 Caelum will check it out, thanks!
21:09 stephan48 for example
21:10 Caelum I need to convert my angerwhale blog
21:10 stephan48 the autorenderer should only kick in after the method is finished anyway in my understanding, so when its declared before returning from the method it should be fine
21:11 jberger stephan48, I was pretty sure of that
21:11 jberger but I don't see anything else in that paste that shouldn't work
21:11 * jberger suspects that libsysguy had some other problem
21:12 stephan48 i am not sure that that really a delayed callback?
21:12 stephan48 i.e. return control
21:15 jberger stephan48, I don't follow
21:17 stephan48 jberger: nvm
21:23 denisboyun joined #mojo
21:39 sri jberger: only matters if the callback can be called right away
21:39 sri well, actually in this case it shouldn't
21:40 sri but generally that's what you watch out for
21:41 stephan48 so there could be problems when render_later is called after render()?
21:42 sri i doubt it, it's not something we test for though
21:42 stephan48 k
21:42 stephan48 so better to avoid to case than to run into possibly non existent problems...
21:42 stephan48 avoid this*
22:02 lukep joined #mojo
22:13 whitebook joined #mojo
22:14 mire_ joined #mojo
22:42 libsysguy joined #mojo
23:38 mattastrophe joined #mojo
23:51 russum joined #mojo

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