Camelia, the Perl 6 bug

IRC log for #mojo, 2013-01-09

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

All times shown according to UTC.

Time Nick Message
00:00 * sri listens to the firefly soundtrack
00:10 jdoe I'm not sure if this is an appropriate forum to ask... but is there a 'proper' way to handle multiple file uploads in a single request? (<input type="file" multiple>) The example in the mojolicious::lite docs provides only the first file, the multipart upload example in the cookbook works... but doesn't provide the files as mojo::upload objects, and I'm not sure what other requests it might snag as well.
00:26 Caelum don't you have to use flash or something for multi-uploads?
00:27 sri not anymore
00:27 Caelum cool
00:27 sri i think we don't support multi uploads yet
00:27 vervain Yikes
00:28 sri since they share the same name
00:29 vervain For my impending needs it'll probably be wiser to upload one at a time with ajax anyway.
00:31 sri you may be able to get them all via $self->req->uploads
00:31 sri supported by accident it seems :)
00:32 * sri pokes jdoe
00:33 sri or actually...
00:34 janus joined #mojo
00:35 sri http://mojolicio.us/perldoc/Mojo/Message#upload # documentation says multiple should work :o
00:36 sri i have no clue how it got there though
00:36 jnbek joined #mojo
00:42 Caelum my second pullreq of the day: https://github.com/abh/mojox-renderer-tt/pull/34
00:42 sri ok, there's only a bug in Mojolicious::Controller->param
00:42 sri should be trivial to fix
00:45 Caelum anewkirk: ping
00:47 Caelum anewkirk: when you get this, I was wondering if you have ideas on the structure of good models using DBI/SQL (via ::Connector of course)
00:48 jdoe sri: sorry, I was dealing with work.
00:49 jdoe cool, I'll check it out. "You can't" is fine too, I just wanted to be sure I wasn't missing something obvious. ;)
00:50 jdoe oh, it... does work, there's just a bug? Even better.
00:50 sri whole thing is a bit tricky
00:50 sri it's easy to fix on the server side
00:51 sri but Mojo::UserAgent->post_form support will have to wait
00:52 jdoe ah. Yeah, I keep forgetting there's a UA as well, I was asking about the server side.
00:57 * jnbek is away: Auto-away after 2 mins idle (gone at 9th Jan, 00:57:23)
01:06 jnbek joined #mojo
01:07 jdoe sri: awesome, thanks
01:08 good_news_everyone joined #mojo
01:08 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/Wmc86A
01:08 good_news_everyone mojo/master 07475c1 Sebastian Riedel: fixed support for multiple uploads in Mojolicious::Controller
01:08 good_news_everyone left #mojo
01:08 good_news_everyone joined #mojo
01:08 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/k_-2dA
01:08 good_news_everyone mojo/master 5765f32 Sebastian Riedel: bump version
01:08 good_news_everyone left #mojo
01:08 sri jdoe: and fixed
01:09 sri the test looks a bit funny though ;p
01:09 sri https://github.com/kraih/mojo/commit/07475​c13a9ab5332ab854afbb165a3ca0a72fce2#L2R92
01:09 hlin joined #mojo
01:10 sri you can always build odd requests manually... but it would be nice to have support for this in Mojo::UserAgent::Transactor->file
01:10 Mike-PerlRecruiter_ joined #mojo
01:10 sri no clue how it would fit in there though
01:11 sri pull requests welcome! :)
01:11 Koterpillar joined #mojo
01:12 sri perhaps something like ->file('/same_name' => {foo => [{content => 'bar'}, {content => 'baz'}]}) or so
01:13 sri the trick will be to make it work with clean code ;p
01:16 jdoe works perfectly, thanks.
01:19 diegok jdoe: the problem with multiple uploads is it's easy to reach max body size :-/
01:20 diegok jdoe: fine tune your server if you use one on top of your mojo app ;-)
01:22 sri this method really could use a cleanup https://github.com/kraih/mojo/blob/mast​er/lib/Mojo/UserAgent/Transactor.pm#L33
01:23 ka2u joined #mojo
01:25 sri (please someone volunteer!)
01:27 Koterpillar How do I make an (honest) HTTP request to my own application from inside the application?
01:28 Koterpillar $ua->get(...) just hangs there
01:29 sri make it non-blocking
01:36 Miked joined #mojo
01:40 egopro joined #mojo
01:40 Averna joined #mojo
01:48 jdoe diegok: yeah. I haven't decided what's reasonable. Image upload, so a couple of files at a meg or two per file is probably where I want to tap out. I'm not sure yet.
01:58 d4rkie joined #mojo
02:00 Koterpillar AnyEvent::HTTP::LWP::UserAgent works if I run it under 'myapp.pl daemon', but not if I manually start it with $daemon->start().
02:03 Caelum Mojo::UA can do non-blocking requests, why do you need AE?
02:06 Koterpillar it's used in too many places now to make it non-blocking :(
02:19 sri make a second instance
02:20 sri helper myua => sub { state $ua = Mojo::UserAgent->new };
02:20 sri voila
02:22 duncanthrax joined #mojo
02:26 * tempire is a second instance
02:28 trone joined #mojo
02:30 Koterpillar sri, if I understand it right, this is still the same Mojo::UserAgent?
02:43 good_news_everyone joined #mojo
02:43 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/s8xzeA
02:43 good_news_everyone mojo/master 13c4e85 Sebastian Riedel: added support for multiple uploads sharing the same name to Mojo::UserAgent::Transactor
02:43 good_news_everyone left #mojo
02:43 sri ok, that's a lot better :)
02:45 sri jdoe: now also testable
02:47 * sri likes the code a lot more now
02:47 jdoe haha.
02:51 laouji joined #mojo
02:53 tempire neat
02:55 good_news_everyone joined #mojo
02:55 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/sK31Hg
02:55 good_news_everyone mojo/master 7d5b29c Sebastian Riedel: small optimizations
02:55 good_news_everyone left #mojo
03:06 esskar_ joined #mojo
03:09 bizam joined #mojo
03:09 * jnbek is away: Auto-away after 2 mins idle (gone at 9th Jan, 03:09:57)
03:11 sri jnbek`afk: turn that off please
03:18 noganex_ joined #mojo
03:20 bizam joined #mojo
03:30 jnbek joined #mojo
04:09 dotan joined #mojo
04:15 Averna joined #mojo
04:21 laouji_rouge joined #mojo
04:32 xaka joined #mojo
04:53 ka2u joined #mojo
05:06 egopro joined #mojo
05:07 ka2u joined #mojo
05:19 egopro joined #mojo
05:34 ver joined #mojo
05:39 Foxcool joined #mojo
05:52 Foxcool joined #mojo
06:01 d4rkie joined #mojo
06:18 egopro joined #mojo
06:20 ka2u joined #mojo
06:21 egopro joined #mojo
06:29 Vandal joined #mojo
06:30 Foxcool joined #mojo
06:43 Molaf joined #mojo
07:03 dpetrov_ joined #mojo
07:25 lammel2 joined #mojo
07:35 egopro joined #mojo
08:14 dod joined #mojo
08:19 egopro joined #mojo
08:19 egopro_ joined #mojo
08:24 suy joined #mojo
08:28 dod joined #mojo
08:29 ObseLeTe joined #mojo
08:30 alnewkirk joined #mojo
08:36 egopro joined #mojo
08:37 egopro joined #mojo
08:43 n0n joined #mojo
08:46 karel9 joined #mojo
08:58 ObseLeTe joined #mojo
09:14 dotan1 joined #mojo
09:15 bizam hi! which edit mode (AsciiDoc | Creole Markdown | MediaWiki | Org-mode | Pod | RDoc | Textile | reStructuredText) better for wiki page with bash scripts in content?
09:17 bizam i want to describe nginx + uwsgi(psgi) + perlbrew + mojolicious
09:19 ObseLeTe_ joined #mojo
09:21 lammel2 github uses a markdown flavor this is where the mojolilcious wiki is hosted
09:30 suy last time I checked, all pages exect the index were written in POD
09:31 bizam okay, mediawiki choose
09:53 SmokeMachine joined #mojo
10:05 arthas joined #mojo
10:32 Vandal joined #mojo
10:37 ryozi joined #mojo
11:02 xaka joined #mojo
11:02 egopro joined #mojo
11:21 perlite joined #mojo
11:25 nic haha -- seemed we needed a wiki for internal documentation -- but mojo pod rendering is so good that we might just use a line of ojo
11:25 nic after hours discussing merits of various wikis... "oh, that looks good" "what do you mean we already have it?"
11:26 kitt_vl joined #mojo
11:31 sri o/
11:37 yakubori joined #mojo
11:38 yakubori o/
11:47 mire_ joined #mojo
12:13 egopro joined #mojo
12:18 ObseLeTe joined #mojo
12:31 Vandal joined #mojo
12:37 bizam checks this https://github.com/kraih/mojo/wiki/nginx-&amp;-u​wsgi%28psgi%29-&amp;-perlbrew-&amp;-mojolicious
12:40 good_news_everyone joined #mojo
12:40 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/WpNeRg
12:40 good_news_everyone mojo/master dbf5f1d Sebastian Riedel: improved performance and memory usage of Mojo::EventEmitter
12:40 good_news_everyone left #mojo
12:45 sri in my worst case tests, this is a difference of 200 rps at 2800 rps average :o
12:46 ladnaV joined #mojo
12:53 good_news_everyone joined #mojo
12:53 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/DGANvA
12:53 good_news_everyone mojo/master ffe21fd Sebastian Riedel: slightly better diagnostics for Mojo::EventEmitter
12:53 good_news_everyone left #mojo
13:07 sri oh, i guess how we handle DATA sections is another feature unique to mojolicious
13:07 sri something other languages can't do
13:08 sri while ruby has a DATA section, it seems to be only available in the first ruby file invoked by the interpreter
13:11 Mike-PerlRecruiter_ joined #mojo
13:18 marty o/
13:18 marty bizam++
13:35 d4rkie joined #mojo
13:42 inokenty joined #mojo
13:46 jbnewman joined #mojo
13:47 Vandal joined #mojo
13:51 d4rkie joined #mojo
14:03 gryphon joined #mojo
14:17 bluescreen joined #mojo
14:31 labrown joined #mojo
14:40 dpetrov_ joined #mojo
14:43 davehorner joined #mojo
14:44 sivoais joined #mojo
15:14 davehorner joined #mojo
15:15 plicease joined #mojo
15:16 Britzel_ joined #mojo
15:37 yakubori so quiet today...
15:37 * yakubori drops a pin
15:37 arthas joined #mojo
15:42 * cfedde watches as the pin crashes through the glass floor.
15:44 basic6 joined #mojo
15:51 ObseLeTe joined #mojo
15:52 sri \o\
15:52 sri /o/
15:53 marty \o/
15:54 vervain For strings why do I feel like there is something more sensible than: ( ( $var1 && !$var2 ) || ( $var2 && !$var2 ) ); which is basically an XOR
15:54 vervain Whoops...
15:57 ObseLeTe joined #mojo
15:58 jberger ( !! $var1 + !! $var2 ) % 2
15:59 arthas joined #mojo
16:00 jberger sub xor ($$) { (!! $_[0] + !! $_[1]) % 2 }
16:01 cfedde the world famous !! operator.
16:03 sri i think adobe is just messing with us now http://www.adobe.com/downloa​ds/cs2_downloads/index.html
16:04 sri public statement: we are not giving away cs2 for free... website: downloads with serial numbers and no disclaimer
16:04 vervain I was being drunken in several ways, but thanks for ideas.  My actual solution it seems was !!$v1 == !!$v2
16:09 ruz joined #mojo
16:21 rem_lex joined #mojo
16:23 basic6 joined #mojo
16:24 nicomen_ vervain: what did you really want to do?
16:25 vervain I really wanted to do  !!$v1 == !!$v2 :-)  They are both true or they are both false
16:26 mattastrophe joined #mojo
16:26 yakubori !! forces a "bool" in perl?
16:27 vervain It forces truethy/falsy evaluation of the string.
16:29 vervain e.g. this probably isn't what was meant:  perl -E 'say "foo" == "bar" ? "yep" : "nope"'
16:29 vervain Sorry _this_ is probably not what is meant:  perl -E 'say "foo" == "" ? "yep" : "nope"'
16:36 egopro joined #mojo
16:41 xaka joined #mojo
16:45 egopro joined #mojo
16:58 suy vervain: how do you relate that sentence with "!!" ? (excuse my noobiness)
17:00 sri yakubori: yes, it is a bool
17:01 vervain An author such as me probably meant: perl -E 'say !!"foo" == !!"" ? "yep" : "nope"'
17:02 sri internally they are special constants, sv_yes and sv_no
17:03 sri if there was a Scalar::Util::isbool() we could get rid of those ugly bool modules we use for serializers
17:04 suy vervain: in this case, isn't "eq" more readable? I remember using !! in some JavaScript situation, but I can't remember which right now.
17:04 suy but it was the same, force truthiness
17:10 vervain In my algorithm I don't care if the strings are 'eq' though, just that they are truthy.
17:11 vervain I think eq would work in this case but to me it's just not quite semantically correct after the !!
17:14 suy ah, ok, good point.
17:19 njlg joined #mojo
17:24 ObseLeTe_ joined #mojo
17:36 ObseLeTe joined #mojo
17:41 jberger_ joined #mojo
18:10 ObseLeTe joined #mojo
18:11 ObseLeTe joined #mojo
18:13 ObseLeTe joined #mojo
18:16 bc547 joined #mojo
18:51 ObseLeTe_ joined #mojo
19:23 Caelum yay, abh merged my TtRenderer fix
19:31 PanzerBjorn joined #mojo
19:32 PanzerBjorn Is there any way to pass additional parameters through an <%= include 'footer' %>besides title and format? Any way to pass my own params to it's stash?
19:34 PanzerBjorn I.e. I tried this line and it errors out on me: <%= include 'header', title => $title, extra_header_content => $extra_header_content %>
19:39 yakubori whoa, the mojolicious site runs using ::Lite! :)
19:44 yakubori sounds like you need layouts, PanzerBjorn
19:45 PanzerBjorn Using layouts already. That's the issue, it seems.
19:45 PanzerBjorn Can't pass values from templates to layouts.
19:46 sri PanzerBjorn: what does "error out" mean?
19:46 sri include is nothing else than a partial render with localized stash values
19:47 sri so it should just work
19:47 PanzerBjorn It says the value is undefined when I try to pass it through the include.
19:48 sri then you're doing something wrong
19:49 PanzerBjorn Uh, yeah, that's why I'm here asking for help. I couldn't find any documentation online about passing extra params/values via include.
19:50 rhaen_http joined #mojo
19:50 sri title is nothing else than a normal stash value, so if that works everything else does
19:50 PanzerBjorn My route calls a template which has layout info. In the layout, there is no access to the stash that the template had. How can I pass template values to the layout and have the layout pass them down in include?
19:51 PanzerBjorn % layout 'default'; % title $self->siteinfo->{name} ." Test Form";
19:51 PanzerBjorn that's in the top of my header. If I try to set another value like % somevalue "This is a test" it errors.
19:52 PanzerBjorn So how can I pass some data from the template to the layout?
19:54 Caelum PanzerBjorn: perhaps you can put up a small example on a gist that shows the behavior you are seeing? of a small ::Lite app
19:54 PanzerBjorn This isn't a Lite app, it's a full app./
19:56 Caelum right, but it's more productive to provide a test case rather than just arguing "this does X" "no it does Y"
19:56 PanzerBjorn Test case isn't very useful when I'm not even sure 1) it's possible or 2) if it is, how to do it.
19:57 PanzerBjorn I just assumed "Oh I can set title with % title "Some Title" so that means I can set anything like that." Apparently not.
20:21 Caelum I have an idea, can "use Mojo::Base 'foo';" automatically do an: "use mro 'c3';" since 5.10 is the minimum anyway
20:22 sri we don't do multiple inheritance in mojolicious
20:22 ObseLeTe joined #mojo
20:23 Caelum so I should use SUPER:: instead of next::method
20:23 Caelum ok
20:26 sri is there a performance difference between next::method and SUPER for single inheritance?
20:27 Caelum that's an interesting question, I'll do a simple benchmark and see
20:33 xaka joined #mojo
20:35 Caelum sri: SUPER:: is significantly faster: http://gist.github.com/4496686
20:36 lukep joined #mojo
20:36 sri good to know
20:41 plicease joined #mojo
21:08 good_news_everyone joined #mojo
21:08 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/gJN1DQ
21:08 good_news_everyone mojo/master ae43ebb Sebastian Riedel: better Mojo::UserAgent::Transactor tests
21:08 good_news_everyone left #mojo
21:13 good_news_everyone joined #mojo
21:13 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/c1xMvw
21:13 good_news_everyone mojo/master d7e5ae2 Sebastian Riedel: test tweaks
21:13 good_news_everyone left #mojo
21:47 good_news_everyone joined #mojo
21:47 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/Xb6_4Q
21:47 good_news_everyone mojo/master f951c2e Sebastian Riedel: small optimizations
21:47 good_news_everyone left #mojo
21:55 laidback_01 joined #mojo
22:16 sri i'm still on the edge about deflate compression, not sure if we should support it in Mojo::UserAgent
22:42 bluescreen joined #mojo
22:57 Caelum what do you guys think about making ->respond_to use the Content-Type header if the Accept header isn't set and a format param isn't available, which is what C::C::REST does
22:57 sri it's bad REST imo
22:59 Caelum it doesn't bother me all that much, just something that I noticed :)
23:01 sri if you really want it you can make a plugin
23:02 Caelum I'm ok with just telling the API users "you have to send an Accept header"
23:28 asarch joined #mojo
23:32 good_news_everyone joined #mojo
23:32 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/y61mfg
23:32 good_news_everyone mojo/master 5db7e0f Sebastian Riedel: changed port of example application from 3000 to 8080
23:32 good_news_everyone left #mojo
23:34 davehorner joined #mojo
23:34 Foxcool joined #mojo
23:35 BeDa joined #mojo
23:51 jzawodn joined #mojo
23:57 good_news_everyone joined #mojo
23:57 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/nEhHXA
23:57 good_news_everyone mojo/master 2f33548 Sebastian Riedel: made form generation a little more predictable
23:57 good_news_everyone left #mojo
23:59 good_news_everyone joined #mojo
23:59 good_news_everyone [mojo] kraih tagged v3.76 at 2109e15: http://git.io/_-E46Q
23:59 good_news_everyone left #mojo

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