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

IRC log for #mojo, 2017-10-03

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

All times shown according to UTC.

Time Nick Message
00:31 vicash left #mojo
01:13 tchaves joined #mojo
01:40 zivester joined #mojo
02:02 zivester joined #mojo
02:45 noganex joined #mojo
03:09 iamb joined #mojo
04:00 marty joined #mojo
04:04 dboehmer_ joined #mojo
04:46 aborazmeh joined #mojo
05:37 inokenty-w joined #mojo
06:22 dod joined #mojo
06:23 salva joined #mojo
06:24 dod joined #mojo
06:25 Vandal joined #mojo
06:31 dod joined #mojo
06:45 AndrewIsh joined #mojo
07:26 trone joined #mojo
08:10 leont_ joined #mojo
08:35 karjala_ joined #mojo
08:45 mib_vp4o2e joined #mojo
09:01 rshadow joined #mojo
09:28 ilbot2 joined #mojo
09:28 Topic for #mojo is now 🍩 nom nom | http://mojolicious.org | http://irclog.mojolicious.org | http://code-of-conduct.mojolicious.org
11:05 tchaves joined #mojo
11:20 dod joined #mojo
11:28 bobkare joined #mojo
12:47 tcohen joined #mojo
13:04 karjala_ I have a variable $log_entry that contains something like "date [warn] some warning" or "date [info] some info" - what should I do to make a template print this variable, but with the [info] substring with green color, or [warn] with red?
13:04 karjala_ I think somehow I need to use the b() helper
13:04 karjala_ but how?
13:06 jberger To the logger or to the web?
13:06 jberger logger look for ASCII control codes
13:07 jberger Web just span tags with classes
13:07 karjala_ to the web
13:08 karjala_ jberger, the problem is that I need to insert <span class="green"> unescaped inside the variable
13:09 karjala_ and print the whole thing xml-escaped, but the span tag should be unescaped
13:10 karjala_ One way is to create a helper that will split, insert tags, apply b() wherever it must, rejoin
13:10 karjala_ I'm wondering if that's the only tidy way
13:11 karjala_ or if I could just do (before the <%= $log_entry %>): $log_entry =~ s/\[warn\]/something goes here/
13:12 jberger If you consistently use b to wrap things as you go it shouldn't be an issue
13:13 karjala_ it looks a bit complicated to implement
13:14 karjala_ not terribly simple
13:17 karjala_ jberger: would this work? <%= b('<span>').'[info]' %>
13:18 karjala_ would this <%= b('<span>').'1 > 2' %> produce this? <span>1 &gt; 2
13:19 karjala_ jberger, what did you mean by "consistently use b to wrap things"?
13:23 karjala_ I haven't understood what I should do
13:41 tchaves joined #mojo
14:12 gizmomathboy joined #mojo
14:21 gryphon joined #mojo
14:26 tchaves joined #mojo
14:54 jberger did people see this: https://www.ynonperek.com/2017/09/28/perl-mojolicious-web-development/
15:05 maschine that's a pretty nice comprehensive guide for introducing mojo
15:17 mcsnolte joined #mojo
15:23 mishanti1 joined #mojo
15:35 sh14 joined #mojo
15:38 gizmomathboy joined #mojo
15:39 arcanez can hypnotoad be sent a signal to restart (re-read updated code)?
15:40 pink_mist it supports hot restart
15:41 arcanez yeah, but if I have it running in the foreground in a docker container, that causes the container to exit
15:42 arcanez perhaps I should just tail something instead of running in the foreground
15:43 jberger arcanez: if I understand containers correctly, why not just start another container with the new code and then cut over your load balancer?
15:43 jberger injecting new code into a container sounds distinctly un-containery
15:44 jberger (that said, I'm not really on the container bandwagon, so take what I say with a grain of salt)
15:47 karjala_ joined #mojo
15:49 arcanez doing dev at this point.. and my flow might not be the best
16:34 good_news_everyon joined #mojo
16:34 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vdWFc
16:34 good_news_everyon mojo/master 29f56b0 Sebastian Riedel: just pass along the default
16:34 good_news_everyon left #mojo
16:47 jberger I feel like perhaps I've asked this before, but is there a method like accepts but for the request content type?
16:52 jberger heh, I did https://gist.github.com/jberger/3191e551d3f21d71f495e7de4c130ad0
16:55 jberger https://irclog.perlgeek.de/mojo/2017-04-19#i_14451710
16:56 jberger ok so I don't love the name respond_for, but I actually need this code for $work
16:56 jberger so anyone got name suggestions?
17:12 rshadow joined #mojo
17:20 dod joined #mojo
17:56 trone joined #mojo
18:28 Rob joined #mojo
18:29 Rob Hi. Can someone help me to build a multipart content?
18:29 jberger Rob: from a form?
18:30 Rob I need to send multipart/related with two parts - JSON and file data
18:30 CandyAngel jberger: Wouldn't it be more like "respond_to"..?
18:31 jberger response_to already exists
18:31 Rob I'm struggling with the Mojo:Content and Asset docs.
18:32 jberger Rob: remember that the class documentation is reference only
18:32 jberger have you read the relevant guides?
18:33 Rob Sure. But this doesn't seem to be addressed anywhere else. Most of the guides are about writing a web app
18:33 Rob The only stuff about ua is fairly basic
18:34 Rob I'd expect something like $req->content->add_part
18:34 jberger before we go down this path what are you trying to do
18:35 Rob Upload a file to Google Drive
18:35 jberger you mention ua, are you trying to upload a file or are you trying to stream ...
18:35 jberger ok
18:35 jberger and it is just a multipart
18:35 jberger http://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#Large-file-upload
18:35 Rob yeah, multipart/related
18:35 Rob I'll take a look
18:37 Rob That doesn't build the right body. It requires JSON metadata for the first part and the file data for the second
18:38 jberger ok well now you are into some very specialized stuff :-P
18:38 Rob https://developers.google.com/drive/v3/web/multipart-upload
18:39 Rob Yup :)
18:39 Rob Which is why it isn't in the cookbook
18:40 jberger I'd have to read the docs myself to find that out, but I'm kinda in the middle of something
18:41 Rob ok I can wait. Can you get back to me?
18:42 jberger I'm guessing you start by creating a new http://mojolicious.org/perldoc/Mojo/Content/MultiPart and using it as the request's content
18:43 Rob Ye I got that far, but I don't see how to add content
18:43 jberger parts?
18:44 Rob So create two Assets and pass them to ->parts?
18:44 jberger no, create two Content::Single's and pass them to parts
18:45 jberger like its shows
18:45 jberger this is going to take a bit of reading on your part I'm afraid :-P
18:46 jberger once you do though, this would make a great blog post, hint hint :D
18:46 jberger it is actually quite an interesting problem
18:46 Rob Yeah I've done a few hours work. Came here hoping there would be an easy answer.
18:46 Rob Hehe sure. There's a blog?
18:46 jberger I've really only ever used multipart for simple file uploads
18:47 jberger well yes, Mojolicious has a blog
18:47 jberger but mostly people just post on personal blogs or on blogs.perl.org
18:47 Rob Yeah, this is even multipart/related which I've never heard of before.
18:47 jberger nor I
18:47 Rob Okay. I'lll get it going first :)
18:48 jberger indeed I didn't understand that that was meant as an actual thing when you said it before
18:48 jberger like "something related to multipart", hehe
18:48 Rob I haven't read the RFC yet. Might be a good start
18:49 Rob I'll let you know how I get on. Thanks Joel
18:54 CandyAngel I wonder if Zoffix still has their cookie file stuff for UserAgent :P
18:57 sri no reason we can't have a generic multipart generator
18:58 CandyAngel I also need to figure out how to get Linux at work, so I can have Minion :P
18:59 rshadow joined #mojo
18:59 jberger what about Mojolicious-Plugin-RequestNegotiation ?
19:00 jberger I think there'd be two helpers, sent which is the analog of accepts
19:00 jberger and then ... when_sent ... or some other name, that is the analog of respond_to
19:01 jberger then again with those names Mojolicious-Plugin-Sent seems be more clear
19:03 jberger sri: blessing or concerns on either of those names?
19:10 maschine CandyAngel: Tell me about it..  I could do some cool stuff with minion.  I don't think we even have any Linux servers.
19:11 maschine I'm hoping when I get to actually deploying the app I've been working on, I can have my own machine and it won't have to be Windows based
19:11 maschine I have some really long blocking routines that would be much faster if I could have minion do it in the background
19:12 maschine Or if I understand how to write a non-blocking controller well enough to develop an API for MS Access. :p
19:15 jberger any hope in WSL for both of you?
19:19 maschine I think you need Windows 10
19:19 jberger you do
19:19 maschine we're still on 7 and our IT is slow as molasses to update
19:19 jberger here's your reason
19:19 maschine The good news is I'm usually one of the first to get a new machine, but mine is already at least 5 years old and I haven't heard anything :p
19:19 jberger ("look fellas, even windows doesn't to use window anymore")
19:20 maschine I don't want to run the app full time from my machine anyway
19:20 maschine lol
19:20 jberger I will still never understand companies that deploy production to windows servers
19:21 jberger I'm not saying they're wrong, I'm just saying I don't get it
19:21 maschine "because that's what we've always done"
19:21 maschine actually we have a lot of software with license servers that only run on windows
19:21 jberger ... and ...?
19:21 jberger :-P
19:21 maschine it's above my pay grade :p
19:22 jberger that's the real problem
19:22 jberger and above you "nobody ever got fired for buying IBM"
19:22 maschine it's Dell here, but pretty much.
19:22 jberger its an old phrase
19:23 jberger really though, who thinks a production server should be running on the OS that though Live Tiles was a thing
19:24 jberger zomg, I'm so glad this exists (I didn't even make it)
19:24 jberger http://s2.quickmeme.com/img/f7/f7f18bc140c17151c1d05ff59ab0b020e4dc6b331393ffee6091bf26abdb7adb.jpg
19:24 maschine I doubt any of our servers are that new
19:28 maschine We only just last year killed our last Win98 machine.  No kidding.  It ran the software to update our standards documentation. lol
19:28 maschine They replaced it because you had to turn it on 3 times before it would boot
19:28 jberger how pwnd was it?
19:28 jberger lots I'm guessing
19:28 maschine yeah no clue I never had the misfortune of using it
19:33 CandyAngel jberger: IT department don't like me having any extra software anyway, so probably not
19:34 CandyAngel I only get away with it because of inertia (install it without permission, make it indispensable)
19:34 CandyAngel :P
19:34 maschine Dell has a "big brother" software that monitors what all the employees have installed on their machines (Kace I think)
19:35 maschine IT kept uninstalling software I was legitimately testing.  They were asked to stop and they haven't bothered me since. :p
19:35 maschine I could probably set up a VM on my windows machine, but I don't want to step on IT's toes
19:37 CandyAngel I like to think it is because I choice/write software which works.. which can't always be said for theirs :P
19:37 CandyAngel They actually asked me to test their helpdesk system that they wrote.. it never saw the light of day :|
19:39 CandyAngel Surprising, because I can't English straight
19:39 CandyAngel But then again, my typing doesn't have a test suite so..
19:39 CandyAngel because I choose/write software*
19:42 CandyAngel But yeah.. I would like to make Minion a backend for a workflow/task system
19:53 karjala_ joined #mojo
19:58 rickbol joined #mojo
20:04 leont_ joined #mojo
20:10 rickbol joined #mojo
20:12 ChmEarl joined #mojo
20:18 Pyritic joined #mojo
20:22 rickbol joined #mojo
20:31 rickbol_ joined #mojo
20:48 rickbol joined #mojo
20:55 rickbol_ joined #mojo
21:05 jamesaxl joined #mojo
21:06 rickbol joined #mojo
21:28 rickbol joined #mojo
21:42 jberger sri: does https://github.com/kraih/mojo/commit/29f56b09a1eb5735ecb99a3aa5f7b2854cfa3e86 also close #1135?
21:43 jberger looks like it
21:43 jberger closed
21:47 Grinnz i almost think if anything 1 should be passed, to match what's done in decode, but i don't know if that would break the case in question
21:47 Grinnz or if it was intentionally ignoring errors
21:49 jberger as the default is 0 and we weren't passing anything in that slot, this is consistent with the behavior as it has always been
21:50 Grinnz the default is only 0 in Encode::encode
21:51 Grinnz its up to each encoding class for how they handle it afterward, or via find_encoding
21:58 rickbol joined #mojo
22:06 rickbol joined #mojo
22:18 Dandre joined #mojo
22:38 rickbol joined #mojo
22:46 rickbol_ joined #mojo
22:58 Grinnz there's an ad about "E Corp's new Ecoin" on reddit from usa network
22:58 Grinnz /o\
23:03 Ralesk joined #mojo
23:09 rickbol joined #mojo
23:22 good_news_everyon joined #mojo
23:22 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vdlP7
23:22 good_news_everyon mojo/master 5407815 Sebastian Riedel: add "multipart" content generator to Mojo::UserAgent::Transactor
23:22 good_news_everyon left #mojo
23:22 sri Rob: that should make your problem pretty simple
23:23 sri i've tried to reuse most of the existing code, but i think it can still be more efficient
23:25 Grinnz nice
23:30 trippeh joined #mojo
23:32 asarch joined #mojo
23:33 good_news_everyon joined #mojo
23:33 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vdlXu
23:33 good_news_everyon mojo/master 811a719 Sebastian Riedel: mention the new content generator in the cookbook too
23:33 good_news_everyon left #mojo
23:34 Grinnz I totally forgot you could dynamically register content generators
23:35 asarch In the GNOME Desktop Environment, there is an application called "Rhythmbox" written in C, it has a plugin for the last.fm song service. In order to access to your user account from Rhythmbox, you have to login in the web site of last.fm. What is the name if this kind of authentication?
23:35 Grinnz oauth
23:36 asarch Thank you!
23:36 asarch Thank you very much Grinnz :-)
23:36 asarch Have a nice day guys
23:44 Ralesk joined #mojo
23:48 rickbol joined #mojo
23:53 rickbol_ joined #mojo
23:58 trippeh joined #mojo

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