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

IRC log for #mojo, 2016-05-04

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

All times shown according to UTC.

Time Nick Message
00:00 Gedge joined #mojo
00:05 Gedge_ joined #mojo
00:06 meshl joined #mojo
00:11 Gedge joined #mojo
00:59 genio gym done, food done.  maybe I will be able to think now
01:03 jnbek joined #mojo
01:18 asarch joined #mojo
02:05 mcsnolte joined #mojo
02:19 noganex_ joined #mojo
02:51 mmp joined #mojo
02:55 sri a little reminder that we still need a good libuv binding http://magic.io/blog/uvloop-blazing-fast-python-networking/
03:06 mmp sri: those benchmarks sound fishy
03:14 mtths joined #mojo
04:32 inokenty-w joined #mojo
05:32 dod joined #mojo
05:37 dod joined #mojo
06:00 skinch joined #mojo
06:00 anparker joined #mojo
06:00 firnsy joined #mojo
06:00 magnux joined #mojo
06:00 mtj joined #mojo
06:04 dod joined #mojo
06:07 charsbar joined #mojo
06:24 salva joined #mojo
06:25 ivi joined #mojo
06:49 reneeb joined #mojo
07:06 dod joined #mojo
07:18 reneeb2 joined #mojo
07:23 punter joined #mojo
07:24 AndrewIsh joined #mojo
07:30 trone joined #mojo
07:41 abra joined #mojo
07:51 Vandal joined #mojo
08:01 punter joined #mojo
08:18 dod joined #mojo
08:30 icjs joined #mojo
08:34 osfabibisi joined #mojo
08:43 salva joined #mojo
09:16 henq joined #mojo
09:54 dod joined #mojo
10:00 henq joined #mojo
10:01 andy joined #mojo
10:24 meshl joined #mojo
10:26 kaare_ joined #mojo
10:42 Kripton joined #mojo
10:54 dvinciguerra joined #mojo
10:58 tchaves joined #mojo
11:05 henq joined #mojo
11:11 tchaves joined #mojo
12:04 punter When a route handler orders a page to be rendered based on a template that's missing from the filesystem, you don't get an error message like "template missing". You get "none of the route handlers could form a response". Is that more correct than "template is missing"?
12:04 punter The current error message is a bit confusing.
12:04 punter I find.
12:07 punter joined #mojo
12:26 punter Suppose two route handlers have the same template. But one uses more template variables than the other. Is it necessary to list all template variables inside both $self->render(...) statements?
12:26 punter I'd like to be able to list only half template variables inside the render(...), but my template crashes with an error if the template contains variables that aren't declared in render(...)
12:27 punter any way out of this?
12:28 punter for instance, the login form is rendered by both GET /login (the empty form), and by POST /login (when there's an error and the login screen has to be redrawn for a new attempt)
12:28 punter In GET /login, there's no reason to declare username & password & error_message (they're all empty)
12:28 punter but in POST /login, these vars are needed.
12:29 dantti_laptop joined #mojo
12:32 punter in template toolkit, any undefined variable is replaced by undef or '' or ()
12:33 punter or [] or {}
12:37 anparker you can use $self->stash('var_name') in your template for variables that may be missing
12:57 sri jberger: i have a feeling this will not get any votes https://github.com/kraih/minion/pull/33
12:57 sri minion is in a weird spot, too many users to make a lot of changes, too few users to vote on decisions
12:57 sri and i'm starting to hate working on it :/
12:58 ramortegui joined #mojo
13:00 jberger :s
13:00 jberger well, how can we improve that?
13:02 jberger I like the idea of a minion-roast
13:02 jberger which would help validate backends
13:04 jberger perhaps a minion mailing list to help get and request feedback from minion users
13:13 gizmomathboy joined #mojo
13:23 punter thanks, anparker
13:42 mcsnolte joined #mojo
13:44 CW Here's a weird question but can you call a method, in a controller without routing to it from the router. For example instead of
13:45 CW get 'someaddress' => sub { code here };
13:45 CW tell get 'someaddress' => <function in controller>
13:48 nicomen the question doesn't seem to match the lines you provided. Could you put up a gist or something?
13:50 CW I want the {some Code} to be run as a method in the controller. but If I route to it, it throughs a 404, or Err_empty_response. but if i put the code in the some code place, in theory it should work but I don't want to have that code in my routing file.
13:52 CW Sorry, some code place = code here place
13:53 mfontani get 'someaddress' => \&sub_name; # ?
13:54 * mfontani misread
13:57 CW So I would do: get '/homescreen/order_detail' => order_detail(); And it should know to look in the Homescreen controller?
13:58 Lee $r->route('/foo')->to( controller => "Controller",action => "sub_name");
14:00 CW Lee: is that not the same as $r->any('/homescreen/order_detail')->to('/homescreen/order_detail');
14:01 jabberwok CW: If you write: >> get '/homescreen/order_detail' => order_detail();  << remember this is still really Just Perl, so that statement executes, calls order_detail(), and the return value from that is passed to 'get'.
14:02 Lee CW: $r->route('/foo')->via( [qw/GET/] )->to( controller => "Controller",action => "sub_name");
14:02 jabberwok that would only make sense if your order_detail returns a code reference (which it could).
14:02 CW Order_detail returns nothing.
14:04 jabberwok right. then see Lee's comments
14:04 CW K, Thanks. Will give it a shot. :->
14:08 jberger CW: please don't take offense to this, but it is at this point in a new user's experience with mojolicious that I encourage them to go back and reread the Guides, in detail
14:09 jberger it really will help you
14:09 CW No offence but the guides suck
14:09 jberger CW: please consider the audience that you are speaking to
14:09 jberger we meticulously wrote those guides
14:10 jberger they do cover everything, 90% of the time when people don't get what they need out of them, it is because they skimmed rather than read
14:11 jberger we always will consider doc patches of course
14:11 jberger but we consider them to be models for documentation
14:11 jberger and if you don't like that, well, keep it to yourself
14:11 CW They are better then nothing, and they do help, most of the time. But they have holes.
14:13 jberger please speak in specifics, we are always happy to improve
14:14 jberger but honestly, people say this sometimes and realize later that the material they thought wasn't covered is actually there and they had skimmed over it
14:14 genio That ^^.  Most people I talk to here at work love how well the docs cover the material
14:15 andy joined #mojo
14:15 CandyAngel Skimming the documentation and missing the bit I need? I've never done that! At all! Never. Nu-uh.
14:16 CW Its probably just me. I dont see things the same way as most people and get frustrated because most documentation is designed from a view point that I don't always get. :-P
14:16 * CandyAngel is probably the poster-child of doing exactly that, really.
14:16 jberger CW I will say one thing, our docs are different from most in one key way, they are very dense
14:16 jberger they are meant to be read carefully
14:16 jberger this is different than most documentation that rambles and is meant to be skimmed
14:17 bpmedley CW: have you tried the book (in beta) i'm writing
14:20 CW Still getting 404 error. :-S
14:21 jberger CW: can you paste (to a paste site) a runnable example that demonstrates the problem you are having?
14:21 jberger trim it down to a minimal example
14:21 CW Sure. :-)
14:23 bwf Learn by example also:  https://github.com/kraih/mojo/wiki/Example-applications
14:24 CW Here is the route and the sub simplified.. https://gist.github.com/anonymous/0c2c79a1235a00297e7e192bec9c5656
14:25 perlpilot_ joined #mojo
14:25 CW I use ajax from Javascript to make the call
14:26 CW It calls it fine and runs the code. but then throws a 404 error or Err_empty_response depending on how I render
14:28 jberger CW: that example isn't runnable
14:28 jberger The problem might well be the layout of the files that you are using (and taking pieces of)
14:29 jberger It looks to me like you are attempting to render a template which isn't included
14:30 CW even if I render a template that does exist: $shift->render( 'homescreen' ); I still get the same error
14:32 CHYC CW: What's your Accept request header?
14:33 jberger CW: that is exactly the same paste that I said that of yesterday! http://irclog.perlgeek.de/mojo/2016-05-03#i_12430142
14:34 CW yah, and I do have a template.
14:35 Lee you have duplicate routes in that snippet, it's probably not doing what you think it *should* be doing
14:36 jberger I gave this suggestion yesterday http://irclog.perlgeek.de/mojo/2016-05-03#i_12430054 , your paste doesn't help me in considering whether my guesses are true
14:36 jberger and I think at this point I've taken all the $work time I can afford to attempt to help
14:36 jberger sorry about that
14:38 CW I would have agreed with you but if I change from a ajax request to a href request of the page. The href works. Technical so does the ajax with the exception that when it goes to render, the ajax throws a 404
14:38 jberger CW: that is very important information!
14:39 Lee well it's something screwy in your js or headers then
14:39 bpmedley Cw: could be contentType
14:39 jberger or in the template (base tag for example)
14:39 Lee CW: do you have tests for your code?
14:40 jabberwok CW: Having started with Mojolicious about a year ago, the biggest Aha! for me was: There is no magic. It's all Really Just Perl. Most of what looks like magic is syntactic sugar or less-used Perl idioms.
14:40 jberger this is where a MINIMAL example helps, the pure act of whittling the problem down to something that other people can help you with often will help you find the bug yourself
14:40 CW no, I haven't learn how to use test yet.
14:40 CW i just print to the terminal
14:40 CW or alerts
14:40 genio That's part of the growing guide.
14:40 Lee learn the mojo test stuff, it will save you a world of pain later
14:41 jabberwok Lee++ ... a small investment in learning Test::Mojo will give you at least one of those Aha! moments, I assure you
14:41 CW kk
14:44 jberger CW: I just want to loop back and give you one other piece of advice, if you had said "I can see that you have put in a lot of effort into the documentation, but it hasn't helped me in the way I need"
14:45 jberger it wouldn't have changed the tone of the conversation
14:45 jberger insulting it did
14:45 jberger and I was less inclined to help from that point, just on an emotional level
14:46 CW yah, sorry. Frustration projected at the wrong direction. Sorry.
14:46 jberger we try very hard here to keep the conversation positive, and we don't always succeed tbh, but we tyr
14:46 jberger try
14:46 jberger something different for IRC I know :-P
14:47 PryMar56 joined #mojo
14:47 CandyAngel Pesky electrons..
14:47 * jberger looks at his electron gun and cackles maniacally!
14:48 CW You guys do do an awesome job and it is much appreciated
14:48 CandyAngel I would put "jberger-" but I don't know if that will downvote. Hopefully it won't with it being in a sentence (and only one -)
14:49 CandyAngel Is your villian name "Negaberger"? I think it should be.
14:49 preaction it's probably khotdog
14:54 henq joined #mojo
14:54 jberger we don't have a karma bot anymore
14:54 * jberger thinks of purl and weeps
14:55 meredith i know i'd be decrementing preaction right now!
14:55 preaction why? i'm Hi-larry-us!
14:57 CandyAngel Aww, purl is gone? :(
15:00 jberger Has been for a while
15:00 jberger There are efforts underway to get and/or recreate her database
15:19 CandyAngel Ah, I haven't been paying that much attention >.<
15:24 henq joined #mojo
15:28 dotan joined #mojo
15:33 orev joined #mojo
15:35 Kripton joined #mojo
15:56 reneeb joined #mojo
16:10 sri CW: offense taken
16:15 sri the fact that you said "no offence" before saying my work sucks only makes it more offensive
16:15 sri you will never receive help from me again
16:20 sri you know, i could really use some upbeat news
16:22 ribasushi sri: well, there's always Donald Trump winning yuuuuuge \o/
16:23 sri oh yea, some schadenfreude
16:23 sri that works too i guess
16:23 ribasushi glad to help ;)
16:23 genio sri: CW saw the error of his ways and altered his viewpoint and apologized. No need to let it bother you
16:24 bpmedley sri: What do you think of the current state of my book in beta?
16:25 sri bpmedley: i'll review it when it's more complete, for now i think you'll get better feedback from those that actually need it
16:27 bpmedley Fair enough, it's in a fuzzy state where i need a few newbies to give feedback so i know what needs changing..
16:31 bpmedley Not sure how good the news is; however, http://foundit.ninja is a new app and works well with programmatic and manually entered gps coords.. :)
16:36 sri i'm good actually, that dose of schadenfreude helped
16:36 sri you americans are screwed
16:37 Adurah If he stops the TPP, I'd vote for him. Of course I live a bit farther North than voting allows.
16:38 sri and i think CW is american too, so... see that's what you get from being mean!
16:41 punter joined #mojo
17:01 sri jberger: re minion, i think the only option for now is dictating what to do :/
17:01 sri jberger: lets do the retry optimization if the implementation is reasonable
17:13 genio well, now you're just being mean.
17:17 CW I changed the way, I did things, and returned json instead... Now it all works... Thanks for your help, it gave me ideas... :-P
17:26 dod joined #mojo
17:35 disputin joined #mojo
18:21 disputin joined #mojo
18:23 macsnowball joined #mojo
18:25 disputin joined #mojo
19:11 disputin joined #mojo
19:47 disputin joined #mojo
20:28 punter left #mojo
20:48 meshl joined #mojo
20:54 itaipu joined #mojo
21:09 meshl joined #mojo
21:13 * jabberwok ponders how best to use Mojo::Pg  migrations with schemata
21:16 jberger jabberwok: schemata? as in multiple schema?
21:21 jabberwok right
21:22 jabberwok for a multi-tenant project.
21:24 jberger is it the exact same schema deployed multiple times?
21:26 jberger basically I'd probably use multiple pg and/or migrations objects targeted at different databases: http://mojolicious.org/perldoc/Mojo/Pg/Migrations
21:28 sri the tests have their own schemas https://github.com/kraih/mojo-pg/blob/master/t/migrations.t#L13
21:28 sri so you can run all tests parallel on the same database without anything clashing
21:29 jberger oh right, I forgot about search_path
21:30 jberger http://mojolicious.org/perldoc/Mojo/Pg#search_path
21:43 meshl joined #mojo
21:56 sri jberger: this seems to work reasonably well https://gist.github.com/anonymous/bb4ff73ad8752622e604221357fa8b19
21:57 jberger you prefer having two triggers rather than one trigger that triggers for two events?
21:57 jberger I guess it is an easier migration
21:58 jberger I don't care about that at all, just asking
21:58 sri that said, i don't think it will make it into minion anytime soon
21:59 sri there's more unknowns i've stumbled over, like automatic retries for failed jobs
21:59 jberger sure, as I said before it is just an optimization, I have much bigger fish to fry
21:59 sri not sure if we really want to poke all workers for that
21:59 jberger ah, right
22:00 sri on the other hand, we do poke all workers for jobs enqueued with a delay
22:01 jberger I wonder if it would be worth exploring $job->notify
22:04 sri hmm, this is actually annoying, i want to replace the whole trigger function
22:10 jberger what would you replace it with?
22:10 sri something more efficient
22:14 sri https://gist.github.com/anonymous/20f913b2cb6775b2e6454a4dcb2f25ad
22:14 sri so workers don't wake up for delayed jobs
22:20 disputin joined #mojo
22:22 thowe_work joined #mojo
22:25 sri yea, think i'm doing this https://github.com/kraih/minion/commit/04e32f08045ab7f31a2bd2d432ebef478e2694dc
22:28 cpan_mojo Paws-0.25 by JLMARTIN https://metacpan.org/release/JLMARTIN/Paws-0.25
22:44 jabberwok perfect sri, that's just what i had been wondering about
23:02 jberger sri++
23:31 dvinciguerra joined #mojo
23:45 sri this one prolly will not help you, but is nice for me ;p https://github.com/kraih/minion/commit/4018ff73734764f695afed3925eb83dc3afccef2
23:48 preaction joined #mojo
23:51 sri pausing all workers of even a specific queue is too hard to do, so i'll prolly not do it without a sponsor
23:52 sri just pausing the workers individually should be fine for smaller setups
23:59 disputin joined #mojo

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