Camelia, the Perl 6 bug

IRC log for #mojo, 2013-07-07

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

All times shown according to UTC.

Time Nick Message
00:43 punter Mojolicious::Controller documentation says:
00:43 punter # Better enforce scalar context
00:43 punter my $hash = {foo => scalar $self->param('foo')};
00:44 punter but that doesn't enforce scalar context, on the contrary it enforces list context
00:44 punter Bug
00:44 preaction forces list context on what?
00:44 punter on $self->param('foo')
00:45 punter That's what he was saying before
00:45 preaction scalar $self->param('foo') does not force list context on $self->param('foo')
00:45 punter o?
00:45 punter Doesn't it turn lists&arrays into scalars?
00:45 preaction {foo => scalar $self->param('foo')} executes $self->param('foo') in list context, because of perldoc -f scalar
00:45 punter So it expects array?
00:45 preaction argh, in "scalar" context
00:45 punter ok i see
00:45 punter a
00:46 preaction { foo => $self->param('foo') } would be list context, because lists are flattened
00:46 preaction which is why scalar() exists
00:46 * punter feels like a beginner
00:47 preaction eh, i know lots of people who've used Perl for year without truly bellyfeeling how Perl uses context
00:48 preaction but you can do a quick check: sub what_i_want { print not defined wantarray ? "nothing" : wantarray ? "list" : "scalar"; }; what_i_want(); my $scalar = what_i_want(); my @array = what_i_want(); my @array = scalar what_i_want();
00:48 punter so scalar myfunc(), would cause wantarray in myfunc to equal false?
00:49 preaction except now i'm confused as to why that doesn't print anything
00:49 * preaction blames being exhausted
00:50 punter false equals ''
00:50 punter i.e. nothing
00:50 preaction because "not" doesn't bind tightly enough, actually
00:50 preaction perl -le'sub what_i_want { print !defined wantarray ? "nothing" : wantarray ? "list" : "scalar"; }; what_i_want(); my $scalar = what_i_want(); my @array = what_i_want(); my @array = scalar what_i_want();'
00:50 * preaction stops pasting to the channel after that
00:50 preaction so what the first one was actually doing, ha ha, was evaluating the entire ternary, and THEN applying "not", making every string into "".
00:51 punter a
00:51 preaction the second one, using !, binds the not operation more tightly, and does what i want
00:51 preaction and THEN it finally demonstrates the wantarray/scalar interaction i wanted to show you
00:51 punter excellent!
00:51 punter excelent!
00:51 preaction so you get to see perl's sometimes confusing order of operations _and_ how wantarray/scalar work ;)
00:51 punter one of the two
00:52 preaction two l's i believe
00:52 punter http://www.youtube.com/watch?v=YKUOB8MN4Kc
00:53 preaction but the idea behind why inside of a list is list context is so that you can do: my @combined = ( @one, @two, @three ); an array in list context gives you the members of the array. lists are flattened, so you get the combined members of the array
00:54 punter I am wondering whether there's a way to shorten this: $self->render(json => { status => 'ok', data => [10, 20, 30] })
00:54 preaction and each of those arrays could also be a sub that returns a list/array (there is one very subtle thing about return list vs return array that escapes me right now)
00:54 punter into: return [10, 20, 30]
00:54 punter or: my_return [10, 20, 30]
00:54 preaction doesn't status default to ok? so just: $self->render( json => [ 10, 20, 30 ] ); should work, no?
00:54 * preaction has not used mojo as much as he should to answer that question
00:55 punter it works, but I'd like my_return to include status => 'ok' in the JSON
00:55 punter o
00:55 punter ok
00:55 preaction ohh, i see
00:55 preaction wait, why? you have a 200 OK in your http response, use it
00:55 preaction if it's not ok, use a different http status code, 400, 500, 401, 403, 404, 402, etc...
00:55 punter hm... hadn't thought of that. I will :-)
00:56 preaction they each have a different meaning, and can help make your API a lot friendlier
00:56 preaction 500 basically means "hey, I screwed up, let an admin know". 400 basically means "hey, YOU screwed up. stop doing that." 401 is "You aren't privileged enough for this." 403 is "This is impossible." 404 is "I don't know what you're asking for"
00:57 punter Was used to including ok in JSON from work, but there's no reason
00:57 preaction yeah, i used to do that too
00:57 preaction REST is all about using http to its fullest. it's a robust protocol, and we should use it
00:58 punter Since you know so much about status codes: I couldn't find a status code for "the two passwords you entered are not the same" type of user-input errors
00:58 preaction i've been using 400 bad request for that, but that may not be the exact correct code
00:59 punter I use 409, which I'm not sure is the right one
00:59 preaction 401 works. you're trying to auth, you're not authed. 401
00:59 punter I'm not trying to auth, but to register new account
00:59 preaction oh. i check that on the client side, honestly
00:59 punter You're right (again)
01:00 punter Send only one password
01:00 preaction yeah, the API shouldn't care
01:00 preaction that's what i figured at least
01:00 punter You seem to write REST API apps... but don't use Mojo, what do you use?
01:00 preaction i just got done with a major new website (not in mojo, unfortunately, in Python even)
01:00 punter a
01:00 preaction i wrote my own web framework, because most of the ones i found in python kind of suck
01:01 preaction nothing like mojo there, though a new one called Klein has a shot at it
01:01 punter Was it a requirement of your client's to use Python?
01:01 preaction Flask seems nice, but doesn't have an underlying event loop like Twisted / Klein
01:01 punter What did you need the event loop for?
01:01 punter that's for websockets, right?
01:02 preaction it's my own company, and yeah, i made a bad decision 4 years ago to use Python based on one library that is missing in Perl (that I now could have written)
01:02 punter i see
01:02 preaction websockets is one thing yes, but also various website stuff that you want to do that isn't tied to the actual serving of requests
01:02 preaction or asynchronous request handling
01:02 preaction in fact, mojo was created because of the event loop
01:02 preaction (from what jberger told me, i abdicate to him on this)
01:03 jberger ETOOMUCHBACKLOG
01:03 preaction heh
01:03 preaction just the last two lines
01:04 punter It's possible to use Mojo Websockets on Starman, right/
01:04 punter ?
01:04 jberger no
01:04 preaction that's a question i cant' answer
01:04 preaction but that's what hypnotoad is for, no?
01:04 jberger all the "real time" features require one of the built-in servers
01:05 jberger daemon morbo or hypnotoad
01:05 preaction if mojo::ioloop supports EV, then could AnyEvent work?
01:05 punter Is hypnotoad lacking any important features when compared to Starman?
01:05 jberger psgi doesn't support websockets anyway, even IF the IOLoop worked with them
01:05 jberger punter, not that I'm aware of
01:06 preaction starman is basically a thin wrapper around Net::Server::PreFork, so there isn't that much there really
01:06 punter jberger: vti has created websockets (SockJS) for Twiggy
01:06 punter jberger: a slightly modified Twiggy
01:06 preaction and twiggy, that was the one that uses AnyEvent, right?
01:06 punter jberger: but ok, I'll use hypnotoad
01:06 punter yes preaction
01:07 preaction so you can get an event loop there, not sure if Mojo::IOLoop can use the same loop as AnyEvent or not
01:07 preaction i'm sure that was not a design consideration, and why would it be?
01:08 punter hypnotoad
01:08 punter i remember a frog in futurama that could hypnotize you. the name's probably from there
01:09 preaction yes, that is it exactly
01:09 jberger yes Mojo::IOLoop can interact with AnyEvent via EV
01:09 preaction ALL GLORY TO THE HYPNOTOAD
01:09 jberger preaction its about time that ... ALL GLORY TO THE HYPNOTOAD
01:10 jberger http://mojolicio.us/perldoc/Mojoli​cious/Guides/Cookbook#Event_loops
01:10 jberger ^^^ thats the full story on event loops
01:10 jberger <3 Mojo::IOLoop
01:10 preaction so then you could use Twiggy and get Mojo::IOLoop, no?
01:11 jberger I don't think it works that way, hmmmmm
01:11 * jberger reads about twiggy
01:11 jberger I think the problem there is that PSGI doesn't have a websocket spec, but maybe the IOLoop would still work (I'm really not sure about that one)
01:11 jberger is there some reason to use twiggy?
01:12 preaction not really, no
01:12 jberger hypnotoad is pretty awesome
01:12 * jberger just deployed his first nginx rev proxy to hypnotoad
01:13 punter jberger: will nginx proxy websockets successfully? have you tried it?
01:13 jberger which btw is finally a good solution to using a user perlbrew but running a webservice on port 80
01:13 punter the new version i mean
01:13 jberger in the new version of nginx it should work
01:14 jberger I've not tried it, this thing I just deployed is a very basic site
01:14 jberger no websockets needed
01:14 jberger but recent nginx do support websockets and I believe that is true for the reverse proxy
01:24 jberger from https://github.com/kraih/mojo/blo​b/master/lib/Mojo/Server/PSGI.pm
01:24 jberger we can see that PSGI deployed mojolicious apps do not have a running IOLoop
01:25 jberger in comparison with https://github.com/kraih/mojo/blob​/master/lib/Mojo/Server/Daemon.pm
01:25 jberger and morbo and hypnotoad both inherit from Daemon
01:25 jberger use the source luke! :-P
01:26 punter Will I have to implement the 'heartbeat' mechanism for the websockets myself? Or maybe it's not needed at all?
01:26 jberger punter, if you can, you should just use hypnotoad
01:26 punter so the client knows when to reconnect (on dropped websocket connection)
01:27 punter i'll use hypnotoad. does that implement some kind of heartbeat? or is it not needed?
01:27 punter does the browser take care of reconnecting on dropped connection?
01:27 jberger I'm not sure how the internals of the websocket architecture work, but it is handled internally
01:28 jberger you might need to set a longer timeout, IIRC the default is rather short (~10s)
01:28 jberger but that is easily done
01:28 punter I remember socket.io used to send a small packet every 15 seconds, I figured from that fact that it is necessary
01:28 jberger there is a PING/PONG mechanism I recall, that is probably it
01:29 punter ok
01:31 jberger that is all internal, handled for you
01:56 Meiermann joined #mojo
02:09 punter So, if I have 1,000 clients concurrently connected with websockets to my server, does this mean 1,000 hypnotoad processes will be running?
02:16 punter I think I see: I can set the number of concurrent connections, depending on whether I execute blocking operations or not
02:17 punter So the ideal would be, I believe, to have a hypnotoad dedicated to websockets, with many concurrent connections, and several for HTML&API with a low number of concurrent connections
02:32 mrphilov joined #mojo
02:50 tba__ joined #mojo
02:51 asarch joined #mojo
02:52 tba joined #mojo
03:00 d4rkie joined #mojo
03:07 preflex_ joined #mojo
03:33 tba_ joined #mojo
03:49 KindTwo joined #mojo
05:46 denisboyun_ joined #mojo
06:15 jdvorak joined #mojo
06:17 jdvorak Hi.  I noticed that Google::Voice hadn't been updated in quite a while, and it was no longer functional.  I made some changes to it to change deprecated calls to the Mojo module to avoid the use of post_form(), and it appears that it now can successfully send SMS messages.  But phone calls, when initiated, disconnect immediately.  I know almost nothing about the Mojo module.  I am looking for a Mojo expert who can assist me in getting Google::Voice wo
06:19 denisboyun_ joined #mojo
06:28 crab where's the latest code?
06:33 jdvorak I can put it on Pastebin.
06:36 Britzel joined #mojo
06:36 jdvorak http://pastebin.com/Rv9hpjA4 <- The changes that I made are very simple.  I removed the post_form() calls and replaced them with post() calls.
06:40 Vandal joined #mojo
06:43 sri jdvorak: send tempire a pull request, i'm sure he will appreciate that https://github.com/tempire/perl-google-voice
06:45 jdvorak sri: It's a good idea. I will have to sign up for github....
06:46 dod joined #mojo
06:51 denisboyun joined #mojo
07:03 dod joined #mojo
07:14 d4rkie joined #mojo
07:28 iSlug joined #mojo
07:35 trone joined #mojo
07:36 good_news_everyone joined #mojo
07:36 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/dZRf_w
07:36 good_news_everyone mojo/master ba0f0dd Sebastian Riedel: handle CONNECT failures a little more gracefully
07:36 good_news_everyone left #mojo
07:36 sri bpmedley: that should at least result in a sensible error message now
07:37 sri the whole fiddler thing is still very very weird though
07:38 hrupp_ joined #mojo
07:45 * nic calls Antarctica
07:52 punter joined #mojo
07:59 d4rkie joined #mojo
08:08 sh4 joined #mojo
08:15 denisboyun joined #mojo
08:18 good_news_everyone joined #mojo
08:18 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/50aY6Q
08:18 good_news_everyone mojo/master c559f83 Sebastian Riedel: better CONNECT tests
08:18 good_news_everyone left #mojo
08:29 good_news_everyone joined #mojo
08:29 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/jLjxZA
08:29 good_news_everyone mojo/master 1beb4fd Sebastian Riedel: small optimizations
08:29 good_news_everyone left #mojo
08:30 jzawodn joined #mojo
09:09 punter Is there a list of which environment variables Morbo & the other servers use?
09:12 connor_goodwolf joined #mojo
09:13 connor_g1odwolf joined #mojo
09:13 punter I search the source code for the answer
09:14 punter Question: How do I set the environment (development || production) of Morbo? Through an $ENV{..} ? Is there a setting on the command line?
09:14 Britzel Someone had started compiling a list, and I contributed my findings in the hope, that it might end up in the wiki. Alas, it didn't.
09:14 punter I can't find the answer to that in the docs
09:14 Britzel which OS?
09:14 punter Linux
09:15 Britzel assuming bash: $ export VARIABLENAME=VALUE; morbo script/myscript
09:16 punter Britzel: No, I mean, the Env, like, is morbo running on a development machine, or is it running on a production machine?
09:16 punter I'm talking about the setting that among other things sets whether the exact error will be shown on the browser in case of error
09:17 mire_ joined #mojo
09:17 Britzel I may be wrong, but it my understanding that morbo _is_ the devel server, single threaded, auto restart on codechange.
09:18 punter The MODE
09:18 punter ok
09:18 punter You're right
09:18 Britzel hypnotoad is the production builtin server, multithreaded pre forking, no auto restarte
09:18 punter Single threaded, but how many concurrenct connections does it allow?
09:18 Britzel One
09:18 Britzel Uno
09:18 Britzel Eine
09:18 Britzel 1
09:19 punter So I can't work with websockets AND html then
09:19 punter I need to run two morbos
09:19 Britzel Um, dunno, I have never played with websockets.
09:19 bc547 Britzel: single threaded does not mean 1 concurrent connection
09:19 rhaen joined #mojo
09:19 Britzel bc547: I know.
09:19 rhaen hi #mojo.
09:20 sri i guess a -m flag for morbo would make sense, considering that people most likely want to develop with other modes as well
09:21 bc547 punter: websocket example is given on https://github.com/kraih/mojo/wiki/Writi​ng-websocket-chat-using-Mojolicious-Lite
09:21 punter I have three modes: local, testing & production
09:22 punter but morbo only runs on local, so I'm ok
09:22 punter the other two will have hypnotoad
09:24 good_news_everyone joined #mojo
09:24 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/OquQMQ
09:24 good_news_everyone mojo/master 2acef0b Sebastian Riedel: added --mode option to Morbo
09:24 good_news_everyone left #mojo
09:25 punter thanks
09:27 connor_goodwolf joined #mojo
09:31 good_news_everyone joined #mojo
09:31 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/9lQGKQ
09:31 good_news_everyone mojo/master 6fed490 Sebastian Riedel: slightly more consistent option handling
09:31 good_news_everyone left #mojo
10:07 basiliscos joined #mojo
10:22 abra joined #mojo
10:24 opticnerpe joined #mojo
10:26 opticnerpe I am new to using Mojolicious and I am stuck.  I am using a template which is using a place holder that is supposed to contain some HTML tags.  However, the HTML tags are just displaying instead of processing.  Lik it's literally displaying "<select>" instead of the web browser processing it as an object.
10:27 opticnerpe Looking at the source, I see that it is replacing the < and > symbols with &lt; and &gt;
10:27 opticnerpe respectively.  How do I prevent this?
10:27 sri see rendering guide
10:32 opticnerpe Ah, I see.  I need to use an additional equal sign.  <%== $html_body %>
10:32 opticnerpe sri, thanks!
10:33 jamesw joined #mojo
11:13 bpmedley sri: I get "Proxy connection failed" in $tx->error now.  However, I tried "curl" and was able to use the Fiddler proxy.
11:26 sri bpmedley: i guess i would accept a sensible patch
11:28 sri but it needs a) tests and b) an explanation for why Connection: close is acceptable for CONNECT responses
11:48 sri bpmedley: i actually don't have a clue how to gracefully handle a response as messed up as https://gist.github.com/brianmed/​5940946#file-headers-timeout-L44
11:49 bpmedley sri: It's windows.. :)
11:49 sri it's not just Connection: close, there's also the lack of a Content-Length header
11:50 sri is there a spec that says a response to a CONNECT request can't have a message body?
11:50 bpmedley sri: I haven't found much in googling.  Just a draft from 1999 or so.
11:51 bpmedley sri: It should be noted that with proper headers Mojolicious works in windows.
11:51 sri of course it does
11:51 sri CONNECT support has actually pretty good tests
11:55 sri RFC 2817 seems to cover it
11:55 sri oh, i found another bug though ;p
11:56 sri http://www.ietf.org/rfc/rfc2817.txt
11:56 sri only possible conclusion is that Fiddler must be broken
12:02 good_news_everyone joined #mojo
12:02 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/_oMmLQ
12:02 good_news_everyone mojo/master e852bb0 Sebastian Riedel: fixed bug in Mojo::UserAgent where not all 2xx responses would be accepted for CONNECT requests
12:02 good_news_everyone left #mojo
12:11 tom joined #mojo
12:12 sri bpmedley++ # thanks for looking into it
12:13 bpmedley sri: You are welcome.
12:13 tom Howdy.  I'm trying to use Mojo::Template for a non-web application.
12:13 tom It works fine, but the templates don't have access to the default helpers.
12:13 sri those are not part of Mojo::Template
12:14 sri they get added in the renderer plugin https://github.com/kraih/mojo/blob/master​/lib/Mojolicious/Plugin/EPRenderer.pm#L25
12:16 tom @sri: right.  For a non-web app, is there a good way to use mojo templating, and also have access to those helpers from within the templates?
12:16 sri http://mojolicio.us/perldoc/Mojolicious​/Guides/Cookbook#Application_embedding
12:16 tom at the moment I'm calling ->render_file from within the templates, so can get by without "include" but it is a bit cumbersome
12:17 tom thanks - I'll see if the embedding stuff can work for me
12:28 KindOne joined #mojo
12:33 asarch joined #mojo
12:34 KindOne joined #mojo
12:47 KindOne joined #mojo
12:50 tom I'm not getting much joy with taking other approaches to rendering standalone template files in my (non-web) app.
12:51 tom Mojolicious::Renderer / Mojolicious::Controller seem to place constraints on the template path.
12:51 tom eg appending ".html.ep" and only looking in particular directories (which I note is configurable with paths())
12:52 tom I can't see anything in their APIs to just give them a straight path (need both relative to cwd, and absolute, to work).
12:52 jberger tom: can you explain your use case more fully? When do you need the helpers but don't want to be a web app?
12:52 tom Sure.
12:53 KindTwo joined #mojo
12:54 tom It's generating config files based on a moderately complex model of configuration items which are already in-memory in the app.
12:55 jberger and which helpers do you need?
12:55 tom So for example in a mojo template that generates an apache instance's configuration, I test "<% if ($httpdi->is_ssl) { =%>"
12:56 tom .. and if so, "SSLEngine on" and friends are output.
12:56 tom The specific helper that would be nice to have is "include".
12:57 tom As I mentioned, calling ->render_file from within the template works okay, but as this becomes more common, it just seems a bit cumbersome to keep typing it out, when "include" would be nicer.
12:59 tom So it's a nice to have thing really - I can continue to call ->render_file() from within the template if necessary.
12:59 jberger looking at the source for include, it uses partial rendering which is necessarily part of the rendering engine, so if you need that you are going to need to use the templating system from under the rendering engine
13:00 jberger that said, perhaps it might not be hard to implement your own `include` function which you could prepend to your template, allowing you to use Mojo::Template on its own
13:03 tom interesting, thanks, I'll take a look at that approach.
13:03 jberger it really is the approach that the renderer uses: https://metacpan.org/source/SRI/Mojolicious-4​.17/lib/Mojolicious/Plugin/EPRenderer.pm#L34
13:08 jberger In other news, I thought I was getting close to background job management for Win32 using Coro and friends, but then this: "Win32 unfortunately does not have interval timers." from Time::HiRes
13:08 jberger :/
13:08 sri background job management?
13:09 jberger I've been trying to make Zoidberg run on windows
13:09 sri ah
13:09 jberger so like ^Z
13:10 * sri pretty much never puts jobs in the background anymore
13:10 jberger I got excited because Coro works on windows, but unfortunately there's no way to interrupt the process
13:11 jberger I don't either, which leads to the other possible solution, try to turn off job management in Zoidberg selectively
13:12 sri yea, don't confuse Coro with threads, it's basically just a hack that allows us to have multiple callstacks
13:12 sri on many platforms Coro doesn't actually use pthreads internally
13:13 jberger well it was fun to tinker with anyway
13:37 trone joined #mojo
13:41 sh4 joined #mojo
13:46 sh4 joined #mojo
13:49 punter joined #mojo
14:05 sri guess i'll release mango tomorrow
14:06 sri would be kinda nice if the connection management code in Mango and Mojo::UserAgent could be extracted into a separate module...hmmm
14:07 sri could be useful for other modules like Mojo::Redis too
14:11 sri i keep considering the Mojo::UserAgent code rather ugly... but them i look at modules like AnyEvent::HTTP... :) http://api.metacpan.org/source/ML​EHMANN/AnyEvent-HTTP-2.15/HTTP.pm
14:12 * mst bursts into tears
14:12 mst gods I hate that code
14:13 * sri hugs mst
14:14 bowtie_ joined #mojo
14:46 rem_lex|pivo joined #mojo
14:50 gryphon joined #mojo
15:09 * jberger hands out lollipops
15:09 xiaoyafeng joined #mojo
15:09 jberger truly I'm glad there are smart people on the problem, I can't imagine having to write such code
15:22 dotan joined #mojo
15:27 batman hi. is there a way to make the dispatcher run on another url? like go() in catalyst
15:28 batman i would like to set session(username => ...) on login and then redirect, but looks like browsers doesn't like cookie+redirect...
15:29 batman i was hoping i could do $c->tx->req->url(...); and $c->app->dispatch(Mojolicious::Controller->new); but it does not seem to work
15:35 Vandal O_o
15:35 Vandal which browsers?
15:36 Vandal never had a prolbem with cookie+redirect
15:42 tba joined #mojo
15:46 sh4 joined #mojo
15:48 batman Vandal: oh? maybe i'm doing something else wrong then (chromium)
15:48 * batman starts digging
15:51 Vandal batman, yep, chromium, works fine
15:51 Vandal and opera and FF
15:54 batman thanks.
15:59 sh4 joined #mojo
15:59 iSlug joined #mojo
15:59 d4rkie joined #mojo
16:32 denisboyun joined #mojo
16:48 * sri thinks about a gridfs api for mango again
16:59 sri http://pastie.org/8118568 # does this look like a sane design for the blocking api?
17:00 sri (low level api that is)
17:03 jberger do we know who this is: https://metacpan.org/release/OPERA/Arepa-0.93
17:05 jberger sri: looks sane, would there be a read_all and write_all in an upper level api?
17:06 jberger meaning slurp and spurt
17:06 sri sure, it's meant for *huge* files though
17:06 jberger whatever the name
17:06 sri i'd expect that you'd rather stream them chunk wise
17:06 jberger I've never used gridfs, I guess you are right for streaming huge files
17:06 sri > 16mb
17:07 jberger for my purpose, if I used it it would be for the convenience of not having to store files differently than data
17:07 sri can always add more convenience
17:08 jberger yeah, your example looks sane, then again, having not used it before I can't tell you if you are missing something
17:08 sri i just want to get the basics right for now
17:08 jberger sri: do you know who that OPERA cpanid is?
17:08 sri no
17:08 jberger they have Mojolicious::Plugin::MoreTagHelpers in their Arepa dist
17:09 sri could be cosimo
17:10 sri jberger: heh, i guess you were not around yet when this happened :D https://twitter.com/opera/​status/180422389371383808
17:11 jberger hahah nice
17:12 jberger I have a tag helper that I am using in more than one place, so I'm thinking of releasing it to CPAN
17:12 jberger its not really core considerable, it only makes sense with bootstrap
17:13 * jberger thinks about Mojolicious::Plugin::BootstrapTagHelpers
17:14 jberger control_group seen here: https://github.com/jberger/Galileo/blob/​master/lib/Galileo/Command/setup.pm#L195
17:33 sri looks like the python mongodb driver works pretty much the same \o/
17:34 sri just the perl driver is terrible again... only accepting file handles
17:37 sri guess i'll have stuff like $mango->db->gridfs->slurp('foo.txt') and $mango->db->gridfs->spurt('foo.txt', 'hello world!') for convenience
17:39 sri this is way more fun than rewriting the mango core :)
17:44 ladnaV joined #mojo
17:49 crab what is gridfs?
17:49 preaction mongodb's built-in file store
17:51 mst sri: spew seems to be more common than spurt for the latter case
17:54 sri mst: it's spurt in perl6 now though ;)
17:55 sri http://docs.mongodb.org/manual/core/gridfs/
18:05 crab "slurp" and "spew" do go together a bit better than slurp and spurt
18:06 crab (just making an observation, not arguing for or against naming things either way)
18:08 mst honestly, I quite like 'splat' as an antonym of 'slurp'
18:08 mst mostly because 'spew' and 'spurt' both make me think of beavis and butthead sniggering.
18:08 levabalkin joined #mojo
18:10 levabalkin hello, I cannot find a reference in the documentation for the use of @@ symbol in the __DATA__ section of modules, where shoul I look for this template separator ?
18:13 crab levabalkin: i don't think there's anything specific. it's just "@@ templatename" though.
18:13 crab Mojo::Loader reads in the entire DATA section and splits it up on that separator.
18:16 levabalkin so it's not something that the perl interpreter does on the __DATA__ section, but mojo spliting the data by that separator
18:16 crab yes.
18:32 asarch joined #mojo
18:44 sri \o\
18:44 sri /o/
18:45 crab ?
18:48 tempire |o|
18:48 tempire _o_
18:48 tempire \o
18:49 tempire o/
18:49 tempire !
18:49 dabudabu Hey. I've got an after_render hook (like '$self->hook(after_render => MyApp::Foo:bar'), which works in development mode but in production mode causes an error like '[error] Event "read" failed: Undefined subroutine &MyApp::Foo::cleanup called at /usr/local/share/perl/5.14​.2/Mojolicious/Plugins.pm line 10.'
18:50 dabudabu *MyApp::Foo::bar (sorry, typo)
18:50 dabudabu And s/cleanup/bar/
18:53 dabudabu As a quick fix, I've moved the bar function into the same file where I'm subscribing to the hook (MyApp.pm), but was wondering if there's a way to have it in MyApp/Foo.pm
18:53 tempire hmm
18:54 tempire mojocasts haven't been working in firefox for who knows how long
18:54 tempire but
18:54 tempire now they do
18:54 sri \o/
19:21 lammel2 joined #mojo
19:43 jegade joined #mojo
19:50 BeDa joined #mojo
20:05 mire__ joined #mojo
20:30 maxhq joined #mojo
20:49 preflex_ joined #mojo
20:53 lammel2 left #mojo
20:56 trone joined #mojo
21:09 tm joined #mojo
21:10 tm joined #mojo
21:10 tm joined #mojo
21:35 lukep joined #mojo
21:56 lammel2 joined #mojo
22:00 jnbek joined #mojo
22:05 tm left #mojo
22:12 basiliscos joined #mojo
22:12 punter How can I test websockets with my webapp that's running over morbo? I'm asking because I was told in this channel that morbo only allows one connection per process (and only launches one process), but I need two websockets to be opened from my browser
22:33 batman punter: morbo can only handle one _blocking_ request at a time
22:33 batman punter: as long as it's not blocking it can ... handle multiple requests
22:34 punter batman: so many concurrent connections, right?
22:34 punter but single thread
22:34 punter ok thanks
22:36 batman single process, no threads (unless you think of one process as a thread...)
22:37 batman cooperative programming != threads
22:38 punter one process is what I meant
22:38 batman punter: guess the answer is that it's not a problem testing multiple (~10000) websockets with morbo :)
22:39 punter good
23:16 punter left #mojo
23:30 bpmedley joined #mojo

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