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

IRC log for #mojo, 2016-11-05

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

All times shown according to UTC.

Time Nick Message
00:24 trwww joined #mojo
02:30 * jberger reads today's backlog
02:30 jberger sri very cool to see a real app you've written. Nice that you get to use signatures and postderef
02:36 * jberger spent the day at the 7th largest gathering of people in human history o/
02:36 asarch joined #mojo
02:39 bpmedley jberger : Where?
02:42 jberger http://www.fox32chicago.com/news/local/215601786-story
02:46 jberger Cubs parade/rally
02:46 jberger A truly astonishing number of people
02:46 jberger Roads as far as you could see were swarmed with people
02:46 jberger So much fun
02:46 bpmedley That's cool, odd, and exciting all at once..
02:51 bpmedley jberger : Baseball fan, or cubs fan, or both?
02:57 jberger Both
02:57 jberger Big cubs fan. Third generation (at least)
02:57 bpmedley Been a good week, then.. :)
02:57 jberger Yes it has  (finally)
03:01 jberger But whats 108 years between friends, right?! :p
03:02 bpmedley 108 years of waiting?
03:02 jberger Yeah
03:02 jberger Previous world series win was 1908
03:03 jberger Last world series appearance was 1945
03:03 bpmedley I wonder if they made bratwurst sausage the same back then..
03:08 aborazmeh joined #mojo
03:09 jberger Funny thing is, you basically can read about it: https://en.m.wikipedia.org/wiki/The_Jungle
03:09 bpmedley Oh wow, looks like we have the Meat Inspection Act for the win..
03:49 * tempire_ puffs
03:50 preaction yeah, that totally wasn't the real point of The Jungle :(
03:51 bpmedley preaction : What do you mean?
03:51 preaction Sinclair wanted to show the deplorable working conditions of the people, not that people were eating tainted meat. indeed, the first paragraphs mention that
03:52 bpmedley What you say makes sense.  Perhaps I could have worded my statement better.
03:54 noganex_ joined #mojo
04:08 meroy joined #mojo
04:08 meroy Mojolicious and Parallel MCPI Calculator https://gist.github.com/marioroy/e785bdb94742633b67e1138a21085013 Now, imagine a minion task running MCE::Hobo doing the same thing :)
04:13 meroy A given minion task may be extra CPU intensive. Data sharing between workers is possible. One day will try a Mojolicious application with progress updates while running a CPU intensive task using https://github.com/marioroy/Mojo-IOLoop-HoboProcess for another possibility without impacting the main event loop.
04:16 meroy .. and work across the board including running on Microsoft Windows.
06:12 polettix joined #mojo
06:45 meroy joined #mojo
06:47 meroy The following is a parallel demonstration for the Websocket Exercise: Recurring Plot of Monte Carlo Pi Calculation.
06:47 meroy https://gist.github.com/marioroy/46fc4f4b87f57724cdde843607d060fe
06:52 meroy Thanks @demian, @jberger, and all. Websocket is cool.
07:26 Vandal15263 joined #mojo
07:29 upasana joined #mojo
07:31 upasana_ joined #mojo
07:32 jkramer joined #mojo
07:33 esh joined #mojo
07:33 bobkare_ joined #mojo
07:36 parv joined #mojo
07:40 crab joined #mojo
07:47 parv joined #mojo
08:02 dod joined #mojo
08:07 dod joined #mojo
09:12 parv joined #mojo
09:21 polettix joined #mojo
09:29 kes joined #mojo
10:05 * sri answers https://github.com/kraih/mojo/issues/1014
10:08 sri jberger: happy birthday!
10:08 purl happy birthday is for (('to you', 'dear '.shift)[0,0,1,0]) { print "Happy birthday $_" }
10:21 trone joined #mojo
10:26 parv joined #mojo
10:42 bpmedley sri : How is SuSE?
10:44 sri it's a strange combination of open source and enterprise, but i like it
10:44 bpmedley Nice, glad it's a good transition for you.
10:46 sri what surprised me a little bit is the lack of programming culture, everything is very much about linux, and people are generally not very passionate about the programming languages they use
10:46 bpmedley Sounds like they may be more interested in a working solution, rather than a specific approach.
10:47 sri you have projects like the open build service that are written in ruby, perl and python
10:47 bpmedley That project uses all three languages?
10:48 sri everything is extremely diverse, programming languages, databases, and all the other backend technologies... you find everything at suse
10:48 sri http://openbuildservice.org/
10:48 sri it's also open source
10:49 sri frontend is rails, backend is perl building stuff, and the command line client is python
10:52 bpmedley Fascinating.  I wonder if it's because sometimes finding expert resources is difficult, so they go with what the resource knows.  Or, is it the right tool for the job, or something else?
10:52 sri i have not found the answer yet
10:53 sri there's some really cool perl projects, like openQA https://github.com/os-autoinst/openQA/
10:54 bpmedley That looks neat.  I'll mention that at work..
10:56 sri really hope i get around to cleaning up openQA a bit soon :)
10:56 sri there's some very sketchy mojo code in there
10:57 sri like this ;p https://github.com/os-autoinst/openQA/blob/baac24bcae7618c9fd6014cc6f3e6f1dc2609159/lib/OpenQA/Worker/Common.pm#L246
10:57 sri you can see the project grew a bit too quick and people took shortcuts
11:02 sri jberger: btw. i really like writing simple mojo apps like the one i just open sourced every now and then, i've already spotted a few weaknesses in mojolicious i want to improve
11:02 sri like the problem with config files in tests
11:08 marcus sri: what did you just open source?
11:17 dod joined #mojo
11:36 sri nothing fancy, just a little mojo app that was needed here https://github.com/openSUSE/build-check-statistics
11:38 sri bpmedley: i guess now that i think some more about it, the infrastructure diversity makes perfect sense when you consider everyone at suse r&d is working on a linux distribution and mantaining a few packages
11:39 sri you rely on that diversity to make sure all packages are top quality
11:39 bpmedley Cool.  MOAR skillset in all the things..
11:57 batman joined #mojo
12:09 flow joined #mojo
12:10 flow hi. sri: I kindly ask to reconsider reopening issue #1014. see my reply, please.
12:10 flow https://github.com/kraih/mojo/issues/1014
12:12 sri flow: you don't understand the problem
12:12 sri we will never give built-in exception handling a more prominent role
12:13 sri because of this http://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#Exceptions-in-non-blocking-operations
12:13 jberger flow the problem is that what you are proposing is (a) very difficult for non blocking and (b) a paradigm shift in mojo design philosophy
12:13 flow I am not sure you understand my
12:13 jberger sri: thanks for the birthday wishes
12:13 flow it is not about exceptions
12:14 flow i.e. it is not about exceptions thrown to mojolicious
12:15 flow it is about exceptions *caught* by me the developer, client of mojolicious, for the purpose of rendering. :-)
12:16 sri caught where?
12:16 flow in my controller.
12:16 sri then you don't need anything new from core mojo
12:16 flow I know
12:17 sri make your own fancy try/catch and good
12:17 flow yeah.
12:19 sri why am i supposed to open the issue again if you don't need anything from us?
12:20 flow because I just proposed a means to simplify it, requiring me to centralize, refactoring, this custom exception handling.
12:21 flow But you do not want, it's okay. Just a proposal.
12:21 sri then you don't understand
12:21 sri your proposal only considers blocking code
12:21 rshadow joined #mojo
12:22 flow then please explain me why you allows to render content in non-blocking code
12:22 flow -s
12:22 sri so multiple requests can be handled concurrently
12:23 sri or you can handle thousands of websocket connections with a single process
12:23 flow mom, I know, my question is another
12:24 jberger mom == typo ?
12:24 flow mom(ent)
12:24 flow why ...
12:25 flow why is there a $c->render(...) when there cannot be some $c->render_exception($caught_exeption)?
12:25 flow this is what I do not understand.
12:26 jberger flow: there is a render_exception, it is spelled reply->exception
12:27 flow yes, but it sets status code to 500, serializes it etc.
12:28 jberger I'm confused. If you don't want the standard error reply, just render whatever you want
12:28 sri technically, you can already do what you want with some creativity
12:28 sri https://github.com/kraih/mojo/blob/master/lib/Mojolicious.pm#L163
12:29 sri but there is no way we're going to formalize the process
12:31 sri $app->plugins->subscribers('around_dispatch')->[0] = sub {...}
12:32 flow I would really like to know how other projects achieve that
12:33 flow How to bring client-code exceptions typically in line with mojolicious renderer
12:33 flow without repeating the same code all over the place?
12:34 bpmedley flow : Could you create your own exception helper?
12:34 sri please listen, reply->exception is a fallback, not your general purpose exception handling
12:34 flow sri, I am to use $c->render, right?
12:35 jberger Yes
12:35 flow okay, I agree to it.
12:36 flow Now I will find a way – there seems to be no best practice as I understand you – to avoid redundancy of the code outlined in my reply to your issue-closed.
12:37 flow thanks so far :-)
12:39 sri correct, there is no way
12:39 sri well, no officially supported way at least
12:41 * flow will need to write an Mojolicious::FlowdysEssentialToolboxUtils ;)
12:44 polettix joined #mojo
12:45 flow are helpers always callable with $c->$custom_helper?
12:46 bpmedley flow : http://mojolicious.org/perldoc/Mojolicious#helper <-- yes
12:46 flow so I could have my $c->render_user_exception() indeed.
12:49 sri or $c->reply->user_exception
12:49 mib_l685bl joined #mojo
12:50 sri http://mojolicious.org/perldoc/Mojolicious/Guides/Rendering#Adding-helpers
12:51 flow how to define it? helper('reply->user_exception' => ...)
12:51 sri i just linked to it
12:51 * flow is examining
12:52 mib_l685bl I have an async client for some service A (async because of fancy websocket stuff, not my choice), and in the various callbacks I need to interact with a service B. What is a sane workflow to keep swiftly reacting to events on A, but queue the interactions with B in a "sync-manner" to avoid having more than one outstanding request to B?
12:53 flow sri, yeah, ok.
12:53 bpmedley mib_l685bl : How quickly should you interact with service "B"?
12:55 mib_l685bl if you are asking "can't you use a queue" - I rather not. I want to interact with B in real time ( preferably without the complication of persistent state somewhere ), yet I don't want to get in a situation where an eager A will overwhelm B
12:55 sri that's one of those things where promises would work well
12:58 bpmedley mib_l685bl : I must have misunderstood.  You mention that that you desire "queu(ing) the interactions with B".  And, also, that you'd rather not use a queue.  Did I misread?
12:59 mib_l685bl I meant I don't want to add the complication of minion/zmq/something like that
13:00 mib_l685bl i.e. there is a logical queue of course, but I rather express it entirely in-process
13:00 bpmedley mib_l685bl : I would consider a recurring timer that accessed a shared data structure.
13:00 mib_l685bl thus I am asking if there is some sort of mojo-specific practice for this
13:01 mib_l685bl hm... yes I suppose... have each finished interaction with B check the @queue, and if nothing is there right now - set a timer to check later
13:01 mib_l685bl yeah that'll work
13:02 bpmedley mib_l685bl : That'd be a great blog post on working with distinct services without starving a particular resource.
13:03 * flow says bye and thank you for all the work and time with me. and with mojolicious project of course.
13:03 mib_l685bl bpmedley: maybe, we;ll see
13:45 sri recurring timer seems incredibly inefficient
13:46 sri just take a look at the queue thingy jberger made for crawling a bunch of websites
13:49 bpmedley sri : do you have a link handy?  I looked in the 1st page of github gists and tried searching the lrc log.
13:50 sri bpmedley: no, but i think he wrote a blog post about it
13:53 bpmedley http://126kr.com/article/u72qp778x <-- this one?
13:58 sri no, but i guess that works
13:59 sri now that i think about it, there actually was a recipe for that in the cookbook a long time ago
13:59 sri https://github.com/kraih/mojo/blob/v2.0/lib/Mojolicious/Guides/Cookbook.pod#non-blocking
13:59 sri also a queue
13:59 sri too bad the recipe had to be removed
14:05 jberger https://gist.github.com/jberger/5153008
14:05 bpmedley Hrmm, I assumed that the previously mentioned access for service "A" was in a controller.  I maybe making an incorrect assumption.
14:12 sri ah, it was from stackoverflow
14:12 sri now i remember
14:13 jberger man SO has gotten to be such a mess
14:14 jberger I used to LOVE it
14:14 jberger now, not so much
14:14 jberger I try to check the #mojolicious tag from time to time
14:14 jberger but other than that, I pretty much stay away
14:15 sri i was wondering recently if the stackoverflow answers google finds me have gotten worse recently
14:15 sri s/recently//
14:16 jberger the problem is that there are so many of them, how could google find the rare good ones
14:17 jberger one of the biggest problems (and despite the militaristic mods closing so many things as dupes) is that users continually post new questions rather than reading and understanding old ones
14:18 jberger the site just got too big and the "community feel" collapsed
14:18 jberger it became a free for all of "gimme teh codz, kthxbai"
14:28 asarch joined #mojo
15:19 vmvm joined #mojo
15:22 vmvm hello! can I reset validation->output ? I need to validate two hashes and I have output with data from both ((
15:24 sri yes
15:30 vmvm thank you ))
15:30 vmvm I can't find how ((
15:32 vmvm I can only create new validator object for second  hash
15:34 sri http://mojolicious.org/perldoc/Mojolicious/Validator/Validation#output
15:36 vmvm ->output({}) ?
15:39 vmvm thank you ! this work ->output({})
15:46 lluad joined #mojo
16:15 Paddi joined #mojo
16:16 Paddi Hi guys
16:16 Paddi in Mojo lite app, is there anyway I can change method from GET to POST and redirect to another page?
16:17 Paddi I tried $self->tx->req->method('POST'); $self->redirect_to('/new/path'); ... doesn't work :(
16:38 Grinnz Paddi: you cannot redirect to POST from a GET
16:40 suede does $c->reply->static automatically 404 if the file doesn't exist?
16:45 Paddi Grinnz: thank for the answer.
16:48 Paddi I facing this problem, in my mojo lite all routes are '/:system/<name>' ...but one of the route is '/:system/<name>/:id'. when user reach the /:system/<name>/:id page ... all my menu item kinda screw up (url_for('dashboard') supposed to go /:system/dashboard, but it became /:system/<name>/dashboard )
16:55 rshadow joined #mojo
17:13 polettix joined #mojo
17:27 dod joined #mojo
17:28 dod joined #mojo
17:50 suede can i make $c->reply->static use an absolute path?
17:56 suede o
17:56 suede i guess that's what $c->reply->asset is for
17:56 PryMar56 joined #mojo
17:57 suede thanks #mojo!
18:09 dod joined #mojo
18:25 jberger Paddi i think you are using url_for incorrectly
18:27 jberger I was going to as to see some code, but I guess not
18:28 suede jberger:
18:28 suede thank you for writing this
18:28 suede http://blogs.perl.org/users/joel_berger/2015/12/response-to-the-perl-jam-2.html
18:29 suede my friend got angry with me that i chose perl for our collaborative web app project
18:29 suede because of the dumb presentation that guy gave
18:36 preaction there's even more rebuttal to that: https://gist.github.com/preaction/978ce941f05769b064f4
18:39 suede jberger, preaction you guys are the best
18:40 suede thanks
19:00 lluad joined #mojo
19:02 jberger suede no problem
19:03 jberger Both of his talks have been an embarrassment for him not us
19:04 preaction they'd've been fine if he wasn't so self-righteous and unwilling to accept criticism (or even assistance)
19:04 jberger And if the CCC would stop giving him a platform
19:06 preaction eh. if it happens again, then it's a pattern... the first one was "okay", the second one could've been "wow, the first one got us a lot of hits, let's do this again"
19:06 jberger I know we sent lots of feedback to the organizers
19:06 jberger This time at least
19:07 suede i'm going to CCC this year
19:07 suede i can be really annoying
19:07 suede if there's another
19:07 suede if you want
19:08 preaction the first one had a clear problem though, Bugzilla even made a CVE. which is why part 2 happened.
19:08 preaction i mean, i'd personally rather the perl community be seen as reasonable, open, and friendly. so, being annoying to someone who's up there speaking wouldn't be that
19:08 suede preaction: not to them
19:08 suede i meant i can tell the organizers
19:08 suede something
19:08 suede idk
19:08 suede i wouldn't heckle anyone on stage for any reason
19:08 suede that's just rude
19:10 preaction i'm an ardent free speech supporter. i'd rather, if i were there, go to the talk and then blog about what i disagreed with. or even get my own talk up there discussing topics that rebut the original topic
19:10 preaction so, sure, open letters to the organizers saying "hey, look, there's a lot of misinformation here, and we tried getting them to correct it and they refused" is good
19:11 rshadow joined #mojo
20:26 asarch joined #mojo
20:39 ajr_ joined #mojo
20:41 ajr_ joined #mojo
22:14 disco joined #mojo
22:14 disco hi there
22:14 purl hola, disco.
22:15 disco I installed latest Mojolicious version as user, in ~/perl5. It worked well. Then I create an app with ~/perl5/bin/mojo generate Test
22:15 disco When I try to run it with ~/perl5/bin/morbo script/test it exists with error:
22:16 disco "getopt" is not exported by the Mojo::Util module
22:16 disco is there something else to install locally in order to make it work ?
22:19 disco btw, this is to use the latest version of Mojolicious. But if it is relevant to use the version distributed with Debian/Jessie (5.54), then it would be fine. I would only need to use Mojo::Pg.
22:20 bpmedley disco : I can't replicate.  I just tried 7.10 via CPAN and git clone.  What version of Mojolicious do you have?
22:20 Grinnz disco: what is the shebang of ~/perl5/bin/morbo?
22:21 disco Grinnz: it's : eval 'exec /usr/bin/perl  -S $0 ${1+"$@"}'
22:21 Grinnz uh... what
22:22 Grinnz that's not a shebang
22:22 disco Indeed
22:23 rshadow joined #mojo
22:24 disco Well, actually I got the problem. Of course running ~/perl5/bin/mojo does: use Mojolicious, and then it loads globally installed modules, not the local ones
22:24 Grinnz did you enable local::lib in your shell?
22:24 disco so, ~/perl5/bin/mojo version # shows Debian/Jessie stock version (5.54) and not 7.10.
22:24 polettix joined #mojo
22:25 Grinnz https://metacpan.org/pod/local::lib#SYNOPSIS
22:25 Grinnz you need to do the third one there, so that your shells have the appropriate env vars set to prefer modules in ~/perl5
22:25 disco Grinnz: no, and that's the point
22:26 Grinnz otherwise perl has no idea you have modules there
22:27 disco Grinnz: thanks, that was the problem.
22:30 disco Grinnz: now if I need Mojo::Pg, I can simply install it with perl -MCPAN -e shell, then install Mojo::Pg ?
22:30 Grinnz or just `cpan Mojo::Pg` or `cpanm Mojo::Pg`, assuming you've applied the local::lib env to your current shell
22:31 disco Grinnz: ok, didn't know that ;)
22:39 disco it worked ;)
22:40 disco I wrote some web app in 2006 using perl/cgi and custom Postgres backend and html display, I'm looking forward to rewrite this using Mojolicious ;)
22:49 disco Grinnz: thanks for helping ;) good night

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