Camelia, the Perl 6 bug

IRC log for #mojo, 2012-12-05

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

All times shown according to UTC.

Time Nick Message
00:31 lukep joined #mojo
01:02 tl joined #mojo
01:07 hlin joined #mojo
01:15 Mike-PerlRecruiter_ joined #mojo
01:31 ifim joined #mojo
01:45 lukep joined #mojo
01:57 d4rkie joined #mojo
01:58 laouji joined #mojo
02:06 lukep_ joined #mojo
02:07 lukep_ joined #mojo
02:47 ObseLeTe joined #mojo
02:54 xaka joined #mojo
03:01 hlin joined #mojo
03:19 asarch joined #mojo
03:24 buu Hey
03:24 buu Is there any way to get the IP of a request
03:27 anewkirk remote_address is on the transaction object
03:29 buu oh
03:31 buu cool.
04:00 noganex joined #mojo
04:38 d4rkie joined #mojo
04:58 Foxcool joined #mojo
05:07 lukep joined #mojo
05:12 d4rkie joined #mojo
05:19 laouji joined #mojo
05:31 spleenjack joined #mojo
05:55 hlin_laptop joined #mojo
05:58 hlin joined #mojo
06:05 mattp_ joined #mojo
06:06 hlin_laptop joined #mojo
06:19 ver joined #mojo
06:26 Molaf joined #mojo
06:38 dpetrov_ joined #mojo
06:38 egopro joined #mojo
06:41 freman so um, say I'm trying to make my life a little easier by opening a websocket between two mojo daemons... how would I do the client?
07:06 freman nevermind, sorted that... now I have to figure out how to wait for them all to reply
07:33 yakudza joined #mojo
07:35 Vandal joined #mojo
07:36 Averna joined #mojo
07:48 mire__ joined #mojo
07:49 Caelum joined #mojo
08:03 batman joined #mojo
08:06 freman eaugh, I put everything in a loop and return... says it's rendering the right thing but the other client doesn't get the right thing
08:23 freman so, $self->ua->post($url, $args, sub {my ($ua, $tx) = @_;print Dumper($tx->res->body);}); works fine if the backend doesn't do anything strange... but as soon as I make the backend delay for 2 while it sends out some websocket requests to other hosts... it returns the 'headers'
08:25 freman or is the cookbook documentation of Recurring timers wrong?
08:25 cosmincx joined #mojo
08:29 alnewkir1 joined #mojo
08:29 mattastrophe joined #mojo
08:37 mattastrophe joined #mojo
08:51 suy joined #mojo
09:05 dod joined #mojo
09:10 sinkovsky joined #mojo
09:12 dod joined #mojo
09:30 D4RK-PH0ENiX joined #mojo
09:33 fhelmber_ joined #mojo
09:40 egopro joined #mojo
09:46 lammel2 joined #mojo
10:05 spleenjack joined #mojo
10:21 vishwanathms joined #mojo
10:22 vishwanathms_ joined #mojo
10:44 alexeiras joined #mojo
11:02 sri hmmmm
11:03 sri i think mojolicious does have a few hash order bugs
11:03 sri no idea why the tests pass
11:05 sri like https://github.com/kraih/mojo/blob/ma​ster/lib/Mojolicious/Sessions.pm#L46
11:06 sri or wait
11:06 nic aren't 'keys' and 'values' guaranteed to have the appropriate order?
11:06 nic (correct wrt each other)
11:06 sri i'll have to check that
11:07 nic The perl docn claims it at least
11:07 sri ah, it does indeed \o/
11:08 nic happy days
11:14 memowe phew, excellent :)
11:14 dpetrov_ yep they are
11:15 dpetrov_ that seems like nice article http://onionstand.blogspot.de/2012/12/a​re-you-relying-on-hash-keys-being.html
11:16 sri garu++
11:30 lukep joined #mojo
11:31 kitt_vl joined #mojo
11:54 sinkovsky joined #mojo
11:55 dod joined #mojo
12:15 lukep joined #mojo
12:22 ryozi joined #mojo
12:37 sinkovsky joined #mojo
12:48 ObseLeTe joined #mojo
12:55 vishwanathms joined #mojo
12:55 vishwanathms_ joined #mojo
12:58 marty moin
13:00 ObseLeTe joined #mojo
13:01 SmokeMachine joined #mojo
13:13 Mike-PerlRecruiter_ joined #mojo
13:35 b2b joined #mojo
14:56 sri http://pastie.org/5484144 # should this be in the rendering guide or not?
15:04 sri haha, perhaps there should be a method to replace all those little asset checks :)
15:04 marcus sri: yea, and yea
15:04 sri return unless $self->res->content->asset->is_simple;
15:06 sri which method name says "this content will be served completely from memory and is safe to modify"
15:06 sri ?
15:09 Fuzzy Bugger. Any bvious ideas as to why a Mojo-lite program I've just made which uses $self->session('balh') stuff works fine on my desktop (with several items in the session) yet when I test it on an iPhone it only has *one* item in $self->session() when I spit it out with Data::Dumper for testing?
15:09 Fuzzy *obvious
15:10 sri perhaps a method name that says the opposite... ->is_complex :)
15:11 Fuzzy On the desktop it reports { 'foo'=>'bar, 'foo2'=>'bar2', 'baz'=>1 } wheras on the iPhone only shows the first item: { 'foo'=>'bar' }
15:12 Fuzzy (tested and it works fine on several desktop browsers, yet not on safari on the iPhone)
15:12 sri $asset->is_partial maybe
15:13 sri hmmm
15:14 Fuzzy Google throws up no help for me so far anyhow...
15:15 Britzel_ joined #mojo
15:21 sri i guess $asset->is_dynamic could check if the content is stored in a file or has a range constraint
15:22 sri ->is_streaming doesn't really cover range constraints
15:23 marcus sri: its_complicated
15:23 marcus :p
15:23 sri :D
15:25 sri http://pastie.org/5484246 # this version is a little shorter but there are still quite a few checks
15:32 sri if i ass $asset->is_range it gets a little better
15:32 sri s/ss/dd/
15:32 sri http://pastie.org/5484262
15:33 sri still 3 asset checks though
15:34 Fuzzy Damned iPhone... doesn't want to eat my cookies... :P
15:36 Fuzzy There isn't some stupidly low limit on cookie size on Safari on the iPhone, is there?  (I know of the 4K limit, and I'm WAY below that)
15:41 augensalat is_volatile
15:41 augensalat is_mutable
15:41 augensalat ?
15:41 knshaum joined #mojo
15:43 good_news_everyone joined #mojo
15:43 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/K_13-w
15:43 good_news_everyone mojo/master 0af2b2a Sebastian Riedel: added is_range method to Mojo::Asset and a content post-processing recipe to the rendering guide
15:43 good_news_everyone left #mojo
15:43 sri i guess that's the best version
15:45 dpetrov_ what was !! doing?
15:45 dpetrov_ :)
15:45 sri boolean
15:45 sri !!1 and !!0
15:46 marcus joined #mojo
15:47 sri it's a quirk of me, i like to be explicit when i return booleans
15:47 marcus bool punching
15:48 dpetrov_ I ask because I remember reading about !! somewhere but totally forgot the meaning
15:48 sri hopefully some day someone will patch Scalar::Util to include a isbool() function and we can use !!1 and !!0 as native boolean types
15:56 good_news_everyone joined #mojo
15:56 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/v6HGMA
15:56 good_news_everyone mojo/master c5829bf Sebastian Riedel: tweaked content-post processing recipe
15:56 good_news_everyone left #mojo
15:58 Fuzzy Hmm... Is this documentation incorrect, or am I being a doofus?  Specifically the 'delete $c->session->{foo};' line... I try that and I just get "delete argument is not a HASH or ARRAY element or slice" back.
15:58 Fuzzy http://mojolicio.us/perldoc/M​ojolicious/Controller#session
15:59 b2b sri: that someone is probably not gonna be me :) do you have a minute or are you guys still busy?
16:01 d4rkie joined #mojo
16:02 mire__ joined #mojo
16:06 marcus Fuzzy: what perl version do you have?
16:08 mire_ joined #mojo
16:16 * sri still would like to combine "$asset->is_file || !$asset->size || $asset->is_range" into a single method
16:17 sri or at least is_file and is_range
16:21 sinkovsky joined #mojo
16:33 good_news_everyone joined #mojo
16:33 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/dGdl9A
16:33 good_news_everyone mojo/master 50f7ab8 Sebastian Riedel: added template to content pos-processing recipe
16:33 good_news_everyone left #mojo
16:34 good_news_everyone joined #mojo
16:34 good_news_everyone [mojo] kraih force-pushed master from 50f7ab8 to c9d3579: http://git.io/BhzC7A
16:34 good_news_everyone mojo/master c9d3579 Sebastian Riedel: added template to content post-processing recipe
16:34 good_news_everyone left #mojo
16:44 good_news_everyone joined #mojo
16:44 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/rpDd-A
16:44 good_news_everyone mojo/master 320494e Sebastian Riedel: more advanced route example
16:44 good_news_everyone left #mojo
16:48 mire_ joined #mojo
17:06 xaka joined #mojo
17:09 Fuzzy This is perl 5, version 14, subversion 2 (v5.14.2) built for x86_64-linux-gnu-thread-multi
17:12 dpetrov_ joined #mojo
17:13 good_news_everyone joined #mojo
17:13 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/J4Fgsg
17:13 good_news_everyone mojo/master cf3ce52 Sebastian Riedel: small optimizations
17:13 good_news_everyone left #mojo
17:14 sri marcus: that style better or worse?
17:15 dabudabu joined #mojo
17:15 sri i'm kind of on the edge about using $_[0] directly when it reduces the method to a single line
17:16 dpetrov_ I like more the first one
17:17 dpetrov_ not that it matter but... :D
17:21 b2b sri: my 2 cents: clarity wins over brevity even if its 4 times shorter
17:22 * b2b freely admits to jumping in without having a clue what this code is actually supposed to do;
17:26 sri maybe look at it in context
17:26 sri https://github.com/kraih/mojo/blo​b/master/lib/Mojo/Content.pm#L79
17:27 sri vs
17:27 sri https://github.com/kraih/mojo/blob/320494e24c9652b​02398e6386888ee3eb7603ae6/lib/Mojo/Content.pm#L79
17:30 b2b hmm, i see
17:31 b2b my beginners view is that the $self style conforms more with the style of coding i have seen in the docs and in the code/code examples so far
17:32 b2b gives the whole code a consistent look and feel - unless you wish to change everything to $_[0] style
17:33 sri consistency is good, but i prefer elegant code outside of documentation
17:36 b2b i can relate to that. Plus, its not like it's obfuscated perl :)
17:38 b2b i guess its a question of your personal preference. in my opinion, a few lines extra don't hurt - makes little difference in app load times at todays desktop processing speeds, even on low powered hardware.
17:39 b2b gotta run, closing time here
17:40 suy My beginner opinion (about 2/3 weeks with Perl at all), is that both are clear. The short version is not less clear, because the subroutine is so short, that is pretty obvious that $_[0] is the same as $self=shift. Although I would try to stick to one style.
17:46 sinkovsky joined #mojo
17:48 Fuzzy I prefer $self=shift as it "looks less magic" than $_[0] - same reason why I always use English qw(-no_match_vars) and force long names in the perlcritic config.
17:49 dpetrov_ well looked in the context
17:50 dpetrov_ I prefer consistency
17:51 Fuzzy Then the consistency of using shift elsewhere (even in just the line below) means you'd prefer the shift method then, and not the first?
17:52 Fuzzy Still... hard to criticise either way on something as short as that, though I'd still go with the shift method personally, and continue to use it all over.
17:55 yakudza joined #mojo
17:57 suy Fuzzy: $self=shift is quite "magic" too. :) In other languages, is quite crazy that a function with no parameters actually receives a parameter from a magic default. :)
18:17 batman left #mojo
18:28 jwang joined #mojo
18:30 mire_ joined #mojo
18:31 nic imo the fact the result end up being one line justifies the double use of $_[0]
18:31 nic but if that wasn't the case I'd avoid using $_[0] when it's used more than once
18:32 nic (cos the reader needs to scan both to check they're the same)
18:46 sri hmm, there already are cases where i use that style and imo it looks better
18:46 sri https://github.com/kraih/mojo/blo​b/master/lib/Mojolicious.pm#L191
18:47 sri i think i'll consider single line a special case
18:53 * Fuzzy chuckles
18:54 Fuzzy Breviy is fine as long as it doesn't sacrifice readability, and in this case I agree that it doesn't :)
18:54 Fuzzy *brevity, damnit.
18:56 Fuzzy Bleh. Still no closer to figuring out why safari on the iPhone is only remembering one item in the stored cookie... must be something odd I'm doing... it must be.
19:23 njlg joined #mojo
19:25 sinkovsky joined #mojo
19:27 jnbek^dt joined #mojo
19:29 bluescreen joined #mojo
19:29 b2b joined #mojo
19:30 njlg joined #mojo
19:44 sri Fuzzy: the browser can't change the cookie, it is certainly something you are doing
19:44 sri if it was changed you wouldn't see anything
19:54 chansen joined #mojo
20:08 b2b hello sri, have some time now?
20:09 sri b2b: time for?
20:10 b2b i wanted t run soemthing past you. unfortunately i dont use github (yet) so i have to do it this way
20:11 b2b i made a change to my copy of morbo in order to enable me to pass a config file to the app as an environment variable
20:12 b2b diff result:
20:12 b2b <   'w|watch=s'  => \my @watch
20:12 b2b ---
20:12 b2b >   'w|watch=s'  => \my @watch,
20:12 b2b >   'c|config=s' => \my $config
20:12 b2b 37a39
20:12 sri STOP!
20:12 sri STOP!
20:12 sri STOP!
20:12 dpetrov_ :)
20:12 b2b stopped
20:12 sri don't ever paste into an irc channel
20:12 b2b ok. lesson taken
20:13 sri it's considered extremely rude
20:13 b2b is there a paste site or something
20:14 b2b or i could wait till weekend when i have more time, and register on github
20:14 * b2b apologises to everone
20:15 dpetrov_ b2b: some people are using http://paste.scsys.co.uk/
20:15 dpetrov_ but I guess you can use everything else if you have some personal prefs
20:16 b2b channel mojo is not listed there
20:18 dpetrov_ :)
20:18 dpetrov_ just dont put any channel
20:18 dpetrov_ and copy the link
20:18 dpetrov_ after you paste it
20:19 b2b thanks dpetrov :)
20:20 dpetrov_ no problem
20:20 dpetrov_ :)
20:23 b2b http://paste.scsys.co.uk/216938
20:25 sri ok, that would get a -1 vote from me i'm afraid
20:26 b2b :)
20:26 b2b i'm all ears
20:26 sri but of course you're welcome to try and get the votes of other core devs
20:27 b2b depends on why you voted nay: i'm interested in hearing your reasoning
20:28 sri i have no need for it
20:29 sri and my default is always to vote -1 for new untested features i don't particularly care about
20:30 sri well, i pretty much always default to -1 and then another core dev convinces me it's a good idea
20:33 b2b You know, when i end up requesting a new feature, its usually a sign i'm either missing the obvious 'accepted way' of doing things, or i have a unique use case. i wonder if anybody else has needed to customize app instances?
20:36 lukep joined #mojo
20:41 mire_ joined #mojo
20:48 good_news_everyone joined #mojo
20:48 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/d1TB3Q
20:48 good_news_everyone mojo/master a94d2e1 Sebastian Riedel: small optimizations
20:48 good_news_everyone left #mojo
20:54 mattastrophe joined #mojo
20:55 ptuptu joined #mojo
21:06 xaka joined #mojo
21:14 fhelmber_ joined #mojo
21:18 good_news_everyone joined #mojo
21:18 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/aqnIZA
21:18 good_news_everyone mojo/master d14dc30 Sebastian Riedel: improved content post-processing recipe
21:18 good_news_everyone left #mojo
21:51 perlite_ joined #mojo
21:51 sinkovsky joined #mojo
22:06 Fuzzy Wow.
22:06 Fuzzy I figured out my 'iPhone cookie problem'
22:06 Fuzzy Rather ashamedly too.
22:08 Fuzzy While testing I've set the cookie to expire after 60 seconds, which has been no problem up until now... until the iPhone I tested on has its clock more than a minute in the future when compared with the server... derp.
22:08 Fuzzy The cookie was always invalidated as soon as the browser fetched it...
22:09 Fuzzy Hadn't had that trouble with the three regular PCs I'd tried it with as they all synchronised their time correctly with the NTP source, same as the server... I guess the iPhone is 'special' and wants to be different...
22:10 freman yeh, it thinks NY is in the pacific...
22:10 Fuzzy That was an interestingg problem anyhow... would have been easy to solve if the iPhone had let me dissect the cookie and see what was going on, like Chrome and Firefox do on the desktop.
22:10 * Fuzzy chuckles
22:10 Fuzzy Glad it's sorted now at least - I've set the cookie to expire after 10 minutes for now while testing... :)
22:13 sri haha
22:15 Fuzzy :)
22:15 Fuzzy "My iPhone is so cool it's 1 minute in your future!"
22:15 Fuzzy ;)
22:16 dotan joined #mojo
22:16 Fuzzy Right. Glad that's sorted.  I'm off to bed, can carry on poking at this code tomorrow - at least it's all working now *AND* working on the iPhone too (as it already was, aparrently...)
22:16 Fuzzy Ninite!
22:17 sri then please look up what i'm going to name the method combining "$asset->is_file || !$asset->size || $asset->is_range"
22:17 sri nn
22:17 * sri still can't think of something
22:18 sri ->is_elastic
22:37 phips_ joined #mojo
22:43 mire_ joined #mojo
23:16 jzawodn joined #mojo
23:27 davido joined #mojo
23:29 davido Can someone confirm whether or not Mojolicious::Plugin::Authorization is passing its test suite against Mojolicious 3.64?
23:42 davido I'm getting failures on test #9, and #15.  Didn't used to.  The only two dependencies that have changed since the last time I used it are Mojolicious's version number, and Perl (5.16.2 vs 5.16.1)
23:47 good_news_everyone joined #mojo
23:47 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/5l-etQ
23:47 good_news_everyone mojo/master c497e76 Sebastian Riedel: check for multipart content in content post-processing recipe
23:47 good_news_everyone left #mojo
23:47 sri damn, i totally forgot about multipart :(
23:49 sri i think that recipe should be simpler... but i'm not sure how exactly
23:49 sri http://mojolicio.us/perldoc/Mojolicious/​Guides/Rendering#Postprocessing_content
23:50 sri marcus: still think it should be included?
23:50 freman tl;dr :)
23:50 sri :,(
23:52 freman ah I get it
23:52 good_news_everyone joined #mojo
23:52 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/zBuU8A
23:52 good_news_everyone mojo/master e49cd30 Sebastian Riedel: documentation tweaks
23:52 good_news_everyone left #mojo
23:52 freman (4 hrs sleep between 12 hr shifts... really beginning to kill me, thankfully tomorrow is last day)
23:53 sri i kind of think it is backwards
23:54 sri there should be an return unless $self->res->is_ok_to_modifyl
23:54 sri s/l/;/
23:54 freman yes but everyone's definition of "ok to modify" is different
23:54 sri i originally proposed a new hook
23:55 sri one that runs after the renderer has generated a response
23:55 sri after_content or so (not after_renderer, since it doesn't get emitted for partials)
23:56 freman $self->res->is_mutateable
23:56 sri well, it's always mutable
23:56 freman no, not mutable, mutateable :D
23:56 sri ;p
23:57 freman ah here we go "is_hulk"
23:57 freman on a more serious note, a hook before "sending down the wire" would seem pertinent
23:58 sri perhaps even $self->res->on(body => sub {...}) which gets emitted whenever someone assigns with $self->res->body(...)
23:58 sri freman: you need to be more precise, there are many hooks already at different places

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