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

IRC log for #mojo, 2014-07-03

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

All times shown according to UTC.

Time Nick Message
00:21 shmuel joined #mojo
00:21 meshl joined #mojo
00:42 nishttal2 joined #mojo
00:43 nishttal2 hi the render function is replacing my single quotes with '.. is there a way to ask it not to?
00:45 nishttal2 nevermind found it
00:50 Averna joined #mojo
01:26 neyasov__ joined #mojo
01:40 mad_hatter joined #mojo
01:44 mad_hatter hey folks, is there any sort of special way to insert an image in the __DATA__ section? using background; url(); or <img> doesn't seem to work
01:54 sri see tutorial
01:56 neyasov__ joined #mojo
01:57 mad_hatter nvm figured it out
01:57 mad_hatter needed to have a /public directory
01:57 sri bollocks, but whatever works for you
01:57 klapperl joined #mojo
02:04 mad_hatter it works :) but is there a better way?
02:17 neyasov__ joined #mojo
02:18 neyasov___ joined #mojo
02:41 laouji joined #mojo
02:46 bpmedley mad_hatter, Have you seen the base64 file embedding?
02:47 bpmedley mad_hatter, http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Base64_encoded_DATA_files
02:51 bpmedley http://www.oliverguenther.de/2014/04/applications-with-mojolicious-part-one-introduction/  <-- Seen this?
02:59 KCL joined #mojo
03:12 basic6_ joined #mojo
03:19 jberger__ joined #mojo
03:21 gatitskiy joined #mojo
03:28 jberger_ joined #mojo
03:43 jberger_ joined #mojo
03:53 deserted joined #mojo
03:59 good_news_everyon joined #mojo
03:59 good_news_everyon [mojo] kraih tagged v5.11 at f19c59e: http://git.io/tQq0eA
03:59 good_news_everyon left #mojo
04:01 good_news_everyon joined #mojo
04:01 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/BppUvQ
04:01 good_news_everyon mojo/master 21157d4 Sebastian Riedel: bump version
04:01 good_news_everyon left #mojo
04:01 laouji joined #mojo
04:08 laouji joined #mojo
04:58 hesperaux joined #mojo
06:15 gatitskiy joined #mojo
06:15 dpetrov_ joined #mojo
06:18 sujithm joined #mojo
06:44 dod joined #mojo
06:48 sujithm joined #mojo
06:56 sugar joined #mojo
07:03 Vandal joined #mojo
07:06 igorsutton joined #mojo
07:09 mattastrophe joined #mojo
07:28 trone joined #mojo
07:34 kyshtynbai joined #mojo
07:39 kyshtynbai Hi everyone. How do I send a hash via stash?
07:41 preaction $c->stash( foo => \%bar );
07:41 preaction perldoc perlreftut; <- should be able to help
07:42 kyshtynbai thanks! I thought about reference also.
07:45 KCL joined #mojo
07:48 edestler joined #mojo
07:48 sujithm_ joined #mojo
07:50 sujithm joined #mojo
08:05 denis_boyun joined #mojo
08:10 mattastrophe joined #mojo
08:26 john joined #mojo
08:26 neyasov___ joined #mojo
08:35 gatitskiy joined #mojo
08:42 batman kyshtynbai: remember that they are actual references in the template. so you need to do "% for (keys %$foo) {"
08:44 mattastrophe joined #mojo
08:49 dod joined #mojo
08:49 mire joined #mojo
09:00 KCL_ joined #mojo
09:04 KCL joined #mojo
09:33 dod joined #mojo
09:43 denis_boyun joined #mojo
09:47 Negor joined #mojo
09:52 dod joined #mojo
10:01 sujithm joined #mojo
10:01 batman sri: 5.11 has some really nice features :)
10:10 rem_lex|pivo joined #mojo
10:12 basiliscos joined #mojo
10:13 sujithm joined #mojo
10:14 sujithm_ joined #mojo
10:17 bpmedley kyshtynbai, You may want to look into serialization.
10:19 d4rkie joined #mojo
10:20 d4rkie_ joined #mojo
10:22 sujithm joined #mojo
10:23 shmuel joined #mojo
10:24 sujithm joined #mojo
10:29 neyasov____ joined #mojo
10:38 d4rkie joined #mojo
10:53 kyshtynbai batman: I see, thnaks!
10:54 kyshtynbai bpmedley: gotta read about serialization also, thanks!
11:28 mr-foobar joined #mojo
11:30 shmuel joined #mojo
11:41 Jonneh joined #mojo
11:41 neilhwatson joined #mojo
11:42 dod joined #mojo
11:44 dotan joined #mojo
11:52 gatitskiy joined #mojo
12:05 dod joined #mojo
12:13 kyshtynbai joined #mojo
12:37 punter joined #mojo
12:44 laouji joined #mojo
12:45 laouji joined #mojo
12:55 HtbaaPi joined #mojo
13:10 gryphon joined #mojo
13:40 sugar_ joined #mojo
13:40 mire joined #mojo
13:45 sugar__ joined #mojo
13:46 punter joined #mojo
13:57 Ptolemarch joined #mojo
14:07 ryozi joined #mojo
14:10 mire joined #mojo
14:14 bobkare joined #mojo
14:15 sh4 joined #mojo
14:29 andrefs joined #mojo
14:32 shmuel joined #mojo
14:38 zackiv31 joined #mojo
14:39 good_news_everyon joined #mojo
14:39 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/9SWIoQ
14:39 good_news_everyon mojo/master f6d804a Sebastian Riedel: fixed a few multipart form handling bugs (closes #642)
14:39 good_news_everyon left #mojo
14:40 sri i hate this content-disposition crap... only gonna support stuff we actually have real world test cases for, generated by actual browsers
14:41 sri the shit browsers generate is hilarious... from raw UTF-8 bytes to filename="test\"
14:42 crab no kidding
14:43 sri chrome escapes " to %22, while firefox escapes it to \"
14:43 sri firefox still generates "test\" to mean test\ though xD
14:44 genio ahh, I was wondering about: "((?:\\"|[^"])*)"
14:44 genio That's annoying
14:54 KCL joined #mojo
14:59 KCL_ joined #mojo
15:01 condor66 joined #mojo
15:01 condor66 hi
15:01 purl hola, condor66.
15:03 condor66 would someone have a moment here? I can't find the right approach to solve my problem - I have 3 ioloop delays under one controller that has render_later, I have 4th delay that I want to start working only if the first 3 finished - how would I do it in mojo?
15:06 batman condor66: do you have a code example of what you try to do? (put it in a pastebin)
15:10 punter joined #mojo
15:10 tusj joined #mojo
15:10 mire joined #mojo
15:21 condor66 http://pastebin.com/LxYU97jZ
15:21 condor66 i have 1  controller with 3 delays:  delay_openorders, delay_getbalances,  delay_orderbooks, I want delay_createorder  to kick off only when the 3 three came  back with data already
15:22 sri eeep, tldr
15:25 genio indeed, that's an extremely long block to go through.  Can you trim it down enough to produce your problem but make it more manageable for us to see?
15:30 henq joined #mojo
15:36 jberger_ joined #mojo
15:37 jberger_ condor66: why do you have lots of different delay objects in the same method?
15:37 jberger_ That smells like a code smell to me
15:38 jberger_ Help yourself out and make those nonblocking functions
15:38 jberger_ And call them from a central delay in your controller
15:39 jberger_ condor66: see also http://mojoconf.joel-berger.com
15:40 condor66 i have 3 different delays to process the responses easier as I get balances, openorders and orderbooks which give me different data
15:41 condor66 jberger assuming I'd have one delay for 3 requests how would call the other delay only when the first one finishes? currently delay_createorder gets displayed/executed straightaway even if I don't call it from anywhere
15:42 jberger_ grrr,  i still need to fix the usability of the intra slide transitions on my presentation software
15:42 sri super long closures are a bad code smell
15:43 jberger_ again, i recommend reading through my talk
15:43 condor66 I do agree, many things need optimization here - just wanted to proof it will work what I want and then I can trim that down
15:43 jberger_ Use the keyboard for navigation so that you see the intra slide transitions
15:46 condor66 it would look like a trivial task to run one delay after the other finishes but can't figure it out... should I use something else like routes maybe?
15:46 jberger_ Those are steps
15:46 jberger_ Steps in a larger delay
15:47 condor66 thanks jberger_, i'll start digging
15:48 mr-fooba_ joined #mojo
15:59 bluescreen joined #mojo
16:08 dod joined #mojo
16:14 punter Why do we say that "non-blocking code consumes less memory", if the forks of a process share a lot of memory? Isn't it wrong?
16:14 punter it says so here: http://mojoconf.joel-berger.com/3
16:15 Mikey if you fork 50 servers to handle 50 requests vs. one server to handle 50 requests
16:15 avenj punter: I don't see anything about forking there
16:15 Mikey even with a bit of shared memory...
16:15 punter avenj, i meant it says there about non-blocking consuming less
16:16 sri short answer, fork is still much more expensive
16:16 punter aha
16:16 punter ok
16:16 avenj punter: oh, I'm tracking now, sorry
16:17 sri but don't take my word for it, do your own testing
16:17 Mikey levar burton, everyone
16:40 D4RK-PH0ENiX joined #mojo
16:40 voegelas joined #mojo
16:55 sujithm joined #mojo
17:00 mattastrophe joined #mojo
17:07 * sri wonders if the delay example in the cookbook should be using 3 steps instead of 2, to demonstrate more possibilities
17:08 sri http://pastie.org/9351005 # something like this
17:15 crab eh
17:22 mire joined #mojo
17:31 disputin joined #mojo
17:57 elik joined #mojo
18:01 good_news_everyon joined #mojo
18:01 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/039--A
18:01 good_news_everyon mojo/master 8af37f1 Sebastian Riedel: handle quoted snowmans correctly
18:01 good_news_everyon left #mojo
18:02 mattastrophe joined #mojo
18:06 meshl joined #mojo
18:10 denis_boyun joined #mojo
18:15 good_news_everyon joined #mojo
18:15 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/LdEsCQ
18:15 good_news_everyon mojo/master 00e27e9 Sebastian Riedel: consistently escape before encoding
18:15 good_news_everyon left #mojo
18:17 sri i kinda feel like we should be unescaping again here... but :S https://github.com/kraih/mojo/blob/master/t/mojo/transactor.t#L287
18:20 sri thing is, that's not real percent encoding
18:20 sri i just uploaded a file named te"s%26t\ with chrome on os x
18:21 sri Content-Disposition: form-data; name="test\"; filename="te%22s%26t\"
18:21 sri that's the header :S
18:22 sri all browsers handle it differently... no idea what IE does actually
18:24 sri testing with this oneliner btw. in case anyone wants to try more browsers
18:24 sri MOJO_DAEMON_DEBUG=1 perl -Mojo -E 'a({inline => q{<%= form_for "/" => (enctype => "multipart/form-data", method => "POST") => begin %><%= file_field "test\\\" %><%= submit_button %><%= end %>}})->start' daemon
19:23 cousin_luigi left #mojo
19:34 neyasov_____ joined #mojo
20:10 nebulous joined #mojo
20:18 punter joined #mojo
20:24 rubens joined #mojo
20:36 genio sri: Windows 7 (64-bit) with IE 10: Content-Disposition: form-data; name="test\"; filename="tes%26t"
20:37 genio unfortunately, a file can't contain a literal \ in its name in Windows, so I couldn't test exactly
20:37 sri genio: thanks, does it just remove the "?
20:37 sri from te"s%26t\
20:38 genio no " either
20:38 genio in the filename, that is
20:38 sri oh, i see
20:38 sri and in the name?
20:38 mire joined #mojo
20:39 genio I can't accurately test since windows won't allow double quotes in filenames
20:39 genio so, there's no telling how IE might deal with it
20:39 sri no, i mean the field name
20:40 sri MOJO_DAEMON_DEBUG=1 perl -Mojo -E 'a({inline => q{<%= form_for "/" => (enctype => "multipart/form-data", method => "POST") => begin %><%= file_field "te\"st\\\" %><%= submit_button %><%= end %>}})->start' daemon
20:40 sri chrome gives me something like this
20:40 sri Content-Disposition: form-data; name="te%22st\"; filename="minion.data.lock"
20:43 genio Chrome on Win: Content-Disposition: form-data; name="te%22st\"; filename="tes%26tasdf'asdf"
20:43 sri oh, that's interesting
20:43 sri no wait, it's not ;p
20:44 sri i guess chrome is the same everywhere
20:44 genio and IE: Content-Disposition: form-data; name="te%22st\"; filename="tes%26tasdf'asdf"
20:44 sri ah!
20:44 disputin joined #mojo
20:44 genio for anyone else that wants to test.  open PowerShell:
20:45 genio $env:MOJO_DAEMON_DEBUG=1
20:45 genio perl -Mojo -E 'a({inline => q{<%= form_for q(/) => (enctype => q(multipart/form-data), method => q(POST)) => begin %><%= file_field qq(te\"st\\\) %><%= submit_button %><%= end %>}})->start' daemon
20:45 sri funky think is firefox gives me this header
20:45 sri Content-Disposition: form-data; name="te\"st\"; filename="minion.data.lock"
20:46 sri so we have chrome and IE using %22, and firefox \"
20:46 genio FF on Win: Content-Disposition: form-data; name="te\"st\"; filename="tes%26tasdf'asdf"
20:47 sri i think all webkit/blink browsers do the same
20:49 sri hahahaha
20:49 purl LOLCON 4 reached.
20:49 sri to make matters worse
20:49 sri if i add %22 to the field name in firefox i get this
20:49 sri Content-Disposition: form-data; name="t%22e\"st\"; filename="minion.data.lock"
20:49 sri so trying to unescape without knowing the actual browser is hopeless
20:50 genio that's... no fun
20:50 genio IE 10 in standards mode won't render the app.  odd
20:50 genio scratch that, yes it will.  I just had somethign funky going on
20:51 genio testing as many differences in IE as I can to see if they all behave the same
20:52 genio IE 7 (standards and quirks) all the way through IE 10 (standards and quirks) seem to behave identically for this.
20:55 genio sri: adding %22 to the field name in IE:
20:55 genio Content-Disposition: form-data; name="t%22e%22st\"; filename="tes%26tasdf'asdf"
20:55 genio that sucks badly
20:56 sri haha
20:56 sri same as in chrome
20:56 cfedde joined #mojo
20:56 genio knowing how to decode that is just magic
20:56 sri there is no hope trying to unescape
21:04 nebulous anyone have the incantation to change default static path in OldAss(0.999 snowman debian) version of mojo?
21:05 * sri faints
21:05 nebulous sri: you would faint… harder, if you saw the stack I just moved into
21:07 nebulous the tall catalyst-style stack would never have made it thru the door at this place though, so I'm just going to try to appreciate that I can use any framework at all :)
21:10 mattp nebulous: fatpacking or bundling a dist with zero deps isnt exactly hard. is that not an option?
21:10 nebulous mattp: See, what you're doing right now is being "rational."
21:11 nebulous If I had the option of doing what made sense, it would be a few cpanm commands and off to the races
21:11 mattp who is dictating otherwise?
21:12 mattp rather, what is their reasoning
21:13 nebulous $grayHairedProgrammerUnits. Getting a module installed is like pulling teeth. And again, I can't really explain their reasoning because so far it makes no sense to me.
21:13 mattp condolences
21:14 nebulous hah, thanks. Just doing a bit of skunkworks demonstration of what perl post 1995 can look like. Hopefully it will be the catalyst(no pun, but works) to more modern practices.
21:18 bluescreen_ joined #mojo
21:23 good_news_everyon joined #mojo
21:23 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/ZoXvUg
21:23 good_news_everyon mojo/master 33b13e0 Sebastian Riedel: mention portability advantages of delays
21:23 good_news_everyon left #mojo
21:37 good_news_everyon joined #mojo
21:37 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/e6A7fA
21:37 good_news_everyon mojo/master 609850e Sebastian Riedel: fixed AUTOLOAD bug in Mojo::Collection where it would behave differently than calling pluck directly
21:37 good_news_everyon left #mojo
21:41 jberger__ joined #mojo
21:50 denis_boyun joined #mojo
21:51 neyasov_____ joined #mojo
21:51 sri old behavior was cargo culted... but i think it should behave just like ->pluck, as documented
21:53 neyasov_____ joined #mojo
21:54 sri 5.x is really turning into a usability cycle
21:54 * sri shrugs
21:54 sri what else needs to get a little easier to use?
22:10 meshl joined #mojo
22:12 * genio wonders if nebulous is working at the same company as me.
22:12 genio I'm doing my best to get Perl out of the dark ages
22:14 btyler joined #mojo
22:40 cfedde heh
22:41 cfedde but perl has not changed since 1993.  Nothing but minor releases since then.
22:51 d4rkie joined #mojo
23:03 neilhwatson joined #mojo
23:06 good_news_everyon joined #mojo
23:06 good_news_everyon [mojo] kraih tagged v5.12 at d880676: http://git.io/8Pdy4g
23:06 good_news_everyon left #mojo
23:07 good_news_everyon joined #mojo
23:07 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/nJvhsg
23:07 good_news_everyon mojo/master 81262cb Sebastian Riedel: bump version
23:07 good_news_everyon left #mojo
23:11 sri now that we have form validation we could support some sort of param nesting
23:11 sri the foo[bar][baz] stuff
23:12 sri Mojo::Parameters->new('foo[bar]=baz')->to_hash(1) # {foo => {bar => 'baz'}}
23:12 sri could come in handy with mongodb
23:13 sri could do something like $c->validation->params->to_hash(1) or so on the higher layer
23:13 sri not sure how the nesting syntax would work exactly though
23:15 sri the whole foo[bar] results in nested hashes, foo[] results in an array in a hash, foo[23] is the 23rd element in an array in a hash...
23:16 sri haha, thinking about how to explain it in documentation makes me loose interest ;p
23:16 Adura Tighten it!
23:23 * sjn looks at Statocles
23:24 sri Adura: what are you trying to say?
23:24 Adura I just make light of odd spelling.
23:24 Adura For some reason, there's a meme spreading where lose gets an extra o.
23:25 Adura I don't remember it happening as much online years ago.
23:26 sri oh...
23:27 Adura There was a point where I never accidentally added a space inside words, but I saw it occur a few times and have done so since.
23:27 Adura Not that any of these observations are scientific... hah.
23:27 bpmedley joined #mojo
23:41 howitdo joined #mojo

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