The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2014-08-04

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

All times shown according to UTC.

Time Nick Message
00:00 preaction dima: i think you add another =, so <%==
00:00 preaction i think there's up to 3 =
00:00 dima preaction: but then won't my <> not get quoted?
00:00 dima I want the output as seen in the browser to look just like the original string, so the <> and the \n need quoting
00:01 preaction oh wait, whitespace is trimmed because of =%>
00:01 preaction looks like you can disable escaping via <%= b('whatever') %>, but dunno. never tried any of this at all
00:02 dima preaction: thanks. In the HTML output the \n is simply left as is, and when the browser renders the HTML, it strips it
00:02 preaction in your css: white-space: nowrap; on the element in question
00:02 preaction or one of the various other white-space properties
00:02 preaction don't use <br/>, please
00:03 dima preaction: I was hoping there was some magic mojolicious function I call, or something
00:03 preaction why? the browser is doing it
00:03 dima preaction: I'm really not a web dev, to be clear, so a bit out of my element. So far Mojolicious has been pretty good about not making me learn this :)
00:04 dima preaction: yes, the browser is doing it, but the browser also interprets <>, but mojolicious sees it as acceptable to deal with those, no?
00:04 preaction i am a web dev, so i like that mojolicious doesn't try to hide things (hiding things means i can't fix them when they are broken)
00:04 preaction because it's only us, you don't need to use my name
00:05 preaction mojolicious has a sane default for escaping. preformatted whitespace is a rather rare need
00:05 preaction it is literally as easy as either: using a <pre> tag, or <elem style="white-space: pre"> or <elem style="white-space: pre-line">
00:06 dima ah. ok
00:06 dima let me try that
00:06 dima thanks
00:07 preaction https://developer.mozilla.org/en-US/docs/Web/CSS/white-space <- here are the various white-space things you can do
00:07 dima it works!
00:07 dima thank very much!
00:07 dima I'm going to look at that link now
00:08 preaction longer-term, you should probably give the element a "class", which then has "white-space: whatever" assigned to it, in a CSS file, which you include via <link ... />, but that's veering into best practices territory, which depends on how long-term the project is
00:09 dima ok. thank you very much, again
00:11 davido__ joined #mojo
00:23 woz joined #mojo
00:29 dima left #mojo
00:30 d^_^b phillipadsmith: are you sure you don't mean $self->res->json?
00:31 dj_goku phillipadsmith: also you can just add the status code to render $self->render(json => { something => 'value' }, status => 200);
00:31 phillipadsmith d^_^b: Not sure? I got it working using $self->res->json but my JSON data was bad, hence the problem.
00:31 dj_goku right, but your example is using ->req
00:31 * phillipadsmith looks
00:32 phillipadsmith dj_goku: Well, in that example, am I not looking at the request?
00:33 phillipadsmith Sorry, getting confused ...
00:33 phillipadsmith This is working: https://gist.github.com/phillipadsmith/fe8a4bb9341118f1eff0
00:34 phillipadsmith So, in this case, I'm wanting the request content, no?
00:36 dj_goku it is a response.
00:42 phillipadsmith dj_goku: I don't think I'm fully following, because if I dump $self->res in that route, I just see a Mojo::Message::Response object with an undef json property …?
00:43 phillipadsmith The route is anticipating a put/post with a JSON body
00:43 phillipadsmith Would that not be in $self->req->json ?
00:46 sri jberger, batman, tempire, marcus, crab: i guess this is arguable... but since powerman filed the issue i'm trying to avoid discussions... if you have an opinion please get involved https://github.com/kraih/mojo/issues/663
00:49 tempire having $ua be undef in such a case is an interesting idea
00:49 dj_goku phillipadsmith: oh sorry, I am gettin them mixed up. :D
00:49 dj_goku you are right. :)
00:49 phillipadsmith dj_goku: Phew!
00:49 * phillipadsmith wipes sweat from brow
00:50 phillipadsmith I'm so used to sri telling me I'm wrong that I rarely think I'm right anymore. ;)
00:51 dj_goku haha. You shouldn't listen to me then, because I am pretty new at this too. :D
00:51 dj_goku I was thinking of this: $t->tx->res->json. :D
00:51 dj_goku in my tests
00:52 sri phillipadsmith: you're wrong!
00:52 phillipadsmith sri: :-P
00:52 sri let me just quickly look for a reason why
00:52 phillipadsmith I'm sure, in some way, I am… but I'll take "done" over "perfect" any day. :)
00:53 sri oh... you blamed JSON... but that is NOT JSON!
00:53 sri \o/
00:54 phillipadsmith LOL
00:59 woz joined #mojo
01:10 laouji joined #mojo
01:24 sri i wonder what's the lesser evil, issues that are closed too quickly, or issues that stay open forever
01:26 sri often i feel bad for dismissing issues with a one-liner, but if i didn't do that nobody would deal with them
01:27 sri looking through other big projects... i'm starting to wonder if the forever open issue is a good thing
01:28 preaction possible corrolary: manpages have KNOWN BUGS sections, which really act more like diagnostics or "watch out!"
01:28 preaction but a closed bug works as well as an open one there, i guess
01:30 sri https://github.com/kraih/mojo/pull/661 # with pull requests like this one, i always wonder if i just saved him time or scared him away from the project
01:34 sri would be nice to have a few people actively monitoring and handling issues
01:36 sri i'm sure being so harsh about no feature/support requests on github also scares a few people away, but those issues would currently just get ignored
01:36 woz joined #mojo
01:38 klapperl_ joined #mojo
01:41 avenj some canned responses with pointers ('lacks tests and docs, perhaps see <foo> for an example of a workable PR' and such) can perhaps be helpful regardless of open/closed
01:42 sri i'm using canned one-liners atm. https://github.com/kraih/mojo/issues/638#issuecomment-47213062
01:45 sri it's pretty much all in the contributing guide... but we are dealing with a lot of beginners... that can't handle the etiquette yet
01:49 good_news_everyon joined #mojo
01:49 good_news_everyon [mojo] kraih pushed 2 new commits to master: http://git.io/1J_jjg
01:49 good_news_everyon mojo/master 7bea66d jamadam: fixed typo
01:49 good_news_everyon mojo/master 11f9d5e Sebastian Riedel: Merge pull request #664 from jamadam/master...
01:49 good_news_everyon left #mojo
01:50 sri if only every issue was as easy as that pull request :)
01:51 sri jberger, batman, marcus, tempire, crab: maybe we need some sort of actual issue handling strategy
01:52 sri like... what's the most friendly way to deal with issues?
01:53 KCL joined #mojo
02:09 woz joined #mojo
02:12 noganex joined #mojo
02:40 dj_goku sri: If I knew the framework better I wouldn't mind helping, but right now I feel like I am spinning my wheels but not making much progress.
02:43 woz joined #mojo
03:19 woz joined #mojo
03:27 basic6 joined #mojo
03:28 asarch joined #mojo
03:32 asarch When I do $r->get('/students/add')->to('student#add'); I use the sub called "add" at the MyApp::Student.pm file, right? How can I use the sub "add" in the MyApp::School::Student.pm module?
03:34 asarch $r->get('/school/students/add')->to('school#student#add'); doesn't work
03:37 Averna joined #mojo
03:40 preaction i think you can use the full version: controller => '...'. not sure what the method part is, method => 'add' maybe?
03:40 crab action
03:41 crab does school_students#add work?
03:43 asarch No, it didn't work
03:45 asarch The code is at lib/MyApp/School/Student.pm
03:45 asarch I also have (for the index for /school/students
03:46 asarch I mean, I also have (for the index for /school/students): lib/MyApp/School.pm
03:46 asarch This index works fine
03:51 crab sorry, i meant school-students
03:51 crab school-students#add should be translated to School::Students::add
03:54 woz joined #mojo
03:57 dabudabu joined #mojo
04:01 asarch THANK YOU!!!
04:01 asarch Thank you very much :-)
04:01 asarch It worked!
04:01 purl What do you mean it worked? Did it run to completion? Did it bomb out early? Did it finish the job early? Did it tell your girlfriend "let's just be friends"? Be specific!
04:08 asarch Well, now I can visit /school/students/add
04:14 asarch lol purl
04:30 woz joined #mojo
05:00 laouji joined #mojo
05:02 jberger_ sri: well when in doubt always appeal to policy
05:02 jberger_ That way the response is not personal
05:05 jberger_ As to individual issues, i think that open for a few days (ostensibly "for comment") isn't the same thing as open forever
05:05 woz joined #mojo
05:05 jberger_ Anyway, I'm about to do three flights to get home, not sure how around I'll be in the next few days
05:06 jberger_ All good things (like vacation on a tropical island) must end
05:13 sugar joined #mojo
05:37 mr-foobar joined #mojo
05:41 woz joined #mojo
05:47 sujithm joined #mojo
06:10 batman joined #mojo
06:10 marcus joined #mojo
06:11 irq joined #mojo
06:11 jberger_ joined #mojo
06:15 woz joined #mojo
06:19 denis_boyun joined #mojo
06:19 _eugen joined #mojo
06:51 woz joined #mojo
06:57 dod joined #mojo
07:04 batman hope my comment here is ok: https://blog.afoolishmanifesto.com/posts/concurrency-and-async-in-perl/
07:11 marcus very ok.
07:13 batman cool :)
07:13 batman maybe i should remove the "error" event from the example echo server...
07:14 sujithm joined #mojo
07:18 Dandre left #mojo
07:27 woz joined #mojo
07:32 basiliscos joined #mojo
07:38 trone joined #mojo
07:39 Vandal joined #mojo
07:42 neyasov joined #mojo
07:58 Mad_Dud joined #mojo
07:59 Mad_Dud hi guys, can I choose cyphers (disable rc4) used by hypnotoad in ssl traffic?
08:01 woz joined #mojo
08:02 batman Mad_Dud: yes, listen to https://*:8080?tls_ciphers=...
08:02 batman tls_ciphers is the same as https://metacpan.org/pod/distribution/IO-Socket-SSL/lib/IO/Socket/SSL.pod#SSL_cipher_list
08:02 batman or maybe i'm completely lost :(
08:02 batman look at the parameter list under https://metacpan.org/pod/Mojo::Server::Daemon#listen
08:09 Mad_Dud batman: awesome!
08:17 batman cool :)
08:37 edestler joined #mojo
08:50 neyasov joined #mojo
09:07 dexteruk_ joined #mojo
09:09 sujithm joined #mojo
09:24 ua joined #mojo
09:27 sujithm joined #mojo
10:04 d4rkie joined #mojo
10:33 d4rkie joined #mojo
10:37 sujithm joined #mojo
10:58 og01 joined #mojo
11:08 Kripton joined #mojo
11:23 sri jberger: the reminded me of you :) http://xkcd.com/1403/
11:40 mr-fooba_ joined #mojo
11:42 D4RK-PH0ENiX joined #mojo
12:04 batman sri: i would like to discuss issue strategy some day... i would like if we could use labels more active to mark why a given issue is rejected or similar categories
12:06 batman https://github.com/kraih/mojo/issues/660 # should at least have "rejected" or "invalid" label imo.
12:08 batman hm... i can't come up with any other atm :P
12:08 batman my brain lost track
12:25 sri that's not a good way to end a proposal :o
12:26 batman that my brain lost track?
12:28 sujithm joined #mojo
12:28 * sri nods
12:29 batman yeah. co-workers are back. they confuse me :(
12:29 * batman plugs into soundcloud again
12:29 sri jberger: last time i tried leaving issues open they just got ignored for weeks
12:30 batman sri: i would close them, but with a label.
12:45 sri batman: how is that any friendlier?
12:45 batman sorry. didn't know we discussed "friendly".
12:45 sri you might want to reread what i wrote earlier
12:45 batman i don't care much about friendly. i do believe closing issues with a feedback is "fair" (like you do now)
12:46 batman when should i read back from?
13:01 marcus I would prefer to be fair *and* friendly.
13:04 batman i don't think "unfriendly" is the opposite of not being friendly... i mean, being fair and neutral is not friendly, nor unfriendly imo
13:04 batman i think wasting time keeping tickets open instead of giving a constructive feedback is good.
13:04 batman uhm... i will try to write that last sentence again
13:05 batman i think closing a ticket with good feedback is a time saver.
13:07 marcus Not saying it's hostile to close tickets, but you said "I don't care about friendly" <- I think that's not a very healthy attitude.
13:07 marcus (for the project).
13:08 batman i care more about fair, than friendly.
13:09 batman i hope that's more accurate...
13:09 nicomen how about "informative" :)
13:09 marcus I care about being fair in a friendly manner =]
13:09 batman marcus++
13:15 sujithm joined #mojo
13:22 sujithm_ joined #mojo
13:27 batman not sure how to discuss this without coming out wrong :(
13:27 batman i just don't think closing issues is a bad thing if they don't make sense or are "invalid"
13:27 batman but closing without a comment would be bad (but i haven't seen that)
13:41 sh3 joined #mojo
13:45 zivester joined #mojo
13:46 sri yea, the big problem is to close issues friendlier... without it just turning into a collection of indefinitely open issues
13:46 sri i know, if i had to write something personalized and encouraging for every issue i intend to close... i'd just leave them open
13:47 sri only an army of volunteers could handle that
13:47 nicomen what's wrong with a friendly: "No."
13:47 nicomen :)
13:49 genio "This 'no' is friendly. Your request is getting closed."
13:49 sri batman: the point is not to scare people away from contributing to the project, looking back, i believe many give up after their first attempt failed
13:50 nicomen is the real reson that people propose things that do not follow some charter (that they don't know about) ?
13:50 nicomen or just merely insane shit?
13:50 sri dunno
13:51 sri often i guess it's also language barrier
13:52 sri i wish our asian users weren't so isolated
13:52 neilhwatson joined #mojo
13:53 sri especially translated japanese tweets are often really interesting
13:53 KCL_ joined #mojo
13:58 moritz just learn Japanese, Mandarin and Korean, and you'll be fine :-)
14:02 genio we need universal translators like star trek
14:02 diegok o/
14:03 diegok does anybody knows if it's valid to name an id attribute with a dot?, example <span id="my.id">
14:04 genio first SO answer seems to say no
14:05 nicomen http://mathiasbynens.be/notes/html5-id-class
14:05 sri genio: voice mode of google translate on android is pretty mindblowing these days
14:06 genio diegok: http://stackoverflow.com/questions/448981/what-characters-are-valid-in-css-class-selectors   yet further down someone says it IS valid
14:06 nicomen http://www.w3.org/TR/html401/types.html#type-name
14:06 diegok I've found that on the wild but can't select that with Mojo::DOM::CSS :-(
14:07 sri of course you can
14:07 sri read up on selector escaping
14:07 diegok nicomen & genio: thank's for your links!
14:07 diegok sri: oh!, I'll :-)
14:07 sri pretty sure there's even a dot example in the docs somewhere
14:08 sri ah, it's a : example http://mojolicio.us/perldoc/Mojo/DOM#namespace
14:09 Dandre joined #mojo
14:11 sri batman: not sure this layer should be promoted like that https://gist.github.com/jhthorsen/076157063b4bdaa47a3f
14:11 sri at the end of the day it only serves mojolicious core, and we will reject new features that don't get used in core
14:12 sri like, some people really like the whole push_read thing where you say how many bytes you want, mojolicious doesn't benefit from that, so it has been rejected so far
14:17 * sri still wonders if this version of reduce is useful enough to add it https://gist.github.com/anonymous/877edc7e547466ce2ad2
14:17 nicomen win 39
14:17 sri https://gist.github.com/anonymous/5abb5d13dcab31646ea5
14:17 sri nicomen: fail 39
14:18 diegok sri: https://gist.github.com/diegok/ab8997490fae7e3f304c :-/
14:18 nicomen hehe
14:23 genio diegok: not that it resolves your issue, but your markup in there has : twice instead of : and .
14:24 diegok genio: thanks. I've fixed the example. Same results :-(
14:28 genio diegok: this works: https://gist.github.com/anonymous/51a5ca302d58ac927056
14:29 batman sri: why won't you promote server()? it's awesome :)
14:29 sri batman: keep reading -.-
14:29 sri diegok: could be a bug
14:29 purl No, it's a feature.
14:30 diegok genio: nice :-)
14:30 batman sri: today is not my day :(
14:31 * batman still think server() is sweet
14:32 genio My cursory glance at dom.t showed tests for attributes with all sorts of values like that, but I didn't really see much just using the id (#) accessor
14:34 diegok sri: looks like it won't accept dots neither for classes: https://github.com/kraih/mojo/blob/master/lib/Mojo/DOM/CSS.pm#L17
14:34 sri diegok: already have a fix ;)
14:34 diegok ahaha!
14:35 sri but i first had to confirm in the grammar http://www.w3.org/TR/css3-selectors/#w3cselgrammar
14:38 diegok oh!, that grammar doc is what I wanted first!. Thanks, I'll keep it on my box :)
14:40 sri it's not actually a good grammar
14:40 sri rather confusing
14:41 good_news_everyon joined #mojo
14:41 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/1crJhg
14:41 good_news_everyon mojo/master df23566 Sebastian Riedel: fixed escaping bugs in Mojo::DOM::CSS
14:41 good_news_everyon left #mojo
14:44 diegok sri++
14:50 neilhwatson joined #mojo
14:51 Jonneh Dumb question time! I have this mojo site where I occasionally want to download some big zip files of my data, is it possible to simultaneously stream data from my db into a zip in memory, and then stream that zip to the client so they dont have to wait for a zip file to be generated and then downloaded?
14:53 meshl joined #mojo
14:54 sri batman, jberger, marcus, tempire, crab: yay or nay? https://gist.github.com/anonymous/0032e08946d279167075
14:55 crab can i just say "yes"?
14:55 sri crab: nay
14:58 crab (it should actually be yea or nay)
14:59 sri you're a hater!
15:02 cfedde my $json = $self->render( json => {%result}, partial => 1 ); # is in some instant legacy.  Apparently it used to return some json.  Now it returns 1.
15:03 * tempire yays and yeas
15:03 tempire and yeah'a
15:03 tempire and OHNOYOUDIDNT
15:04 * tempire snaps
15:05 cfedde I suppose I could just use Mojo::JSON there.
15:06 sri cfedde: 5.0 changelog
15:06 cfedde kk
15:07 sri cfedde: or https://groups.google.com/forum/#!topic/mojolicious/PYfjHyVj26w
15:07 cfedde sri: thanks!
15:09 good_news_everyon joined #mojo
15:09 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/I9YelA
15:09 good_news_everyon mojo/master 3c18fa3 Sebastian Riedel: added reduce method to Mojo::Collection
15:09 good_news_everyon left #mojo
15:09 disputin joined #mojo
15:10 sri i wish we could support signatures more prominently i some form
15:10 sri but there's actually problems with just activating it in Mojo::Base for Perl 5.20
15:11 sri we do use a few prototypes :o
15:12 sri this one is a real blocker https://github.com/kraih/mojo/blob/master/lib/Mojolicious/Lite.pm#L41
15:13 dod joined #mojo
15:14 sri i guess there could be two versions... one using the old form and one with :prototype(&)
15:14 sri this one is less of a problem https://github.com/kraih/mojo/blob/master/lib/Mojo/Util.pm#L284
15:15 sri there it's more of a convenience, so you can use it as a dropin replacement for time
15:17 batman +1 on reduce.
15:27 sujithm joined #mojo
15:30 sujithm_ joined #mojo
15:54 tempire to be clear, I'm +1 on reduce
15:54 tempire reduce is teh awesome
16:00 davido_ joined #mojo
16:01 batman i think it will be very useful in my scraper software :)
16:03 sri tempire: figured as much :)
16:03 sri and jberger is +1 anyway
16:06 denis_boyun joined #mojo
16:25 irq joined #mojo
16:30 neyasov joined #mojo
16:46 batman i've written basic operation tests for Mojo::Redis2 now: https://github.com/marcusramberg/mojo-redis/blob/v2/t/all-basic-operations.t
16:46 batman can someone give me feedback on the TODO tests?
16:47 batman marcus..?
16:47 purl hmmm... marcus is pretty sure lisp adoption is being hampered by being named after a speech defect. or http://picasaweb.google.com/olga.ramberg/Lisboa#5240395957801479314 or a moose farmer?
16:50 batman also...i'm not sure if start_server() should be part of that package. maybe i should move it...
16:51 * sri wonders if intial value first or last is better... ->reduce(sub ($a, $b) { $a->{$b}++; $a }, {}) or ->reduce({} => sub ($a, $b) { $a->{$b}++; $a })
16:52 sri ->reduce(5 => sub { shift()  + shift() })
16:52 sri ->reduce(sub { shift()  + shift() }, 5)
16:54 sri ->reduce(5, sub { shift()  + shift() })
17:08 crab batman: i remember that sri pasted some gist not too long ago to do <something with methods and packages> that you released as a cpan module. can you point me at it, please?
17:14 crab refine, perhaps
17:16 crab thanks
17:29 batman crab: yes, refine :)
17:39 dod joined #mojo
17:41 good_news_everyon joined #mojo
17:41 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/k8QCbg
17:41 good_news_everyon mojo/master a613a7d Sebastian Riedel: the initial value is the first argument
17:41 good_news_everyon left #mojo
17:44 denis_boyun_ joined #mojo
17:59 risugg I've never done CORS before but need it in dev mode. Have I done everything I need to do on the mojo side to enable CORS? https://gist.github.com/richardsugg/e00e47e56d9357d63385
18:05 risugg i see the OPTIONS go through and return with 200, but then I get an error about CORS in firebug
18:14 sugar_ joined #mojo
18:22 neyasov joined #mojo
18:24 sri hahaha https://twitter.com/fishmanpet/status/496338863573307392
18:34 risugg re: cors - didn't realize I had to specify each header instead of wildcarding them. Got it working.
18:45 good_news_everyon joined #mojo
18:45 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/3sc-PA
18:45 good_news_everyon mojo/master a37d767 Sebastian Riedel: a few more tests for escaped selectors
18:45 good_news_everyon left #mojo
18:46 basiliscos joined #mojo
19:17 dvinciguerra joined #mojo
19:21 disputin joined #mojo
19:33 Adura joined #mojo
19:50 denis_boyun joined #mojo
20:05 davido__ joined #mojo
20:11 asarch joined #mojo
20:11 asarch May I suggest a new motto for Mojo?: "Beyond the limit"
20:11 asarch :-)
20:12 sri "Mojo: What limit?"
20:17 asarch Exactly!
20:17 asarch With no limit at all
20:18 asarch And with Mojolicious you go beyond this "limit"
20:18 asarch Just like with Perl
20:28 dvinciguerra joined #mojo
20:31 punter joined #mojo
20:43 bobkare joined #mojo
20:44 rwp joined #mojo
20:47 neyasov_ joined #mojo
20:49 neyasov__ joined #mojo
20:50 doby Mojolicious: Know No Limits
20:50 bobkare joined #mojo
20:54 neyasov___ joined #mojo
20:57 umi joined #mojo
20:59 umi When I store data in a SESSION, it is stored in the user's cookie with an HMAC.  However I'd like to save the state on the server, and just give the user an ID.
20:59 umi Is that possible?
21:03 marty joined #mojo
21:11 umi Is there nothing similar to the PHPSESSID where data is stored on the server, and the user only has an session ID?
21:13 asarch "No limit" means you stay behind it, "beyond the limit" means you go further ;-P
21:13 asarch Have a nice day gentlemen
21:54 * jberger is home
22:28 bobkare joined #mojo
22:38 bobkare joined #mojo
22:46 bobkare joined #mojo
22:46 umi joined #mojo
22:46 umi Is there a way to store SESSION data server side instead of client side?
22:46 woz joined #mojo
22:47 firnsy umi: yes there is, Mojolicious::Plugin::ServerSession is one way of doing that
22:48 umi firnsy: Sweet!  I've been looking around forever
22:50 firnsy umi: your google-fu is very weak then ... "mojolicoius server session" that plugin is the first hit ;)
22:55 umi Oh noes!
22:55 umi Thanks, cya later
22:59 sri jberger: welcome home, i'd still like to hear a yay or nay from you for ->reduce :)
23:02 jberger It looks like $a and $b don't work, am i correct?
23:02 sri you're correct
23:03 sri at least not without signature
23:03 jberger Right
23:03 jberger Yeah I'm +1
23:03 sri https://gist.github.com/anonymous/877edc7e547466ce2ad2
23:03 sri that was my example from yesterday
23:03 jberger As you expected
23:03 sri \o/
23:04 jberger signatures gives a good solution to that problem
23:04 jberger (arguably better than $a and $b)
23:04 sri yea, i like signatures more
23:06 sri i've made a little change since yesterday though, the initial value goes first now https://gist.github.com/anonymous/179d74b99c2661773de8
23:07 * sri wonders if ojo needs a flag to activate signatures :)
23:07 bobkare joined #mojo
23:08 jberger Now i can update this again : http://stackoverflow.com/a/5195485/468327
23:08 jberger !
23:09 sri 5.25 is not out yet!
23:09 jberger Hehe
23:12 sri -Mexperimental=signatures is way too long :S
23:13 jberger sri: evil thought. Add a VERSION method to Mojo::Base which imports the perl version
23:14 sri signatures is not included there
23:14 jberger ORLY? hmm maybe not
23:15 sri we actually have stuff that conflicts with signatures
23:16 sri https://github.com/kraih/mojo/blob/master/lib/Mojolicious/Lite.pm#L41
23:16 jberger Prototypes? Those can be lexically enabled
23:16 sri what do you mean?
23:17 sri https://github.com/kraih/mojo/blob/master/lib/Mojo/Util.pm#L284
23:17 woz joined #mojo
23:18 jberger Well best to wait until they aren't experimental, but 'no feature'  works
23:18 sri perl5.12 -E 'no feature "signatures"'
23:18 sri Feature "signatures" is not supported by Perl 5.12.5 at -e line 1
23:18 jberger no if
23:19 sri oh
23:19 jberger Still on phone, or i would make a better example
23:20 * jberger has gotten about 1h of sleep in the last couple days
23:25 komodo joined #mojo
23:34 jnbek joined #mojo
23:39 d4rkie joined #mojo
23:46 sri jberger: what do you like more, initial value before or after the closure?
23:46 sri perl -Ilib -Mojo -E 'say r g("mojolicio.us")->dom("*")->type->reduce({} => sub { $_[0]->{$_[1]}++; $_[0] })'
23:48 jberger I always think that optional arguments should be on the end unless there is a compelling reason not to
23:49 jberger Plus, I'm some sense,  having the initializer after the function is more like the reduce function
23:49 sri that's true
23:50 komodo_ joined #mojo
23:51 bobkare joined #mojo
23:51 good_news_everyon joined #mojo
23:51 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/6fRFIw
23:51 good_news_everyon mojo/master 55936cf Sebastian Riedel: move initial value back after the callback
23:51 good_news_everyon left #mojo
23:52 woz joined #mojo
23:53 sri anyway, it's fun to play with this
23:53 sri perl -Mojo -E 'say r g("mojolicio.us")->dom("*")->attr->map(sub { keys %$_ })->reduce(sub { $_[0]->{$_[1]}++; $_[0] }, {})'
23:53 sri for a list of attributes in the document with count

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