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

IRC log for #mojo, 2016-01-26

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

All times shown according to UTC.

Time Nick Message
00:14 genio sri: When you need a mind-numbing fun game... http://reactoridle.com/
00:17 zax joined #mojo
00:18 disputin joined #mojo
00:41 CandyAngel I swear I should be a hardware/software tester. My server is now thrashing CPU trying to deal with the fact that I *shockhorror* ejected a drive out of my removable drive bay
00:42 CandyAngel I knew today was going too well :P
01:03 sri genio: think i'll stick with hearthstone for now ;p
01:10 genio aww.  no fun-o
01:20 lluad_ joined #mojo
01:27 binlei joined #mojo
01:28 lluad_ joined #mojo
01:30 Grinnz CandyAngel, next test: randomly unplug things
01:39 CandyAngel It's still doing it.. I have 2 kworker threads doing ummm.. sd_revalidate_device or something
01:39 CandyAngel I can't think how to stop them without rebooting
01:41 Grinnz did you try putting it back?
01:47 CandyAngel Yeah
01:51 bradjm joined #mojo
03:10 geheimnis` joined #mojo
03:41 noganex joined #mojo
04:00 jberger I think I just wrote my most insane bit of delay code ever
04:00 jberger better than my FriendFeed delay-repeat forever hack
04:04 sri is the refactoring on hold now that we know there's a serious performance cost?
04:06 jberger I've been letting that soak in the grey cells for a bit
04:06 jberger for the moment I'm trying to implement a letsencrypt plugin before my certs expire
04:06 jberger anyway, https://github.com/jberger/Mojolicious-Plugin-ACME/blob/master/lib/Mojolicious/Plugin/ACME/Command/acme.pm#L63-L80
04:06 sri eww
04:07 jberger hahaha
04:07 jberger its a step that repeats itself until all its arguments are undef
04:08 sri yea, it's the wrong pattern
04:08 jberger probably, but it was fun
04:08 sri it's futures bs observables
04:08 lluad joined #mojo
04:08 sri s/bs/vs/
04:09 lluad joined #mojo
04:09 sri delays are for stuff that happens once, and we have no pattern for stuff that happens multiple times
04:09 jberger I'm sure I can refactor it into something nicer, but for now this worked
04:10 jberger and it did check that my challenge completed (though there is only one at the moment)
04:11 jberger anyway, all that's left is to grab the cert
04:13 sri it bothers me that people mess with $delay->remaining
04:14 jberger I thought that was why it was made to be a public attribute
04:18 jberger anyway, it will be fairly easy to make this more traditionally recursive
04:20 good_news_everyon joined #mojo
04:20 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vzXi7
04:20 good_news_everyon mojo/master 00e40e4 Sebastian Riedel: more examples
04:20 good_news_everyon left #mojo
04:20 sri i mean, if this is a common pattern, maybe we should have something better
04:21 jberger I've only had to use it a few times
04:21 sri "a few times"
04:21 jberger oh c'mon, that's kinda fun isn't it :-P
04:23 c--_ joined #mojo
04:29 sri re the refactoring, i think it all depends on this method now https://github.com/kraih/mojo/blob/master/lib/Mojo/Server/Daemon.pm#L119-L151
04:31 sri that needs to be cleaned up a little
04:31 sri ideally in a way that makes it easier to support multiple transactions per connection
04:39 sri guess we could abstract out the whole websocket upgrade process
04:39 sri that's a bit in the way
04:39 jberger sri: https://github.com/jberger/Mojolicious-Plugin-ACME/blob/master/lib/Mojolicious/Plugin/ACME/Command/acme.pm#L62-L78
04:39 jberger that is nicer anyway
04:40 sri indeed
04:40 jberger I do need to stick a timer in there to keep from hammering the challenge server
04:40 sri kinda odd that nobody has made a robot wrapper for Mojo::UserAgent yet
04:41 sri to handle rate limit and robots.txt
04:42 sri still a little small, but it appears the sticker is beautiful \o/ https://pbs.twimg.com/media/CZnqUw1WkAA6Tw6.jpg
04:46 jberger argh, I can't wait
04:46 jberger mine are coming tomorrow!
04:46 binlei joined #mojo
04:53 Shaeto joined #mojo
04:55 inokenty-w joined #mojo
05:15 sri \o\
05:16 sri /o/
05:24 absolut_todd joined #mojo
05:34 jantore joined #mojo
05:37 sri oh, didn't realize that this channel is now bigger than #catalyst :o
05:44 lluad joined #mojo
05:45 Vandal joined #mojo
06:08 dj_goku left #mojo
06:24 jberger nice
06:24 jberger and \o/ my ACME plugin can now nominally generate a cert!
06:26 jberger its slightly longer than acme-tiny.py but it does SO much more
06:26 jberger with that, bed time
06:26 jberger nn
06:33 sri \o/
06:33 sri nn
06:35 kes joined #mojo
06:54 jb360 joined #mojo
06:54 dod joined #mojo
06:59 dod joined #mojo
07:24 dod joined #mojo
07:26 binlei joined #mojo
08:21 futurefaster joined #mojo
08:31 batman off topic: has anyone used zepto.js or minified.js?
08:31 batman not sure if i'm going to switch from jquery, but i'm still curious...
08:34 odc` joined #mojo
08:35 trone joined #mojo
08:35 sue joined #mojo
08:37 cpan_mojo Mojo-Weixin-1.0.1 by SJDY https://metacpan.org/release/SJDY/Mojo-Weixin-1.0.1
08:52 binlei joined #mojo
09:05 kes does it possible to set breakpoints at templates?
09:05 kes Can't call method "next" on an undefined value at template listeners/index.html.ep line 7, <DATA> line 46.
09:05 kes at this line ----^^^ for example
09:22 berov joined #mojo
09:33 Shaeto left #mojo
09:34 c-- joined #mojo
09:40 kes hm.. the $DB::single=1 works as usual
09:40 kes Template file are not located at %INC, but they are still at @{ "::_<$file" }
09:42 kes Maybe because of this the source are not displayed when error occour while we use template inheritance?
09:43 kes and we should load templates, for example via hook?
09:43 kes http://perldoc.perl.org/functions/require.html
09:48 sri argh... stuck at rank 2 in hearthstone again :(
09:48 sri never legend
10:03 Shaeto joined #mojo
10:05 n16gel joined #mojo
10:08 Shaeto left #mojo
10:12 jontaylor joined #mojo
10:30 punter joined #mojo
10:32 absolut_todd joined #mojo
10:38 jontaylor joined #mojo
10:41 AndrewIsh joined #mojo
10:45 CandyAngel I've improved MojoSubcommand.. it now replaces any instances of Mojolicious::Command in $app->commands->namespaces
10:46 CandyAngel So if it is in the middle of the namespaces, MojoSubcommand will replace it in the middle \o/
10:46 CandyAngel Help text is still wrong though -.-
10:51 dod joined #mojo
10:53 dod joined #mojo
11:05 osfabibisi joined #mojo
11:19 salparadise joined #mojo
12:02 nic http://paste.scsys.co.uk/504716
12:03 nic My syntax for restricted placeholder (in a lite app) must be wrong
12:03 nic if I remove the restriction (the term in [..]) it does the redirect
12:04 nic but with that attempt at restriction it never matches (even when qr/./)
12:04 nic batman: you're usually my lite_app syntax expert -- can you see what I'm screwing up?
12:06 nic http://mojolicious.org/perldoc/Mojolicious/Guides/Routing#Restrictive-placeholders
12:13 nic http://paste.scsys.co.uk/504717 is an executable (but wrong) example
12:27 nic batman: minified.js looks interesting.  Is your interest focused on mobile or broader use?
12:29 batman nic: sorry. i can't see what's wrong... maybe you have another route that gets the request instead..?
12:29 batman nic: my interest is everything :)
12:29 CandyAngel Just in case this is new information, $app->schema->txn_do(sub { $app->schema->resultset('WE')->create }); ### reaaaaaally slow
12:29 CandyAngel With SQLite anyway
12:29 batman i don't make "desktop web pages" anymore
12:30 CandyAngel Unless you "state $schema = ..."
12:31 nic minified looks even more interesting when compared to jquery+moment
12:31 nic (when size is important)
12:49 jkramer joined #mojo
12:49 jkramer Ahoy
12:57 n16gel joined #mojo
13:05 batman nic: i'll have a look at moment. thanks
13:07 nic I mean that minified does date manipulation, so saving you the cost of moment.js in addition
13:07 nic (I'm pretty much stuck with using jquery, but I'm finding these pointers interesting)
13:09 batman right. i try to avoid date manipulation :)
13:11 nic yesterday I was working on different ways of calculating tomorrow (in plain js).  Wasn't sure whether to laugh or cry
13:12 batman :)
13:12 jkramer left #mojo
13:12 nic If you're working with angular2, try {{ day | date:'yyyy-MM-dd' }}
13:13 batman i'm using riotjs
13:13 nic For reasons I don't yet understand, it does not do anything close to what you'd expect
13:14 nic (spoiler: it instead processed 'MM/dd/yyyy')
13:15 AndrewIsh joined #mojo
13:17 sri nic: perl -Mojo -E 'get "/some/:thing" => [thing => qr/./] => {inline => q{%= $thing }}; app->start' get /some/a
13:17 sri works flawless
13:18 CandyAngel The slow schema thing has been fixed without state.. I still had 'PRAGMA synchronous' on its default instead of turning it off (thankies ribasushi )
13:18 sri nic: http://mojolicious.org/perldoc/Mojolicious/Guides/Routing#Introspection
13:20 good_news_everyon joined #mojo
13:20 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vz1MK
13:20 good_news_everyon mojo/master 61612ae Sebastian Riedel: fix typo in routing guide
13:20 good_news_everyon left #mojo
13:20 nic ahhhhhh, just found my problem
13:20 nic the regex has to match the entire placeholder
13:21 nic there's an invisible ^....$ around the pattern
13:21 nic d'oh!!
13:21 sri someone didn't read the guide -.-
13:21 nic so your example failed for me cos I did "get /some/foo" :P
13:22 nic well there's an hour I could have done without losing
13:22 sri http://mojolicious.org/perldoc/Mojolicious/Guides/Routing#Restrictive-placeholders
13:23 nic yep, read that at least twice -- didn't tell me what I needed to know
13:24 nic anyway, thank you for stepping in and stopping me losing at least another hour
13:26 good_news_everyon joined #mojo
13:26 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vz1DA
13:26 good_news_everyon mojo/master cee9134 Sebastian Riedel: move introspection closer to restrictive placeholders
13:26 good_news_everyon left #mojo
13:27 nic yeah, if I'd re-read the whole guide, "routes -v" would have saved me
13:37 kaare joined #mojo
13:37 kes $v->optional makes scalars from one element lists (((
13:41 binlei joined #mojo
13:42 kes http://paste.scsys.co.uk/504718
13:47 marty_ joined #mojo
13:48 binlei joined #mojo
14:06 orev joined #mojo
14:09 neilhwatson joined #mojo
14:15 ajr_ joined #mojo
14:18 Shaeto joined #mojo
14:18 binlei joined #mojo
14:20 asarch joined #mojo
14:28 vanHoesel joined #mojo
14:59 mcsnolte joined #mojo
15:06 n16gel joined #mojo
15:16 binlei joined #mojo
15:24 Grinnz kes meant one element array refs, i believe
15:24 CandyAngel Whelp, I just coded myself into a corner -.-
15:27 CandyAngel Actually, maybe I haven't and it will just work correctly
15:30 kes joined #mojo
15:53 sugar joined #mojo
15:54 Shaeto1 joined #mojo
15:56 sue joined #mojo
16:01 Shaeto joined #mojo
16:20 lluad joined #mojo
16:26 Shaeto1 joined #mojo
16:30 Kogurr joined #mojo
16:41 jb360 joined #mojo
16:46 Shaeto joined #mojo
17:02 gryphon joined #mojo
17:05 bradjm joined #mojo
17:15 jontaylor joined #mojo
17:30 n16gel joined #mojo
17:41 disputin joined #mojo
17:48 disputin joined #mojo
17:53 disputin joined #mojo
18:14 ajr_ joined #mojo
18:33 hesh joined #mojo
18:34 dod joined #mojo
18:40 PopeFelix joined #mojo
18:42 PopeFelix I'm creating a TX with Mojo::UA. The headers are all terminated with CRLF, save the last one, "Host", which is only terminated with LF. How do I get the Host header terminated with CRLF?
18:49 jberger PopeFelix: you are saying that mojo is creating a transaction like that
18:49 jberger ?
18:50 PopeFelix jberger, yes, that's correct.
18:50 Grinnz_ are you setting any headers?
18:50 PopeFelix Grinnz_: Yes. Those headers are not terminated with CRLF or LF when I set them.
18:51 jberger PopeFelix: can you confirm by running your script with MOJO_USERAGENT_DEBUG=1 which should explicitly show the line endings
18:51 PopeFelix jberger, yes, just a moment
18:52 PopeFelix Well, when I do that, I see the headers, including Host, terminated with '\x0d'
18:53 Grinnz_ then there is a CRLF
18:53 jberger what made you suspect that it lacked the CR?
18:54 PopeFelix When I looked at it with $req->headers->to_string in vim, I saw "^M" at the end of every header save "Host"
18:54 PopeFelix When I looked at $req->headers->to_string in vim, rather.
18:54 jberger never tried that
18:55 jberger suspect I won't either given this :-P
18:55 PopeFelix Is it normal to have a CRLF between the headers and the body?
18:56 Grinnz_ yes
18:56 PopeFelix OK.
18:56 Grinnz_ every header ends in CRLF, and there's an extra one to indicate the end of the headers
18:56 jberger <3 http://mojolicious.org/perldoc/Mojo/Util#term_escape
18:57 PopeFelix Is there any way to remove that? I suspect this is causing the service I'm communicating with not to understand my requests.
18:58 * PopeFelix is trying to do SOAP/MTOM over raw POST. This may be a mistake.
18:58 jberger PopeFelix: remove what?
18:58 PopeFelix the CRLF between the headers and the body.
18:59 jberger I'd doubt if that was possible, at least easily
18:59 PopeFelix OK.
18:59 PopeFelix Thanks, all. I have to run. It looks like I need to rethink my approach to the problem.
19:00 Grinnz_ PopeFelix: if you remove that, any sensible client would not understand the request
19:00 PopeFelix Grinnz_ - this is an Oracle SOAP service. Sensible doesn't enter into it. ;)
19:00 Grinnz_ given.
19:00 PopeFelix anyway, gotta run
19:01 jberger PopeFelix: you could capture the output, format it to your suspicians and send it via telnet?
19:01 jberger at least to confirm
19:01 Grinnz_ if you do manage to implement a SOAP client in Mojo, it would be a nice thing for CPAN, btw; the best option right now is XML::Compile::SOAP, which also could work with a Mojo Useragent transport plugin if someone wrote one
19:02 Grinnz_ i'd generally suggest trying for the latter, as reimplementing a SOAP client doesn't sound very fun
19:04 cpan_mojo Module-Release-2.12 by BDFOY https://metacpan.org/release/BDFOY/Module-Release-2.12
19:05 dod joined #mojo
19:07 dod joined #mojo
20:02 jberger is there a mechanism or a plugin which outputs a stack trace to the log on exception?
20:06 pink_mist Carp::Always?
20:06 pink_mist not sure if that will actually do what you want, but sounds like it might
20:06 jberger I usually do that, but I'm looking for something a little more specific
20:07 PopeFelix Grinnz_: Writing a SOAP client for Mojo does not sound like my idea of a good time.
20:08 PopeFelix I went with Mojo for this because the WSDL for this SOAP service was full of things that XML::Compile::WSDL11 didn't like, like "xsl:any" elements.
20:08 PopeFelix or whatever you call it.
20:08 Grinnz_ most of what i hear about SOAP is how the WSDL is wrong anyway
20:08 Grinnz_ which makes me wonder, what's the point...
20:09 PopeFelix I couldn't tell you.
20:09 PopeFelix Oh, btw - jberger, that's a good idea. I'll try that.
20:10 PopeFelix I wonder why headers->to_string doesn't have that last CRLF.
20:11 Grinnz_ it's more of a separator
20:11 pink_mist because it's a sep... yeah that
20:11 pink_mist it's not part of the headers
20:11 PopeFelix That makes sense.
20:11 pink_mist it separates the headers from the payload
20:28 genio PopeFelix: Ask on the xml-compile email list: xml-compile@lists.scsys.co.uk  The maintainer is really active with responding to the mail list.  If something doesn't parse right, he's pretty good at pointing out why and supplying a fix
20:28 genio Making a SOAP client for anything is not something I'd venture out on
20:28 PopeFelix genio, thanks. If I switch back to XML::Compile::SOAP I'll do that.
20:29 genio Having done LOTS of soap in Perl, in my experience it's the most complete (TM) and easiest to work with.
20:29 * PopeFelix got fed up with trying to make things work with XML::Compile::WSDL11 and decided to just do raw XML to the endpoint.
20:29 genio heh.  there's always that
20:29 PopeFelix I don't need WSSE-Security.
20:30 genio Lucky man
20:31 PopeFelix Yeah, they supposedly support it, but in the docs it says you have to do HTTP Basic to actually authenticate, so...
20:31 PopeFelix Gods help me if I need WSSE security *and* Basic.
20:35 jontaylor joined #mojo
20:35 disputin joined #mojo
21:02 punter joined #mojo
21:06 bowtie joined #mojo
21:07 HtbaaPi_ joined #mojo
21:08 PryMar56 joined #mojo
21:21 PopeFelix Is there a better way to set the content of a Mojo request than $tx->req->content($content)?
21:21 PopeFelix $content is an instance of Mojo::Content::Multi in this case.
21:35 tempire Whoa
21:35 tempire An offer to sponsor http/2 development
21:37 jberger tempire: Oo
21:37 genio \o/
21:37 jberger tempire: we're not finished with the refactor yet, but a lot of the hard bits have been figured out
21:38 jberger its been a rather clean process so far
21:38 tempire I've been watching
21:46 marcus kinky
21:46 marcus #scnr
21:49 bowtie_ joined #mojo
22:30 ajr_ joined #mojo
22:46 disputin joined #mojo
23:25 tempire I just saw that a friend has some fancy mojolicious stickers
23:25 n16gel joined #mojo
23:35 disputin joined #mojo
23:59 disputin joined #mojo

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