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

IRC log for #mojo, 2014-01-30

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

All times shown according to UTC.

Time Nick Message
23:09 Akron joined #mojo
23:10 bowtie_ joined #mojo
23:19 tempire joined #mojo
23:19 * tempire creeps in
23:20 * tempire looks for the motivation to fix his irc bouncer
23:36 Akron I'm jealous of everyone who has one.
23:46 maxhq joined #mojo
23:47 dvinciguerra joined #mojo
23:47 Akron Just wrote a little debug helper for templates (<%= debug_template __FILE__, begin %>...<% end %>) to show the template name (in xml comments) at the start and end of an html template and thought: Wouldn't this be a nice feature for MOJO_TEMPLATE_DEBUG?
23:49 Akron (I was surprised that this even worked for inline templates)
23:51 mire joined #mojo
00:09 btyler_ joined #mojo
00:15 sri Akron: you drunk? perl -Mojo -E 'a({inline => q{%= __FILE__}})->start' get /
00:18 Akron sri: Sorry, data-section templates, not inline templates.
00:18 Akron Unfortunately sober.
00:21 sri anyway, making __FILE__ work is a feature https://github.com/kraih/mojo/blob/master/lib/Mojo/Template.pm#L98
00:21 sri also makes all exception messages sensible
00:22 sri magical comments \o/
00:22 Akron That's really nice.
00:27 d4rkie joined #mojo
00:27 d4rkie joined #mojo
00:30 marty joined #mojo
00:41 marty joined #mojo
01:04 laouji joined #mojo
01:09 Akron joined #mojo
01:33 sri apparently the openshift people want feedback on their directory layout, i've never used openshift, but maybe someone here has something to say? https://twitter.com/VojtechVitek/status/428687648220123136
01:40 ka2u joined #mojo
01:44 laouji joined #mojo
01:47 laouji joined #mojo
02:01 Akron left #mojo
02:16 cleverfox joined #mojo
02:29 klapperl joined #mojo
02:43 geck so.. I need a basic IO Loop for a support application for my mojo app (writes to memcached, that my mojo app then reads from)
02:44 geck can Mojo::IOLoop be used in that way
02:44 geck or do I need to bring in something more complex?
02:57 nicomen_ try?
02:57 purl just a little bit harder !
02:57 geck lol
02:57 * geck grumbles
02:57 geck seems easy enough :P
03:15 btyler joined #mojo
03:37 ka2u joined #mojo
03:51 asarch joined #mojo
03:57 ka2u joined #mojo
04:24 jberger joined #mojo
04:24 jberger I'm just catching up
04:24 jberger And I haven't read through all the patches yet ...
04:24 jberger But I love it!
04:25 jberger sri += 3
04:25 jberger These have been the least hackable parts,  And ones I've wanted to hack on occasion
04:26 jberger I know others have too
04:26 jberger This is great
04:27 tempire_ joined #mojo
04:30 jberger_ joined #mojo
04:30 * jberger_ is so excited he jumped out of his irc client
04:45 * tempire_ segfaults
04:45 purl No whammies!
04:51 sri \o/
04:52 good_news_everyone joined #mojo
04:52 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/rY-f3A
04:52 good_news_everyone mojo/master faac71b Sebastian Riedel: added tests and recipe for custom exception rendering
04:52 good_news_everyone left #mojo
05:15 irq joined #mojo
05:17 laouji joined #mojo
05:17 ka2u joined #mojo
05:45 irq_ joined #mojo
06:00 Bender joined #mojo
06:05 dotandimet joined #mojo
06:16 hesperaux_ joined #mojo
06:26 hesperaux__ joined #mojo
06:37 dotandimet1 joined #mojo
06:38 dod joined #mojo
06:54 dod joined #mojo
06:58 Vandal joined #mojo
07:17 dpetrov_ joined #mojo
07:23 ka2u joined #mojo
07:32 stl joined #mojo
07:32 tianon joined #mojo
07:32 stl joined #mojo
07:35 batman https://github.com/jhthorsen/mojo-redis-timeseries # anyone who want to comment on this api?
07:48 dod joined #mojo
07:59 kanishka joined #mojo
08:04 rawler joined #mojo
08:09 kwa sri++ # before_render and accepts
08:10 kwa Really like that I don't need to check the stash for the format.
08:14 Bravo13 joined #mojo
08:23 inokenty joined #mojo
08:31 trone joined #mojo
08:37 odc joined #mojo
08:38 dod joined #mojo
08:51 rem_lex joined #mojo
08:52 D4RK-PH0ENiX joined #mojo
09:09 basiliscos joined #mojo
09:16 maxhq joined #mojo
09:33 maxhq1 joined #mojo
09:37 cleverfox joined #mojo
09:50 maxhq joined #mojo
10:02 dvinciguerra joined #mojo
10:05 dod joined #mojo
10:07 maxhq1 joined #mojo
10:09 irq joined #mojo
10:14 Su-Shee joined #mojo
10:14 Su-Shee hi everyone.
10:14 purl Howdy, Su-Shee, you fantastic person you.
10:15 moritz oh hai
10:15 Su-Shee I'm collecting good mojo articles. of course I never bookmark anything, that's why I have pinboard ;) who besides glen hinkle has written good mojo articles? I remember two people.
10:16 KindTwo joined #mojo
10:16 test123 joined #mojo
10:16 test123 joined #mojo
10:20 michael Is there a recommended way to log easily with JSON? or would something like this make sense ? https://gist.github.com/mjemmeson/8705760
10:26 maxhq joined #mojo
10:27 Su-Shee I don't know, I never log in JSON, I always log "plain"...
10:27 kwa Su-Shee: check out jberger's on blogs.perl.org.
10:28 irq joined #mojo
10:28 Su-Shee kwa: ah, yes, that was the xx part tutorial about non-blocking.. now I remember.
10:29 crab i write lousy, outdated articles about mojo.
10:29 crab well, they're not outdated when i write them, of course.
10:29 d4rkie joined #mojo
10:30 crab michael: your code seems like it makes sense. but--out of curiosity--why do you want to log JSON?
10:32 michael standardise across various apps and then can use various tools to search them (logstash, splunk, etc)
10:33 crab i see.
10:35 hummeleBop joined #mojo
10:36 maxhq1 joined #mojo
10:36 michael couldn't see a way or ordering keys with Mojo::JSON though (to make them more human readable) hence using JSON::to_json...
10:40 kanishka1 joined #mojo
10:40 kanishka1 joined #mojo
10:45 marcus hey Su-Shee :)
10:45 marcus Su-Shee: I think batman has some nice articles as well - http://thorsen.pm/blog/
10:46 Su-Shee marcus: never even seen those :(
10:48 batman there's only a few though...
10:48 Su-Shee well a few good ones is all that's needed.
10:48 batman :D
10:49 batman Su-Shee: is it for your own, or for some other purpose you're collecting ?
10:50 Su-Shee I'm collecting in general and as contemporary Perl stuff is nowhere mentioned and nothing is written about a lot of things I scrape together that little that exists..
10:51 batman ok.
10:52 batman do you follow http://perlweekly.com/ ?
10:53 Su-Shee yes, I basically follow everything.
10:53 batman ok :)
10:58 jack joined #mojo
11:16 ver joined #mojo
11:20 KindTwo joined #mojo
11:22 laouji joined #mojo
11:26 tester3666 joined #mojo
11:27 tester8354 joined #mojo
11:27 tester8354 hi
11:27 purl hi, tester8354.
11:27 tester3666 yahoo
11:27 dpetrov_ google
11:27 tester3666 ok
11:27 dpetrov_ duckduckgo
11:27 purl duckduckgo is probably mostly written in perl.
11:27 dpetrov_ :)
11:43 Su-Shee sri: if you're collecting mojo based apps -> bpmedley's sparky looks nice enough on smartphones to post it.
11:44 laouji joined #mojo
11:54 tianon joined #mojo
11:57 batman grumpify.com and getbetsy.com is written in perl ;)
11:59 batman redis-cli -a xxx -h db8.nm2.telenor.net monitor # overraske over at det skjer så lite...
11:59 batman men køene på cmp1 er tomme, så det må vel stemme
11:59 batman wrong channel :P
12:01 batman marcus: i think we need to support different backgrounds or something so i can see the difference between company chat and magnet :)
12:02 * batman tar turen til fbu snart...
12:02 batman ARG!
12:02 * batman closes window
12:02 Adura Write a perl script that prevents you from foreign languaging in this channel.
12:03 batman convos _is_ perl
12:04 Adura Well, a convos plugin, then!
12:04 sjn Adura: what do you mean, batman isn't talking foreign? :) </one_who_reads_norwegian>
12:05 Adura Snart you.
12:05 batman Adura: https://github.com/Nordaaker/convos/issues/42 :)
12:06 Adura Exactry.
12:11 nic my flash problems were just cos I was using both flash(message =>) and stash(message =>); just had to decide which should have priority
12:20 irq joined #mojo
12:35 laouji joined #mojo
12:45 maxhq joined #mojo
12:47 maxhq1 joined #mojo
13:13 maxhq joined #mojo
13:19 tianon joined #mojo
13:26 jberger joined #mojo
13:28 tianon joined #mojo
14:15 dvinciguerra joined #mojo
14:20 ryozi joined #mojo
14:24 stephan48 joined #mojo
14:24 __mkrull joined #mojo
14:24 mfontani joined #mojo
14:25 al joined #mojo
14:25 voegelas joined #mojo
14:25 Zx3 joined #mojo
14:25 jberger batman: you have opened my eyes http://thorsen.pm/blog/2006/12/23/How_to_secretly_buy_jewlery_to_your_girlfriend.html
14:25 jberger :-P
14:26 jberger batman moar mojo posts!
14:36 mire joined #mojo
14:44 sh4 joined #mojo
14:46 marcus batman: was it inspired by the movie Love, Actually?
14:47 marcus batman: also, excause => excuse
14:56 ka2u joined #mojo
15:02 asarch joined #mojo
15:03 sri Su-Shee: i do not, but there's a wiki page https://github.com/kraih/mojo/wiki/Projects-and-Companies-Using-Mojolicious
15:10 btyler joined #mojo
15:11 * sri wonders how much ruby gc actually sucks for massively concurrent servers
15:12 sri i complain a lot about perl gc... but one thing it has going for it is predictability, there won't ever be pauses
15:13 sri with a GIL and stop the word gc it seems like you get the worst of both worlds
15:13 sri *+l
15:14 sri having to do this just to handle one request at a time really sucks http://tmm1.net/ruby21-oobgc/
15:18 sri node.js seems to be using incremental gc now, which is quite a bit better
15:18 moritz does node.js use V8?
15:19 sri ye
15:19 marcus sri: didn't ruby recently revamp their vm again?
15:19 sri marcus: yea, still stop the world though
15:20 marcus So far I've had 0 problems with the ruby gc, fwiw. Haven't really taxed it hard tho.
15:21 sri have you actually done latency benchmarks?
15:22 marcus nope.
15:22 marcus so it ain't worth much :)
15:30 dotandimet joined #mojo
15:31 btyler_ joined #mojo
15:54 ka2u joined #mojo
15:57 marty joined #mojo
16:04 good_news_everyone joined #mojo
16:04 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/Npb17A
16:04 good_news_everyone mojo/master af12908 Sebastian Riedel: more links to commands
16:04 good_news_everyone left #mojo
16:06 arthas joined #mojo
16:06 Su-Shee can I point the renderer to json_encode and bypass templates completely?
16:07 moritz Su-Shee: $self->render(json => $yourdata) does exactly that
16:09 Su-Shee moritz: can I put that somewhere to be enabled globally?
16:12 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Rendering_JSON
16:14 Su-Shee yes, I know how to render something specific to JSON - but how would I go about it to render everything in general to JSON by default? Or do I have to set json in each and every render method?
16:15 good_news_everyone joined #mojo
16:15 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/CdGzWQ
16:15 good_news_everyone mojo/master 42a9b69 Sebastian Riedel: link to Mojo::JSON for details
16:15 good_news_everyone left #mojo
16:15 sri Su-Shee: question makes no sense i'm afraid
16:15 sri what's a "render by default"?
16:17 punter joined #mojo
16:18 Su-Shee I call a render method whereever needed. I pass in json => $mydata. do I have to do that in every render method I call or can I set the renderer to JSON globally so I don't have to pass in json => ... every time?
16:19 sri where else would you pass the data structure?
16:20 Su-Shee sri: that why I'm asking - because I don't no. and it seems the answer is "yes, you have to pass it every time" is it?
16:20 Su-Shee know.
16:20 sri i'm trying to understand why you think it could be any other way
16:22 bluescreen joined #mojo
16:22 sri it's not strictly the render call, but the stash value
16:22 sri perl -Mojo -E 'a({json => {lulz => 1}})->start' get -v /
16:23 Su-Shee sri: because I made it in catalyst so I have a JSON view which is always applied via this action stuff.. so I expected an equivalent mechanism in Mojo.. whatever is appropriate in Mojo's design philosophy...
16:23 batman jberger: I've considered deleting the old blogposts. They are awful :/
16:23 sri forget everything you know from catalyst
16:23 purl sri, I didn't have anything matching everything you know from catalyst
16:23 batman I really wish I had blogging in my blood. I need to get more out.
16:24 Su-Shee well as with other things "doing it every day" helps.. :)
16:24 batman marcus: no. It was all me.
16:25 sri i don't remember it working much different in catalyst though... you pass around stuff through the stash as well
16:25 Su-Shee sri: can't I use render_after for something like this?
16:25 sri Su-Shee: you've got more reading to do!
16:25 Su-Shee sri: well I have it running in catalyst, but I want to get rid of catalyst.
16:26 Su-Shee sri: gladly. what do I read?
16:26 sri the guides... all of them!
16:27 sri http://mojolicio.us/perldoc#TUTORIAL
16:27 Su-Shee I already did at least two years ago. all of them.
16:27 sri hahahahaha
16:27 purl LOLCON 5 reached.
16:27 sri two years... that's cute ;p
16:27 sri you know how much changed since then? :)
16:28 jberger I'm probably about ready for a re-read
16:28 jberger It's been about 6 months
16:28 jberger :-)
16:28 Su-Shee sri: ah just forget the question, really. I'll find out somehow on my own.
16:28 * sri has been constantly updating the docs since 1.0
16:30 Su-Shee yes. and I first looked into the docs before I asked here. as I always do. but anyways. I'll find something.
16:31 btyler joined #mojo
16:32 sri hmm, still no answer on my Compress::Raw::Zlib ticket :(
16:33 sri you'd think a security issue would be taken a little more serious
16:34 jberger ZIP BOMB ALL THE THINGS!!!
16:34 sri -.-
16:34 sri well, at least mojolicious is safe
16:38 mire joined #mojo
16:47 sri to answer my own question... this is how much changed in two years :o https://github.com/kraih/mojo/blob/master/Changes#L1502
16:48 * sri just had to look it up
16:59 Su-Shee left #mojo
17:00 kwa Su-Shee: As a simple approach, you could create a helper which always renders JSON. http://pastebin.com/azePFGrJ
17:00 kwa (If that's what you mean.)
17:06 sri hmm, i wonder if it's worth optimizing Mojo::Util::xml_escape for the case where nothing needs to be escaped
17:06 sri we generally just throw it arbitrarily at stuff to make it safe
17:07 abra joined #mojo
17:08 sri change can double the performance when nothing needs to be escaped
17:08 purl sri: that doesn't look right
17:08 sri oi!
17:10 sri Mojo::DOM and EP template use come to mind
17:10 sri how often do you really need to escape?
17:12 sri performance loss for actual escaping is small
17:14 sri in my test case... actual escaping from 5.144s to 5.439s... and no escaping from 7.569s to 3.992s
17:18 arthas joined #mojo
17:20 ka2u joined #mojo
17:21 sri hmm, rendering reddit.com 100 times from a Mojo::DOM object goes from 2.507s to 2.393s
17:24 good_news_everyone joined #mojo
17:24 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/hFD-EA
17:24 good_news_everyone mojo/master 9514fb5 Sebastian Riedel: improved xml_escape performance significantly when no escaping is necessary
17:24 good_news_everyone left #mojo
17:24 sri seems well worth it
17:26 sri have to consider every <%= $foo %> is an xml_escape call that prolly doesn't need escaping
17:31 sri interesting but maybe no big surprise i guess... s/([&<>"'])/_escape_char($1)/ge completely ruins escaping times
17:34 bowtie joined #mojo
17:45 dod joined #mojo
17:48 zM joined #mojo
17:48 beyondcreed joined #mojo
17:55 zM joined #mojo
18:00 cleverfox joined #mojo
18:07 irq joined #mojo
18:15 zM joined #mojo
18:23 sri oh
18:23 sri s/([&<>"'])/$ESCAPE{$1}/ge is actually quite fast
18:23 sri interesting
18:27 sri yea, wins at everything
18:28 tianon so since you're down to just one regex, is it still faster to have the check?
18:28 sri nope
18:29 tianon very nice :D
18:29 sri just didn't expect that string eval to be so much faster without a function call
18:34 good_news_everyone joined #mojo
18:34 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/xJec6w
18:34 good_news_everyone mojo/master ddff39c Sebastian Riedel: improved xml_escape performance in all use cases
18:34 good_news_everyone left #mojo
18:37 sri lol
18:38 sri checking some other shortcuts nobody ever questioned... and found one that makes things worse
18:44 good_news_everyone joined #mojo
18:44 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/s_1RhA
18:44 good_news_everyone mojo/master 4b329bd Sebastian Riedel: improved html_unescape and url_unescape performance slightly
18:44 good_news_everyone left #mojo
18:44 sri http://cdn.ebaumsworld.com/picture/mc03steve/DEMOT1.JPG
18:46 sri it's actually measurable in a micro http benchmark :O
18:47 sri from 3100 rps to 3250
18:47 dod joined #mojo
18:49 good_news_everyone joined #mojo
18:49 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/XtQJ4g
18:49 good_news_everyone mojo/master a3ba3f3 Sebastian Riedel: fixed typo in Changes
18:49 good_news_everyone left #mojo
19:08 sri that's the problem when you're "fast enough"... nobody bothers profiling ;p
19:41 dpetrov_ joined #mojo
19:42 asarch joined #mojo
19:48 mire joined #mojo
19:51 dpetrov_ joined #mojo
20:01 jberger sri++
20:33 bodgix joined #mojo
20:35 bodgix joined #mojo
20:37 lukep joined #mojo
21:03 good_news_everyone joined #mojo
21:03 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/re7RJA
21:03 good_news_everyone mojo/master 81c398b Sebastian Riedel: reduce method calls
21:03 good_news_everyone left #mojo
21:21 damaya joined #mojo
21:22 damaya I know how to do $dom->at('body'), but I was wondering how to do that for </body>?
21:24 good_news_everyone joined #mojo
21:24 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/eelhIw
21:24 good_news_everyone mojo/master 3d8789b Sebastian Riedel: simplify pattern handling
21:24 good_news_everyone left #mojo
21:29 tianon damaya: the object returmed from $dom->at('body') represents the entire <body>...</body> tree/block
21:29 tianon *returned, even
21:29 trone joined #mojo
21:31 damaya oh yeah
21:31 damaya haha, thanks
21:35 tianon :)
21:56 drift joined #mojo
22:42 good_news_everyone joined #mojo
22:42 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/91LZgw
22:42 good_news_everyone mojo/master 9b840f9 Sebastian Riedel: small optimizations
22:42 good_news_everyone left #mojo
22:48 marty_ joined #mojo

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