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

IRC log for #mojo, 2014-01-26

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

All times shown according to UTC.

Time Nick Message
00:01 jberger actually, I don't like that the code is not indented now
00:01 jberger the code lines are at the very left edge of the box
00:02 jberger ... or you fixed it :-P
00:03 curt joined #mojo
00:13 ka2u joined #mojo
00:17 curt As I stated the other day, I'm new to mojo and irc. I've been attempting to resolve an issue with Test::Mojo. I've believe found a solution to my problem and would like to submit an enhancement to Mojo::UserAgent::Server.
00:19 curt http://pastie.org/8667685
00:22 good_news_everyone joined #mojo
00:22 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/6d0nwA
00:22 good_news_everyone mojo/master 9d9ca2e Sebastian Riedel: made unindent a little smarter
00:22 good_news_everyone left #mojo
00:22 sri the $, @, % whitelist is actually not too bad
00:26 good_news_everyone joined #mojo
00:26 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/DpcUcQ
00:26 good_news_everyone mojo/master 627b03a Sebastian Riedel: status does not contribute anything to the example
00:26 good_news_everyone left #mojo
00:26 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Growing
00:30 sri noooooooooooo
00:30 sri http://127.0.0.1:3000/perldoc/Mojolicious/Lite#Layouts
00:30 mire joined #mojo
00:32 sri umm yea... 127.0.0.1
00:39 curt sri: Are your comments directed towards me? If I've submitted the enhancement incorrectly or there is little value please let me know.
00:40 sri nope
00:42 good_news_everyone joined #mojo
00:42 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/t2qWSw
00:42 good_news_everyone mojo/master 90ba766 Sebastian Riedel: use arrow in whitelist for highlighting
00:42 good_news_everyone left #mojo
00:42 sri curt: http://mojolicio.us/perldoc/Mojolicious/Guides/Contributing#CONTRIBUTING_CODE
00:42 curt ah, thanks
00:44 sri that said, the changes i see in the paste won't have a chance to get past me
00:44 priodev joined #mojo
00:45 sri either you're an expert and what you're doing is way over my head, or you're misunderstanding something
00:53 good_news_everyone joined #mojo
00:53 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/d145tw
00:53 good_news_everyone mojo/master 2086b36 Sebastian Riedel: blacklist usage messages again
00:53 good_news_everyone left #mojo
00:53 curt sri: ok... can you provide specific feedback?
00:54 sri afraid not, i don't understand it
00:57 curt Simply attempting to start the Mojo::UserAgent::Server using the dns name. Then, send all future test using the dns name as well.
00:57 sri sounds like a terrible idea tbh
00:58 sri why would you depend on that specific physical interface?
00:59 sri bind to a dns name sounds all kinds of wrong
01:00 curt in our company, the encrypted cookies are served by a proxy and if the dns name isn't found the cookie can be decrypted
01:01 curt sorry, can't be decrypted
01:02 sri sooo... you have a dns A record that belongs to one ip address and you want to bind to the one interface that's associated with it?
01:02 sri i don't get it
01:03 sri dns shouldn't have anything to do with the interfaces you bind to
01:04 sri could it be that you have no clue what you're doing? :)
01:04 curt yes, it's very possible
01:05 sri allright... my guess is all you really want is $t->get_ok('/lalala' => {Host => 'mysupersecret-domain.name'})
01:05 sri dns doesn't matter
01:05 sri http doesn't care about it
01:06 curt well, let me try that... thanks for the input
01:09 mire joined #mojo
01:34 curt I originally started with http://pastie.org/8661521
01:51 good_news_everyone joined #mojo
01:51 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/Xw2NXw
01:51 good_news_everyone mojo/master 973d6a6 Sebastian Riedel: list commands alphabetically
01:51 good_news_everyone left #mojo
01:53 ka2u joined #mojo
02:22 ka2u joined #mojo
02:31 klapperl joined #mojo
02:37 torbjorn joined #mojo
02:38 torbjorn Im using Mojo::DOM to parse html5, can I control the escaping of stuff when stringifying it again?
02:39 torbjorn in my particular case, I need literal " in element attributes, but I get "
02:42 jberger torbjorn, not easily: https://github.com/kraih/mojo/blob/master/lib/Mojo/Util.pm#L332
02:44 torbjorn I see, thanks for the insight, ill put inn funny looking placeholders and regex them in later
02:53 sri that's horrible, why would you even need that? both forms are semantically identical...
02:54 torbjorn for me?
02:54 sri yes
02:55 torbjorn im turning a html5 index.html file into a wrapper.tt2 , in the process changing attributes like src="js/foo" to src="[% c.uri_for("static/js/foo"] %]"
02:55 torbjorn and found Moho::DOM to be the best parser (it left whitespace and comments intact)
02:55 torbjorn *Mojo
02:55 sri :O
02:56 torbjorn when Mojo stringifies an html attribute that is 'foo"bar"baz', it becomes 'foo"bar&quotbaz', my problem being that the inner " are valid TT syntax
02:56 * sri slowly moves backwards out of the channel
02:57 torbjorn that might be for me to do, taking a catalyst related issue in here ;)
02:58 sri i actually wonder how much of a performance gain less escaping in Mojo::DOM would be... haha
03:02 sri in attribute values we only have to escape " and &, since we only generate the double quoted version
03:02 torbjorn it takes ' too
03:03 curt clearly i don't understand... my hack works and $t->get_ok('/lalala' => {Host => 'mysupersecret-domain.name'}) does not. Guess I'll continue using my hack until I understand the issue. Thank again for the input.
03:03 sri because it's a best practice
03:06 sri anyway, a substantial performance gain would be the only way to make me care
03:07 torbjorn might aswell ask here too.., how do you handle it when you have url() type of things in static css, do you take it out of static and put it elsewhere so that you can call uri_for on that url?
03:08 sri if static assets have dynamic elements they are not static
03:08 torbjorn does url('../images/foo') quality as a dynamic element?
03:09 torbjorn most modern css frameworks come with some imagery that they refer to in something like ../images/*, would you take out those particular entries from the css or serve all css dynamically? which would mean most of the css of the site
03:40 jberger so, I expected to get windows failures on this latest release of ForkCall actually
03:40 jberger and I just got an email saying that CPANTesters had two windows fails
03:40 jberger AND THE CPANTESTERS SITE IS ********* DOWN!!!
03:41 jberger SHOW ME ALL THE TESTS!
03:41 sri haha, i just wanted to look up a test fail too
03:41 * jberger takes a deep breath
03:41 sri !@#$%^
03:41 jberger maybe I can ask you, maybe you know
03:42 jberger do sockets on Window have a maximum message size?
03:42 jberger *Windows
03:43 jberger https://metacpan.org/source/MLEHMANN/AnyEvent-7.07/lib/AnyEvent/Util.pm#L291
03:43 jberger ^^ the last part of his code I haven't ported yet, but in this release I added a test with a 1,000,000 character string
03:51 jnbek^dt joined #mojo
03:53 ka2u joined #mojo
03:53 d4rkie joined #mojo
03:59 KindTwo joined #mojo
06:34 Vandal joined #mojo
06:38 rem_lex|pivo joined #mojo
06:56 cfedde joined #mojo
07:17 irq joined #mojo
07:50 komodo joined #mojo
07:54 trone joined #mojo
08:08 dvinciguerra joined #mojo
08:27 nornagest joined #mojo
09:24 basiliscos joined #mojo
09:28 dod joined #mojo
09:31 stl joined #mojo
09:41 voegelas joined #mojo
10:00 dod joined #mojo
10:33 elvis joined #mojo
10:33 batman joined #mojo
11:15 sh4 joined #mojo
11:30 amirite joined #mojo
11:34 Vandal joined #mojo
11:36 ladnaV joined #mojo
11:46 Vandal joined #mojo
11:58 ladnaV joined #mojo
11:59 batman idea: $validation->required('random_number')->cb(sub { time % 10 == $_[0] });
12:00 batman so cb() is check that takes a callback. i think this would allow hooking in more validation functions form cpan...?
12:00 * batman ponders some more...
12:03 Vandal joined #mojo
12:21 irq_ joined #mojo
12:35 d4rkie joined #mojo
12:42 denis_boyun joined #mojo
12:44 cleverfox joined #mojo
12:51 d4rkie joined #mojo
13:24 ryozi joined #mojo
13:25 amirite joined #mojo
13:38 denis_boyun_ joined #mojo
13:40 bodgix joined #mojo
13:53 cleverfox joined #mojo
13:59 denis_boyun joined #mojo
14:15 odc joined #mojo
14:28 bowtie_ joined #mojo
15:06 good_news_everyone joined #mojo
15:06 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/DfdyAQ
15:06 good_news_everyone mojo/master a0b4a0d Sebastian Riedel: faster listen socket test
15:06 good_news_everyone left #mojo
15:17 gryphon joined #mojo
15:26 jberger so today I'm doing a mini-hackathon with a friend who wants to learn about web stuff
15:27 jberger unfortunately he only knows Python and so I am planning on doing the hackathon in Python
15:27 jberger so I was trying to find a web framework to try, something useful for examples for him, but something that might be fun for me to learn some new things from
15:28 jberger and I am having a really hard time trying to find anything with the range of ability of Mojolicious
15:29 jberger thus I am even more impressed with Mojo, from 3 line micro-apps to huge structured tested non-blocking apps
15:29 moritz I don't do python, but my python colleauges tend to use flask when they look for a small python framework
15:29 jberger flask is near the top of my list
15:29 jberger also a thing called pesto
15:47 sri flask for small, tornado for non-blocking
15:48 sri tornado is the only python framework that has inspired mojolicious a little bit
15:50 sri http://www.tornadoweb.org/
15:51 jberger yeah, I was originally looking at tornado because I knew that it mapped to mojo well
15:51 jberger I was trying to find something smaller, but still full-featured/interesting, and I'm not sure I can find it
15:52 jberger maybe I'll just use tornado
15:52 sri i'd use flask ;p
15:52 sri better for beginners
15:54 jberger the global request object scares me
15:55 jberger not because I don't trust it, but because I'm not sure I'll get implications
15:59 denisboyun joined #mojo
16:13 good_news_everyone joined #mojo
16:13 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/ikOxOg
16:13 good_news_everyone mojo/master 84d588a Sebastian Riedel: a few more unindent tests
16:13 good_news_everyone left #mojo
16:13 sri the latest version of unindent seems to work pretty decently https://github.com/kraih/mojo/blob/master/lib/Mojo/Util.pm#L297
16:14 sri only case that's not handled is text that's not actually indented
16:15 jberger that's cute
16:15 jberger how is that not handled?
16:16 sri it just unindents all other lines
16:16 sri line without whitespace prefix are ignored
16:16 sri makes handling empty lines easy
16:16 jberger that is what I would expect to happen
16:17 sri yea, i guess the "correct" behavior is arguable
16:17 jberger oh, I see what you mean
16:18 jberger you are talking about when determining the amount of unindent
16:18 jberger I see the problem there
16:19 jberger I think I still agree with this behavior
16:20 sri perl -Mojo -E 'b(" test\n123\n\n456\n")->unindent->say'
16:20 sri an example
16:20 purl Example (noun): A thing characteristic of its kind or illustrating a general rule.
16:20 sri should it unindent the one whitespace prefixed line or not
16:20 * jberger pulls
16:21 sri i tend towards yet atm
16:21 sri *yes
16:21 sri upside: easy implementation and possibly more use cases... downside: you have to know something is indented before you use unindent()
16:22 jberger If I describe it as "move indented lines in by the amount of the smallest indentation" I would argue that it behaves as expected
16:23 jberger because then you can do this: perl -Ilib -Mojo -E 'b("\t\ttest\n\t123\n\n456\n")->unindent->unindent->say'
16:23 sri haha
16:40 dvinciguerra joined #mojo
16:43 jberger anyone on here running windows and willing to run a few tests?
16:53 Vandal yep
16:58 x86 joined #mojo
17:09 jberger Vandal, oh hai
17:09 jberger https://github.com/jberger/Mojo-IOLoop-ForkCall
17:10 jberger would you mind testing this, and if it passes great, if not, then test the branch buffered_write
17:11 jberger meanwhile, sri, I have an odd idea which would make ojo one-liners easier
17:12 sri ohoh
17:12 jberger in the vein of $_ getting the controller, could Mojolicious::Controller overload %{} to the stash method?
17:12 jberger perl -Mojo -E 'a("/:name" => { name => "World" } => sub { $_->render( text => "Hello " . $_->stash("name") ) } )->start' get /
17:12 jberger could be
17:12 purl could be is not sufficient! I want fatal or nothing.
17:13 jberger perl -Mojo -E 'a("/:name" => { name => "World" } => sub { $_->render( text => "Hello $_->{name}" ) } )->start' get /
17:13 sri that's actually a pretty cool idea... BUT!... controllers are hash based objects :(
17:13 jberger and you poke into it I suppose
17:13 jberger hmmmm, ok, nm
17:13 sri accessors couldn't work any other way
17:13 jberger oh! ha! right
17:14 sri (aside from the million other ways to do accessors... which we don't use)
17:16 sri closest you could get would be $_->('name') i guess
17:16 jberger does that interpolate?
17:16 sri but that's not as useful or looks as good
17:16 sri nope
17:17 jberger does array deref overload force numeric context first?
17:17 * jberger checks
17:20 * sri wonders if the postderef versions interpolate
17:22 sri nope, doesn't
17:23 sri only advantage would be not having to type "stash"
17:24 sri only possibility i see is scalar deref to hashref
17:24 sri perl -E 'my $foo = \{foo => "bar"}; say "test $$foo->{foo}"'
17:24 Vandal jberger, Do I need to build something, or just run prove?
17:25 jberger sri: not a bad trick, I don't think its quite your style. Of course I like it, but I like fun hacks
17:25 jberger Vandal, prove should be enough
17:25 Vandal jberger, All tests successful.
17:25 jberger \o/
17:25 jberger on the main branch?
17:26 Vandal perl v5.16.3
17:26 Vandal https://github.com/jberger/Mojo-IOLoop-ForkCall
17:26 jberger cool
17:26 Vandal master
17:26 Vandal i think
17:26 Vandal yep, master
17:26 jberger strawberry? activestate?
17:26 Vandal active
17:26 jberger cool
17:26 jberger cygwin I expect would work, native was a bigger question
17:27 jberger Vandal++
17:27 Vandal np
17:27 sri yea, i dislike the inconsistency with other objects that use hash overload for something a bit
17:27 Vandal jberger, glad to be usefull
17:27 jberger sri: I can make array dereferencing work, but with a warning
17:27 sri lol
17:28 sri lets not do that ;p
17:28 sri $_->['foo'] is seriously passed through?
17:29 jberger no, you return an arrayref like [$value, $value]
17:29 jberger oh! maybe a tied arrayref!
17:29 * jberger hacks
17:29 sri :o
17:30 jberger ^^ would break for a key like "2something"
17:31 * sri is on the edge about $$c->{foo} as alias for $c->stash->{foo}
17:31 jberger its nice because it interpolates
17:31 sri it has easy to document going for it
17:34 jberger perl -Mojo -E 'a("/:name" => { name => "World" } => sub { $_->render( text => "Hello $$_->{name}" ) } )->start' get /
17:35 sri and to top it off... make $_->() an alias for $_->render()
17:35 sri :D
17:35 jberger sri++
17:36 jberger can scalar deref return a hashref?
17:36 sri that oneliner is a bad example though
17:36 sri inline template is shorter
17:37 sri perl -Mojo -E 'a("/:name" => {name => "World", inline => q{%= $name}})->start' get /
17:37 jberger 'If a dereference operator is overloaded then it must return a reference of the appropriate type'
17:38 x86 whoa... perl -Mojo? wouldn't one need "perl -MMojo", or did miyagawa implement a whole namespace alias for "ojo"?
17:38 sri is a hashref not a scalar?
17:38 jberger x86 miyagawa?
17:39 jberger so you return a reference to a hash reference? :D
17:39 jberger nice
17:40 jberger x86: sri wrote Mojolicious, but yes it includes an "ojo" namespace
17:40 jberger plus, the Mojo namespace has other meaning
17:41 sri yes, confirmed working "use overload '${}' => sub { \shift->stash }, fallback => 1;"
17:41 jberger \o/
17:41 jberger that's kinda gorgeous actually
17:43 jberger well its a +1 from me,  but it will be up to you if its worth doing
17:44 jberger in that case $$_ gives the whole stash too
17:46 x86 how do most people end up deploying high performance, event-based, stateful Mojolicious web apps? do most people reverse proxy with nginx, or starman, or twiggy, or something else?
17:47 jberger event-based you can't use psgi servers
17:47 jberger recommend nginx+hypnotoad
17:48 x86 twiggy uses AnyEvent to run as a non-blocking event loop
17:48 x86 hypnotoad is better than, say, plackup or morbo?
17:48 jberger yes
17:49 jberger it's the high-performance server that Mojolicious provides
17:49 bpmedley x86: morbo is meant for development
17:50 x86 yes I'm aware of it... I've always used that in my development environments (also sometimes morbo) -- but production thus far I've always used plackup... but now I'm reading a little on Twiggy and it looks sorta awesome
17:50 jberger hypnotoad is similar to starman, except it allows Mojolicious to use its internal event loop, I'm not sure if twiggy would work (with some configuration), it **might**
17:51 x86 and Server::Start
17:51 x86 as long as you end up with an EV or AnyEvent IO handle, couldn't you pass it around just as easy?
17:52 x86 I'll investigate more on that
17:52 x86 so more or less everyone uses nginx out front eh?
17:52 jberger x86, Mojo::IOLoop can use AnyEvent (via EV), I'm just not sure that the appropriate linkages are built if twiggy is used as the server
17:53 bpmedley x86: I think some also use varnish
17:53 jberger if you have the choice of server, (especially if you can use a reverse proxy) then there is no reason to use hypnotoad
17:53 jberger sorry
17:53 jberger no reason NOT to use hypnotoad
17:54 x86 duly noted... I'll switch the PSGI layer to hypnotoad
17:55 x86 what does varnish give you over nginx?
17:55 bpmedley x86: what does your code currently look like with your PSGI layer?  Do you have a sample?
17:55 bpmedley I think varnish is just a reverse proxy - no web server. Not 100% sure.
17:57 x86 bpmedley: I'm not interfacing directly with anything at the PSGI layer with my code (yet, anyway) -- letting Mojo's internals do what it does
17:58 x86 but I've not implemented anything using events yet
17:58 jberger x86: once you go non-blocking, you wont look back
17:58 bpmedley You might like a reverse proxy setup.
17:59 x86 I want to initiate communication back to a web browser (client) if an event triggers a callback
17:59 jberger and yes you CAN use AnyEvent (via EV), its just controlled by Mojolicious and not the server
17:59 x86 bpmedley: I'm reverse proxying with nginx+plackup right now
17:59 jberger x86, then you are looking for websockets
17:59 bpmedley It will probably be faster with nginx+hypnotoad
18:00 x86 bpmedley: reverse proxy is really the only option for insane on-demand scalability (which is key for me)
18:00 jberger plackup <==> mojo's daemon, hypnotoad <==> starman
18:00 bpmedley May I ask the app your deploying?
18:00 x86 jberger: yeah I was reading about those, but it seems browser standards support with those is all over the place
18:00 jberger x86, it
18:00 jberger it's getting much better
18:01 x86 bpmedley: I'm just building something to run my website really... more or less, sport coding :)
18:03 x86 but where I work (a regional chain of data centers with a strong managed services emphasis), we're constantly testing / labbing up different things, like load balancers (which are essentially reverse proxies on steroids at the end of the day)
18:04 jberger x86, mojo does handle long-polling too, but websockets are so nice
18:05 * jberger steps away for a bit
18:07 x86 so I was thinking of building an app that could spin up new "jails" for every X number of threads, spin up new PSGI-level (application) threads up to the max number per jail, and even interact with a hypervisor to build / spin up / destroy VMs for every X jails
18:09 x86 implementing things such as throttled ramp-up / DoS detection / etc, to limit resource consumption
18:10 bpmedley Have you seen docker?
18:11 x86 hmm, nope
18:14 x86 uh... they must have an awesome DeLorean, because they totally travelled into the future and stole my idea
18:16 sri thing about twiggy is that it's chained to the limitations of psgi and doesn't do preforking
18:17 sri you have to break out of the psgi jail to do proper long polling and websockets for example
18:19 sri psgi/wsgi/rack and friends were made for a world of one request/response cycle per worker process at time
18:20 x86 oh, weak
18:22 sri but now we have node.js, go, netty and so on to compete with
18:22 x86 would any of those be better than nginx on the front line?
18:22 sri no, those are all still application servers
18:23 x86 gotcha
18:23 x86 what about nginx versions? what's generally recommended for production? I see they have a "mainline" and "stable" release train, is the mainline more feature progressive?
18:24 sri all i care about when choosing nginx versions is if it has websocket support, which might be stable now
18:24 bpmedley x86: What distro are you using?  Linux?
18:25 x86 ubuntu, yeah
18:25 bpmedley Does their nginx have websockets?
18:27 sri btw
18:27 sri jberger: perl -Ilib -Mojo -E 'a("/:name" => {name => "World"} => sub { $_->(text => "test: $$_->{name}") })->start' get /
18:27 sri this works too
18:27 sri ;p
18:27 x86 I'm not using ubuntu's nginx, perl, mojo, plack, etc...
18:27 bpmedley What's wrong with their nginx?
18:27 x86 I've been building my own packages for them
18:28 sri jberger, tempire, marcus, crab: has science gone too far?
18:28 x86 well there were some features that I wanted at one point, where a newer version had them available but ubuntu's didn't... so that compelled me to maintain my own nginx package
18:28 sri $c->() for $c->render() is kinda cute
18:28 btyler joined #mojo
18:29 sri jberger: actually, i can't think of too many cases where i wouldn't use an inline template instead
18:33 sri guess this would be a use case for both
18:33 sri perl -Ilib -Mojo -E 'a("/:epoch" => sub { $_->(json => {time => scalar localtime $$_->{epoch}}) })->start' get /1234567890
18:36 sri actually i can think of more reasons for the render shotcut than stash :o
18:37 x86 what about static assets (javascript, images, css, etc)... I've been serving that with an Apache stack... what do people generally do for that these days? I'd really rather not serve that stuff from the application stack
18:38 bpmedley A lot of people find hypnotoad does well with static files.  However, there are options for static files, as well.
18:45 sri jberger, tempire, marcus, crab: this is the patch http://pastie.org/8669601
18:46 * jberger catches up
18:47 sri i would want another core dev vote in favor... since i'm unsure about it
18:50 jberger sri: hashy deref is still shorter than the similar stash method call, which for ojo is always useful
18:50 sri sure, but how often do you really use that?
18:53 bpmedley What about using that overload capability for param and stash?
18:53 bpmedley my ($name, $password, $email) = $c->([qw(name password email)];    # Array ref retrieves params
18:54 jberger array deref doesn't help up
18:54 jberger us
18:54 jberger oh, passing an arrayref to &{}
18:54 jberger eeh
18:54 bpmedley $c->({ name => "abc", password => "blahlabh", email => "a@a.com"});   # Hash ref sets stash
18:54 jberger bpmedley, getting a bit too magical for me
18:55 bpmedley :)
18:55 jberger bpmedley, the stash is at the core of the controller object, so using it in a hashy way seems to make sense to me
18:55 sri actually ->param([...]) is already a thing... and you should know!
18:56 jberger similarly, most controllers eventual job is to render, so &{} defer to render makes lots of sense too
18:57 jberger yeah, but allowing &{} to render if passed a list, but pull params if passed an arrayref? :-/
18:57 sri when jberger says something is too magical for him you know you went way overboard
18:57 jberger hahaha
18:57 bpmedley lol
18:57 bpmedley We have replaced mojo with *
18:57 jberger its the cognitive dissonance, not really the "too magical-ness" for me actually
18:58 * jberger reminds bpmedley about his proposal for Mojo::Collection::reduce which uses not less than 5 "local"s
19:00 jberger for me, magic is fine as long as the workflow doesn't stray too far
19:02 jberger anyway, sri: I'm +1 on both, but I also recommend you take votes from other core devs on the two overloading separately
19:02 * sri shakes marcus, tempire and crab
19:02 jberger I would hate to see &{} refused because people don't like ${}
19:03 * jberger sets tianon on fire
19:03 jberger (seemed like the thing to do)
19:05 rem_lex joined #mojo
19:07 jberger I do like the NAMING section in the docs for twiggy and starman tho
19:09 jberger sri: I see keys in PSGI like psgi.nonblocking
19:10 jberger is there any spec on how that should be used? could there be a Mojo::Server::PSGI::Nonblocking?
19:10 sri try finding out when the client closed the connection
19:11 sri there are holes in the psgi spec
19:11 sri i wanted to add non-blocking support to Mojo::Server::PSGI for 3 years now
19:12 sri and i've complained about the holes since then
19:12 jberger oh, I do remember you bringing that up before
19:21 jberger sri, still no snow in Germany? This is shaping up to be one of the coldest snowiest winters in Chicago in many years?
19:22 jberger s/years?/years!/
19:22 * jberger goes to snowblow
19:22 moritz jberger: the north of Germany has snow and -10°C
19:23 moritz here in the south we had a smattering of snow, but most of it has already melted
19:40 jberger -10C would be a pleasant increase :-/
19:40 jberger actually its about that now,
19:40 jberger but schools are already cancelling for the next two days because of the coming cold (again!)
20:11 sri can confirm, freezing my ass off
20:22 irq_ joined #mojo
20:23 rem_lex joined #mojo
20:35 * tianon burns
20:43 marcus I never understood how easily you guys cancel school if there's a little winter, jberger.
20:43 marcus When I was a kid, we walked to school in -30c, and we liked it!
20:45 jberger uphill both ways no doubt
20:45 marcus jberger: it's like you were there.
20:47 * batman want to release https://github.com/jhthorsen/mojo-server-tcp/blob/master/lib/Mojo/Server/TCP.pm to cpan. any objections?
20:54 * sri chains marcus to the channel
20:54 sri marcus: http://pastie.org/8669601 # yay or nay?!
21:01 mire joined #mojo
21:06 batman if i had a vote, i would wote "nay". just because i think it's harder to read and gives me nothing in return.
21:07 batman (still easy, but harder...)
21:08 sjn fwiw, I agree with batman
21:10 batman \o/
21:10 * batman googles fwiw
21:10 batman aah
21:10 jberger for what its worth
21:11 batman yeah. aah = alright (a)i have (it) - or something like that ;)
21:11 * batman tries to be funny...
21:12 odc i also vote "nay"
21:13 jberger the votes that don't count are stacking up against me it would seem
21:15 jberger batman/sjn/odc remember the target is actually ojo not really for full app controller
21:15 marcus I'm nay too
21:16 odc oh... well in that case ok, as long as nobody uses it in mojolicious apps
21:17 batman odc: that won't happen
21:17 jberger can overloading be added dynamically?
21:17 batman anything that might be used, will be used
21:17 batman jberger: yes
21:17 jberger if so, ojo could add it
21:17 odc hm
21:18 sri batman, sjn: you did see the resulting oneliners?
21:19 sri perl -Ilib -Mojo -E 'a("/:epoch" => sub { $_->(json => {time => scalar localtime $$_->{epoch}}) })->start' get /1234567890
21:19 batman sri: i don't really care. sorry... i just don't want it to be available in Mojolicious::Controller
21:19 jberger could add it here: https://github.com/kraih/mojo/blob/master/lib/ojo.pm#L23
21:20 sri ewww
21:20 batman :)
21:20 jberger I should, not in the around_action, afterwards
21:20 odc this thing took me a while to read and understand...
21:20 batman jberger: how often do you write one-liners to actually consider this super useful? :(
21:21 jberger I prototype with one-liners rather often
21:21 batman ok
21:21 sri to be fair... $_ in oneliners did pay off
21:22 amirite joined #mojo
21:23 sri but it looks like consensus on this one tends towards -1
21:25 sjn sri: I'm mainly thinking of $_->(...)'s opaqueness
21:26 sri aside from prototyping, there's also examples and test cases... and there too many special cases might get in the way
21:27 sjn it's neat, but also a bit "magic"
21:27 sri sjn: but you're ok with $$_->{foo}?
21:27 sjn even less so
21:27 sri :)
21:28 sjn make it easy for a n00b to understand
21:28 sjn and a common way to explore code is to grep for function names
21:28 sjn don't take away that :(
21:29 sri this is the long version
21:29 sri perl -Ilib -Mojo -E 'a("/:epoch" => sub { $_->render(json => {time => scalar localtime $_->stash('epoch')}) })->start' get /1234567890
21:29 sri guess that wins for examples
21:29 sri tweets not so much ;p
21:30 sjn it's a hard world :)
21:31 sjn call it "understand what's going on while you learn" or something :)
21:37 jberger http://pastie.org/8670050
21:37 jberger works
21:37 jberger (expects to be set on fire)
21:39 batman jberger: just do BEGIN { require overload; Mojolicious::Controller->overload::OVERLOAD('${}' => sub { \shift->stash }, fallback => 1); }
21:39 batman not sure if you require BEGIN either...
21:40 sri lets not do that
21:43 torbjorn joined #mojo
21:44 jberger is overload::OVERLOAD documented anywhere?
21:44 jberger or do you mean overload::import?
21:48 batman jberger: i guess your version is the documented way...
21:51 x86 overload::OVERLORD
21:52 x86 muhaha :P
21:53 jberger although the import is just a pass through method
21:55 AirDisa joined #mojo
22:07 jberger batman, the only way I can get it to work inside the ojo::import method is with a string eval as documented
22:07 batman ok
22:08 good_news_everyone joined #mojo
22:08 good_news_everyone [mojo] kraih tagged v4.70 at 094aa70: http://git.io/Cu5qWA
22:08 good_news_everyone left #mojo
22:10 * sri still loves the new command synopsis feature http://mojolicio.us/perldoc/Mojolicious/Command/prefork#SYNOPSIS
22:16 * sri wonders what people would like to hear him talk about at mojoconf
22:20 sjn sri: it's a keynote :)
22:20 sjn it means you'll get to set the tone for the whole conference
22:20 sri no pressure!
22:20 sjn nah, just talk about things you want to say
22:21 sri i'm thinking "mojolicious sucks" as a headline
22:21 sjn "I wish more people knew this"
22:21 nicomen sri: I would attend ;9
22:22 sri well, it will be terrible regardless.. i've never given a talk in english before :o
22:22 nicomen you can do it norwegian, that's closer to german ;)
22:24 sri djangocon actually has a tradition where the keynote is given by someone else every year and the topic has to be how django sucks
22:25 nicomen is it real fair points in how it sucks, or humourous and/or ironic?
22:27 sri http://www.youtube.com/watch?v=i6Fr65PFqfk
22:34 marcus Sounds good to me!
22:36 sri problem is, i don't hate mojolicious yet
22:40 batman https://gist.github.com/jhthorsen/8640415 # wonder if this is a good idea...
22:42 nicomen ok, now I see why mojo sucks, there are obviously too little documentation on how to make a blogging engine
22:44 stephan48 might want to have a look towards bootylite
22:45 sri you might want to get your sarcasm detector checked
22:45 stephan48 i might take this as a valid suggestion
22:46 nicomen sri: I'm starting to get bored after 10 minutes, is it worth watching it further?
22:46 nicomen (he still hasn't said anything on why django sucks though)
22:47 sri nicomen: i didn't watch the start
22:47 sri we will later on
22:48 sri the introduction was really drawn out... i'll just pretend i'm someone else and not elaborate
22:49 nicomen ok, I think perl guys need some tutoring in how to be more cocky and condescending towards other languages, only then the language might gain more popularity
22:49 sri talking about the history of mojolicious seems like the obvious choice... but might get boring :/
22:49 sri significant changes since 4.0 seems also like an obvious choice
22:50 nicomen one obvious thing would be to get to know about long-term plan and/or if there are no concrete long-term plans, how the day-to-day evolvement works
22:50 sri could release 5.0 on stage if you got wifi
22:51 sri nicomen: there are no real long term plans
22:52 sri the dev model would be a fitting introduction to the 4.0 - 5.0 changes
22:53 nicomen right, yeah ;)
22:53 nicomen oh, and when will it be ported to php of course
22:54 sri hmm... maybe i could start with milestones of the past, and show some of the bigger features we added since 1.0
22:54 sri ok... i think i have something that won't make everyone fall asleep
22:56 nicomen ;)
22:56 sri and i have to bash catalyst of course
22:56 stephan48 skipping the keynote?
23:04 nicomen wow, ten minutes talking about lack of read/write db clustering...
23:08 bpmedley Perhaps you could showcase a few Mojolicious sites, as well?
23:09 amirite joined #mojo
23:09 sri right, like http://twitpic.com/c41xs7
23:10 bpmedley We're all dancing the dinosaur
23:23 nicomen always repeat questions from the audience, damnit
23:26 * sri still thinks someone more qualified should be doing the keynote
23:46 bpmedley Anyone used the new jquerymobile 1.4?  Does the new default theme seem boring?
23:56 dvinciguerra joined #mojo

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