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

IRC log for #mojo, 2016-07-27

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

All times shown according to UTC.

Time Nick Message
00:12 noganex_ joined #mojo
00:16 tchaves joined #mojo
00:24 PopeFelix joined #mojo
00:27 Sebbe joined #mojo
00:41 tchaves1 joined #mojo
00:45 Sebbe joined #mojo
00:53 Janos joined #mojo
00:56 tchaves joined #mojo
01:07 kid511 joined #mojo
01:14 kid511 joined #mojo
01:37 Sebbe joined #mojo
02:18 mcsnolte joined #mojo
02:25 lluad joined #mojo
02:37 aborazmeh joined #mojo
02:39 noganex joined #mojo
02:43 kaare_ joined #mojo
03:15 ivi joined #mojo
03:44 nic joined #mojo
03:45 ivi joined #mojo
03:49 CW joined #mojo
04:30 ivi joined #mojo
05:37 cosimo joined #mojo
05:37 inokenty-w joined #mojo
05:38 dod joined #mojo
05:43 dod joined #mojo
05:59 che-quest joined #mojo
06:12 ksmadsen joined #mojo
06:15 dave joined #mojo
06:32 Atog joined #mojo
06:50 mbudde joined #mojo
07:20 dod joined #mojo
07:20 CW joined #mojo
07:30 ksmadsen joined #mojo
07:32 AndrewIsh joined #mojo
07:36 punter joined #mojo
07:38 mbudde1 joined #mojo
07:39 Vandal joined #mojo
08:00 osfabibisi joined #mojo
08:00 ksmadsen joined #mojo
08:12 coolo sri: please consider applying to https://jobs.suse.com/job/nuremberg/opensuse-release-engineer/3486/1995455 - I can asure you it's the perfect job for you ;)
08:30 punter joined #mojo
08:37 punter joined #mojo
09:26 batman sri: is it intentionally that Mojo::UserAgent::Transactor modifies the input structure? https://github.com/kraih/mojo/blob/master/lib/Mojo/UserAgent/Transactor.pm#L204
09:27 sugar__ joined #mojo
09:27 batman i guess it's not by accident, but i just go a bit confused when i wrote a unit test where i tried to do $t->post_ok("...", form => \%form ) twice
09:29 cuechan joined #mojo
09:31 pink_mist batman: perhaps do: $t->post_ok("...", form => { %form })?
09:32 pink_mist though, I'd say that's a bit surprising it does that
09:55 tinita coolo: 'Extra bonus points if our perl experts scratch their head and ask "how does he do that?!"'
09:55 tinita do you also want women to apply?
09:55 tinita just saying, i stumbled over this
09:59 Lee doesn't give me much faith in the quality of their code either
10:09 coolo tinita: gives less extra points for women as the question the scratchers ask is different ;)
10:09 pink_mist eh, I don't see the problem -- sprinkling "he/she" everywhere just for the sake of it isn't worthwhile imo ... "he" is often used to mean a generic person regardless of gender
10:09 nic I think all job ads demand a large pinch of salt -- it's rare that the smart minds in a company even look at them
10:10 pink_mist and if you're the type of person who gets hung up on the text not saying "he/she" everywhere, not sure I'd want to work with you in any case :P
10:11 nic pink_mist: that was often taught in the Twentieth Century, but anything that reinforces a gender bias is part of the problem
10:11 coolo pink_mist: it depends. I like people with an extra gratitude to correct details :)
10:11 sri coolo: what is "Suse virtual office"?
10:12 coolo nic: but see https://github.com/os-autoinst/openQA/pull/785#discussion_r70752158
10:12 sri does Suse do remote work too?
10:12 nic and does it have flashing lights?
10:12 coolo sri: we have 3 offices but people working in about 300 cities :)
10:13 sri oh wow
10:13 sri ok, now i'm really interested in Suse :)
10:13 coolo nic: what I normally aim at is intermixing hes and shes all the time - so everyone feels offended equally
10:14 nic was about to say :D
10:14 coolo sri: we have at least people in Bielfeld, Köln, Hamburg, Berlin, Darmstadt, Nürnberg, Münich, Schwäbisch Gmünd, Düsseldorf and plenty I forgot :)
10:16 nic personally I like third-person plural -- usually has the fewest issues -- though I often imagine my grandfather choking on the 'broken' grammar
10:17 nic Is there an office in Berlin?  Berlin is top sexy city now that London has a death warrant
10:17 coolo nic: a virtual one :)
10:18 sri coolo: hmm, looks like perl jobs are limited to nuremberg though
10:19 coolo sri: the problem is that job portals require a location (to give you the extra useless '50km away' options)
10:19 coolo so we have to set one location for all jobs, but usually expect senior applications remotely
10:19 sri coolo: maybe it's just the ui that's confusing https://jobs.suse.com/search-jobs/perl/3486/1
10:19 sri there's global jobs and jobs with location
10:20 sri (the btrfs job is global)
10:20 coolo ... and as such is not visible on normal job portals
10:21 sri well, i will certainly apply... lets see what happens :)
10:22 coolo so our preference for most jobs is having the developer around in Nürnberg for training in the first weeks. So having a train distance to NBG is kind of a requirement, but that still leaves central europe
10:22 sri i actually was in contact with a suse recruiter a week ago, but he seems to have forgotten about me
10:23 sri coolo: that's cool
10:23 coolo sri: we have 106 open jobs and only 2 recruiters at the moment - we're hiring recruiters too, but it's hard to find good recruiters that know shit about open source world
10:24 pink_mist coolo: over in #perl on freenode, Su-Shee has a lot of experience with that kind of thing
10:24 pink_mist coolo: and she's currently looking for a job
10:24 coolo sri: but if you apply to a specific job and put 'referred by coolo' somewhere in the text, this surely accelerates the process ;)
10:24 coolo pink_mist: with recruiting you mean?
10:24 pink_mist afaik yes
10:25 sri coolo: hope you get a referral bonus too ;)
10:25 pink_mist (also perl in general :P)
10:26 coolo pink_mist: we actually just finished onboarding a recruiter, which then fell sick longterm - and stupid german laws forbid firing someone in that situation ;)
10:26 coolo but e.g. https://jobs.suse.com/job/nuremberg/global-suse-onboarding-coordinator-recruiting-and-hr-team/3486/2447769 is still open
10:27 coolo sri: I think I would
10:35 tinita pink_mist: ok, then i'm gladf i'm not working with you
10:36 tinita it's a job offer and it says "he" and nowhere does it say "she"
10:36 batman pink_mist: that doesn't work, since the "file" is nested inside
10:37 tinita so I know in the mind of the person who wrote this there was a guy
10:37 pink_mist batman: oh, it's deeper in the structure? darn
10:37 * sri agrees with tinita on that, only saying "he" doesn't sound neutral at all
10:38 ribasushi tinita: in their defense coolo *did* acknowledge they are short on HR staff with things slipping through
10:38 tinita i also use the male version of programmer or something like that often, but it's a job offer, you can put some work into it
10:39 ribasushi tinita: don't let one (3rd party) persons flippant remark reflect badly on the job itself ;)
10:39 tinita ribasushi: i'd do a pull request ;-)
10:40 tinita i think "he or she" would be ok
10:40 tinita ribasushi: i didn't get through all the backlog, so i hadn't read that =)
10:41 sri wasn't the neutral "they" recommended these days?
10:41 ribasushi tinita: all is well in the world \o/ ( though the ad still can use fixing ;)
10:42 tinita sri: "how did they do that" - yeah, that would also be ok
10:42 ribasushi .oO( how did it do that?! ;)
10:43 coolo tinita: our VP wrote these challenges and you're perfectly right that he very likely had a guy in mind when writing this. But he didn't mean it - so I sent him your feedback
10:44 nic coolo++
10:44 coolo tinita: it's a chicken-egg problem, but in a company with less than 10% women the default is to think of a man applying ;(
10:48 tinita coolo: yeah, i can imagine. i'm the only women in a team of 12
10:49 nic improving the ads is a win for everybody, and I guess also helps more clearly highlight those other companies that might still be stuck in C20
10:50 ribasushi hey now! C20 was awesome! Little-to-no-hipsters, the macbook wasn't a thing... what's not to like?! :)
10:50 nic :)
10:55 sugar__ joined #mojo
11:02 tchaves joined #mojo
11:03 punter joined #mojo
11:15 cuechan_ joined #mojo
11:35 ksmadsen joined #mojo
11:40 nic https://gist.github.com/niczero/86971fb5141a83075bdf3a46bde93344
11:40 nic Can anyone spot why the user agent doesn't follow redirects?
11:41 kid51 joined #mojo
11:41 sri might be hard to test, considering google behaves so different based on geo location
11:41 nic yeah, thought that
11:41 nic anyone know a public address that reliably redirects?
11:42 sri fwiw. "mojo get -r google.com" does follow the redirect
11:43 ksmadsen joined #mojo
11:45 kid511 joined #mojo
11:45 sri coolo: you think i should do the cve challenge? :)
11:45 Kripton joined #mojo
11:46 nic http://google.fr reliably gives a 301
11:48 kid51 joined #mojo
11:50 coolo sri: actually I'm curious how you'd solve it :)
11:50 Adurah joined #mojo
11:51 * coolo has seen quite interesting bash scripts converted to stackoverflow perl :)
11:51 Kripton joined #mojo
11:52 sri guess i would cheat, look up a bash script and turn it into a mojolicious one-liner
11:53 nic :D
11:53 coolo for other perl positions we had an old soduko solver and asked the applicant to extend it to cover 4x4 sodukos. And then they wondered they only got one application ;)
11:54 sri haha
11:55 ribasushi coolo: um... I think I am not getting the joke - but why...?
11:56 ribasushi I mean... was it a trick question, or nobody could adapt a 9x9 to 16x16 sudoku solver...?
11:56 * nic watched The Imitation Game at the weekend
11:56 nic class
11:57 nic ooh, is there a source for 4x4 sudokus?  my daughter has just got into doing them
11:58 nic well, imagine that, those funny people at google.com have hundreds of them :)
11:58 coolo nic: I'm personally exhaused with binary sudokos
11:59 coolo ribasushi: the challenge was more about getting to understand someone else's algorithm expressed in perl :)
11:59 ribasushi yeah, so I got that right then... and only one applicant managed? I find this... so hard to believe
12:00 coolo ribasushi: we don't know how many tried :)
12:01 * coolo personally is stressed to understand things like https://github.com/openSUSE/open-build-service/blob/master/src/backend/bs_dispatch#L511
12:02 ribasushi without reformatting it - I can't read it easily either, but so what ;)
12:02 nic I'm assuming if you spend your time sniggering at something being called "bs" you don't get the job
12:04 ribasushi http://paste.scsys.co.uk/528610 <--- hardly a problem now (though I wouldn't nest the ternaries but lay them out in one level)
12:06 Kripton joined #mojo
12:08 sri coolo: oh, the cve problem is way easier than i thought :(
12:09 sri it's just "rpm -q --changelog perl", search for "CVE-\d+-\d+", and make that list?
12:10 sri i thought there was scraping data from the cve index involved
12:12 sri actually, the hardest part was understanding the problem ;p
12:15 trone joined #mojo
12:15 coolo sri: and knowing about rpm :)
12:17 nic some challenges are also testing whether the candidate is interested enough to make a little effort
12:17 nic I was surprised how many of my candidates gave a loud 'no'
12:18 Kripton joined #mojo
12:19 Vitrifur joined #mojo
12:27 sri coolo: guess you could do it with rpmfind.net too
12:28 nic sri: it seems build_tx does not follow redirects at all; I'll review why I went that route; maybe don't need to use it
12:28 nic (played with t/mojo/user_agent_online.t to confirm)
12:28 sri nic: everything uses that method
12:30 nic I'm guessing somewhere there's a loop around the build_tx layer, but tbh I haven't looked into the code yet
12:32 punter joined #mojo
12:41 nic yeah, I admit what I'm saying makes no sense.  UserAgent::get works, and it's few lines of code appears to be what I'm trying to do.  Shouldn't be too hard to trap where they differ
12:45 neilhwatson joined #mojo
12:46 nic oh my giddy aunt, found my bug
12:48 nic never ever do "$agent->start($tx)"; must be "$tx = $agent->start($tx)"
12:48 * nic hangs head in shame
12:50 gizmomathboy joined #mojo
12:53 nic well, if you care about the subsequent value of $tx.  I was following redirects and then analysing the wrong transaction
13:04 jberger nic: that shouldn't matter should it?
13:05 jberger Then again I'm fairly jet lagged
13:05 nic good to see you back, btw
13:06 jberger I was never really gone, just time shifted enough that i rarely saw you guys
13:06 jberger s/guys/people/
13:08 ptolemarch joined #mojo
13:08 nic I was throwing away the final transaction, so $tx->res was the response from the first redirect.  Adding the missing assignment has fixed the problem.  Confusingly the async version didn't need fixing
13:08 nic s/Confusingly/Obviously/  :D
13:24 blonewolfs joined #mojo
13:24 ashimema_ joined #mojo
13:39 sri coolo: argh, your application site wouldn't let me mention you :(
13:41 kid51 joined #mojo
13:42 sri i did use a text CV though, guess i could add a note at the top
13:44 sri hehe, "referred by coolo" would be funny as a cover letter i guess
13:45 nic put it as a subtle watermark diagonally across each page
13:45 sri hahaha
13:46 sri <blink>referred by coolo</blink>
13:51 sri echo "<blink>referred by coolo</blink>" > cover_letter.html
13:51 sri 👍
13:53 nic echo "<font color="yellow">He promised this is a done deal</font> >>cover_letter.html
13:56 blonewolfs i'm trying to create a generic catch all route but, it doesn't seem to be recognized.  $r->any('.*')->to(controller => 'Upload', action => 'index');  anybody have any idea why this just results in the default 404 page?
13:56 nic blonewolfs: why the dot
13:57 nic if you're thinking regex, that's where the problem is
13:57 punter joined #mojo
13:57 blonewolfs nic: i have tried it with just the '*' and that didn't make a difference.
13:59 nic once you've fixed the dot problem, take a look at "myapp routes -v"
13:59 blonewolfs nic: how would you write it so that any uri would get caught and sent to the index page?
14:00 nic if you remove the dot does it match the example in the docs?
14:01 nic once you're happy the route is defined correctly, put some debug in your Upload::index method to confirm it's being invoked
14:02 nic once you're happy it's being invoked, look at the render call(s) to see why they aren't
14:02 sri http://mojolicious.org/perldoc/Mojolicious/Guides/Routing#Catch-all-route
14:06 blonewolfs nic: that is the problem.  the index page never gets called.  i just get a 404.  if i request the index page directly, it works fine.
14:08 blonewolfs sri: i had seen that example before but, i don't understand how to make it generic.  or, is that a literal cut and paste example?
14:09 nic copy-n-paste to confirm it works in your app then season to taste
14:11 jberger the catch-all variable still needs a name, even if you don't use/need it
14:11 jberger *dummy
14:12 blonewolfs nic: i just did and that works.  i don't understand why though.  the "whatever" was throwing me off and making me think it was not a literal example.  i guess i was just over thinking it.
14:12 mcsnolte joined #mojo
14:12 sri jberger: no name actually works too :)
14:12 sri then it ends up in $c->stash->{''}
14:12 jberger oh, hunh
14:13 * jberger stands corrected
14:13 jberger its kinda odd to be in an office again
14:13 * jberger looks for ocean/mountains, can't find
14:13 blonewolfs i will have to study uri variables in more detail.  thanks all for your help.
14:13 sri i think the default value is what made it break for blonewolfs
14:13 sri that is required to make it optional
14:14 sri $r->any('/*' => {'' => ''})
14:14 sri that actually works
14:15 jberger yes, that is the real issue, supplying a "default" even if it isn't used/needed
14:15 blonewolfs that is the part i wasn't understanding.
14:16 marty joined #mojo
14:16 jberger hmmmm, I wonder if that would be worth a feature request, special case * (well, *'') to have a default of ''
14:16 sri i don't like the onconsistentcy
14:16 sri s/o/i/
14:16 marty joined #mojo
14:16 jberger $r->any('/*' => {'' => ''}) looks kinda odd though
14:16 sri but is consistent :)
14:16 jberger true :D
14:17 sri having a name is better anyway
14:17 jberger I always do *dummy
14:17 jberger or *whatever
14:17 jberger dummy tells the future reader something though
14:21 sintovc joined #mojo
14:26 sri i better not mention when the last time i used suse linux was
14:27 sri it actually was the first unix i ever used, and the first contact i had with open source
14:28 sri back in 1997 you had to go to the book store here in germany to buy it on cd :)
14:34 sri yea, this is what it looked like https://upload.wikimedia.org/wikipedia/commons/d/dc/German_SuSE_Linux_4.2_Box_Manual_and_CDs.jpg
14:35 sri back in the days when you still kept xeyes on your desktop
14:37 sri don't pretend you didn't do it too!
14:37 jberger <3 xeyes
14:43 Lee 👀
14:44 punter joined #mojo
14:49 Janos joined #mojo
14:53 bwf joined #mojo
15:00 svc joined #mojo
15:06 * tempire never liked suse
15:09 Jonis started with slackware 3.6
15:09 Jonis printed the entire installation guide, but forgot the bit about logging in
15:09 sri lol
15:09 Jonis so had to wait until the next day so I could go to a friends place and get the login instructions :)
15:11 * tempire sat at a redhat command line for several hours trying to guess at acceptable commands
15:12 jabberwok bash tab completion says there are 1337 possible commands at this point
15:12 lluad joined #mojo
15:12 tempire excellent
15:14 Jonis :D
15:23 FROGGS joined #mojo
15:35 FROGGS hi, is there a cookbook for a redis/sql backed websockets chat?
15:35 sri https://github.com/kraih/mojo-pg/blob/master/examples/chat.pl
15:37 sri https://api.metacpan.org/source/JHTHORSEN/Mojo-Redis2-0.26/examples/chat.pl
15:38 sri batman: you have an odd signature style "sub ($c, $r=$c->redis) {"
15:38 sri not sure i could get used to the lack of whitespace
15:47 jberger FROGGS: there is a difference in how the unsubscribe logic works between Mojo::Pg and Mojo::Redis2
15:47 jberger I greatly prefer the logic in Mojo::Pg and (when I get some time (ha!)) I want to try to submit a patch to Mojo::Redis2 to do a similar thing
15:48 FROGGS hmmm
15:48 FROGGS we usually use mysql but this might be a reason to switch :/
15:49 jberger pg is teh awesom
15:49 FROGGS I know
15:49 FROGGS pg vs mysql is teh like perl vs php
15:50 FROGGS (wrt strictness etc)
15:51 pink_mist I like your analogy
15:55 jzawodn_ joined #mojo
15:59 punter joined #mojo
16:00 jzawodn joined #mojo
16:25 Bean joined #mojo
16:56 gizmomathboy joined #mojo
17:03 marty joined #mojo
17:17 marty joined #mojo
17:20 FROGGS sri, jberger: thanks btw, the notify feature in combination with websockets will be very helpful with the rest of the project too
17:37 dod joined #mojo
17:55 nicomen I'm having problems doing a non-blocking request from a controller. I don't care about the result, just want to fire off a request to an external service', I see connect in debug, but nothing more. This works with a test (setting up an own Mojo::Server::Daemon), but not thru morbo or starman.
17:55 nicomen any ideas?
17:59 nicomen sorry it might work with morbo, but doesn't with ./script/app get '/route/..'
18:10 jberger nicomen: you need to start the loop when you are not using ioloop servers
18:10 jberger you can use delays to make the code "portable"
18:11 nicomen I've tried different incantations found on the net, but still can't get around it :-(
18:11 ningu joined #mojo
18:11 nicomen the app get call, seems to just stop the ioloop?
18:11 jberger Mojo::IOLoop->delay(sub{ ... })->wait;
18:11 jberger there is no loop in a command-line get nor if you use starman
18:11 ningu I have a Mojolicious app where I'm calling $c->validation->csrf_protect->has_error. it's been working fine for me. but oddly, my coworker is having it fail for him in Chrome. it works on other browsers. any idea what could be up with that?
18:12 ningu it seems really odd because why would Chrome be submitting anything other browsers wouldn't for the form?
18:12 jberger ningu: we would need lots more detail on that
18:12 ningu such as what?
18:13 jberger like chrome versions, definion of "fails", best yet, a case example
18:13 trone joined #mojo
18:13 ningu has_error returns true even though the form he's submitting has the csrf token
18:13 ningu that is what I mean my fail
18:13 nicomen jberger: Are you saying this will start an ioloop? Mojo::IOLoop->delay(sub{ ... })->wait; or that it just won't work with get?
18:14 ningu I guess I could try to make a test case
18:14 jberger ->wait is the portable way to possibly start the loop
18:14 ningu we just discovered it
18:14 ningu I've verified that the HTML in his browser is correct
18:14 jberger ningu: we are not aware of any chrome problems with csrf_protect
18:15 jberger if you have found a bug, please make a reproducable example and open a bug report on github
18:15 punter joined #mojo
18:15 ningu ok
18:19 itaipu joined #mojo
18:34 ningu jberger: made a minimal Mojolicious::Lite app that he can reproduce with failure
18:35 ningu it works in all other browsers he has tried
18:35 ningu I will submit a bug report
18:37 ningu I wonder if there is some possible Chrome setting that could be interfering
18:38 jberger do you see any errors in the console when you run the example?
18:38 ningu ah good idea
18:38 ningu I will ask him (we aren't in the same physical location atm)
18:38 jberger also, look in the network tab to see the form data that was sent
18:42 ningu console reads:
18:42 ningu chrome-extension://jeoacafpbcihiomhlakheieifhpjdfeo/scripts/vendor/port/port.js:30 Uncaught SecurityError: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.
18:42 ningu also: langid.js:45 unpacked a langid model: 97 langs, 7480 feats, 9118 states.
18:43 nicomen jberger: I think I got it to work thru 'get' with your construction, but then my test server daemon, that the nb-ua->get() request tries to fetch is never called
18:43 AirDisa joined #mojo
18:44 jberger ningu: that extension is "Disconnect"
18:44 jberger no idea what the other js file is
18:44 nicomen so I guess, new question is, how do I test that a non-blocking call is being done from with a testfile
18:44 jberger does the request look ok in the network tab?
18:44 ningu jberger: doing that next
18:44 ningu he is a bit slow, sorry :P
18:45 jberger nicomen: nb-ua?
18:46 jberger so I usually give the useragent object a server which mimics the actual external service
18:47 jberger then make sure that the url it tries to request is relative (so that it uses that mock service)
18:47 jberger then your test should work fine
18:48 FROGGS how dows this 'helper pg => sub { ... }' work for non-Mojo::Lite apps?
18:48 nicomen jberger: non-blocking ua?
18:48 preaction FROGGS: in the same way: $app->helper( pg => sub { ... } )
18:48 nicomen -?
18:49 ningu jberger: http://pastebin.com/nKxuyyii
18:49 ningu jberger: URL is https://panlex.org/mojotest/ if you want to compare
18:50 FROGGS preaction: awesome, thank you
18:50 ningu I am not sure what the dnt header is
18:50 ningu oh, do not track
18:50 jberger nicomen: I was asking why you have a useragent which is named for the fact that it is used nonblocking?
18:51 jberger ningu: I don't see anything immediately wrong with that
18:51 ningu me neither
18:51 jberger compare it with the form data and headers sent by a browser that works for you
18:51 ningu yeah, I am doing so
18:52 nicomen jberger: well, just that it is supposed to behave non-blocking I guess
18:53 jberger deep-dark secret: all mojo ua requests are nonblocking :-P
18:53 nicomen haha ok ;)
18:54 jberger nicomen: $ua->server(Mojolicious->new) is your friend here
18:54 jberger at least for testing
19:05 batman sri: it's not mine :) https://github.com/jhthorsen/mojo-redis2/blame/master/examples/chat.pl
19:07 batman btw: if anyone wants to do something crazy with the Mojo::Redis or Mojo::Redis2 namespace, then go crazy.
19:07 batman if the code looks sane, i will hand over one of the namespaces
19:07 batman haven't used redis for suck a long time :(
19:08 batman *such
19:10 jberger batman: I did try once but it has this odd property of how to manage blocking vs nonblocking requests
19:12 nicomen jberger: not server->app?
19:12 jberger sorry, yes, server->app
19:12 batman jberger: but it doesn't have to be backcompat. Mojo::Redis has been deprecated for...forever :)
19:12 jberger yeah, that wasn't the problem
19:13 jberger I have to go back and look at my attempt again before I could tell you the problem I ran into
19:13 jberger I did really like the redis wire protocol
19:16 batman oh. ok...
19:16 batman i kind of like it, but it's a bit weird the blocking and subscription requests...
19:16 batman maybe it's just me
19:16 punter joined #mojo
19:25 batman romel: i'm pretty sure it's because both the files are named index.json...
19:25 * batman looks closer
19:25 batman ooops! wrong channel.
19:29 sugar joined #mojo
19:34 nicomen jberger: thanks for your help ;)
19:35 jberger nicomen: did you get it working?
19:35 nicomen yup
19:35 cuechan__ joined #mojo
19:35 jberger excellent!
19:38 nicomen A comment was a bit weird in the end though: # don't wait for request to finish by using IOLoop->delay to execute it in the background\n Mojo::IOLoop->delay( ... )->wait; return;
19:38 jberger that isn't exactly right
19:38 nicomen oh?
19:38 jberger ->wait, when it actually starts the loop, is blocking
19:39 jberger just like Mojo::IOLoop->start is
19:39 jberger ->wait is "ensure that the loop is running by starting it if necessary"
19:39 nicomen ah right, so ->wait is 'ensure_loop_runs' ?
19:39 jberger yep
19:40 jberger the code is easy enough to understand
19:40 nicomen yeah, well, that's why the comment felt wrong, at least for people not familiar with the inner workings ;)
19:40 jberger https://github.com/kraih/mojo/blob/master/lib/Mojo/IOLoop/Delay.pm#L27-L33
19:40 nic jberger, batman, bpmedley: If there was a team project to make a reborn Mojo::Redis with an API like Mojo::Pg, I'd love to help -- I'll be avail from around mid-August
19:41 batman nic: sure! i'm not sure if i will do much hacking, but i think i want to do code reviews
19:41 batman i really want to do it myself, but i don't see when i can find time
19:41 jberger same here
19:41 jberger I have some ideas though
19:42 jberger and somewhere in my notes I have the trouble points I was already hitting
19:42 nic cool.  ideas and quality control are exactly the areas I'll need help with
19:44 Jonis Ya'll got more of those 'skills'?
19:46 jberger https://cdn.meme.am/instances/500x/41101320.jpg
19:46 Jonis jberger++
19:48 Jonis I've been in this flat for a year, I think it's time I get a proper computer chair
19:49 mishanti1 Reminds me we are (come August) two years overdue on our housewarming party.
19:49 jberger Jonis: that folding lawn chair is finally getting to you?
19:50 Jonis jberger: literally a steel ikea kitchen chair
19:50 jberger when I moved into my first apartment in college my roommate was older and already had all the stuff
19:50 Jonis mishanti1: you are, the bbq could double_
19:50 jberger but I moved in first
19:51 jberger so for several days I used a folding camp chair and a plastic plate and cutlery
19:51 Jonis hah
19:51 mishanti1 jberger: Then you got a wife and all was right in the universe?
19:52 jberger by the time I got married I'd been in apartments long enough to have plenty of my own stuff
19:52 mishanti1 jberger: Ah, so you got the reverse problem of having to decide what to keep and what to throw?
19:53 jberger actually she bought a lot of her stuff from the person in the apartment before her (a coworker)
19:53 jberger so almost everything was pretty replacable
19:59 punter joined #mojo
20:04 sri your daily reminder we still need this https://github.com/kraih/minion/issues/25#issuecomment-234754959
20:08 batman any comments on how to write less Mojo::IOLoop::Delay code? https://ssl.thorsen.pm/paste/38ade3ab34c1
20:08 jberger that's how I do it
20:08 jberger sub signatures would help the first one
20:09 ksmadsen joined #mojo
20:09 batman SOURCE FILTER FTW!!!! ;)
20:09 jberger heh
20:13 sri yea man, let us all just start using signatures
20:13 batman jberger: how would that help?
20:13 sri the tyranny of @_ has to end
20:14 jberger "my ($delay, $err) = @_;                    <------------------------------------- THIS"
20:14 preaction it even looks like a python!
20:14 preaction @ <- snake head. _ <- snake tail!
20:14 jberger preaction: dammit man, its a snail
20:14 jberger use less 'snails';
20:14 preaction fewer
20:15 * jberger failis
20:15 batman :)
20:16 Grinnz_ sri: i know lots of signatures, people tell me I have the best signatures
20:16 batman hahaha
20:18 jberger every now and again I think about what a blessed callback (or callback-like) object could do in mojo
20:19 jberger like for example it could have its own stack trace noting where it was declared (to help with error reporting)
20:19 sri preaction: cannot unsee!
20:19 preaction if we assume the ;, it's a rattlesnake!
20:19 preaction @_; <- DEADLY
20:19 Grinnz_ or a person crying with a black eye
20:19 jberger it could localize $SIG{__DIE__} and wrap exceptions in an exception object with that stack trace
20:20 PopeF joined #mojo
20:20 asarch joined #mojo
20:21 batman i think just having Mojo::IOLoop::Delay detect an Mojo::Exception (or something) and die for me would be a win for me :P
20:21 jberger oh man, that would be nice
20:22 batman but it will be probably be a lot slower
20:22 jberger having to scan through the argument list, ... maybe
20:22 batman since it has to do @errors = grep { UNIVERSAL::isa("Mojo::Exception", $_) } @_;
20:22 jberger could be controlled by an attribute
20:23 batman but what about Mojo::UserAgent? it only has $tx->error and no $err
20:23 batman there's so many "but, but... what about" questions popping into my head :(
20:23 jberger that is almost always the problem in trying to be general about exception handling in ::Delay
20:24 Grinnz_ a promises implementation would be one way since it encapsulates results as well as errors
20:24 jberger though $tx->error isn't really the same thing, which is why it doesn't have an error slot in the callback sig
20:24 * jberger really dislikes promises the more he tries to write complex things in them
20:24 batman jberger: i agree
20:24 sri and then there's 3rd party modules like AnyEvent::*
20:25 batman yeah... i've never managed to write good code with promises :(
20:25 batman sri: it's our way or the highway! ;)
20:25 * batman hides
20:26 sri promises rock when all apis already use them and you have an await keyword in the language ;p
20:26 punter Would anyone here happen to know whether Mojolicious::Plugin::UnicodeNormalize will normalize JSON input as well?
20:26 Grinnz_ indeed
20:27 preaction punter: no, it won't. the code is like 6 lines
20:27 perlpilot heh
20:27 ningu there could be Acme::NoEvent... makes everything sync
20:28 * jberger sets ningu on fire
20:28 sri this article explains it pretty well https://ponyfoo.com/articles/understanding-javascript-async-await
20:28 sri bonus points for arrow closures
20:29 sri really cool thing is that try/catch works again with await
20:30 pink_mist I've heard LeoNerd (author of IO::Async and Future) has been planning to get an await keyword implemented
20:30 pink_mist but afaik it's just plans so far
20:30 sri pink_mist: some mentions it everytime the topic comes up here ;p
20:30 pink_mist oh :P
20:30 sri s/some/someone/
20:31 sri i think the "LeoNerd is working on it" count is now at 4
20:31 perlpilot Maybe if LeoNerd were paying attention here, it would get bumped up in priority in his head so that it might actually be implemented
20:31 pink_mist I don't actually think he *is* working on it :P
20:32 Grinnz_ he did have a discussion about it on p5p the other day
20:32 Grinnz_ http://www.nntp.perl.org/group/perl.perl5.porters/2016/07/msg237517.html
20:33 batman oh man... await would be awesome
20:33 Grinnz_ not much came of it
20:36 perlpilot <LeoNerd> People should prod me about it.
20:36 perlpilot See?  :)
20:38 punter preaction, do you think it's going to take a lot of work & effort to make it normalize posted JSON as well?
20:38 jberger punter: can any of the normalizers walk a data structure?
20:38 preaction punter: did you open up the code and check?
20:38 sri punter: actually not, you should be able to filter the request body
20:38 perlpilot preaction: why would he read the code when you read it already?
20:39 sri the structural JSON elements are plain ascii and unaffected by normalization
20:39 sri i think
20:39 sri if it normalizes bytes
20:39 punter perlpilot, I looked at the code, but it was more advanced than I can understand
20:39 sri i have not actually checked ;p
20:40 jberger ah, good point sri, if it acts on bytes them yeah, just apply it to the body
21:08 PopeF0 joined #mojo
21:27 punter unless body also contains some file uploads (then apply only to the text fields)
21:27 punter right? right
21:27 ningu jberger: so this is really weird but I am checking now and csrf_token is set to "371ad7b2f34cf58c8b386f1dbabc51ceaee61ffc" and it comes back to the server as that exact string, and yet the validation fails
21:27 jberger punter: it isn't our plugin, you might want to talk to the author
21:27 ningu I will delve into the validation code I guess to see if I can determine the reason
21:28 jberger punter: in fact, that is exactly what the mojolicious-universe email list could be used for
21:28 punter indeed
21:40 ningu jberger: if I understand correctly, the csrf token is stored in the session which means for it to work the user must have cookies enabled
21:41 jberger yes
21:41 ningu ok. it's conceivable he has cookies disabled in Chrome
22:06 ningu yes, cookies are disabled and that is the issue
22:30 ningu is there a recommended way to handle the situation where someone has cookies disabled?
22:34 ningu joined #mojo
22:34 Grinnz_ if they disable cookies, they cannot hold a session on any website
22:35 punter execept with session id in URL
22:35 punter which is insecure though
22:35 Grinnz_ egh
22:35 Grinnz_ yeah, some sites used to do that
22:35 punter amazon did it
22:35 punter i think
22:36 Grinnz_ not as much insecure as just ugly
22:36 Grinnz_ but amazon's urls are all ugly :P
22:36 punter you can't share urls
22:36 Grinnz_ true
22:36 Grinnz_ and everyone just copypastes urls these days so you can't use it as a practice
22:37 ningu Grinnz_: yes, that is also my view
22:37 ningu but the question is being asked by someone, so...
22:37 Grinnz_ which is why the whole EU crusade against cookies is wildly misguided
22:38 ningu yeah
22:38 ningu ok so let me rephrase the question
22:38 ningu how do I detect that the person has cookies disabled in order to tell them to enable them?
22:38 Grinnz_ you might be able to leverage local storage, but I don't know of anyone that does this, and I don't know if it can be scoped to the browser session like cookies can
22:38 Grinnz_ try to store a cookie and see if you get it back, heh
22:38 ningu well, yes
22:39 Grinnz_ without doing a series of requests there's really no way to tell the browser's settings
22:39 ningu but basically you can't distinguish that from an actual CSRF attempt
22:39 ningu er... well
22:39 ningu yes, because with a CSRF attempt the cookie would be there but the token wouldn't
22:40 ningu so I guess the case is (1) POST request taking CSRF token, (2) session has no CSRF token
22:40 ningu in that case tell the user something about their cookies
22:41 punter looks good
22:41 ningu ok, that is pretty simple
22:41 ningu I just don't want to reply wth "bad CSRF token" in that case or some other error that a normal person won't understand
23:15 sri joined #mojo
23:16 * sri tries irccloud again
23:21 sri it's so pretty on android as well
23:22 jberger sri: batman has been making progress on the convos rewrite
23:22 jberger #justsayin
23:22 PopeFelix Should Mojo::URL::to_abs kill the userinfo portion of the URL?
23:22 sri ah, nice
23:22 sri irccloud is $40 per year now
23:23 sri left #mojo
23:23 PopeFelix never mind, something on my end
23:25 sri joined #mojo
23:25 jberger PopeFelix: in 7.0 the username and password portion of a url will not render as text
23:26 PopeFelix no, it's not that.
23:26 PopeFelix It's something in my URL construction. My end, I'm sure.
23:28 sri ok, i'm seriously liking irccloud now
23:30 sri maybe an idea for convos http://i.imgur.com/LxUtzyo.png
23:30 sri those avatars with the first character of the name and a color
23:31 ningu similar to gmail
23:37 karjala joined #mojo
23:38 cpan_mojo Mojo-UserAgent-Mockable-1.40 by POPEFELIX https://metacpan.org/release/POPEFELIX/Mojo-UserAgent-Mockable-1.40
23:38 sri and just as i say that i'm turning off those icons to make the layout more minimalistic ;p
23:40 Grinnz_ Discord does that first-character avatar as a default for servers at least, not sure for users (never seen a discord user without an avatar now that I think about it)
23:41 Grinnz_ but yeah I switched discord to remove the avatars from chat long ago
23:42 Grinnz_ the trend of combining multiple messages with only one instance of the username is really annoying to me.
23:42 Grinnz_ and I blame skype :P
23:42 Grinnz_ at least they have individual timestamps in that screenshot, and in discord, so there's that
23:43 Grinnz_ but it makes it hard for me to parse separate messages vs really long messages
23:43 Grinnz_ which often makes people's messages read with unintended pacing
23:51 mr_wibble joined #mojo

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