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

IRC log for #mojo, 2015-07-01

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

All times shown according to UTC.

Time Nick Message
00:25 aggrolite joined #mojo
00:36 Grinnz joined #mojo
00:48 zackiv31 joined #mojo
01:09 DaniBunny joined #mojo
01:11 zackiv31 joined #mojo
01:29 hshong joined #mojo
01:44 jberger forget sure.
01:45 purl jberger: I forgot sure
01:45 jberger forget sure.
01:45 purl jberger, I didn't have anything matching sure
01:45 jberger Hmmm
01:46 jberger CandyAngel: make a minimal example because you def can use a nonblocking helper
01:59 aggrolite joined #mojo
02:01 bpmedley joined #mojo
02:04 noganex joined #mojo
02:10 bpmedley Woohoo.. I think I'll be able to play Heart of the Swarm without stuttering now.. :)   I got a Radeon 7950.
02:15 aggrolite joined #mojo
02:25 dave__ joined #mojo
02:45 ans joined #mojo
02:55 ans joined #mojo
03:20 ans joined #mojo
03:47 ans joined #mojo
04:07 zivester joined #mojo
04:13 lluad joined #mojo
04:39 aggrolite joined #mojo
05:06 kaare joined #mojo
05:10 irq joined #mojo
05:21 disputin joined #mojo
06:42 dotandimet joined #mojo
07:18 trone joined #mojo
07:21 Vandal joined #mojo
07:22 arpadszasz joined #mojo
07:30 AndrewIsh joined #mojo
07:45 amon joined #mojo
07:50 lluad joined #mojo
07:51 CandyAngel jberger: http://codepad.org/j3Plbtvg
07:53 CandyAngel jberger: I have a feeling I am going about it the wrong way (also, I'm running that with morbo)
07:55 ans1 joined #mojo
07:56 CandyAngel jberger: Also, I just realised that you are the person that writes the blog where I have to 'Select All' to read it :P
07:59 bc547 joined #mojo
07:59 dod joined #mojo
08:00 * CandyAngel facepalms
08:00 purl facepalms are certainly another important measure
08:00 CandyAngel I'm sorry, I've no idea why I thought that would even work
08:01 CandyAngel jberger: Ignore me, I'm being an idiot
08:03 dod joined #mojo
08:13 marcusr :D
08:15 CandyAngel Hmm
08:15 CandyAngel The other way doesn't do what I want either
08:15 CandyAngel http://codepad.org/6J7mUhRN
08:16 CandyAngel Basically, I am looking for the helper to make a non-blocking request, then return a value to be used by the route-action-thing
08:16 CandyAngel But the non-blocking thing I am doing just makes the helper return nothing (or a job id or something)
08:18 bc547 joined #mojo
08:24 CandyAngel I guess I have to do the rendering in the helper
08:24 CandyAngel Soooo.. one helper to do the request/rendering, which uses another helper to actually parse out the data?
08:25 CandyAngel (by passing it $tx -> res -> dom) would be the way to go
08:32 jontaylor joined #mojo
08:48 marcusr async is hard, let's go shopping.
08:48 marcusr https://s-media-cache-ak0.pinimg.com/736x/b4/ca/a1/b4caa15aed00066220110776a113ed29.jpg
08:52 CandyAngel marcusr: The only thing I am interested in going shopping for is a new CPU :P
08:52 CandyAngel I want one with VT-d so I can run Xen
09:13 bpmedley CandyAngel: Did you get your stuff working?
09:18 lluad joined #mojo
09:18 batman CandyAngel: no idea where you got that "syntax" from. it looks very weird
09:19 batman CandyAngel: have you looked at this? https://metacpan.org/pod/distribution/Mojolicious/lib/Mojolicious/Guides/Cookbook.pod#Synchronizing-events
09:19 batman or just this whole chapter https://metacpan.org/pod/distribution/Mojolicious/lib/Mojolicious/Guides/Cookbook.pod#REAL-TIME-WEB
09:30 CandyAngel bpmedley: I haven't tried my latest idea of having rendering in the helper
09:41 bpmedley CandyAngel: Can we help?  I'm not sure what your goal is...
09:44 CandyAngel batman: What's wrong with the syntax? I pretty much copied it from one of the Mojo documents :|
09:44 * CandyAngel tries to find it again
09:45 marcusr candyangel: I want a lot of crap :)  http://amzn.com/w/3GI52MF8WFU05
09:46 marcusr Trying to decide what to order for pickup in Portland this summer.
09:46 CandyAngel bpmedley: My goal is to call a handler from a route action(?) which fetches and parses a web page (and returns a value) that the action then passes to the template
09:46 bpmedley CandyAngel: Do you want it to be async?
09:46 CandyAngel But also goes and handles other requests or something while it is fetching it
09:47 CandyAngel marcusr: Oh yeah, I also want a (bigger) quadcopter. I have a Hubsan X4 (well.. 2 broken ones) but it can't lift much
09:48 CandyAngel marcusr: Also, I don't know which CPU to get. Just one that has VT-d, is better than the i5-2500K and works in the Z68 Extreme4 motherboard :P
09:48 CandyAngel bpmedley: I can't see how to do this without just doing 'render_later' and doing the rendering in the async callback bit
09:49 marcusr CandyAngel: This drone looks amazing http://www.wired.com/2015/04/3dr-solo-drone/
09:49 marcusr I don't know much about cpus anymore. Mostly buying laptops =]
09:50 CandyAngel marcusr: Indeed it does
09:51 CandyAngel For now though, I just need to replace my Hubsan motors :)
09:51 marcusr I think maybe the i7 in my mbpr supports vT-d anyways.
09:53 Adurah Is it the overclockable ones that don't do virtualization support...
09:53 CandyAngel Adurah: Yeah
09:54 Adurah Silly...
09:54 purl somebody said silly was good
10:02 arpadszasz joined #mojo
10:11 bpmedley CandyAngel: https://bitbucket.org/snippets/bpmedley/5y6pG <-- how is this?
10:15 CandyAngel bpmedley: That isn't using a helper (the fetch/parsing is common between different routes)
10:16 CandyAngel Which is why I don't want to put the render code in the helper
10:19 CandyAngel I think I just need 2 helpers though
10:19 CandyAngel I could pass in the aysnc callback from the action..
10:19 bpmedley https://bitbucket.org/snippets/bpmedley/5y6pG <-- Is this closer?
10:19 CandyAngel So I have one helper which parses the DOM (and returns the info) and one that takes a callback and does the get
10:20 bpmedley Are the routes in different packages?
10:20 dod joined #mojo
10:20 bpmedley Interesting.  Sounds like a delay would be helpful; although, I am no expert.
10:21 CandyAngel bpmedley: No, this is still a ::Lite thing
10:21 bpmedley Would you consider a delay?
10:22 CandyAngel Yeah, I thought $delay -> wait, would go back to letting morbo handling requests and then just resume the once the callbacks were done
10:22 CandyAngel But it didn't do that for me, the code just immediately carried on
10:23 CandyAngel (that's the one that batman said the syntax was weird)
10:24 bpmedley https://bitbucket.org/snippets/bpmedley/5y6pG  <-- Thoughts?
10:24 batman CandyAngel: wait doesn't do anything if the ioloop is running https://metacpan.org/pod/Mojo::IOLoop::Delay#wait
10:24 batman CandyAngel: "...does nothing when ioloop is already running"
10:25 batman CandyAngel: i've beenw where you are many times. often it's a good thing to step back and start over with a new guide...
10:25 batman but that's up to you of course.
10:26 batman btw: https://bitbucket.org/snippets/bpmedley/5y6pG looks very good
10:26 batman except that there's no such thing as "$shift"
10:26 bpmedley Moment
10:26 bpmedley Please reload.
10:26 batman uset the cookbook! https://metacpan.org/pod/distribution/Mojolicious/lib/Mojolicious/Guides/Cookbook.pod#Synchronizing-events
10:27 batman *use
10:27 batman :(
10:27 bpmedley What's wrong with my latest example?
10:28 batman or even the tutorial: https://metacpan.org/pod/distribution/Mojolicious/lib/Mojolicious/Guides/Tutorial.pod#User-agent
10:28 batman https://bitbucket.org/snippets/bpmedley/5y6pG # still has $shift
10:28 bpmedley Please refresh.
10:28 batman i did. many times.
10:29 CandyAngel The guides are showing me how to do the thing I'm trying to avoid doing (putting the render call in the helper)
10:29 batman CandyAngel: which guide?
10:29 purl which guide are you referring too? Im looking, dont see it
10:29 bpmedley Odd, it's showing the latest for me.  Which does not have the unfortunate "$shift".
10:29 batman CandyAngel: just make the helper take $cb ($delay->begin) and call that when you're done.
10:30 batman CandyAngel: a helper is just a method. $app->helper(foo => sub { my ($c, $url, $cb) = @_; $ua->get($url => $cb); });
10:31 batman that foo() helper doesn't have $c->render. it just calls a callback when done.
10:31 CandyAngel And then have another helper that parses the DOM that $cb can use?
10:31 batman example $cb = sub { my (undef, $tx) = @_; $c->render(json => $tx->error || {}); };
10:31 batman CandyAngel: sure. if you like.
10:32 batman but _only_ make a helper if you use it multiple times or has many lines of code.
10:33 batman $c->delay(sub { .... }, sub { .... }, sub { .... }, sub { $c->render(text => "wohooo!"); }); # <--- this makes sense without helpers, if each sub has little code.
10:33 batman but if it has 1000 lines of code, you probably have a bad design.
10:33 CandyAngel :P yeah
10:33 CandyAngel It's like umm
10:33 batman design...? hard to read code...? (something like that)
10:33 hahainternet i assume i'm ok asking questions about minion in here too, i'm trying to find if there's an inbuilt mechanism for limiting the number of running background tasks
10:34 hahainternet we have a job queue system where sometimes a couple hundred big jobs are queued for the same time
10:34 CandyAngel Say for example, I want to fetch Google results
10:34 batman CandyAngel: but we can't help you with that. write the easy sub {}, .... sub {}, ... thing first, en then factor out.
10:34 bpmedley hahainternet: I believe one minion will run one job at a time.
10:34 bpmedley Is that the question?
10:34 CandyAngel And I want /search/:query to give a html page of formatted results
10:35 hahainternet bpmedley: ideally i'd like 4 at a time
10:35 CandyAngel But want /api/search/:query to give a JSON version or something
10:35 bpmedley hahainternet: Perhaps by running 4 at a time?
10:35 CandyAngel So I have a helper which parses the DOM and returns an array of results
10:35 CandyAngel Which both those routes can use
10:35 batman CandyAngel: https://metacpan.org/pod/Mojolicious::Controller#respond_to
10:36 bpmedley hahainternet: I believe you can run 4 minions at once.
10:36 hahainternet bpmedley: right you're saying each minion /worker/ will run one job
10:36 hahainternet sorry i was confused there
10:36 bpmedley I believe so.
10:36 CandyAngel But if I want to async them, the docs tell me to put the render code in the helper (which I can't, because 2 formats)
10:36 hahainternet ok glad it's that simple, i wasn't sure if there was a fork/exec
10:36 bpmedley hahainternet: Do you have time to try it?
10:36 hahainternet bpmedley: i'll let you know, it's for a colleague and i'm chatting with him remotely
10:36 batman CandyAngel: or just do get("/api/search/:query", [format => 'json'], => \&cool_function); get("/search/:query" => \&cool_function);
10:37 * batman have to run
10:37 CandyAngel Okies
10:37 CandyAngel batman: Thanks for your input :)
10:37 batman CandyAngel: but it's ok to make a mess before understanding how to structure the code.
10:38 batman whenever you feel it's a mess, then figure out how to restructure.
10:38 CandyAngel Mhm
10:38 batman doing the other way around is probably just wasting time.
10:38 batman (and after a while you get the magical feeling when to do it first)
10:38 hahainternet bpmedley: i also have to see what happens if i crash a worker
10:39 bpmedley hahainternet: My understanding is that the queue is geared to be resilient to crashes.
10:40 CandyAngel hahainternet: As far as I am aware, the queue will remain consistent, but if the worker interfaces with something else, that something else may not be (same as if you were doing it independently)
10:40 CandyAngel Not sure if a crashed minion fails a job though (I would imagine so)
10:41 arpadszasz joined #mojo
10:42 hahainternet CandyAngel: failing a job is fine, the question is keeping the worker around really
10:42 bpmedley https://github.com/kraih/minion/blob/master/lib/Minion/Command/minion/worker.pm#L42 <-- This may be what your looking for.
10:43 bpmedley Oh, right.  A worker supports max number of concurrent jobs: https://metacpan.org/pod/Minion::Command::minion::worker
10:49 bpmedley CandyAngel: Did you finish your code?
10:50 CandyAngel The aync one?
10:50 CandyAngel async*
10:50 bpmedley Yip
10:50 CandyAngel Not yet
10:51 bpmedley When you do, I'd love to see it.
10:51 CandyAngel The whole thing or just async helpers?
10:52 bpmedley Probably not the entire thing.  Maybe a smallish route and the helpers.
10:52 CandyAngel And if "the whole thing", which one? I have several Mojolicious projects on the go :P
10:52 CandyAngel Okiedokie
10:52 CandyAngel I can make a little example
10:53 CandyAngel Gives me something to post on my blog once the platform is written :P
10:53 bpmedley May I ask what you're working on?
10:54 CandyAngel One is a filesystem crawler that using Minion and manually-started jobs
10:54 bpmedley Oh; write, you're picture processor.
10:54 bpmedley *right
10:54 CandyAngel not just pictures, but yeah
10:55 CandyAngel And I have a wiki viewer (uses Text::WikiCreole)
10:55 bpmedley What OS does the crawler support?
10:55 CandyAngel It'll run on anything Mojo will run on I think
10:55 bpmedley Sweet
10:55 CandyAngel There isn't any OS specific code
10:56 CandyAngel I have a cool personal wiki setup and I have Mojolicious provide a web (read only) UI to it
10:56 CandyAngel Which is displayed on my kindle
10:56 bpmedley Is it a public URL?
10:56 CandyAngel No, just local text files
10:57 CandyAngel I use Leo (http://leoeditor.com/) and its @clean nodes to make some text files in Creole format
10:57 CandyAngel I use Meld to sync them to my phone, on which I use Wikimind
10:57 CandyAngel (Android)
10:58 CandyAngel And Mojo with the Kindle display, as I mentioned
10:58 CandyAngel Normally showing my Next Actions (Getting Things Done method thing)
10:58 bpmedley Sounds cool from a tech perspective.  Your writing a personal organizer?
10:59 CandyAngel But it has a list of my digital assets (games, music) too
10:59 CandyAngel And my inventory
10:59 bpmedley That's cool.
10:59 bpmedley https://metacpan.org/pod/PAR <-- Have you seen this?
11:00 CandyAngel So if I want like.. a SATA-USB adapter, I can just: grep 'sata' ~/wiki/storage/ | grep 'usb'
11:00 CandyAngel And it gives me the UUID of the container it is in
11:00 CandyAngel I have, yeah
11:00 CandyAngel Not used it yet though
11:01 CandyAngel Not so much writing a personal organiser, but building one of a lot of different tools
11:01 bpmedley Might be useful to someday make your project publicly available.
11:01 CandyAngel It was solely kicked off by Wikimind using plaintext files!
11:03 bpmedley Sounds cool
11:06 ashimema joined #mojo
11:07 eitz joined #mojo
11:10 CandyAngel ugh, the pains of using Excel for things it isn't supposed to do
11:10 CandyAngel I have a race condition where if two people try to do the same thing, it silently loses ones
11:10 CandyAngel one*
11:11 bpmedley Race conditions are tough to debug.. gaw
11:11 CandyAngel It writes some information into another file
11:12 bpmedley Can you flock the file?
11:13 CandyAngel I don't know, I'm opening it asa a database
11:13 bpmedley DBI?
11:13 purl i heard DBI was not documented in DBIx::Class
11:13 CandyAngel No, from Excel
11:13 CandyAngel If this was Perl, it'd work properly :P
11:14 bpmedley Oh wow.  You're using a hammer to open a door.. ;)
11:14 CandyAngel A hammer would be more effective
11:14 CandyAngel This is like using silly putty to open a door
11:14 bpmedley lol
11:14 CandyAngel If it works, it is serendipitous
11:21 kyshtynbai joined #mojo
11:24 CandyAngel Unfortunately, it has gone from 2 people using that bit of functionality to about 14 people :|
11:25 CandyAngel You know, if i was allowed to use Mojolicious, I could just make Excel submit the data to that, and fetch the data from that :|
11:25 CandyAngel And it would be fine!
11:26 CandyAngel Or ermm.. maybe I could make it run code that adds it as a job to Minion :P
11:26 CandyAngel And a worker updates the data file :P
11:29 bpmedley Excel is sometimes an albatross
11:51 irq joined #mojo
12:04 sri does everybody but me have a quadcopter already? :S
12:06 marcusr sri: How else would you get your takeaway burriots?
12:06 marcusr BURRIOT!
12:13 jontaylor I built a quad from scratch, got it right here in the office :p
12:15 neilhwatson joined #mojo
12:16 punter joined #mojo
12:16 dod joined #mojo
12:17 batman Lee: do you mean documentation or an actual html document?
12:17 Lee html documentation
12:17 Lee a la http://editor.swagger.io/#/
12:18 batman Lee: mojo swagger2 pod api.json > foo.pod; pod2html foo.pod > foo.html
12:19 Lee right
12:19 batman Lee: that's why i focused on pod output, since you can convert it to pretty much anything.
12:19 Lee yeah
12:19 Lee i'll probably go with swagger-ui
12:19 zivester joined #mojo
12:19 batman i mostly use a pod renderer directly or convert it to pdf so i can email it around...
12:20 bwf joined #mojo
12:20 batman swagger-ui was awful when i started out with this (almost a year ago). not sure how it looks now.
12:20 batman it was nice if you didn't use $ref
12:20 Lee hmm
12:21 Lee this will be end-user facing so needs to be pretty(ish)
12:22 Lee 127 github issues... hmm
12:22 batman doesn't need to mean anything. popular projects will have a lot of issues :/
12:23 batman at the time i created mojo swagger {editor,pod} i put readability over pretty
12:23 batman meaning i wanted it to be as easy as possible to read the doc like a manual. not jumping back and forth to look at definitions :/
12:23 batman but swagger-ui is nice for testing a public api.
12:24 batman Lee: have you tried "mojo swagger2 editor spec.json" ?
12:24 Lee no, not yet
12:24 batman sorry. i meant "edit" not "editor"
12:25 batman the way i do it, is that i generate pod and then make mojo render it pretty for me :)
12:25 batman but there's a lot of alternatives.
12:29 batman Lee: if you have some extra time, i would really like to have Swagger2::Markdown :)
12:29 batman it would render pretty tables, instead of the ascii thing i have now
12:30 batman it's a bit weird, but no-one has ever commented on the ascii tables, hehe
12:30 batman and i've sent the generated pdf to java devs ;)
12:31 Lee i'll have a play around
12:32 Lee we're in the early stages of the API so i'm still figuring out what is required and such
12:35 batman if you don't require interactive, i would try "mojo swagger pod" + Mojolicious::Plugin::PODRenderer
12:35 batman it's the absolute most simple thing you can do (imo)
12:37 ajr_ joined #mojo
12:37 Lee ta!
12:41 batman you're welcome. let me know if something is messed up :)
13:00 jberger CandyAngel: sorry I disappeared last night
13:00 jberger Did you get the async working?
13:01 jberger batman was right, if your async helper don't take a callback then you aren't likely to be doing it right
13:02 CandyAngel jberger: No worries. I'm writing an example of for bpmedley of how I am going to do it
13:03 CandyAngel Providing the new plan works :P
13:09 jberger ?
13:14 gtodd joined #mojo
13:17 jberger I'm reworking the second example you sent me now
13:18 CandyAngel jberger: If you put the rendering in the helper, that's not what I was aiming for :P
13:18 jberger nope
13:18 CandyAngel Ooo
13:18 ashimema in a mojo full app.. where do i need to call 'push @{$commands->namespaces}, 'MyApp::Command';' to add my local commands?
13:19 ashimema I have it within my startup sub.. but it's not currently picking them up.. wondered if anyone here had any advice
13:21 joelb joined #mojo
13:24 Grinnz delay helper, that's what you want
13:24 Grinnz @ CandyAngel
13:24 jberger ashimema: your commands must be then in lib/MyApp/Command/ and have to have a package name that agrees and have to inherit from Mojolicious::Command
13:24 jberger Grinnz: yes, but that doesn't help with the helper
13:25 Grinnz who helps the helper?
13:29 CandyAngel OKay
13:29 CandyAngel I think I have my example
13:33 CandyAngel bpmedley: http://codepad.org/Q9woDUpB
13:33 CandyAngel This is what I wanted to do
13:33 jberger CandyAngel: http://pastie.org/10268148
13:33 CandyAngel Rendering code is still in the routing
13:33 CandyAngel But there is only one handler for parsing the information
13:34 jberger CandyAngel: try mine without the max_redirects and you see what happens on failure
13:35 jberger since there is a redirect there
13:36 * jberger will be back
13:36 CandyAngel Hmmm
13:37 eitz Guys, i'm having trouble adding a new folder that templates can be loaded from. Actually, the folder is correctly added to ->paths but mojo still can't find the template. If a do a "say join '  ', @{$c->app->renderer->paths}; directly above the render, it shows the two folders, but still 404'd on the template that is in the second folder. Is there anything that I should do for that to work?
13:37 CandyAngel From first glance, jberger's keeps it to one helper but I find it much harder to follow than mine
13:39 sri your use of whitespaces around the arrows makes me nauseous
13:40 CandyAngel sri: Oddly enough, you're not the first person to comment about my whitespacing today :|
13:40 jberger I commented implicit by changing it all
13:40 jberger :p
13:40 CandyAngel You're not the first either jberger
13:41 CandyAngel The other Joel I know was :P
13:41 jberger You don't need to "follow" mine, it's almost just a paradigm to repeat
13:41 jberger Aaaaaah too many Joels!
13:42 CandyAngel 09:54 <Moogle> Not juuust that. I just noticed the spacing you used in: $ua -> get ($url, $callback);
13:42 CandyAngel :P
13:42 sri when you can say stuff like "you're not even the first joel to complain about my coding style today"... you might want to rethink some things ;p
13:42 CandyAngel :P
13:42 jberger Hahaha
13:42 CandyAngel I'm open to changing my ways
13:42 CandyAngel By Joelcree
13:43 sri but seriously, where do all those joels come from?
13:43 CandyAngel I have no idea!
13:43 jberger I for one can't handle it
13:43 CandyAngel I knew none for ages, then I met my Joel (so you know which I am talking about)
13:43 CandyAngel Then only knew him for ages
13:43 CandyAngel Now there are 11 of them in my IRCles
13:44 CandyAngel >.<
13:48 CandyAngel So how come you don't do whitespace like I do
13:48 CandyAngel Aside from it making you feel sick because that doesn't apply to me :P
13:48 * sri 's style can be summed up as https://github.com/kraih/mojo/blob/master/.perltidyrc
13:52 absolut_todd joined #mojo
13:52 genio my eyes don't work well enough for 2 space indents.
13:53 * notjoel buys genio glasses
13:55 sri you have a phd in lasers, just fix his eyes! ;p
13:56 wingfold joined #mojo
13:56 genio I tried that once.  They fucked up and it took physical intimidation to get my money refunded
13:56 sri eeeep
13:56 genio my eye was swollen and bruised for 2 weeks
13:57 genio so, I'll gladly continue with contacts and glasses.  Those guys can keep their lasers away from my eyes, thank you!
13:57 ashimema hmm..
13:57 ashimema that's what i've got jberger..
13:57 ashimema as far as I can tell..
13:57 ashimema just going to double check before digging out the pastbin
13:58 ashimema to ask if anyone can see through my code blindness ;)
13:59 notjoel genio: :o
13:59 genio sri: The doctor didn't decide to give my money back until my rather large brother came to pick me up.  He kept trying to say that they would be able to complete the surgury the next day, etc. and that I just needed to be patient and that this problem happens to them at least once per week
13:59 notjoel Also my laser would just blow eyes up
14:00 disputin joined #mojo
14:00 stephan48 notjoel: also fixed the problem. just a bit differently
14:01 stephan48 fixes*
14:01 notjoel Hehe
14:01 genio I was pissed and half-way yelling at the guy that I was done and that I had travelled over 2 hours to get it done and wouldn't be able to make it another time.  My brother walks in, hears me yelling, sees my messed up eye, so he's automatically pissed and ready to hurt someone.  The doctors own eyes grew to about 3 times their normal size at the site of my brother and he immediately had his receptionist go through the refund process and went ...
14:01 genio ... back into his office to hide behind the door.  The people in the waiting room got pretty nervous at that point and I'm sure he lost some business that day
14:02 notjoel genio: is your eyesight at least as good as it was?
14:03 notjoel meaning, hopefully you didn't end up worse than before
14:03 genio I went to the opt. several times afterwards and there doesn't appear to be any lasting damage.  Just pain and swelling for a couple of weeks
14:05 genio I'm around 6' and 200lbs.  So, I'm a fairly average sized guy.  He was nervous talking to me, but not fearing his life.  My brother is around 6'4" and 260lbs.  I'm still pissed that it took that to get my refund.
14:05 jberger CandyAngel: https://www.youtube.com/watch?v=UGufeknRHjQ
14:06 gtodd joined #mojo
14:07 * jberger wishes he could go back and fix the presentation framework to my new one
14:10 CandyAngel I shall watch it when I get home
14:11 CandyAngel I will try the method you did because it means not having double the number of helpers *nodnod*
14:11 ToApolytoXaos joined #mojo
14:12 CandyAngel Err
14:12 CandyAngel The method you demonstrated
14:14 jberger The only other comment about that video is that the delay helper didn't exist yet
14:14 stephan48 g34
14:14 jberger In fact the seeds of it started the next day at the hackathon
14:17 absolut_todd joined #mojo
14:18 ashimema remind me.. where is the mojo channle pastbin?
14:18 genio Basically, any site that isn't laden with ads like pastebin.  gist.github.com works
14:18 ashimema I was sure there was one actually linked to in the motd a while back though..
14:19 ashimema but gist will do ;)
14:19 ashimema found it :)
14:21 shadowpaste "ashimema" at 217.168.150.38 pasted "commands confussion /lib/Rebus/Command/preference" (30 lines) at http://paste.scsys.co.uk/491655
14:23 shadowpaste "ashimema" at 217.168.150.38 pasted "/lib/Rebus.pm" (14 lines) at http://paste.scsys.co.uk/491657
14:23 gtodd joined #mojo
14:23 ashimema anything obviose I'm getting wrong?
14:26 jberger ashimema: does you module work with perl -c ?
14:26 jberger perl -c lib/Rebus/Command/preference.pm
14:27 ashimema balls.. syntax error.
14:28 ashimema fixed the.. lets try via mojo
14:28 ashimema nope..
14:28 jberger via mojo?
14:28 ashimema so 'perl -c' gives 'Syntax OK'
14:28 jberger rebus preference
14:29 jberger mojo preference won't work
14:29 ashimema but './rebus preference' gives 'Unknown command "preference", maybe you need to install it?'
14:29 ashimema where rebus is my startup script.
14:29 jberger right
14:30 shadowpaste "ashimema" at 217.168.150.38 pasted "for clarity.. my app script" (11 lines) at http://paste.scsys.co.uk/491659
14:30 ashimema last paste for clarity.. in case I've got that bit of the puzzle somehow wrong ;)
14:31 jberger that's in the root or in bin/ or script/ or something?
14:31 ashimema in script/
14:32 jberger typoed the filename perhaps?
14:32 jberger lib/Rebus/Command/preference <--- .pm?
14:32 ashimema no pm present
14:32 jberger needs pm
14:34 jberger even though its a lowercase name for consistency with command names, it still is a proper perl module and "require" has to be able to find it
14:34 ashimema ack..
14:34 ashimema I see..
14:34 ashimema thanks.. I'm a muppet
14:34 mattastrophe joined #mojo
14:34 jberger nah, it took me that long to see it
14:36 ashimema I blame the heat.. not used to these summer days in the UK ;90
14:36 jberger hot in the UK? that's rare
14:37 CandyAngel It's 22C (71F) here
14:37 ashimema 34C here..
14:37 jberger we just can't get it to stop raining in Chicago
14:37 jberger perhaps we traded climates!
14:37 CandyAngel Melty
14:37 ashimema poor pc is sitting at 56C for cpu temps
14:38 ashimema so my office is probably not all that far behind.. not worth buying myself air con for the few days we get ;)
14:39 harry joined #mojo
14:41 CandyAngel That just reminds me of a few months ago
14:41 CandyAngel "Just noticed my GPUs are running at 96C and have been for a year and a half. That means it must be fine! .. right?"
14:41 CandyAngel I have strange friends
14:41 ashimema lol
14:47 Grinnz_ lol
14:52 kyshtynbai joined #mojo
14:53 disputin joined #mojo
14:54 ashimema ack.. no I get Mojo::JSON vs JSON collisions due to DBIC using an alternative module for json encode/decode
14:55 ashimema what fun we have..
14:57 ivan_ joined #mojo
14:57 ashimema Is Mojo::JSON::MaybeXS still the recommended module in this game?
14:57 gtodd joined #mojo
14:57 Grinnz_ use that and JSON::MaybeXS, yea
14:57 sri yes
14:57 Grinnz_ don't use JSON.pm, it's pretty bad...
14:59 ashimema brill.. cheers..
15:00 nicomen what about mst's chants for CPanel?
15:00 ashimema Yup.. been aiming at making the switch to cPanel::JSON::XS for a while..
15:00 Grinnz_ JSON::MaybeXS does that for you
15:00 nicomen aha
15:00 Grinnz_ it only uses JSON::XS if it's already loaded and the Cpanel fork isn't
15:01 ashimema MaybeXS will 'choose the right one' depending on whats installed on your system though.. so hopefully as the dbic serialixre module also uses MaybeXS internally they'll choose the same thing ;)
15:01 ashimema so my problem should be solved :)
15:01 Grinnz_ if it uses MaybeXS, then yeah it will
15:01 sri talking about Cpanel::JSON::XS... please +1 this :) https://github.com/rurban/Cpanel-JSON-XS/issues/37
15:01 sri for better Mojo::JSON compatibility
15:03 ashimema :)
15:03 ashimema that would be coolios.
15:05 nicomen how does one +1 that?
15:11 CandyAngel -.-
15:12 CandyAngel One of my biggest Excel spreadsheets is just crumbling today
15:12 * CandyAngel wants to delete it
15:15 jberger sri: I'm a little hesitant to join a flood of +1s after that incident with the syntax highlighting that dotan did
15:16 fahad|psem joined #mojo
15:17 fahad|psem hi, using `Mojo::UserAgent->get($url=>sub{...})` how do I custom set a header?
15:19 jberger fahad|psem: ->get($url => { HeaderName => 'Header Value' } => sub { ... })
15:19 sri jberger: i think that was a success, we learned that the maintainer is unstable
15:19 fahad|psem thanks!
15:22 sri marcusr: spider brawl!
15:26 fahad|psem left #mojo
15:30 jberger marcusr, batman, any ansible user: how are you installing perl dependencies
15:31 jberger it seems that the core-ish cpanm can't handle cpanfile
15:31 jberger cpanm handler I mena
15:32 disputin joined #mojo
15:44 seba joined #mojo
15:59 cpan_mojo API-Wunderlist-0.03 by AWNCORP https://metacpan.org/release/AWNCORP/API-Wunderlist-0.03
16:00 lluad joined #mojo
16:02 cpan_mojo API-Trello-0.03 by AWNCORP https://metacpan.org/release/AWNCORP/API-Trello-0.03
16:03 gryphon joined #mojo
16:03 disputin joined #mojo
16:07 cpan_mojo API-Name-0.03 by AWNCORP https://metacpan.org/release/AWNCORP/API-Name-0.03
16:07 seba joined #mojo
16:08 cpan_mojo API-Stripe-0.03 by AWNCORP https://metacpan.org/release/AWNCORP/API-Stripe-0.03
16:09 cpan_mojo API-Github-0.03 by AWNCORP https://metacpan.org/release/AWNCORP/API-Github-0.03
16:09 cpan_mojo API-Basecamp-0.03 by AWNCORP https://metacpan.org/release/AWNCORP/API-Basecamp-0.03
16:09 seba Hi, anyone here willing to help/participate in Mojo::IOLoop based RabbitMQ client development? If so, please take a look at: https://github.com/InWayOpenSource/mojo-rabbitmq-client
16:14 ToApolytoXaos joined #mojo
16:22 aggrolite joined #mojo
16:22 irq joined #mojo
16:31 gtodd joined #mojo
16:32 sh4 joined #mojo
16:41 Dandre left #mojo
16:58 dotan jberger: +1 that (not plusspamming).
16:58 jberger dotan: o/
16:59 sri bullshit!
16:59 sri if there's a feature request in the mojolicious repo, i want to see +1s
17:00 sri (and -1s)
17:00 sri if you want a feature, you actually have to say so
17:00 sri or it might just not happen
17:03 sri the highlight.js maintainer is clearly just a jerk, since he didn't even make a CONTRIBUTING.md file with instructions on what to avoid
17:04 jberger his attitude was poor, no doubt about it
17:05 sri if posting a bare ":+1:" makes you feel bad, then just elaborate on why you like the feature
17:06 sri "i don't want to +1 spam, so i don't participate" is stupid
17:06 jberger ^^ that's true too
17:07 gtodd joined #mojo
17:07 jberger I'll need to find a minute to compose a proper thought
17:07 * jberger is crash-learning ansible, because apparently I'm ops now too
17:07 * sri is melting... still 30C here
17:08 mst yeah, england is ridiculous as well
17:08 mst I can barely think
17:08 jberger sri: its a beautiful day here, and going to get beer with some friends at a local fair tonight, you can probably make it in time! get on a plane!
17:08 jberger mst: you too
17:09 genio I hear you guys talk like that and it makes me want to laugh until I remember that AC is likely nowhere near as ubiquitous there as it is here
17:10 jberger Chicago would be unlivable most summers without AC
17:10 jberger it was one year in uni
17:10 jberger cheap apartments still don't have it of course
17:10 sri it's not supposed to be this warm here...
17:10 genio It's a regular, not-too-hot, 33C here.  Hot here is 36-37C.  But, with AC we are kind of babied
17:11 jberger Chicago has to have one of the widest common temperature spreads anywhere I would think
17:11 mst genio: also it's pretty rare for it to get over about 25 here so we're totally not used to it
17:11 aggrolite joined #mojo
17:11 jberger mst/sri, there'll be a beer waiting for each of you here tonight, come get it
17:12 genio mst: Yea, 30C and no AC and not being accustomed to it sounds pretty f'ing miserable
17:13 mst I'm more comfortable at 3C than 30C
17:14 genio Yea, I'm the opposite.  I cease to function properly in <= 15C coldness
17:14 genio and if there's very little humidity I'm all messed up too.  my sinuses do not like dry climate
17:17 mst right, we're right near the coast so 'cold, unhumid, pissing rain' is normal
17:18 * genio formulates a business plan to sell suicide kits to mst's area
17:23 sri i think they call those Guiness over there ;p
17:28 punter joined #mojo
17:33 jberger My friends in SLC were complaining about the high humidity
17:33 jberger It was almost 40% during YAPC::NA :p
17:41 wingfold joined #mojo
17:44 mst yeah, SLC was annoyingly humid
17:44 mst it's 45%-ish here atm
17:44 berov joined #mojo
17:49 CandyAngel Ugh, Kindle Fire people need to be poked with something sharp
17:49 CandyAngel "Hey, let's make a Kindle For Kids.. and leave the shortcut to enable accesibility, which completely changes how you interact with it enabled! It doesn't matter that it is really easy to do by mistake.."
17:50 CandyAngel Oh, and you can't disable it
18:00 trone joined #mojo
18:17 aggrolite joined #mojo
18:29 jberger clearly they need a better UX QA person
18:30 jberger cause that sounds like the first thing our QA team at the $bank would have done
18:30 jberger I miss my $bank QA team the most of the few things that I miss from there
18:30 CandyAngel Wait what? A UX team that cares about the experience of actual users?
18:30 CandyAngel Why you lie to me like this Joel :(
18:31 lb UX can be used for evil too
18:31 lb in fact, it probably mostly is
18:32 jberger at the bank, UX was part of functionality, because traders are stupid and will enter a huge trade incorrectly if you let them
18:33 jberger on the day of the release of our code, I had to stop watching the production db when I saw that a trade went in valued at €800M
18:34 jberger it made me too nervous to watch after that
18:34 dotandimet joined #mojo
18:35 jberger the UI had a shortcut key for billions too, that made me a little bit uncomfortable too
18:35 lb at a bank, ux is used for evil by def.
18:35 jberger lb: this was market making so for the most part we just profited by volume and a defined markup
18:36 jberger but yeah, evil happens everywhere
18:37 jberger *cough* http://www.reuters.com/article/2014/03/06/us-bank-of-america-suspends-idUSBREA251MZ20140306 *cough*
18:43 lluad joined #mojo
18:49 Phil21 hmm, is there a good cookbook/guide for stupid-simple JSON injest as an "api"
18:49 Phil21 basically just doing a real fast PoC and want to hack something up as quickly as possible
18:50 Phil21 didn't see anything super obvious in the guides section of docs
18:50 Grinnz Phil21, "injest"?
18:50 Phil21 take in a json object, stuff into hashref
18:50 Phil21 I'm probably just missing it :)
18:50 Grinnz Phil21, $c->req->json
18:51 Phil21 hmm, ok that was kind of a silly question :)
18:51 jontaylor joined #mojo
18:51 Grinnz https://metacpan.org/pod/Mojo::Message#json
18:52 Grinnz very useful, for both webservices and using external APIs with Mojo::UserAgent
18:52 Phil21 thanks a ton, sorry for the stupid question.  Yeah, most of my experience thus far with Mojo is UserAgent and it's great
18:53 Phil21 first foray into trying to do a basic API server
18:53 * CandyAngel uses quadcopter as a fan
18:53 jberger CandyAngel: hahahah
18:54 jberger Phil21: for the most part, if you have to work hard to do something easy, you're doing it wrong. <3 mojo
18:54 Phil21 jberger: yeah :)
18:54 CandyAngel Yeah, even enqueing a job that you have to start manually in Minion is easy :|
18:54 Phil21 the more I touch mojo the more I fall in love
18:55 Phil21 (coming from a guy who's last real "programming" was CGI.pm)
18:55 pink_mist just ... don't touch it inappropriately :P
18:55 jberger CandyAngel: you are the only person who has wanted that :P
18:55 CandyAngel jberger: Clearly that makes me best person or worst person
18:55 jberger pink_mist: well, if mojo consents ...
18:55 CandyAngel But once I do it on something public.. you may see it more! :D
18:55 jberger CandyAngel: nah, just weird :-)
18:56 CandyAngel Oh, just scraping the surface.. trust meh
18:56 CandyAngel (see previous comment about quadcopter fan)
18:56 jberger no, that's just clever
18:56 CandyAngel Hey, manually started tasks in Minion is clever too!
18:57 CandyAngel (though I didn't come up with it)
18:57 jberger find the use cases!
18:57 CandyAngel At least, not the cool, compact way I am doing it
18:57 jberger we add things that will benefit people
18:57 jberger or find hooks that have use cases
18:58 CandyAngel jberger: I've already shared the technique with my friend who is implementing it on his site, though same general use case
18:58 jberger that you can then use to implement it
18:58 CandyAngel e.g. applying to be part of groups on the site, requires accepting, all done through Minion
18:59 CandyAngel Anyways
18:59 CandyAngel I'm working towards feeling the same for Minion as I do for git-annex
18:59 CandyAngel :P
18:59 dotandimet joined #mojo
18:59 CandyAngel Which I (ab)use just as much
19:01 CandyAngel Er
19:01 CandyAngel s/Minion/Mojolicious/
19:03 JDorpinghaus joined #mojo
19:06 * sri is fine with the minion job review pattern that has evolved here
19:09 JDorpinghaus https://gist.github.com/JDorpinghaus/2c47ea7b63a8b6e668d6 I am writing tests using the json_has method and I have a question about its behavior. The first post_ok in my test file fails as expected because there is no question_id key in the JSON response. However, the second post_ok passes, even though the only difference between the two is a slash
19:09 JDorpinghaus in front of my JSON pointer. Why does the second json_has test pass?
19:12 sri where did you see a json pointer like that?
19:13 sri is that in the RFC? Oo
19:14 JDorpinghaus I was referring to the Mojolicious documentation. http://mojolicio.us/perldoc/Test/Mojo#json_has
19:15 JDorpinghaus My original question should have been why is the slash necessary in front of the JSON pointer?
19:15 sri so you're just making selectors up and hope for the best? :)
19:15 sri see RFC 6901
19:15 sri which is linked from the docs you just mentioned
19:17 jberger JDorpinghaus: because spec says so
19:20 JDorpinghaus Thanks, I understand a little more about JSON pointers now. It seems odd to me that the second json_has test in my gist file would pass even though the JSON object is empty and contains nothing.
19:20 JDorpinghaus On line 19 specifically.
19:21 marcusr 0
19:21 marcusr eep
19:21 marcusr jberger: I'm using plenv in ansible
19:22 marcusr request tracker is basically the only app I dist. I'm planning to start syncing the local::lib on dev machines to test and production instead of reinstalling them on each environment.
19:24 lb we build .debs for that
19:24 jberger I've gotten my cpanm command down at this point I think
19:24 jberger now I'm trying to get it to talk to github for me, which is hard because my sshkey has a password
19:24 lb .debs with full perlbrew+carton
19:25 lb full deployment to various environments from jenkins
19:25 * lb has a cow-orker who promised to do a write up
19:26 spicyjack jberger: start an agent on the host you're trying to talk to github to
19:31 bin_005 joined #mojo
19:32 jberger spicyjack: http://littlefun.org/uploads/52309db3e691b236df7d6b76_736.jpg
19:34 lb i think i said that one time too many, and someone printed out http://i.imgur.com/xVyoSl.jpg and put it next to my desk
19:39 melo joined #mojo
19:40 jberger spicyjack++
19:40 jberger it worked!
19:40 purl Of course it worked
19:40 jberger dammit purl!
19:41 spicyjack jberger: I was trying to find the script I did the same thing in previously
19:41 jberger I can work this way while prototyping the playbook, but I'm not sure how this will work once I try to actually want to make it work
19:42 jberger seems that there is some forwardagent games I can play in that case
19:42 spicyjack use throwaway SSH keys, or like you said, forward your existing agent
19:52 disputin I have cgi script that I'm using to process a form into an email.  How can I create a route for /cgi-bin/TFMail.pl ?!?
19:53 mst um.
19:53 * mst went to metacpan.org
19:53 mst typed 'mojolicious cgi' into the search box
19:53 mst first result was https://metacpan.org/pod/Mojolicious::Plugin::CGI
19:54 disputin thanks, missed that somewher
19:55 Grinnz_ :)
19:58 aggrolite joined #mojo
19:59 dotandimet joined #mojo
20:04 melo1 joined #mojo
20:07 bin_005 joined #mojo
20:22 dotandimet joined #mojo
20:38 bin_005 joined #mojo
20:39 melo joined #mojo
20:54 Phil21 hmm
20:54 Phil21 seeing some kinda strange caching(?) behaviour I didn't expect and seems at first blush inconsistent
20:54 Phil21 I have a template that basically does a select * on foo, dumps that to the template
20:54 Phil21 if I add a new row to db and hit refresh, old data gets returned
20:55 Phil21 restart morbo and it shows up
20:56 Phil21 I guess I thought the template cache only cached the templates themselves
20:56 jberger Phil21: IIRC that SHOULD work, but at the same time, don't do that
20:56 Phil21 hmm
20:56 Phil21 what is the correct way?
20:56 purl hmmm... the correct way is to distribute Net::Telnet along with your script
20:56 Phil21 ha
20:56 jberger that should be a helper or a controller method
20:56 jberger don't listen to purl
20:57 jberger purl: shut it
20:57 * purl gives jberger a frosty glare
20:57 Grinnz_ purl: why the hell would you ever do that
20:57 purl Grinnz_: excuse me?
20:57 mst no, purl, the correct way is <reply>
20:57 purl okay, mst.
20:58 mst what is the correct way?
20:58 mst \o/
20:58 jberger purl: be mst
20:58 purl Step back. Explain what you're trying to achieve.
20:58 Phil21 jberger: what really confuses me, is I have another route that seems to work as I would expect
20:58 Phil21 I can update the db table that holds the data, and those changes are reflected upon refresh
20:58 Phil21 weird
21:01 Phil21 oh yeesh
21:02 Phil21 alright, sorry.  still wrapping my head around this not being completely stateless :)
21:02 Phil21 e.g. entire app isn't ran on every http request
21:02 jberger Phil21: ah yes
21:06 bin_005 joined #mojo
21:14 Grinnz_ heh
21:15 Grinnz_ in fact, nothing is reran on every request, except your action methods
21:15 Grinnz_ and hooks
21:29 PryMar56 joined #mojo
21:30 aggrolite joined #mojo
22:09 mattastrophe joined #mojo
22:14 mattastrophe joined #mojo
22:17 jberger can someone try installing Net::Server and see if it hangs on its tests?
22:18 Grinnz_ any particular perl version?
22:18 jberger I'm using 5.20.2
22:19 Grinnz_ Successfully installed Net-Server-2.008
22:19 Grinnz_ in 5.22
22:19 jberger hmmmmm
22:20 jberger thanks anyway
22:20 Grinnz_ ditto in 5.20.2
22:20 jberger what os?
22:20 Grinnz_ Linux
22:21 jberger you don't happen to have a freebsd hanging around do you?
22:21 Grinnz_ nope
22:21 Grinnz_ i was thinking of throwing up a freeBSD vm to mess around with, but haven't gotten sufficiently masochistic
22:21 Grinnz_ i mean bored
22:21 jberger I'm not a fan so far
22:21 jberger it seems that the bsd people keep loving things, but I'm not sure why
22:22 Grinnz_ perhaps because it's an ecosystem that's as of yet unpenetrated by noobs
22:26 BinGOs jberger: http://matrix.cpantesters.org/?dist=Net-Server%202.008;os=freebsd;reports=1
22:31 melo1 joined #mojo
22:32 sri i'm bored, can someone find a bug in mojolicious?
22:32 Grinnz_ lol
22:33 Kogurr joined #mojo
22:34 jberger BRING BACK wantarray!!!!
22:34 Grinnz_ rofl
22:34 sri that would certainly be everything but "boring"
22:37 Grinnz_ add an event "party" to Mojo::IOLoop, have it emit at random times and have various modules subscribe to it to do random things
22:37 sri hmm, a chaos monkey feature
22:38 jberger http://pastie.org/10268954
22:38 jberger hangs after the last line!
22:39 Grinnz_ UDP test, wonderful
22:39 pink_mist how about a feature request? I want a Mojo::EventEmitter ->exclusive(event => sub {}) that works just like ->once() except it temporarily disables any other callbacks that were already registered for the event
22:39 pink_mist and when it fires restores them
22:40 jberger I already think of once as damn near a code smell, what do you need that for?
22:41 Grinnz_ all your emit are belong to me
22:41 jberger Grinnz_++
22:41 sri jberger: drain
22:41 jberger sri: it has its purposes, yes
22:41 pink_mist jberger: I've got a Mojo::IOLoop::Stream of stdin listening for commands ... but sometimes a command needs to prompt the user for something, and it's useful then to not have that parsed as a command too
22:42 jberger whihc is why I say "damn near"
22:42 Grinnz_ pink_mist: send a different event? :P
22:42 Grinnz_ oh, you mean the input
22:43 pink_mist ... yeah
22:43 Grinnz_ hmmm
22:44 Grinnz_ probably easiest to set a flag in the object, which the subscribers check for... or have an intermediary event, which either emits a command or input event
22:45 pink_mist that's not easier at all .. that's absolutely horrible
22:45 Grinnz_ doesnt seem that bad to me
22:45 pink_mist http://paste.scsys.co.uk/491723 <-- something like this
22:47 Grinnz_ seems to me if not everything it gets will be a command, it shouldn't emit the command event every time anyway :P
22:47 pink_mist it's not emitting a command event
22:47 pink_mist it's getting a read
22:47 pink_mist from the stream associated with stdin
22:48 pink_mist and I don't want it to get a read
22:48 pink_mist so I have that exclusive thing
22:48 Grinnz_ but it is reading something
22:48 pink_mist yes ... and that read is already being handled by the exclusive handler ... not by the normal standby handler
22:48 pink_mist that parses commands
22:55 sri Mojo::EventEmitter extensions we don't actually need in core are very unlikely
22:56 jberger pink_mist: that could easily just be an ephemeral method
22:56 pink_mist ephemeral?
22:57 jberger my $exclusive = sub { ... }; $emitter->$exclusive(...);
22:57 jberger handy those are
22:58 pink_mist ah, neat
23:18 bpmedley joined #mojo
23:22 janus joined #mojo
23:39 jontaylor joined #mojo

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