Camelia, the Perl 6 bug

IRC log for #mojo, 2013-02-11

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

All times shown according to UTC.

Time Nick Message
00:11 sri hmm
00:11 * sri is trying to benchmark MongoDB vs Mango a bit... but half of the MongoDB options don't work
00:12 sri looks like if you're asking for safe inserts... you get unsafe inserts anyway :O
00:15 sri wow, that's messed up
00:16 Molaf__ joined #mojo
00:29 sri i expected it to be a lot faster than Mango, but even under ideal circumstances (localhost) it's barely 2-3 times in the most extreme cases
00:29 sri if you add a little latency the difference becomes irrelevant
00:30 sri (should have said localhost + ssd)
00:32 sri and if you go ->j(1) for journal safety both get slowed down to the exact same number
00:48 GabrielVieira hey there
00:50 GabrielVieira if I have a get method after a under, the template that mojo looks for is the name of the get method without the under... -> under 'admin'; get 'add';  <- template = 'add.html.ep' instead of 'admin/add' this behavior is expected?
00:55 jzawodn joined #mojo
01:37 ka2u joined #mojo
01:41 xaka joined #mojo
02:19 GabrielVieira param 'status' => 1 is not working properly
02:30 Miked joined #mojo
02:34 miniCruzer joined #mojo
03:49 Skylos_ joined #mojo
04:25 Skylos_ left #mojo
04:33 arpadszasz joined #mojo
04:34 asarch joined #mojo
05:00 jberger joined #mojo
05:28 jberger ok, so I think I have my protocol basically laid out
05:28 jberger its actually totally decoupled
05:29 jberger I think I could have something useful for generic server-side backends
05:29 jberger https://gist.github.com/jberger/4744482
05:53 spleenjack joined #mojo
05:56 Miked joined #mojo
06:40 mire joined #mojo
06:42 bizam_ joined #mojo
06:56 Vandal joined #mojo
06:58 yakudza joined #mojo
06:59 GabrielVieira joined #mojo
07:07 Mike-PerlRecruiter_ joined #mojo
07:20 yakudza joined #mojo
07:30 ladnaV joined #mojo
07:30 bzero Hello. Why with: use Mojo::Base -base; sub new { my $class = shift; my $self = $class->SUPER::new( @_ );
07:30 bzero I got Can't use an undefined value as a HASH reference at /usr/local/share/perl/5.12.4/Mojo/Base.pm line 54
07:31 bzero It worked in Mojo::Base with Mojolicious 2.x :)
07:42 bzero Oops. It's my fault. :)
07:50 arpadszasz_ joined #mojo
08:03 suy joined #mojo
08:04 vishwanathms joined #mojo
08:09 dod joined #mojo
08:11 d4rkie joined #mojo
08:38 dod joined #mojo
08:53 fhelmber_ joined #mojo
08:59 karlheinzdieterwuer joined #mojo
09:05 cosimo joined #mojo
09:09 cosimo joined #mojo
09:14 karlheinzdieterwuer left #mojo
09:21 dhg joined #mojo
09:24 hrupp joined #mojo
09:25 geira joined #mojo
09:40 spleenjack joined #mojo
09:48 vishwanathms joined #mojo
09:48 nelio joined #mojo
09:49 vishwanathms left #mojo
09:49 ObseLeTe joined #mojo
09:58 Polarn joined #mojo
10:01 Polarn joined #mojo
10:02 _visu joined #mojo
10:06 rwstaune` joined #mojo
10:16 maxhq joined #mojo
10:21 rwstauner joined #mojo
10:28 nelio joined #mojo
10:48 arthas joined #mojo
11:01 ryozi joined #mojo
11:11 vervain joined #mojo
11:12 berov joined #mojo
11:13 berov Now Bulgaria knows more about Mojolicious!
11:16 berov Although I just "scratched the surface" as tempire say,s at least I demonstrated how websocket works
11:16 berov http://2013.perlbulgaria.org/sofia2013/talk/235
11:31 geira joined #mojo
11:31 geira1 joined #mojo
11:32 rwstaune` joined #mojo
11:46 ObseLeTe joined #mojo
11:47 yakudza can some one show example of deploing mojolicious nginx with client side https authentication
11:50 ver joined #mojo
11:52 berov http://mojolicio.us/perldoc/Moj​olicious/Guides/Cookbook#Nginx
11:53 berov https://github.com/kberov/MYDLjE/blob/m​aster/conf/nginx-vhost-example.com.conf
11:54 berov what is client side authentication :)?
11:55 yakudza I generate openssl cert and give it to client. And he can see site only if it has this cert
11:55 berov well  Iwill b einterested to see such example too :)
12:25 dvinciguerra joined #mojo
12:33 mire joined #mojo
12:46 judofyr joined #mojo
12:56 dvinciguerra_ joined #mojo
13:12 dvinciguerra__ joined #mojo
13:13 phips joined #mojo
13:23 Skylos_ joined #mojo
13:23 Skylos_ left #mojo
13:24 vervain http://wiki.nginx.org/HttpS​slModule#ssl_verify_client
13:24 vervain Your client verification using a certificate is an nginx thing, not a mojolicious thing.
13:32 dvinciguerra_ joined #mojo
13:32 mugenken joined #mojo
13:44 dhg joined #mojo
13:45 maxhq1 joined #mojo
13:49 sri o/
13:50 Britzel joined #mojo
13:51 dvinciguerra__ joined #mojo
13:52 jberger \o
13:55 judofyr \o/
13:57 bluescreen joined #mojo
13:59 mire joined #mojo
14:02 * jberger does the cha-cha
14:06 dvinciguerra__ joined #mojo
14:07 TitanOfOld joined #mojo
14:07 judofyr joined #mojo
14:11 Miked joined #mojo
14:16 jberger I think I'm going to release my Plugin as "GalileoSend"
14:16 judofyr jberger: what does it do?
14:16 jberger but I also think that the GalileoSend "protocol" could be useful outside of Perl servers
14:16 jberger file uploads via websocket
14:17 jberger with nice server-client communication throughout
14:17 judofyr jberger: why?
14:17 judofyr ah
14:17 jberger async
14:17 jberger https://gist.github.com/jberger/4744482
14:17 jberger try it out!
14:17 judofyr jberger: you can do the same with just regular AJAX. split the upload into X chunks and do X requests to the server.
14:18 jberger probably
14:18 judofyr jberger: that'a what http://www.plupload.com/ does for you :)
14:18 judofyr jberger: but yeah, cool idea
14:19 jberger hmmm
14:19 jberger is that websocket transport?
14:19 judofyr nope
14:19 jberger oh ok
14:19 judofyr but I guess you could implement a backend for it
14:20 judofyr (I meant, Plupload does the "split the file into X chunks" and does AJAX for them separately)
14:20 jberger I looked quite a bit for such a thing late last week and only found one thing that was highly tied to a node server-side
14:20 jberger websocket has much less latency
14:20 judofyr Plupload gracefully handles all browsers :)
14:20 judofyr jberger: I have a Mojolicious-plugin for Plupload if you're interested
14:20 jberger read my spec at the bottom of the document
14:20 jberger cool
14:21 jberger yeah, websocket doesn't work on all browsers (all newer ones though I think)
14:21 * sri keeps yelling at the official mongodb perl driver
14:21 judofyr http://caniuse.com/#search=websock
14:21 jberger but supporting that has never been a goal of Galileo (my CMS) which uses websockets exclusively
14:22 jberger * I should say, viewers don't need websockets, only authors/admins
14:23 dvinciguerra_ joined #mojo
14:24 jberger I'm almost glad I didn't know about Plupload though, I enjoyed working on this and I might not have done it if I had known
14:24 jberger I might have caved
14:27 * jberger still might, Pluploader looks cool
14:28 jberger no they serve different purposes
14:28 jberger there is no "queue" in my thing, but you could easily write one around it. it is purely a transport mechanism
14:28 jberger judofyr, thanks for the tip though
14:30 judofyr jberger: Plupload has both a high-level jQuery-plugin (with CSS and shit) and a low-level API where you just upload files
14:30 jberger yeah, I saw that
14:31 jberger like I said if I had known I might not have written this
14:31 jberger but not that I have, I kinda want to use it :-)
14:31 jberger without using websockets, does it get positive confirmation from the server?
14:34 judofyr jberger: sure. with the HTML5/Flash/Silverlight backends it will just chunk the file. so you'll get positive confirmation for each chunk/request
14:34 judofyr jberger: it has a fallback for old browsers where it will just be an old-style <input type="file"> that's getting POST'ed to an <iframe>
14:34 jberger ok, (I'm trying to determine if I have any selling point beyond just "it uses websockets")
14:35 jberger speed perhaps
14:35 Britzel joined #mojo
14:36 judofyr jberger: well, I'm not 100% satisfied with Plupload. the API and implementation is a bit messy. the server-side isn't specified anywhere, so I had to look at the provided PHP-script to implement a Perl-version
14:36 judofyr s/Perl/Mojo/
14:37 jberger I haven't documented the mojo side yet either, but its basically just three new signals (with default handlers)
14:38 judofyr jberger: let me put it like this: I don't think Plupload is great project, but they've implemented all types of runtimes which makes my job easier
14:38 jberger I made the decision when I started Galileo that I was going to target HTML5 and modern shite only
14:39 jberger in order to make my job easier :-P
14:39 judofyr ;)
14:40 judofyr lucky you
14:58 gryphon joined #mojo
15:10 Molaf_ joined #mojo
15:40 berov By the way can somebody give a hint/example how to handle chunks sent by plupload with Mojolicious ?
15:41 berov imagine I have a big (500MB) file to upload
15:41 berov and my app is done on top of Mojolivious.
15:42 jberger https://github.com/jberger/GalileoSend
15:42 dotan joined #mojo
15:42 judofyr berov: https://gist.github.com/ju​dofyr/4e54fa2ca0bd1cfb344d
15:42 berov my customer insists on using plupload :)
15:43 jberger berov, I wasn't really meaning to send that to you
15:43 berov ok :)
15:43 jberger in fact I hadn't read the backlog when I sent it
15:43 jberger just odd luck
15:43 berov np
15:43 berov :)
15:43 jberger if anything I was sending it to judofyr
15:43 jberger though he also can't use it :/
15:44 judofyr berov: have a look at that plugin I sent. I might open-source it and CPANify it one day :)
15:44 sri tempire: weren't you a ron paul fan? :) http://politics.slashdot.org/story/13/02/​11/1247252/ron-paul-asks-un-for-help-geti​ng-control-of-ronpaulcom-domain-from-fans
15:44 judofyr jberger: looks nice
15:45 berov hey judofyr Thanks will try it an definitely will contribute when I come to that part of the project
15:46 judofyr berov: we've been using it successfully in production :)
15:46 berov wow great then :)
15:46 berov I eventually will be implementing an upload app for bigger files
15:48 vervain jberger: cloned ;-)
15:48 jberger vervain, I will ship it to CPAN soon
15:48 jberger unless you are making contributions :-)
15:49 vervain Not yet.  I'm still eyeball deep in backend.  So I'm not mojoing at the moment.  Will be heavily switching gears that direction soon though.
15:49 berov me too :)
15:51 jberger vervain, berov cool
15:52 jberger with all the plugin and most of the javascript now in their own files, the example looks sooo clean!
15:52 jberger https://github.com/jberger/GalileoS​end/blob/master/example/uploader.pl
15:52 * jberger is not being so humble right now
15:53 sri that's pretty clean
15:54 sri jberger: why not $self->app->home->rel_dir('upload')?
15:54 jberger I probably could
15:54 jberger probably should even
15:54 jberger I was going rather quickly
15:54 sri yea, cwd will change based on server
15:55 marty sri:  that article is from the atlantic wire.  <enable_media_bias_filter>  :)  But still, even with bias, it's a hypocritical action by Paul.
15:55 jberger if that's a problem, is this? https://github.com/jberger/GalileoSend/blob/ma​ster/lib/Mojolicious/Plugin/GalileoSend.pm#L13
15:56 sri jberger: __FILE__ is pretty safe
15:56 jberger cool, thanks
15:56 sri i use it for bundled files in mojolicious too
15:56 jberger oh yeah, thats right
15:58 sri don't think you need that much boilerplate for it
15:58 sri https://github.com/kraih/mojo/b​lob/master/lib/Mojo/Util.pm#L23
16:00 judofyr sri: are you deprecating my ugly sort-hack? :(
16:00 sri judofyr: ?
16:00 judofyr sri: https://github.com/kraih/mojo/blob/a7d47f97ee858​098330d80253cbaa7b9e2f77b30/lib/Mojo/Util.pm#L37
16:00 jberger sri: probably not
16:01 jberger but it will work
16:01 sri judofyr: ah, yea, html_escape will go the way of the dodo
16:01 jberger all: yeah I borked a variable name, if you've tried it and it didn't work, pull again
16:02 * jberger needs to write tests
16:02 jberger sri: is there a good way of testing javascript?
16:02 jberger I can (and will) of course test the Mojo side of things
16:03 sri nope
16:05 jberger oh well
16:05 slushie joined #mojo
16:06 slushie good morning friends
16:06 berov good evening :)
16:07 slushie hehe indeed
16:07 berov for me yes :)
16:08 slushie its 10am and warm here, a beautiful day to code
16:13 yakudza joined #mojo
16:14 jberger slushie, where are you, its 10am in Chicago
16:14 suy jberger: phantomjs is the only think that I know about JS testing. Sorry if is not very helpful for your JS :-/
16:14 jberger and if you are in Chicago you should come to chicago.pm meetings
16:14 jberger :-)
16:14 jberger suy, I will look, but I don't have high hopes
16:14 jberger thanks though
16:15 slushie hehe no i am in Costa Rica
16:16 slushie there was once a costarica.pm years ago, but its mostly fizzled now, unfortunately
16:16 inokenty joined #mojo
16:18 jberger Costa Rica sounds a lot nicer than Chicago right now
16:18 jberger its probably nicer most times actually
16:19 slushie its summer right now
16:19 slushie an especially nice time to be here :)
16:19 jberger though I do love Chicago :-)
16:19 jberger I'm sure
16:19 jberger I will get there at some point
16:19 slushie come on down
16:24 basic6 joined #mojo
16:28 vervain slushie: What defines 'summer' in Costa Rica? ;-)
16:29 slushie well, its relative i guess. its more accurate to say 'dry season' although the first part of dry season is the nicest
16:29 vervain Gotcha :-)
16:31 bluescreen joined #mojo
16:35 d4rkie joined #mojo
16:37 labrown joined #mojo
16:41 bluescreen_ joined #mojo
16:45 d4rkie joined #mojo
16:49 jberger_ joined #mojo
17:09 xaka joined #mojo
17:12 slushie hm i'd like to add SOCKS proxy support to Mojo::UserAgent. does anyone know a good place to start?
17:13 sri slushie: https://github.com/kraih/mojo/issues/429
17:14 slushie aha i see
17:15 slushie well, does the lack of 'pluggable' proxy support mean its not worth the effort?
17:15 slushie at least until the new api
17:16 sri depends on what you were planning to do, a hackish patch for core would prolly not be accepted
17:17 slushie i'd probably want to keep it in a MojoX::UserAgent::SOCKS or similar namespace
17:17 slushie but then, itd probably be even more of a hack to mess with another package's methods
17:18 sri i doubt that's possible with the current api, at least without poking into internals
17:19 slushie right
17:20 biz joined #mojo
17:20 slushie i suppose i could do the SOCKS connections and then stuff them into the UA connection list
17:20 sri wouldn't work for redirects
17:21 slushie yeah :| in which case i could do that manually too
17:21 sri yes
17:22 sri adding connection features is hard, since everything is non-blocking internally, only a new layer like channels could make it better
17:23 slushie right, hooking into the coderefs to perform SOCKS-layer operations would be difficult
17:23 slushie the whole point is to take advantage of the NB connects, though ;)
17:24 slushie you know, now that i think about it, this is half-way toward the channel API already
17:25 berov left #mojo
17:25 sri :)
17:25 slushie maybe i'll work on that in a topic branch
17:25 sri any help would be appreciated
17:25 slushie i feel like sisyphus, writing network io layers for all eternity
17:26 slushie (just finished writing the libev SOCKS proxy this will be using)
17:26 sri network io is fun though :)
17:26 slushie i agree!
17:27 slushie still, bringing evented io to the world is sometimes an uphill battle
17:33 sri interesting, i was so sure Mango::BSON would be a bottleneck
17:34 sri but i can encode 95k and decode 45k bson documents per second... while MongoDB can only do 6k safe inserts per second
17:36 marty That's an amazing stat, sri.  Kewl
17:37 sri and that's only under ideal conditions
17:37 sri MongoDB::BSON can encode 500k documents per second btw. but it seems not to matter much
17:39 sri there's quite a difference between safe and unsafe inserts btw. jumps down from 20k to 6k
17:39 sri (on localhost!)
17:41 sri atm. Mango is at 2k safe inserts per second (blocking), not too shabby for this scenario, but i wouldn't be surprised if we could get a lot more with a few optimizations
17:41 tempire I'd like to add patch_json to Mojo::UserAgent
17:42 sri tempire: and put_json... and and and
17:46 sri also Test::Mojo::patch_json_ok, put_json_ok...
17:49 sri not that i'm saying no... just pointing out that it could get tedious
17:49 tempire I understand
17:50 sri are patch and put requests with json body common now?
17:50 tempire Thinking of other solutions, and then realizing that no matter what, j() is always going to be shorter than _json
17:51 sri the content type is longer though
17:52 * sri wants to blog but is totally out of practice :S
17:52 tempire it's been forever since you made something.
17:52 tempire (blog entry)
17:52 tempire GET ON IT
17:52 sri was thinking Mango + AnyEvent
17:54 sri or maybe untangling callback spaghetti with ioloop delays and mango
17:54 tempire I figured you would have an introduction of mango first
17:55 sri hmm
17:55 tempire and then do a small series of entries over the next couple of weeks, to get it in peoples heads
17:56 tempire that is, if you're comfortable with it.  Most people have no idea it exists yet.
18:01 mire joined #mojo
18:03 ObseLeTe joined #mojo
18:03 tempire You should make an entry: Mango, built for Perl 7
18:04 sri :)
18:10 cfedde yay!  perl 7!
18:10 tempire Some dude mentioned a Perl#.
18:10 tempire Perl☃
18:11 cfedde heh. Perl mandlebrot?
18:12 kitt_vl left #mojo
18:14 cfedde BTW. Is tere a way to use Mojo::Template outside mojo and give it a namespace to pull variables from? As is I'm passing it @_.
18:18 rem_lex|pivo joined #mojo
18:34 njlg joined #mojo
18:39 moltar joined #mojo
18:42 jberger_ haha, some people are starting to wish Catalyst was mojo: http://blogs.perl.org/users/alberto_simoes/2013/0​2/about-the-grants-committee.html#comment-356052
18:43 jberger_ I actually liked the idea of perl++
18:43 dod joined #mojo
18:43 jberger_ people know c++ works with c (as perl++ would "work with" perl (5))
18:43 jberger_ perl# conveys the need for dotnet
18:43 jberger_ which there isn't
18:44 jberger_ cfedde, you might want to look at the code for Mojolicious::Plugin::EPRenderer
18:47 dhg joined #mojo
18:49 inokenty jberger_: I always thought that Ruby is Perl++ =)
18:59 rem_lex| joined #mojo
19:01 dhg joined #mojo
19:02 sh4 joined #mojo
19:07 Mike-PerlRecruiter_ joined #mojo
19:09 dhg joined #mojo
19:22 Adura joined #mojo
19:25 xaka joined #mojo
19:47 cfedde jberger_: thanks.
19:49 jberger_ np
20:03 rwstaune` joined #mojo
20:05 rwstaun`` joined #mojo
20:16 nelio joined #mojo
20:33 dvinciguerra_ joined #mojo
20:35 lukep joined #mojo
20:45 GabrielVieira2 joined #mojo
20:57 Britzel joined #mojo
21:20 * sri accidentally a blog
21:20 sri http://blog.kraih.com/mangolicious
21:22 perlite joined #mojo
21:23 marty sri++
21:24 sri marty++
21:26 jberger_ sri accidentally the whole thing
21:28 sri hope my comment about the official driver doesn't come across too negative
21:30 tempire "it's basically the only driver i could find that still defaults to unsafe writes."
21:30 tempire capitalize the i
21:30 sri really?
21:30 tempire in the middle of the sentence
21:31 sri you capitalize if it's one sentence?
21:31 sri you mean "It's"?
21:31 tempire "driver I could"
21:31 sri oh
21:32 * sri never capitalizes I
21:33 stephan48 i noticed the sub "state" in the helper  mango in the blogpost, is this something new i missed in docu?
21:33 jberger_ sri, I don't think its too strong
21:33 stephan48 could someone maybe point me to a hint what it does
21:34 jberger_ state is a Perl keyword since 5.10
21:34 jberger_ and its awesome
21:34 jberger_ its like my, but only runs its initialization once
21:35 marty stephan48: http://perldoc.perl.org/functions/state.html
21:35 jberger_ @uniq = grep { state %seen; ! $seen{$_}++ } qw/one one two/
21:36 stephan48 thanks!
21:37 stephan48 the hint about being a perl keyword brougth me to the rigth page :)
21:37 stephan48 thanks marty for the link
21:44 * jberger_ <3 state
21:51 sri <3 state
21:51 Pizentios left #mojo
21:53 mire joined #mojo
22:12 joschi joined #mojo
22:36 jberger_ I CNA HAZ TEZTS: https://github.com/jberger/Gal​ileoSend/blob/master/t/basic.t
22:37 jberger_ the test also might be the only mojo app yet that only has a websocket route
22:39 bluescreen joined #mojo
22:49 knight joined #mojo
23:02 sri hmmm
23:02 sri think i'll change Mango::BSON::Time a bit
23:03 sri it should stringify to a valid hires epoch value
23:07 gryphon joined #mojo
23:11 arthas joined #mojo
23:22 drift joined #mojo
23:22 sri that kinda sucks
23:22 sri perhaps a TO_JSON methods that stringifies to epoch seconds
23:22 sri s/s//
23:22 JvD joined #mojo
23:23 sri bson_time is currently epoch milliseconds
23:23 sri (so time * 1000)
23:25 JvD Hello, can I ask a question?
23:26 marty jvD:  ask away.
23:26 JvD I just installed Mojolicious-3.84 (upgraded from 3.43)
23:27 marty It's pretty awesome huh? :)
23:27 JvD and i have things like $self->render( template => 'cdn/genfiles', data => $octets ); that do not work anymore after that upgrade
23:27 JvD i get <HTML>.... in front and after. not just the data.
23:27 JvD worked in 3.43
23:27 JvD and yes, mojolicious is awesome.
23:28 sri those are both reserved keywords that don't work together
23:28 JvD u mean template and data?
23:28 * marty nods
23:28 JvD i tried removing the template, and i still get the (default?) template
23:29 JvD so with "$self->render( data => $octets );" i still get the <HTML>.... stuff.
23:30 Averna joined #mojo
23:31 marty here is the current list of reserved stash values.  http://mojolicio.us/perldoc/​Mojolicious/Controller#stash
23:36 JvD not sure i follow... it worked in 3.43; do you know of anything that has changed with regards to this?
23:37 sri it should never have "worked" (whatever that means) to begin with
23:38 sri those keywords are incompatible
23:39 arthas joined #mojo
23:39 sri it's like saying "render this template and this raw binary blob, and surprise me which you put into the response" :)
23:39 JvD OK, so i removed the template. Now have:
23:39 JvD $self->res->headers->content_​type("application/download");
23:39 JvD $self->res->headers->conten​t_disposition("attachment; filename=\"$file_to_dl\"");
23:39 JvD my $success = $self->render( data => $octets );
23:39 JvD was kicked by sri: JvD
23:46 biz joined #mojo
23:55 mire joined #mojo

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