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

IRC log for #mojo, 2017-08-22

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

All times shown according to UTC.

Time Nick Message
00:50 meredith joined #mojo
01:13 bit_shifter joined #mojo
01:25 bit_shifter Any easy way to use Mojo::File's spurt with UTF-8 encoding specifically? When I try to spurt some text that included an "em dash", perl errors out with "wide character in syswrite".  Currently using Mojo::File->new(...)->open('>:encoding(UTF-8'); then "print $fh ..." on the next line.
01:28 Grinnz use Mojo::Util 'encode'; $file->spurt(encode 'UTF-8', $text);
01:29 bit_shifter Grinnz: Ah, perfect.  Thank you.
01:29 Grinnz spurt and slurp don't do anything with encoding, so it always must be handled manually or by a layer on the filehandle like you did
01:30 Grinnz but note spurt uses syswrite, so it ignores layers, I think?
01:30 bit_shifter hm
01:30 Grinnz some alternatives with this sort of thing built in: Path::Tiny->spew_utf8, File::Slurper::write_text
01:31 bit_shifter How is it that the call to spurt takes that UTF-8 encoding into consideration?  Docs show just a single arg.
01:31 Grinnz it doesn't. that's an arg to encode()
01:31 bit_shifter I'll try the Mojo::Util way first.
01:31 bit_shifter Oh, I see
01:59 mishanti1 joined #mojo
02:20 chandwki joined #mojo
02:38 noganex joined #mojo
04:04 dboehmer_ joined #mojo
04:59 VVelox joined #mojo
05:37 jasanj CandyAngel:thanks.
05:42 inokenty-w joined #mojo
06:30 trone joined #mojo
06:53 AndrewIsh joined #mojo
06:59 dod joined #mojo
07:04 dod joined #mojo
07:13 Vandal joined #mojo
07:21 ivi joined #mojo
07:22 petru joined #mojo
07:28 dod joined #mojo
08:03 CandyAngel jasanj: You're welcome. Sorry it doesn't really help fix your issue :\
08:25 Andreq joined #mojo
08:25 Andreq hello
08:25 purl hey, Andreq.
08:25 CandyAngel Heyas Andreq
08:26 Andreq How are you guys?
08:31 prg joined #mojo
08:36 rshadow joined #mojo
08:47 mariusz joined #mojo
09:07 brunoramos joined #mojo
09:22 rshadow joined #mojo
09:44 rshadow joined #mojo
10:16 zerah joined #mojo
10:29 jasanj https://github.com/kraih/mojo/issues/1123
10:30 jasanj I file another windows issue for mojo timer co-work with IPC::Run3
10:40 CandyAngel jasanj: You'll probably be, at least, asked to clear that code up. You have bits in it that don't do anything (use .. ForkCall)
10:41 CandyAngel And your use of "and" isn't super clear. You might want to change the arguments to waitpid so that are parenthesised: waitpid($pid, WNOHANG) and Mojo::..
10:41 CandyAngel so they are*
10:42 CandyAngel You can also (kind of) replace that first line with: use Mojo::Base '-strict'
10:43 CandyAngel http://mojolicious.org/perldoc/Mojo/Base#DESCRIPTION
10:46 CandyAngel Oh, and you aren't using Mojo::IOLoop
10:48 CandyAngel Also.. not being familiar with fork, aren't you starting the IOLoop in both parent and child? :\
10:51 bwf joined #mojo
11:01 tchaves joined #mojo
11:05 S joined #mojo
11:38 mib_oli2bq joined #mojo
12:47 dod joined #mojo
12:48 dotan_convos joined #mojo
12:52 cforbes joined #mojo
12:52 cforbes hi everyone
12:53 cforbes just a quick question, i have a useragent that is getting json string containing a base64 image.  How do i store it as an image on the local file system
13:04 gordonfish joined #mojo
13:04 cosimo joined #mojo
13:11 cforbes I have created a new file using Mojo Asset then add_chunk and i get a size and use move_to it create a file but nothing in it
13:14 cforbes If i conver the base64 online it works fine
13:14 cforbes If i convert the base64 online it works fine
13:14 cforbes so there is an image in there
13:19 gizmomathboy joined #mojo
13:22 sri don't use Mojo::Asset::* like that
13:22 sri use Mojo::File instead
13:23 sri and Mojo::ByteStream::b64_decode
13:34 gryphon joined #mojo
13:36 sh14 joined #mojo
13:42 mcsnolte joined #mojo
13:58 dod joined #mojo
14:03 karjala_ joined #mojo
14:09 cosimo joined #mojo
14:16 zivester joined #mojo
15:03 ChmEarl joined #mojo
15:05 jacoby joined #mojo
15:09 PopeF joined #mojo
15:22 dod joined #mojo
16:19 jberger sorry I wasn't there to answer the ForkCall question
16:19 jberger thanks to CandyAngel for helping out
16:20 jberger I was eclipse chasing
16:20 jberger really spectacular thing, if one goes near any of you ever, make the effort
16:20 jberger totally work it
16:20 jberger worth
16:23 ribasushi .oO( "I was eclipse chasing" sounds something like https://what-if.xkcd.com/42/ )
16:34 dod joined #mojo
16:39 CandyAngel jberger: Sounds like you had a good time!
16:41 jberger I really did
16:41 jberger though we drove about 1200 miles in 2 days
16:41 jberger more the yesterday then sunday
16:41 jberger https://twitter.com/joelaberger/status/899744182692196353
16:58 sh14 joined #mojo
17:38 itaipu joined #mojo
18:32 tchaves joined #mojo
18:43 rshadow joined #mojo
18:47 DerAlex joined #mojo
18:53 itaipu joined #mojo
19:06 dod joined #mojo
19:25 CandyAngel sri: With regards to Mojo::Base documentation, are you looking for a Mojolicious::Guides thing?
19:29 DerAlex Hey guys and girls, just wanted to let you know: Mojolicious is _awesome_. Being a Perler since many years and a PHP web dev since many years it is really refreshing working with Mojo. Thank you for the work and keep it up!
19:30 CandyAngel DerAlex: Always good to hear positive feedback like that :)
19:31 CandyAngel Even if you're not a major Mojo contributor :P
19:32 DerAlex ;) I planned to contribute to Mojo after doing some projects with it and getting familiar with it :)
19:32 DerAlex But one step after another :)
19:33 * CandyAngel nods
19:34 CandyAngel I'm learning the internals because I am butchering Mojo for a non-web project, but hopefully it will put me in a better position to help
19:34 CandyAngel Even if not to Mojo code directly, I can answer questions better :)
19:36 DerAlex And that's always a good thing :)
19:37 jberger DerAlex: very glad you like it
19:40 CandyAngel jberger: If you give me a minute, I can try and see if using socketpairly and parent keepalive fixes the time limit in ForkCall under Windows..
19:53 karjala_ joined #mojo
19:54 DerAlex btw: What's the best practice to use a database (abstraction layer) with Mojo? I found Mojo::mysql which seems adequate, but is there a "better" way to do it, dbal-like?
19:56 CandyAngel Like using DBIx::Class (which you can do)
19:56 CandyAngel ?
19:57 Grinnz a connection pool like Mojo::mysql is fine
19:57 DerAlex Ah, ok, didn't know that I can use that too CandyAngel
19:57 Grinnz DBIx::Class is an ORM, which is very different, and its up to you whether you want that
19:57 Grinnz but it serves as both ORM and connection pool
19:58 CandyAngel Am I thinking of something else that is a DBAL?
19:58 Grinnz never heard of dbal
19:58 DerAlex For the current use case Mojo::mysql seems fine, but for further projects I would like to use an ORM like DBIx::Class Grinnz
19:58 CandyAngel DataBase Abstraction Layer, isn't it?
19:59 DerAlex PDO from the PHP world is a DBAL for example
19:59 Grinnz that's just DBI, which underlies all of these
20:00 DerAlex A dbal is just an database-agnostic way to make transactions to a database (mysql, pg etc.)
20:00 Grinnz it's better to use a connection pool than DBI directly though, for several reasons
20:00 Grinnz fork safety, disconnect handling, usually simpler transaction handling
20:01 DerAlex Indeed
20:01 Grinnz DBIx::Connector is a database agnostic connection pool, but being database agnostic is overrated
20:01 Grinnz at least at the level where you're writing queries
20:22 CandyAngel jberger: Using socketpairly() instead seems to work, but I think it would involve a fairly substantial change to ForkCall to get it working properly
20:23 CandyAngel But that might be my naivety about IO::Pipely talking :)
20:23 sri DerAlex: thanks :)
20:24 sri CandyAngel: not 100% sure on the Mojo::Base docs thing, it's definitely not enough for a whole guide, could be a little intro like in Mojo::Template or a little section in the cookbook
20:36 DerAlex Is there any example Mojo application with some kind of more extensive model?
20:37 Grinnz beyond the one included in Mojo::mysql or Mojo::Pg?
20:38 DerAlex Yep
20:38 sri they have CRUD fairly well covered
20:38 sri if you're looking for database tricks Minion::Backend::Pg has a few
20:40 DerAlex Ah great, thanks!
20:40 sri (slightly different kind of model, but lots of inspiration i think)
20:41 sri for bigger apps, don't think we have something we currently recommend as a learning example
20:42 sri most i have are just slightly different variations of the blog example https://github.com/openSUSE/build-check-statistics/blob/master/lib/SUSE/BuildCheckStatistics/Model/Packages.pm
21:15 Grinnz http://cpanmeta.grinnz.com/ is much simpler using vue.js, and cause i stopped using the js tab navigation
21:16 Grinnz (mostly so i could use the fragment for searches instead)
21:58 DerAlex Going to sleep now, see you all tomorrow. The examples you provided sri are very good, thanks for that! :)
23:37 sjn joined #mojo
23:41 marty joined #mojo

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