Camelia, the Perl 6 bug

IRC log for #mojo, 2013-05-30

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

All times shown according to UTC.

Time Nick Message
00:06 heytrav joined #mojo
00:27 shmuel joined #mojo
00:31 inokenty joined #mojo
01:00 jb360 joined #mojo
01:10 SirG joined #mojo
01:57 Meiermann joined #mojo
02:04 SirG joined #mojo
02:22 egopro joined #mojo
02:23 btyler joined #mojo
03:01 zivester joined #mojo
03:02 zivester joined #mojo
03:11 zivester joined #mojo
03:12 wruppert joined #mojo
03:30 fildon_ joined #mojo
03:34 russum Doesn't http://mojolicio.us/perldoc/Moj​olicious/Guides/Cookbook#Nginx make both nginx and hypnotoad handle static content one after another? Wouldn't it be more optimized if static content would be taken from /public/ directly by nginx and thus probably saving some CPU/RAM?
03:36 russum I mean right now - hypnotoad reads the static file and then gives it to nginx which then gives it to the browser, nginx can probably better handle static content, but I am not sure about this
03:42 preflex_ joined #mojo
03:43 human39 joined #mojo
03:54 egopro joined #mojo
03:59 zivester joined #mojo
04:01 zivester joined #mojo
04:17 edenc joined #mojo
04:22 mike_ joined #mojo
04:22 duncanthrax joined #mojo
04:29 ver joined #mojo
04:59 KindOne joined #mojo
05:07 moltar joined #mojo
05:08 d4rkie joined #mojo
05:10 Meiermann joined #mojo
05:10 d4rkie joined #mojo
05:13 d4rkie joined #mojo
05:42 mire joined #mojo
05:43 keedi joined #mojo
05:46 suy joined #mojo
05:49 sh4 joined #mojo
05:49 Britzel_ joined #mojo
05:52 KindTwo joined #mojo
05:59 mire joined #mojo
06:05 cooper joined #mojo
06:05 periapt joined #mojo
06:17 mattp joined #mojo
06:18 dod joined #mojo
06:32 basiliscos joined #mojo
06:41 davido joined #mojo
06:50 denisboyun joined #mojo
06:58 yakudza joined #mojo
07:01 kwa russum: It's referring to using Nginx as a reverse proxy. If you set sane headers for cache control it will actually reduce the amount of hits to your app.
07:12 KindOne joined #mojo
07:13 dod joined #mojo
07:23 dod joined #mojo
07:24 moltar joined #mojo
07:29 Vandal joined #mojo
07:45 nicolaas joined #mojo
07:51 jzawodn joined #mojo
08:36 davido left #mojo
09:01 dod joined #mojo
09:21 dotan joined #mojo
09:33 mkrull joined #mojo
10:18 maxhq joined #mojo
10:28 tagg joined #mojo
10:30 denisboyun joined #mojo
10:30 mire joined #mojo
10:33 tagg joined #mojo
10:38 tagg joined #mojo
10:43 tagg joined #mojo
10:59 tagg joined #mojo
11:04 tagg joined #mojo
11:29 tagg joined #mojo
11:39 mire joined #mojo
11:44 libsysguy joined #mojo
11:59 moltar joined #mojo
11:59 whitebook1 joined #mojo
11:59 suy joined #mojo
12:12 ynonp joined #mojo
12:35 libsysguy is there a nifty trick for having morbo restart after changes?
12:41 mkrull morbe does restart your app on changes
12:41 mkrull *morbo
12:41 libsysguy does it output to STDOUT when it does?
12:41 libsysguy or is it just super stealthy :p
12:42 mkrull it is ;)
12:42 libsysguy silly morbo, okay thanks mkrull
12:43 Britzel_ You wil lsee a 'read config file' line in the log, as long as you use the config plugin.
12:43 * libsysguy needs to do that
12:43 jberger or just print something (or log) in your startup method
12:44 libsysguy I guess I could just quit being paranoid
12:44 mkrull or use the MORBO_DEBUG environment variable. or is it no more?
12:44 libsysguy im sure it doesn't take more than a second to restart
12:45 libsysguy mkrull I don't see that one giving me anything else
12:46 libsysguy is there anything on the differences between render and stash?
12:50 jberger extra pairs (key-values) passed to render are merged into the stash
12:50 libsysguy oh
12:50 libsysguy well that is…something I had not considered
12:51 jberger so you can stash things at any time, or pass pairs to render to stash them "just in time"
12:52 libsysguy forgive me if this is a dumb question: what is the advantage or using render over stash?
12:53 libsysguy I don't really understand the "just in time" idea
12:53 sri morbo -v
12:53 jberger its just as shortcut
12:53 jberger s/as/a/
12:53 libsysguy okay, thanks jberger++
12:53 libsysguy also thanks sri++
12:53 Britzel_ Sometimes you just need render, for example when you return a special status, or json data etc. And while you are at it, you can just pass some more items, which will go in the stash.
12:54 libsysguy oh I get it
12:55 libsysguy so render is like "render this" and then poke this extra stuff in the stash
12:55 libsysguy stash is just stashing everything, but you can pass a render variable with the "template" key
12:56 sri render also renders right away with the current controller, while auto rendering only triggers after the action with the default controller
12:58 libsysguy ah
12:58 libsysguy okay well that makes sense
12:58 libsysguy and may be why I'm getting the error I have
12:59 sri http://mojolicio.us/perldoc/Mojoliciou​s/Guides/Rendering#Automatic_rendering
13:00 libsysguy that is actually way more handy than I thought it would be
13:00 libsysguy the ability to render different content types is fantastic
13:00 libsysguy rather than having to print to the body of the response
13:07 dod joined #mojo
13:23 dpetrov_ joined #mojo
13:27 dod1 joined #mojo
13:56 bluescreen joined #mojo
13:58 sri neat, working with certificates was such a pita before https://metacpan.org/module/IO::Socket::SSL::Utils
13:58 d4rkie joined #mojo
13:58 alester joined #mojo
13:59 libsysguy well my project just got a little easier
13:59 libsysguy thanks sri :)
13:59 MeierM joined #mojo
14:08 libsysguy so I have a route defined like so: http://pastebin.com/B1LP3vXR
14:08 libsysguy and it results in page not found
14:08 libsysguy I can see from a dbix trace the correct query is buing executed
14:09 libsysguy the function looks like http://pastebin.com/SxDazL84
14:10 libsysguy is there anything obvious of what I might be doing wrong
14:19 jberger what does the resultset method show do?
14:21 libsysguy it just gets and returns a DBIx::Class resultset http://pastebin.com/5dyw4Bff
14:22 libsysguy I added a new route and it shows up in the routing table for the error page
14:22 sh4 joined #mojo
14:23 libsysguy I also added a route with a sub attached to just print "Hello" and that worked as well
14:23 libsysguy I am wondering if it has anything to do with the controller being in MyApp::Controller::Admin rather than MyApp::Admin
14:25 jberger yes
14:25 libsysguy I added this to account for the new namespace   $r->namespaces([qw/MyApp::Controller MyApp::Schema/]);
14:25 libsysguy should I have done something different>
14:26 jberger given what you set, its now looking for MyApp::Controller::Schema::Admin
14:26 egopro joined #mojo
14:26 libsysguy doh
14:28 Vandal joined #mojo
14:28 Vandal joined #mojo
14:29 libsysguy so I basically need to remove the Schema namespace
14:29 whitebook joined #mojo
14:33 libsysguy okay its definitely in the sub in the controller
14:33 libsysguy I did a text render and it worked
14:34 KindOne joined #mojo
14:40 * jberger just discovered the mongo/mango ->save method
14:40 * jberger wonders how he missed that before?! <3
14:49 KindOne joined #mojo
14:57 asarch joined #mojo
14:58 libsysguy jberger I finally figured it out
14:58 libsysguy it was the template
14:59 libsysguy I was trying to render a tt template and it was trying to pick it up as an ep template
14:59 jberger you know, I almost mentioned that
15:00 libsysguy but you thought…surely libsysguy can't be that dense
15:00 libsysguy :p
15:00 jberger :-)
15:01 AndroUser joined #mojo
15:01 jberger just a note, unless you already have lots of tt templates, or really love tt, you might want to try ep
15:02 jberger its really nice to be able to just do Perl in your templates
15:02 libsysguy I have been a little resistant to putting perl in my templates
15:02 tomdlux Hi folks
15:02 * jberger can never seem to figure out how to do things in tt
15:02 libsysguy but I am going ot give it a shot
15:02 tomdlux I"
15:02 jberger tomdlux, o/
15:03 libsysguy I've always done tt so its just comfortable, but I think ill give ep a go
15:03 jberger do what's comfortable
15:03 libsysguy is there a preformace hit with using TT as opposed to EP?
15:03 jberger for me it was just easier not to have to learn another syntax, if you already grok tt then there's no real issue
15:04 jberger I don't know, I don't think so
15:04 libsysguy I didnt' think there would be
15:04 kwa Q: What would be the simplest way to program routes that match /companies/:uuid /companies/:uuid/greetings but also /companies and /companies/greetings? (The uuid can be worked out via authentication if it's not passed.)
15:05 kwa The placeholder :uuid slurps 'greetings' when a path doesn't include the uuid. :/
15:06 tomdlux I'm fetching a page which has a table of links. I need to find the row that had a certain text in col 1 and grab the url from col 3. I haven't been able to find examples to work from, that use related fields like that
15:06 tomdlux Hoping to find suggestions
15:08 jberger tomdlux, sounds like find all rows, grep on col 1, then extract on col 3 of the remaining\
15:09 kwa I don't want to have to duplicate routes, but looks like I might have to.
15:09 good_news_everyone joined #mojo
15:09 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/u4P_Hg
15:09 good_news_everyone mojo/master a4aa654 Sebastian Riedel: improved Mojo::Message::Request to allow curly brackets in URLs (closes #498)
15:09 good_news_everyone left #mojo
15:09 jberger kwa, a restriction on what matches :uuid, http://mojolicio.us/perldoc/Mojolic​ious/Lite#Restrictive_placeholders
15:10 sri wonder why chrome and firefox allow curly brackets now though
15:10 jberger sri: why not break something thats not broken, eh?
15:11 sri could have something to do with URL templates
15:12 sri they are becoming popular for HATEOAS
15:12 tomdlux conceptually, jberger, yes .... But be OK ng brand new to mojo, the mechanics confuse me.  I have $mojo->find('tr')->each(), but I don't know what to do with it
15:12 jberger dont each, learn to love Mojo::Collections
15:13 kwa jberger: That would help me weed out company ids that weren't uuids, but it looks like I'll still need to have two routes for each path. /companies/:uuid/greetings and /companies/greetings?
15:13 sri btw. TT is a lot slower than EP
15:13 libsysguy damn it sri
15:13 libsysguy lol
15:14 sri you can look at the chart here :) http://xslate.org/benchmark.html
15:14 jberger kwa, the router really isn't my specialty yet :-)
15:14 sri Text::MicroTemplate is a fork of an early version of Mojo::Template (EP)
15:14 kwa Also TT adds to your dependencies libsys. :p
15:15 jberger sri: I was trying to find that, I was assuming it was something neilb has done, but no luck
15:15 kwa jberger, it's cool, I'll get it I'm sure. :)
15:15 libsysguy I figured it would be faster sri, in my gut i knew
15:15 libsysguy but I had hope
15:16 sri EP gets compiled to perl, so it's basically just as fast as concatenating strings
15:17 sri the other template engines in that benchmark cheat by having their own VMs and stuff like that :)
15:18 jberger sri: it would be nice to get Mojo::Template on that comparison directly
15:19 libsysguy well, the benchmarking script is there
15:19 libsysguy i lied
15:19 libsysguy it 404's
15:21 jberger https://github.com/xslate/p5-Te​xt-Xslate/tree/master/benchmark
15:21 jberger they moved to an organization
15:21 libsysguy ah
15:22 libsysguy oh hey, lestrrat, he put out another project I'm working with, STF
15:22 sri being fast is nice and all, but i'd rather not play the benchmark game ;p
15:22 libsysguy aww c'mon sri, where is your sense of adventure
15:22 jberger ... and being easy to write is also good, which is actually why I <3 ep
15:23 jberger sri has a long history of not liking comparitive benchmarks
15:24 libsysguy dare I ask why
15:24 * libsysguy decides against it
15:24 sri they are all flawed
15:25 jberger getting an apples to apples comparison of the stuff that matters is darn-near impossible
15:25 libsysguy I feel like there is always a spin
15:26 maxhq joined #mojo
15:26 sri just look at http://benchmarksgame.alioth.debian.org
15:27 sri you'd think comparing different programming languages performing the same task would be simple
15:28 sri but it's not the case, some implementations use language idioms and optimizations, others are crude translations of C code by people who have never used the target language before
15:29 sri some use C extensions in interpreted languages, others stick with pure solutions
15:30 sri and don't get me started on the realism of the actual problems
15:32 Adura All you have to do is make your application in all languages.
15:35 jberger blast
15:35 jberger tomdlux: http://pastie.org/7984204
15:38 mire joined #mojo
15:42 sri perl could cheat by solving all those problems in C with XS, but has that any relation to the real world?
15:45 sri or look at the usual node.js micro benchmarks, 10 lines of javascript and all the real work happens in C++
15:46 libsysguy I understand that frustration
15:46 * libsysguy looks at DBI
15:46 * sri loves *good* benchmarks
15:46 sri but they are soooo rare
15:50 sri when you look at something like the framework benchmarks, the numbers mean pretty much nothing http://www.techempower.com/benchmarks/
15:50 sri you have 10 lines of perl vs 1000 lines of java
15:51 libsysguy I think there are too many business factors involved for benchmarks to be an effective tool
15:52 sri shitty ruby servers running against native nginx extensions
15:52 * libsysguy sigh
15:52 libsysguy ruby...
15:53 libsysguy i was just about to complain about having to convert my TT vmethods
15:53 libsysguy then i realized they're all in perl anyway…easy conversion
16:02 denisboyun_ joined #mojo
16:06 kwa Is it possible to have the action as the request method? $r->any('/greetings')->to(controller => 'greetings', action => 'req.method');?
16:07 kwa Hmmm, looks like I might need to use shortcuts.
16:08 Adura joined #mojo
16:12 yakudza joined #mojo
16:14 dod joined #mojo
16:18 karel9 joined #mojo
16:21 dod1 joined #mojo
16:34 whitebook joined #mojo
17:02 sri kwa: btw. you've not commented on the format patch http://pastie.org/7977357
17:03 rem_lex|pivo joined #mojo
17:03 egopro joined #mojo
17:13 libsysguy so I am getting a compilation error in my template, the debugging info isn't very helpful, is there anything that is common that I could look for
17:13 libsysguy I'd paste the template but its pretty big
17:21 libsysguy repo link https://bitbucket.org/libsysguy/mojo_buildapp/src
17:24 bowtie joined #mojo
17:46 jberger libsysguy, it should give you a line number
17:46 jberger the conversion to Perl is pretty straightforward
17:46 jberger on that I usually get wrong is that lines that don't return strings, ie. % lines often need the trailing ;
17:47 jberger where returning lines, ie. %= dont
17:48 libsysguy I think I got it all sorted out, there was a problem in an if elsif that I was trying to do
17:48 libsysguy among other things
17:48 libsysguy :p
17:48 libsysguy not switching all the .'s to ->'s
17:48 libsysguy etc etc
17:49 libsysguy the page renders now, so thats an exciting start :p
17:57 jberger :-)
17:59 mire joined #mojo
18:02 basiliscos joined #mojo
18:05 libsysguy i think I am finally starting to get the hang of it
18:05 libsysguy thanks for all your help jberger and sri
18:07 jberger np, enjoy!
18:22 sri github is down... PANIC!
18:22 libsysguy 0_0
18:23 libsysguy how am I supposed to read the wiki
18:23 libsysguy :p
18:29 sh4 joined #mojo
18:30 basiliscos joined #mojo
18:36 denisboyun joined #mojo
18:53 ynonp joined #mojo
18:57 nelio joined #mojo
18:59 trone joined #mojo
19:07 * sri still wonders if Mojo::Base should just set STDIN/STDOUT/STDERR to :utf8
19:10 chansen ":encoding(UTF-8)" would probably be a better choice
19:12 * sri would be fine with that too
19:13 sri my main worry is about it being too intrusive
19:13 chansen yeah, could ve very annoying if you want to output bytes
19:14 * chansen s/ve/be/
19:22 libsysguy when I see a route defined like /admin then one under it defined +/modules that should give me a url like /admin/modules right
19:29 jberger sri: the problem is that cannot be lexically (or file) scoped right?
19:30 * jberger looks at utf8::all again
19:31 chansen no, it's not lexically scoped
19:32 sri if you change the handle you screw up code that depends on the default, if you encode all output you get screwed by code that messes with the handle :S
19:32 jberger libsysguy, perl -Mojo -E 'any("/admin")->any("/modules" => { text => "hi" }); app->start' get /admin/modules
19:32 jberger :-)
19:33 chansen the open.pm pragama is lexical but the effect is not
19:33 dod joined #mojo
19:34 jberger sri: I think there is only so much we can do with output encoding
19:34 sri yea
19:35 jberger at some point, the users will have to know how to set the encodings in Perl for IO handles
19:35 sri that would get us in trouble
19:35 sri we currently encode all output, if they mess with the handle we're screwed
19:36 jberger is there some way to add a level of indirection?
19:36 jberger open some handle, set its encoding and then direct it somewhere else
19:37 * jberger might be talking out of is *** right now
19:38 sri biggest problem really is Mojo::Log logging to STDERR
19:38 sri Mojo::Commands is kind of a problem too, but not that bad... we could change the encoding on demand there
19:40 chansen Can't Mojo::Log escape characters with codepoints outside US-ASCII,
19:41 sri not sure if that's a good solution either, i know people are logging in russian, japanese and chinese
19:41 chansen mm, would be a lot of escapes
19:56 * sri wasn't aware of "use open ':locale'"
20:01 * sri kinda wants to just add "open::->import(':encoding(UTF-8)', ':std');" to Mojo::Base and call it a day
20:03 Zx3 joined #mojo
20:12 jnbek joined #mojo
20:17 sri oh crap... somehow i thought sysread/syswrite bypass PerlIO
20:17 sh4|2 joined #mojo
20:21 delias joined #mojo
20:23 chansen sri: they do bypass PerlIO, on POSIX OS sysread/syswrite is implemented using read(2)/write(2), but the :utf8 pseudo layer (only a flag) is checked by the ops
20:24 sri oh my
20:36 dsteinbrunner joined #mojo
20:37 good_news_everyone joined #mojo
20:37 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/Z-4EjA
20:37 good_news_everyone mojo/master 1b6ae7c Sebastian Riedel: fixed small portability bugs in slurp and spurt functions of Mojo::Util
20:37 good_news_everyone left #mojo
20:40 cooper joined #mojo
20:42 sri oh wait
20:43 sri i might just have broken windows support :S
20:43 sri :crlf is the default there
20:44 sri i bet Mojo::Template and friends depends on it
20:44 sri although... it's sysread/syswrite... so i have no clue what actually applies
20:46 chansen :crlf isn't applied when you use sysread/syswrite only the :utf8 pseudo layer
20:46 sri ah
20:46 sri :encoding(UTF-8) did affect it as well though
20:47 chansen yes, the :encoding layer implies the :utf8 layer
20:49 sri eeeep
20:51 good_news_everyone joined #mojo
20:51 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/_ZYQMQ
20:51 good_news_everyone mojo/master 17e4b2f Sebastian Riedel: removed portability fix again
20:51 good_news_everyone left #mojo
20:51 sri http://25.media.tumblr.com/tumb​lr_m8rjkmqOZR1rdl5h0o1_1280.jpg
21:11 good_news_everyone joined #mojo
21:11 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/lOfLOg
21:11 good_news_everyone mojo/master e660821 Sebastian Riedel: show how to restart an active timer
21:11 good_news_everyone left #mojo
21:44 good_news_everyone joined #mojo
21:44 good_news_everyone [mojo] kraih tagged v4.08 at 1fed390: http://git.io/jXYSxA
21:44 good_news_everyone left #mojo
22:03 asarch joined #mojo
22:20 good_news_everyone joined #mojo
22:20 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/ZyUSBw
22:20 good_news_everyone mojo/master 7934852 Sebastian Riedel: updated jQuery to version 2.0.2
22:20 good_news_everyone left #mojo
22:25 denisboyun joined #mojo
22:35 abqar_ joined #mojo
22:35 rem_lex| joined #mojo
22:35 bobkare joined #mojo
22:36 memowe joined #mojo
22:44 bayashi joined #mojo
23:11 ajmrch joined #mojo
23:26 mattp_ joined #mojo
23:59 KindOne joined #mojo

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