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

IRC log for #mojo, 2016-04-27

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

All times shown according to UTC.

Time Nick Message
00:04 nicomen $ perl -wle 'package MyApp::Models::Lol; use Moo; sub hi { print "hello" }; package MyModelFactory; use Moo; sub get { my ($self, $type) = @_; return "MyApp::Models::$type"->new(); }; package main; my $models = MyModelFactory->new; $models->get("Lol")->hi();'
00:04 nicomen hello
00:05 bpmedley nicomen: That would be easier on the eyes in a pastie.
00:05 nicomen some require/Module::Load love ommitted
00:07 nicomen bpmedley: you are right, I'm being too lazy/tired
00:07 henq nicomen, thx will study tomorrow (newbie me) goodnight
00:08 henq bpmedley: thx too
00:50 inbioz joined #mojo
00:55 tchaves joined #mojo
01:16 bpmedley joined #mojo
01:38 Kripton joined #mojo
01:39 jberger sri: yet another sql query possibility:
01:39 jberger select distinct queue, state, count(*) over (partition by state) from minion_jobs;
01:39 jberger I wish the distinct wasn't thee
01:39 jberger there
01:40 jberger and it doesn't give all the zero values
01:40 jberger but I hadn't seen window functions before
02:14 asarch joined #mojo
02:25 cpan_mojo Mojo-Webqq-1.7.9 by SJDY https://metacpan.org/release/SJDY/Mojo-Webqq-1.7.9
02:26 noganex joined #mojo
02:35 inbioz joined #mojo
02:48 dvinciguerra joined #mojo
02:53 asarch joined #mojo
02:57 mcsnolte joined #mojo
03:14 cpan_mojo Mojo-Weixin-1.1.2 by SJDY https://metacpan.org/release/SJDY/Mojo-Weixin-1.1.2
04:37 inokenty-w joined #mojo
05:27 inbioz joined #mojo
05:28 inbioz joined #mojo
06:10 dod joined #mojo
06:15 dod joined #mojo
06:47 inbioz joined #mojo
07:02 bc547 joined #mojo
07:02 mishanti1 jberger: Window functions are amazing. The problem with them is that they are so cool that suddenly everything seems like a problem they can solve.
07:02 mishanti1 And therein lies madness.
07:03 sebbe joined #mojo
07:25 AndrewIsh joined #mojo
07:29 trone joined #mojo
07:33 osfabibisi joined #mojo
07:54 cpan_mojo MojoX-Renderer-Xslate-0.12 by HJANSEN https://metacpan.org/release/HJANSEN/MojoX-Renderer-Xslate-0.12
08:05 osfabibisi joined #mojo
08:09 Vandal joined #mojo
08:13 HtbaaPi_ joined #mojo
08:16 sri hmm, my laptop decided to make a stop in south korea :S
08:21 henq joined #mojo
08:35 dod joined #mojo
08:38 batman is this expected behaviour from a recurring timer? https://gist.github.com/jhthorsen/c21b6ef8da852a7de58e959981a11417
08:38 batman sorry!
08:38 batman nevermind :(
08:39 batman s/nevermind/wait a sec/ wrong paste :)
08:40 trwww joined #mojo
09:16 odc joined #mojo
09:38 batman bad timing. i need to run in meetings :(
09:54 ribasushi hmmmm doesn't .gitattributes need a .pod entry for completeness?
09:55 ribasushi afaik p6 reused that extension as well (I may be very wrong)
09:55 ribasushi also is it 'Perl' or 'Perl5' (futureproofing)?
10:01 * ribasushi will research this later today, please highlight if someone beats me to it / knows the answers already
10:04 osfabibisi joined #mojo
10:06 nicomen wonder if gitpan is adding this stuff
10:12 kaare joined #mojo
10:31 henq joined #mojo
10:33 cpan_mojo Mojolicious-Plugin-HTMLTemplateProRenderer-0.05 by EBRUNI https://metacpan.org/release/EBRUNI/Mojolicious-Plugin-HTMLTemplateProRenderer-0.05
10:44 Adurah joined #mojo
11:07 tchaves joined #mojo
11:18 Jonis -w 4
11:22 tchaves joined #mojo
11:26 dvinciguerra joined #mojo
11:29 asarch joined #mojo
11:44 kaare joined #mojo
12:07 dod joined #mojo
12:17 inbioz joined #mojo
12:20 dod joined #mojo
12:33 gizmomathboy joined #mojo
12:46 lluad joined #mojo
12:53 ramortegui joined #mojo
13:45 mcsnolte joined #mojo
13:48 jberger ummmmm
13:48 jberger http://www.opera.com/blogs/desktop/2016/04/free-vpn-integrated-opera-for-windows-mac/
13:49 jberger weren't we just wondering why a chinese company would buy opera?
13:49 jberger https://www.techinasia.com/chinese-tech-companies-bought-opera
13:49 jberger would you pipe your data through someone else's vpn?
13:56 eitz joined #mojo
14:04 icjs joined #mojo
14:06 sri jberger: it's not even a vpn
14:06 sri just a proxy server
14:06 icjs hello, i have a node.js client making calls to a mojolicious webservice. i'm seeing intermittent tcp connection resets reported by the client code (mocha tests) when my webservice is run under hypnotoad, however when run in the foreground with morbo it seems much more stable - what could the problem be?
14:06 sri icjs: version?
14:07 jberger icjs: how long does the response take to generate?
14:07 sri jberger: i think it's the bug
14:07 jberger ah
14:10 icjs sri, 6.58
14:10 sri icjs: there is your problem
14:11 icjs jberger, how long, not sure but i'd say 1s ?
14:11 jberger icjs: no sri is right: https://github.com/kraih/mojo/blob/master/Changes#L5
14:13 icjs ok, let me upgrade to 6.61 and try it again, thanks guys
14:13 jberger icjs: and 1s is no problem, the problem I was guessing comes in around 20s http://mojolicious.org/perldoc/Mojo/Server/Prefork#heartbeat_timeout
14:14 icjs or 6.60 rather, thats what cpanm is pulling down
14:14 icjs jberger, ah ok, no worries. it's a webservice so 20s would be very bad :)
14:14 jberger icjs: that's correct, 6.61 hasn't been released yet
14:15 jberger and re 20s, you'd be surprised :P
14:16 icjs frak, tests failed during install, let me check the log...
14:19 icjs got a lot of failing tests, starting in t/mojo/home.t
14:19 sri let me guess http://mojolicious.org/perldoc/Mojolicious/Guides/FAQ#Do-I-need-to-clean-my-environment-before-testing-Mojolicious
14:19 icjs Failed 16/87 test programs. 120/9784 subtests failed.
14:20 icjs thanks sri, let me check my env
14:22 cfedde joined #mojo
14:27 gizmomathboy jberger, on google fi it connects my phone to an open wifi through google's vpn. It all depends upon trust. Like you wrote
14:28 icjs sri, you were right :) also i just testing with my webservice under morbo and all my client tests pass - so far so good
14:28 icjs let me try with it running under hypnotoad... in the meantime can you give me a high-level one or two lines on what bug was fixed?
14:29 jberger icjs: https://github.com/kraih/mojo/commit/80a4f3fd98f673abe65b223e401f5e3d5de554e7
14:29 jberger order of operations
14:30 icjs jberger, a race-condition type thing?
14:32 jberger I'd have to reread the discussion around it
14:32 jberger I was otherwise occupied at QAH during that time
14:33 icjs jberger, no worries
14:34 icjs so, ran my webservice udner hypnotoad, and then ran my test suite 3 times ina  row and i am happy to report they pass
14:34 icjs awesome suace
14:35 icjs sri, jberger - thanks guys :D
14:35 sri buy more t-shirts!
14:35 icjs my colleague was talking earlier about a 3rd party software system we use and he's lucky to get a response from their support after 2 weeks, and here i get to talk to the authors over irc
14:35 icjs my colleague was talking earlier about a 3rd party software system we use and he's lucky to get a response from their support after 2 weeks, and here i get to talk to the authors over irc
14:35 icjs t-shirt? ok!
14:36 icjs well send it over to gemrnay to get it signed, might be worth somnething on ebay in a few years?
14:36 jberger icjs: glad to hear it works!
14:37 jberger and yeah, irc is really cool :D
14:39 romel joined #mojo
14:43 human39 joined #mojo
14:43 gizmomathboy joined #mojo
14:43 sri icjs: i tell people to buy more t-shirts as a hint that they can sponsor my work on mojolicious ;)
14:44 sri https://shop.spreadshirt.com/kraih/
14:48 sri guess it's time to close this https://github.com/kraih/mojo-pg/pull/18
14:50 CHYC sri: Can you wait 24 hours so I can submit a new implementation?
14:51 sri CHYC: you think it would make a big difference?
14:52 jberger sri: I think if CHYC is actively still working on it then we don't need to consider it stalled
14:52 CHYC If your reason for the -1 was it didn't clean the codebase, and pink_mist said words to similar effect, then I'm willing to give it another go.
14:52 sri ignoring the implementation, the feature itself has not gotten any votes either
14:52 jberger CHYC: we don't like to leave things open long though
14:52 CHYC jberger: That's a fair comment.
14:52 CHYC As in the leaving it open too long.
14:53 jberger oh, I did talk with metacpan about some mechanism to exclude issues from their issue count display
14:53 jberger didn't get very far on what it would be (some excluded tags like 'want list' or so) but they did seem receptive
14:54 jberger (and I have a commit bit now, bwahahahahahahaha)
14:54 CHYC If there is universal apathy for the feature then so be it, but at least want to give it the best chance because it would be something that would help me a lot.
14:56 jberger CHYC: I'm not -1 generally and I think pluggable expanders would be nice, but I'd have to see the clean/fast implementation before I'd consider an upvote
14:57 sri having worked on the code just a few hours ago, i don't have high hopes it could be much cleaner
14:57 sri just fixing the stuff i commented on doesn't really cut it
14:57 sri something would have to radically change, and i have no idea what
14:58 CHYC Well if all I did was spur on a cleanup of the existing code then that's something I guess, but please at least give me 24 hours to come back with something.
14:59 sri these decisions are rarely final
14:59 sri if you by chance end up with the most beautiful code i've ever seen, i would most definitely accept a patch at any time
15:00 sri we just won't rehash the discussion that already happened
15:00 sri which i guess is not a risk here
15:01 perlpilot CHYC: fwiw, I liked your feature  :)   (Not sure about the bang/buck ratio for including it though)
15:02 CHYC perlpilot: Thanks.
15:26 pierrick joined #mojo
15:31 inbioz joined #mojo
15:38 * jberger ponders something really <s>evil</s> perl4
15:38 jberger sub trailing_callback { (ref $_[-1] && ref $_[-1] eq 'CODE') ? pop : undef }
15:39 jberger then you call it like sub { my $cb = &trailing_callback; my ($self, @args) = @_; ... }
15:39 jberger how delightful
15:44 bpmedley Mojo 6.66 requires perl 4
15:50 inbioz joined #mojo
15:51 bc547 joined #mojo
16:05 inbioz joined #mojo
16:25 dod joined #mojo
16:35 asarch joined #mojo
16:42 meshl joined #mojo
16:48 cfedde life in hell
16:50 cfedde perl -MMath::BigInt=lib,GMP -E '$x = Math::BigInt->new(6); say $x**$x**$x'
16:51 icjs perl4? wat
16:51 jberger cfedde: is that for something real?
16:51 cfedde Mojo 66.6 requires perl 3
16:51 cfedde jberger: it's just a big number.
16:51 cfedde 6**6**6
16:51 jberger its a really really big number
16:51 jberger ah
16:53 cfedde the exponential of the beast
16:53 jabberwok i remember helping a client with their perl cgi scripts in 1999, on solaris.  i thought they said it was 5.004 but eventually discovered it was solaris 9 running perl 4. O.o
16:53 jberger cfedde++
16:58 Grinnz_ egads
17:10 Kripton joined #mojo
17:17 gizmomathboy candybar's company was still using perl4 iirc when he ran yapc::na::columbus..which was...2008?
17:40 sri oh, summoning cthulhu while i was gone for a moment?
17:40 preaction it was going to be a surprise for your birthday :(
17:40 sri :/
17:45 inbioz_ joined #mojo
17:47 gtodd joined #mojo
17:55 meshl joined #mojo
17:56 gtodd when you run "mojo daemon"  and go http://127.0.0.1:3000 there's no "default" CSS that is styling the "Your Mojo is working!" ...  but if I create a lite app I thought I could just @import CSS in my __DATA__ section. Can I do that?   I don't remember needing to install M::P::AssetPack or anything previously
17:58 sri http://mojolicious.org/perldoc/Mojolicious/Guides/Tutorial#Static-files
17:58 gtodd Mojolicious::Plugin::AssetPack is great but I don't always wt to use it I just want to import/apply some fonts and/or CSS from the interweb  under __DATA__  @@index.html.ep
17:58 gtodd ahh crap sorry ... just bad DNS  ...
17:59 gtodd one should always just keep clicking reload
17:59 gtodd sri: thanks
18:03 gtodd ++ Mojo keeps getting better but not very much bigger ..  <3 ♥ ++
18:04 sri it gets smaller actually
18:04 gtodd small++  ... I find using a single file with __DATA__ sections impress
18:04 gtodd "It's not just a SPA it's an SFA"  ...
18:07 gtodd of course lots of files are involved  behind the curtain to make that Single File Application so full of Mojo but ...
18:11 batman gtodd: did you know assetpack can also read from __DATA__ ?
18:12 batman i understand that's not what you want here, but just wanted to tell :-)
18:14 gtodd whoa :)
18:14 gtodd I can haz *
18:14 batman even sass, coffeescript or whatever...
18:21 tyldis Help. I need to make my Mojo::IOLoop::Client conform to my "sockopt(SO_SNDBUF, 1260)" call. Ideas?
18:21 tyldis Talking to a embedded device that is very fnicky.
18:22 tyldis My non-mojo code works fine with it, but I wanted to do it all in a more mojo-way :)
18:24 tyldis Tried manipulating the ->handle, but it doesn't stick
18:27 jabberwok At what point will the codebase be so perfect that it collapses into a singularity?
18:43 sri jabberwok: i'd hope it becomes sentient first
18:48 PryMar56 joined #mojo
19:35 sri oh wow, that's a nice humble bundle for once https://www.humblebundle.com/books/no-starch-hacking-books
19:36 sri if you're into tech books that is
19:56 mdom Uh, nice. Thanks, sri!
20:15 CW joined #mojo
20:21 CW Hello, I am new to Mojo and having some issues with getting routes to work. Maybe I am not understanding them correctly. I have a page with a button on it. When the button is pressed I am expecting a action to be preformed on the page. I have put the code for this action with in my controller file and have routed the action to the page like this $homescreen->route('order_detail')->to('homescreen#order_detail');
20:21 CW order_detail is the sub name with in the homescreens controller file. The button is in a <form action=order_detail> tag. but this seems to not work and is expecting there to be a order_detail.html.ep file. I want it to use homescreen.html.ep not create a new one. Any help would be welcome, thanks.
20:22 jberger CW: the route method is all but private now
20:23 jberger and a form action should be a url not a route name
20:23 jberger that said the fact that it is looking for order_detail.html.ep tells me that the request is indeed getting through
20:23 jberger so you aren't giving us the right info I think
20:23 jberger can you post some code (to a paste site)
20:24 jberger ?
20:27 CW Here is how I make the call: <form action="order_detail" method="get"><input type="hidden" name="salesorderno" value="' . $so . '"><input type="submit" class="startinstall ui-btn" id="StartTicket_'. $i . '" value="Order Details"></form>
20:28 CW I have also tried: $homescreen->get('order_detail')->to('homescreen#order_detail');
20:28 CW my $homescreen = $r->under('/homescreen')->to('login#logged_in');
20:29 CW Yeh, the call is getting through but I dont understand how to keep it on homescreen.html.ep instead of needing a controller or a template of its own. I am trying to keep all homescreen actions under homescreen.
20:31 meshl joined #mojo
20:31 sri where did you learn to use paths like action="order_detail"?
20:32 CW I was kinda hoping I could do something like /homescreen#order_detail?salesorderno="A0001234"
20:32 sri ok, it appears you need to learn how to use paths
20:33 sri and some basic http for the form handling
20:33 sri the mojolicious docs do not cover those parts http://mojolicious.org/perldoc#BASICS
20:34 CW Any site recommendations for those topics?
20:35 jberger CW: lately I've been using the Mozilla Developer Network whenever I have html/javascript questions
20:36 jberger I'm not sure if they have a "start at the beginning"
20:36 jberger ah, yes they do
20:36 jberger in the link sri said
20:40 sri some people learn pretty fast when they see the output of MOJO_DAEMON_DEBUG=1
20:41 sri maybe that works for you too
20:41 sri if not, then yea, the link
20:42 sri it's good to know how exactly paths transition from html to http though
20:43 jberger sri: interesting that you said that
20:43 jberger as I was looking through that MDN intro page I was like "you should show an actual message"
20:43 jberger so that a newcomer can see that there is no magic (ha!)
20:44 sri heh
20:44 sri i guess it's the most fundamental thing a web developer learns
20:45 sri there should be a tutorial that deals with the html form to http case
20:45 * sri remembers learning this back in the days with CGI.pm
20:46 sri was so exciting
20:46 gizmomathboy joined #mojo
20:57 sri hmm, my laptop seems to be taking a break in warshaw :S
20:57 sri hurry up ups!
21:01 gtodd hmm just noticed that if you are not careful you could accidentally build a page with Mojo that could updated via 140 character comments over, say, XMPP ...
21:01 gtodd and it would nearly be a clone of twitter ...
21:03 CW from what I can see on the MDN HTML form guide, my form is correct.
21:04 jberger CW: the action has to be a url
21:04 jberger the browser doesn't know anything about the application internals
21:05 jberger anyway, I don't think I can help more without the code
21:12 CW strange. it makes no differents if I have /homescreen/order_detail or just order_detail...
21:13 CW still looking for a different template. :-S
21:17 CW what other code do you need to see?
21:21 jberger a minimal example, a ::Lite app with a template in the __DATA__ section that demonstrates the problem that you are having
21:24 sri you did see that the growing guide covers html forms, right?
21:24 sri http://mojolicious.org/perldoc/Mojolicious/Guides/Growing
21:25 CW Yah, I used that as my base.
21:25 sri well, those examples do work
21:27 CW So I guess that means you have to create a new page for every action... thats sucks.. :-S
21:29 CW Thanks though. I appreciate the help. :-)
21:29 jberger CW: I suspect that you aren't understanding something (or that we aren't understanding you)
21:30 sri yea, seems like CW is not asking the right question
21:31 CW Most likely. :-P
21:33 CW myapp
21:33 CW |- script
21:33 CW |  +- my_app
21:33 CW |- lib
21:33 CW |  |- MyApp.pm
21:33 CW +- templates
21:33 CW |- layouts
21:33 CW |  +- default.html.ep
21:33 CW +- login
21:33 CW |- index.html.ep
21:33 CW +- protected.html.ep
21:33 CW Opps, Didn't mean to do that... Sorry
21:43 CW Maybe if I ask it this way. with my route:
21:43 CW my $homescreen = $r->under('/homescreen')->to('login#logged_in');
21:43 CW $homescreen->any('order_detail')->to('homescreen#order_detail');
21:43 preaction i'm finding it harder to believe you didn't mean to do that
21:44 CW is there anything here that says, go to order_detail.html.ep
21:44 preaction the to(...) says "go to templates/homescreen/order_detail.html.ep"
21:46 CW Oh, that explains it. :-) so if I wanted it to use homescreen.html.ep do I just remove the to?
21:47 CW I thought that ment for it to call the order_detail sub in homescreen. :-S
21:47 preaction no, you'd either need to route to some kind of "homescreen" method, or you'd need to( cb => sub { shift->render( 'homescreen' ) } );
21:47 preaction it also means that yes
21:48 CW cool, That helps. Thanks
21:50 CW Now I just have to figure out how to do that... But at least now I got an idea of where to go..
21:51 jberger you can use to(template => 'template_name')
21:52 jberger and technically homesceen#order_detail means the order_detail action (read: method) of the Homescreen class
21:53 jberger but when it doesn't find that method it will try to render the template of that name
21:53 jberger so if that's what you are after "is there anything here that says, go to order_detail.html.ep"
21:54 jberger $homescreen->any('order_detail')->to(template => 'order_detail');
21:56 pink_mist I thought he wanted to render homsecreen.html.ep
22:00 CW I do want to render to homescreen. :-
22:00 jberger "is there anything here that says, go to order_detail.html.ep"
22:03 CW Nope
22:43 trwww joined #mojo

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