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

IRC log for #mojo, 2015-07-03

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

All times shown according to UTC.

Time Nick Message
00:06 Snelius joined #mojo
00:22 Kogurr joined #mojo
00:36 harry joined #mojo
00:48 aggrolite joined #mojo
01:18 PryMar56 joined #mojo
01:22 neilhwatson joined #mojo
01:42 hshong joined #mojo
02:53 noganex joined #mojo
03:11 kaare joined #mojo
03:50 jberger Command line use in general
03:51 jberger bpmedley: so far it's had most of what I needed
03:51 jberger Ansible that is
03:51 jberger Mojo too :p
05:31 aggrolite joined #mojo
05:47 cpan_mojo Mojo-Webqq-1.3.6 by SJDY https://metacpan.org/release/SJDY/Mojo-Webqq-1.3.6
05:48 cpan_mojo Mojo-SinaWeibo-1.5 by SJDY https://metacpan.org/release/SJDY/Mojo-SinaWeibo-1.5
05:57 abracadaniel joined #mojo
05:58 bjoernfan joined #mojo
06:08 dotandimet joined #mojo
06:08 melo joined #mojo
06:11 Lee joined #mojo
06:27 mattastrophe joined #mojo
06:30 Lee joined #mojo
06:51 mattastrophe joined #mojo
06:53 dod joined #mojo
06:58 dod joined #mojo
07:12 AndrewIsh joined #mojo
07:13 eseyman joined #mojo
07:14 trone joined #mojo
07:18 dotandimet joined #mojo
07:30 Vandal joined #mojo
07:42 dotandimet joined #mojo
07:50 odc joined #mojo
08:01 Lee joined #mojo
08:45 ladnaV joined #mojo
08:49 kyshtynbai joined #mojo
09:37 jb360 joined #mojo
09:43 bin_005 joined #mojo
09:50 irqq joined #mojo
10:14 dod joined #mojo
11:09 ToApolytoXaos joined #mojo
11:16 eitz joined #mojo
11:48 neilhwatson joined #mojo
11:53 _dave_ joined #mojo
11:54 punter joined #mojo
12:42 hahainternet minion theory question: an email sending job that also watches remote mail logs to wait for a success, how should that be architectured? seems inefficient to have the jobs stick around for up to 30 minutes+ (when the remote person is using something like postgrey) but i'm not sure how to signal failure back if i use two separate jobs
12:56 anufant joined #mojo
13:01 cpan_mojo Mojolicious-Plugin-ReCAPTCHAv2-0.01 by HJANSEN https://metacpan.org/release/HJANSEN/Mojolicious-Plugin-ReCAPTCHAv2-0.01
13:06 CandyAngel hahainternet: That sounds like 2 separate jobs to me. You could pass the original job ID to the checking job.. like umm
13:06 ajr_ joined #mojo
13:06 CandyAngel $minion -> enqueue ('check_email', [$send_job_id, %other_args])
13:07 cpan_mojo Mojolicious-Plugin-ReCAPTCHAv2-0.02 by HJANSEN https://metacpan.org/release/HJANSEN/Mojolicious-Plugin-ReCAPTCHAv2-0.02
13:08 hahainternet hmm, am i being stupid, how do you get access to $minion from within a job?
13:08 hahainternet sorry, i'll go search better, i'm just distracted like crazy atm
13:08 CandyAngel It's just: $job -> minion
13:09 CandyAngel And no worries, I'm happy to help anyway
13:09 hahainternet lol i can't believe i missed that
13:09 hahainternet wow
13:09 CandyAngel if I can answer your question faster than you can find the answer, you save time and I get my dose of being helpful :P
13:09 hahainternet i was looking for methods, it's in attributes :D
13:10 hahainternet so i guess the only other question i had which i could probably search for is: can i schedule a job at a specific time instead of calculating a 'delay'? i have timestamps with time zones already so might as well use them
13:10 CandyAngel I don't think so. Can't recall any documentation that mentions it
13:11 sri it used to be a timestamp, but people liked the relative delay better
13:11 CandyAngel i think you could also have it so the job checks its own result and if it matches like 'check_email', it does the check instead
13:11 hahainternet hmm, that's a shame, i was hoping for { at => $datetime } or similar
13:12 CandyAngel So you would enqueue 'send_email', it would check result, see it isn't checking and send the email, then $job -> fail ('check_email'); $job -> retry (delay => 5 * 60)
13:12 sri why do you check the other job at all? wasn't the goal to check a log file?
13:12 CandyAngel then on the next loop after sending the email, it would check the logs and finish if it finds itself in there
13:13 CandyAngel next attempt, rather
13:13 hahainternet sri: i just need to be able to inform the client of the email failure and ensure that the job is not retried
13:13 hahainternet passing ids/references to them should be fine though, so i don't think that's a problem
13:14 hahainternet i'd missed that you can just access the minion instance from the job as i was reading the wrong part of the doc
13:14 marty joined #mojo
13:15 sri literally the main example uses $job->app->...
13:15 sri how does that not make it 100% obvious you have access to everything?
13:15 hahainternet sorry i'm trying to catch up on literally tens of thousands of lines of our internal code still and teach a guy
13:15 hahainternet i already apolgised earlier but CandyAngel was kind enough to answer, so we chatted :)
13:16 hahainternet i knew it must be somewhere, but i was reading the Methods section and yeah, a bit too distracted
13:16 sri $job->minion is not even important
13:16 sri $job->app->minion should have been obvious though
13:16 hahainternet anyhow i don't think there's much in the way of problems, i'm a little conflicted on how to handle the delay though
13:17 sri that's the point i was trying to make with the example :S
13:17 sri "just use $job->app-> to access *everything*"
13:17 hahainternet sri: i just didn't read it well enough, it is obvious now but i was just skimming over the manpage because i was fielding questions from someone i'm trying to get up to speed
13:18 hahainternet i know i should have searched better, we were just casually chatting
13:20 anufant Hi. How can I change every text element in my html document using Mojo::DOM? I see in docs that text property is read only? I just see one way - use tree method and then parse tree structure, but i dont't think it's right way :(
13:21 sri http://mojolicio.us/perldoc/Mojo/DOM#descendant_nodes
13:22 sri http://mojolicio.us/perldoc/Mojo/DOM#type
13:24 dotandimet joined #mojo
13:25 CandyAngel sri: Would you then use $dom -> content to change it?
13:27 sri yes
13:27 sri http://mojolicio.us/perldoc/Mojo/DOM#content
13:29 ashimema_ joined #mojo
13:34 good_news_everyon joined #mojo
13:34 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vqkL7
13:34 good_news_everyon mojo/master f43208c Sebastian Riedel: another Mojo::DOM example
13:34 good_news_everyon left #mojo
13:35 sri wish there was a way to make ->grep(sub { $_->type eq 'text' }) a little more pretty though
13:36 sri like turning ->map(sub { $_->content('test') }) into ->map(content => 'test')
13:39 ans joined #mojo
13:39 CandyAngel That's kind of like ummm HTML::Element's look_down
13:39 CandyAngel Which I have to admit, I miss
13:40 nicomen could you perhaps use {}, [], () to distinguish method-dispatch, regexp comparison, and perhaps exact string comparison?
13:42 nicomen or wait wouldn't ->grep( qr/text/ ) and ->grep( 'content' => qr/test/ ) work?
13:46 genio I finally got around to watching the 1st episode of Mr. Robot.
13:47 anufant sri, thank you. I'v done it! I tried the same way 30 minutes before you advice and failed. I don't know what was wrong with my code %)
13:50 zypper joined #mojo
13:50 CandyAngel anufant: I had an experience like that a few days ago. Something didn't work, I made a test case, it worked in the test case.. then the actual code worked :P
13:53 ans1 joined #mojo
13:54 anufant I know what is my issue. I changed my MOJO version from ancient 3.45 to modern 6.12 before second try :)
13:56 CandyAngel That might help :P
14:04 dotandimet joined #mojo
14:06 gryphon joined #mojo
14:09 zivester joined #mojo
14:17 sri hard to believe how badly reddit is managed
14:29 mattastrophe joined #mojo
14:31 Onigiri sri: not really.
14:43 CandyAngel Yay
14:43 CandyAngel I have broken my editor.. cut/copy doesn't work anymore
14:43 dotandimet joined #mojo
14:50 theo joined #mojo
14:56 noganex joined #mojo
14:58 cpan_mojo Mojolicious-Plugin-ReCAPTCHAv2-0.03 by HJANSEN https://metacpan.org/release/HJANSEN/Mojolicious-Plugin-ReCAPTCHAv2-0.03
15:01 Kogurr joined #mojo
15:02 ans joined #mojo
15:28 jberger Oh what's reddit done this time?
15:28 avenj gotten everything they wanted
15:28 avenj everyone does
15:28 jberger Apocalypse Now?
15:28 purl Apocalypse Now is better
15:28 avenj indeed ;o
15:28 jberger botsnack
15:28 purl :)
15:28 jberger avenj++
15:30 jberger Probably my favorite movie of all time
15:30 jberger It's so hard to rank the top few
15:30 avenj yeah, it really is
15:30 avenj but also up there for me, too
15:32 avenj I guess the tldr on reddit is that some apparently-well-liked staffer was canned for not moderating thoughtcrime hard enough or something in a jesse jackson AMA and now everyone is mad?
15:32 avenj from what I can discern anyway, I never use the thing
15:33 jberger hrmmmmm
15:34 pink_mist before I watched 'The King's Speech' I probably would have rated apocalypse now as my favourite movie
15:34 pink_mist now I'm not so sure
15:35 pink_mist (not /only/ because of The King's Speech)
15:38 sri wat?
15:38 purl Watt?  Watt?  I can't hear you, there's this buzzing noise where my brain should be. or https://www.destroyallsoftware.com/talks/wat
15:38 jberger Kings Speech was good, but I don't think it had the same kind of character exposition or symbolism
15:38 sri best movie of all time is of course Blade Runner!
15:39 jberger For me also, to get in the top rung, cinematography and composition has to be there too
15:40 jberger American Beauty, Bridge on the River Kwai
15:41 pink_mist oh, Blade Runner .. I'm glad I hedged my bets by saying "probably" :P
15:43 jberger I loved the cinematography in Benjamin Button, but it doesn't have the story
15:45 jberger I'm one of the few people that loves all the Matrix movies, they work on both levels, but the don't make the cut either on account of too much superfluous hand fighting
15:55 sri the first matrix movie was a masterpiece
15:56 sri guess some would put the shawshank redemption above blade runner
15:56 sri but not me!
16:00 dotandimet joined #mojo
16:00 jberger Shawshank definitely has story and cinematography
16:03 CandyAngel Ohhh, I know why I do whitespace like I do
16:03 CandyAngel Makes $object->method and $hashref->{key} more distinct
16:04 CandyAngel Because, you know.. {} isn't enough :P
16:53 lluad joined #mojo
17:08 PryMar56 joined #mojo
17:27 mattastrophe joined #mojo
17:27 dod joined #mojo
17:33 aggrolite joined #mojo
17:38 trone joined #mojo
17:49 dotandimet joined #mojo
18:13 berov joined #mojo
18:41 noganex_ joined #mojo
18:45 noganex joined #mojo
18:51 mattastrophe joined #mojo
19:06 bin_005 joined #mojo
19:12 ajr_ joined #mojo
19:49 dod joined #mojo
20:49 ajr_ "Ex Machina" is an interesting movie for geeks - a sort of cerebral "Blade Runner"
21:21 CandyAngel I think I am going to look into making this crawler a bit more flexible and release it as a project
21:22 CandyAngel SOmeone else might find it useful
21:40 jberger CandyAngel: what does your crawler do?
21:41 dotandimet joined #mojo
21:41 jberger I know there is at least one on cpan and I have my urlqueue gist that I point to from time to time
21:41 CandyAngel You give it a filesystem path and it crawls it and does stuff depending on content
21:42 CandyAngel Like a directory with images will get a contact sheet created
21:43 jberger Oh a filesystem, cool
21:43 jberger I expected it was for a webpage
21:43 CandyAngel I thought you would have noticed that I use things in weird ways by now ^_^
21:45 jberger CandyAngel: have you looked at my cpan author list ?!
21:45 CandyAngel ?
21:45 jberger Once sri mentioned to someone that if jberger even thought it was crazy, it really must be
21:45 CandyAngel :P
21:45 jberger I wish I had that irclog link
21:46 CandyAngel Aw
21:47 mst similar to 'if sri and mst actually agree for once, listen carefully'
21:50 jberger Ha!
21:50 jberger http://irclog.perlgeek.de/mojo/2014-01-26#i_8178303
21:51 jberger mst: that's a good one too, but with a different, if related, purpose
21:51 CandyAngel :P
21:53 CandyAngel Hm
21:56 jberger Oh I remember that, we were debating &{} overloading on the controllers to mean ->render
21:56 jberger Probably an ok leave, I haven't missed it
22:00 jberger On further reading/remembering, after $_ in ojo, we were trying to make tweetable one-liners easier :0
22:00 jberger :p
22:01 CandyAngel Tweetable one-liners..
22:02 jberger ojo one-liners in less than 140 characters
22:03 jberger Less if you want to get the hashtag in
22:03 CandyAngel #jbycdmys?
22:04 CandyAngel Or "jibby dimmys"
22:12 CandyAngel Oh, that's a thing
22:12 CandyAngel keeping a DOM object in a collection does not mean it keeps everything else
22:12 CandyAngel >.<
22:31 jberger oh sad, I can't use g() nonblocking
22:31 jberger sri: FEATURE REQUEST!!!
22:34 punter joined #mojo
22:38 CandyAngel Is there any way to stop the rest of the DOM tree vanishing or do I need to keep a reference to the root to stop that?
22:43 jberger it doesn't vanish
22:44 jberger you can call parent for exampel
22:44 jberger or root
22:51 CandyAngel If I call parent, I get undef for everything except the ones where I still have the $tx object..
22:52 jberger oh, you have to hold on to the $tx object
22:52 jberger this is async?
22:53 jberger client or server?
22:53 jberger client I suppose
22:53 jberger need to hold a reference to the $ua too
22:53 CandyAngel Yeah
22:53 CandyAngel It's a passthrough thing, it grabs pages from a website and presents them in a different format
22:53 CandyAngel One of them, it iterates over pages to get all of the items
22:54 CandyAngel But I went to call 'parent' at the end, but only the last page had the parentage
22:56 jberger wait, what?
22:56 purl yeah, seriously
22:56 jberger thanks purl
22:57 CandyAngel Not sure what the "wait what" is to :P
22:58 jberger "last page"
22:58 jberger if you extract all the dom objects for each page after receiving them, why does the $tx matter?
22:58 btyler anyone have suggestions on where to start digging if I'm trying to embed in an AE application and $daemon->start doesn't result in an open listening socket (according to ss)? MOJO_DAEMON_DEBUG and MOJO_IOLOOP_DEBUG are both quiet
22:58 jberger dom objects don't know anything about a $tx
22:59 btyler (basically doing the final example in http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#Event-loops)
22:59 bpmedley btyler: What is an AE application?
22:59 btyler anyevent
22:59 purl anyevent is just Any Event or not unique (see: http://search.cpan.org/search?query=POE%3A%3ALoop&amp;mode=module) or a giant bag of dick waving maintained by an asshole
22:59 btyler I've successfully done non-blocking calls with Mojo::UA without any special trickery
22:59 btyler but I can't get a socket open to serve web requests on
23:00 jberger "a giant bag of dick waving maintained by an asshole" ahhahahahahahaha
23:00 CandyAngel I don't know, I just know that something is causing $item->parent to be undef for everything that isn't the latest ua->get
23:02 damaya joined #mojo
23:02 jberger CandyAngel: we are to the point where I doubt anyone can help without seeing some code
23:03 btyler amendment to previous statement: $daemon->start _does_ open a socket (otherwise things would have croak'd), but something is closing it right away.
23:03 * btyler hunts deeper
23:03 bpmedley btyler: The example works for me.  I get a "Hello World".
23:03 btyler yes, not at all questioning the example
23:04 bpmedley btyler: I see.  Do you have a smallish example that shows the issue?
23:04 btyler just trying to figure out how to debug
23:06 btyler bpmedley: yes and no. my code is short, but it interacts with a big hairy AE app: https://github.com/Yaribz/SPADS (which wraps AE with https://github.com/Yaribz/SimpleEvent) -- the problem is somewhere in the interaction, and there's way too much code involved for me to ask anyone to hunt
23:07 bpmedley You might consider Devel::Trace
23:07 btyler oooh, cool
23:11 jberger argh, I was trying to make a non-blocking ojo one-liner and I figured out that you can't use $_ in delay callbacks as the controller, because the $_ magic is local to the dispatch
23:16 CandyAngel It's not a big problem, I just put everything I want in the collection in the loop, rather than post-processing it out
23:35 zivester joined #mojo
23:41 jberger hehe, hacking on ojo.pm I caused three deep recursion warnings and a segfault!
23:42 CandyAngel Sounds familiar. Totally didn't do that a log writing OpenHMD::Inline :|
23:42 CandyAngel do that a lot*

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