Camelia, the Perl 6 bug

IRC log for #mojo, 2013-01-24

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

All times shown according to UTC.

Time Nick Message
00:06 jzawodn joined #mojo
00:12 Molaf_ joined #mojo
00:24 egopro joined #mojo
00:27 tm hmm, sadly M::P::Authentication doesn't allow for user not to exist in the DB first :-/
00:28 tm I use OAuth2 for login, users are created dynamically, so unless I rewrite it, no dice :-/
00:30 tm oh well, at least I know how to handle that now - separate auth module based on M::P::Authentication
00:32 Averna joined #mojo
00:41 marty_ joined #mojo
00:51 shmuel joined #mojo
01:00 asarch joined #mojo
01:03 egopro joined #mojo
01:09 Mike-PerlRecruiter_ joined #mojo
01:16 ka2u joined #mojo
01:21 hlin joined #mojo
01:29 egopro joined #mojo
01:39 tm left #mojo
02:02 d4rkie joined #mojo
02:22 egopro joined #mojo
02:22 egopro joined #mojo
03:16 komodo joined #mojo
03:45 xaka joined #mojo
03:47 xaka joined #mojo
05:01 egopro joined #mojo
05:05 ka2u joined #mojo
05:22 egopro joined #mojo
05:25 Miked joined #mojo
05:56 spleenjack joined #mojo
05:59 egopro joined #mojo
06:23 egopro joined #mojo
06:25 Vandal joined #mojo
06:31 bizam hi mojoers! FAQ: what kind of event module is more preferable for the mojo?
06:33 arpadszasz joined #mojo
06:40 yakudza joined #mojo
06:41 shmuel joined #mojo
06:52 egopro joined #mojo
06:59 spleenjack1 joined #mojo
07:00 marcus So strange
07:00 marcus 3.81 breaks my pjax functionality
07:00 marcus I can't see anything in the changelog that's controversial
07:01 marcus sri: after upgrading to 3.81 I suddenly get errors like this: https://www.evernote.com/shard/s22/sh/4600dc9f-a6b​8-4b1e-a4a0-19c92d9a977f/2ca2f5a4b560e0342d847e0ba​a711f12/deep/0/Screenshot%2024.01.13%2008:01.jpg - if I downgrade to 3.80 it's gone again.
07:02 marcus hmm, maybe content-type changes makes jquery angry.
07:05 ver joined #mojo
07:06 dpetrov_ joined #mojo
07:08 marcus OH
07:08 marcus somehow I'm using the bundled jquery
07:08 marcus even tho I ship with my own
07:09 marcus sri: If you have /js/jquery.js - shouldn't that get priority over the bundled one?
07:09 marcus public/js/jquery.js even
07:10 marcus ACTUALLY
07:10 * marcus blames batman
07:11 crab what did he do?
07:13 marcus crab: use the bundled jquery
07:15 zivester joined #mojo
07:21 marcus Maybe we should rename it to jquery.mojo-internal.js :p
07:30 taryk joined #mojo
07:31 taryk left #mojo
07:40 rem_lex| joined #mojo
07:40 egopro joined #mojo
07:47 ObseLeTe joined #mojo
07:53 dod joined #mojo
08:07 dod joined #mojo
08:15 marty joined #mojo
08:18 egopro joined #mojo
08:26 arthas joined #mojo
08:26 lppoix joined #mojo
08:37 suy joined #mojo
09:09 egopro joined #mojo
09:11 mugenken joined #mojo
09:33 tempire renaming the jquery lib isn't a bad idea
09:33 tempire I've been caught up on that a couple of times.
09:35 fhelmber_ joined #mojo
09:50 batman hi
09:50 batman can i hot deploy with a new listen port?
09:50 batman marcus: what?
09:50 marcus batman: what what?
09:51 batman does mojo search for the bundled version of jquery before our?!
09:54 egopro joined #mojo
10:03 shmuel I have started wrapping every helper that fetch some object in a stash-cacheing. am I doing it wrong?
10:25 shmuel joined #mojo
10:27 Miked joined #mojo
10:49 egopro joined #mojo
10:58 SmokeMachine joined #mojo
11:14 dotan1 joined #mojo
11:46 tagg joined #mojo
12:22 marcus batman: no, you didn't bundle one.
12:30 russum joined #mojo
12:52 SmokeMachine joined #mojo
12:53 warlock afternoon everyone
12:54 warlock I have setup the websocket chat example available on github but I seem to have run into an issue regarding UTF-8 I believe. It seems that all messages I receive on server-side from client-side are encoded weirdly. Swedish characters are printed out as ??? when I try to print $msg
12:54 warlock Does anyone have any ideas of why this is happening and what I can do to fix it?
12:57 SmokeMac_ joined #mojo
13:06 warlock anyone? :-)
13:08 arpadszasz joined #mojo
13:09 Mike-PerlRecruiter_ joined #mojo
13:15 vervain warlock: When you say printed out, do you mean with log, print, say etc or something else?
13:15 vervain IOW - do you mean to console?
13:16 warlock vervain: to the console, I just use print $msg; to see what the actual input from the client-side was
13:16 warlock but it shows as ?
13:16 warlock (a question mark that is). I am not quite sure what I am doing wrong here
13:17 warlock although, when I convert it to UTF client-side before sending it to server-side it shows correctly
13:17 warlock BUT when I send it back (foreach send the chat message back to the client) it turns out as ? in the browser on the client-side
13:23 SmokeMachine joined #mojo
13:26 warlock I hate to be moving to node.js for this, I'd prefer to code this in pure perl but this little thing is stopping me from continuing :(
13:28 komodo joined #mojo
13:45 warlock oh well, looks like socket.io for me then :-(
13:53 inokenty joined #mojo
13:54 vervain warlock: What kind of luck do you have with running mojo/examples/websocket.pl under morbo?
13:54 bluescreen joined #mojo
13:56 batman is there a way to dispatch to multiple actions (in different controllers) on a request?
13:56 bluescreen_ joined #mojo
13:58 warlock vervain: http://62.20.49.201:3000/
13:58 warlock seems to work
14:00 batman warlock: maybe you need to do my $message = Unicode::UTF8::encode_utf8($ws_input, sub { $_[0] });
14:00 warlock let me take a look at the code, one second
14:02 warlock batman: I get this in the console; Event "read" failed: Undefined subroutine &Unicode::UTF8::encode_utf8 called at app.pl line 33
14:03 warlock do I need to use; something specific in order to use the UNicode::UTF8 function?
14:03 batman did you load Unicode::UTF8?
14:03 warlock that's it, one second
14:03 batman use Unicode::UTF8;
14:03 gryphon joined #mojo
14:04 warlock hmpfh, looks like it made it even worse batman, that didn't fix it
14:05 warlock actually, it's the very same output
14:20 Miked joined #mojo
14:29 sri marcus: the bundled jquery is last, your files always have priority
14:29 sri marcus: as far as i can see there is no bug, please make a minimal test case
14:29 marcus sri: yepp, I just thought I had one because it showed up in cmd-t, it was from another project.
14:30 marcus sri: as mentioned above, batman didn't actually include a jquery.js :)
14:30 sri ah
14:30 * sri blames batman
14:33 sri warlock: if you're utf-8 encoding yourself, then your websocket code it prolly broken
14:34 sri there's a very good encoding example included in examples/websocket.pl, just run it
14:38 sri marcus: you want to rename all bundled files?
14:52 warlock sri: im using the code from this page: https://github.com/kraih/mojo/wiki/Writi​ng-websocket-chat-using-Mojolicious-Lite (The second example)
14:52 warlock using the server side + client-code
14:52 sri that's just an old wiki page, the examples are prolly broken
14:52 warlock aha
14:53 warlock guess I'd have to rewrite it somehow, but looks very much as the same as websocket.pl
14:53 warlock but I'll take a closer look at it
14:53 sri it's very different, the double encoding issue is pretty obvious
14:54 warlock oh I see
14:55 sri that article has caused a lot of problems, i think unless someone fixes it i'm going to delete it
14:55 warlock I had no clue, I for whatever reason figured It was official and hence the examples there would work hehe
14:56 warlock guess I was wrong, very wrong :)
14:56 sri tempire, marcus, crab: want to fix it?
14:58 warlock thanks for the heads-up sri
14:59 sri only the examples in the distribution are official and maintained
15:01 batman marcus: about jquery.js... not sure if i want the full blame!!! ;)
15:03 marcus batman: why? Have you been git blame'in? :)
15:03 marcus batman: 3dbd5aac (Jan Henning Thorsen 2012-08-03 15:24:39 +0200  5)     %= javascript '/js/jquery.js';
15:07 Molaf__ joined #mojo
15:16 Britzel_ joined #mojo
15:19 SmokeMachine joined #mojo
15:31 dod joined #mojo
15:34 dod joined #mojo
15:42 lppoix left #mojo
15:57 arthas joined #mojo
16:23 yakudza joined #mojo
16:25 SmokeMachine joined #mojo
16:48 labrown joined #mojo
17:09 xaka joined #mojo
17:40 d4rkie joined #mojo
17:44 SmokeMachine joined #mojo
17:48 SmokeMac_ joined #mojo
17:50 SmokeMa__ joined #mojo
17:50 arpadszasz joined #mojo
18:04 SmokeMachine joined #mojo
18:05 nic Deploying to a cgi host, I've used .htaccess to rewrite s|/cgi-bin||
18:05 nic All is well till my code calls redirect_to
18:06 nic ie client browser doesn't see "cgi-bin" till after a redirect
18:07 nic I'm wondering how to lie to Mojolicious and get it to construct urls without the cgi-bin
18:08 nic I could monkey patch redirect_to, but I'm guessing I can just override one of the app values
18:18 SmokeMac_ joined #mojo
18:24 nic monkey_patch ftw
18:50 trone the mod_perl PSGI/Plack deployment here: https://github.com/kraih/m​ojo/wiki/Apache-deployment is still valid?
18:52 basic6 joined #mojo
18:54 basic6 joined #mojo
18:58 BeDa joined #mojo
19:01 * sri has deleted the websocket article from the wiki
19:11 vel joined #mojo
19:15 good_news_everyone joined #mojo
19:15 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/t9oPJQ
19:15 good_news_everyone mojo/master 14ed827 Sebastian Riedel: better WebSocket examples for Mojolicious::Controller
19:15 good_news_everyone left #mojo
19:15 sri those should be closer to what people really do with websockets
19:16 tempire what are we fixing?  the wiki page?
19:18 good_news_everyone joined #mojo
19:18 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/y9fyZQ
19:18 good_news_everyone mojo/master cd84fd9 Sebastian Riedel: documentation tweak
19:18 good_news_everyone left #mojo
19:18 sri tempire: https://github.com/kraih/mojo/wiki/_compare​/2a8e5a00382aa48f5cdc14291ab98ec55486c3d6..​.4ce5cfb978fae53168edf9507d9cf025723cdc4c
19:18 sri that article is horribly outdated, you would have to rewrite it basically
19:19 sri all kinds of double encoding issues
19:19 * tempire nominates marcus
19:19 tempire since he's been working a lot with websockets most recently
19:19 sri we've only recently made JSON via WebSockets nice with text/binary events
19:20 sri jberger++ # for pointing out the flaw
19:21 * sri loves how websocket tests work now
19:22 SmokeMachine joined #mojo
19:25 mike___ is there anyway to use a different set of templates based on the hostname?
19:30 xaka joined #mojo
19:30 SmokeMachine joined #mojo
19:32 xaka joined #mojo
19:36 xaka joined #mojo
19:49 ObseLeTe joined #mojo
19:56 ObseLeTe joined #mojo
19:59 good_news_everyone joined #mojo
19:59 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/Inshtw
19:59 good_news_everyone mojo/master 99621b4 Sebastian Riedel: moved bundled static files to mojo directory
19:59 good_news_everyone left #mojo
19:59 sri marcus, tempire, batman: that should make the boundaries more obvious
20:06 tempire +1
20:09 batman mike__: maybe you could alter the include dirs inside an around_dispatcher...
20:09 sri batman: bad idea!
20:10 sri don't mess with the app, there may be parallel requests bein processed
20:11 basic6 i've written my own helper "url_for" which works a little different than the default one. i'm adding it with that name in the before_dispatch hook, which works. now i'm trying to get redirect_to to use my url_for helper, adding a custom helper "redirect_to" doesn't seem to work though?
20:12 sri url_for is also a controller method
20:14 basic6 so if i would replace the controller method url_for with my helper, redirect_to would use it?
20:17 dod joined #mojo
20:18 batman sri: yes. it is indeed a bad idea :)
20:22 vel joined #mojo
20:32 basic6 or do i have to put something like sub redirect_to { shift->app->custom_redirect_to } at the top of my controller classes?
20:40 perlite_ joined #mojo
20:46 lukep joined #mojo
20:56 marcus sri: +1
21:15 good_news_everyone joined #mojo
21:15 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/IzPntg
21:15 good_news_everyone mojo/master 66a04af Sebastian Riedel: test static files
21:15 good_news_everyone left #mojo
21:23 gryphon joined #mojo
21:25 sri just 14 more tests and we've reached 10k :o
21:30 bluescreen joined #mojo
21:36 mike___ sri: so is what i want to do possible?
21:47 marcus IMPOSSIBLE IS NOTHING
21:48 marcus http://barneysvideoresume.com/
21:53 marcus mike___: your could add the hostname to the template name and have like templates/$host/templates ? for instance by wrapping render in a helper.
21:58 mike___ marcus: would that entail adding the call to the helper in every sub that calls render() or is there a way to hook it in
21:58 mike___ sorry, n00b here
21:59 marcus mike___: yes it would.
21:59 mike___ i was hoping to write it once :)
22:02 nic Found a solution on the mailing list to the mod_rewrite problem...
22:02 marcus mike___: guess you could subclass the renderer
22:03 nic BEGIN { $ENV{SCRIPT_NAME} = '/foo'; }
22:04 marcus nic: did you see https://metacpan.org/module/Mo​jolicious::Plugin::RequestBase ?
22:06 nic that's interesting, marcus, and looks like it's in a similar problem area
22:07 marcus nic: I use it when I proxy nginx apps to like /foo
22:07 nic basic6: why were you customising url_for?
22:07 nic just wondering if you're tackling exactly the same problem
22:08 nic marcus: yes, I may well use it on a different project once I get nginx sorted out
22:08 nic (I want nginx to direct /foo to one mojo app and /bar to a separate mojo app, but I'm new to nginx)
22:36 Averna joined #mojo
22:40 basic6 nic yeah i've rewritten url_for in order to remove the filename of the application script "myapp.pl" from the url. then i wrote a rewriterule. it works.
22:41 basic6 i've now just added  sub url_for { shift->app->url_for(shift) } to every controller class, which looks weird but it does the job
22:51 basic6 so a url_for('/welcome') returns "/welcome" instead of "/myapp.pl/welcome". plus url_for('settings') inside a controller "Documents" would return "/Documents/settings" because I couldn't figure out how to get url_for to do that.
23:28 ObseLeTe joined #mojo
23:41 anaio joined #mojo
23:51 arthas joined #mojo

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