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

IRC log for #mojo, 2017-08-31

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

All times shown according to UTC.

Time Nick Message
00:29 itaipu joined #mojo
00:30 disputin joined #mojo
02:27 noganex joined #mojo
02:30 purl joined #mojo
02:31 purl joined #mojo
04:04 dboehmer_ joined #mojo
04:26 inokenty-w joined #mojo
04:44 aborazmeh joined #mojo
05:26 genio joined #mojo
06:52 AndrewIsh joined #mojo
07:09 n16gel joined #mojo
07:10 bianca joined #mojo
07:13 Vandal joined #mojo
07:16 bianca joined #mojo
07:27 trone joined #mojo
08:04 rshadow joined #mojo
08:04 karjala_ joined #mojo
08:49 petru joined #mojo
09:53 prg joined #mojo
10:50 petru joined #mojo
10:52 pirateFinn_ joined #mojo
10:57 tchaves joined #mojo
11:11 itaipu joined #mojo
11:39 bpmedley joined #mojo
12:02 petru joined #mojo
12:08 bianca joined #mojo
12:13 genioweb joined #mojo
12:21 sri buying usb-c cables is a total nightmare
12:22 zen how come?
12:22 sri you never know if it will actually work for the task you had in mind
12:22 zen I thought usb C was all in one
12:23 sri it's like a collection of a dozen specs, and every cable supports a different subset
12:23 coolo if you buy a real usb c cable, it's basically a mini-computer
12:23 coolo so cable producers have to chose between usb c spec compliant or being able to sell for less than 100 bucks
12:23 sri it's crazy
12:24 zen so much for standards
12:25 coolo sri: well, as long as samsung ships their 'usb c' tablets with a cable that is only usb c on one side and a usb a power plug, what do you expect? :)
12:25 sri some usb-c cables are for charging only, no data, some support the display port protocol, some are thunderbolt 3, different usb versions, some have extensions like quick charge... and so on...
12:26 sri coolo: same for apple
12:26 coolo zen: with usb c the cable is part of the negotiation process about currency and power and data rate, so they are still usb c compliant - they just say no to everything :)
12:26 sri of course apple makes the best damn usb-c power cable with 85W, but still... no data transfer sucks
12:26 coolo sri: at least they all *look* the same - which makes searching for the right one so much more fun
12:27 genio it currently just means a dongle for everything, which is beyond annoying. USB-C--
12:27 coolo it's a bit like pipes now - theoretically you can put oil and water through the same pipe, but still you don't want to mix :)
12:27 sri i also had a lot of fun with the dell thunderbolt docking station i got from work, it only supports the display port protocol with 30Hz...
12:28 CandyAngel .. why even bother?
12:28 coolo CandyAngel: ... apple
12:28 CandyAngel Oh right, so they can say "Supports DisplayPort!"
12:31 sri the usb-c connector is kinda neat though
12:31 sri i think the trick is to buy a google pixel phone, they come with the perfect usb-c cable that supports all the specs
12:32 sri or so i heard
12:35 sri oh, did i mention that i've already had two cables that actually crash laptops?
12:36 sri both usb-c to display port adapters from different manufacturers
12:42 genio heh. that definitely does nothing to improve my feelings towards USB-C
12:42 mishanti1 How about we quit tech and start woodworking?
12:45 tcohen joined #mojo
12:53 rshadow joined #mojo
12:56 CandyAngel But then you miss out on the fun meetings :P
13:11 genio woodworking meetings instead?
13:18 gizmomathboy joined #mojo
13:31 dantti_laptop joined #mojo
13:37 Pyritic joined #mojo
13:38 Alex342 joined #mojo
13:38 Alex342 Hey guys
13:38 Alex342 I get this warning on testing :
13:38 Alex342 Overwriting existing sub 'Mojo::Template::Sandbox::a040e575e4cc6de4dee962625cf6e35c::M' with sub 'M' exported by match::smart at template page/page_list.html.ep line 1.
13:39 Alex342 Should i be worried?
13:42 genio match::smart worries me
13:44 genio What version of Mojo are you using and what does that template look like?
13:46 Alex342 i got this on that template: 'solved' |M| $page_status
13:47 n16gel joined #mojo
13:47 Alex342 i got the latest verion of mojo.
13:48 Alex342 I think. how do I find out which version I'm using?
13:48 genio type mojo version on the command line
13:48 Alex342 7.36
13:49 Alex342 So it's not the latest
13:52 genio why are you using match::smart?
13:53 genio smartmatch--
13:56 Pyritic joined #mojo
13:57 marty joined #mojo
13:58 bianca genio: what do you recommend for finding out if an element exists in an array?
13:58 bianca smartmatch (~~) is experimental
13:59 bianca would you implement a helper?
13:59 CandyAngel bianca: Mojo::Collection::first?
14:00 CandyAngel Or List::Util::any()
14:00 genio if (grep {$_ && $_ eq 'foo'} @array)
14:01 bianca oh
14:01 bianca makes sense
14:01 bianca any() seems a reasonable option I think
14:01 genio grep is good enough for me in most cases and apparently faster than any() for most cases
14:02 genio just uglier
14:02 bianca is it faster? They say any shortcircuits after finding the first match
14:03 bianca does it have a lot of overhead?
14:05 genio https://github.com/dbsrgits/dbix-class/commit/87b1255103d7b8873b225416cb381c50011f4c06
14:06 CandyAngel A good example of why you shouldn't presume something is a performance improvement. You should benchmark :)
14:07 genio ribasushi explained it better than I would be able to in that commit message
14:08 bianca sounds reasonable. He says that's due to arrays being rather short, so maybe the any() function call would do better in large arrays where the element is at the beginning.. but that does not account for much improvement anyway
14:10 ribasushi bianca: "large" in this context would mean tens of thousands or more elements
14:11 ribasushi note - it is possible that this is your constraints - for instance in some software I work I had to move from hashes to array because a million hashes do not fit in memory very well, so as CandyAngel said: profile based on your real world use case
14:12 ribasushi .oO( it's awesome someone reads my commit messages ;)
14:12 bianca yeah I think I have like tens of elements :)) so good ol' grep would work well enough
14:13 ribasushi s/well enough/way better than/
14:13 bianca :)) true
14:19 genio ribasushi++ # well thought out commit messages. I'm known to go, "got rid of x in favor of y" :)
14:21 karjala_ joined #mojo
14:23 tcohen is there some handbook on design patterns for writing Mojo REST apis?
14:25 tcohen I wrote a plugin for adding pagination headers (Link, X-Total-Count) and was thinking how do people write the code to build their DB queries (for example
14:25 tcohen http://paste.koha-community.org/627
14:26 tcohen do you write a plugin for (reusing) that?
14:26 jberger hmmmm, I wonder if Mojo::Collection could/should learn some of the newer additions to List::Util, like all, any, none, notall etc
14:27 jberger and yes I understand the performance notion, but the ease of use might be nice when performance isn't key
14:28 CandyAngel Aren't most just shorthand for things like $c->grep(sub{..})->size ?
14:34 sri yea, i've optimized *a lot* of code by just using grep instead of those closure based functions
14:45 foristh joined #mojo
14:45 foristh hi. anyone using Minion::Backend::mysql and expereience issue with missing 'receive' method in Worker.pm?
14:48 gryphon joined #mojo
14:57 disputin joined #mojo
14:59 mib_ygqjld joined #mojo
15:06 sri foristh: the mysql backend is not maintained very well
15:06 sri it prolly requires an old version of minion
15:12 foristh buuuu, ok, thanks anyway, sri
15:14 sri postgres and sqlite are the well supported backends at the moment
15:14 sri if you care enough maybe you can adopt the mysql backend
15:22 sivoais joined #mojo
15:55 preaction foristh: i have a forked version that i've fixed: https://github.com/preaction/Minion-Backend-mysql
15:56 disputin joined #mojo
15:56 preaction bpmedley has not yet responded to my request to adopt the backend https://github.com/brianmed/Minion-Backend-mysql/issues/7#issuecomment-324084474
15:57 preaction it's presently powering cpantesters
16:01 ChmEarl joined #mojo
16:01 Grinnz can confirm, the usb-c cables that came with my pixel are great, and i had no idea there were problems with such cables
16:02 Grinnz match::smart does not fix the problems with smartmatch so it's rather pointless. Smart::Match on the other hand allows you to be explicit with your matching so is perfectly reasonable
16:03 Grinnz for example, finding if an item is in an array: $foo ~~ any(stringwise(@arr))
16:03 Grinnz can't speak to how it would perform, but some like that syntax better.
16:06 jberger CandyAngel with the shortcircuiting etc
16:06 Grinnz they can be useful for shortcircuiting and readability
16:07 Grinnz tbh i've only used any() and none() out of those
16:07 jberger all can sometimes be nice
16:08 jberger they all just specify different types of short circuit really (and don't setup intermediate values like grep does)
16:09 jberger but of course the method overhead probably washes that out
16:09 Grinnz a keyword version of them would be nice and optimized... and require perl 5.14
16:09 jberger so yeah, semantic readability is probably the best argument for it
17:04 elik joined #mojo
17:24 Pyritic joined #mojo
17:51 rshadow joined #mojo
18:14 fuogo joined #mojo
18:16 fuogo Hello, I am using Mojolicious::Lite.  Is there a way to run something just once on start and reload (hypnotoad)?  If I call, say, a helper, before app->start and with <N> workers, the helper is being called <N> times, so I am trying to see if I can run a code block just once everytime the app is started or reloaded.  Any ideas?
18:16 Grinnz anything in startup will run in those cases
18:17 Grinnz oh, in lite
18:17 Grinnz running it before app->start would run it before forking, not sure what you mean
18:17 fuogo how do I define startup in Mojolicious::Lite app?  I have seen startup {} in Mojolicious, so trying to figure it out ..
18:17 Grinnz everything before app->start is the equivalent of startup
18:22 fuogo actually, sorry, it's not <N> times (<N> workers) but it's being called twice.  So, I am calling a helper, say, app->haha and it has just one line to print, and when I send SIGUSR2, I am seeing the helper being called twice and two lines getting printed.
18:34 karjala_ joined #mojo
18:38 fuogo ah, grr, I can't reproduce this in a simple test Lite app. It seems an issue issue with my semi-monster app somewhere.  I will dig .. thanks for the help!
19:25 petru joined #mojo
19:28 bianca joined #mojo
19:39 Janos joined #mojo
21:01 bianca joined #mojo
21:29 marty joined #mojo
21:30 marty joined #mojo
21:32 kiwiroy joined #mojo
21:56 disputin1 joined #mojo
22:03 kiwiroy joined #mojo
22:20 bianca joined #mojo
23:01 gizmomathboy joined #mojo
23:17 disputin joined #mojo

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