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

IRC log for #mojo, 2014-06-26

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

All times shown according to UTC.

Time Nick Message
00:11 d4rkie joined #mojo
00:11 d4rkie joined #mojo
00:32 shmuel joined #mojo
00:54 odc joined #mojo
01:01 laouji joined #mojo
01:13 klapperl joined #mojo
01:19 neyasov joined #mojo
01:20 Averna joined #mojo
02:03 meshl joined #mojo
02:26 KCL joined #mojo
02:28 Ptolemarch joined #mojo
03:35 btyler joined #mojo
03:42 KCL joined #mojo
03:55 Ptolemarch joined #mojo
03:56 fhelmber_ joined #mojo
03:59 KCL joined #mojo
04:33 KCL joined #mojo
04:34 irq joined #mojo
05:44 voegelas joined #mojo
05:45 laouji joined #mojo
05:49 sujithm joined #mojo
06:00 laouji joined #mojo
06:05 sujithm_ joined #mojo
06:06 sujithm joined #mojo
06:14 sujithm_ joined #mojo
06:20 laouji joined #mojo
06:20 denis_boyun joined #mojo
06:51 dod joined #mojo
06:53 laouji joined #mojo
07:10 eseyman joined #mojo
07:17 igorsutton joined #mojo
07:18 Vandal joined #mojo
07:21 basiliscos joined #mojo
07:22 batman i wonder if i need to support this: https://gist.github.com/jhthorsen/d94c045cfda4b47b9213
07:22 batman it will make Mojo::Redis2 a lot more complicated...
07:23 batman i would like to just have prepare ... execute ... wait ... prepare ... execute ... wait
07:26 trone joined #mojo
07:35 mr-foobar joined #mojo
07:57 laouji joined #mojo
08:01 shmuel_ joined #mojo
08:11 kyshtynbai joined #mojo
08:15 laouji joined #mojo
08:28 sujithm joined #mojo
08:32 laouji joined #mojo
08:33 shmuel joined #mojo
08:42 sujithm joined #mojo
08:45 john joined #mojo
08:47 Jonneh joined #mojo
08:50 rawler joined #mojo
08:55 laouji joined #mojo
09:01 kyshtynbai Guys, can I write a hook, which would set a variable with stash to zero for all routes? What field (after dispath, before dispatch) should I use for it?
09:02 kyshtynbai and this varialble should be possible to be overwritten in a specific route.
09:06 eugen joined #mojo
09:08 fhelmber_ joined #mojo
09:12 _eugen joined #mojo
09:17 mire joined #mojo
09:18 crab of course you can
09:18 crab but why not just use a default?
09:19 crab $app->defaults(foo => 0) or whatever
09:19 rofl_ joined #mojo
09:19 rofl_ if i wanna proxy a mojo app running hypnotoad through nginx and serve it from /site
09:19 rofl_ what should i look for?
09:20 sujithm_ joined #mojo
09:22 kyshtynbai crab: thanks!
09:24 crab rofl: search for rewrite in the cookbook
09:34 dpetrov_ joined #mojo
09:35 batman rofl_: you can also do $route->to("ctrl#action", foo => 0); if you just want it for a single route (or children of a given route)
09:35 batman oops! i meant kyshtynbai ^
09:42 denis_boyun joined #mojo
09:43 kyshtynbai I see, thanks! Thats handy.
09:45 kyshtynbai But not in the case. There situation is - I %= include 'tmpl' if $var . (Like a drop-down menu which appears only when requesting a specific route. But in case of lack of this control variable in other routes I recive an undefined var error.
09:45 kyshtynbai s/there/the
09:46 moritz then replace $var with stash('var')
09:46 moritz then it won't barf when $var is missing
09:46 kyshtynbai cool! I'll try!
09:46 kyshtynbai Thanks.
09:48 kyshtynbai That works! Thanks again.
09:52 meshl joined #mojo
10:00 TenshiLyle joined #mojo
10:04 neyasov joined #mojo
10:19 batman i think i got the basics working now: https://github.com/marcusramberg/mojo-redis/blob/v2/lib/Mojo/Redis2.pm
10:21 batman wonder if it's any better or just as bad :(
10:40 punter joined #mojo
10:41 dotan1 joined #mojo
10:41 batman https://github.com/marcusramberg/mojo-redis/blob/v2/t/pipelined.t # pipelining works.
10:41 batman at least the way i think it should work...... :P
10:47 alnewkirk joined #mojo
10:51 kyshtynbai joined #mojo
11:07 mire joined #mojo
11:12 sujithm joined #mojo
11:37 ver joined #mojo
11:40 batman sri: got any good idea on how to make "unsubscribe" work in Mojo::Redis2?
11:40 batman i think i'm way off with the $self->unsubscribe($id) idea
11:41 sri batman: ->unsubscribe('some_channel')?
11:41 batman what if the channel is called "error", "connection", ... ?
11:41 sri don't share the unsubscribe method
11:42 sri use a different name then
11:42 batman i was thinking about that. what do you think about un_un_unsubscribe() ?
11:42 batman ;)
11:42 batman off() ?
11:42 sri you shoudl have voted for Mojo::EventEmitter to use ->off() ;p
11:43 batman haha. true ;)
11:44 batman can i just make a new topic under https://groups.google.com/forum/#!forum/mojolicious for Mojo::Redis2 ?
11:48 batman i could just document that Mojo::Redis2->subscribe, unsubscribe and friends require namespaced channel names...
11:49 sri then you would have compatibility problems with existing redis setups
11:49 batman true :/
11:49 * batman creates a new topic in google groups
11:51 rj11 joined #mojo
11:52 neilhwatson joined #mojo
11:52 rem_lex| joined #mojo
12:00 neyasov joined #mojo
12:07 someanon hi guys! jberger advised me write article about integrating hypnotoad with systemd. I want to write. Can some one help me with mojolicious wiki: how can i create new article?
12:07 meshl joined #mojo
12:10 sujithm joined #mojo
12:11 nicomen someanon: sorry, no idea
12:12 batman someanon: don't you have a blog somewhere?
12:15 batman someanon: http://blogs.perl.org/ sign up :)
12:23 sri someanon: the "New Page" button ;)
12:24 batman someanon: do you have a github account? if not: make one
12:24 batman ^ friendly advice
12:26 batman https://groups.google.com/forum/#!topic/mojolicious/ey_4bmbZPZQ # finally on google groups :)
12:26 sri batman: ->un() might work
12:27 sri if you really can't think of something better
12:27 batman and ->pun() ..? # pun intended
12:27 sri haha
12:28 sri or just delegate to a separate object
12:28 someanon sri, where is no new page button https://github.com/kraih/mojo/wiki
12:29 sri $redis2->channels->subscibe('foo'); $redis2->channels->on(message => sub {...}); ...
12:29 batman someanon: DO YOU HAVE A GITHUB ACCOUNT?
12:29 someanon yes i hav
12:29 batman ok.
12:29 someanon i need to authorize?
12:30 batman someanon: have you logged in?
12:30 batman http://home.thorsen.pm/private/raw/notverysecret/mojo-new-page.png
12:30 batman the green button ^^^^^
12:31 someanon wow, i have found
12:31 batman someanon: but you should rather make a blog post -- http://blogs.perl.org/
12:31 sri ok, i'm stupid... delegating doesn't help at all... Redis2::Channel would just inherit unsubscribe as well...
12:32 batman sri: i'm considering $self->unsubscribe(message => @channels);
12:32 sri jus don't
12:33 sri dual use methods like that are ugly
12:33 batman BUT I WANT! PLEASE!
12:33 batman :)
12:33 sri NO!
12:33 batman buhuuu :(
12:33 batman actually: it's one of the things i screwed up in Mojo::Redis
12:34 batman trying my best to avoid that now
12:34 batman but...history do have a nasty habit of repeating it self :(
12:35 * batman need a break
12:37 basiliscos joined #mojo
12:41 eseyman left #mojo
12:48 mr-foobar joined #mojo
13:08 d4rkie joined #mojo
13:21 someanon sri, is it you mojolicious main author?
13:22 mire joined #mojo
13:25 d4rkie joined #mojo
13:26 batman he is
13:27 batman xs-- # why does it always screw up encoding? :(
13:30 cosimo joined #mojo
13:42 batman sri: i got a solution to the unsubscribe() problem: just let the object go out of scope ;)
13:42 woz joined #mojo
13:43 kyshtynbai Guys, will this work: <% do { %> _html_tags_ <% } if _some_condition_; %>
13:43 kyshtynbai For now, it doesn't :(.
13:44 sri set MOJO_TEMPLATE_DEBUG=1 to see what that actually looks like in compiled perl
13:46 kyshtynbai Is MOJO_TEMPLATE_DEBUG  enviroment variable?
13:46 Jonneh_ joined #mojo
13:48 neyasov joined #mojo
13:48 ryozi joined #mojo
13:52 marty joined #mojo
13:52 btyler joined #mojo
13:54 someanon sri, thank you for mojolicious:3
13:54 crab what about mojolicious 5?
13:55 crab and, y'know, 4?
13:55 sri seriously, mojolicious 3 wasn't that great :)
13:56 crab you should've seen 2!
13:57 mattastrophe joined #mojo
14:00 doby joined #mojo
14:01 sh4 joined #mojo
14:07 someanon https://github.com/kraih/mojo/wiki/Integrating-hypnotoad-with-systemd-and-rsyslog
14:09 someanon jberger, sri
14:09 someanon :3 means :3 not 3
14:13 someanon now i'm using mojolicious 4.96
14:14 batman what is :3? is it the same as <3 ..?
14:18 someanon no
14:19 someanon do u know cat face?
14:19 sri http://weknowmemes.com/wp-content/uploads/2012/09/grumpy-cat-i-had-fun-once-it-was-awful.jpeg
14:20 someanon http://img132.imageshack.us/img132/7769/1357690843867.jpg
14:20 someanon sri, haha
14:21 d4rkie_ joined #mojo
14:23 nic mojolicious 2.55 was still significantly better than some of the alternatives of the day
14:26 KCL_ joined #mojo
14:28 Jonneh joined #mojo
14:29 disputin joined #mojo
14:38 bluescreen joined #mojo
14:40 batman this is weird... i'm running a NYTProf and i'm getting that Mojo::Reactor::Poll::one_tick() is called 39616 times, even though Mojo::Reactor::EV is loaded
14:40 mire joined #mojo
14:41 batman oh... Mojo::IOLoop->singleton->reactor == Mojo::Reactor::EV but Mojo::IOLoop->new->reactor is Mojo::Reactor::Poll (!)
14:44 batman perl -MMojo::IOLoop -e'warn join "\n", Mojo::IOLoop->singleton->reactor, Mojo::IOLoop->new->reactor' # how is this possible?
14:48 batman sri: ^^ any idea?
14:56 gryphon joined #mojo
15:03 sri batman: https://github.com/kraih/mojo/blob/master/lib/Mojo/Reactor/EV.pm#L17
15:04 batman oh.
15:04 batman so it means that Mojo::UserAgent is slower in blocking mode than in non-blocking?
15:05 sri batman: you're the one profiling
15:05 batman i'm just guessing since i would suppose EV is faster than pure-purl :)
15:05 sri don't guess, profile
15:06 batman ok
15:06 sri not that it matters... since we can't change it anyway
15:06 batman right. get it now.
15:09 sri oh, i was just about to suggest adding fork safety, but you already got that :)
15:11 batman it's not perfect though.
15:11 batman i need to move the code i think...
15:11 batman more testing will tell :)
15:12 sri useragent has a good test
15:12 sri https://github.com/kraih/mojo/blob/master/t/mojo/user_agent.t#L347
15:12 sri surprisingly easy to test
15:12 batman yeah, i was thinking about stealing that :)
15:14 sri i guess you can pretty much cut n paste the mango test https://github.com/kraih/mango/blob/master/t/connection.t#L133
15:17 rawler joined #mojo
15:18 Adura joined #mojo
15:20 batman nice :)
15:22 batman Mojo::Redis2 benchmark PING: non-blocking: 17771.72/s, blocking: 7273.73/s
15:23 batman not very fast, but hopefully fast enough :)
15:23 sri single connection?
15:23 batman yes
15:24 sri i'm sure the start/stop also costs every time
15:24 sri you could benchmark it better
15:24 sri Mojo::IOLoop->singleton->reactor(Mojo::Rewactor::Poll->new);
15:24 batman oh. i'm actually cheating: i'm preparing all the commands and then do ->execute
15:24 sri after that blocking will use EV
15:25 batman http://p.thorsen.pm/8eca5922b3c5
15:25 batman i don't really care about blocking :P
15:26 batman hehe
15:26 sri wait, just one operation? Oo
15:26 sri that's terrible!
15:27 batman what do you mean? the benchmark code, or the actual performance?
15:27 sri benchmark code
15:27 sri the results seem pretty much useless
15:28 batman what i think i'm benchmarking: the inner workings that parse messages.
15:28 sri you want to run at least 10 seconds to get a feel for actual performance
15:29 batman i'm setting BENCHMARK=100000
15:29 sri even worse
15:29 sri that's one batch, not 100000 roundtrips
15:30 batman it's 100000 roundtrips since i'm not running with pipelining
15:30 batman send PING, wait for response, send PING, ...
15:31 sri oh, i do not understand the api then
15:32 batman $redis->ping; # queue the PING command
15:32 batman $redis->execute; # start dequing
15:32 disputin joined #mojo
15:34 c--__ joined #mojo
15:34 batman i guess i need to change the api then...
15:36 sri so there is no oneshot methods? you always make a batch and execute it?
15:37 batman you can "cheat" and do $self->ping(sub { }); # which will call ->execute(sub {}) internally
15:43 batman i think i need a bulk object after all.
15:43 batman i think i can get rid of ->execute that way
15:44 kyshtynbai are 30 random genarated (with pwgen) symbols good enough for 'secret phrase' for signed cookies?
15:45 sri you can
15:45 batman sri: "you can" --> was that to me?
15:45 sri yes
15:45 batman ok
15:46 batman kyshtynbai: i just do $self->secrets(["i_am_c00ler_than_a_fridge"]); so i think you will be fine
15:46 sri bulk object is how i would have done it (actually did in mango)
15:46 batman sri: meaning all the $redis->get, set, ... will be blocking/non-blocking right? no need for calling an extra method?
15:47 sri right
15:47 * batman need to think about it :)
15:47 batman it makes sense, but it's a bit annoying
15:47 sri and $redis->batch->get->get->get->execute for batches
15:48 sri and $redis->batch->pipeline->get->get->get->execute i guess
15:48 batman should each batch use a new connection or re-use the "main" connection?
15:48 kyshtynbai batman: thanks).
15:48 sri doesn't seem annoying to me
15:48 sri just like it works now
15:49 batman but it doesn't really work now :/
15:49 sri oh
15:50 batman anyway. i got some pondering to do.
15:50 batman this is quite some work... hopefully it won't suck completely.
15:50 c--__ how to i change the behavior of Mojo::URL::query() to behave just like Mojo::Util::url_escape? see http://paste.debian.net/106877/
15:53 batman c--__: why do you want that?
15:54 c--__ batman: i'm building a url for another application (deep link) and this application wants the format produced by url_escape
15:54 batman kyshtynbai: if you want to be safe, then make sure you rotate the secrets and never let anyone else get a hold of them.
15:55 c--__ batman: i could just do string concatination (url->to_string.url_escape("val 1/2")) but i thought maybe query() can do the same thing, maybe there's a format switch i haven't found yet?
15:56 kyshtynbai batman: how often should I rotate them?
15:57 disputin joined #mojo
15:59 batman c--__: i think you're out of luck... could you please tell me the name of the app so i can avoid it?
15:59 rem_lex joined #mojo
16:00 batman kyshtynbai: not sure. not so often that it's annoying :)
16:00 batman kyshtynbai: adding a new secret is ok, but when you remove an old one the session is invalid, so you could add new secrets once a day and then remove the old one after seven days.
16:01 batman but then if you have a visitor that's only visiting the webpage once a month he/she has to authenticate again
16:01 Adura Rotate as often as the question of HMAC-SHA1's security comes up in your mind.
16:01 batman if that sucks, then maybe doing it a bit less often is a good idea :)
16:03 batman *bbl*
16:04 c--__ batman: ok so i will do string concatination, thanks. well i cannot go into much details but it's from the great bmc corporation...
16:04 Adura Where the c doesn't stand for corporation.
16:20 Jonneh joined #mojo
16:21 dotan joined #mojo
16:26 disputin joined #mojo
16:54 sujithm joined #mojo
17:04 kyshtynbai batman: I see. Thanks!
17:10 stephan48 joined #mojo
17:11 klapperl_ joined #mojo
17:23 basiliscos joined #mojo
17:24 mire joined #mojo
17:41 genio damn our connection sucks now that everyone in the office is apparently watching the soccer match
17:42 meshl joined #mojo
17:42 tianon don't you guys have a bigscreen or something you can just throw it up on once so everyone isn't hogging it?
17:42 tianon :)
17:47 genio we're on too many floors and in too many separate areas for that to work well.  I think the match is close to being over though
17:47 tianon ah
17:50 genio Germany is beating the US, so maybe I won't have to hear about soccer for another 4 years.  Unless (under the strange non-bracket system they have) the US still advances somehow in the voodoo that is FIFA rules
17:51 * genio can't parse FIFA  (ties allowed, arbitrary extra time that nobody knows how much there will be until it starts, some point system used since people can tie, etc.
17:52 dod joined #mojo
17:53 crab and no biting. what's up with that?
17:54 genio and worse acting than in the WWE (or whatever it's called)
17:54 sri germany and the us go into the next round
17:54 genio We advance after a loss?
17:55 sri first round is about points
17:55 sri second is knock out
17:56 sri this was more like a qualifying round
17:59 genio well, I guess what could I expect from an acronym that contains both "federation" and "association".  sigh.
17:59 genio FIFA = http://weknowmemes.com/wp-content/uploads/2012/04/looks-like-its-fuck-this-shit-o-clock.jpg
17:59 sri you might even get belgium or so for the first knock out game and advance further ;p
18:02 mattastrophe joined #mojo
18:03 neyasov joined #mojo
18:17 zivester joined #mojo
18:21 Ptolemarch joined #mojo
18:25 dod joined #mojo
18:38 Eke- joined #mojo
18:45 Bravo13 joined #mojo
18:51 disputin joined #mojo
18:52 mire joined #mojo
19:14 meshl joined #mojo
19:37 ua_ joined #mojo
19:56 * tempire is sold on postfix dereferencing
20:00 lb and hash-slices
20:00 * lb is forcing work project onto 5.20 and damn the torpedos
20:01 Ptolemarch joined #mojo
20:03 * sri is glad the experimental pragma exists
20:06 fhelmber_ joined #mojo
20:10 lb i don't think i've ever selected perl-version, except for say, // and /r
20:11 lb 5.20 has lots of features i want
20:18 genio I didn't like postfix dereferencing as much as the slicing
20:35 Ptolemarch joined #mojo
20:47 sri wish we could use those features already in mojolicious :S
20:49 genio pffft.  according to @others, you have to support 10 year-old Perl releases because RHEL.  None of this new-fangled crap!
20:49 sri ok :(
20:52 kyshtynbai joined #mojo
20:53 * lb forces sri to write 5.003 code forever
20:55 meshl joined #mojo
20:56 btyler kind of on the bleeding edge, don't you think? perl 4 would be a much safer choice
20:56 btyler I chatted with a guy at a node meetup recently who was adamant that perl 5 ruined perl
20:56 neilhwatson Back to the AIX bunker you.
21:18 disputin joined #mojo
22:03 meshl joined #mojo
22:13 neyasov joined #mojo
22:23 stephanj joined #mojo
23:01 * sri wonders who is still working on a mojolicious book
23:04 neyasov joined #mojo
23:17 meshl joined #mojo
23:22 neyasov joined #mojo
23:26 neyasov joined #mojo
23:29 mattastrophe joined #mojo
23:37 tempire who indeed
23:37 purl indubitably
23:46 neyasov joined #mojo
23:48 neyasov_ joined #mojo
23:51 chansen joined #mojo
23:56 mattastrophe joined #mojo

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