The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2014-05-14

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

All times shown according to UTC.

Time Nick Message
00:21 gtodd jberger: for sure if one feels the urge they should go wild and crazy on a birthday (in the confines of a relatively safe environment) ... but "subroutine signatures" !!
00:42 Akron joined #mojo
00:49 sri http://vimeo.com/95066828 # this talk is sooooo good
01:04 shadowpaste "dwierenga" at 217.168.150.38 pasted "making a bot announcement to a channel on a timer" (36 lines) at http://paste.scsys.co.uk/372983
01:05 laouji joined #mojo
01:05 dwierenga hi, hoping someone could help me with the above paste.  i'm not really sure how to successfully fire an event on a timer
01:05 dwierenga it looks like my timer fires because i see the warn statements, but i never see anything posted to the channel
01:11 dwierenga alternately, if anyone can share either a working example of a Mojo::IRC bot or a slightly-more-than-trivial app that uses Mojo::IOLoop i'd be most grateful
01:11 dwierenga err, Mojo::IOLoop->timer, that is..
01:13 jberger dwierenga: I have two
01:14 jberger https://github.com/jberger/Mojo-FriendFeed/blob/master/ex/cpan.pl
01:14 jberger which is a single script
01:14 jberger and https://github.com/jberger/Toastr
01:15 jberger which is a sort of IRC bot pluggable framework
01:15 klapperl_ joined #mojo
01:15 dwierenga jberger: excellent thanks much!  i'll digest those for awhile
01:16 * jberger just bought an arduino and is looking forward to a severely geeky evening
01:28 laouji joined #mojo
01:28 firnsy sri++ # that talk was awesome ... "maybe i do know her..."
01:29 shmuel joined #mojo
01:39 laouji joined #mojo
01:39 jberger "They are making a series of obvious mistakes that I would not have made" :-)
01:45 davido__ joined #mojo
01:46 jberger dwierenga: you aren't doing : $irc->register_default_event_handlers;
02:00 cpan_mojo Mojolicious-Plugin-DigestAuth 0.08 by sshaw - http://metacpan.org/release/SHAW/Mojolicious-Plugin-DigestAuth-0.08
02:04 d4rkie_ joined #mojo
02:14 fhelmber_ joined #mojo
02:18 jberger jzawodn: I see you tweeted about Mojolicious and Arduino, do you have any cool repos laying around?
02:25 * sri wonders if JSON::PP will get fixed too https://github.com/makamaka/JSON-PP/pull/10
02:32 sri i guess chances don't look too good, but i tried
02:58 btyler joined #mojo
03:05 basic6 joined #mojo
03:20 dotandimet joined #mojo
03:40 dotandimet trippd6: you can mock out a REST API with Mojolicious::Lite in your test file. Write your mock routes at the top, and then initialize your test server with the app global - my $t = Test::Mojo->new(app);
03:48 dvinciguerra joined #mojo
04:00 laouji joined #mojo
04:15 jzawodn jberger: hm, sorry.. nothing I can make public (yet?).  it's stuff for my wife's company (we're prepping some hardare to run in the ISS)
04:16 jberger wow, that's cool!
04:16 jberger I will defer under those conditions!
04:20 jberger I'm working it out ok on my own
04:21 jberger I'm trying to see if there is an easy way to attach Mojo::IOLoop listeners to the Device::SerialPort
04:21 jberger it seems that there is an AnyEvent::SerialPort
04:23 jberger I might try to replicate the logic (though I haven't checked that it works)
04:23 jberger jzawodn: also, is her company hiring, that sounds much more interesting than my $work
04:23 jberger :-P
04:25 btyler jberger: I haven't used AnyEvent::SerialPort, but I did some arduino stuff in node about a year ago, and node-serialport has a pretty enjoyable API: https://github.com/voodootikigod/node-serialport
04:33 laouji joined #mojo
04:33 jzawodn jberger: her company not yet but my employer is hiring. :-)  I ended up using Mojo::IOLoop to do a mix of polling and non-blocking stuff (had there been more time I'd have tried to do something like AnyEvent::SerialPort)
04:34 jzawodn jberger: let's just say that by December of this year, we'll have some Perl running on the outside of the ISS on ~5 ARM cores
04:36 * dabudabu turns green
04:45 wolf_ joined #mojo
05:07 laouji joined #mojo
05:20 jberger jzawodn: so cool
05:20 d4rkie joined #mojo
05:38 basic6_ joined #mojo
05:48 Eke- joined #mojo
06:07 cpan_mojo Mojolicious-Plugin-PlainRoutes 0.04 by CTHOR - http://metacpan.org/release/CTHOR/Mojolicious-Plugin-PlainRoutes-0.04
06:11 denis_boyun joined #mojo
06:15 fhelmber_ joined #mojo
06:15 toebu joined #mojo
06:20 dpetrov_ joined #mojo
06:29 panshin joined #mojo
06:37 hummeleBop joined #mojo
06:40 sugar joined #mojo
06:45 sujithm joined #mojo
06:45 igorsutton_ joined #mojo
06:46 dod joined #mojo
06:50 jhg joined #mojo
06:56 ver joined #mojo
06:59 mire joined #mojo
07:01 laouji joined #mojo
07:02 cpan_mojo Mojolicious-Plugin-Crypto 0.11 by Marco Romano - http://metacpan.org/release/NEMUX/Mojolicious-Plugin-Crypto-0.11
07:04 denis_boyun joined #mojo
07:05 eseyman joined #mojo
07:19 panshin joined #mojo
07:48 trone joined #mojo
08:02 cosimo joined #mojo
08:04 Vandal joined #mojo
08:15 cosimo joined #mojo
08:18 panshin .
08:27 fhelmber_ joined #mojo
08:28 sugar_ joined #mojo
08:30 cpan_mojo Mojolicious-Plugin-CGI 0.08 by Jan Henning Thorsen - http://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-CGI-0.08
08:35 kbenson joined #mojo
08:41 edestler joined #mojo
08:43 laouji joined #mojo
08:45 laouji joined #mojo
08:47 laouji_ joined #mojo
09:00 basiliscos joined #mojo
09:04 rem_lex|pivo joined #mojo
09:05 ua1 joined #mojo
09:13 panshin joined #mojo
09:20 hrupp joined #mojo
09:21 sujithm joined #mojo
09:48 panshin joined #mojo
09:56 panshin joined #mojo
09:58 meshl joined #mojo
10:07 denis_boyun joined #mojo
10:08 sujithm_ joined #mojo
10:21 dexteruk joined #mojo
10:28 alnewkirk joined #mojo
10:37 arthas joined #mojo
10:51 dod joined #mojo
11:11 dod joined #mojo
11:43 panshin joined #mojo
11:52 dvinciguerra joined #mojo
11:59 igorsutton I may be doing something really stupid, but I can't get the post data I submit via a simple form
12:00 igorsutton post '/foo' => sub { my $self = shift; $self->param('bar'); } doesn't return anything.
12:01 igorsutton I assume param() is the proper way to get a value sent via post, right?
12:01 igorsutton or am I missing something.
12:02 panshin joined #mojo
12:03 nicomen does $self->param return a list of param key names?
12:04 cpan_mojo Mojolicious-Plugin-RedirectHost 1.04 by Alex - http://metacpan.org/release/ALEXBYK/Mojolicious-Plugin-RedirectHost-1.04
12:04 zivester joined #mojo
12:06 igorsutton nicomen: not at all
12:06 igorsutton nicomen: I can see that in scalar context, $c->param returns a reference to a Mojo::Parameters object
12:08 D4RK-PH0ENiX joined #mojo
12:12 neilhwatson joined #mojo
12:17 good_news_everyon joined #mojo
12:17 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/DnBwow
12:17 good_news_everyon mojo/master 66c4a93 Sebastian Riedel: fixed Mojo::IOLoop::Server to work correctly with newer versions of IO::Socket::SSL (closes #622)
12:17 good_news_everyon left #mojo
12:18 asarch joined #mojo
12:18 aleksey joined #mojo
12:19 aleksey left #mojo
12:21 igorsutton sort of getting crazy here with it. i dumped the contents of $self->req and i can't see the post data in there.
12:21 moritz $self->req->body
12:21 purl $self->req->body is the raw body
12:22 moritz and there are various methods for accessing the body in processed form
12:22 moritz like $self->req->json
12:22 igorsutton It's empty
12:22 dpetrov_ joined #mojo
12:22 igorsutton :(
12:22 moritz which one? ->body?
12:23 igorsutton body_params
12:23 igorsutton I'm looking at the dump of Mojo::Message::Request
12:24 igorsutton body_params is empty
12:24 moritz so, what's the content type? what's in body?
12:24 igorsutton the body is empty, as in empty string
12:25 moritz so, does it surprise you that body_params is empty too?
12:25 moritz I mean, where would it come from?
12:25 igorsutton no, but it should not be, because I'm posting it from the browser!
12:25 igorsutton that's weird
12:25 moritz igorsutton: did you inspect the HTTP request?
12:25 igorsutton in the browser or in mojo?
12:25 moritz in the browser
12:26 moritz cause you know, client side errors are possible too
12:26 moritz in the end you spend hours searching why it's empty in mojo, just to find out that the browser sent an empty request
12:26 moritz (if you're even more paranoid, you check it on the network layer, like with wireshark)
12:26 moritz (and when debugging, paranoia is good)
12:27 igorsutton yes
12:27 igorsutton and I found what's wrong
12:27 igorsutton argh
12:27 igorsutton moritz: thanks for being my teddy bear
12:28 igorsutton i've been away from html for almost two years, and i was bit by the input's name
12:42 moritz igorsutton: you're welcome
12:57 * sri yawns
12:58 mishantil Stop it! You risk infecting everyone!
13:00 panshin joined #mojo
13:05 nicomen igorsutton: next time, try something like: script/myapp get -M POST -c 'bar=lol' /some-url
13:06 igorsutton nicomen: oh, that's handy
13:06 igorsutton nicomen++
13:06 sri you learn that in the tutorial
13:07 igorsutton sri: hrm, thanks, I'm gonna check it out again
13:07 aleksey joined #mojo
13:12 rem_lex joined #mojo
13:12 denis_boyun joined #mojo
13:17 panshin joined #mojo
13:34 nic yeah, I need to re-read it too; a lot has gone in since I last looked (last year)
13:39 cpan_mojo Mojolicious-Plugin-RedirectHost 1.05 by Alex - http://metacpan.org/release/ALEXBYK/Mojolicious-Plugin-RedirectHost-1.05
13:43 btyler joined #mojo
13:46 russum joined #mojo
13:48 hesco joined #mojo
13:53 d4rkie joined #mojo
13:56 sujithm joined #mojo
14:02 bluescreen joined #mojo
14:03 gryphon joined #mojo
14:07 sh4 joined #mojo
14:07 Akron joined #mojo
14:09 mire joined #mojo
14:14 dvinciguerra joined #mojo
14:19 good_news_everyon joined #mojo
14:19 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/7fA2dA
14:19 good_news_everyon mojo/master f917592 Sebastian Riedel: explain cost of WebSocket compression and how to disable it
14:19 good_news_everyon left #mojo
14:27 marty_ joined #mojo
14:33 bluescreen_ joined #mojo
14:59 neyasov_ joined #mojo
15:05 igorsutton joined #mojo
15:16 rem_lex|pivo joined #mojo
15:38 sri https://gist.github.com/kraih/ac0502106bf0f643ea10 # 297MB for 10k open websockets doesn't seem too bad
15:41 sri compression really adds up though, 1.2GB when activated
15:41 stephan48 wow
16:04 marty_ ahhh, found a way to use readPreference with mango.
16:04 marty_ I just add two helpers and one has ?readPreference=secondaryPreferred appended to the connection string uri.
16:05 sri marty: you've got a sharded setup?
16:06 marty sri:  no.  just replica set with 3 replicas
16:06 sri then it doesn't work
16:06 marty I think you are going to tell me I am missing someting
16:06 marty Yep, :(
16:06 sri readPreference is a client side feature without a mongos
16:07 marty ahhhhh,  dang!!  I was so proud of myself for figuring that out.
16:08 marty thanks for the info: sri.
16:08 sri you can always have two mango instances though, one for reading and one for writing
16:09 sri but of course it's not as reliable, no failover, no figuring out which nodes are secondaries automatically
16:11 marty I do currently use two instances.  One just for running reports where stale data is not an issue.  I'll look into that more.
16:12 beyondcreed joined #mojo
16:13 sri it's this issue again https://jira.mongodb.org/browse/SERVER-1594
16:13 d4rkie joined #mojo
16:14 sri once mongos becomes a general purpose proxy stuff just works
16:14 sri they keep delaying it though, might be still be years until it happens
16:16 marty yes, now I remember.  I +1 that issue a long time ago.   It must be a tricky thing to solve because there seems to be a lot of interest in it.
16:28 mire joined #mojo
16:49 tempire um
16:50 tempire can you not specify the address/port for a daemon or morbo to listen on the config file?
16:53 Jonneh joined #mojo
17:01 denis_boyun joined #mojo
17:18 sri no
17:46 Akron joined #mojo
17:51 punter joined #mojo
17:55 dotandimet joined #mojo
18:10 abra joined #mojo
18:26 tempire You know what's needed
18:26 tempire or, what I would find useful
18:26 tempire mojo generate command
18:28 sri too vague
18:29 sri commands are not clearly defined like apps or plugin
18:31 voegelas joined #mojo
18:36 Akron What I would love to have: A way to add an event to be released after a route is dispatched - without the need to have an app-wide hook.
18:37 Akron In the line of get('/myroute)->after(sub{ ... })->to('...#...'); - or is this already possible?
18:38 sujithm joined #mojo
18:38 sri to do what?
18:38 purl do, or do not. there is no try.
18:39 Akron For example a caching plugin - I have a plugin first checking for a cache key - if it's not found or the cache is expired, the response should be cached. The plugin is route specific.
18:40 sri if you really want to run something after routes, there's around_dispatch, if you want after content is generated, there's after_dispatch, if you want after the response has been sent there's the finish event on the transactions... and so on
18:40 sri actions may be async, to tie stuff to routes is silly
18:42 sri s/stuff/code/
18:42 sri if you want to make sure a specific route matched, just check $c->match->endpoint->name
18:42 Akron I currently use events - but these are application wide. That's what I meant. However - routes may not be the correct point for these kind of actions, that's true. Maybe something similar to an "on_render" hook To add as an action to the controller object ...
18:43 Akron I am not sure.
18:43 sri anyway, my point is that there's prolly more than one way to do what you want already
18:43 Akron It's just a thing I stumbled upon from time to time and always think: And application wide event doesn't seem to be the best choice.
18:44 sri your use case is not even good
18:44 Akron Currently I set a stash value, e.g. "please.cache", and that's the first thing I check in the event.
18:44 sri as soon as you have something non-blocking it falls apart
18:44 Akron What is wrong in my use case?
18:45 Akron s/in/with/
18:45 sri you assume once the route has been dispatched there's something to cache
18:46 Akron No - I check if there is something to cache. But this check is currently application wide.
18:46 Akron Or am I misunderstanding you?
18:47 Akron (currently I am using after_render btw.)
18:47 sri perl -Mojo -E 'a(sub { my $c = shift; Mojo::IOLoop->next_tick(sub { $c->render(text => "you missed this!") }) })->start' get /
18:48 sri you just can't use routes, the time is wrong
18:48 Akron Ah - okay.
18:50 pemungkah joined #mojo
18:50 sri shit
18:50 Akron And the controller? I mean in case the controller would inherit from Mojo::EventEmitter and had a ->on(render => sub {})?
18:50 sri and this is how the open web died https://blog.mozilla.org/blog/2014/05/14/drm-and-the-challenge-of-serving-users/
18:51 Akron :( and I have to change my UserAgent to InternetExplorer to stream legally from Amazon Prime. The system is doomed.
18:53 Akron Let's hope that DRM will fail as it has failed with music and (at least partially) with ebooks.
19:02 Akron Oh ... does $c->on(finish => sub {}) possibly even work ... ? I will check that.
19:06 igorsutton joined #mojo
19:06 davido__ The best stance is for browser vendors to ignore content producer's desire for DRM. If they want it, let them implement some buggy solution that nobody likes or uses, until eventually they get the message that nobody is viewing their content because of its buggy delivery system.
19:07 davido__ Ok, that's not the best solution, but neither is browser manufacturers getting into the game themselves.
19:09 Akron sri: Damn, I'm stupid.$c-> on(finish => sub { ... }) is exactly what I was crying for! sri++
19:10 Akron ALL GLORY TO THE HYPNOTOAD!
19:10 sri :)
19:10 sri davido__: problem is w3c made it happen
19:11 davido__ I guess the price users pay for w3c not being involved is 25 different plugins, or inconsistent experiences across browsers, which is kind of what happened already in the early browser wars.
19:11 sri EME exists, it's too late, our only hope now is to restrict it to video
19:12 Akron And it's pretty consistent with what tbl wrote in "weaving the web".
19:12 davido__ http://i.imgur.com/jJ0EbGI.jpg
19:34 igorsutton joined #mojo
19:43 russum joined #mojo
20:11 good_news_everyon joined #mojo
20:11 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/L7S_3A
20:11 good_news_everyon mojo/master 776aec9 Sebastian Riedel: return less
20:11 good_news_everyon left #mojo
20:16 sujithm joined #mojo
20:29 neyasov_ joined #mojo
20:30 cosimo joined #mojo
20:40 denis_boyun joined #mojo
20:46 meshl joined #mojo
21:11 wolf_ joined #mojo
21:12 igorsutton joined #mojo
21:12 disputin joined #mojo
21:39 neyasov_ joined #mojo
21:58 TheCrimsonRadish joined #mojo
22:02 meshl joined #mojo
22:05 TheCrimsonRadish joined #mojo
22:11 davido___ joined #mojo
22:31 Reychar_ joined #mojo
22:49 sugar__ joined #mojo
22:52 bluescreen joined #mojo
23:03 howitdo joined #mojo
23:03 bluescreen_ joined #mojo
23:04 good_news_everyon joined #mojo
23:04 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/5sAjyQ
23:04 good_news_everyon mojo/master 46de638 Sebastian Riedel: emphasize that TDD is just a tool
23:04 good_news_everyon left #mojo
23:07 zivester joined #mojo
23:44 d4rkie joined #mojo

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