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

IRC log for #mojo, 2015-07-25

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

All times shown according to UTC.

Time Nick Message
00:01 thowe If anyone is interested, this is the code I've mostly settled on the the rotating record of visited accounts I was brain farting on earlier...
00:01 thowe https://gist.github.com/thowe/da34c0993806d154bfd6
00:02 thowe Prevents duplicates and moves the current to the top if it was already there...
00:02 thowe latest on top
00:19 bpmedley thowe: That's cool.  Why do you need the most recent visitor to be first?
00:20 mattastrophe joined #mojo
00:25 thowe Most recent visited...  I doubt it is a need, but as we bounce around the system, people will think in terms of "I just visited that, it should be towards the top" or actually on top.  So things go down the list as they get older.
00:26 thowe and visiting again refreshes its order in the list.  Just seems intuitive to me.
00:26 bpmedley That is neat
00:27 thowe It's funny how minor visual cues can trigger helpful things...  I am re-imagining how we view a customer dashboard, and I've already hit on a major mistake we are making that might be costing us money with this little visual indicator I built in.
02:02 jberger bpmedley: that is an interesting idea
02:02 jberger I was just thinking about writing a Minion "plugin" that would do repeating jobs
02:02 jberger since I think I have all the primatives I nead
02:02 jberger but that is clever
02:03 bpmedley Seems icky to solve that problem in the job queue; however, that's just a feeling.
02:04 jberger I can't say that I have any feeling on this
02:04 jberger or actually, all options seem icky
02:04 jberger but equally
02:05 bpmedley What we need is inferno.
02:05 jberger http://ia.media-imdb.com/images/M/MV5BMTc3ODUwMzU4OF5BMl5BanBnXkFtZTcwNjYzNzIzMQ@@._V1_SY317_CR9,0,214,317_AL_.jpg
02:10 jberger or if you know what this is it might be better: http://i62.tinypic.com/241t3jp.jpg
02:10 bpmedley Dunno, first one seemed more of cult classic
02:22 jberger bpmedley: and the second isn't :-P
02:22 jberger thowe left?
02:22 jberger :(
02:22 jberger I golfed: https://gist.github.com/jberger/dd9ca7bb30809f3b5b3c
02:26 jberger bpmedley: is this really the script? http://timkay.com/solo/solo
02:26 jberger I don't get it
02:27 bpmedley My understanding is that the script currently works for localhost only.
02:28 jberger but argument handling?
02:28 purl it has been said that argument handling is b0rked as hell
02:28 jberger thanks purl
02:28 * jberger pats purl
02:28 purl how condescending
02:28 bpmedley I believe the -s handles that.  Is that correct?
02:28 jberger :o
02:28 * jberger scampers over to perlrun
02:30 jberger holy carp! I've never seen that before
02:30 jberger I've read perlrun a dozen times at least, how have I never seen that?!
02:31 bpmedley I don't think I've ever used that either.  Probably been there since perl 4.. ;)
02:57 noganex joined #mojo
02:58 jberger sad that thowe isn't here, I got the splice form of his size cap working too
02:58 jberger that code is now well and truly concise
02:59 jberger bpmedley: preaction found that -s is in perl since 1.0 http://perl5.git.perl.org/perl.git/blob/8d063cd8450e59ea1c611a2f4f5a21059a2804f1:/perl.man.1#l220
02:59 bpmedley Holy hell, that's good sluething
03:00 jberger indeed, preaction++
03:00 preaction nah, it was a bisect that got short-circuited since it was in the first commit in the repo ;)
03:17 bpmedley http://bmedley.org/controller.png  <-- Thoughts on improvement?
03:25 bpmedley Or, any thoughts at all?
03:29 preaction what am i looking at?
03:30 bpmedley It's an attempt at a graph of a $c (Mojolicious::Controller) object.  Sorry, I should have mentioned that.
03:30 preaction it seems like it might be better to arrange them horizontally instead of vertically
03:30 bpmedley Possibly.  Good thought.
03:30 preaction the UML diagramming conventions might be useful as well
03:31 preaction is the input a $c object? so if i make my own controller, it'd figure out what the controller has?
03:31 preaction i wish there were some more structure in POD sometimes...
03:32 thowe joined #mojo
03:33 bpmedley Yes, the input is a $c object.  The code walks the symbol table, more or less.
03:33 preaction nice
03:34 bpmedley The UML looks intriguing
03:35 preaction yeah, they introduced that stuff to us doing java. iirc the netbeans ide let you build your classes using a gui uml thing ...
03:37 bpmedley If there's interest I can pastie the code.  I basically copied 'n pasted some code here and there.. ;)
06:14 dod joined #mojo
06:19 dod joined #mojo
06:42 dotandimet joined #mojo
06:54 kaare joined #mojo
07:11 dotandimet joined #mojo
07:17 Vandal joined #mojo
07:32 elik joined #mojo
07:36 Adurah joined #mojo
07:45 melo joined #mojo
07:56 dotandimet joined #mojo
08:14 kaare_ joined #mojo
08:20 melo joined #mojo
08:33 melo joined #mojo
09:04 amon joined #mojo
09:14 joelb joined #mojo
09:43 trone joined #mojo
10:06 dotandimet joined #mojo
10:14 bpmedley_ joined #mojo
10:16 cpan_mojo W3C-SOAP-WADL-0.006 by IVANWILLS https://metacpan.org/release/IVANWILLS/W3C-SOAP-WADL-0.006
10:30 Craftsmanship joined #mojo
11:04 melo joined #mojo
11:15 Vandal joined #mojo
11:51 dotandimet joined #mojo
12:01 mattastrophe1 joined #mojo
14:29 bwf joined #mojo
15:19 ashimema joined #mojo
15:30 mattastrophe joined #mojo
15:38 mattastrophe joined #mojo
15:42 PryMar56 joined #mojo
15:59 melo joined #mojo
16:21 dotandimet joined #mojo
17:33 Adura joined #mojo
18:01 lluad joined #mojo
18:32 mattastrophe joined #mojo
19:17 ledet joined #mojo
19:26 ledet Hello everyone. Is this the right place to ask Mojolicious newbie questions? I'm building a small webapp (where I want to user Mojolicious) to be frontend to a TCP based backend. So my first thought was to use Mojo::IOLoop::Client to talk to the backend (handle send and receiving stuff, one connection per hyptotoad process), and I can get get it to send out events to subscribe to. How do I get, say "get '/dostuff' => sub {...}" to post data to the ba
19:26 ledet ckend? Is there something like $poe_kernel->post($session,...) that I can use to inject events? Or tell me if I'm going about this completely wrong :)
19:28 mst er ... keep the client around somewhere
19:28 mst might I suggest looking at the code to convos.by
19:28 mst since that's an HTTP interface to IRC
19:29 mst which is, in the end, just another TCP socket protocol
19:29 mst and as such might make a decent example
19:31 ledet mst: Thanks for the pointer to convos.by. If I keep the client around (say in a global variable $client or similar), how toI write to it? It does not appear to have any methods for this... I guess I would need to extract its "stream" somehow and write to that?
19:33 mst ledet: I'm confused. the documentation for ::Client says it exists to *open* connections and then on 'connect' you receive a $handle
19:33 mst ledet: surely the handle is the one you should be writing to
19:33 mst in fact, I'm not sure you'd even need to call ::Client directly
19:33 ledet mst: I'll give that a try. Thank you!
19:34 mst here we go
19:34 mst ledet: https://metacpan.org/pod/Mojo::IOLoop#client
19:34 mst ledet: as documented, that'll give you a $stream already
19:37 ledet mst: yes, I get the stream inside the sub {} for the client, but if I have "get '/something' => sub { want to send stuff to the client here }" (Mojolicious::Lite) in the main scope, those won't have access to that stream?
19:37 mst ledet: erm. the stream is just, like, a variable. you could put it in a hash.
19:37 mst ledet: my point was that you don't want or need to use Mojo::IOLoop::Client directly
19:38 mst ledet: don't keep the client around, just keep the $stream
19:38 mst ledet: you were talking about "extracting the stream somehow"
19:38 mst ledet: you've already been passed the stream
19:38 mst ledet: store it somewhere :)
19:39 ledet mst: ok, so subscribe to "incoming data events" where it makes sense, and keep the stream handy for anything that needs to be able to send out outgoing stuff?
19:39 mst well, I'd start by writing a MyService::Client class that actually encapsulated all of this
19:40 mst and then have the app use it
19:40 mst but that's because I basically have to fight the urge to vomit every time I see non-web-specific logic in route handlers
19:41 ledet mst: sounds reasonable. Unfortunately, I'm still in the "fighting to get stuff to work" phase of learning Mojolicious, so doing pretty (i.e. readable, non-vomit-inducing) stuff is my next step :)
19:43 mst personally I find that splitting the two helps during that phase
19:43 mst since now I can drive my client from a test file until it works
19:43 mst and only worry about the http stuff afterwards
19:43 mst but if you find learning two complicated things at once is easier than one, go for it
19:44 mst seriously though, we all have our own ways of flailing about when trying to learn things
19:45 mst I'm just pointing out that maybe compartmentalising the flailing might help :D
19:45 ledet mst: I would like to tell you that I find all of this easy to understand and that I would have no problem with learning two things at once, but I an struggling here. Thanks for the help so far.
19:45 mst right, my point is, you could write a client first, get that all working, then write web code that drives the client
19:45 mst this may or may not be easier than trying to write both at once
19:46 ledet mst: I'n any case: thanks for your pointers! Have plenty to get confused about now :)
19:46 mst good enough :D
20:13 bpmedley joined #mojo
20:37 PryMar56 joined #mojo
20:40 mattastrophe joined #mojo
21:02 brainbuz joined #mojo
21:52 mattastrophe joined #mojo
22:23 CandyAngel \o/
22:23 CandyAngel I broke Mojo::URL :|
22:23 CandyAngel Deep recursion on clone

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