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

IRC log for #mojo, 2014-02-10

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

All times shown according to UTC.

Time Nick Message
00:08 damaya jberger, are you talking about the create_route helper?
00:09 jberger shoot I closed that tab
00:09 damaya hehe
00:09 jberger damaya, yes
00:09 damaya I guess I'm not sure what you mean by "close over".
00:09 damaya Ah, yes, that was the one thing I was trying to figure out how to do best
00:10 damaya I will look at PPI, thank you for all the feedback
00:10 damaya I'm checking here off and on at this point. Playing some Ocarina of Time with my son.
00:10 damaya Teaching him the ways.
00:10 jberger cool
00:11 jberger one more thing, for internal use stash keys, think about prefixing them with 'myplugin.'
00:11 damaya I see that you do that in humane.
00:11 jberger so like 'datatables.settings'
00:11 marty joined #mojo
00:11 jberger names with a . don't become scalars in the templates
00:11 damaya So, don't use has db_info    => sub { +{} }; for example?
00:12 jberger so you have to use stash('datatables.settings')
00:12 jberger but then again, you have minimal risk of collision
00:12 jberger I wouldn't
00:12 jberger the choice is yours
00:12 jberger remember that your plugin is going to live in the real-world of someone else's app
00:13 jberger keeping their stash clean is polite
00:13 jberger and reduces risk
00:14 punter Question about Websockets: Why do I need to subscribe to an incoming event with "on" in order for websocket connections to be able to be established on my server?
00:15 punter I'm asking because I'd like my server to not subscribe to any incoming websocket events with "on" - just send stuff once an hour or so
00:17 damaya Would it make sense to do 'datatables.dbinfo' and 'datatables.tableinfo' ?
00:20 good_news_everyone joined #mojo
00:20 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/ze7zog
00:20 good_news_everyone mojo/master f9e076c Sebastian Riedel: added example for accepting WebSocket handshake without subscribing to an event
00:20 good_news_everyone left #mojo
00:20 jberger damaya, enjoy zelda
00:20 * jberger is jealous
00:21 punter sorry if my question was wrong :-)
00:21 punter a ok
00:21 mattp joined #mojo
00:22 jack joined #mojo
00:23 sri jberger: mojoconf is not officially announced yet
00:23 jberger I didn't get the link
00:24 jberger someone else tweeted it first
00:24 jberger should I delete?
00:24 sri keep it under wraps!
00:24 jberger https://twitter.com/maddingue/status/432659037679673344
00:25 jberger ok, well I deleted my tweet
00:25 sri HIDE ALL THE THINGS
00:25 jberger I figured since I saw tweets
00:25 jberger sorry guys :-/
00:26 jberger hehe
00:26 sri the official stance for now is we can't confirm or deny mojoconf
00:26 jberger k
00:28 jberger perhaps the down-low promotion will build excitement :-P
00:44 * jberger can confirm that it is still bloody cold in Chicago
00:45 sri warming up in germany
01:00 * jberger hopes that should he ever make it to Norway, for any reason, that he would get to see some fjordy-looking fjords
01:01 laouji joined #mojo
01:02 nicomen it's not TOO fjordy in Oslo, but perhaps a boat trip would be something
01:03 btyler joined #mojo
01:03 * sri would join... should he ever be in norway, for any reason
01:16 d4rkie joined #mojo
01:27 ka2u joined #mojo
01:33 hlin joined #mojo
01:47 bpmedley What would ya'll do if you wanted to transcode a video while displaying it in the browser?
02:04 skullbocks joined #mojo
02:07 jberger it makes me sad when the entire first page of the SO Perl tag is about text search and replace
02:07 radixo joined #mojo
02:08 dj_goku jberger: that is kind of sad. :(
02:13 skullbocks joined #mojo
02:17 klapperl_ joined #mojo
02:23 mixMonkey joined #mojo
02:25 jberger sri: this is the correct invocation right?
02:25 jberger BEGIN { $ENV{MOJO_REACTOR} = 'Mojo::Reactor::Poll' }
02:25 jberger I'm seeing tester results with "EV does not work with ithreads" messages, but my test has that line at the top
02:29 mire joined #mojo
02:31 gnephiak joined #mojo
02:40 jberger got it
02:41 cpan_mojo Mojo-IOLoop-ForkCall 0.06 by Joel Berger - http://metacpan.org/release/JBERGER/Mojo-IOLoop-ForkCall-0.06
02:41 * jberger pats cpan_mojo
02:41 * jberger kicks purl
02:41 * purl kicks jberger
02:44 jberger there's some hope that this version will be clean on all platforms :-D
02:44 * jberger probably speaks too soon
03:03 thowe joined #mojo
03:03 thowe hello.
03:04 thowe I'm looking at some examples of writing non-blocking apps with Mojolicious...  I'm curious about the subroutines that get passed after the calls to render_later.
03:06 thowe They seem to pass at least two bits of data automatically, often called "$coll" and "$err".  Is this a Mojo thing?  Are these subroutines of the Mojo class?  I'm just curious where this interface is described.
03:06 jberger thowe, this is generally call 'continuation passing' style
03:07 jberger basically it says "when you are done doing this job, then call this function"
03:07 jberger each non-blocking method defines the arguments that get passed to the callback
03:08 jberger the easiest to understand is probably the Mojo::UserAgent get method
03:09 jberger get some url, then when you get it, call this subref and pass it the agent and the resulting transaction object
03:09 jberger the benefit is that the app doesn't have to wait for the 'get' to complete
03:09 jberger it can go on and do other things
03:09 jberger then call that function when it has gotten the response from the remote server
03:10 thowe OK, but in one example you have the oid being passed...  But "my ($coll, $err, $doc) = @_;" seems to indicate it is third in line after "$coll" and "$err".  Where is it defined that these things ared passed first?
03:10 jberger what are you looking at?
03:11 thowe http://blogs.perl.org/users/joel_berger/2013/10/writing-non-blocking-applications-with-mojolicious-part-1.html
03:11 thowe my ($coll, $err, $oid) = @_;
03:11 thowe The Non-Blocking Form
03:12 thowe what are $coll and $err and how do I know they are passed before any of my arguments?
03:12 thowe This must be defined someplace(?)
03:12 * jberger looks
03:13 jberger https://metacpan.org/pod/Mango::Collection#find_one
03:13 jberger https://metacpan.org/pod/Mango::Collection#save
03:14 jberger yes, it is up to the documentation to note what the arguements to the callback should be
03:15 thowe Oh...  So this only works with stuff designed specifically to handle a callback..  Such as Mango::Collection#find_one
03:15 jberger right
03:16 jberger in order for a non-blocking application to work, the whole chain must not block
03:16 jberger ... unless you have some tricks up your sleeve :-P https://metacpan.org/pod/Mojo::IOLoop::ForkCall
03:17 * thowe wonders if he can do that with DBIC
03:17 sri http://mojolicio.us/perldoc/Mojolicious/Guides/FAQ#What_is_the_difference_between_blocking_and_non-blocking_operations
03:17 sri and the following 2 answers
03:18 good_news_everyone joined #mojo
03:18 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/BPKgjA
03:18 good_news_everyone mojo/master 43da906 Sebastian Riedel: fixed typo in FAQ
03:18 good_news_everyone left #mojo
03:18 jberger I don't believe DBIC can handle non-blocking, but I don't know that for sure
03:18 sri it can't
03:18 jberger ForkCall might work, but be sure that your connection is fork-safe
03:19 sri making it work with one DBD module is a pita, making it work portably with something like DBIC is impossible
03:20 sri any non-blocking SQL database module would be database specific and prolly use raw SQL
03:20 thowe Maybe as long as I have as many workers as I have allowed database connections I don't have to worry too much...
03:23 thowe All my command line code that works with our big database at work uses DBIC classes I have been working on for a while.  I want our web interface to as well, but the whole thing is a pile of really bad PHP.  I would love to be able to Mojo the whole things up...
03:25 thowe I was originally thinking doing it with Catalyst, because I know Catalyst a little bit.  But Mojo seems more awesomer.
03:26 tempire it is
03:26 tempire oh oh
03:26 * tempire can confirm
03:27 thowe Oh, jberger.  You're everywhere...  I was playing with Galileo the other day :)  Submitted that Issue, but I think I solved it myself.  (I think you commented)
03:29 jberger :D
03:29 thowe =]
03:29 * jberger is only right here. can confirm
03:30 jberger WHY NOT ZOIDBERG???
03:30 purl (V) (;,,;) (V)
03:30 thowe That's funny...
03:31 thowe Anyway, thanks for you help and for all the other stuff you seem to do that helps me (and I'm sure many others).  Much appreciated.
03:31 thowe now I must go watch TV.
03:31 * jberger blushes, then thanks sri for the great framework
03:32 jberger for the record, if I was everywhere, I wouldn't tell anyone
03:33 sri so that confirms it
03:49 sri hmm, having built in significant return values in the job queue could be fun
03:51 crab what job queue?
03:51 purl job queue is ordered.
03:51 sri $queue->task(add => sub { my ($queue, $a, $b) = @_; return $a + $b }); my $oid = $queue->enqueue(add => [1, 1]); my $two = $queue->result($oid);
03:51 sri the one i built for myself :)
03:53 sri but i guess $queue->app->mango->... will get used most of the time anyway
03:54 sri think when i have some time i'll polish and release it
03:56 sri the self repairing parts are pretty cute, all workers check the integrity of the queue every now and then to clean up after dead workers that just went away
04:06 sri thing about return values is that they are a fun way to explain a job queue in docs :)
04:10 sri "...->result($oid) will return undef until the job has actually been finished in the background..."
04:18 * dj_goku is excited for the job queue :D
04:26 jwang joined #mojo
04:28 laouji joined #mojo
05:03 d4rkie_ joined #mojo
05:04 irq joined #mojo
05:22 gnephiak joined #mojo
05:23 gnephiak Hi guys, I have a trivial question.
05:23 gnephiak Will $self->render() return the lambda?
05:23 gnephiak in routes
05:30 crab return... the lambda?
05:36 ka2u joined #mojo
05:45 mixMonkey joined #mojo
05:58 Stefan joined #mojo
06:31 Vandal joined #mojo
06:36 Stefan joined #mojo
06:57 buu Do I need to do anything special to get MojoUA to accept and store cookies?
06:57 buu Because this is confusign me
07:03 trone joined #mojo
07:08 basiliscos joined #mojo
07:34 denis_boyun joined #mojo
07:44 abra_ joined #mojo
07:45 crab no
07:56 rawler joined #mojo
07:57 eseyman joined #mojo
07:58 dod joined #mojo
08:08 damaya Is this new: http://mojolicio.us/perldoc/Mojolicious/Guides/FAQ#What_is_the_difference_between_blocking_and_non-blocking_operations
08:08 damaya ?
08:08 damaya I just found the FAQ, never even noticed it before.
08:08 damaya I wish I had found this 3 months ago
08:13 crab heh, will my code magically become non-blocking with mojolicious
08:17 bowtie_ joined #mojo
08:20 dod joined #mojo
08:24 trone joined #mojo
08:36 odc joined #mojo
08:43 maxhq joined #mojo
09:13 dpetrov_ joined #mojo
09:21 irq joined #mojo
09:25 dvinciguerra joined #mojo
09:41 rem_lex|pivo joined #mojo
09:49 kwa sri++ #accepts idiom IS useful
10:13 skullbocks joined #mojo
10:14 fhelmber_ joined #mojo
10:37 rem_lex joined #mojo
10:37 Andy2 joined #mojo
10:38 Andy2 hi
10:39 Andy2 I'm trying mojo thr first time right now and the examples where templates are used are not working, even when inline
10:39 Andy2 It says "[debug] Template "baz.html.ep.html.ep" not found."
10:40 Andy2 ANd i have no idea why, any ideas?
10:41 Andy2 That happens for this example: http://search.cpan.org/~sri/Mojolicious-4.78/lib/Mojolicious/Lite.pm#Stash_and_templates
10:41 radixo joined #mojo
10:43 moritz Andy2: you have to remove leading spaces from the examples you copy&paste
10:44 moritz Andy2: in particular, the lines with @@ may not have spaces before the @@
10:44 moritz same with __DATA__
10:46 Andy2 moritz: There are no leading spaces and i even get the error:  Template "not_found.development.html.ep" not found.
10:46 Andy2 When teh rout does not exist
10:46 odc joined #mojo
10:46 Andy2 I am not sure if that is normal
10:46 moritz 11:39 < Andy2> It says "[debug] Template "baz.html.ep.html.ep" not found."
10:47 moritz sounds like you specified the template 'baz.html.ep' instead of 'baz' in your mojolicious code
10:47 Andy2 that is for the rout bar from the example
10:47 Andy2 OHH
10:47 Andy2 moritz: Right it works now
10:47 moritz \o/
10:48 Andy2 Thanks a lot :)
10:48 Andy2 I was playing arount with the names
10:48 Andy2 Not sure why it didn't work in the first place
10:51 moritz I know that it confused me in the beginning too
11:07 punter joined #mojo
11:25 nicomen perl -MMojo::DOM -wlE 'print Mojo::DOM->new("<b><!-- foo --><i>lol</i></b>")->at("i")->previous;' # Why don't I get the comment?
11:27 skullbocks joined #mojo
11:36 Stefan joined #mojo
11:48 denis_boyun joined #mojo
11:55 punter joined #mojo
12:06 tardisx joined #mojo
12:09 purl joined #mojo
12:18 radixo joined #mojo
12:29 rem_lex joined #mojo
12:37 d4rkie joined #mojo
12:41 nicomen now that Mojo::DOM->content replaces ->text_before, how do I use ->content to mimic ->text_before?
12:42 nicomen (sorry meant contents(
12:57 cpan_mojo Mojolicious-Plugin-Util-Endpoint 0.16 by Nils Diewald - http://metacpan.org/release/AKRON/Mojolicious-Plugin-Util-Endpoint-0.16
13:35 btyler joined #mojo
13:44 radixo joined #mojo
13:45 nicomen hm, seems like there is some serious difference in how conetnt/prepend/append works
13:51 mire joined #mojo
13:56 nicomen what the?
13:56 nicomen $ perl -MTest::More=no_plan -MMojo::DOM -wlE 'my $d = Mojo::DOM->new(q{<p><p a="b">lol</p></p>}); $d->find("*[a=b]")->map(sub{ $_->prepend("pre"); $_->append("app"); }); ok("$d", q{<p>pre<p a="b">lol</p>app</p>}); print $d'
13:56 nicomen ok 1 - <p>pre<p a="b">lol</p>app</p>
13:56 nicomen <p></p>pre<p a="b">lol</p>app
13:56 nicomen 1..1
13:56 nicomen ah haha
13:57 nicomen this fails according to what I would expect, and pre 4.77 (78) behaviour
13:57 nicomen $ perl -MTest::More=no_plan -MMojo::DOM -wlE 'my $d = Mojo::DOM->new(q{<p><p a="b">lol</p></p>}); $d->find("*[a=b]")->map(sub{ $_->prepend("pre"); $_->append("app"); }); is("$d", q{<p>pre<p a="b">lol</p>app</p>});'
14:09 mikegrb joined #mojo
14:22 sh4 joined #mojo
14:24 dvinciguerra joined #mojo
14:31 ryozi joined #mojo
14:38 mire_ joined #mojo
14:43 gryphon joined #mojo
14:46 marty joined #mojo
14:46 marty joined #mojo
15:14 odc joined #mojo
15:14 Stefan joined #mojo
15:28 bluescreen joined #mojo
15:31 asarch joined #mojo
15:43 ka2u joined #mojo
15:47 mattastrophe joined #mojo
16:16 good_news_everyone joined #mojo
16:16 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/RNI9bQ
16:16 good_news_everyone mojo/master 2aea4bf Sebastian Riedel: improved not found page to show the exact path used for route matching
16:16 good_news_everyone left #mojo
16:23 bedivere joined #mojo
16:30 tempire joined #mojo
16:31 basiliscos joined #mojo
16:33 mattastrophe joined #mojo
16:35 tempire joined #mojo
16:55 basiliscos1 joined #mojo
16:57 mire_ joined #mojo
17:05 bluescreen joined #mojo
17:30 dwierenga joined #mojo
17:36 sri hmmmm... i guess $queue->enqueue(foo => ['bar', 'baz'], {result => 1}) would be a simple solution to the return value problem, and just as good for examples
17:37 sri (just use an option to make the task return value significant)
17:44 punter joined #mojo
17:44 btyler sri: what is the problem? sounded earlier like enqueue would/(does?) return the job ID in the storage backend, like in other queue systems
17:45 sri i want something dead simple to explain in docs
17:45 btyler ah, right. yeah, "the return value is....some ID that depends on what you're using for storage"
17:45 sri that's not the return value i'm talking about
17:46 sri http://irclog.perlgeek.de/mojo/2014-02-10#i_8258638
17:47 btyler ah, I misunderstood the snippet earlier. butting back out, then :)
17:49 sri normally you would do fire and forget operations with your job queue, but since mojolicious is mostly non-blocking, you might want to use it for blocking operations that you expect a return value from
17:51 sri http://pastie.org/8719535
17:52 sri stuff like this is totally possible
17:53 sri could even be optimized with capped collections and a tailable cursor to notify ->result the second a result is available
17:54 sri in the example ->result would wait non-blocking for a result to be available
17:54 btyler and with {result => 0} it would block until the job completed?
17:55 sri no, fire and forget
17:55 sri this is about using the return value of the task
17:55 sri normally a job queue would not bother
17:55 btyler right, yeah, I've always used them in the 'fire and forget' sense
17:57 sri of course my example can be shortened with a simple helper... $self->perform_job_and_wait_for_result(add => [1, 1] => sub { my ($self, $result) = @_; ... });
17:59 sri perhaps it's not worth it if nobody understands it anyway ;p
17:59 btyler I get it now, sounds awesome. I suspect you've already considered and discarded this, but it feels like a good fit for an event listener
18:00 btyler but I suppose $self->app->queue[$oid]->on(result => sub {} is a bit icky
18:01 Stefan joined #mojo
18:06 btyler having enqueue return an object out of the question? http://pastie.org/8719581
18:08 mattastrophe joined #mojo
18:09 btyler heh, ok, 15 minutes later, I get the issue - deciding whether to register the result callback/event
18:09 sri out of the question, since it can't work
18:13 bpmedley sri: Is "add" an already defined job that can go in the queue?
18:13 sri see link above
18:14 btyler I was thinking in terms of registering the 'result' listener when the $job event emitter heard about someone listening for 'event', but that requires something like the 'newListener' event in node
18:14 bpmedley Oh sweet.  It's a task.. :)
18:15 sri the idea is to make it feel like any other callback in mojolicious, like a validation check, but process it in the worker cluster
18:15 btyler anyways, apologies for the failures of understanding. it does sound really neat, looking forward to seeing how it turns out
18:16 sri every task gets a full application instance, so it feels like your app during startup
18:17 bpmedley Nice
18:26 skullbocks joined #mojo
18:40 ka2u joined #mojo
18:40 meshl joined #mojo
18:45 hahainternet joined #mojo
18:45 katze joined #mojo
18:46 thowe joined #mojo
18:47 katze Hi. Can someone point me to a good example of how to write an asynchronous web applications using websockets and workers? It's kinda hard to get into
18:51 dvinciguerra joined #mojo
18:51 bedivere joined #mojo
18:52 bedivere Hallo
18:53 bedivere Ich hab da ein kleines Problem mit Mojolicious als PSGI
18:53 sri this is an english channel
18:53 bedivere uppps, sry
18:54 bedivere ok, i have got some problems with a mojolicious application in an psgi environment
18:56 bedivere in cgi and with the testsuite, the application works like expected, but with psgi $controller->render('controller/action') seems to not find the corresponding template file (templates/controller/action.html.ep), in that case i receive a 404 page
18:57 bedivere i have another different application on the same server running, that also does something like this render-thing and this application works well in cgi and psgi
18:57 bedivere any ideas what could be the problem?
18:58 moritz bedivere: are files in public/ served OK?
18:58 moritz if not it might be a problem with the working directory
18:59 bedivere with cgi everything works, so i expect that die files are ok
18:59 hahainternet bedivere: make sure your action is rendering something, you can get 404s when the function doesn't return anything iirc
18:59 hahainternet oh, maybe not
18:59 hahainternet i'll go back to shutting up
18:59 frustrating_chat ;)
19:00 moritz bedivere: with CGI, each request gets its own process, and its own working directory
19:00 bedivere i thought that if the application runs into a render call somewhere, this is going to be rendered
19:01 bedivere thats why i need to set things like MOJO_HOME in psgi, aint that right?
19:01 frustrating_chat bedivere: yeah ignore me, i didn't realise it all worked with cgi
19:02 sri maybe make it die and look at what paths and stuff your app is actually using
19:02 bedivere and dont forget my big testsuite ;)
19:02 bedivere i made it die allready before the render call and right at the end of the action sub
19:03 sri then you know what paths it is using
19:03 sri just compare
19:03 bedivere ah ok, sry
19:04 bedivere oh ... well ... that might case the problem ...
19:04 bedivere HOME is showing to the wrong application, the other one, the one that works
19:05 bedivere s/showing/pointing
19:05 bedivere hrm ... i worked with the wiki pages on that topic
19:06 sri :)
19:06 sri exception page saves the day
19:06 sri this is why they are now right at the top of the tutorial http://mojolicio.us/perldoc/Mojolicious/Lite#Built-in_exception_and_not_found_pages
19:07 bedivere what a wonderful exception page
19:07 btyler joined #mojo
19:09 bedivere so i think this is all about the application path not set correct ... but where do i need to set this path inside my apache config?
19:09 eugen joined #mojo
19:10 bedivere might that be, that $ENV{MOJO_HOME} in the Perl directive is the wrong place for more than one virtual host?
19:13 bedivere ok, just add to the location directive SetEnv MOJO_HOME sets the correct path
19:14 bedivere and now my applications works to
19:15 sri auto detection does not work with mod_perl?
19:15 bedivere maybe it would be a nice idea to die when the render path is wrong together with an information about what it is trying to do
19:16 bedivere no, the problem was different
19:16 bedivere https://github.com/kraih/mojo/wiki/Apache-deployment
19:16 bedivere have a look to the bottom of that page
19:17 sri what about it?
19:17 bedivere this excample seems to set an environment variable MOJO_HOME for every application ... otherwise i cant understand the problem
19:18 sri the wiki is community maintained, with very mixed quality
19:18 sri so, did auto detection not work or did you just not try?
19:18 bedivere i ... did never try ... sry
19:19 bedivere wait for it, i will check
19:19 sri i see
19:20 genio I'm so glad I don't have to deal with mod_fastcgi, mod_cgi, or mod_perl anymore.
19:20 sri please update the wiki in any case
19:20 Stefan joined #mojo
19:20 bedivere im sorry, autodetect does not work
19:21 Stefan joined #mojo
19:21 sri too bad
19:21 punter I haven't understood where&how Mojo::Exception can be used.
19:21 punter It seems useful
19:21 bedivere if i leave out the parts with $ENV in every application, my second application tries to look in the home of the first one
19:21 punter Is it meant to be used by Mojo's developers only?
19:22 sri it would have a recipe in the guides if it was meant to be general purpose
19:23 punter a, thanks
19:23 bedivere oh wait, missed something about auto detection, sry
19:23 Stefan joined #mojo
19:24 sri kwa: glad someone likes the accepts idiom :)
19:24 bedivere sry sri, i gave you a wrong information: auto detection works
19:24 sri \o/
19:25 bedivere thanks a lot :D
19:25 sri fix the wki recipe please ;)
19:25 sri *wiki
19:26 bedivere so i throw away that <Perl></Perl> part in the wiki
19:26 sri PLACK_ENV doesn't seem like such a mad idea
19:26 sri *bad
19:26 Stefan joined #mojo
19:27 Stefan joined #mojo
19:27 Stefan joined #mojo
19:28 Stefan joined #mojo
19:28 bedivere upps, its all about PerlOptions +Parent that was missing in my config
19:29 sri ah, it doesn't matter, miyagawa fixed it in Plack
19:29 sri PLACK_ENV only matters for changing the application mode, not detection
19:30 Stefan joined #mojo
19:33 bedivere i will rely on auto detection
19:35 sri wow... what a vicious and false review :( http://cpanratings.perl.org/dist/Mojolicious#11568
19:38 cpan_mojo Mojo-Server-TCP 0.01 by Jan Henning Thorsen - http://metacpan.org/release/JHTHORSEN/Mojo-Server-TCP-0.01
19:40 dod joined #mojo
19:40 tempire wow.
19:41 tempire that's just blatantly false.
19:41 genio Is there no way to respond to cpan revies such as that?
19:41 Adura You can click No?
19:42 sri of course he's a dancer developer
19:42 sri with a dancer history of over a year
19:43 sri all you can do is click no, if it gets enough it will be hidden and not counted
19:43 genio Adura: yea, I know you can up/down vote it.  I was wondering if there was any comments type thing I was missing a-la-amazon or something
19:44 sri nope, nothing you can do about it... cpanratings is the worst part of cpan
19:44 irq joined #mojo
19:48 sri looks like it's hidden now
19:48 frustrating_chat i was just about to say
19:48 frustrating_chat i can no longer see it
19:48 sri but if you have a bitcard account please vote No again... just in case :S
19:49 frustrating_chat which review was it?
19:49 bedivere it's gone, is it?
19:49 frustrating_chat there are 4 hidden ones
19:49 Adura cpan_mojo needs to keep an eye on the ratings, too.
19:49 sri it will reappear once someone votes Yes, i think there needs to be like 4 times as many No votes
19:50 frustrating_chat i assume it was the review of 4.77
19:50 frustrating_chat i must say, i too find routes confusing and frustrating, but the Mojo::JSON comment seems hurtful
19:50 genio The other bad rating on v1.86 is meh, too.  No'd that one.  That guy does nothing but provide terrible ratings
19:52 Adura The two times I upgraded for a popular site, both times did break something. Though, the first was a major release upgrade probably 3.x to 4.x, the second wasn't.
19:53 bedivere i did not quite get the "under" und "bridge" thingy in the routes ... but i use it for simple things like checking the session status and it works
19:53 frustrating_chat I find bridges quite hard to comprehend, I just don't get the implementation logic and usually don't have time to fight it
19:53 frustrating_chat so i just piss about till it works, job done
19:53 frustrating_chat it's a minor complaint as it's only for things like having authenticated bridge routes that it gets frustrating i think
19:55 skullbocks joined #mojo
19:57 sri irc history says rsimoes was last here in january 2012, and has since been releasing dancer modules
19:57 Adura Don't read too much into it, sri. hah
19:57 frustrating_chat yeah i'd chill out about it sri
19:57 frustrating_chat the complaints are not straight up malicious i don't think
19:58 frustrating_chat #1 is an opinion, #2 i think is partially valid, #3 is an opinion
20:00 sri #1 we have a strict deprecation policy, if you don't like it you're welcome to start an open discussion about it #2 it's a tough concept, patches welcome #3 is blatantly false, and easy to verify
20:00 mudler joined #mojo
20:00 sri also about #2, he has not reported any bugs to my knowledge
20:01 frustrating_chat sri: #1 is perfectly fine to me, i appreciate that maintaining backward compatability is a huge drag so rapid deprecation and improvement is valuable
20:01 frustrating_chat #3 i have no knowledge about, so whether it's straight up false or not i can't say
20:01 frustrating_chat but my point is, the difference seems mostly covered by opinions, rather than malice
20:02 sri "A salient example: Mojo::JSON, which is currently the slowest and least-spec-compliant JSON implementation on CPAN."
20:02 sri that is not an opinion
20:02 frustrating_chat yeah but in reality it probably is, as he probably hasn't done the tests
20:02 frustrating_chat he's stating it as fact, but it's probably just based on him not being able to do something at some point and getting frustrated
20:02 frustrating_chat so yeha fair enough to vote it as unhelpful
20:03 sri if he hasn't done the tests it is malice
20:03 frustrating_chat but you shouldn't read malice into it
20:03 frustrating_chat no, that's incompetence
20:03 frustrating_chat never attribute blah blah
20:04 sri ok, lets end this, i've had enough
20:04 frustrating_chat yeah i'm not backing him or anything, i LOVE mojo and wouldn't use anything else
20:04 frustrating_chat but just saying, when he's having a go at your baby, it's easy to take it harsher than it reads to a third party
20:04 frustrating_chat and to me it just reads as a bit of whining that's unlikely to affect anyone's use
20:15 Stefan joined #mojo
20:19 nicomen haha
20:20 nicomen getting bad rating by direct competitors is an honor
20:20 nicomen means you must be doing something good ;-)
20:26 mire_ joined #mojo
20:30 cpan_mojo Mojo-Server-TCP 0.02 by Jan Henning Thorsen - http://metacpan.org/release/JHTHORSEN/Mojo-Server-TCP-0.02
20:31 shixilun joined #mojo
20:33 shixilun I have searched and searched and searched and cannot find the answer to this
20:33 shixilun I have inherited an app
20:33 shixilun I run it like this: $ hypnotoad  app
20:33 shixilun I don't want it on port 8080
20:33 shixilun Where is the config file to change this?
20:35 cfedde I'm having trouble with Mojolicious::Lite and Plugin::BasicAuth in a CGI environment. I must be doing it wrong but I can't see what's broken: https://gist.github.com/cfedde/8923656
20:35 doby usually at the base dir of the app, something like app.conf
20:35 genio shixilun: http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#Hypnotoad
20:35 doby {
20:35 doby hypnotoad => {
20:35 doby listen => ['http://*:3000'],
20:35 doby proxy => 1,
20:35 doby workers => 10,
20:35 doby },
20:35 doby thats listening on 3000
20:36 cfedde $self->basic_auth is being called with no arguments.
20:36 cfedde or rather the call back is
20:37 lukep joined #mojo
20:38 shixilun genio, I did read http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#Hypnotoad
20:39 shixilun So I guess I have to hack bin/hypnotoad
20:39 cooper joined #mojo
20:39 shixilun Or Mojo/Server/Hypnotoad.pm
20:39 shixilun So I can get app->config(hypnotoad => {listen => ['http://*:80']}); inserted
20:40 cfedde shixilun: it might be better to setup a config file if there is not one already.
20:40 shixilun So, where is the documentation on config files?
20:41 cfedde The doc is a bit obtuse on this point.
20:41 cfedde Let me see if I can find it again
20:41 shixilun Yes, that is why I have been driven to IRC
20:44 cfedde one way is to say 'plugin Config => {default => {...}};' somewhere in your app
20:44 cfedde https://metacpan.org/pod/Mojolicious::Plugin::Config
20:44 shixilun So I have to hack the app
20:45 cfedde if the author did not set it up with config already then yes.
20:45 cfedde you want to hack the module itself instead of your app?
20:45 shixilun No, I want to use a config file
20:46 cfedde then talk to the author of the app and tell them you want a config file.
20:46 shixilun Somehow Mojolicious finds some defaults for hypnotoad...yet I can't see how that is done
20:47 shixilun To wit:
20:47 shixilun $VAR1 = {
20:47 shixilun 'inactivity_timeout' => 90,
20:47 shixilun 'workers' => 10,
20:47 shixilun 'heartbeat_timeout' => 120,
20:48 sri please don't ever paste into an irc channel
20:48 marty shixilun:  No pasting into the channel please.
20:49 marty wow, what timing.  :)
20:49 sri scary
20:49 shixilun Oh, OK...sorry...new to IRC...won't happen again
20:49 marty no worries, shixilun.
20:49 shixilun Thank you for being kind in warning
20:50 nicomen shixilun: did you try setting a config?
20:51 shixilun If I could figure out how...
20:51 nicomen you are starting the app right?
20:51 shixilun Yes: $ hypnotoad app
20:51 * sri keeps targeting shixilun with a laserpointer while playing with the kick button
20:52 bedivere do you think it would be a good idea to add a special exception message if a template file is missing? i mean the route not found error that comes at the moment is a bit irritating i think
20:52 genio shixilun: Are you familiar at all with Perl/Mojo?
20:52 shixilun Perl, yes
20:52 shixilun Mojo, no
20:52 shixilun Reading the docs is not helping
20:52 shixilun I feel sri wants me gone, so I guess I'll go
20:53 shixilun left #mojo
20:53 genio well, that makes it hard to get help
20:53 sri oops
20:53 sri really not my day :(
20:54 cfedde he was alreay pretty frustrated.
20:54 cfedde already too
20:55 genio I was in the middle of typing stuff to try to benefit him, but he left before I could help.  his loss I guess
20:56 tianon sri sets me on fire regularly, and I'm still here :)
20:56 cfedde emotional amplification via electronic communication is a real thing.
20:56 Adura sri ignored me because humour.
20:56 genio thick skin is required to IRC, but we all get too frustrated from time to time
21:01 * marty is considering switching to textmate2.  it looks so pretty.
21:10 nicomen actually, how _do_ you set the listen port if you only have a file with a start_app() call to a module in your lib
21:10 nicomen with morbo just setting MOJO_LISTEN is fine, but with hypnotoad?
21:15 mire_ joined #mojo
21:23 odc nicomen, app->config(hypnotoad => {
21:23 odc listen => ['http://*:3001'],
21:23 odc });
21:24 Stefan joined #mojo
21:33 mattp joined #mojo
21:35 good_news_everyone joined #mojo
21:35 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/PixufQ
21:35 good_news_everyone mojo/master ed9cb42 Sebastian Riedel: added recipe for configuration files
21:35 good_news_everyone left #mojo
21:35 cfedde should I expect Plugin::BasicAuth to work in mojo code that is runnign under CGI?
21:45 good_news_everyone joined #mojo
21:45 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/qt0Rcw
21:45 good_news_everyone mojo/master 8cec8d3 Sebastian Riedel: more details about how configuration filenames are generated
21:45 good_news_everyone left #mojo
21:46 irctc405 joined #mojo
21:49 irctc405 hi i had to make a small patch to Mojolicious::Plugin::TagHelpers::_stylesheet to output type="text/css" instead of just rel=stylesheet.  Some older browsers still need this.   It could be an option, but whatever.
21:50 good_news_everyone joined #mojo
21:50 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/pfMCIQ
21:50 good_news_everyone mojo/master 0f6ee26 Sebastian Riedel: more details for configuration file recipe
21:50 good_news_everyone left #mojo
22:17 bpmedley cfedde: realm => sub { return 1 if "@_" eq 'username password' }  <-- Do you need to use an anonymous sub?
22:17 bpmedley cfedde: Irr.. actaully you are.. my bad
22:18 bedivere left #mojo
22:18 cfedde bpmedley: I don't need to.  I took this from the example in the doc for Mojolicious::Plugin::BasicAuth
22:20 bpmedley cfedde: You example works for me.  What version of Mojo and of the plugin are you on?
22:21 cfedde bpmedley: under CGI?
22:22 marty joined #mojo
22:22 bpmedley No, sorry, I didn't test under CGI.
22:22 cfedde bpmedley: it works fine for me outside CGI.
22:22 cfedde I'd like to avoid CGI but i'm kinda stuck for this deployment.
22:23 nicomen odc: there's no "app" available
22:23 bpmedley I'm trying to think how I can test CGI.
22:23 cfedde it'll be running under thttpd.
22:24 cfedde bpmedley: right now I'm testing under apache on redhat with the cgi handlers enabled.
22:24 bpmedley I have nginx on my boxen at present.. I might be able to run apache under a different port or somesuch.
22:25 cfedde let me test with thttpd.
22:26 odc nicomen, not even a $self->app?
22:28 cfedde bpmedley: an easy way to get the same behavior is to use thttpd and a command line like: thttpd -p 8100 -c check_auth
22:28 cfedde where check_auth is the name of the script.
22:45 nicomen odc: just a static call to Mojolicious::Commands->start_app()
22:46 sri rendering guide the right place for this? http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Adding_a_configuration_file
22:49 bpmedley cfedde: the logging isn't working
22:49 bpmedley It won't capture the STDERR
22:50 odc nicomen, then your answer is right there in the docs
22:50 odc you just want to change the port right?
22:51 nicomen yes
22:51 odc https://metacpan.org/pod/release/SRI/Mojolicious-4.78/lib/Mojolicious/Commands.pm#start_app
22:51 nicomen my app is not picking up myapp.conf
22:51 nicomen (even though it's called MyApp)
22:52 nicomen odc: those params only work whebn run with morbo
22:52 odc huh
22:53 odc then again, i don't think you're supposed to use this module
22:53 odc this module is to create a launcher for your app
22:54 odc and you must set the listening port/config file INSIDE the app
22:58 bpmedley cfedde: I dumped the headers and don't see the Authorization header.
23:10 shixilun joined #mojo
23:11 shixilun Colleague found configuration file in non-standard location.
23:11 shixilun Thanks for all help and patience.
23:12 damaya joined #mojo
23:12 shixilun left #mojo
23:12 bpmedley sri: I would not expect to see a config file for the app in the Rendering guide.
23:13 sri bpmedley: where should it go?
23:14 bpmedley Thinking.. maybe the Cookbook?  There's already some talk about a config file under the hypnotoad section.
23:14 sri it's not a deployment topic though
23:15 sri it would only fit into the hack section
23:15 sri *HACKS
23:15 bpmedley http://mojolicio.us/perldoc/Mojolicious/Plugin/Config  <-- Maybe here?  :)
23:15 sri against the rules
23:15 bpmedley Why?
23:15 sri documentation goes into guides
23:16 sri module pod is reference only
23:16 sri so stuff is not to spread out
23:16 sri *too
23:17 damaya a suggestion: One of the things holding the company I work for back from letting me use Hypnotoad is that they do not like that the logs are not in the same format as Apache, therefore cannot be put into awstats. The ability to easily change the logging format to be awstats compliant would be nice.
23:18 damaya I think that could possibly fit within the HACKS section for Hypnotoad? Not entirely sure, but it was something that I have personally come up against.
23:18 bpmedley Hrmm.. maybe the ::Lite tutorial?  Between Mode and Testing?
23:19 sri tutorial is getting a bit big
23:20 dwierenga joined #mojo
23:20 bpmedley A new guide is brewing with a newish name and some contents.. just not sure what yet.. :)
23:20 damaya Another suggestion: I think it would be a good idea to link to the FAQ somewhere in Mojo::UserAgent POD. I didn't fnid the FAQ until just recently, but the explanation of blocking vs. non-blocking was quite enlightening.
23:20 damaya Maybe something like, "For more information on blocking and non-blocking operations, see the FAQ question..."
23:20 sri faq is linked right from the documentation index
23:21 damaya And finally, my final suggestion: If there is a Mojo conf, it should be held in Portland, Oregon, United States, that way I can surely attend.
23:22 firnsy damaya: lol ... mojoconf in oz would be awesome too
23:23 damaya Hm, I only suggest that with regards to the FAQ because blocking vs. non-blocking seems to me to be such a huge part of Mojolicious, and maybe a new concept to more people than just myself. Since it's a big part of UA, it would be nice for the link to be right there where it is discussing it.
23:23 damaya Not a big deal if it's not, just a suggestion.
23:23 * firnsy will provide the blackjack and hookers
23:23 damaya Alright, I change my mind, Oz sounds nice :D
23:23 bpmedley damaya: Have you read the UserAgent cookbook?
23:24 damaya sri, there is a lot to cover when learning Mojolicious, so I personally wouldn't worry if a guide like "TUTORIAL" gets big. In fact, that's probably a good thing!
23:25 damaya bpmedley, yeah, I've read just about all of it at this point. I am just speaking from past experience (i.e., me 3 months ago trying to figure all this stuff out).
23:25 sri hmm, i guess content negotiation could be removed from the tutorial... it's not essential and covered in greater detail later on
23:25 damaya The cookbooks at this point are my go-to pages really.
23:26 sri and instead add config, which also introduces how plugins are loaded
23:26 bpmedley sri: Maybe a Application guide with the HACKS section and the config file as initial content?
23:27 czinczar joined #mojo
23:27 bpmedley damaya: Would a book have been better 3 months ago with a section on non-blocking in it?
23:27 czinczar http://harmful.cat-v.org/software/node.js is mojo "callback" based? is this a bad thing?
23:27 s1037989_ Content negotiation in the ::Lite tut is paramount, I think.
23:30 damaya bpmedley, yes. Wait, are you writing the book?
23:31 bpmedley That's an oft discussed topic.  There are two known books started in teh wild.  One by myself and another by jberger.  I've been working on my FileBeagle/Sparky project rather than the book, tho.  I'll probably switch gears to the book in ?week? or so.
23:32 marty joined #mojo
23:33 thowe I can offer my eagerness to learn combined with my ignorance and pedantic nature if you want someone to actually try to learn from your book to shake out any bugs =]
23:33 damaya bpmedley, I am first and foremost a technical writer. The only thing stopping me from writing a book on the subject is knowledge. However, having learned this from the ground up, I think I have a pretty good perspective, and I would love to contribute in any way possible.
23:33 bpmedley My book is on github and so is jberger's.
23:34 bpmedley https://github.com/brianmed/book_of_mojo <-- Just don't laugh in what I wrote it in.. :)
23:34 sri argh... so does the config recipe really belong in the tutorial?
23:34 bpmedley Or laugh, it's fine.
23:34 sri give me something to remove! :S
23:35 bpmedley sri: I guess you dislike the Application guide idea?
23:35 cfedde There is a pretty big difference between development reference guides and operator guides. Where ever the details on configuration are a link to that location could decorate all the various places that an operator might stumble upon.
23:35 thowe what's an iba?
23:35 jberger joined #mojo
23:35 sri bpmedley: moot point until there's more content for it
23:36 bpmedley What about the HACKS section and the config file?
23:36 damaya Hm, never heard of iba extension.
23:36 bpmedley It's an iBook Author file.. ;)
23:36 bpmedley It's like making a book with playdo.. it's fun.
23:36 jberger Yay I'm getting passes on Windows!  http://www.cpantesters.org/distro/M/Mojo-IOLoop-ForkCall.html?oncpan=1&amp;distmat=1&amp;version=0.06
23:36 damaya Ah, ok. I don't have access to a Mac, but I imagine there is something on here that I can install to look at it.
23:36 damaya that sounds most awesome.
23:37 bpmedley I can get you a pdf real quick.
23:37 thowe OK
23:37 damaya Thanks bpmedley! I would very much appreciate that :D
23:37 thowe I don't have an iBook.
23:40 bpmedley http://bmedley.org/book_of_mojo.pdf
23:41 mudler joined #mojo
23:41 sri bpmedley: perhaps rename HACKS to APPLICATIONS
23:41 bpmedley That would be cool.  Then config would have a home.. :)
23:41 thowe got it
23:41 sri all hacks are basically application based
23:42 czinczar im pedantik as hell
23:42 jberger Also, a pdf of my book is in the irc log somewhere
23:42 sri needs a tagline though
23:42 bpmedley jberger: Does your pdf have your new mods?
23:42 jberger Mods?
23:42 purl Mods are nice for a mage
23:43 bpmedley I thought you modified your book recently.
23:43 jberger Yeah I've been trying to keep it current
23:43 jberger I know not everyone wants to install a LaTeX compiler but I do want feedback
23:44 nicomen a book launch would be awesome at a mojo conf ;)
23:44 bpmedley When is that?
23:44 thowe I tend to have TexLive installed.
23:45 good_news_everyone joined #mojo
23:45 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/XV3knA
23:45 good_news_everyone mojo/master f6b2ed2 Sebastian Riedel: renamed HACKS section to APPLICATIONS
23:45 good_news_everyone left #mojo
23:45 jberger No chance of my book being ready by then
23:45 mudler joined #mojo
23:46 czinczar mojo ! book of! woa
23:46 czinczar chicken and egg
23:46 purl So the chicken's looking really pissy, and the egg's sitting up in bed next to her smoking a cigarette. The chicken snarls, "Well, I guess that solves THAT question."
23:46 bpmedley :)
23:46 damaya jberger, for someone from my perspective I think the first two chapters should be really basic, nothing really about Mojolicious at all. That may sound strange, but I think introducing the basic concepts first is really important. What is a web framework? What does it do for you? What does "RESTful routes" mean? What do we mean when we say non-blocking vs. blocking. Basically, the first two chapters or so should be the chapters that a lot of people
23:46 damaya skip, but people like myself read because they are new to the whole thing.
23:46 mudler joined #mojo
23:46 czinczar as an econ major, I can reccomend saying in beginning what makes mojo as a product DIFFERENT
23:46 jberger Patches welcome
23:46 purl i think Patches welcome is always true or even for metacpan.org or swahili for "Put up or shut up."
23:47 jberger Hehe
23:47 damaya I could write these two chapters if you're interested. I've done a ton of research into all this stuff (my bookmarks is huge).
23:47 nicomen lol @ purl
23:47 bpmedley When I read a book on a new subject I want to be coding as fast as possible.  I like it when they introduce a topic and code at the same time.
23:47 damaya ok, well I'd be writing it in either LaTeX, or just a text file.
23:47 jberger My focus is going to be on non blocking I think
23:47 damaya I can do either.
23:48 bpmedley damaya: I'd include it.. :)
23:48 jberger But certainly the basics will need to be covered
23:48 damaya bpmedley, you are the person who skips the first two chapters :D
23:48 damaya You dive right in.
23:48 jberger Also I'm not the best at the greater mysteries of the router
23:48 damaya My problem is the technical understanding of Mojolicious. Sometimes I write some code and go, "Wow, that worked!"
23:48 czinczar http://www.ultratechnology.com/method.htm what about thinking?
23:48 damaya haha, then I scratch my head and try to figure out how and why.
23:49 bpmedley damaya: I see
23:49 cfedde usualy I spend most of my time scrathing my head trying to figure out why things are not working.
23:49 cfedde scratching too.
23:49 thowe jberger, what command should I use to compile your tex doc?
23:49 jberger Then again, I really do want a consistent narrative
23:49 damaya Most of my Mojolicious has been basically copying what does work. For example, I'm writing a plugin, but my plugin is almost verbatim the already existing plugin Humane.
23:50 bpmedley cfedde: Did you see my msg about authentication?
23:50 jberger Thowe: latexmk -pdf main.tex
23:50 cfedde bpmedley: I need to scroll back and look.  You said something about missing an authentication header?
23:50 damaya Yeah, anything I throw at the book can be edited and completely changed. My input is only suggestions if that makes sense.
23:50 czinczar dont re invent the wheel!
23:50 bpmedley Yes, the Lite app doesn't seem to get the Authentication header.
23:51 thowe Hm..  latexmk doesn't seem to come with texlive
23:51 cfedde bpmedley: that's kind of odd.  the browser gets the 401 and presents the basic auth stuff.
23:52 jberger pdfflatex should work
23:52 bpmedley cfedde: It is odd.  However, I do hope you can prove me wrong.. :)
23:52 jberger s/f//
23:52 * cfedde goes back to the CGI 1.1 spec
23:52 thowe jberger, I got it...  Looking through it now.
23:53 bpmedley What I'm saying is that maybe that server is manipulating the auth headers.
23:53 cfedde bpmedley: yeah.
23:53 jberger My thesis needed so many compiler passes that I only ever use latexmk anymore
23:53 damaya Alright, I got the first line written. Time for a break :P
23:53 cfedde I've not done much CGI in quite a while.
23:53 jberger Plus it does continuous rebuild
23:53 czinczar try with hypnotoad
23:54 sri nicomen: ->contents is no direct replacement for text_before, you have to do the searching yourself, what is your use case for text_before?
23:54 bpmedley cfedde: If the server is applying authentication to the request, then it MUST NOT execute the script unless the request passes all defined access controls.
23:55 bpmedley cfedde: Not 100% applicable; however, not promising, either.
23:55 d4rkie joined #mojo
23:55 thowe jberger, interested in punctuation nazi patches? :|
23:56 d4rkie joined #mojo
23:56 jberger Haha
23:56 czinczar dont give in to hate
23:56 jberger What is the problem, commas?
23:56 sri is anyone here using Mojo::DOM::text_before/text_after? what for?
23:56 thowe jberger, off the bat, yeah...
23:56 jberger czinczar is a bot?
23:57 jberger thowe that's a known problem in early drafts for me
23:57 jberger Probably not worth it yet
23:58 jberger It's about content flow and pedagogy so far
23:59 thowe OK.  Is there going to be a chapter that explains a bit about how web apps work?  The first page would have a beginner confused for lack of context, I think.
23:59 czinczar no I am a IT consultant, which is debbatable the same, way mangemnt looks at me
23:59 jberger Haha

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