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

IRC log for #mojo, 2015-08-26

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

All times shown according to UTC.

Time Nick Message
00:00 jontaylor joined #mojo
00:20 paulw joined #mojo
00:41 Ptolemarch joined #mojo
01:12 PopeFelix joined #mojo
01:17 jontaylor joined #mojo
01:34 jb360 joined #mojo
01:35 Ptolemarch joined #mojo
01:48 mattastrophe joined #mojo
01:59 damaya joined #mojo
02:19 noganex joined #mojo
02:19 PopeFelix joined #mojo
02:29 Ptolemarch joined #mojo
03:00 PopeFelix joined #mojo
03:02 kaare joined #mojo
03:20 SmokeMachine batman: Now it's working... I really liked the way it is (and I am already using it on a project) Any consideration?
03:20 SmokeMachine https://github.com/FCO/Mojolicious-Plugin-JSON-Validator
03:24 Ptolemarch joined #mojo
03:41 cfedde_ joined #mojo
04:07 Grinnz joined #mojo
04:10 Grinnz joined #mojo
04:11 Grinnz joined #mojo
04:11 damaya joined #mojo
04:18 Ptolemarch joined #mojo
04:45 batman SmokeMachine: Not too bad :)
04:45 batman Do you use both the auto render and not autorender yourself?
04:46 batman Seems like not everything is documented... Where do you document auto_validate stuff?
04:48 mrallen1 joined #mojo
04:48 batman I see you have a typo in the documentation, auto_validate => render, but even so you're not explaining what it does
04:48 batman The DESCRIPTION is awful :(
04:49 batman And you also don't document what arguments register() can take
04:49 inokenty-w joined #mojo
04:50 batman You don't even mention JSON::Validator anywhere.
04:51 batman Please read your own documentation and see if you think it's great.
04:51 batman If the answer is yes, then step aside for a day and read it again.
05:01 Snelius ))
05:01 Snelius nice
05:12 Ptolemarch joined #mojo
05:13 Corgi joined #mojo
06:06 Ptolemarch joined #mojo
06:24 damaya joined #mojo
06:48 dod joined #mojo
07:00 Ptolemarch joined #mojo
07:06 dod joined #mojo
07:11 dod joined #mojo
07:12 eseyman joined #mojo
07:24 bjoernfan joined #mojo
07:29 AndrewIsh joined #mojo
07:29 melo joined #mojo
07:54 berov joined #mojo
07:54 Ptolemarch joined #mojo
07:55 Vandal joined #mojo
08:20 stephen joined #mojo
08:36 damaya joined #mojo
08:48 Ptolemarch joined #mojo
09:00 jontaylor joined #mojo
09:02 nigel joined #mojo
09:07 oetiker joined #mojo
09:34 ladnaV joined #mojo
09:36 meshl joined #mojo
09:43 Ptolemarch joined #mojo
10:01 DadaIsCrazy joined #mojo
10:37 Ptolemarch joined #mojo
10:55 SmokeMachine batman: i didnt even touch the documentation...
11:31 Ptolemarch joined #mojo
11:38 SmokeMachine Yet
11:49 neilhwatson joined #mojo
12:25 Ptolemarch joined #mojo
12:30 melo1 joined #mojo
12:59 hernanGOA joined #mojo
13:02 ajr_ joined #mojo
13:16 sh4 joined #mojo
13:19 Ptolemarch joined #mojo
13:19 jb360 joined #mojo
13:35 jontaylor joined #mojo
13:39 PopeFelix joined #mojo
13:56 dod joined #mojo
14:08 cfedde__ joined #mojo
14:09 cfedde__ joined #mojo
14:10 cfedde joined #mojo
14:13 Ptolemarch joined #mojo
14:34 eitz joined #mojo
14:38 Ptolemarch joined #mojo
14:45 lluad joined #mojo
14:50 PopeFelix joined #mojo
15:02 PryMar56 joined #mojo
15:09 mattastrophe joined #mojo
15:12 batman SmokeMachine: Is the doc mine..? Haha
15:13 batman batman - - :)
15:13 gryphon joined #mojo
15:19 SmokeMachine :) if you want it... Just kidding! Im just procastinating :p ill write it tonight
15:20 jberger I got a spectacular email today: http://pastie.org/10377186
15:20 jberger read it out loud, I dare you
15:27 mrallen1 joined #mojo
15:33 meshl joined #mojo
15:35 mst jberger: gun bullet poison!
15:35 jberger YES!
15:38 asarch joined #mojo
15:40 mattastrophe joined #mojo
15:44 bjoernfan joined #mojo
15:51 marcus and it almost has circulated all over her blood stream
15:51 marcus that sounds serious
15:52 dod joined #mojo
15:53 Ptolemarch joined #mojo
15:57 irqq joined #mojo
15:58 mattastrophe joined #mojo
15:59 dod joined #mojo
16:03 jberger I'm very impressed that with that state of poisoning (and being shot) that she is interested in rapid growth in long terms
16:07 bd signs of a pro
16:08 disputin joined #mojo
16:21 Ptolemarch joined #mojo
16:22 pink_mist I once had gun bullet poison too
16:22 pink_mist then I died =(
16:22 mattastrophe joined #mojo
16:31 jberger ... I got better
16:34 Quai redd
16:34 Quai bah. Why does all my crap always end up in this channel? :P Sorry people.
16:43 genio The part that gets me is that some people must actually fall for these crazy scam emails otherwise it wouldn't make sense for them to keep sending the massive amounts of spam emails.
16:43 Grinnz_ barely anyone needs to, sending spam email is cheap
16:43 genio "wow, that poor lady.  I should give her my bank account information and whatever other personal info about me she wants!"
16:53 pink_mist https://www.youtube.com/watch?v=ytDamqTjPwg <-- this is an interesting take on spam :P
17:01 pink_mist (if you've seen 'The Wolf of Wall Street' you may recognise the penny stock scheme that's being utilised from there ... or you may just know enough about the stockmarket that you knew that anyway :P)
17:10 dod joined #mojo
17:12 PopeF joined #mojo
17:24 Ptolemarch joined #mojo
17:36 berov joined #mojo
17:42 Corgi joined #mojo
17:49 disputin joined #mojo
18:04 mrallen1 joined #mojo
18:07 lluad joined #mojo
18:27 dave Involved question: http://fpaste.org/259715/61362814/ ... which way is "better"? :D
19:03 jberger dave: meaning arrow code vs delay?
19:05 dave yes
19:06 dave if you mean the => in $db->query($sql => $callback)
19:06 dave when you say arrow
19:06 jberger no, arrow code is callbacks within callbacks
19:07 jberger and that is what delays are made to prevent
19:07 * sri has never heard the term arrow code
19:08 pink_mist "callback hell" is the usual term
19:08 dave neither have I
19:08 Grinnz_ i would call that "nested continuations" i guess
19:08 sri it's more commonly known as pyramid of doom or callback hell
19:08 pink_mist yeah, pyramid of doom too
19:08 dave never heard pyramid of doom either
19:08 Grinnz_ anyway i think those terms are sufficient to answer dave's original question :P
19:08 sri those names should tell you everything you need to know :)
19:08 dave yeah well I was concerned about the complexity of method 2
19:08 sri heh
19:09 sri if delays are too complex, you might not be using them correctly yet
19:09 dave can you elaborate?
19:09 sri look at the mojo docs
19:09 sri all the delay examples are pretty clean
19:10 mst delay, as with futures, feels more complicated to begin with but once it clicks you'll find it's a far more powerful approach than callbackception
19:10 dave argh
19:11 Grinnz_ you should also remember that a die in a delay step will happen inside the event loop, so you cannot catch it with Try::Tiny, you want to use ->catch on the delay object
19:11 mst async code involves a lot of having a massive headache on the way to being used it.
19:11 mst I'm afraid I don't have a good way around that; I just sucked up the headaches until things started to make sense
19:12 dave well at least I learned that the delay object has a catch :D
19:12 Grinnz_ dave: more specifically, the delay steps won't even happen until that "Mojo::IOLoop->start" at the end; so it's nowhere near the try/catch block you made when it dies :)
19:13 dave yeah that I just got
19:14 Grinnz_ occasionally, i will use a delay for a single async step for the sole purpose of using ->catch
19:14 dave the thing is, if you put a callback into $pg->db->query() it didn't seem to die
19:14 dave but I wasn't using ->catch(0 at all
19:14 dave er catch()
19:14 Grinnz_ right, the Mojo::Pg API does that intentionally, the error is returned in the callback
19:14 dave so if I am using a callback (because I want non blocking) inside a delay subroutine, that's overkill?
19:15 Grinnz_ not at all
19:15 Grinnz_ the delay is there to facilitate your callbacks
19:15 Grinnz_ you just don't need to ->catch errors, because Mojo::Pg won't throw database errors when used non-blocking
19:15 Grinnz_ (unless you die for some other reason yourself of course)
19:17 didge joined #mojo
19:20 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#Exceptions-in-events
19:22 jberger Grinnz_: I will often do a one step delay for catch
19:22 Grinnz_ it's a catch-all for async error handling :P
19:23 * mst groans
19:24 sri oh right, that reminds me... i was meaning to tell Grinnz_ that i hate helpers that return delays :)
19:24 Ptolemarch joined #mojo
19:24 sri delays are not futures
19:25 Grinnz_ i don't know a better way to let the calling context determine the error handling
19:25 dave Finally I think I have some words for the docs ... there's too many references to different sections that have to be groked before some of this makes sense
19:25 sri apis should always be continuation passing style imo
19:25 mst delays are meant to be inside out, you should be calling ->begin and passing the result in, no?
19:25 sri Grinnz_: $err argument
19:26 Grinnz_ egh, it just seems ugly to me to do that *everywhere*
19:26 ZoffixWork joined #mojo
19:26 sri then maybe you want promises/futures
19:26 Grinnz_ futures seem overcomplex to me
19:27 ZoffixWork batman, you gonna hate me :) I found a new bug with AssetPack :}
19:27 sri well, that's how it's meant to be
19:28 sri continuation passing style or promises
19:28 irqq joined #mojo
19:28 Grinnz_ maybe what i need to do is try to use futures in one of my bot plugins so i can understand them
19:29 sri what makes promises clunky is the boilerplate to add them to an otherwise cps api
19:29 mst I bet there's a pattern for that
19:30 mst I mean, like passing $future->done_cb instead of $delay->begin
19:30 sri and of course perltidy not being able to handle ->them chains is kinda bad too
19:30 sri s/m/n/
19:31 mst o/ them chains / them chains / them DRY chains o/
19:31 mst (sorry)
19:32 Grinnz_ o/ just a big ol' pile o' them chains o/
19:38 dave so there's Mojo::IOLoop->delay and Mojo::IOLoop::Delay and $c->delay ($c->isa('Mojolicious::Controller')
19:39 Grinnz_ Mojo::IOLoop->delay is for creating a Mojo::IOLoop::Delay
19:39 Grinnz_ the delay helper wraps that for making them in Mojolicious actions
19:39 sri http://mojolicio.us/perldoc/Mojolicious/Plugin/DefaultHelpers#delay
19:40 dave how do you ->catch a $c->delay?
19:40 Grinnz_ it already has a default ->catch that renders an exception
19:41 Grinnz_ but it also returns the delay object
19:41 jberger Grinnz_: ewww, no
19:42 Grinnz_ ?
19:42 meshl joined #mojo
19:42 jberger dave: https://github.com/jberger/MojoForum/blob/master/lib/MojoForum/Helpers.pm
19:42 jberger these are the helpers I define in my demo/toy project for complex async stuff
19:42 jontaylor joined #mojo
19:43 sri Grinnz_: it does not return the delay object
19:44 Grinnz_ ah, nvm then
19:44 dave the delay pass stuff and arguments are pretty opaque to me, I better write a test script
19:44 dave before I have to use Devel::Cycle (shudder)
19:45 dave but this is another example, thanks jberger :)
19:46 dave it's much clearer when you see the sequence of subs with clear arguments
19:46 didge Hi;
19:46 didge I'm new to mojolicious as well as the Komodo IDE.
19:46 dave hiya
19:47 didge I had hoped to run the debugger for mojolicous on my very basic app.
19:47 didge What should I click first?
19:47 Grinnz_ "the debugger for mojolicious"?
19:47 jberger didge: the debugger is going to get very ... interesting ... once you enter the ioloop
19:47 didge Sorry, the Komodo IDE debugging tools with a Mojolicious project.
19:47 Grinnz_ ah, an IDE debugger
19:48 jberger Grinnz_: I'm sure (s)he just means the perl debugger
19:48 didge I don't know.  ActiveState seems to be pushing Mojolicous.  They should have a plan.
19:48 dave jberger: what is ->single() ?
19:48 jberger didge: do you have some documentation from them about it?
19:48 didge I'll check.
19:49 jberger dave: that's the orm that the example project used
19:49 * sri vaguely remembers komodo having special mojolicious features, but has never actually used it
19:49 jberger it was for mongodb/mango and so is basically abandoned now
19:49 jberger batman's mad mapper is the closest direct sucessor though think DBIx::Class with callbacks and you'll be close
19:51 jberger actually, batman I wonder if Mojo::Pg+Pg+JSON+Mandel could be a thing?
19:51 jberger (Mandel is the name of the O(D|R)M that I was talking about)
19:52 Grinnz_ throw json on it, everything's better with json
19:52 ZoffixWork batman, just now managed to reproduce it, but I'm going home in 30 seconds. Will post a bug a proper bug report tonight or tomorrow. Here's the test case app though: http://zoffix.com/new/bug-aug-28.tar  Changing the colour in public2/sass/included.scss doesn't update the colour in the browser. And having an extra ->static->path is a prerequisite for the bug.
19:52 dave lol
19:52 * ZoffixWork &
19:52 didge Okay.
19:52 didge It's working for me.
19:53 didge The trick was to open the script/myapp perl file.  Thanks for humouring me.
19:53 jberger Grinnz_: the idea is that it is a Object Document Mapper (rather than ORM) so having the data in JSON makes some sense
19:53 Grinnz_ yeah, with Pg that could work
19:53 jberger didge: I'm still curious about mojo-specific features if you happen to find something I can read
19:54 didge jberger, I'll let you know as my adventure continues.  I'm just making a brochure style web page with two forms right now.
19:55 jberger I meant features of the IDE
19:55 didge jberger, I know.
19:55 jberger though projects in mojo ale always nice to see too
19:55 Grinnz_ mojo ale? new product?
19:55 didge jberger, I'll keep you posted if I encounter any mojo-specific features in Komodo IDE.
19:56 jberger didge: thanks
20:48 didge joined #mojo
20:53 dave http://fpaste.org/259803/40622335/ .. is that better? :)
20:56 jberger dave: are you wanting these queries in parallel?
20:56 dave no, they are supposed to be sequential
20:57 dave that's what delay does right?
20:57 jberger right, ok
20:57 jberger it can do both, but you are doing sequential
20:57 dave I want to abstract a transaction so I don't have to write this code again :D
20:58 dave a couple of the apps I'm doing require a bunch of model accesses before returning a web page
21:00 ajr_ joined #mojo
21:10 jberger why check sth->{Active}?
21:16 dave that was the only way I found to determine whether or not there were results waiting
21:23 melo joined #mojo
21:41 marty joined #mojo
21:45 meshl joined #mojo
21:55 jb360 joined #mojo
22:29 hernanGOA joined #mojo
22:30 Zoffix batman, never mind. I can't reproduce the issue on my home box :S Weird bug.
22:30 PryMar56 joined #mojo
22:41 sri lol, i guess Mojo::DOM is too dwim https://www.lvh.io/posts/queryselectorall-from-an-element-probably-doesnt-do-what-you-think-it-does.html
22:42 sri $dom->find(...) starts at the current element
22:42 Grinnz_ heh
22:43 sri looks like :scope was meant as a workaround for that
22:43 sri that's sooooo awful
22:44 PopeF joined #mojo
22:45 * sri finally understands the confusing stuff from the css4 selectors spec
22:49 sri yea, we'll not follow browsers there ;p
22:51 nicomen ;)
22:54 didge joined #mojo
23:01 Grinnz_ http://www.usanetwork.com/mrrobot/blog/mr-robot-blog/season-finale-postponed huh
23:04 dave ack
23:04 sri spoilers
23:05 dave were the scriptwriters being psychic?
23:06 dave I bet the writers get investigated
23:07 nicomen what happened in virginia?
23:13 Corgi joined #mojo

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