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

IRC log for #mojo, 2017-04-28

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

All times shown according to UTC.

Time Nick Message
00:22 zivester joined #mojo
00:48 kiwiroy joined #mojo
01:05 cheako joined #mojo
02:47 noganex joined #mojo
03:48 aborazmeh joined #mojo
04:04 dboehmer_ joined #mojo
06:19 inokenty-w joined #mojo
06:24 go|dfish joined #mojo
06:39 dod joined #mojo
06:45 dod joined #mojo
06:48 kiwiroy joined #mojo
06:55 AndrewIsh joined #mojo
07:12 Vandal joined #mojo
07:29 hottranny joined #mojo
07:39 trone joined #mojo
07:42 salva joined #mojo
07:42 dod joined #mojo
07:48 karjala_ joined #mojo
08:13 kes joined #mojo
08:14 kes Hi. It will be handy if in tests the route name will be reported
08:14 kes ok 1 - GET /v1/users (list_users)
08:24 stryx` joined #mojo
08:24 rshadow joined #mojo
08:26 berov joined #mojo
08:27 Trick14 my websocket client is working correctly as long as it doesn't receive messages bigger than a certain seize
08:28 Trick14 i don't know that certain seize (no control over the server part of the websocket)
08:29 Trick14 64285 bytes is okay, 126823 nok
08:30 Trick14 numbers obtained from observing in developers tools the same websocket in chrome
08:30 rshadow joined #mojo
08:32 karjala_ joined #mojo
08:32 karjala_ Thanks for perl-core
08:33 osfabibisi joined #mojo
08:33 karjala_ (wrong channel)
08:42 stryx` joined #mojo
09:18 Xyem Trick14: 64KiB is 65536 bytes so that seems like a likely boundary. Perhaps write your own server to test this?
09:21 Xyem Having a quick look in the Mojolicious documentation would imply it isn't Mojolicious that is the limiting factor: http://mojolicious.org/perldoc/Mojo/Transaction/WebSocket#max_websocket_size
09:22 TBSliver joined #mojo
09:46 Trick14 good suggestion Xyem
09:46 Trick14 will try later today, did notice 79014 bytes just went ok
09:50 Trick14 so already moved up
09:53 Trick14 strange thing is the subsequent messages (after receiving an apparently too big one) are also scrambled up
09:53 Trick14 but back to work for couple of hours now first
10:31 sri very possible browsers have rather small websocket message size limits
10:58 eseyman /win 19
11:20 kiwiroy joined #mojo
11:25 cng joined #mojo
11:34 PopeF joined #mojo
12:35 esh joined #mojo
12:48 kiwiroy joined #mojo
12:50 gizmomathboy joined #mojo
12:55 gryphon joined #mojo
13:06 Armen good... day
13:07 tchaves joined #mojo
13:13 CHYC joined #mojo
13:19 rshadow joined #mojo
13:22 new_student joined #mojo
13:33 elik joined #mojo
13:45 kes joined #mojo
13:50 marty joined #mojo
13:56 esh joined #mojo
13:56 CHYC When using Mojolicious::Validator::Validation is there anyway to force an arrayref in a topic's output value? I was thinking there'd be a filter that did it but I cannot find one.
13:59 CHYC On a similar topic, wouldn't the following 500 if multiple title/body params are supplied? https://github.com/kraih/mojo-pg/blob/master/examples/blog/lib/Blog/Controller/Posts.pm#L45
13:59 CHYC (Sorry for the overloaded use of topic)
14:02 maschine joined #mojo
14:10 trone joined #mojo
14:14 mcsnolte joined #mojo
14:15 Pyritic joined #mojo
14:19 rshadow joined #mojo
14:29 karjala_ joined #mojo
14:30 karjala_ Is it possible for an <% ... =%> or similar tag/expression to trim whitespace only from the right and not from the left?
14:35 sri no
14:35 PopeF karjala_ - looking at the docs for Mojo::Template, I think you'll have to do a regex
14:35 PopeF s/I think//
14:35 PopeF :)
14:36 jberger Armen++
14:36 karjala_ I need to produce many <input type="checkbox" checked /> lines, where the "checked " (note the space) appears conditionally - condition is placed in a new line in the template because it's large, so I want to trim to make everything appear packed and in one line, but I don't want to remove the space from "checked "
14:36 jmac left #mojo
14:36 karjala_ That's why I'd need to trim from the right and/or left
14:37 karjala_ to make the HTML source beautiful!!
14:42 karjala_ doesn't sound very interesting to anyone else, eh?
14:42 karjala_ ok
14:44 zivester joined #mojo
14:58 karjala_ PopeF, what kind of regex were you thinking of? Where should I place it?
14:59 elik joined #mojo
15:02 khfeng joined #mojo
15:17 yysachinyy joined #mojo
15:19 rshadow joined #mojo
15:29 berov left #mojo
15:31 stryx` joined #mojo
15:46 PopeF0 joined #mojo
15:46 PopeF0 karjala_ - sorry, went AFK.
15:46 PopeFelix that's better.
15:50 PopeFelix You can put arbitrary Perl code in a Mojo template, so just do a regex. Something like <% (my $var2 = $var1) =~ s/^\s*//; %>
15:51 PopeFelix Play with it, see what you get. :)
15:52 esh joined #mojo
15:52 karjala_ oh ok
15:59 esh joined #mojo
15:59 jberger (1) wait, this is inside the tag not around the tag? (2) this is a great case for /r because ewwwwwwwwww
16:04 jberger anyway, I'd probably at this point make a helper that builds the HTML like I want so that I don't have even that much logic in a template
16:04 CHYC At a conceptual level, would the idea of forcing context in validation output be dismissed out of hand? It seems to me the ease of generating 500 errors in the Blog example would imply not.
16:05 jberger string manipulation inside a regex feels dirty, since the template is itself string manipulation
16:05 jberger CHYC: what do you mean by context?
16:05 CHYC https://gist.github.com/chy-causer/21a6d749afe7e74a3436082df15e5aad
16:05 jberger also, the Blog example isn't really production quality code
16:06 CHYC jberger: perhaps so, but adding the validation ironically makes the example more fragile than just using ->param($FOO)
16:06 jberger wait, you mean perl-ish context?
16:07 jberger wantarray
16:07 purl wantarray is, like, Returns true if the context of the currently executing subroutine is looking for a list value. Returns false if the context is looking for a scalar. Returns the undefined value if the context is looking for no value (void context)
16:07 jberger ?
16:07 jberger shut it purl
16:07 * purl shuts it
16:07 elik joined #mojo
16:07 jberger wantarray is (I think its safe to say) never coming back into the mojo codebase
16:07 jberger after the amount of effort put in by sri and I to remove it
16:08 CHYC jberger: Again I've overloaded my terminology, sorry. I mean if I submit ?a=1&a=2 it's suuper easy to choose between a string and arrayref via param and every_param. Once you throw in validation however, it gets much harder to get the distinction out of the $validation->output
16:08 sri not ad long as i'm alive
16:08 sri s/ad/as/
16:09 CHYC This has nothing to do with perl's wantarray, so perhaps I should have chosen better worded variables to distinguish.
16:09 sri or undead
16:09 jberger CHYC: I can't say that I follow as I'm not a user of the build-in validation
16:09 jberger (almost all the apis I build are JSON)
16:10 jberger can you highlight where this problem happens in the Blog example and/or give a minimal usage example?
16:10 jberger IM(uninformed)O, passing a parameter an unexpected number of times is reason to fail validation
16:11 CHYC jberger: That's the problem, it passes validation!
16:11 jberger you were talking about 500s before
16:11 jberger I'm confused
16:11 sri i tried looking at the problem, but the information is too fragmented for me to understand
16:12 jberger is there some backstory I'm missing?
16:12 CHYC I commented on it at 14:56
16:15 CHYC I'll stop prattling on for now and try to submit using a better medium next week.
16:17 jberger so what you are saying is that ->output has multiple values only the last of which was validated?
16:17 CHYC No, that's not what I'm saying.
16:20 rshadow joined #mojo
16:22 sri the patch is not saying very much at all
16:23 CHYC sri: It's not the most elegant way of solving the problem, but I had hoped it would have shown the issue.
16:24 sri i don't get it
16:25 arcanez joined #mojo
16:29 CHYC https://gist.github.com/chy-causer/d7541ca8e7f0f5fc5a317944b5b4d0cf
16:32 arcanez joined #mojo
16:33 jberger CHYC: that still seems to me the the crux of your argument is that ->output isn't behaving correctly
16:33 sri so, what you want is a way to enforce the value format in $validation->output
16:33 sri which currently can be either, a single value or an array ref
16:34 sri and your proposal for doing it is two magical filters
16:34 sri that are not really filters, but flags
16:34 sri i'd name them single/multi though
16:35 sri or go for a one/all if number of values validation is in the cards for the future
16:37 elik joined #mojo
16:38 cheako joined #mojo
16:39 sri or even first/last/all
16:39 sri yea, i like that one
16:39 CHYC sri: yes, exactly thatk
16:40 CHYC don't care about the names
16:40 sri yea, i can see that getting accepted if it's reasonably clean and doesn't misuse hated terms like wantarray ;p
16:40 dod joined #mojo
16:48 CHYC Thanks. I totally understand your hatred of wantarray :)
16:50 Grinnz interesting how much this post predated the big CGI issue http://www.perlmonks.org/?node_id=729965
16:55 esh joined #mojo
16:57 Trick14 86714 how can i get the debug output written to file commandline?
16:57 Trick14 -86714
16:57 purl -86714
16:58 jberger Trick14: please clarify, the debug output or the log output?
16:59 Trick14 I've set MOJO_USERAGENT_DEBUG environment variable when invoking perl
16:59 jberger ok, so that's proper debug
16:59 jberger its written to STDERR
17:00 jberger so 2>filename
17:00 Grinnz debug vars are not intended for long term usage, but quick debugging
17:00 jberger standard unixy way
17:00 jberger (also, what Grinnz said)
17:00 esh joined #mojo
17:01 Trick14 mmm must step away for second, becoming dumb
17:01 Trick14 (it is okay thus)
17:02 Trick14 is client_max_window_bits implemented for permessage deflating?
17:04 esh joined #mojo
17:05 Trick14 I don't see (but I miss stuff;-) ) any reference to the different modes of permessage deflating in the documentations nor in the packages
17:07 sh14 joined #mojo
17:16 esh_ joined #mojo
17:21 stryx` joined #mojo
17:22 Pyritic joined #mojo
17:26 esh joined #mojo
17:29 sh14|2 joined #mojo
17:47 kiwiroy joined #mojo
17:54 cheako joined #mojo
18:16 kiwiroy joined #mojo
18:17 disputin joined #mojo
18:21 elik joined #mojo
18:28 tchaves joined #mojo
18:55 tyldis_ joined #mojo
18:59 tyldis_ joined #mojo
19:59 marty joined #mojo
20:36 demian joined #mojo
20:36 demian anyone using systemd with plenv?
20:38 demian setting /path/.plenv/shims/hypnotoad for the ExecStart/Stop.. doesn't appear to be hitting the perl in the .perl-version
20:41 Grinnz it wouldn't, systemd doesn't run in your application directory
20:41 Grinnz maybe set plenv_VERSION as https://github.com/tokuhirom/plenv#plenv-shell does
20:41 Grinnz PLENV_VERSION
20:42 Grinnz https://www.freedesktop.org/software/systemd/man/systemd.exec.html#Environment=
20:42 demian Thanks!  I'll give it a shot
20:48 kiwiroy joined #mojo
20:50 demian thanks again Grinnz, it works. within [service] : Environment="PLENV_VERSION=someperl"
20:53 PopeFelix joined #mojo
20:54 disputin joined #mojo
20:55 dikim joined #mojo
21:06 PopeF joined #mojo
21:25 Pyritic joined #mojo
21:47 orev joined #mojo
21:57 SwellJoe joined #mojo
22:05 tchaves joined #mojo
22:52 marty joined #mojo
23:14 gizmomathboy joined #mojo
23:48 kiwiroy joined #mojo

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