Camelia, the Perl 6 bug

IRC log for #mojo, 2012-08-19

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

All times shown according to UTC.

Time Nick Message
00:05 jeen joined #mojo
00:08 vel joined #mojo
00:14 berov left #mojo
01:05 jeen joined #mojo
02:01 SmokeMachine joined #mojo
02:20 jeen joined #mojo
02:49 noganex_ joined #mojo
03:59 arpadszasz joined #mojo
04:10 Leandr joined #mojo
05:15 vel joined #mojo
05:49 jeen joined #mojo
05:55 jeen joined #mojo
05:56 buu joined #mojo
06:08 maettu joined #mojo
06:09 jeen joined #mojo
06:12 niczero joined #mojo
06:15 niczero inokenty: The app having the problems with duration of session validity...
06:16 niczero Is it Lite or full?
06:17 niczero At what point do you set your preferred duration?
06:25 inokenty niczero: both light and full
06:26 inokenty I read the source of Mojolicious/Sessions.pm and I think this problem is unsolvable =)
06:32 inokenty ( s/light/lite/ )
06:39 davido_ joined #mojo
06:53 niczero :(
06:59 inokenty The only use case for 'expires' option is $c->session(expires => 1);
07:05 d4rkie joined #mojo
07:08 inokenty niczero: http://hastebin.com/nomokunale
07:09 Vandal joined #mojo
07:31 * sri yawns
07:58 jeen joined #mojo
08:03 batman i wonder how to store dates in redis... using epoch?
08:03 batman or a string?
08:06 Leandr joined #mojo
08:12 jontaylor joined #mojo
08:19 Psyche^ joined #mojo
08:23 batman when can i have steps? :)
08:25 marcus batman: When you install trunk :)
08:25 batman not going to do that :)
08:26 sri WHY NOT ZOIDBERG?
08:26 purl (V) (;,,;) (V)
08:26 * marcus hugs purl!
08:26 * purl smiles
08:26 marcus batman: BECAUSE FACEBOOK?
08:26 purl BECAUSE FACEBOOK is an entire enclosed system!
08:27 batman going to use redis for betsy now... don't think it'll use too much memory just yet
08:27 * sri goes to spam betsy with new bets
08:27 marcus batman: I'm using steps in wirc now.
08:27 batman you're just crazy! crazy i tell yah!
08:27 batman :)
08:28 sri marcus: make sure to check out the latest version of it
08:28 marcus sri: Am using the delay version, if that is what you mean?
08:28 sri nono, i changed semantics a little yesterday
08:29 sri the final step is no longer required for example
08:31 batman marcus: i'm stealing redis_then over to betsy :)
08:31 batman i hope you're not throwing lawyers at me
08:31 * batman hides
08:31 batman ;)
08:31 marcus batman: Why would you do that, when you can have steps?
08:31 marcus it's like redis_then but good
08:31 marcus :p
08:32 batman marcus: because i'm not going to bundle mojolicious with betsy
08:32 sri there will be a new release somewhen this week anyway
08:32 marcus batman: Pretty sure it will be in a released version before long
08:32 marcus right
08:32 batman marcus: i'm releasing betsy today
08:33 sri sooner if you help find bugs ;)
08:33 batman what? software and bugs? didn't know such a thing existed....
08:33 batman :P
08:34 marcus batman: well, delay has infinitely more tests than redis_then :)
08:34 batman hahaha
08:34 batman can't argue that
08:35 ilbot2 joined #mojo
08:35 Topic for #mojo is now Mojolicious real-time web framework 3.0 🌈 http://mojolicio.us 🌈 http://irclog.perlgeek.de/mojo/today
08:36 * batman <3 steps
08:39 sri marcus: ohoh, i might have stumbled over a new dealbreaker in ST2
08:39 sri perltidy does not work if the file contains unicode characters
08:39 batman hm... is there a way to do this or that callback? like marcus' Oauth2 plugin: $self->get_token(on_success => $delay->step, on_failure => $delay->step, ...);
08:40 marcus sri: My laptop is broken, so currently using vim :)
08:40 sri eeep
08:40 sri the retina one?
08:40 marcus yes.
08:40 sri ouch
08:40 marcus screen crapped out.
08:41 sri always the screen making trouble it seems
08:41 batman think i got it now... $next = $delay->step; ->(on_success => sub { $next->(@_) }, ...
08:42 batman errr... ->begin != ->step
08:43 marcus I don't quite understand. Why would you continue stepping on error?
08:43 batman haven't really though about that :)
08:50 nicomen joined #mojo
08:53 marcus ...
08:53 batman :)
08:53 davido_ I had one where the screen crapped out; started developing vertical lines that eventually took over.  Last week my current laptop had to get a new keyboard because my 2-year-old broke the backspace key off of it.  I don't know about you but I can't live without backspace. :)
08:53 marcus I never use it.
08:53 marcus :D
08:54 davido_ lol.  Only because vi has some other mapping right? ;)
08:54 marcus no, because I lie.
08:54 davido_ Now we know.
08:55 marcus my screen first got a dead triangle at the top of the screen. then jesterday everything started scrolling and flickering.
08:55 sri niczero, inokenty: think i know how to solve your problem
08:56 davido_ I had to give a presentation (while it was in the shop)... ended up dual-booting my wife's $200US netbook with a 10.5" screen to Linux and pluged it into the projector.  Got a few snickers.
08:56 crab snickers? why?
08:58 davido_ I guess it's enough of a departure from the 17" thing I usually show up with.
08:58 nic sri, inokenty: I can't find any unit tests for ->session(expires => times + ...)
08:59 sri you can't fix expires
08:59 sri just wait 30 minutes
09:00 * nic inserts ->wait(30 * 60) all over the place
09:00 nic I'm glad we found this before the 3.33 release
09:01 nic The 3.33 release has to be perfect
09:02 nic snickers used to be called "marithon bar" in some places
09:02 nic they were slightly firmer in those days, and possibly had more peanuts
09:06 crab marIthon?
09:06 davido_ ah, by snickers i meant laughs.
09:10 niczero snickers used to be called sniggers in some places
09:11 niczero seemed to be slightly noisier in those days, and sometimes gave you sore ribs
09:11 niczero but they got re-marketed cos some girls reported getting wet pants
09:17 davido_ I'd like to invalidate all sessions after a given hour.  I'm thinking the way to accomplish it is to generate a new app secret on the first request that comes in after the alotted time.  Is that reasonable?
09:24 jeen joined #mojo
09:44 alexeiras joined #mojo
09:45 crab i can't think of any other way
09:46 alexeiras left #mojo
09:50 davido_ *bonk* ...or I could just set an 'expires' session value.
09:54 crab if you have a way to identify old sessions, i suppose
09:55 davido_ On app start, use a fresh app secret.  As users log in, set an expires to today at 23:45 (for example) (in epoc seconds).
09:58 good_news_everyone joined #mojo
09:58 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/j7TjOg
09:58 good_news_everyone [mojo/master] added support for expiration session value, which allows for more fine grained control - Sebastian Riedel
09:58 good_news_everyone left #mojo
09:59 sri nic, inokenty: that should do the trick
10:00 * niczero looks forward to trying it out
10:00 sri unlike expires, which is hop by hop, the expiration value can be kept in the session, and therefore persists
10:02 davido_ Hm. So am I still able to set an expiration time (as opposed to expiration offset)?
10:03 niczero ah, i'm starting to understand why mine wasn't working
10:04 sri davido_: did you see me break any tests?
10:04 davido_ :)
10:04 niczero if req is not authd, i redirect to /login and then to their intended destination
10:06 niczero sri: can you point me at a test of ->session(expires => $y) where $y != 1
10:06 niczero i couln't find one earlier
10:06 sri niczero: i don't know, and don't really care tbh
10:09 niczero k, i'll have a go on Wed
10:11 sri maybe you don't understand, the behavior you're seeing is expected and perfectly fine, there is no bug
10:11 sri expiration is the only way to go for what you want
10:14 good_news_everyone joined #mojo
10:14 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/H-ZhtA
10:14 good_news_everyone [mojo/master] better examples for session expiration - Sebastian Riedel
10:14 good_news_everyone left #mojo
10:15 niczero my understanding is you+inokenty are talking about setting expiration while at the time crossing redirects
10:16 sri the problem is solved, just use expiration instead of expires
10:16 inokenty sri++
10:16 inokenty thanx
10:16 niczero On Wed i'll construct minimal ex for my use case, which is different
10:16 sri perhaps we should just hide expires completely, to avoid confusion
10:17 sri niczero: i don't believe that
10:17 niczero I was just concerned we're following documented usage that has no unit test
10:19 niczero It's sub-optimal me trying to discuss while away from computer so i'll investigate on Wed
10:47 marcus marcus  was gonna code on the beach, but my kbd battery is dead :(
10:48 marcus Guess I will just chill and troll reddit instead
10:52 memowe_ joined #mojo
10:56 batman_ joined #mojo
11:10 memowe joined #mojo
11:21 sri marcus: or review recent commits :)
11:27 * sri is back to TM2
11:35 alnewkirk howdy all
11:38 alnewkirk sri: I uploaded Class::Forward ... for personal reasons, but it has a bit of logic I think should be in Mojo::Util
11:38 alnewkirk specifically https://metacpan.org/source/AWNCORP/Clas​s-Forward-0.05/lib/Class/Forward.pm#L113
11:41 sri alnewkirk: i don't follow
11:43 alnewkirk Mojo::Util::camelize('foo_bar'); will return FooBar, but what if I want to name my class FooBAR
11:43 sri then camelize it yourself
11:44 alnewkirk ... or you could add a bit-o-logic that checks @INC
11:44 alnewkirk just a suggestion
11:44 sri you're basically proposing to make it completely unpredictable
11:44 alnewkirk not at all
11:46 sri you want a general purpose camelization function to change its behavior based on what modules are loaded at the time
11:46 sri that's madness
11:46 alnewkirk that is spartaaaa
11:47 alnewkirk well maybe it doesn't make sense in this mojolicious context
11:47 sri your code is also broken
11:47 purl okay, sri.
11:48 alnewkirk how so?
11:48 * sri pats purl
11:48 * purl pats sri back, harder
11:48 sri you only support :: and not '
11:48 alnewkirk is that a single quote?
11:48 sri it is
11:49 alnewkirk i dont follow?
11:49 sri Foo::Bar and Foo'Bar are both valid perl classes
11:50 alnewkirk well .. then your code is broken too, mojo generate doesn't support that convention
11:50 alnewkirk you did it on purpose, I did it by accident
11:50 sri https://github.com/kraih/mojo/​blob/master/t/mojo/util.t#L44
11:51 sri we support it wherever it makes sense
11:52 alnewkirk woah
11:52 alnewkirk thanks for the lesson
11:52 alnewkirk thats weird, never saw that before
11:52 sri :)
11:53 sri https://metacpan.org/module/Acme::Don::t
11:54 inokenty But this single quote completely breaks syntax highlighting in all text editors =)
11:56 alnewkirk that boggles the mind
12:31 good_news_everyone joined #mojo
12:31 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/n6MfFg
12:31 good_news_everyone [mojo/master] fixed a few small namespace handling bugs - Sebastian Riedel
12:31 good_news_everyone left #mojo
12:41 * diegok At frankfurt for YAPC::EU :-)
12:58 * nic guesses diegok is 'regular'
13:03 diegok nic: yep.... coming to all but one since I live in europe :)
13:06 jontaylor joined #mojo
13:10 nic I'm guessing http://act.yapc.eu/ye2012/prices.html is using the American meaning of 'not super-sized' or 'with sugar instead of sweeteners'
13:46 rem_lex| joined #mojo
14:18 batman_ i have no idea why i can't remember $delay->begin()
14:19 batman_ add an alias called ->next; ?
14:19 * sri bonks batman on the noggin
14:19 batman_ noggin..?
14:19 purl it has been said that noggin is teaching mandrian
14:55 d4rkie joined #mojo
15:16 marcus batman: noggin is the thing on top of your shoulders.
15:46 arpadszasz joined #mojo
15:47 batman_ oh.
15:48 marcus batman: I think sri is saying he won't soil his api just because you can't remember the correct command.
15:50 sri :)
15:51 * sri is against methods with multiple names
15:51 sri if an api doesn't work it should just be redesigned properly
15:52 marcus we are adding steps to Mojo-Redis now.
15:53 marcus so you can $redis->execute('get,['foo'],'get',['bar'], sub { ...});
15:53 sri interesting
15:54 sri the problem with actually renaming ->begin to ->next is that ->end exists too
15:54 marcus ->last
15:54 marcus :)
15:55 sri ;p
15:55 marcus would hate to deprecate begin/end tho
15:55 marcus and I don't think they are bad
15:56 sri well, we don't even have a good proposal yet, so...
15:57 sri especially something that works inside and outside of steps will be pretty hard to find
15:58 sri http://mojolicio.us/perldoc/Mojo/IOLoop#delay # you have to cover both examples
16:44 plicease joined #mojo
17:47 newbie joined #mojo
18:01 jontaylor joined #mojo
18:30 maettu joined #mojo
18:51 Netfeed what does steps actually do?
18:53 keedi joined #mojo
18:56 batman https://github.com/jhthorsen/mojo-redis/comm​it/71f520fc02d4318a44bb9d2a7f2bb208a1c571b2
18:57 batman ^ "step" in mojo-redis
18:57 batman what do you think?
18:57 purl I think batman should try flossing more often!
18:58 sri why are you not using Mojo::EventEmitter?
18:58 * sri doesn't get why anyone would still use plain callbacks for evented code
18:59 batman i think it's because of the backend
19:00 batman i think marcus is better at answering that question :/
19:00 sri looks like you actually have $redis->on(error => sub {})
19:00 batman yeah
19:01 sri $redis->quit(sub {}) makes no sense to me
19:01 batman could you pastebin an example on what would make sense?
19:03 sri hmm, looks like it delegates to Protocol::Redis or so
19:03 batman yes. and you can use Protocol::XS::Redis or something if you like...
19:06 sri not pretty, but makes sense i guess
19:06 batman can't make it pretty unless you tell me what is wrong :(
19:07 sri i would expect $redis->on(quit => sub {})
19:07 batman would you also expect $redis->on(mget => sub { ... }) ?
19:07 sri is quit a command?
19:08 batman yes
19:08 batman in redis
19:08 sri oh, i see, then it's fine of course
19:08 batman ah. good
19:08 batman :)
19:35 rem_lex joined #mojo
19:47 sri looks like we'll finally get the mojo bundle into TM2 ;p
19:51 marcus sri: mojo-redis is built on mojox-redis, so not everything has been modernized yett.
19:51 marcus yet even.
19:52 marcus s/built on/forked from/
19:59 batman_ joined #mojo
20:14 jontaylor joined #mojo
20:20 tempire_ joined #mojo
20:27 maettu joined #mojo
20:28 l3l1p joined #mojo
20:36 sri guess we are mostly ready for a release, but i would like some reviews of the session expiration change (and how it's documented now)
20:41 batman could you point me to that commit?
20:41 sri https://github.com/kraih/mojo/commit/35​1e58c162fcdf0c09dba6588776ffaeacd3ffe6
20:41 sri https://github.com/kraih/mojo/commit/b3​a8efc80ff8e2dcd3ef4b578d1caa933a2d0372
20:44 batman i don't see when i would use it, but i guess it could be useful...
20:44 sri or just
20:44 sri https://github.com/kraih/mojo/compare/530​fb034f0f1f3e6362d48833e804f03c9ffab1b...b​3a8efc80ff8e2dcd3ef4b578d1caa933a2d0372
20:45 batman yup. read it...
20:45 sri https://github.com/kraih/mojo/compare/530fb​034f0f1f3e6362d48833e804f03c9ffab1b...b3a8e​fc80ff8e2dcd3ef4b578d1caa933a2d0372#L1R909
20:45 sri especially that
20:46 batman yes. isn't that the actual change? adding expiration which persists?
20:46 sri it is
20:47 sri i'm not sure if expires and expiration should be documented
20:47 batman why not?
20:47 sri might be confusing
20:48 batman don't get how it's confusing :)
20:48 sri i take that as a good sign :)
20:49 batman i don't take that as a good sign that you take it as a good sign that i get it
20:49 batman ... :)
20:49 sri i take that as a good sign too :)
20:49 batman :D
20:57 batman hm... i'm killing my model after changing to redis... that doesn't seem right :/
21:09 bjoernfan l
21:10 rem_lex|pivo joined #mojo
21:27 xxtjaxx joined #mojo
21:34 xaka joined #mojo
21:36 Htbaa joined #mojo
21:38 Htbaa I think I've found a big in url_escape. In a template I had this <%== url_escape(url_with->to_abs) %>. The first couple of requests to the page are fine. After that you can no longer connect. Looking at top the perl process is CPU hungry (load went over 5). Removing the url_escape call made the issue go away
21:39 Htbaa some added context: I use that part in a mailto link to include the page URL in an e-mail
21:39 Htbaa all was tested with morbo by the way
21:41 Htbaa perl used is v5.10.1 (system perl on a Ubuntu 10.04 Virtual Machine)
21:43 Htbaa reading the docs it looks like I need a url_encode function, not escape. Still, worrysome bug I think
21:43 * Htbaa afk
21:44 xaka joined #mojo
21:44 rem_lex| joined #mojo
22:00 good_news_everyone joined #mojo
22:00 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/sfHvSA
22:00 good_news_everyone [mojo/master] small optimization - Sebastian Riedel
22:00 good_news_everyone left #mojo
22:01 Htbaa sri: I think small is an understatement for this one :-)
22:01 sri Htbaa: why?
22:02 Htbaa hmm, since when did MetaCPAN stopped listing subheadings? https://metacpan.org/modul​e/Mojolicious::Controller
22:02 Htbaa for me my app wouldn't even respond anymore
22:02 Htbaa had to restart it
22:02 Htbaa and always happened after a couple of requests
22:02 sri that change is unrelated to whatever you're having trouble with
22:02 sri i don't actually understand your problem
22:03 Htbaa hmm well it is a change to the url_escape method
22:05 sri i would be very surprised if your problem was caused by url_escape, considering how trivial the implementation is
22:05 Htbaa yet after removing it my problem was solved. I'll see if I can reproduce it in a standalone lite app
22:06 sri just make it a oneliner, shouldn't be hard if it's a bug in the function
22:06 Htbaa I'm not familiar with the one liners stuff yet :-)
22:07 Htbaa I'll look into it
22:08 sri i mean like perl -MMojo::Util=url_escape -E 'say url_escape "<whatever>"'
22:08 garu sri: is Mojo::Log's _message event subscriber supposed to record everything? Or should it check for the log level?
22:09 sri garu: dunno, whatever is implemented ;p
22:09 garu I understand $logger->log would already do this before calling emit(), but what prevents my code from sending a message and having it captured by the logger without the specified level?
22:09 Averna joined #mojo
22:10 garu sri: it's implemented this way (ignoring the level), but it might be an error (or, more likely, an error in my understanding :)
22:11 sri hmm, could actually be a bug
22:13 garu sri: if you want, I could send you a patch. I think moving line 64 to line 72 (from sub log to sub _message) would fix this, without breaking back compat
22:13 sri i just tried it, breaks some tests
22:13 garu I know
22:13 garu err
22:14 garu I think I know which... the event emitter tests for mojo::log don't consider it
22:15 garu if those are the only ones, it's because the test replaces the emitter (I think)
22:15 garu of course, you're much more knowledgeable on this code than I am :D
22:15 garu I just stumbled on it
22:16 garu (and want to make sure I'm doing the right thing before pushing the next version of MojoX::Log::Log4perl)
22:17 Htbaa sri: on Windows with Strawberry Perl 5.14.2 I'm not having issues. But I do have with Perl 5.10.1 on Ubuntu 10.04. The oneliner doesn't give issues, but this lite app running under morbo does
22:18 sri Htbaa: sounds like a perl bug then
22:18 Htbaa with this lite app it does require more requests for it to happen, but it does.
22:19 Htbaa looking at top 1 of the 2 perl processes dissapears
22:19 sri garu: i'm actually not sure what the right behavior is
22:20 Htbaa is Perl 5.10.1 no longer supported by Mojolicious? (I'm actually fine with that, it's going to be deployed on a newer Perl. For development I should get my VM updated).
22:20 sri Htbaa: personally, i don't care about 5.10.1, but if we get patches that fix 5.10.1 bugs they get applied
22:21 Htbaa ah OK
22:25 sri garu: what do you think makes more sense? filter level before or after emitting the event?
22:26 garu sri: I like the idea of failing as soon as possible, but I don't like that the logger simply writes whatever message it captured. So I would put the level checking code inside the event handler
22:26 garu makes special sense to me because the syntax is so close to the log() method itself
22:27 garu log( debug => 'bla' )
22:27 garu emit( message => debug => 'bla' )
22:27 Htbaa sri: what really seems to happen is that for whatever reason morbo's fork dies. Shouldn't morbo be able to recover if that happens?
22:27 sri i'm not sure i understand "but I don't like that the logger simply writes whatever message it captured"
22:28 garu sri: to me, the function monitoring the message events should be the one responsible for logging (or not) depending on the message - or, in this case, the message level.
22:28 sri Htbaa: it does
22:28 garu sri: makes sense?
22:28 purl it has been said that makes sense is http://xrl.us/bjq3kq
22:28 Htbaa then it's a Perl 5.10.1 bug :-)
22:28 sri garu: yes
22:33 garu sri: I need to leave for a couple of hours, talk to you in a bit!
22:33 sri garu: think i'll fix the logger and then go to sleep
22:35 garu sri++
23:00 good_news_everyone joined #mojo
23:00 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/vdEy7w
23:00 good_news_everyone [mojo/master] fixed bug in Mojo::Log that prevented some message events from being emitted - Sebastian Riedel
23:00 good_news_everyone left #mojo
23:01 sri the way it simplified log tests made pretty clear that this is the correct implementation :)
23:02 sri i've also checked other events of this type, they behave the same, emit everything and filter in callback
23:11 good_news_everyone joined #mojo
23:11 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/Ih2QkA
23:11 good_news_everyone [mojo/master] fixed typo in Changes file - Sebastian Riedel
23:11 good_news_everyone left #mojo
23:12 Htbaa Chuck is also a Perl programmer :-) https://twitter.com/Htbaa/status/​237147250759962624/photo/1/large
23:12 purl okay, Htbaa.
23:12 Htbaa what?
23:13 sri :D
23:15 Htbaa spotted that one today. I was like "hey! Wait a minute!" Funny to see
23:16 Htbaa though earlier in the series I believe he was talking about C++ and having books on that. But those are just minor details :-)
23:25 Htbaa sri: just perlbrewed 5.16.1 and tried my sample script: no issues. So it must be a 5.10.1 bug
23:26 Htbaa though if you manually kill the forked process (when using Morbo) it doesn't recover from it
23:28 dminus joined #mojo
23:28 Htbaa I'm heading to bed now. Good night.
23:54 zhutingting joined #mojo

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