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

IRC log for #mojo, 2015-06-19

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

All times shown according to UTC.

Time Nick Message
00:13 woz joined #mojo
00:17 d4rkie joined #mojo
00:36 asarch joined #mojo
01:00 good_news_everyon joined #mojo
01:00 good_news_everyon [mojo] Grinnz created unicode_characters (+1 new commit): http://git.io/vLann
01:00 good_news_everyon mojo/unicode_characters dd585a8 Dan Book: normalize unicode character designations and add literal characters
01:00 good_news_everyon left #mojo
01:00 Grinnz damn, i forgot github doesn't render the Mojolicious.pm pod :P
01:00 Grinnz i wanted to see if they would show up there
01:01 Grinnz sadly my browser font doesn't even render a few of those
01:03 Grinnz ... and my browser font in linux renders the opposite ones from my browser in windows
01:15 woz joined #mojo
01:19 thowe joined #mojo
01:20 klapperl_ joined #mojo
01:34 sri_ Grinnz_: not a good idea, we would be limited to choosing unicode symbols in common fonts in the future
01:34 sri_ and not just a funny name
01:36 d4rkie joined #mojo
01:37 Grinnz yeah...
02:03 jberger leont coins WTF-8
02:03 * jberger adopts
02:12 mst for mangled utf8?
02:14 Grinnz unfortunately the problem there isn't mangling, that could be solved more easily :P
02:15 d4rkie joined #mojo
02:16 woz joined #mojo
02:19 noganex_ joined #mojo
02:26 hshong joined #mojo
02:29 esh joined #mojo
02:53 noganex joined #mojo
02:58 coolo joined #mojo
03:03 esh joined #mojo
03:03 garu joined #mojo
03:03 go|dfish joined #mojo
03:03 jnbek joined #mojo
03:03 Jonis joined #mojo
03:03 rwp joined #mojo
03:03 BinGOs joined #mojo
03:04 davido__ joined #mojo
03:08 sivoais joined #mojo
03:08 garu_ joined #mojo
03:18 woz joined #mojo
03:34 kaare joined #mojo
03:37 thowe Is there a way to have url_for call 'some_route' with content of 'rss' or what have you so that it then uses the some_route.rss template?
03:39 thowe or should I just url_for('some_route.rss')
03:40 bpmedley thowe: So, you want some_route.rss.ep to be processed? Do you need Content negotation?   http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Content-negotiation
03:41 thowe No, I don't need content negotiation, the link will always lead to the rss version.
03:42 bpmedley $c->render(template => 'foo/bar/baz', format => 'rss')  <-- Will that work?
03:43 bpmedley http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Rendering-templates
03:43 thowe I'm specifically trying to make url_for build it for me.
03:44 thowe url_for('some_route.rss')  <- this works, I just don't know if it is "right"
03:45 davido__ joined #mojo
03:50 bpmedley thowe: Will this help?   http://mojolicio.us/perldoc/Mojolicious/Guides/FAQ#Where-did-my-file-extension-go
03:51 thowe that seems to suggest that what I am doing is just groovy...
03:52 thowe Possibly even expected...
03:52 thowe So, OK, thanks!
03:52 bpmedley Always nice to found out, eh?   :)
03:53 thowe I seem to recall url_for in Catalyst had all kinds of options, but Mojo mayu make this particular one not needed.
03:54 Grinnz hmmm http://www.unicode.org/emoji/charts/full-emoji-list.html
03:55 Grinnz this has (at least black and white) base64 encoded images for every character...
03:55 bpmedley That's cool.. try using those in LaTeX..
03:55 Grinnz i wonder if there would be any license issue embedding those in the pod
04:19 woz joined #mojo
04:27 jberger Just get a Unicode spanning font
04:29 Grinnz for mojolicio.us, metacpan, s.c.o., and github? :P
04:29 Grinnz well, scratch the last, but still
04:30 jberger For yourself, screw everybody else! It's not like Unicode is about inclusion or anything!
05:05 Adurah joined #mojo
05:14 dod joined #mojo
05:20 dod joined #mojo
05:20 woz joined #mojo
05:33 mattastrophe joined #mojo
06:10 d4rkie joined #mojo
06:13 melo joined #mojo
06:21 woz joined #mojo
06:30 kaare_ joined #mojo
06:45 dod joined #mojo
06:46 esh_ joined #mojo
06:46 sivoais_ joined #mojo
06:50 BinGOs joined #mojo
06:51 Jonis joined #mojo
06:51 rwp joined #mojo
06:51 go|dfish joined #mojo
06:51 garu joined #mojo
06:52 ans joined #mojo
06:52 davido__ joined #mojo
06:53 jnbek joined #mojo
06:56 garu_ joined #mojo
07:00 eseyman joined #mojo
07:04 trone joined #mojo
07:13 mattastrophe joined #mojo
07:23 woz joined #mojo
07:55 Vandal joined #mojo
08:08 d4rkie joined #mojo
08:18 dp_ joined #mojo
08:20 berov joined #mojo
08:24 woz joined #mojo
08:33 joelb joined #mojo
08:35 woz joined #mojo
08:54 joelb M::P::Authentication has something that's puzzling me
08:54 joelb https://metacpan.org/pod/Mojolicious::Plugin::Authentication#signature_exists
08:54 joelb I'm struggling to understand how that is less secure than https://metacpan.org/pod/Mojolicious::Plugin::Authentication#is_user_authenticated
08:55 joelb How can a malevolent pass the first test but not the second?
08:56 joelb (I'm exluding considerations of OAuth at this point)
08:56 Dandre left #mojo
09:09 pink_mist joelb: a malevolent entity could copy the cookie store from a target and then use that cookie and signature_exists would accept it .... I would however be /surprised/ if is_user_authenticated wasn't also subject to the same issue
09:09 pink_mist so I dunno really
09:10 joelb pink_mist: essatly
09:10 joelb a stolen cookie passes both tests
09:12 pink_mist well, I suppose if you also check against originating ip, that would help some
09:13 joelb yes, I can guard against cookie theft, but I'm thinking I may as well use the cheaper 'authenticated' test either way
09:43 mattastrophe1 joined #mojo
09:49 Dandre joined #mojo
09:49 batman not sure if i would bother about cookie theft if you're using ssl.
09:49 batman and you're pretty screwed anyway, if you're not using ssl, ... :)
09:50 batman or... i guess that "not bother" could depend on the site... a complex site is probably more exposed to xss
09:53 hahainternet so, i don't know if anyone's been using minion
09:53 hahainternet in a replicated Pg environment
09:53 hahainternet but i assume that the on insert trigger will fire whenever the replicated writes hit a server
09:53 hahainternet i'm trying to use it for periodic jobs rather than one-offs, so i'll need to re-populate the jobs table from a separate table at some point, it seems, although i'm new to minion too
10:43 joelb batman: Are you saying malware on the client end can't steal cookies?
10:44 batman joelb: i'm saying if the client has malware, then it might as well take over the whole browser
10:53 neilhwatson joined #mojo
11:00 joelb thanks guys, that was useful
11:32 asarch joined #mojo
11:38 punter joined #mojo
11:59 Kripton joined #mojo
12:03 d4rkie joined #mojo
12:21 Jonis is there a nice and easy way to sort out indenting of ep templates in vim?
12:23 pink_mist surely there's a htmltidy program you could run
12:38 Jonis yeah, there's html5 tidy, guess I need to look up the right settings for it to do ep files
12:41 JonisBeggar joined #mojo
12:42 JonisBeggar How about when Mojolicious throws an exception in developer mode, the line "at /srv/myapp/lib/C/MyApp.pm line 4250" is a hyperlink
12:43 JonisBeggar and when you click on it it displays exactly the
12:43 sri_ the WHAT?!
12:44 sri_ now we'll never know
12:46 Jonis hah
12:46 dod joined #mojo
12:47 crux joined #mojo
12:51 dod joined #mojo
12:53 dod joined #mojo
12:53 * Grinnz shall wonder forever...
13:00 glee joined #mojo
13:01 glee Hi
13:01 nicomen hi
13:01 purl salut, nicomen.
13:01 glee Mojo::Parameters overloads @{} to provide pairs
13:01 glee anyone got a line that demonstrates that working?
13:02 glee conceptually, want the keys of $self->req->params
13:02 crux joined #mojo
13:03 glee Can call 'pairs', but it's bugging my bunnet that I can't figure out how to use the override
13:04 sri_ http://mojolicio.us/perldoc/Mojo/Parameters#array
13:04 sri_ that is not entirely clear?
13:06 glee it is clear but couldn't get it in a working example
13:06 glee but I have now
13:06 glee my @a = @{$self->req->params};
13:06 sri_ or $c->req->params->@*
13:07 glee aha, thank you sri
13:07 Grinnz keys %{+{@{$self->req->params}}}
13:07 Grinnz (if you want keys and are ok with discarding duplicates)
13:07 Grinnz er
13:08 Grinnz yeah i think thats right <_<
13:08 good_news_everyon joined #mojo
13:08 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vLw5N
13:08 good_news_everyon mojo/master 7660450 Sebastian Riedel: slightly more consistent examples
13:08 good_news_everyon left #mojo
13:08 sri_ Grinnz: or just $c->req->params->names ;p
13:08 Grinnz right, that too :P
13:09 glee Grinnz: that's similar to what I had, but it's not working for me
13:09 Grinnz do what sri_ said, instead of that insanity :P
13:09 glee it's as if the @{} is in scalar context
13:10 Grinnz my @keys = @{$self->req->params->names}
13:10 glee that isn't using the override :)
13:10 Grinnz glee, did you have the +? to make sure it uses a hashref constructor
13:10 Grinnz i dont know if a block can even be inside a hash derefence but...
13:11 glee ah, I was missing the {} immediately inside the +
13:11 Grinnz yeah you need a hashref to dereference to a hash
13:11 glee oh, I see, because %{} works on a scalar
13:11 Grinnz right
13:12 glee so inside it you need a way of making list context
13:12 Grinnz well, no, that was just to make a ref for it to deref, but in the ref is list context
13:13 glee bah, if only perl could use arrayrefs as hashrefs
13:13 zivester joined #mojo
13:14 Grinnz i think there actually is some kind of... hashy slice thing...
13:14 sri_ List::Util has pair functions
13:14 sri_ they are quite convenient
13:18 Grinnz ah, i was thinking of something like my %params = %{$self->req->params}[0], that new-ish weird key-value slicing
13:18 frederico joined #mojo
13:19 Grinnz you maybe could do something like keys %$params[0..@$params], to be ultra confusing
13:19 Grinnz er, $#$params that last thing should be
13:19 glee @a = @{$self->req->params} gives me the expected 4-member array
13:20 glee but keys @a gives 0, 1, 2, 3 which is not exactly what I was expecting
13:20 Grinnz my $params = $self->req->params; my @names = keys %$params[0..$#$params]
13:20 Grinnz yeah keys on an array is different.
13:20 Grinnz this is just some really confusing new syntax in 5.20 that i don't see the point of :)
13:20 sri_ just use ->names though
13:20 glee d'oh!  indices
13:21 Grinnz actually, no idea if you can even use keys on that key-value slice
13:23 glee ok, sanity is back, I see I was looking for "%p = @{$self->req->params}", so now I relax and put '->names' in my code
13:23 Grinnz yeah :D
13:23 glee thank you for kind explanations
13:24 Grinnz thats enough golfing for today, time for work
13:36 Kogurr joined #mojo
14:01 d4rkie joined #mojo
14:19 gryphon joined #mojo
14:29 dod joined #mojo
14:40 dvinciguerra joined #mojo
14:54 zackiv31 joined #mojo
15:02 ashimema joined #mojo
15:13 disputin joined #mojo
15:15 sh4 joined #mojo
15:25 ashimema joined #mojo
15:29 lluad joined #mojo
15:48 aggrolite joined #mojo
15:49 jb360 joined #mojo
15:53 genio So, it seems someone encoded a URL parameter by base64 encoding and s/=/_/g.  While it works, it feels eww.  Should I just punycode_encode and url_escape it instead?
15:53 neilhwatson updated bug: '@if version_after macro is illogical' by Neil Watson. @if version_after reads as greater than, but I'm told it means greater than or equal to. Please chan... https://dev.cfengine.com/issues/7281
15:53 neilhwatson updated bug: '@if version_after macro is illogical' by Neil Watson. @if version_after reads as greater than, but I'm told it means greater than or equal to. Please chan... https://dev.cfengine.com/issues/7281
15:53 neilhwatson updated bug: '@if version_after macro is illogical' by Neil Watson. @if version_after reads as greater than, but I'm told it means greater than or equal to. Please chan... https://dev.cfengine.com/issues/7281
15:53 Grinnz_ what the hell are these notices
15:55 neilhwatson joined #mojo
15:55 sri_ neilhwatson: ?
15:56 Grinnz_ genio: punycode is for DNS... just use regular url escaping
15:56 neilhwatson I think a test script went awry. Kill it.
15:56 genio regular url escaping was dying on a crappy character
15:57 Grinnz_ eh?
15:57 jberger genio: that's a thing
15:57 sri_ how is that a thing?
15:58 jberger oh, its ALMOST a thing
15:58 sri_ you can't percent encode arbitrary binary data?
15:58 Grinnz_ it should be utf8-encoded then percent encodedd
15:58 jberger https://metacpan.org/pod/MIME::Base64#encode_base64url-bytes
15:58 genio s\xe2\x80\xa2p  or s•p  wasn't playing nicely with url_escape
15:59 jberger I know because there are b64urlsafe encodings in JWT spec
15:59 Grinnz_ right, the b64 is used for some things in urls
16:00 Grinnz_ i dont see the point unless it's really binary data though
16:00 sri_ i was referring to percent encoding
16:00 jberger sri_: right, I was referring to genio's original statement
16:01 jberger it seems that whatever he is using is ALMOST the standard mechanism
16:01 * jberger scrabbles about for the xkcd standards
16:01 jberger https://xkcd.com/927/
16:02 genio jberger: so, whoever did that was close to being correct but forgot to think of + and / characters as well as =
16:02 jberger yes
16:02 Grinnz_ oh god, ending up with / characters...
16:02 jberger and = can actually just go away, they are padding
16:02 jberger https://metacpan.org/source/GAAS/MIME-Base64-3.15/Base64.pm#L19
16:03 genio nice.  thanks
16:04 sri_ / is not actually a problem in the query
16:08 ToApolytoXaos joined #mojo
16:13 jberger hahahha
16:13 jberger http://i.kinja-img.com/gawker-media/image/upload/s--LWzp2H7U--/c_fit,fl_progressive,q_80,w_320/1303040237404683809.jpg
16:14 genio gah.  I need to learn more about unicode.    Wide character in subroutine entry at ...../MIME/Base64.pm line 20
16:14 sri_ there's characters and bytes, now you know everything there is to know
16:15 sri_ that subroutine wants bytes, but you gave it characters
16:15 Grinnz_ complicating matters is the fact that bytes can be interpreted as characters :P
16:16 sri_ not really something you have to think about
16:16 Grinnz_ that's how things end up double-encoded, though
16:17 sri_ all you have to know is in which representation your data happens to be in at any given time
16:17 genio ah, I'm just being dumb. thanks again (I'll learn to read and think about error messages completely one day).
16:17 Grinnz_ which is usually simpler when you keep to "work with characters, input from/output to bytes"
16:17 sri_ yea
16:22 cpan_mojo Mojolicious-Plugin-AccessLog-0.009 by GRAF https://metacpan.org/release/GRAF/Mojolicious-Plugin-AccessLog-0.009
16:36 ans joined #mojo
16:50 lluad joined #mojo
16:54 dod joined #mojo
17:28 kaare joined #mojo
17:31 ans1 joined #mojo
17:42 trone joined #mojo
17:42 mattastrophe joined #mojo
17:50 neilhwatson left #mojo
17:55 neilhwatson joined #mojo
17:59 kaare joined #mojo
18:02 amon joined #mojo
18:10 disputin joined #mojo
18:36 ajr_ joined #mojo
19:02 PryMar56 joined #mojo
19:04 melo joined #mojo
19:12 ravenhall joined #mojo
19:22 kaare_ joined #mojo
19:39 aggrolite joined #mojo
19:45 disputin joined #mojo
20:06 dod joined #mojo
20:07 cpan_mojo joined #mojo
20:09 cpan_mojo joined #mojo
20:09 cpan_mojo Swagger2-0.33 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Swagger2-0.33
20:10 batman jberger: ^ removed the filter on name, and just kept the dependency (cpan_mojo)
20:10 jberger ah, nice!
20:10 jberger batman++
20:10 batman :)
20:10 batman let me know if it's too much
20:11 batman dexteruk: new version with some bugfixes and a client: https://metacpan.org/pod/release/JHTHORSEN/Swagger2-0.33/lib/Swagger2/Client.pm
20:13 jonasbn joined #mojo
20:13 jberger I don't think it will be, my cpan_mojo did basically that
20:14 jberger arguably checking the dependency is better, since it won't accidentally report MojoMojo
20:14 jberger then again, it won't report releases of Mojolicious either :s
20:14 jberger but I guess good_news_everyone mostly does that
20:20 batman yeah, i think we notice that :)
20:20 batman *we*
20:27 bin_005 joined #mojo
20:27 vicash joined #mojo
20:28 vicash hello. i am a new user of mojo. is there a Vim syntax highlighter for the .ep template files ?
20:29 batman vicash: maybe this? https://github.com/yko/mojo.vim
20:29 vicash thanks batman
20:30 batman you're welcome
20:36 meredith i wish i could give an extra ++ for Swagger2::Client; i'll be checking it out later
20:40 jberger vicash: o/
20:41 batman meredith: awesome! i really need the feedback :)
20:42 vicash jberger: \o
20:57 ravenhall joined #mojo
21:14 bin_005 joined #mojo
21:35 lluad joined #mojo
22:06 woz joined #mojo
22:14 thowe joined #mojo
22:17 woz joined #mojo
22:51 bpmedley joined #mojo
23:18 woz joined #mojo
23:22 mattastrophe joined #mojo
23:48 d4rkie joined #mojo
23:55 ravenhall joined #mojo

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