Camelia, the Perl 6 bug

IRC log for #mojo, 2013-09-14

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

All times shown according to UTC.

Time Nick Message
00:55 jberger_ joined #mojo
01:27 espent joined #mojo
01:29 basic6_ joined #mojo
01:45 duncanthrax2 joined #mojo
01:51 cooper joined #mojo
02:41 dvinciguerra joined #mojo
03:10 preflex_ joined #mojo
03:24 btyler joined #mojo
03:52 toastr joined #mojo
03:52 jberger_ boy I sure would like some toast
03:52 toastr Somebody wants toast? https://i.chzbgr.com/maxW500/7104009216/h0F2119B5/
03:52 jberger_ hehehe
03:52 tianon \o/
03:55 jberger_ its not quite a karma bot yet, but its coming :-)
03:55 tianon toasty :D
03:55 toastr Somebody wants toast? https://i.chzbgr.com/maxW500/7104009216/h0F2119B5/
03:55 jberger_ hmmm, was that just bad luck
03:55 jberger_ I would like some more toast
03:55 toastr mmmmmm toast. https://i.chzbgr.com/maxW500/7782244096/h6AB2D231/
03:56 jberger_ wow, that was some bad luck
03:56 jberger_ the prefix string and the image are both randomized, but you got the same ones I did
03:56 tianon well toast is cool
03:56 toastr What's all this about toast? https://i.chzbgr.com/maxW500/6413855488/hF5930F86/
04:24 toastr joined #mojo
04:25 toastr joined #mojo
04:25 toastr joined #mojo
04:26 jberger_ yay, now its a karma bot
04:26 sri :D
04:26 jberger_ sri++ # mojolicious
04:26 jberger_ batman++ # Mojo::IRC
04:26 jberger_ toastr, karma batman
04:26 toastr batman has 1 karma
04:27 * sri just found an unfixable bug :(
04:27 sri https://github.com/kraih/mojo/blob/maste​r/lib/Mojolicious/Command/inflate.pm#L24
04:28 sri that breaks base64 encoded images
04:28 sri and other binary files
04:28 KindOne joined #mojo
04:28 sri we either support unicode text or binary files :/
04:29 jberger_ hm, I don't think its too bad
04:29 jberger_ inflate is really just a one time thing, and I would only say its a "best try" kind of thing anyway
04:29 sri i just ran into it, and had a hard time tracking down what broke my image
04:31 jberger_ can you detect the (base64) somehow?
04:31 jberger_ doesn't help binary I suppose
04:38 toastr joined #mojo
04:42 ryozi_ joined #mojo
04:44 jberger_ a preview: https://gist.github.com/jb​erger/4f021f383e35fc5a6783
04:46 tianon jberger++ # cool toaster! :)
04:46 toastr A toast! https://i.chzbgr.com/maxW500/6537575424/h44483E74/
04:47 tianon and the perfect random message!  even your new bot likes your work :)
04:47 jberger_ :-)
04:48 jberger_ toastr, what do you think?
04:48 toastr Pepperoni is a great pizza topping.
04:49 jberger_ (didn't see that one coming did you?)
05:10 tianon whoosh :)  pepperoni on toast is pretty good with some cheese, though :P
05:10 toastr mmmmmm toast. https://i.chzbgr.com/maxW500/7782244096/h6AB2D231/
05:21 toastr joined #mojo
05:21 SmokeMachine joined #mojo
05:30 toastr joined #mojo
05:35 toastr joined #mojo
05:36 jberger_ yay more toasts!
05:36 toastr What's all this about toast? https://i.chzbgr.com/maxW500/4757874432/h45645953/
05:38 good_news_everyone joined #mojo
05:38 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/7hEBrg
05:38 good_news_everyone mojo/master a740baf Sebastian Riedel: fixed support for binary files in inflate command
05:38 good_news_everyone left #mojo
05:38 sri actually is fixable
05:38 sri but requires a new method :S
05:42 toastr joined #mojo
05:43 jberger_ sri++
05:43 jberger_ well done
05:43 jberger_ (and I don't think adding "is_binary" is a problem)
05:49 good_news_everyone joined #mojo
05:49 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/xFOjuw
05:49 good_news_everyone mojo/master ca94c9c Sebastian Riedel: fixed recursion bug in inflate command
05:49 good_news_everyone left #mojo
05:49 * sri screwed up a little though
05:50 sri the ->is_binary call would mess up the hash for some reason... making the while/each loop spin forever
05:51 Adurah joined #mojo
05:53 D4RK-PH0ENiX joined #mojo
05:57 good_news_everyone joined #mojo
05:57 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/lBUYCA
05:57 good_news_everyone mojo/master ea6fe49 Sebastian Riedel: small optimizations
05:57 good_news_everyone left #mojo
06:05 cooper joined #mojo
06:21 mavera joined #mojo
06:23 ryozi joined #mojo
06:46 rem_lex joined #mojo
07:10 mire joined #mojo
07:18 d4rkie joined #mojo
07:18 d4rkie joined #mojo
07:18 denisboyun joined #mojo
07:19 d4rkie joined #mojo
07:31 batman jberger_: why do you have BEGIN { $ENV{ANY_MOOSE} = 'Moose' } ?
07:32 batman oh. because of Hailo ?
07:36 chansen joined #mojo
08:01 dod joined #mojo
08:04 sh4 joined #mojo
08:11 dod joined #mojo
08:35 denisboyun joined #mojo
08:39 entro_ joined #mojo
08:54 basiliscos joined #mojo
09:51 Vandal joined #mojo
10:04 maxhq joined #mojo
10:11 denisboyun joined #mojo
11:03 sh4|2 joined #mojo
11:06 mire_ joined #mojo
11:09 tempire joined #mojo
11:15 batman is there a way to do the reverse of $app->static->file(...) ?
11:16 denisboyun joined #mojo
11:18 batman http://p.thorsen.pm/e8b61e1787b7 # maybe something like this?
11:21 batman oops! $rel = $abs :P
11:26 asarch joined #mojo
11:39 KindOne joined #mojo
12:11 batman https://github.com/jhthorsen​/mojolicious-plugin-compress # comments?
13:00 dvinciguerra joined #mojo
13:19 jberger I'm curious if there is a name for this pattern? https://gist.github.com/jberger/4f02​1f383e35fc5a6783#file-toaster-pl-L31
13:19 toastr mmmmmm toast. https://i.chzbgr.com/maxW500/5493833216/hB780FDD5/
13:19 jberger hehe
13:21 jberger The requests are non blocking against the main program but block each other. Seems handy for background initialization
13:23 KindTwo joined #mojo
13:23 ladnaV joined #mojo
13:27 basiliscos joined #mojo
13:47 dod joined #mojo
13:53 KindOne joined #mojo
14:09 jberger__ joined #mojo
14:14 Vandal joined #mojo
14:22 ladnaV joined #mojo
14:23 basiliscos joined #mojo
14:24 D4RK-PH0ENiX joined #mojo
14:38 Vandal joined #mojo
14:45 ladnaV joined #mojo
14:56 Vandal joined #mojo
14:57 imran-uk joined #mojo
14:58 imran-uk hi, i'm trying to get the mojolicious lite_app working under modperl::registry - it's giving me a 404 though
14:58 imran-uk if i comment out the modperl::registry stanza in my vhost then it works as a cgi
14:59 jberger joined #mojo
15:04 imran-uk jberger, hi, same from http://stackoverflow.com/questions/16253879/​is-mojolicious-morbo-is-good-for-production?
15:09 btyler joined #mojo
15:11 punter joined #mojo
15:19 howitdo joined #mojo
15:27 btyler joined #mojo
15:32 sri imran-uk: does your app have a DATA section?
15:33 sri what does the mojolicious log say?
15:36 d4rkie joined #mojo
15:39 bowtie_ joined #mojo
15:49 imran-uk sri, where would the mojo log be?
15:49 sri imran-uk: just noticed you cross posted, that's not cool
15:50 imran-uk sri, yeah sorry - was impatient
15:50 sri at least say that you're already getting help elsewhere
15:50 imran-uk apologies, btw where is the mojo log? i'm trying to get the default lite_app working
15:51 d4rkie joined #mojo
16:00 dqw joined #mojo
16:05 asarch joined #mojo
16:07 connor_goodwolf joined #mojo
16:16 howitdo joined #mojo
16:18 jwang joined #mojo
16:42 jberger joined #mojo
16:45 jberger imran-uk: that's me :-)
16:53 btyler joined #mojo
17:02 imran-uk jberger, :)
17:03 entro joined #mojo
17:03 whatwhat joined #mojo
17:03 gryphon joined #mojo
17:03 whatwhat what ?
17:34 dvinciguerra joined #mojo
17:40 abra joined #mojo
17:49 toastr joined #mojo
17:58 toastr joined #mojo
17:58 KindTwo joined #mojo
18:03 sri hmmm
18:04 * sri wonders if Mojo::Loader::is_binary should be called is_base64 instead
18:04 toastr joined #mojo
18:05 jberger_ toastr now understands direct messages
18:05 sri toastr: shut up!
18:05 jberger_ seriously Mojo::IRC / Mojo::EventEmitter make this almost too easy
18:06 sri it's really smart
18:06 jberger_ toastr, +shut up!
18:06 jberger_ (+ == learn)
18:10 jberger_ hmmm it really needs a corpus
18:11 sri toastr: shut up!
18:11 sri so what did it learn?
18:11 sri toastr: shut?
18:11 toastr Shut up is a great pizza topping.
18:11 jberger_ yeah, that was the one I just got too
18:12 sri toastr: wtf?
18:12 toastr Pepperoni is a great pizza topping.
18:12 jberger_ It knows only a few phrases I fed in during testing
18:12 jberger_ I hesitate to have it learn everything we say though (seems evil)
18:13 imran-uk so ive got a psgi app working with apache thanks to Plack::Handler::Apache2 but i'm unsure how i'd get that configured for a whole dir of psgi apps like you would do with mod_cgi
18:13 jberger_ imran-uk, seems like a question for the plack room
18:13 Vandal joined #mojo
18:13 imran-uk eg. with CGI, i'd have a bunch of scripts to reflect different areas of my apps functionality - books.cgi, users.cgi
18:14 jberger_ is there no plack room?
18:14 imran-uk with mojo, it seems the pattern is that you have one app that routes the different URLs of your app
18:14 jberger_ yes Mojo is a centralized router
18:14 imran-uk jberger, i figured this might be a common question no?
18:15 jberger_ (though if you google mojolyst you can see an interesting hack for decentralizing the router somewhat)
18:16 imran-uk jberger_, i'm not saying i must write it in a decentralized way, i'm just trying to udnerstand what app design style mojo kind of guides me towards
18:16 imran-uk since i'm from the "ye olde cgi design" school
18:16 jberger_ imran-uk, my problem is that though Mojo apps can run under cgi, I haven't ever used any of the other tools you mention, so I can't really help that much
18:17 sri http://mojolicio.us/perldoc
18:17 imran-uk jberger, np. i've abandoned cgi in this case, mst suggested Plack::Handler::Apache2
18:19 jberger_ in that case, I'm with sri, read the documentation, starting with Mojolicious::Lite (ie. the tutorial) and then read the Guides in order from that landing page
18:19 jberger_ not trying to say RTFM or anything, but its more than we can reasonably tell you here
18:19 imran-uk jberger, ok, i will do that. sometimes it's still not obvious to me even after rtfm'ing
18:20 jberger_ well then let me say it this way, ::Lite is a tiny system that conflates the router, the main app and the controllers
18:21 imran-uk what would really be good, and especially if you want to win over the old skool cgi devs, is an end-to-end example of building an app in cgi versus mojo
18:21 jberger_ full apps (Mojolicious) have a central app that establishes the routes (paths) your app will serve and then points them to controller classes and specific handler methods therein
18:22 imran-uk jberger, ok makes sense, i totally forgot it is built on mvc principles
18:23 jberger_ and I imagine that the view/controller separation might feel a little foreign to a cgi hacker but its worth it once you buy in
18:24 imran-uk yep, i'm going to keep at it. just waiting for that "eureka" moment :)
19:01 sri http://pragprog.com/book/7web/sev​en-web-frameworks-in-seven-weeks # what an odd choice of frameworks
19:03 entro joined #mojo
19:09 jberger__ joined #mojo
19:24 batman could someone give me feedback on the name i've chosen for this plugin? https://github.com/jhthorsen​/mojolicious-plugin-compress
19:25 batman i'm wondering if i can give it a more accurate name...
19:26 denisboyun joined #mojo
19:29 heytrav joined #mojo
19:32 sri batman: that's usually called an asset pipeline, although the documentation confuses me
19:39 cooper joined #mojo
19:40 batman can you give me more details on what confuses you?
19:40 batman *which part
19:40 sri the api is ver unusual for an asset pipeline
19:40 sri %= compress '/less/reset.less', '/sass/helpers.scss', '/css/app.css';
19:41 sri specifically that
19:41 batman how should it look?
19:41 sri assets are usually predefined and compiled on startup
19:42 batman i don't like that, because it's annoying while i development mode
19:42 sri app->asset('app.css' => '/less/reset.less', '/sass/helpers.scss'); %= asset 'app.css'
19:43 sri how so?
19:43 batman hm... i guess it could still be intelligent about the compress/don't compress logic
19:43 sri in dev mode it's common not to precompile assets and have the template helper generate individual tags for the files
19:44 batman ok. i agree. but why do you want to define it in you app and not in the template?
19:44 batman it doesn't sound intuitive to me...
19:44 sri in the template it has to be lazy
19:44 sri so you get a few very slow responses
19:45 sri sure you can do it, but it will always be wrong
19:45 batman the compressed asset is cached, so it will just be one (or many in parallel) slow requests.
19:45 sri it's still suboptimal
19:46 batman i see your point.
19:46 sri in rails you define assets with comments in the files
19:46 batman which are "the files"? templates?
19:47 sri http://guides.rubyonrails.org/asset_pipeline.html
19:48 imran-uk jberger_, are you still around? i'm following your dbi mojo example but the data is not being inserted...
19:48 sri not that i belive that's a good idea ;p
19:48 entro_ joined #mojo
19:48 sri if i knew how to do an asset pipeline right it would be in core :)
19:49 sri batman: glad you're building one
19:49 batman :)
19:49 batman i'm super happy for the feedback.
19:49 batman should i name the plugin ::Plugin::AssetPipeline ?
19:50 sri i actually liked this one most https://github.com/rstacruz/sinatra-assetpack
19:51 sri maybe leave that name for core... just in case ;p
19:51 batman '/js/lib/**/*.js' <--- does this mean that you need 00-foo.js, 01-bar.js files to make sure they are loaded in the right order..?
19:52 batman ::Plugin::ExternalAssetPipeline ? too long maybe...
19:52 sri ::Plugin::AssetPack :)
19:52 batman nah.. i don't want "External" - maybe someone builds a kick ass perl lib in the future
19:52 batman sound good to me! AssetPack it is.
19:53 sri btw
19:53 sri this is what i meant with dev mode tags https://github.com/rstacruz/sin​atra-assetpack#development-mode
19:54 batman no idea what the numbers mean, but it's about the same as my module does
19:54 sri timestamps for cache expiration
19:55 batman ok. my plan was /foo.js?12345678
19:55 batman ok. my plan was /foo.js?1379188525 # timestamp afterwards
19:58 sri batman: http://www.stevesouders.com/blog/2008/08/2​3/revving-filenames-dont-use-querystring/
19:59 batman oh. haven't thought about evil proxies :(
19:59 batman that sucks
20:00 batman but is it enough that i add timestamp to the production file and not in development mode?
20:02 imran-uk jberger_, something odd about the code, i changed driver to mysql just in case, still not getting the data or table created.
20:14 batman what should the helper be? just "asset" ?
20:14 batman i guess i can do <%= assetpack 'app.js' %> to avoid conflict with future core...
20:15 batman or "packed_asset"
20:21 sri %= pack 'asset.js'
20:21 batman won't that be in conflict with perl's pack?
20:22 sri good point
20:22 batman i think i will rather hack %= packed '...'
20:22 batman *have
20:23 sri you could also just use asset and make the helper name configurable
20:23 sri a future core helper would just be redefined, and if you want to use both you can change the name
20:24 batman okidoki
20:24 * batman tries to copy the sinatra behavior...
20:24 sri not like renaming a helper is hard :)
20:24 batman no. IT'S SUPER HARD!
20:24 batman :P
20:24 sri app->renderer->helpers->{my_helper} = delete app->renderer->helpers->{asset};
20:25 batman :)
20:26 sri you could also just go with two helpers
20:26 sri %= js 'app.js'
20:26 sri %= css 'app.css'
20:27 sri they would just look good and not do anything format specific :)
20:27 batman not sure if i like that. i think it looks more like a clever/modified version of javascript and stylesheet
20:28 batman the upside is that it's known for the sinatra people
20:28 batman *to
20:30 sri or go fancy with %= ap 'app.js'
20:30 sri ap = AssetPack
20:30 batman i don't like it.
20:30 sri /o\
20:30 batman it's either "asset" or "js+css"
20:30 batman i'm doing asset for now, unless *people* hate it
20:43 nicomen joined #mojo
20:47 marty joined #mojo
21:12 entro__ joined #mojo
21:15 batman i really don't like defining my assets in the application :(
21:16 batman it feels bad
21:28 sri batman: you make it sound like you have a choice
21:29 batman yeah...
21:29 batman guess i don't :/
21:36 batman https://github.com/jhthorsen/​mojolicious-plugin-assetpack # new api
21:39 sri batman: looks good
21:39 sri i would use an app helper to define the assets... but that's just me
21:39 KindOne joined #mojo
21:40 marcus soo toasty
21:40 toastr Toast here! https://i.chzbgr.com/maxW500/4445362944/hF657CBF1/
21:40 batman sri: like $app->asset('app.js' => @files); ?
21:40 * sri nods
21:41 batman i like it! i thought it was a bit clunky to do plugin 'AssetPack' => { assets => {} };
21:41 sri \o/
21:47 marty haha.  I just got sri compressor to work the other day.    batman++ looks good
21:47 batman "sri compressor" ?
21:48 batman marty: thanks
21:48 batman i'm a bit surprised that no one has commented on that i'm using external tools :)
21:48 marty https://gist.github.com/kraih/3927875
21:49 marty Sometimes (imo) using external tools is the practical thing to do.
21:50 batman not just practical. it's the only thing i know that actually works :P
21:51 batman marty: what's the difference between what i'm doing and what you're doing?
21:53 marty I'm not doing much.  Just using a slightly modified version of sri's CSSCompressor.pm.   The only change I had to make was to set the content_type header before serving the asset.   (IE 10 complains if the header is not present)
21:53 batman ok...
21:55 batman i really hate that the link tag has media="screen" :(
22:07 sri batman: if you want that changed make a proposal with explanation
22:08 batman i want stylesheet() to make a <link> tag without media="screen" since i can then allow the stylesheet to define the media and use the same helper for all kinds of media
22:09 sri batman: what are the disadvantages of removing the media attribute by default?
22:09 batman i would suppose backward compat... not sure if anyone cares though
22:10 batman it sucks that i need to write <link rel="stylesheet" ...> manually because i want to define a css for media print
22:10 sri batman: if you get a core dev to support your proposal i'm ok with it
22:10 batman marcus?
22:11 batman who else? jberger_..?
22:12 marcus how about link media=>undef ?
22:13 batman didn't know i could do that :/
22:13 marcus I'm not sure you can, but it'd be a good way to fix it?
22:13 marcus I think screen is a pretty sane default for most cases
22:14 batman i think it's quite evil to default to something which a lot of people don't use :(
22:14 sri erl -Mojo -E 'say app->tag("foo", bar => undef)'
22:14 batman the web is inaccessible enough as it is already...
22:14 sri doesn't work
22:14 marcus screens?
22:15 batman marcus: people who require other medias to access the web
22:15 sri marcus: changing bar => undef would also break backcompat
22:16 sri since media queries are a html5 feature i would consider the media="screen" a HTML4 leftover we forgot to fix
22:17 * sri shrugs
22:17 marcus ok, I'm in favor of removing it
22:17 marcus after reviewing the actual code
22:22 good_news_everyone joined #mojo
22:22 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/ATs7Tg
22:22 good_news_everyone mojo/master 48aca03 Sebastian Riedel: fixed stylesheet helper not to enforce a media attribute
22:22 good_news_everyone left #mojo
22:22 batman \o/ \\o o// \o/\o/\o/
22:22 batman thanks!
23:02 batman i feel i'm pretty much done now...
23:02 batman https://github.com/jhthorsen/​mojolicious-plugin-assetpack # i only need to figure out a clever default for "rebuild"
23:03 batman the timestamp on the css/js files can't really be trusted...
23:03 batman https://github.com/jhthorsen/​mojolicious-plugin-assetpack
23:18 sri a command to force rebuild might also be fun
23:19 sri could also be used to build assets before actually starting the server ;)
23:20 sri ./myapp.pl build_assets
23:20 cooper joined #mojo
23:23 sri batman: one important feature is missing though... pluggable compressors/processors
23:24 batman you mean that you can define sass, less, ...?
23:24 sri and js/css minifiers
23:24 sri after all there are quite a few cpan modules for those too
23:25 batman i will support the cpan modules if you can tell me one that doesn't suck
23:25 sri yuicompressor is a big blob of java after all...
23:25 batman i agree on that :)
23:26 sri needs to be pluggable imo, there are new ones popping up all the time after all
23:26 sri and not all are cpan modules
23:27 sri https://github.com/mishoo/UglifyJS # how about a javascript one?
23:27 batman got an idea on how that will look - api wise?
23:28 sri i would prolly do a jberger style api
23:28 batman example?
23:28 batman oh. the one from earlier?
23:28 sri have app->assetpack return the plugin instance and let people play with attributes
23:29 sri app->assetpack->js_compressor(sub {...});
23:29 batman i need to think about that
23:29 sri app->assetpack->filter->{sass} = sub {...};
23:29 sri app->assetpack->add_filter(sass => sub {...});
23:31 sri future proof... make what you have pluggable now... and add stuff when necessary
23:32 batman i might have over exaggerated the "cpan suck" part... cpan might be useful for pure js and css...
23:33 sri you could also get rid of that horrible our %APPLICATIONS hack
23:33 sri app->assetpack->is_supported('yuicompressor')
23:33 sri (you get the idea)
23:34 batman i don't think it's bad. after all. applications are global.
23:38 batman but i think i will make it prettier...
23:39 batman one moment
23:39 batman i need a gin&tonic as well...
23:44 batman i'm also not sure about "filter". what about "compressor" ?
23:45 sri sass/less aren't compressors
23:46 batman are they filters?
23:46 sri i was thinking js_compressor, css_compressor and filters
23:46 sri could also call them preprocessors
23:46 batman what happens when they are both?
23:46 sri who cares? :)
23:47 sri double compressed \o/
23:47 batman hehe
23:47 sri just have to consider that preprocessors are for both, since you have coffeescript too
23:47 batman i think i like processor
23:48 batman :P
23:48 sri preprocessor seems to be the most common term
23:48 batman ok... let me try something here

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