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

IRC log for #mojo, 2015-03-20

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

All times shown according to UTC.

Time Nick Message
00:05 vmbrasseur joined #mojo
00:33 disputin joined #mojo
00:48 elik joined #mojo
00:55 sri dammit
00:55 sri i knew something was bugging me about the fix
00:55 Zoffix What?
00:55 sri you can chain as many attribute selectors and pseudo-classes as you like
00:55 Zoffix right
00:55 sri [foo]:not(bar)[baz]:not(yada)
00:56 Zoffix And the fix only works for when it's a chain of 2? :)
00:56 sri yes, and not for attribute selectors
00:56 Zoffix hah
00:57 berov1 joined #mojo
01:08 sri and ids and classes
01:08 sri requires an entirely different tokenizer
01:09 Zoffix ouch :(
01:13 Zoffix This is an interesting result: http://fpaste.scsys.co.uk/469994
01:14 Zoffix Same selector. In the first case, the element is nested within another one that has the same classes.
01:19 mattastrophe joined #mojo
01:27 woz joined #mojo
01:32 hshong joined #mojo
01:36 kaare joined #mojo
01:37 bruce_lee joined #mojo
01:47 sri looks like i already have a new tokenizer :)
01:48 Zoffix \o/
01:49 asarch joined #mojo
01:50 woz joined #mojo
01:54 sri all tests successful \o/
01:54 Zoffix sri++
01:55 sri i think it might even be less code :o
02:09 d4rkie joined #mojo
02:13 klapperl_ joined #mojo
02:25 good_news_everyon joined #mojo
02:25 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/haWI
02:25 good_news_everyon mojo/master fc52a98 Sebastian Riedel: fix a few bugs in Mojo::DOM::CSS that required class, id and attribute selectors, as well as pseudo-classes, to be in a specific order
02:25 good_news_everyon left #mojo
02:27 sri 7 lines of code removed :)
02:37 jberger less code more tests
02:37 jberger that's the mojo way
02:37 good_news_everyon joined #mojo
02:37 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/ha8V
02:37 good_news_everyon mojo/master 64c45c5 Sebastian Riedel: no need for interpolation
02:37 good_news_everyon left #mojo
02:37 sri Zoffix++ # noticing the bug
02:37 Zoffix \o/
02:37 sri nobody else has in all those years :)
02:38 jberger I think I stumbled on it once, assumed I was wrong and changed the selector
02:38 * sri sets jberger on fire
02:39 jberger a long while ago, when I had no idea what I was doing
02:39 * jberger burns
02:43 sri https://jeffhalloran.files.wordpress.com/2013/07/minion-call-to-action.jpg
02:45 crab why use #!/usr/bin/env perl instead of #!perl?
02:45 crab (i know env can set environment variables, but most of the time it's not used that way)
02:46 jberger crab: that's used for perlbrew
02:46 jberger but not in mojo anyone
02:46 jberger anymore
02:47 crab but even #!perl works fine with perlbrew, right?
02:47 jberger hmmmm I suppose it should I guess
02:48 jberger I really had never thought of that
02:48 crab it certainly seems to
02:48 Zoffix yup (just tested it)
02:52 jberger do some shells need an absolute path in the shebang?
02:53 crab the shell doesn't care, only the kernel
02:53 Zoffix How does cpan_mojo figure out which dists depend on Mojolicious? I see it announced Net::Easypost that uses Mojo::UserAgent. I uploaded HTML::ExtractText 20 minutes ago that uses Mojo::DOM and cpan_mojo is quiet.
02:53 jberger that's what I mean
02:53 crab do some kernels want an absolute path? no
02:53 jberger Zoffix: it checks metacpan
02:53 Zoffix Wondering if I messed up prereqs someplace..
02:53 jberger was it the first release?
02:53 Zoffix Yeah
02:54 jberger the bot is faster than metacpan
02:54 Zoffix Ah, ok then :)
02:54 jberger so it actually lags one release
02:55 jberger add it is it's almost instantaneous
02:55 jberger as
02:55 jberger I didn't want to have to wait
02:55 Zoffix :D
02:55 crab ,msg jberger that's quick thinking, zoffix must never know of the secret list of cool people whose releases are announced
02:55 jberger it kicks gumbypan's butt
02:55 Zoffix hahaha
02:55 Zoffix crab++
02:55 jberger hahaha
02:57 jberger Zoffix: if the module's name had mojo in it it would also have worked
02:57 jberger next time
02:57 purl Next time, Gadget. NEXT TIME!
02:57 * jberger sets purl on fire
02:57 * purl basks in the warm glow HEY WAIT A MINUTE
03:13 noganex joined #mojo
03:37 marmez left #mojo
03:38 disputin joined #mojo
04:03 sri so, i guess irc is dead again, and we are all supposed to use slack
04:05 crab oh no!
04:05 sri it's really too bad nobody builds irc apps that look like that though
04:05 crab what does it look like?
04:05 sri https://slack.com/is
04:06 sri i mean, i would totally give it a try... if only the server connection limits weren't so tough
04:09 sri irccloud is terrible because there's no competition, there's no competition because you need a gazillion ip addresses to bypass connection limits
04:12 jberger convos looks nice
04:15 sri it's not bad, but slack is in a different league
04:16 bruce_lee left #mojo
04:20 woz joined #mojo
04:28 preaction if only the people who made slack could make the thing they actually set out to make...
04:29 preaction and that's not the first time it happened to them: Flickr was built on the ashes of a video game, and Slack was built on the ashes of Glitch
04:39 Eke- joined #mojo
04:45 inokenty-w joined #mojo
04:52 basic6_ joined #mojo
04:57 cpan_mojo Mojo-Pg 1.17 by Sebastian Riedel - http://metacpan.org/release/SRI/Mojo-Pg-1.17
05:39 irq joined #mojo
06:02 melo joined #mojo
06:08 good_news_everyon joined #mojo
06:08 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/haAz
06:08 good_news_everyon mojo/master 02c6af0 Sebastian Riedel: test invalid selector
06:08 good_news_everyon left #mojo
06:09 woz joined #mojo
06:21 woz joined #mojo
06:26 marmez joined #mojo
06:31 good_news_everyon joined #mojo
06:31 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/hahd
06:31 good_news_everyon mojo/master 26947c4 Sebastian Riedel: parse without substitution
06:31 good_news_everyon left #mojo
06:33 coolo sri: thanks for caring, but I don't think we will change our config format now :)
06:39 sri :o
06:39 good_news_everyon joined #mojo
06:39 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/haji
06:39 good_news_everyon mojo/master dbba0d1 Sebastian Riedel: there is always a part
06:39 good_news_everyon left #mojo
06:40 OmarOthman joined #mojo
06:46 dotandimet joined #mojo
06:49 good_news_everyon joined #mojo
06:49 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/hVvJ
06:49 good_news_everyon mojo/master 16baba0 Sebastian Riedel: use the correct terminology
06:49 good_news_everyon left #mojo
06:55 coolo sri: would you add openQA to https://github.com/kraih/mojo/wiki/Example-applications ?
06:59 uma joined #mojo
07:02 wikihead joined #mojo
07:04 melo1 joined #mojo
07:19 bramirez joined #mojo
07:21 dexteruk joined #mojo
07:22 tianon joined #mojo
07:31 reneeb joined #mojo
07:31 Eke- joined #mojo
07:33 lnussel joined #mojo
07:35 bramirez joined #mojo
07:36 batman too bad i'm hacking on MCT... convos is not in focus :(
07:37 batman i do have plans... still won't put it in the slack league, but i'm not sure if i should aim for that.
07:37 batman need to figure out another segment convos can fit in.
07:37 batman i think it will be impossible for two persons to compete with the slack team
07:38 batman and "open source" just doesn't cut it for a different segment
07:40 Eke- joined #mojo
07:41 dod joined #mojo
07:43 crab batman: what is MCT?
07:43 purl i heard MCT was funny sometime4s.
07:44 batman crab: mojo conference toolkit. it's supposed to become an alternative to act
07:44 crab and act is which conference toolkit?
07:47 dod joined #mojo
07:55 alexbyk joined #mojo
07:56 dod joined #mojo
08:03 batman "a conference toolkit" :)
08:04 batman crab: http://act.mongueurs.net/
08:04 batman mct is running https://www.mojoconf.com/2015, but it's lacking in features
08:04 batman contributions are more than welcome
08:04 batman if anyone want to chip in
08:04 bramirez joined #mojo
08:04 batman souce code is here: https://github.com/mojoconf/MCT/
08:07 bramirez1 joined #mojo
08:07 eseyman joined #mojo
08:12 dexteruk joined #mojo
08:13 Vandal joined #mojo
08:14 AndrewIsh joined #mojo
08:16 McA joined #mojo
08:42 fhelmber_ joined #mojo
08:42 tianon joined #mojo
08:42 trone joined #mojo
08:44 irq joined #mojo
08:55 bpmedley joined #mojo
09:05 niczero oi!
09:05 niczero I heard there was mention of chips & sauce... I turn up... it's just chat about code for cryin out loud
09:06 woz joined #mojo
09:37 ZadYree joined #mojo
09:40 dod joined #mojo
09:55 cpan_mojo Mojolicious-Plugin-Riotjs 0.0201 by Jan Henning Thorsen - http://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-Riotjs-0.0201
10:06 bramirez1 Hi everyone! I  want to download large files with Mojo::UserAgent. That's easy. The point is that I want to get same  progress info. Any idea?
10:21 dod joined #mojo
10:21 tianon joined #mojo
10:23 OmarOthman joined #mojo
10:29 cpan_mojo Mojolicious-Plugin-AssetPack 0.43 by Jan Henning Thorsen - http://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-AssetPack-0.43
10:32 Oleg joined #mojo
10:32 coolo batman: so you consider CSS::Sass good enough? Because I had an empty file on bootstrap.css everytime I tried
10:33 batman coolo: it has some delay, but should be good enough if you're not using bleed sass features
10:34 batman coolo: i use it when i run the unit tests
10:35 coolo updating the packages
10:39 batman coolo: before 0.41, there was no error detection... maybe that's why you got an empty file
10:39 batman not sure which version you had before "updating the packages"
10:39 batman https://github.com/jhthorsen/mojolicious-plugin-assetpack/commit/ecbc598a1e43034c1553a5c3e4c68f467a5a173d # i didn't know the function based interface didn't die on error
10:48 coolo 0.39
10:50 batman aha. how does it behave after upgrade to 0.42?
10:51 * coolo will see
10:53 coolo batman: it's no longer empty
10:53 coolo but the diff between perl and ruby output is huge - but it doesn't have to be a bug, /me needs a tool to verify css diffs :)
10:54 coolo batman: but it's not noticably slower for bootstrap sass
10:54 batman that's super weird. it's supposed to be the same C library.
10:54 batman "CSS::Sass - Compile .scss files using libsass"
10:55 batman maybe it's because it creates a sourcemap... *checks*
10:55 coolo batman: the diff is along http://paste.opensuse.org/86853267
10:55 coolo batman: and sass gem is ruby, ruby-libsass is a different thing
10:56 coolo batman: the web page looks the same though
10:59 batman coolo: so what you're saying is that https://github.com/sass/libsass does not follow the same development pace as we https://github.com/sass/sass?
10:59 batman i don't get how a c-library can be slower that a ruby implementation...
10:59 batman i also thought the ruby gem used libsass. guess i've missed out on something here :(
11:00 deserted batman, no the ruby gem was the original Sass enging
11:01 deserted engine*
11:01 deserted libsass is a C port
11:01 Oleg bramirez1: like this https://gist.github.com/olegwtf/c9c5a266352cba73dc5b ?
11:01 deserted coolo, what version of libsass library are you working with
11:01 batman deserted: what are you answering "no" to..?
11:01 batman i know it was ruby before the c bindings
11:01 coolo deserted: the one bundled with  CSS::Sass (which is another slow down factor)
11:02 deserted batman, may have misread your last comment "I also thought the ruby gem used libsass"
11:03 deserted batman, and prior to libsass 3, no they weren't at feature parity
11:03 batman deserted: thanks. (no, you didn't missread)
11:04 batman coolo: i will check out the CSS::Sass api to see if there's more options i should tweak
11:04 deserted coolo, from the CSS::Sass pod "It is currently somewhere around ruby sass 3.2/3.3 feature parity and heading towards 3.4. "
11:04 deserted so you may find some differences if using up-to-date sass gem Vs libsass
11:05 batman deserted: yeah, but it seems strange that "notable speed" is one of those differences
11:05 deserted however sass has committed to wait at 3.4 for libsass to catch up - > http://www.sitepoint.com/switching-ruby-sass-libsass/
11:06 deserted batman, can't really give much input on that sorry, I've been avoiding libsass until it catches up
11:06 Kripton joined #mojo
11:06 batman deserted: which features do you miss?
11:07 deserted libsass has issues compiling bleeding edge bourbon and compass, or at least did around 4 months ago when i last tried it
11:08 deserted also has some nice sass hacks like @if not not that don't work in libsass as of yet
11:08 bramirez1 Oleg: awesome! thank you very much!
11:10 batman coolo: i see that it takes 0:00.13 to run with oo interface and 0:00.21 with the function
11:10 batman coolo: i will change it
11:15 neilhwatson joined #mojo
11:19 nicomen can anyone explain to me how I can get this to not timeout?
11:19 nicomen $ perl -wle 'use Mojolicious; my $app = Mojolicious->new(); $app->routes->get("/" => { text => "root" }); my $ua = Mojo::UserAgent->new(server => Mojo::UserAgent::Server->new(app => $app) ); $ua->get("/");'
11:20 batman coolo, deserted: https://gist.github.com/jhthorsen/8f0912209d4259d4292a # what do you think?
11:20 batman i guess i should use the oo interface?
11:21 batman nicomen: i don't think you can. it's two different ioloops
11:22 Oleg nicomen: because this is blocking call and your app can't handle request while ua blocked loop
11:22 deserted batman, but function is faster?
11:22 bramirez joined #mojo
11:23 uma joined #mojo
11:23 batman deserted: oh. hahaha
11:23 * batman gives up
11:23 deserted batman, dw, I had to refer to cpan to check I was right before I said that lol
11:23 batman deserted++
11:26 batman nicomen: your oneliner is very complicated. use -Mojo -wE'...' instead
11:26 batman nicomen: http://mojolicio.us/perldoc/ojo
11:27 batman Oleg: are you sure we are right? :)
11:28 Oleg nicomen: so, this works with non-blocking mode perl -wle 'use Mojolicious; my $app = Mojolicious->new(); $app->routes->get("/" => { text => "root" }); my $ua = Mojo::UserAgent->new(server => Mojo::UserAgent::Server->new(app => $app) ); $ua->get("/", sub{Mojo::IOLoop->stop}); Mojo::IOLoop->start'
11:28 Oleg batman: looks right ^^^
11:28 deserted grrr this is just pissing me off now
11:29 nicomen Oleg: hm, ok, but looking at t/mojo/user_agent.t my example should kind of have worked?
11:29 deserted ok giving this https://gist.github.com/deserted/5b30d3c54e79692aaafc can anyone work out why the processed template is successfully iterating on the foreach, but not populating the values at cat.id and cat.name?
11:29 nicomen (Also I thought both Mojolicious and UserAgent would be using a default singleton Mojo::IOLoop)
11:30 Oleg nicomen: did you see my message? looks like  t/mojo/user_agent.t also uses non-blocking mode
11:31 batman nicomen: Mojo::UserAgent::Server->app($app) <-- try that
11:31 batman perl -wle 'use Mojolicious; my $app = Mojolicious->new(); $app->routes->get("/" => { text => "root" }); Mojo::UserAgent::Server->app($app); my $ua = Mojo::UserAgent->new; print $ua->get("/")->res->body;'
11:32 batman i was tricked by ojo.pm, since it use a lite app instead of full app. seems like Mojolicious::Lite sets up more globals than just Mojolicious
11:33 deserted actually nvm, wantarray was screwing with me :(
11:34 nicomen thanks batman and Oleg ;)
11:35 nicomen (althought I would rather not set a global app)
11:36 marcus https://luvit.io/ - pretty sweet
11:42 Oleg nicomen: I got the best solution :) perl -wle 'use Mojolicious; my $app = Mojolicious->new(); $app->routes->get("/" => { text => "root" }); my $ua = Mojo::UserAgent->new(server => Mojo::UserAgent::Server->new(app => $app, ioloop => Mojo::IOLoop->singleton), ioloop => Mojo::IOLoop->singleton); $ua->get("/");'
11:49 nicomen Oleg: hehe, nice
11:51 batman nicomen: my $ua = Mojo::UserAgent->new; $ua->server->app($app); works as well
11:54 Oleg batman: really, this is better
11:54 batman what is better?
11:55 Oleg you variant, less of code
11:55 batman :)
11:59 Oleg marcus: never used lua, is it better than JavaScript?
12:00 Oleg I hate JavaScript :D
12:01 jm666 joined #mojo
12:02 batman js++
12:02 Ralesk eh, counts arrays from 1 instead of from 0, and has a conflated array + hash thingy called table
12:04 marcus Oleg: yeah, it's like javascript but better.
12:06 Oleg counts arrays from 1? Oh, cool feature, but so easy to make mistake after years of working with this horrible languages which counts from 0 :D
12:09 irq joined #mojo
12:10 KindOne joined #mojo
12:16 coolo batman: as the assets aren't regenerated normally I wouldn't care for 6/s vs 8/s myself and go for the nicer API (which in my personal perference would be oo)
12:17 batman ok. i'm not going to change it now. might change it in the future. will change it with a PR on github.
12:17 noganex joined #mojo
12:37 mattastrophe joined #mojo
12:50 crab joined #mojo
13:06 jm666 joined #mojo
13:08 bramirez joined #mojo
13:25 uma joined #mojo
13:25 tianon joined #mojo
13:26 cpan_mojo Test-Mojo-Pg 0.1 by RICHE - http://metacpan.org/release/RICHE/Test-Mojo-Pg-0.1
13:27 zivester joined #mojo
13:50 pink_mist Oleg: you know, on earlier perls, you could set $[ to 1 to have arrays start at 1 in perl too :P
13:50 ribasushi pink_mist: you can still do it with an external module
13:51 ribasushi (on bleading edge perls)
13:51 tianon joined #mojo
13:52 mst ribasushi: using SPROUT's crack, presumably
13:52 ribasushi yes, comes with perl: https://metacpan.org/pod/arybase
13:52 ribasushi :)
13:53 genio meh.
13:55 amon joined #mojo
13:58 asarch joined #mojo
14:09 riche joined #mojo
14:18 xdg joined #mojo
14:22 batman can you do $[ = -2; ..? :)
14:23 mst ideally, if you do that, a small gnome exits the monitor and hits you with a mallet
14:24 riche batman: please videotape that
14:25 batman mst: i don't think i have a perl with that feature set :(
14:26 batman i wonder which change request got $[ in...
14:26 ribasushi batman: it's been there since 2.0 iirc
14:26 ribasushi making it palatable to fortran-folk
14:27 batman makes perfect sense. i would totally
14:27 batman ...hopefully...
14:28 batman not add something like that
14:30 jberger always remember, fortran got subroutine signatures before we did
14:30 * ribasushi never understood the fascination with sub sigs
14:31 pink_mist which kind of signatures? :P
14:32 * jberger programs like a child, likes shiny things heaped with sugar
14:32 cfedde "proper" signatures give a form of polymorphism.  Also they give specific syntax for dealing with parameters.
14:33 batman not sure how much i will benefit from signatures... unless they would some-time-in-the-distant-future support foo($self, @args, $cb)
14:33 neyasov joined #mojo
14:34 pink_mist isn't that precisely what they're for?
14:35 batman pink_mist: i do believe $cb would not get anything, and @args get it all
14:35 ribasushi cfedde: right, multimethods in p5 (on a syntactical level) are exceedingly unlikely
14:36 ribasushi cfedde: at which point - there isn't much left that is *MUST HAVE*
14:36 mst batman: supporting a single arg after an array arg is a fucking disaster
14:36 batman i would be happy if perl could do $self = shift; for me though...
14:36 cfedde ribasushi: this is true.  Still I like sugar most of the time
14:36 mst batman: it has been experimented with repeatedly
14:36 mst batman: the footgun potential is annoyingly high
14:36 batman mst: can you give me an example?
14:37 mishantil mst: Isn't that just more an issue with how it has been decided (or commited) for perl to accept arguments.
14:37 cfedde perl's core behavior would have to change to make that kind of syntax "just work".
14:37 mishantil I know that this is a major confusion for new perl'ers.
14:37 * pink_mist just realised he conflated the terms 'signature' and 'prototype' ... oops
14:38 cfedde anone who has used perl for a while learns about it's array flattening behavior and how that is viewed as a feature.
14:38 mst foo($self, \@args, $cb) would be ok
14:38 mishantil People seem to massively confused by the lack of established conventions, and that strong typing isn't a thing unless you throw modules at the problem.
14:39 batman i don't see why a signature should behave anything like my ($self, @args, $cb) = @_;
14:39 batman it's new syntax. it should do new shiny stuff :)
14:39 ribasushi mishantil: so let's turn the language into a paragon of strong-typedness, so it loses point for everyone who uses the lnaguage for this very reason, right.
14:39 mst batman: right, but you can't have an optional argument after that, and you can't have a second array, and, and ...
14:40 mst having only the last thing be slurpy is a net win
14:40 mst since you can't do anything else and have it remotely consistent with itself, let alone the rest of perl
14:40 batman mst: at lease supporting a \&code_ref as the last argument.
14:40 batman c'mon
14:40 batman :D
14:41 mishantil ribasushi: I sincerely don't hope that happens. I love it for the weak typing. But new users are massively confused, and when you google for resources on perl there aren't exactly many good hits.
14:41 mishantil Thought it is starting to get better with people in the perl community blogging more.
14:42 mishantil I've heard people mentioning mst(pan) as a good reference when they need an overview of whats available.
14:42 tianon joined #mojo
14:42 ribasushi hahaha ;)
14:43 punter joined #mojo
14:50 Lee mishantil: i think there are many good hits, they're just dwarfed by the amount of outdated / shit hits
14:51 mishantil Lee: True enough. It's hard to find the good ones.
14:52 mishantil Hehe. I had one of my developers vent here the other day abou how every time he googled how this or that should be done with mojo he _always_ got the manpage for Mojolicious::Guides::Rendering as the top hit.
14:53 Lee that sort of implies the documentation isn't good enough?
14:53 mishantil Lee: I feel the mojo documentation is very good.
14:53 mishantil However, what I see missing is more people explaining how they _use_ mojolicious.
14:54 Lee yes, learning by example and all that
15:01 mishantil But yeah, all things considering I think the mojo documentation is pretty clear and has good examples with decent scoping.
15:04 jberger consistently the problem seems to be that people skim the documentation
15:05 Lee FWIW i've uploaded my talk(s) to my blog - perhaps the mojo site/wiki might add value if it had links to some talks? probably need vetting though?
15:13 jberger Lee: post the links here and lets see
15:13 batman any assetpack users that can come up with a good idea on how to purge old packed files?
15:13 jberger I still regularly get feedback on my mojo talks, tbh
15:13 batman ls share/public/packed/|wc -l # 620 ...
15:13 Lee jberger: specifically i mean links to the mojoconf talks and such
15:13 Lee (people should be able to find these i know, but links wouldn't hurt?)
15:14 jberger Lee: have we seen them?
15:14 Lee mine?
15:14 purl mine is just for static stuff... not happy enough with it to contrib, but I send the pastes out :) or a creamsicle
15:14 jberger I don't think Jimmy Hoffa is making Mojo talks anymore
15:14 jberger :-P
15:26 romel hi. if anybody has few minutes, please take a look: http://pastie.org/private/lgaaqqdxglzuukgyipqaq i am wondering if such approach is fine at all. especially adding 'custom' routes using $r->find('some_entity')->route('/blabla')
15:35 sh4 joined #mojo
15:39 sri mojolicious still needs a book
15:43 batman is it possible to write to the DATA filehande in a made up package?
15:43 wikihead joined #mojo
15:43 batman does it even exist?
15:43 batman i want to make an in memory package where Mojolicious::Static can look for files.
15:44 batman i guess i could use a before_dispatch hook, but that doesn't sound as as much fun :)
15:47 uma joined #mojo
15:47 batman that was too easy
16:03 Oleg joined #mojo
16:04 kopekru joined #mojo
16:07 crab i want to write a mojolicious book, but it would probably be too damn painful
16:12 jberger I keep saying we should each write a chapter
16:12 jberger it would be over in no time
16:12 Trelane You'd need someone who was the primary author to write a paragraph summary of what will be in each chapter
16:13 jberger that's the corresponding editor, or some such
16:13 mst I think for the cat book we basically had titles and some approximate bullet points and then left the chapter authors to it and it basically worked out
16:14 Trelane That's still a time consuming and painful role;  See also The Perl Advent Calendar
16:14 tianon joined #mojo
16:16 Trelane In an ideal book you'd start with a simple app in chapter one and keep adding to it chapter by chapter
16:16 Trelane you know, it'd start out as a ::Lite app, and each chapter you'd add something like, say, Mojo::Pg, or some websocket code, etc, etc
16:17 Trelane The trouble with that is it doesn't lend itself to the kind of writing that multiple people can do
16:17 jberger I'm not sure I would want a single example that spans multiple chapters
16:17 Trelane Isn't that what makes a book a book though?  A linear progression?
16:17 Trelane Otherwise how is it different to, say, the online documentation?
16:18 jberger more verbose
16:18 jberger readable and wordy
16:18 jberger with longer explaination
16:18 jberger and sure, more examples
16:18 jberger and a pedagogical progression
16:18 mst IME trying to have a single project across an entire book results in a contorted shitty book as often as it results in a coherent narrative
16:18 Trelane Isn't verbosity a constrained problem with dead tree, whereas the online documentation it costs nothing to add a few more pages?
16:19 romel if i add helper named 'geocode', then $self->geocode inside controller returns object of current controller's class no matter what i put inside appropriate helper subroutine. is there any reserved word or something?
16:19 jberger Trelane: you might think that, and yet the longer we make the guides, the less people seem to really read them
16:20 jberger we could probably make the guides three times as long, but do you think that that would improve uptake? I don't really think so
16:23 Trelane being my own devil's advocate, no matter how good a hypothetical book with a wonderful theme running through it might theoretically be, it's not as good as a book that actually gets written.
16:24 jberger Trelane: that's certainly true
16:24 crab what does one use these days to write a book anyway?
16:24 Trelane So, speaking from the Perl Advent point of view, there's three hard things
16:25 Trelane 1) Deciding on some sort of format to write it in
16:25 Trelane crab: github + some common format (bespoke markdown, bespoke pod) + something to turn it into what the publisher wants
16:26 Trelane the modern perl book might be a good source of examples here
16:26 Trelane rjbs did most of this stuff for the modern versions of the advent calendar (thank god)
16:26 Trelane 2) Convincing people to agree to do the work, and actually chasing them to do the work
16:27 jberger I think I would either do markdown or latex
16:27 crab so first i have to pick a catchy nom de plume and erase all traces of my earlier identity. got it.
16:27 Trelane 3) Lots and lots of copyediting
16:27 jberger and I think that no one else would do latex
16:27 crab jberger: i just made my dad convert all the equations in his book to latex
16:28 Trelane Here's what the cool kids do: They write it in markdown, and then have some sort of bespoke escape for "I'm going into HTML here" or, in this case "I'm going into latex here" to do the hard stuf
16:29 Trelane siracusa writes his stuff in HTML and then has a shitload of Perl scripts to munge it into various HTML and ebook formats
16:30 mst I mostly wrote in markdown and apress try and didn't kill me
16:30 mst didn't try and
16:30 mst fucking post-line editing
16:31 crab ok then
16:31 Trelane mst: I'm curious how you did page count etc
16:31 sri markdown seems like a reasonable choice
16:31 genio joined #mojo
16:31 Trelane Did apress just say "It can be as long as you want"
16:32 Trelane One of the advantages of self publishing ebooks is that you don't have that kind of problem
16:32 crab i don't think i could bring myself to do anything but self-publishing an ebook, to be honest
16:33 Trelane Apple have a really powerful app for making ebooks
16:33 Trelane Of course, they can only be viewed on apple devices or PDFs
16:33 Trelane (and you probably want to keep everything in plain text as long as possible)
16:34 crab 'course
16:34 jberger LaTeX is a really powerful app for making PDFs
16:34 Trelane The other question is who do you want to write the book for?
16:35 niczero LaTeX would be a fast route to killing the project
16:35 Trelane Do you want to start at the very very beginning, or do you want to assume a little Mojo knowledge
16:35 jberger niczero: yeah, I know :'(
16:35 Trelane Do you want to assume Perl knoweldge (probably)
16:36 jberger niczero: https://github.com/jberger/MojoBook/blob/master/basics/lite/lite.tex
16:36 niczero I like books that have 'advanced sections' in boxes in each chapter
16:36 niczero "don't read this till you've had some coffee"
16:37 jberger my favorite part of that page: "\label{sec:lite_not_magical}"
16:37 niczero I'll happily read any book if at least 10% stretches my knowledge
16:38 niczero I still think chapters by different authors is win
16:39 niczero perhaps two halves; first half is coherent flow, gradually building you up from post-tutorial; second half is advanced chapters, one topic per chapter
16:39 niczero eg a chapter on what you can do with templating
16:40 * niczero is loving .ep these days
16:40 niczero s/days/years/
16:40 Trelane that's not a bad idea
16:41 Trelane That also means you can touch on many subjects quickly as you need to build up an application, then you can deep dive when the reader has a basic understanding of all the bits
16:41 niczero essactly
16:42 niczero reading the first half, the reader doesn't want to know about 'extends' etc, but in the templating chapter that's exactly what they want
16:42 sri problem with self-publishing is the lack of proper editing
16:43 sri you end up with packt quality
16:45 niczero I'd recommend having two editors, one technical (sri) and one language (someone with an anal education in English grammar)
16:45 Trelane for bonus points, have someone who actually understands typography and layout and all that too
16:46 mst sri would make a terrible technical editor, he can audit for correctness but actual technical editing is about comprehensible and clarity of the technical parts which is generally hard for an expert to do usefully
16:46 Trelane you also need reviewers
16:47 sri i can do technical review
16:47 niczero I'm guessing reviewers would be the easy bit
16:47 mst Apress got us Jacinta; she drove me up the fucking wall but found stuff that there's no way somebody who was already at expert-level could've found
16:47 Trelane I know almost nothing, I can complain when things don't make sense
16:47 woz joined #mojo
16:47 sri yea, i guess volunteers for reviewing won't be a problem at all
16:48 Trelane I can also complain when things do make sense.  Complaining is something I can do
16:48 Trelane ;-)
16:48 Trelane mst: Jacinta Richardson?
16:48 mst Trelane: right
16:49 mst every time she sent a round of feedback I had to read it, then put work on the book down for the day because I was too angry
16:49 mst then the following day I'd re-read it and make 85% of the suggested changes
16:51 Trelane you mean like I should tell jberger that that ::lite code needs an example of the code before and after turning into a full blown application
16:51 Trelane It might actually need to be a full chapter in it's own right
16:51 Onigiri Trelane: hey, that would be useful.
16:52 juikuen joined #mojo
16:53 * jberger ponders replying: THATS IN THE GROWING GUIDE!!!!
16:54 Trelane that's not in the book
16:55 r2d2 joined #mojo
16:55 jm666_ joined #mojo
16:55 jberger oh, right
16:56 jberger well of course there would be one of those too
16:56 r2d2 hi all
16:56 jberger I imagine that every topic in the Guides would get mentioned in the book
16:56 jberger I have a bad feeling about this
16:56 jberger :-P
16:58 genio joined #mojo
17:16 dod joined #mojo
17:16 asarch joined #mojo
17:34 kaare joined #mojo
17:35 disputin joined #mojo
17:39 wikihead joined #mojo
17:39 OmarOthman left #mojo
17:45 * Grinnz volunteers to be a grammar nazi
17:49 * genio cowers in fear
18:13 berov joined #mojo
18:21 jb360 joined #mojo
18:52 * sri wonders if he should just go the opposite direction with this and make ->active($not_really_a_timer) just die all the time https://github.com/kraih/mojo/issues/767
18:53 sri 5 lines of additional code
19:05 woz joined #mojo
19:05 irq joined #mojo
19:18 jnbek joined #mojo
19:20 good_news_everyon joined #mojo
19:20 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/hK2Q
19:20 good_news_everyon mojo/master c19f663 Sebastian Riedel: improve Mojo::Reactor::EV and Mojo::Reactor::Poll to fail more consistently (closes #767)
19:20 good_news_everyon left #mojo
19:21 sri can't say i'm happy with the solution, but this might at least prevent a few bugs :/
19:25 sri great, nobody noticed the travis fails yet https://travis-ci.org/kraih/mojo/builds
19:29 good_news_everyon joined #mojo
19:29 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/hKrH
19:29 good_news_everyon mojo/master b9d985f Sebastian Riedel: use substitution again
19:29 good_news_everyon left #mojo
19:30 sri we need to get rid of 5.10 and 5.12... those are getting annoying
19:35 sri but in this case they actually found a bug in the test :o
19:36 good_news_everyon joined #mojo
19:36 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/hKPt
19:36 good_news_everyon mojo/master cdd197a Sebastian Riedel: stringify cookies before parsing them
19:36 good_news_everyon left #mojo
19:47 jnbek joined #mojo
19:49 Anon021 joined #mojo
20:00 mattastrophe joined #mojo
20:00 csson joined #mojo
20:02 dod joined #mojo
20:17 alexbyk joined #mojo
20:19 dod joined #mojo
20:22 da5id joined #mojo
20:26 uma joined #mojo
20:44 melo joined #mojo
21:16 disputin joined #mojo
21:28 disputin joined #mojo
21:49 alnewkirk joined #mojo
22:17 juikuen joined #mojo
22:17 sri the croak in ->again already helpers me actually :)
22:17 sri s/helpers/helped/
22:18 sri was wondering if timer/connection ids could be generated faster, and used a very fast refaddr based solution with race conditions that triggered the croak
22:18 disputin joined #mojo
22:29 jzawodn the docs for is_readable in Mojo::Reactor say: "Quick non-blocking check if a handle is readable, useful for identifying tainted sockets."  What does 'tainted' mean in that context?
22:30 sri that method doesn't actually exist anymore :)
22:30 jzawodn uh, ok
22:30 jzawodn what *did* it mean?
22:31 jzawodn it's in our version :-)
22:31 sri unexpected write or close from the other side
22:31 jzawodn using it seems to fix a bug for me but I'm unsure... oh!
22:31 jzawodn perfect
22:31 jzawodn so then... when I upgrade, what repalces it?  or how is that case addressed?
22:32 sri it was used to implement Mojo::IOLoop::Stream::is_readable
22:32 sri which now uses a private api
22:33 sri which is a one-liner you can steal https://github.com/kraih/mojo/blob/master/lib/Mojo/Util.pm#L431
22:34 sri https://github.com/kraih/mojo/blob/master/lib/Mojo/IOLoop/Stream.pm#L28
22:34 sri takes a timeout in microseconds and a file descriptor
22:34 jzawodn if I haven an i/o watcher and was only watching it for readability, what's the right way to test that the connection wasn't closed then?  right now I check $loop->reactor->is_readable($handle)
22:35 sri you check what sysread returned
22:36 jzawodn hmmm.  I may be approaching this the wrong way.
22:36 sri is_readable was never very precise, it just told us "something" happend to a cached handle and we better throw it away
22:37 bc547 joined #mojo
22:37 jzawodn yeah, I'm dealing with *sudder* async DBD::mysql handles in this case
22:37 jzawodn *shudder* that is
22:37 sri it's for handles you remove from the event loop and stash somewhere... keep alive connections and the like
22:37 sri oh, that is more complicated
22:37 jzawodn sadly, yes
22:38 sri since you better not touch the handle
22:38 sri had the same problem with Mojo::Pg
22:38 sri my workaround is horrible
22:38 jzawodn if I give up persistent connections, this problem likely goes away.  maybe I should
22:39 sri https://github.com/kraih/mojo-pg/blob/master/lib/Mojo/Pg/Database.pm#L169
22:39 sri that basically calls $dbh->pg_notifies in an eval, because it throws and exception if the connection is closed :)
22:40 jzawodn yeah.
22:40 sri has Mojo::mysql not solved the problem?
22:41 sri it looked like they were putting a lot of effort into it the other day
22:41 jzawodn in this context, I've attempted to fire a query at a mysql server on a persistent connection (that the server dropped in the meantime) and need to tell the difference between "handle is ready to read" and "handle is broken"
22:41 jzawodn hm, we're probably a rev or two behind on DBD::mysql at this point
22:42 woz joined #mojo
22:42 sri doing anything more than checking for readablity with the DBD::* descriptor scares me, because we don't even know what it is
22:42 jzawodn since this is a short-term problem, I think I'm gonna give up on persistent conns
22:42 sri socket, pipe...
22:42 jzawodn yeah
22:43 jzawodn this is actually a sphinx server (speaks mysql protocol) I'm talking to.  but we're >< this close to having a usable native sphinx http interface anyway
22:43 sri https://github.com/jhthorsen/mojo-mysql/blob/master/lib/Mojo/mysql/Database.pm#L98
22:44 sri my $rv = do { local $sth->{RaiseError} = 0; $sth->mysql_async_result; };
22:44 sri that looks promising
22:44 jzawodn also interesting is the fd dup a few lines above that
22:45 sri not sure why they do that
22:48 sri you do need to watch out for the implicit close though, when your handle gets destroyed, that will mess up the descriptor
22:48 jzawodn I think that's what is happening
22:49 jzawodn (server-side timeout on idle conns)
22:49 tianon joined #mojo
22:49 sri are you using something like IO::Handle->new_from_fd(...)?
22:50 sri never ever destroy that handle, it will close the file descriptor (perl quirk)
22:50 jzawodn that's what I'm doing, yes.  but I only destroy it after removing it from the event loop
22:51 sri the dbh is busted afterwards
22:52 jzawodn yeah, I destroy the connection in the case
22:52 jzawodn but there's still something brokenish in here
22:53 sri well, if you can use Mojo::mysql
22:54 jzawodn actually I'm leaving for a 10 day vacation in about 2 hours.  so I either ship a simple fix or leave it as is :-|
22:57 sri hmm, looks like Mojo:mysql is moving away from Mojo::Pg though :/
22:59 jzawodn I'm just going to focus on the HTTP protocol after my trip, since that'll all be 'native' mojo code and far easier to work with.
22:59 sri guess i'm taking back my recommendation... i don't see this staying maintainable https://github.com/jhthorsen/mojo-mysql/pull/12/files#diff-63c0f2ed0e25055ef5611dc2ff92bf5eR1
23:01 jzawodn there's a lot of green in there
23:02 sri batman: that is terrifying!
23:05 sri on a related note, i am actually waiting for that one big mojolicious pull request with an http2 implementation :)
23:09 Zoffix :D
23:33 nicomen here I thought http2 could away
23:34 nicomen +go
23:40 preaction Google wins the Internet now
23:40 pink_mist how so?
23:41 pink_mist oh, you mean http2 things?
23:51 asarch joined #mojo
23:58 good_news_everyon joined #mojo
23:58 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/hiRs
23:58 good_news_everyon mojo/master e42600f Sebastian Riedel: a few more dynamic content examples
23:58 good_news_everyon left #mojo

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