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

IRC log for #mojo, 2017-06-20

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

All times shown according to UTC.

Time Nick Message
00:09 brunoramos joined #mojo
00:17 veryrusty joined #mojo
00:28 dustinm joined #mojo
02:03 tchaves joined #mojo
02:08 maschine joined #mojo
02:26 noganex joined #mojo
02:35 firnsy joined #mojo
02:53 karjala_ joined #mojo
03:40 schelcj joined #mojo
03:45 irqq joined #mojo
03:49 schelcj joined #mojo
04:50 inokenty-w joined #mojo
05:00 schelcj joined #mojo
05:25 veryrusty joined #mojo
06:32 aborazmeh joined #mojo
06:40 karjala_ joined #mojo
06:44 aborazmeh joined #mojo
06:45 dod joined #mojo
06:48 AndrewIsh joined #mojo
06:51 dod joined #mojo
07:08 dod joined #mojo
07:20 trone joined #mojo
07:41 lev joined #mojo
07:41 lev hi there
07:42 lev i'm sure this question has come up before, but i can't find anything about it googling: how to i force Mojo::Log to use Time::HiRes when logging anything?
07:44 batman lev: you can specify your own format: https://metacpan.org/pod/Mojo::Log#format
07:45 lev i know, but i don't actually want to change the format per se
07:46 lev i was just wondering if there is an easy trick to make it use the Time::HiRes version of the commands Mojo::Log format uses
07:53 lev seems like the easiest solution i can come up right now is actually immitating the original format but replacing time()
07:53 lev app->log->format(sub { shift; '[' . time . '] [' . shift() . '] ' . join "\n", @_, ''; });
08:03 dod joined #mojo
08:07 CandyAngel lev: Perhaps monkey patch the 'time' call in that module?
08:08 CandyAngel lev: http://mojolicious.org/perldoc/Mojo/Util#monkey_patch
08:08 lev oooh, that looks interesting! thanks
08:11 sri that's a terrible idea
08:12 sri don't expect that to keep working when you up or downgrade mojolicious
08:34 nic lev: It is pretty easy to subclass Mojo::Log and then app->log(MyBellsAndWhistlesLogger->new(...))
08:40 sri the correct way is to use app->log->format and/or subclass
08:40 * sri is melting btw.
08:41 * sri waves fist angrily at the current heat wave in germany
08:41 nic it's pretty vicious
08:58 rshadow joined #mojo
09:05 CandyAngel Sorry, I probably shouldn't be giving advice. Upset/lack of sleep/overheating are not conducive to rational thinking :P
09:06 nic rational thinking -- I think I remember that
09:09 nic this morning I was a little late getting the @children out to school, hadn't quite made the packed lunches, and needed to get $daughter to school before the bus left for a daytrip to the beach.  Just as I was thinking "We can still do this", I projectile-vomited across the kitchen.  Skipping the details, they both did (just) make it to where they needed to be.
09:10 irqq joined #mojo
09:10 nic [just mentioning that in case there's someone thinking their day is bad, but turns out to be relatively less bad than that]
09:11 CandyAngel o.o
09:11 CandyAngel That escalated quickly
09:11 CandyAngel Err
09:12 CandyAngel There's a pun or reference or something there I didn't intend to make
09:12 nic :D
09:12 CandyAngel I hope your day gets better >.<
09:12 dod joined #mojo
09:12 nic thanks :)
09:12 CandyAngel Yeah, my situation is definitely not that bad :|
09:13 CandyAngel Just have a leader that.. isn't very good at it >.<
09:14 CandyAngel but like.. are you ill or was it triggered by the stress of trying to get things sorted?
09:16 nic I have a suspicion that there was a problem with the yoghurt I ate at breakfast.  But the bad thing is... my daughter ate a yoghurt from the same batch.  I did warn her teacher, but I didn't want her to miss out on her trip.  So I packed a complete set of clothing in the bottom of her backpack :)
09:17 * nic <-- bad parent
09:17 crab joined #mojo
09:18 nic I just hope it doesn't ruin anyone else's day
09:18 CandyAngel I'm sure you'll find out
09:19 nic Anyway, I hear my Minion backend has tests that don't work on Windows, so I'd better focus on that
09:19 CandyAngel Shiny backend?
09:21 nic https://akenji.files.wordpress.com/2010/03/yokohama-balls.jpg
09:21 CandyAngel I'm pretty sure I don't even need to open that
09:21 nic I do have a fun idea for a new Minion backend, but that's under wraps till I see if it's bonkers
09:24 CandyAngel Is it a Minecraft backend?
09:24 nic :D
09:29 CandyAngel I hate making decisions when it isn't clear which one is the best one >.<
09:30 CandyAngel I'd rather solve the trolley problem :P
09:30 karjala_ :D
09:30 nic I spent three years on a lonely rocky outcrop trying to do a PhD in solving the Halting Problem
09:30 nic (nobody believes me -- and I don't blame you)
09:31 nic I did partially solve it, but in a way you don't want to hear about :)
09:36 CandyAngel What's the big deal? The answer to the halting problem is obvious: All programs will terminate eventually
09:37 nic Do you really want to wait for the result of my computation if it turns out you'll need to wait longer than the lifetime of this planet?
09:40 CandyAngel It doesn't matter. It won't run forever :P
09:41 CandyAngel Even if it gives no output, it will terminate
09:44 nic The serious answer is: There are mini rule engines that can be very powerful [often used for proving theorems, but can be used for diagnosing patients or reasoning about aircraft safety, etc] but you cannot trust anything they say if you haven't established that every computation path has finite termination.
09:45 nic (it's one of their fundamental axioms.  if that's broken, all bets are off)
09:46 CandyAngel Kind of like the 0.9... == 1 thing? :P
09:47 nic well, there's a common workaround for that.  Don't test for $x == $y, test for $y - $delta < $x < $y + $delta
09:50 nic oh, 'computation path', that's something like "3 * ($x +1) + 1" -> "3 * $x + 3 + 1" -> "3 * $x + 4" -> ...
09:50 CandyAngel I mean this: https://en.wikipedia.org/wiki/0.999...
09:55 nic funny thing: Most of maths isn't about numbers, in a similar way that most of computing science isn't about computers
09:59 CandyAngel I'd probably get it if someone would explain why it isn't true for 0.8 recurring == 0.9 recurring
10:03 CandyAngel Anyway, I should be trying to work out if I want to work with someone or not :P
10:04 nic it only works for the digit one less than the base, so in binary 0.111111111* == 1
10:19 CandyAngel That makes even less sense :P
10:19 CandyAngel That would mean 0.1* > 0.2*
10:20 CandyAngel Oh wait, in binary, never mind
10:20 CandyAngel As I said, not in the right place for thinking :P
10:34 gregf_ joined #mojo
10:50 nic http://downforeveryoneorjustme.com/rt.cpan.org
11:14 esh joined #mojo
11:18 nic ah, it's back (rt.cpan.org)
11:42 salva joined #mojo
11:48 stephan48 joined #mojo
12:03 itaipu joined #mojo
12:22 nic sri: https://github.com/kraih/minion/blob/master/lib/Minion.pm#L310 I think that should be s/dependencies/dependents/  ie those subsequent jobs that rely on this one
12:24 nic whereas I think https://github.com/kraih/minion/blob/master/lib/Minion.pm#L520 is correct (cos it's talking about the jobs this one relies upon)
12:24 nic (my kids are my dependents; I am one of their dependencies)
12:34 maschine joined #mojo
12:38 kiwiroy joined #mojo
12:56 gryphon joined #mojo
12:59 gryphon left #mojo
13:01 trone joined #mojo
13:01 Pyritic joined #mojo
13:07 kiwiroy joined #mojo
13:10 trone joined #mojo
13:11 nic I've opened a discussion with bpmedley about the future of Minion::Backend::mysql
13:12 nic It's pretty much abandoned and he's happy to hand over the reigns
13:12 nic I am interested in putting together a Mysql backend, but it probably wouldn't be backwards compatible
13:13 nic So I'm raising the question here: Anyone feel the desire to maintain a back-compat version of it?
13:14 nic If not, I can adopt the namespace in the spirit of a New Beginning
13:15 nic [irc really needs theme music]
13:19 perlpilot joined #mojo
13:22 gryphon joined #mojo
13:22 gryphon left #mojo
13:24 gryphon joined #mojo
13:25 gryphon left #mojo
13:27 kiwiroy joined #mojo
13:33 stryx` joined #mojo
13:42 irqq joined #mojo
13:44 dantti_laptop joined #mojo
13:53 perlpilot joined #mojo
13:55 gryphon joined #mojo
13:55 gryphon left #mojo
14:00 Intern42 joined #mojo
14:00 tchaves joined #mojo
14:12 gryphon joined #mojo
14:14 dantti_laptop joined #mojo
14:19 gryphon joined #mojo
14:22 tchaves joined #mojo
14:38 tchaves joined #mojo
14:42 PryMar56 joined #mojo
15:06 tchaves joined #mojo
15:14 kiwiroy joined #mojo
15:15 zivester joined #mojo
15:23 tchaves joined #mojo
15:26 disputin joined #mojo
15:43 CandyAngel Is Mojo::Redis2 the right module to use Redis in Mojolicious?
15:50 dantti_laptop joined #mojo
15:59 pink_mist I believe so
16:06 karjala_ joined #mojo
16:17 batman CandyAngel: some say that redis is so fast, that you can just use a blocking module... but i guess that depends if the blocking operations are fast, hehe
16:19 Grinnz i haven't needed the nonblocking operation yet... even "transactions" in redis are sent as one command
16:20 Grinnz other than nonblocking support, all the redis clients have mostly the same api
16:20 Grinnz helps the redis protocol is so simple ;)
16:20 Grinnz watch out for how encoding is done, though
16:25 sri i mean, blocking queries are mostly enough even in Mojo::Pg
16:39 tchaves joined #mojo
16:44 arcanez <3 Mojo::Pg
17:04 Pyritic joined #mojo
17:12 irqq joined #mojo
17:19 rshadow joined #mojo
17:24 itaipu joined #mojo
17:24 CandyAngel I'm not doing anything super strenuous.. just distributing chat messages and state changes of other clients
17:27 batman Grinnz: redis might hang on another operation or have a long running task, so that's where i think non-blocking comes in.
17:27 batman or if the redis server is another place
17:27 batman geographically speaking
17:27 Grinnz could be useful for network issues, yeah
17:27 Grinnz if redis is hanging on tasks, i think you have bigger problems :)
17:28 CandyAngel :P
17:29 batman isn't redis still a single thread?
17:29 disputin joined #mojo
17:30 CandyAngel Yeah
17:31 CandyAngel "Redis is a single-threaded server. It is not designed to benefit from multiple CPU cores. People are supposed to launch several Redis instances to scale out on several cores if needed. It is not really fair to compare one single Redis instance to a multi-threaded data store."
17:53 Intern42 joined #mojo
18:03 tchaves joined #mojo
18:15 sh14 joined #mojo
18:33 batman does anyone know if it's possible to release a "try this out" release on cpan? i want to make a change to AssetPack, that might/probably is breaking...
18:34 preaction yes: you can add -TRIAL to the end of your version, or you can add a _# to the end of your version, i recommend -TRIAL
18:35 preaction then CPAN Testers will test your thing, and people can try it and install it if they want
18:35 batman so "1.23-TRIAL" ?
18:35 batman but how can i know if anyone try it out? :P
18:37 preaction CPAN Testers reports, also e-mail, also "Hey, I warned you to try it, if it is failing now it's y'all's damn fault"
18:37 irqq joined #mojo
18:38 Grinnz I recommend (unfortunately) the underscore method when not using something like dzil, it will cause EUMM to set the release status to unstable in the metadata
18:39 Grinnz either way when not indexed by pause it won't be installed by users unless they request the specific version or use cpanm --dev
18:39 batman preaction: it's not such a breakage... it's about how assetpack track files, so if you have files from an URL, then it might download it again
18:39 batman so cpan testers won't pick it up
18:39 batman it's kind of a corner case, but will probably happen if you depend on a google font :P
18:40 Grinnz well it's whether you want random users to get the version while you get people to try it out :P
18:40 batman so it's more like "inconvenient" instead of "will make your app unusable"
18:41 batman maybe i'll just release it with a warning in the documentation...
18:41 Grinnz also for the trial method, -TRIAL is added to the tarball after the version, *not* the version itself
18:42 Grinnz it's not a valid version component
18:44 Grinnz batman: Changes is usually a good place to put notes that affect people who are upgrading
18:45 batman Grinnz: yup
18:45 batman thanks!
18:51 karjala_ joined #mojo
19:08 dod joined #mojo
19:12 dod joined #mojo
19:50 salv0 joined #mojo
19:54 trone joined #mojo
20:28 plicease joined #mojo
20:32 gizmomathboy joined #mojo
20:45 maschine Finally figured out a way to use Mojo at work.  Unfortunately, it means connecting to an MSaccess database in Windows.. ugh.
20:45 Grinnz o_0
20:45 maschine Now what I need is a Mojo::Access plugin. :p
20:59 arcanez maschine: can't win em all
20:59 arcanez and awfully generous calling Access a database.
20:59 Grinnz it's slightly more of a database than Excel
21:00 Grinnz ...only slightly
21:00 maschine I'd love it in another format but I gotta work with what I'm given :p
21:01 maschine I swear I could replace 75% of our horrible in-house tools with Mojo/Perl..
21:07 sri mojo all the things
21:27 maschine as you would imagine, connecting to Access is annoying - so the 32 bit driver is the only one that works when I run a straight perl script, but in Mojo only the 64 bit driver works. lol
21:28 Grinnz microsoft seems to prefer the "make all the 32 bit stuff keep working" approach rather than "make proper 64 bit stuff"
21:33 tchaves joined #mojo
21:35 maschine is there a way to read the path when browsing to a file?  like 'name' in Mojo::Upload?
21:36 nic "browsing to a file"?
21:37 maschine well, selecting the file I want to connect to (mdb).  I don't want to upload it of course, I just need the name and the path.
21:37 nic ah
21:39 Grinnz still not sure what you mean really
21:39 Grinnz what's selecting the file? and how?
21:40 disputin joined #mojo
21:41 maschine I want to tell my App the path & file name of the database to connect to - and not have the database hard coded, because it won't always be the same file.
21:42 Grinnz but tell from where?
21:43 Grinnz config file? commandline option? over http?
21:43 maschine preferrably http
21:44 Grinnz ok so passing them as query or post parameters?
21:44 maschine yes exactly..  sorry if I wasn't clear.
21:45 Grinnz well that's only going to be useful for that one request since another request might go to a different file, so it wouldnt be able to maintain a persistent connection
21:45 Grinnz but otherwise, just like reading any other parameters
21:46 maschine yeah, that's fine, it would only be used once.  I guess I'm just not sure what parameter would contain the path, and how to do it without creating an upload object I'm just going to throw away
21:47 Grinnz why would it create an upload object? you're actually doing a file upload form?
21:47 schelcj joined #mojo
21:48 Grinnz if you want the form to just send the path and not the file i dunno, i'd use javascript to do that but my forms are usually javascript already :P
21:48 Grinnz but that would obviously not work on anything other than localhost...
21:49 maschine yeah hrm.  that might work.  Depends if I can make launching the App easy enough for anyone..
21:49 pink_mist surely the correct way would be to fill up a select box with all the paths you have and make the user select one of them
21:50 maschine We have like 100 active clients and thousands of project directories.. that's probably not going to work unfortunately.
21:54 maschine looks like I'll have to figure out a different way:
21:54 maschine https://stackoverflow.com/questions/15201071/how-to-get-full-path-of-selected-file-on-change-of-input-type-file-using-jav
21:55 Grinnz yeah, i probably would try something different rather than trying to abuse the 'file' form element
21:56 maschine a config file might work, we're used to making lists of files like that anyway.
22:15 CandyAngel Can I benchmark my changes using the existing tests?
22:23 Grinnz this is interesting... but why on earth is the first step "use a headless browser to dump the HTML" instead of "use a user agent"
22:24 Grinnz https://engineering.semantics3.com/web-scraping-in-perl-using-mojo-dom-a453229c732f
22:51 maschine Grinnz: that is rather confusing, but I guess because he's using Mojo::DOM by itself, without the rest of Mojolicious?
22:51 Grinnz i mean it also could be so the browser can let the javascript run before dumping the html, but that's not specified either way
22:58 Pyritic joined #mojo
23:30 CandyAngel sri: The websocket optimisation I mentioned yesterday: https://github.com/kraih/mojo/pull/1103
23:36 arcanez pack/unpack makes my head hurt.
23:39 Grinnz I make it a policy to never actually think about those functions
23:39 Grinnz I have been much happier since.
23:39 CandyAngel :P
23:40 arcanez seems powerful
23:51 nic I thought my encryption stuff was going to be really laborious and buggy.  And then I discovered 'pack' :)  It's just the right amount of magic when slotting things into a binary buffer.  Reminds me of packing CICS transactions into a mainframe.

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