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

IRC log for #mojo, 2017-06-29

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

All times shown according to UTC.

Time Nick Message
00:13 Pyritic joined #mojo
00:39 disputin joined #mojo
01:46 jabberwok joined #mojo
02:15 noganex_ joined #mojo
03:58 maschine joined #mojo
04:00 disputin joined #mojo
04:28 zivester joined #mojo
05:34 inokenty-w joined #mojo
06:42 karjala_ joined #mojo
06:47 dod joined #mojo
06:53 dod joined #mojo
07:10 trone joined #mojo
07:56 sri aww, nobody tried? :/
08:06 sri wtf did o'reilly just do? Oo
08:09 sri https://www.oreilly.com/ideas/were-reinventing-too
08:10 sri guess now you have to subscribe for ebooks
08:13 prg joined #mojo
08:22 sri oh, looks like they stopped making real ebooks... and you have to use an app
08:22 sri guess o'reilly just committed suicide
08:25 tadzik ugh
08:26 marcus flail
08:45 rshadow joined #mojo
08:59 rshadow joined #mojo
10:15 bc547 joined #mojo
10:25 jabberwok "apps", and the locked-down spymachine devices that run them, are the antithesis of the Free Software movement. the world is full of sheep. [sigh]
12:23 sri they're either in financial trouble or tim has gone insane
12:34 coolo sri: they still sell ebooks on other people's DRM platforms
12:34 mr_trousers joined #mojo
12:35 mr_trousers I am having trouble deploy my mojo application.
12:35 sri coolo: yea, but do you read tech books on your kindle?
12:35 coolo sri: but I can see people moving into flat rate models more and more - and a single oreilly book is very expensive, so most students will favor stealing than buying a single one. But a flat rate sounds like a good deal to the average student these days
12:35 coolo sri: I don't read full books most of the time :)
12:36 sri exactly!
12:36 * sri loves having drm free ebooks in pdf format for easy searching
12:37 mr_trousers Would anyone be willing to explain how the hypnotoad deployment works? I have been trying to deploy for a while. seems odd to runa server on another server.
12:37 sri mr_trousers: http://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#Hypnotoad
12:37 coolo sri: and you wonder oreilly wants to make a living? :)
12:38 coolo (or pay their authors)
12:38 sri maybe i was the only one *buying* their pdfs
12:38 coolo did you watch 'hot girls wanted' on netflix by chance? All these porn movie makers complain that noone wants to pay them too :)
12:39 * coolo bought some as well - as part of some humblebundle though
12:39 CandyAngel I bought e-books on O'Reilly too
12:40 coolo the only tech books I read in the last decade I did read on the kindle - and bought them as .mobi from practicalprogrammer.
12:40 sri i bought some from o'reilly, pragprog, informit and nostarch ¯\_(ツ)_/¯
12:41 coolo but I bought a kindle edition of 'JavaScript: The Definitive Guide' this week - for my wife to read though
12:42 * coolo is tired of explaining everything :)
12:44 squiggy joined #mojo
12:44 stryx` joined #mojo
12:46 figaro joined #mojo
12:46 figaro I have looked at the guide for mojolicious. I can't seem to deploy using hypnotoad. The guide is for Mojo Lite. Whenever I start my app under hypnotoad I get a "Hypnotoad does not support fork emulation" error.
12:46 figaro would anyone be willing to help?
12:49 CandyAngel Are you deploying it on Windows?
12:50 mib_jclb6f joined #mojo
12:52 mib_jclb6f I am deploying a mojolicious app in windows. The deployment guide is for mojo lite. Can anyone help? When I try to run the app under hypnotoad, i get a "Hypnotoad does not support fork emulation" error
12:52 mib_jclb6f would anyone be willing to help?
12:52 mib_jclb6f I tried to ask this three times and have been disconnected each time
12:53 mib_jclb6f If I do and someone can help, I posted a Q on stack overflow
12:53 mib_jclb6f https://stackoverflow.com/questions/44811075/perl-mojolicious-iis-routes-going-to-post-method
12:54 CandyAngel mib_jclb6f: Deploy on something that has proper forking..
12:54 sri coolo: that's one of the three javascript books i keep around too ;)
12:55 coolo sri: go read it then! :)
12:55 mib_rhzy0i joined #mojo
12:55 sri naaah ;p
12:55 mib_rhzy0i I am deploying a mojolicious app in windows. The deployment guide is for mojo lite. Can anyone help? When I try to run the app under hypnotoad, i get a "Hypnotoad does not support fork emulation" error
12:55 mib_rhzy0i https://stackoverflow.com/questions/44811075/perl-mojolicious-iis-routes-going-to-post-method
12:55 pink_mist mib_rhzy0i: please read the backlog mentioned in the topic
12:56 pink_mist mib_rhzy0i: the irclog.mojolicious.org link
12:56 mib_rhzy0i Keep disconnecting
12:57 pink_mist clearly, but repeating your question over and over instead of checking the log for replies is less than helpful
12:57 mib_rhzy0i Sorry someone directed me this way. very new to the site, wasn't even sure I was in the same chat room...
12:57 pink_mist mib_rhzy0i: WSL or Cygwin can provide proper forking support on windows I believe ... at least WSL should, I'm not certain about Cygwin.
12:58 sri mib_rhzy0i: http://mojolicious.org/perldoc/Mojolicious/Guides/FAQ#How-well-is-Windows-supported-by-Mojolicious
13:12 Pyritic joined #mojo
13:25 sri it's so weird there are no really good postgres books
13:27 gryphon joined #mojo
13:29 * CandyAngel borrows sri's JS book to learn how to bookmarklet
13:34 morton joined #mojo
13:47 maschine_ joined #mojo
13:52 jabberwok sri: Obe&Hsu's Postgres Up & Running is the one I recommend in hardcopy, but that's far from an introductory text
13:52 sri jabberwok: have that one, it's a bit all over the place quality wise imo
13:59 marty joined #mojo
14:01 maschine_ Heh, I started with "Learning Perl in 21 Days".  It should have been "21 Years".  Literally, it's been that long. :p
14:04 tadzik hah, there's this "teach yourself programming in 10 years" article
14:09 mcsnolte joined #mojo
14:27 mbudde joined #mojo
14:42 Pyritic joined #mojo
14:52 maschine_ tadzik: http://norvig.com/21-days.html
15:42 * sri wonders what perl books people around here actually keep around
15:42 genio I've mostly quit purchasing tech books
15:46 jberger I literally don't have any tech boos
15:46 jberger books
15:46 sri interesting
15:46 jberger oh not true, I was given Andrew Shitov's Perl 6 book at PTS this year
15:47 perlpilot what genio said goes for me too
15:48 haarg i used to have some, but i got rid of them in my last move
15:48 sri for some stuff i just need books... like The Linux Programming Interface and The TCP/IP Guide
15:48 jberger the few I have on PDF are ones that were available for free from authors (think Higher Order Perl)
15:48 jberger sri: that kind of book makes more sense to need
15:48 haarg the most recent technical book i had was the template toolkit book
15:49 sri guess i keep the camel book around for nostalgia
15:50 sri Modern Perl and PBP for when people ask me about something in those books (which happens quite a bit)
15:50 genio I have an old copy of HoP and I think that's the last one I purchased
15:50 haarg there are a couple camel books sitting next to my desk, but they belong to amsterdamx.pm i think
15:53 jberger I usually have bought books when I'm learning an entire subject, like science books in school
15:54 jberger I've learned programming so slowly over time that I've built up my knowledge piecemeal
15:54 jberger maybe that's not a good thing
15:54 sri i do have HoP too... and one of these days i'm actually gonna read it and not just skim through :P
15:54 jberger but it means I've never felt the need to go buy a reference
15:54 jberger hahah, same
15:54 jberger I've read the parsing chapters about 30 times ;-
15:54 jberger :-P
15:55 arcanez I have too much AD-squirrel to read a book
15:56 sri one book i did get much more value out of than i thought was the RESTful Web Services Cookbook
15:56 noganex joined #mojo
15:56 sri still looking up arguments for REST best practices in that one all the time
16:00 disputin joined #mojo
16:01 jacobydave I have a whole lot of books, including Programming Perl eds. 1-4, but I go to books only rarely.
16:01 jabberwok i still thumb thru Effective Perl Programming
16:01 jacobydave I was recommended "Build APIs You Won't Hate" and I use that as my REST book.
16:03 arcanez I should read HoP because mjd
16:11 sri overall, i think the nostarch books have been the most valuable for me
16:11 jacobydave I should read HoP because it will level up my code.
16:23 sri and speaking of free books, i've been meaning to read Pro Git
16:24 pink_mist which were the two other javascript books you recommended, sri?
16:24 sri https://link.springer.com/book/10.1007%2F978-1-4842-0076-6
16:24 sri pink_mist: did i?
16:25 sri i have JavaScript the good parts and JavaScript patterns
16:25 pink_mist sri: yeah, I was referring to 14:55 <sri> coolo: that's one of the three javascript books i keep around too ;)
16:26 pink_mist =)
16:26 pink_mist thanks =)
16:26 sri ah :)
16:26 sri patterns is pretty good, not sure about the good parts...
16:26 sri guess i keep it because you're supposed to like it
16:52 sri (not that it's bad, just little value once you've gone through it)
16:52 pink_mist ah, right =)
16:55 jberger like PBP
16:55 jberger I can't wait for DCONWAY's TPC::NA talk to go online
16:55 jberger it was awesome
16:56 jberger he's asked for it to be held until after TPC::EU (and maybe OSCON?)
16:57 jberger anyone going to TPC::EU? it would be nice to have some mojo presence
16:57 sri what did he talk about?
16:58 haarg Dios / Keyword::Declare / PPR
17:02 sri that does look interesting
17:03 haarg source filters v2
17:09 PryMar56 joined #mojo
17:10 jberger at compile time
17:11 jberger also it was in very Damian style
17:11 bit_shifter I'm posting messages to Slack's incoming webhooks API from a Mojolicious app.  When I send a "™" as part of the message (POST body), it ends up as "âÂ\x84¢" in debug output on the terminal as well as in the actual Slack message that appears.  There must be some sort of escaping or encoding happening here, but I'm not well-enough versed in unicode on the web to figure out what I need to do to get it to
17:11 bit_shifter show correctly.  Any thoughts?
17:12 sri you prolly want to utf-8 encode the message body first
17:12 Grinnz that looks double encoded tbh
17:13 bit_shifter Is Mojo::Util->encode('UTF-8', $message) the way to go?
17:13 Grinnz that's not how you call the function, no
17:16 haarg the only difference between damian's new stuff and old source filters is that it starts processing later in the file, and it has better written regexes.
17:16 bit_shifter s/->/::/ ?
17:16 Grinnz yes, but i don't think that will solve your problem
17:16 bit_shifter Oh. Hmm.
17:17 Grinnz post bodies are already UTF-8 encoded by mojo
17:17 Grinnz something else seems to be encoding it as well, at least thats what your output looks like
17:18 bit_shifter The post call is "$c->ua->post($url, json => $message)" if that's helpful.  Is the json encoding doing that?
17:18 Grinnz yes, the json generator will UTF-8 encode
17:18 bit_shifter Hence the double encoding?
17:19 Grinnz only if something else is UTF-8 encoding your content first
17:19 Grinnz where is the message coming from?
17:21 bit_shifter Steam's store API.
17:21 Grinnz in what format?
17:21 pink_mist perhaps you need to decode it first
17:23 bit_shifter https://api.steampowered.com/ISteamApps/GetAppList/v2
17:23 bit_shifter It's a JSON message.  Trying to figure out the actual format.
17:23 Grinnz how are you parsing the json?
17:23 bit_shifter I see the literal "TM" there.
17:24 bit_shifter my $applist = $c->ua->get($url)->result->json;
17:24 Grinnz that should decode it from UTF-8
17:24 pink_mist how do you transform $applist to $message?
17:24 Grinnz so there should be no encoding or decoding needed in between that
17:25 pink_mist it might be that the data from the steam api is double encoded
17:26 bit_shifter my $appname = $applist->{applist}{apps}[0]; my $message->{username} = $appname;
17:26 jnap does this seem like a bug in Mojo::DOM->replace?  => https://gist.github.com/jjn1056/a1a71a605d265ea116935e72659aff06
17:30 bit_shifter correction (forgot {name}): my $appname = $applist->{applist}{apps}[0]{name}; my $message->{username} = $appname;
17:31 jnap I thought in ^^ I'd expect the second warn to reflect the replacement text.
17:32 bit_shifter Putting a literal "TM" in the $message->{username} shows up correctly in the Slack message.  Must be UTF-8 encoded already in the $appname that Steam's API returns?  How can I determine/fix that?
17:32 bit_shifter By that I mean ™
17:34 Grinnz it is UTF-8 encoded in the json. but your ->json call decodes that
17:34 Grinnz it's not double encoded there, or it would look wrong in the browser
17:35 bit_shifter ah
17:36 Grinnz jnap: it replaces it in the parent DOM, but the object itself isn't changed
17:37 sri btw.
17:38 jnap Grinnz: ok so there's gotta be a parent
17:38 Grinnz jnap: or the root node
17:38 purl i think the root node is different from interior nodes how?  Do the interior nodes have pointers the root does not?
17:38 sri the Mojo::DOM::_siblings optimization pussle is still unresolved
17:38 sri if someone feels like contributing to Mojo::DOM
17:38 sri https://irclog.perlgeek.de/mojo/2017-06-28#i_14800613
17:38 jnap Grinnz: when you say, "or the root node" not sure I understand
17:39 Grinnz jnap: all doms have a root node originally
17:39 sri http://mojolicious.org/perldoc/Mojo/DOM#NODES-AND-ELEMENTS
17:39 jnap sri: when I get Template::Lace not terribly sucking I will probably put time into any existing optimizations :)
17:40 Grinnz jnap: so the tree of your example dom there is root -> a tag -> img tag
17:40 Grinnz when you run replace, it becomes root -> h1 tag -> text node
17:40 jnap it seems like when I do ->at on the single element I lost the concept of a root node for ti
17:40 Grinnz but you still have the a tag object, and that isn't change
17:41 Grinnz changed*
17:41 jnap hmmm
17:41 Grinnz $a as a document would be changed, though
17:42 jnap I see
17:43 Grinnz 1 demerit for using $a and $b btw :P
17:43 chandwki joined #mojo
17:43 sri even if we wanted, $b could never change to <h1>aaa</h1>
17:44 sri because you might as well do $b->replace('<h1>aaa</h1><h2>aaa</h2>')
17:44 sri that's two elements
17:44 sri on the same level
17:44 jnap ok
17:44 jnap then I need to figure out a better way to do this..
17:46 bit_shifter $appname = decode 'UTF-8', $appname;
17:46 bit_shifter That solves it, btw
17:47 jnap its possible then I need to redo my ->repeat helper then...
17:47 Grinnz bit_shifter: hmm, still wonder where its getting double encoded, but cool
17:48 bit_shifter Grinnz: Yeah, I'll dig deeper... Haha.  Thanks for your help.
17:49 trone joined #mojo
17:53 sh14 joined #mojo
17:54 rshadow joined #mojo
18:16 dod joined #mojo
18:19 petru joined #mojo
18:20 petru Hi. I'm trying to use markdown-it for doing a live preview of some markdown editing. I'm thinking of installing it using npm. What is a good practice of using mojolicious with npm?
18:21 Grinnz They are not really related in any way. just use npm how you normally would
18:21 Grinnz AssetPack may be useful, though
18:22 preaction i put my package.json in my /public directory, and then use npm install to get the /public/node-modules directory, then use AssetPack to get the individual ones i need from that directory
18:26 Pyritic joined #mojo
18:39 good_news_everyon joined #mojo
18:39 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vQ8o9
18:39 good_news_everyon mojo/master 81916d1 Sebastian Riedel: make many Mojo::DOM methods a little faster
18:39 good_news_everyon left #mojo
18:39 sri not as fast as i would have hoped
18:40 sri benchmarked with perl -Ilib -Mojo -E 'my $dom = x("<p></p>" x 100); my $p = $dom->at("p"); n { $p->next->next->next->next->next->next_node->next->next->next->next->next } 10000'
18:40 sri from 2900/s to 4000/s
18:40 sri but maybe there are other ideas
18:41 sri filtering for tags is really really expensive
18:49 ptolemarch joined #mojo
18:56 ptolemarch joined #mojo
18:56 good_news_everyon joined #mojo
18:56 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vQ8Xe
18:56 good_news_everyon mojo/master 925b3c8 Sebastian Riedel: make many Mojo::DOM methods a little faster again
18:56 good_news_everyon left #mojo
18:56 sri and now 5000/s
19:04 sri think that might be the limit without bigger changes
19:16 stryx` joined #mojo
19:18 good_news_everyon joined #mojo
19:18 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vQ8DW
19:18 good_news_everyon mojo/master 6c0d311 Sebastian Riedel: using the grep method is not slower anymore
19:18 good_news_everyon left #mojo
19:59 rshadow joined #mojo
20:17 Janos joined #mojo
20:27 marty joined #mojo
20:27 dantti_laptop joined #mojo
20:29 zivester joined #mojo
20:46 sri i kinda want to get rid of the finished/failed events in Minion::Job
20:46 sri and replace them with reap/stop events
20:47 sri reap would run in the manager process, and stop in the task
20:48 sri the one who deleted his posts to the list earlier got those events sooo wrong
21:05 jberger I use those events to good effect in Minion::Notifier
21:06 jberger I'm not saying not to add more events
21:06 jberger just saying they can be used correctly
21:21 gryphon joined #mojo
22:07 schelcj joined #mojo
22:19 marty joined #mojo
22:23 marty joined #mojo
23:26 diegok joined #mojo
23:29 Pyritic joined #mojo
23:39 mikegrb joined #mojo

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