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

IRC log for #mojo, 2014-11-26

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

All times shown according to UTC.

Time Nick Message
00:01 howitdo joined #mojo
00:12 disputin joined #mojo
00:19 tencendur joined #mojo
00:29 Averna joined #mojo
00:34 woz joined #mojo
00:55 KCL_ joined #mojo
01:01 woz joined #mojo
01:04 cfedde When I try to access $self->tx->req->content I'm getting the string "Mojo::Content::Single=HASH(0x6a09d08)"
01:04 cfedde What am I doing wrong?
01:08 cfedde ah: s/content/body
01:08 cfedde thanks!
01:08 tempire Indeed,->content is a Mojo::Content::Single object
01:11 * tempire has just fallen in love with adobe typekit
01:34 hesperaux joined #mojo
01:35 thowe joined #mojo
01:39 disputin joined #mojo
01:46 thowe Can you create dispatch chains that are more than two routes long?  Like /parent/child/grandchild   like  my $root = $r->under('/')->to('parent');  my $child = $root->under('/parent')->to('child'); $child->get('grandchild')->to('grandchild#index');
01:46 thowe Or something like that?
01:46 thowe so that code is executed in parent and child before grandchild?
01:51 disputin joined #mojo
01:57 Adura joined #mojo
02:11 thowe Holy crap I made that work with my first guess in how the syntax should work!  Stuff like that makes gives me the false hope that I am "getting it".
02:13 klapperl_ joined #mojo
02:48 KCL joined #mojo
02:53 franzkafka joined #mojo
02:53 franzkafka Hi all, I've found some examples of pluck on SO, but I was wondering if there are any examples of map since pluck is deprecated?
02:57 thowe They aren't putting up with our shit today.
02:57 franzkafka Ah, is there a bug or something?
02:58 thowe I don't know.  I exclaimed a bunch of stuff in the channel about ab hour ago and it's been quite.
02:58 thowe What map and/or pluck stuff are you tlking about.  Perl's map?
02:58 franzkafka No, Mojo::UserAgent.
02:59 thowe Oh.  I don't know much about it yet.
02:59 franzkafka I'm replacing pluck in my scripts with map, but having a few difficulties, so I was looking for any examples. I've read the documention on it, but still hitting a wall.
02:59 thowe I know that they have been writing some better examples for stuff lately...
03:00 good_news_everyon joined #mojo
03:00 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/Ce81Ig
03:00 good_news_everyon mojo/master 18fb677 Sebastian Riedel: allow WebSocket handshakes to fail more gracefully
03:00 good_news_everyon left #mojo
03:01 sri allright, that takes care of the inactivity timeouts
03:04 franzkafka :D
03:06 jberger thowe: you exclaimed that it worked as documented/expected :-) I'm not sure what we should say about that
03:08 thowe Nothing.  Although, I didn't see a multi-chain example.  But there is a strange consistency that somehow made sense to me.
03:09 thowe I'm always surprised when my expectations jive with reality when it comes to Mojo.
03:09 franzkafka OK, quick question. Say I have <h2>blah</h2>I love pain. Being whipped is a lot of fun.
03:09 thowe But that's also why I'm not offended to be ignored.
03:09 franzkafka Is there any way with CSS selectors to grab the text AFTER the <h2> element?
03:10 franzkafka The 'I love pain. Being whipped is a lot of fun.'
03:11 thowe franzkafka, Shouldn't it be wrapped in a <p>?
03:11 franzkafka It is not :D
03:12 thowe hm.  Is it correct markup then?
03:12 franzkafka thowe, it's not really something I have control over.
03:12 thowe I gather you don't have editorial control of the code you are playing with.
03:12 franzkafka thowe, exactly ;)
03:13 thowe is the text and h2 all under something else?
03:15 franzkafka Hrm, a div with class col-md-8
03:15 franzkafka one second
03:15 purl one second is second is the duration of 9,192,631,770 periods of the radiation corresponding to the transition between the two hyperfine levels of the ground state of the caesium-133 atom.
03:15 good_news_everyon joined #mojo
03:15 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/3U1Xog
03:15 good_news_everyon mojo/master 9f3bb31 Sebastian Riedel: handle advice more consistently
03:15 good_news_everyon left #mojo
03:17 jberger franzkafka: see the tree traversal methods, like next etc (I can't remember which one you need, and I'm busy elsewise atm)
03:17 sri quite a bit of legacy there, no wonder errors were triggering timeouts
03:17 franzkafka jberger, checking out next atm actually
03:17 franzkafka thanks man
03:17 franzkafka good luck with what you're busy with!
03:20 thowe will just the text be the next sibling element?
03:21 jberger franzkafka: https://github.com/TechEmpower/FrameworkBenchmarks/pull/1244
03:22 jberger that was the cause of all the shebang noise the other day
03:26 franzkafka Ah, #!perl vs #!/usr/bin/env perl
03:27 sri and better use of exec()
03:27 jberger right, exec was more important it turned out
03:27 jberger some of both
03:27 sri that does not surprise me
03:27 franzkafka sibling is deprecated and it's not a child since it's not in the <h2></h2> tag
03:28 sri i bet it fixed a lot of problems we didn't know about
03:28 sri jberger++
03:28 franzkafka I'm basically trying to move away from anything that is deprecated
03:28 jberger sri: it did fix the problem I was having, so thanks for listening
03:28 franzkafka e.g., pluck -> map
03:39 good_news_everyon joined #mojo
03:39 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/9hEO-A
03:39 good_news_everyon mojo/master 881d719 Sebastian Riedel: more diverse POD browser tests
03:39 good_news_everyon left #mojo
03:40 franzkafka bleh, I can get next if there is an HTML tag, e.g., <h2>Love</h2>Love all people even if they suck.
03:41 franzkafka If 'Love all people even if they suck.' is wrapped in a <p> tag, then I can grab it with next. If not, it's skipped.
03:41 sri http://mojolicio.us/perldoc/Mojo/DOM#next_sibling
03:42 jberger franzkafka: what sri said (I was just getting there)
03:45 franzkafka Maybe I am doing it wrong, because I tried this: $tx->res->dom->find('h2')->each( sub { say shift->next_sibling->text } );
03:45 franzkafka And I get nothing for the one I want, which is the only one not wrapped in any tag (e.g., <p>)
03:50 good_news_everyon joined #mojo
03:50 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/ldGn2A
03:50 good_news_everyon mojo/master e354d03 Sebastian Riedel: a few more node navigation examples
03:50 good_news_everyon left #mojo
03:54 jberger sri++
03:54 good_news_everyon joined #mojo
03:54 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/FqBFSw
03:54 good_news_everyon mojo/master 10bb424 Sebastian Riedel: more consistent multiline examples
03:54 good_news_everyon left #mojo
03:55 jberger sri: doesn't perltidy choose that for you?
03:55 jberger or does perltidy leave chaining alone
03:56 sri it leaves docs alone
03:56 * jberger kicks self
03:59 sri not to jinx it... but i think my recent test improvements were successful \o/ http://www.cpantesters.org/distro/M/Mojolicious.html?oncpan=1&amp;distmat=1&amp;version=5.65
04:02 jberger stupid unsupported perls reporting NA
04:10 frankzkafka joined #mojo
04:12 franzkafka Blarg, what's the best way to do a next in a map? I have this: http://pastebin.com/reRRj4q2
04:13 franzkafka_ joined #mojo
04:13 franzkafka_ http://pastebin.com/reRRj4q2
04:13 franzkafka_ I wanted to see if pastebin was supported in convos
04:13 franzkafka_ yeah, it seems to be
04:15 jberger I think gist is the only one that gets embedded code, but yeah, it gets a card
04:15 franzkafka_ I really liked the embedded code from gist.
04:15 franzkafka_ I'm surprised syskat doesn't get it, considering it's perl.org
04:15 franzkafka_ and they need to add #mojo to the dropdown list
04:17 jberger franzkafka_: all embedding support comes via https://metacpan.org/pod/Mojolicious::Plugin::LinkEmbedder
04:17 jberger so open a PR if you want to see something added
04:18 jberger gist provides a nice embedding snippet, so it was easy for batman to include
04:20 franzkafka Awesome, thanks for the link jberger
04:23 jberger sri: this really is unacceptable :-P https://widgets.stratopan.com/wheel?q=Mojolicious-5.65&amp;fs=1
04:54 KCL_ joined #mojo
04:57 good_news_everyon joined #mojo
04:57 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/eAFoSg
04:57 good_news_everyon mojo/master 24f5aaf Sebastian Riedel: no need for testing optional dependencies anymore
04:57 good_news_everyon left #mojo
04:59 basic6_ joined #mojo
05:12 cfedde_ joined #mojo
05:12 cfedde__ joined #mojo
05:13 cfedde__ joined #mojo
05:20 franzkafka http://pastebin.com/juy12FDH
05:20 franzkafka_ http://pastebin.com/juy12FDH
05:21 franzkafka Alright, I have two questions about that paste. First, I've wrapped it in a try because I don't want it dying with 'Can't call method text on an undefined value.' Is there a better way to test this?
05:22 franzkafka 2. At times there are multiple links [a href], and I'm wondering how to grab them all?
05:23 franzkafka I tried try { push @{ $content->{$_->text} } = $_->next_sibling->find('a[href]')->map('text') };, but I get the Mojo::Collection object
05:24 franzkafka I also tried, try { $content->{$_->text} = $_->next_sibling->find('a[href]')->map('text')->join(',') };, but then I get a Mojo::ByteStream object.
05:45 franzkafka Blarg! at works of course, but I only get the first one. I want ALL THE LINKS!
05:48 Grinnz "This page was last updated on Wednesday, 26th December 2014 (5:25am)."
05:48 Grinnz uh.
05:48 Grinnz what time zone is this site in, Neptune?
05:49 Grinnz (http://www.cpantesters.org/distro/M/Mojolicious.html?oncpan=1&amp;distmat=1&amp;version=5.65)
05:52 Grinnz sri, i'm still not clear :P was there a problem with the useragent creating a HTTP tx instead of a websocket one, or was there something else i should do to make it work?
05:54 franzkafka Grinnz, I am the one who updated it next month.
05:54 franzkafka Actually, I don't want an array of the links. I want to join them.
05:58 woz joined #mojo
06:17 franzkafka I've got to say it, this works but feels filthy: http://pastebin.com/f5pdX8za
06:17 franzkafka I especially don't like the if $_->text part
06:28 franzkafka OK, final question, and this is one I've really been trying to figure out for a while now. I am trying to grab anything between a tag </h2> and another tag <div>, with the tags being specific.
06:42 dod joined #mojo
07:07 denis_boyun joined #mojo
07:11 Lee joined #mojo
07:13 Lee joined #mojo
07:47 woz joined #mojo
07:49 franzkafka For example, given the following content: http://pastebin.com/9jyajw0Y, how do I extract everything after <h2>Description</h2> and before <div class="sideBarLinks">
07:49 franzkafka e.g., the description
08:08 batman franzkafka: please open an issue here: https://github.com/jhthorsen/mojolicious-plugin-linkembedder/issues
08:12 franzkafka batman, created
08:12 batman cool! thanks :)
08:12 dp_ joined #mojo
08:12 batman easier to remember that way
08:12 batman franzkafka: open more issues if you want more embedding :)
08:13 batman i only create embed code i miss myself...
08:13 franzkafka batman, thank you! I recall running into a few, but not sure what anymore. I was testing a bunch the other day :D
08:13 franzkafka I love the gist one, man do I love it
08:13 batman hehe. thank you :)
08:14 franzkafka It looks so good. I guess it would be neat if Gist links (e.g., view raw) opened in a new tab, but that's not a huge deal.
08:14 franzkafka yw!
08:14 batman it doesn't..? that's a bug.
08:14 batman at least i think so...
08:20 franzkafka Yeah, it doesn't.
08:20 franzkafka https://gist.github.com/dougwilson/0dbc430a67f28bac0b39
08:27 basiliscos joined #mojo
08:30 Vandal joined #mojo
08:31 trone joined #mojo
08:45 sugar joined #mojo
09:01 franzkafka What's the difference between concurrent blocking and non-blocking requests?
09:01 franzkafka I'm requesting 2000 pages, but doing so breaks my IOLoop that is non-blocking
09:01 franzkafka I.e., I get no content from any links.
09:02 franzkafka If I request 5 pages, it works fine.
09:03 moritz "concurrent blocking" sounds to me like you have several threads, and block on IO inside each thread
09:04 Snelius yes it is
09:05 franzkafka Got it
09:06 franzkafka Wait, I got the blocking vs. non-blocking concept with the tea analogy
09:06 Nei "We chained several of Perl’s ridiculous syntax quirks in order to create a surprisingly powerful attack,"
09:15 fhelmber_ joined #mojo
09:24 sugar_ joined #mojo
09:29 woz joined #mojo
09:38 ashimema joined #mojo
09:38 franzkafka How do you go about crawling 2000+ pages?
09:38 franzkafka I've tried blocking and non-blocking requests, neither works.
09:53 irq joined #mojo
09:59 moritz franzkafka: by not doing them all at once
09:59 moritz franzkafka: do at most $N at a time, where $N is configurable (and maybe 20 to 50)
10:00 moritz it doesn't help if you try to do 2000+ requests at once, saturating your network link, causing congestion etc.
10:11 franzkafka I agree with that, but I guess I'm not sure how to limit it with Mojo::IOLoop, thus I got rid of it completely
10:22 crab you don't limit it with mojo::ioloop
10:22 crab you limit it in the place where you're creating the requests
10:33 bc547 also... typically a process has an ulimit of max 1024 open file descriptiors. So opening 2000 webpages will fail anyway
11:05 bd I'd like to serve static files from /foo/public/... and not /
11:10 franzkafka $static->paths(['/foo/public']);  |  http://mojolicio.us/perldoc/Mojolicious/Static#paths
11:10 bd franzkafka: not path, url. http://bar.com/foo/public
11:11 franzkafka moritz, crab: is there an example of limiting?
11:13 bpmedley frankzkafka: http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#Concurrent-blocking-requests <— Something like this?
11:18 absolut_todd joined #mojo
11:20 franzkafka bpmedley, this is what I was doing, but it was not working: http://pastebin.com/Y4eL4b07
11:21 bpmedley Lets walk before we jaunt.  Try the first 5 and see what happens?
11:21 crab is jaunting harder than walking?
11:22 bpmedley Quite..
11:22 franzkafka bpmedley, the first 5 works
11:22 franzkafka < 100 works, < 1000 works
11:23 franzkafka purl jaunt
11:23 purl franzkafka: excuse me?
11:23 franzkafka :(
11:23 bpmedley Can you just break your job list into segments?
11:24 bpmedley http://en.wikipedia.org/wiki/The_Jaunt
11:25 franzkafka Yeah, that wouldn't be a problem at all. I guess I'm not sure how to go about that. Multiple while loops?
11:25 franzkafka jberger, you like Stephen King?
11:26 bpmedley There are several options for breaking up the list.  A few while loops would probably suffice.
11:26 franzkafka I've yet to read Dark Tower or The Stand, but I have to say The Shining was probably the only book I've read that ever actually scared me
11:26 bpmedley I like his short stories.
11:27 franzkafka Yeah his short stories are really good too. I recall one where they get stuck in this small town and Elvis was a waiter, or something like that.
11:27 franzkafka Was a good one
11:27 bpmedley :)
11:27 franzkafka OK, well I'll figure out how to break this list down a bit then. For now I'm just grabbing one at a time.
11:27 franzkafka thanks bpmedley !
11:40 frankzkafka joined #mojo
11:51 franzkafka joined #mojo
12:02 sugar__ joined #mojo
12:41 neilhwatson joined #mojo
12:48 jberger franzkafka: see this: https://gist.github.com/jberger/5153008
12:48 jberger obviously the second half needs to be tailored to your needs
12:50 jberger I keep almost putting that snippet on cpan
12:58 dod joined #mojo
13:11 trone joined #mojo
13:17 dvinciguerra joined #mojo
13:22 bpmedley_ joined #mojo
13:25 ignacio_ joined #mojo
13:36 sugar joined #mojo
13:54 amon joined #mojo
13:57 tencendur joined #mojo
14:10 wk joined #mojo
14:20 bd how can i serve static files from a different url, e.g. http://bar.com/foo/public
14:27 dabudabu Not 100% sure I get what you mean, but you could create a folder called foo in public
14:28 bd dabudabu: that's not what I want. normally static files are available under http://bar.com/, e.g. public/js/jquery.js => http://bar.com/js/jquery.js
14:28 asarch joined #mojo
14:28 bd i want it to be available under http://bar.com/foo/public/js/jquery.js
14:29 bc547 bd: you can make in the public dir a dir foo/public/ and place your files there
14:33 bd I'd prefer to have Mojolicious::Stative serve the foo/public route.
14:35 mst bd: mkdir -p public/foo/public
14:35 mst bd: put files in there
14:35 mst bd: done
14:36 * mst not sure what's wrong with that
14:38 lipizzan joined #mojo
14:42 crab you had to create TWO WHOLE directories
14:43 hernan604 bd: maybe you want to add other directory than /public, with: push app->static->paths->@*, '/some/other/directory/';
14:43 hernan604 then you can access those files like you do with public
14:43 hernan604 but they are outside public
14:43 bd hernan604: no the directory is fine
14:55 bd fwiw, this seems to work: http://paste.debian.net/hidden/6113b760/
14:55 Grinnz bd, create a route that calls $c->reply->static('filepath/inside/public')
14:55 Grinnz i did that for another path that didn't exactly match up with the filesystem
15:04 bd Grinnz: Can't locate object method "reply" via package "Mojolicious::Controller" at lib/Dashboard.pm line 145, but i guess that is because of an ancient mojolicious version here
15:06 dvinciguerra_ joined #mojo
15:07 bd Grinnz: thanks though, I'll try after a mojolicious upgrade
15:10 Perl048 joined #mojo
15:12 nic sri: Mojo::JSONXS -- did anyone take up your offer/suggestion?  Was the idea squashed?
15:12 nic I would like it to exist, am willing to package it, but want to check if there's now an existing or different plan
15:13 KCL_ joined #mojo
15:13 nic (nothing of that name exists on metacpan currently)
15:13 Grinnz nic, i was putting together one, but i know nothing of packaging, let me pastebin the code
15:15 Grinnz http://fpaste.org/154326/01492314/
15:15 Grinnz basically the same just using JSON::MaybeXS
15:15 nic Grinnz: I recommend "cpanm --look Mojolicious" and see how sri packages that
15:16 Grinnz (which calls the cpanel module if you have it)
15:16 sugar joined #mojo
15:19 nic if you like.  Personally I'd prefer having a module forcing C::J::XS and choking if there are problems with it
15:19 nic Grinnz: How soon do you think you could have that on cpan?
15:20 Grinnz nic, as i said i don't know what i'm doing, so if you wanted to package something be my guest... i'm not sure if i'd be able to work on it until this weekend, either way
15:21 nic Actually, maybe there's no harm having both Mojo::JSON::MaybeXS and Mojo::JSON_XS -- lots of people will prefer the Maybe version but some will want the strict version
15:22 Grinnz sure
15:22 nic and if I package it up now, it'll give you another example (of packaging) to copy at the weekend
15:23 sh4 joined #mojo
15:24 nic Grinnz_: If you don't have a cpan a/c, I'd request that now to save delay at the weekend
15:24 KCL joined #mojo
15:28 Grinnz ah yep, was just about to
15:30 Grinnz this pause website seems like it's from 1995 :)
15:37 hernan604 probably older
15:41 mst Grinnz: Welcome new user DBOOK
15:46 nic \o/
15:49 sri nic: you're the first
15:51 mst nic: MaybeXS, if it detects a compiler, auto-deps Cpanel::JSON::XS at which point the right thing basically happens anyway
15:51 mst hence why I was willing to allow fallback to JSON::XS in order to minimise political friction of adoption
15:52 mst "save as many people from schmorp as possible, by whatever means are expedient"
15:55 Grinnz_ speaking of which, are there any reactor backends other than EV that mojo would use?
15:55 Grinnz_ i get EV is the fastest but, not worth the 'baggage' imo
15:56 sri still waiting for a kick ass libuv perl binding
16:00 Grinnz_ pause passwords limited to 8 char? no indication but that's all the field seems to accept
16:03 sri there have been like 3 or 4 attempts, but nobody ever finishes their module... libuv is better than libev in every way
16:03 mst sri: buy leonerd beer?
16:05 Grinnz_ heh
16:07 sri funny how rakudo has pretty good support for libuv
16:09 sri mst: i don't like the direction leonerds code is taking (aside from IO::Socket::IP)
16:17 sri oh, libuv went 1.0 just last week :o
16:25 Grinnz_ 00:52:20            <Grinnz> sri, i'm still not clear :P was there a problem with the useragent creating a HTTP tx instead of a
16:25 Grinnz_ websocket one, or was there something else i should do to make it work?
16:25 Grinnz_ ^ ?
16:25 purl i think ^ is bitwise
16:25 Grinnz_ purl: yeah probably
16:25 purl Grinnz_: excuse me?
16:26 mst sri: that's sufficiently vague as to be completely useless so I'm going to stop caring now
16:28 trone joined #mojo
16:45 genio joined #mojo
17:05 sh4 joined #mojo
17:10 dod joined #mojo
17:24 cfedde__ joined #mojo
17:24 KCL_ joined #mojo
17:45 tencendur joined #mojo
17:46 jamesaxl joined #mojo
17:56 inokenty joined #mojo
18:04 marmez joined #mojo
18:25 franzkafka jberger, thank you!!
18:30 nic MaybeXS is certainly interesting, and I get the political angle
18:31 nic but there's a high chance of me having JSON::XS installed on any box (due to dependencies) but I don't want to be using it by accident
18:31 nic Anyway, I might have bigger problems
18:32 nic '[true]' decodes differently... to [1]
18:33 nic I don't know if that's benign, but it's not for cpan till I know it's safe
18:33 Grinnz_ you mean, from json? that is always the case
18:33 nic For now, cpanm -l /tmp/funfunfun http://github.com/niczer/mojo-json/tarball/master
18:34 Grinnz_ or you mean [true] decodes to [1] in perl? it should decode to a JSON::XS::Boolean or whatever
18:35 Grinnz_ or in recent versions of JSON::XS, whatever other boolean type thing he's using now.
18:35 nic Grinnz_: Take a look at test/10-json.t -- the lines beginning #!!
18:36 nic I'd race ahead if all Mojolicious tests passed, but they don't, so needs looking at
18:36 Grinnz_ i think your repo is private
18:36 nic ew
18:36 nic nah, just bad/rushed typing :)
18:37 Grinnz_ lol
18:37 nic s/niczer/niczero/
18:37 nic gotta go
18:37 purl EXCUSE ME, I HAVE TO GO WASH MY COMPUTER
18:37 nic thank you everyone for help & code :)
18:40 sri nic: you're importing functions from Mojo::JSON before Mojo::JSON_XS
18:40 Grinnz_ he's gone
18:40 sri a lot more tests should actually fail
18:40 sri but not those that do
18:41 sri he'll read the irclog
18:43 asarch joined #mojo
18:45 Grinnz_ # Stringify booleans
18:45 Grinnz_ is(Mojo::JSON->true,  1, 'right value');
18:45 Grinnz_ is(Mojo::JSON->false, 0, 'right value');
18:45 Grinnz_ erm, these shouldnt be working
18:46 Grinnz_ JSON::XS::Boolean stringifies to 'true' or 'false'
18:47 Grinnz_ but does is() stringify?
18:48 Grinnz_ ah, it uses eq so yeah
18:49 sri such incompatible, much wrong, wow
18:49 Grinnz_ yeah. one of the reasons im not sure about using Mojo::JSON for the existing code thats using those
18:50 Grinnz_ i hope nothing's stringifying booleans, but hope only goes so far
18:53 Grinnz_ everything else seems like it should work though
18:53 sri not at all, there's lots of incompatibilities
18:54 sri all the errors should fail, number detection is different, escaping of /... and and and
18:54 Grinnz_ ah yes the slash
18:54 sri but seriously, why would you want false() to stringify to a true value?
18:54 * Grinnz_ shrugs
18:55 Grinnz_ i think that goes back to JSON.pm
18:59 good_news_everyon joined #mojo
18:59 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/BS0Nlg
18:59 good_news_everyon mojo/master 752656b Sebastian Riedel: better tests for Mojo::JSON booleans
18:59 good_news_everyon left #mojo
18:59 sri i mean, it's undocumented, we could make it compatible, but i don't see a reason
19:00 Grinnz_ at this point i doubt the JSON-based modules are changing :P
19:01 Grinnz_ the handling of objects would be a bigger difference... i always have allow_blessed and convert_blessed off though so it doesnt matter
19:02 Grinnz_ i.e. i just don't put objects in json... hehe
19:02 sri it's mostly JSON::XS dictating shit, because nobody can argue with mlehmann
19:02 sri so the other JSON modules just accept it
19:02 Grinnz_ and everyone uses it :/
19:04 Grinnz_ hm. according to JSON.pm docs actually, the booleans stringify to 1/0
19:04 Grinnz_ i thought it did the same stringifying way back when i used it
19:05 good_news_everyon joined #mojo
19:05 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/y5Q4Vw
19:05 good_news_everyon mojo/master e135de0 Sebastian Riedel: a few more boolean tests
19:05 good_news_everyon left #mojo
19:06 sri haha
19:06 sri perl -MJSON::PP -E 'say JSON::PP::true'
19:06 sri 1
19:06 sri perl -MCpanel::JSON::XS -E 'say Cpanel::JSON::XS::true'
19:07 sri true
19:07 sri yay
19:07 Grinnz_ and JSON::XS's new Types::Serialiser types stringify to 1 and 0.
19:08 Grinnz_ so its just what JSON::XS used to do, which Cpanel::JSON::XS still does
19:09 Grinnz_ or perhaps it was old versions of JSON.pm
19:14 Grinnz_ yep found it... https://metacpan.org/pod/release/MAKAMAKA/JSON-2.23/lib/JSON.pm#MAPPING interestingly the part about "comparing as strings" doesn't seemt o have come from JSON::XS at all
19:15 Grinnz_ but i've always been using JSON::XS and it's always stringified as true/false... so i'm confused
19:18 Grinnz_ haha... Cpanel::JSON::XS overloads eq so those tests might actually pass
19:19 Grinnz_ https://metacpan.org/source/RURBAN/Cpanel-JSON-XS-3.0106/XS.pm#L1713
19:24 neilhwatson joined #mojo
19:47 basiliscos joined #mojo
19:52 franzkafka jberger++, thank you. I modified the code you posted and this is working beautifuly now!
20:19 franzkafka Is there a way to grab just a part of the ->text? E.g., ->text->grep(qr/(this piece)/i)
20:25 franzkafka You guys would be blown away/disgusted if you could see all the variations I try.
20:25 franzkafka e.g., $dom->find('td.mobHeaderItems')->grep( sub { $_->text =~ qr/of (\d+)/ } );
20:25 franzkafka :D
20:27 franzkafka Haha, found something that works: $dom->find('td.mobHeaderItems')->map( sub { ($_) = $_->text =~ qr/of (\d+)/ } )
20:27 franzkafka man, I am probably doing some hackery crap constantly.
20:29 franzkafka Hm, s/find/at results in 'Can't locate object method "map" via package "Mojo::DOM"'
20:29 franzkafka adding a ->join(',') to the end of the find-> gets rid of the "Stringification support in Mojo::Collection is DEPRECATED in favor of Mojo::Collection::join" error
20:32 franzkafka I love playing with this stuff man
20:36 good_news_everyon joined #mojo
20:36 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/XCwjig
20:36 good_news_everyon mojo/master 19be058 Sebastian Riedel: j should just be using public functions
20:36 good_news_everyon left #mojo
20:36 hernan604 franzkafka: "some text" =~ m/something/  returns a list
20:37 hernan604 so you can do: my ($stuff1, $stuff2) = $some_text =~ m#(?<thing1>.+)(?<thing2>.+)#
20:37 hernan604 :sh
20:39 hernan604 perl -e 'my $text= "aaa bb cc"; my $total_matches =my ($x1,$x2,$x3) = $text =~ m#([^ ]+) ([^ ]+) ([^ ]+)#; warn $x1 ; warn $x2; warn $total_matches'
20:39 hernan604 im pretty sure you dont want to $_=$_->text=~qr/of (\d+)/
20:40 hernan604 maybe this is could be useful: perl -e 'my $text= "aaa bb cc"; my $total_matches =my ($x1,$x2,$x3) = $text =~ m#(?<first_match>[^ ]+) (?<second_match>[^ ]+) ([^ ]+)#; warn $x1 ; warn $x2; warn $total_matches; warn $+{second_match}
20:41 hernan604 its good to know that >)
20:44 franzkafka hernan604: out of curiousity, what is wrong with ($_) = $_->text =~ qr//; ?
20:46 hernan604 value of $_ gets changed ?
20:47 hernan604 usually you dont want to change $_ values
20:47 hernan604 but thats about it...
20:47 franzkafka ok
20:47 franzkafka hmm
20:48 good_news_everyon joined #mojo
20:48 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/eQPpRQ
20:48 good_news_everyon mojo/master af8e964 Sebastian Riedel: the numeric overload is not necessary
20:48 good_news_everyon left #mojo
20:48 franzkafka I wonder if map( sub { return $_->text =~ qr/of (\d+)/ } ); would be better than?
20:49 hernan604 no
20:50 hernan604 probably will not do what you expect
20:51 sri franzkafka: it appears you're mostly fighting with perl there, perhaps you should try not using one-liners for now
20:51 sri remember, collections are also just arrayrefs
20:58 franzkafka sri, ohh yeah! 'collections are just arrayrefs'! Thanks sri, that changes a lot in this script actually.
20:59 sri it's literally the description
20:59 sri http://mojolicio.us/perldoc/Mojo/Collection#DESCRIPTION
20:59 Grinnz_ heh
20:59 good_news_everyon joined #mojo
20:59 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/avPDSw
20:59 good_news_everyon mojo/master 37d1b3c Sebastian Riedel: implicit return value looks better here
20:59 good_news_everyon left #mojo
21:03 sri and just as i say that franzkafka complains in another channel about mojolicious lacking documentations
21:03 sri s/s//
21:03 mst if documentation written by *me* made more sense, there's got to be something wrong somewhere
21:07 sri i've looked through the channel log, and he never brought any ->tap problems up here
21:08 mst well, no, because if you don't understand what it's for, you'll never even try to use it
21:09 sri he complained about it on another channel
21:09 sri instead of bringing it up here
21:09 sri franzkafka: not cool
21:09 purl i guess not cool is when I start screaming at you
21:09 mst sri: you're being a dick
21:10 franzkafka sri, I love Mojolicious. I'm an evangelist for Mojolicious :D
21:10 sri mst: watch your language around here
21:10 mst sri: watch your personality then
21:10 sri mst: final warning
21:10 franzkafka Sorry about that. I push through any frustration I have with Mojolicious because it's awesome.
21:11 sri franzkafka: the expectation, at least from me, is that in exchange for help here you bring up problems in a constructive way and help us improve the project
21:11 franzkafka I mean in terms of documentation. And, it's still pretty young, so I think it is to be expected that the documentation may not be 'all there' just yet.
21:12 franzkafka Yeah, I believe I posted a few code samples here and said something similar to them should be added to the documentation.
21:12 franzkafka So, jberger earlier posted a really awesome gist for Mojo::UserAgent earlier that helped me out immensely with some issues I was having last night. I see that it was also on SO.
21:13 franzkafka Things like that should be added to the documentation.
21:13 alnewkirk joined #mojo
21:15 franzkafka A bit of constructive criticism from someone like me (a newb). Here (http://mojolicio.us/perldoc/Mojo/UserAgent) there is an example under the non-blocking concurrent requests heading.
21:16 franzkafka In this example I see 'my ($delay, $mojo, $cpan) = @_;' and I wonder to myself, if I have 100 urls, do I need 100 params? I.e., my ($delay, $first, $second .. $one_hundred) = @_;
21:17 franzkafka I don't know. When I read the documentation (which I do a lot of), I often am left with a lot of questions. I'm not trying to be a jerk.
21:17 sri that's a very complex question
21:17 sri there simply is no easy answer
21:18 sri or rather, there is no single answer
21:20 franzkafka sri, that's the thing though. For Mojolicious to be adopted by newbs like me, it has to be answered in some way. Better examples? I'm not really sure. I'm pretty resiliant, so I sit here for hours until I figure it out (or I ask in here); but others might just say screw it and walk away.
21:20 Grinnz_ i think in this case more examples would be the solution
21:20 franzkafka No real loss to you probably, but still... I don't know, what you've created is awesome, and I would imagine you want people to know just how awesome it is rather than walk away in frustration.
21:20 sri Grinnz_: what kind of example?
21:20 franzkafka That's my point, which should have been made here rather than #perl. Sorry about that.
21:21 mst crowdsourced mojo advent calendar, by used-to-be-newbies for the next generation of newbies?
21:21 Grinnz_ i'm not sure... this seems to have more to do with the usage of the delay
21:21 sri Grinnz_: big problem here is that an example for one operating system wouldn't work on another
21:21 Grinnz_ ouch
21:21 irq joined #mojo
21:21 sri scaling highly concurrent systems is hard
21:21 sri you have to tune your operating system
21:22 sri some of it is mentioned here http://mojolicio.us/perldoc/Mojo/IOLoop#DESCRIPTION
21:23 sri if there was a way to make it "just work", we would have
21:23 sri if i knew how to properly explain it, it would be in the docs
21:23 Grinnz_ right, but in the context of this example that's there, that appears to be pretty generic
21:23 sri summary: THIS SHIT IS REALLY HARD
21:24 sri Grinnz_: that example may or may not work for hundreds of concurrent requests
21:24 sri it depends on your setup
21:26 sugar_ joined #mojo
21:27 sri and that's only the start
21:27 Grinnz_ hmm.. maybe just an explanation of the process flow there, then; like, what does $delay->begin do? how do the arguments get passed to that second subroutine? and this is all probably better explained in Mojo::IOLoop
21:27 sri it also matters what hosts you're targetting
21:27 sri if your 100 requests are to separate hosts you may need a non-blocking resolver
21:27 Grinnz_ so maybe a link to Mojo::IOLoop from the get method
21:28 Grinnz_ or more explanation in general of that example in the get method
21:28 sri Grinnz_: all linked in the real docs http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#REAL-TIME-WEB
21:29 sri remember, pod in modules is just reference docs, all the real explanations go into the guides
21:30 mst maybe the modules' docs should have links to the guides that cover them to make that more clear?
21:30 Grinnz_ ok, so that Backend web services goes over a similar example; you could link to that from the "get" method in useragent
21:32 sri why only the get method? and why only that one recipe?
21:32 sri what about post, put, patch...?
21:32 Grinnz_ well, the only other example with delay in that guide is in Concurrent blocking requests
21:32 franzkafka sri, let me give what I think might be an easier example.
21:32 sri what about all the other recipes that deal with user agent stuff in the cookbook?
21:33 sri lets take this one for example
21:33 sri http://mojolicio.us/perldoc/Mojolicious/Guides/Cookbook#Web-scraping
21:33 sri it could be linked to from dozens of methods
21:33 Grinnz_ i don't know what that has to do with figuring out how delay works
21:34 sri Grinnz_: you're too focused on concurrency atm.
21:34 franzkafka If you take a look at this hackery: http://paste.scsys.co.uk/447355
21:34 Grinnz_ that's the issue we're talking about, so yes, i am
21:34 sri i'm looking for general documentation improvements all over the place
21:34 sri general rules we can follow for interlinking
21:35 sri Grinnz_: then the question becomes, what makes this one case so much more important that it deserves a special link to a recipe?
21:35 franzkafka Let me explain why the hackery: I don't know how to test if something exists, thus I wrap it in a try so it doesn't die with 'can't call method text on undefined'
21:35 Grinnz_ sri: because it's come up as an issue, and the others haven't
21:35 sri how do we decide which topics are important enough for links in the future?
21:35 sri so whenever someone asks a question, that's reason enough to add a link from a method to a recipe?
21:36 franzkafka sri, from my perspective, someone who is hacking this all together, working with DBIx::Class and asking almost no questions there vs. asking a ton of questions here, give me a few days and I will come back and tell you what the difference is as I see it.
21:37 rem_lex| joined #mojo
21:37 sri there's maybe 20 recipes in the cookbook alone that could be linked to from the get method
21:37 sugar__ joined #mojo
21:38 basiliscos joined #mojo
21:38 franzkafka sri, it's going to take some time for me to think about my criticism and formulate something useful from it.
21:39 sri franzkafka: sure
21:39 franzkafka I just know that I ask so many questions here that I have become a nuisance. But I really try to figure this stuff out, and I am constantly reading the documentation to no avail.
21:39 franzkafka Anyway, sorry for bringing that up in #perl and not here.
21:40 franzkafka I <3 Mojolicious.
21:40 sri looking forward to suggestions :)
21:41 sri more interlinking is a topic that comes up all the time... but nobody has been able to come up with good rules for it yet
21:41 franzkafka sri, what I'd really like, but I don't have the know-how, is to help in some way to write a book.
21:42 sri we certainly need one
21:42 franzkafka The documentation is awesome, but I find myself jumping around quite often (OK, is this a Mojo::DOM object? A Mojo::Collection object? What methods can be used here?).
21:42 Grinnz_ sri: in my opinion, it wouldn't hurt to have links to the guides and such from the individual module docs. I get that they're supposed to just be references, but I go to those pages when I want to figure out how to work with something
21:43 franzkafka I know there have been attempts at a book. I can't really write one, because it'd have some real hackery BS in it, but I can give input as to what troubles a person like me faces.
21:43 Grinnz_ but yes, there are a lot of potential links
21:43 sri Grinnz_: you mean like that one in the description? http://mojolicio.us/perldoc/Mojo/UserAgent#DESCRIPTION
21:43 sri or this one http://mojolicio.us/perldoc/Mojo/IOLoop#DESCRIPTION
21:44 franzkafka I agree though that documenting everything is a bit ridiculous. There's some expectations. For example, you showed me CSS selectors and I read up on them. That helped me big time.
21:44 sri or this one http://mojolicio.us/perldoc/Mojo/Server/Hypnotoad#DESCRIPTION
21:44 franzkafka Yeah, you're covering a lot of ground. There's somewhat of an expectation that you understand x, y and z before working with Mojolicious. I think x, y and z should be explained as good-to-knows in the forward or something.
21:45 sri franzkafka: like this http://mojolicio.us/perldoc#LEARNING-PERL
21:45 sri and this http://mojolicio.us/perldoc#LEARNING-HTML
21:46 franzkafka Yes, exactly. Prerequisites basically. You need to know Perl, look at this book. It's good to understand CSS selectors, take a look here. Etc.
21:46 franzkafka Because yeah, it's more than just Perl for certain :D
21:46 Grinnz_ CSS selectors is a bit more specific to Mojo::DOM
21:47 Grinnz_ or i guess, if you're doing CSS in HTML... not my department :P
21:47 franzkafka haha
21:47 sri funny you mention it
21:47 sri i actually wanted to link to HTML/CSS?JavaScript docs instead of just HTML https://developer.mozilla.org/en-US/docs/Web
21:47 franzkafka I get where you're coming from sri. It's such a huge thing that encompasses so much.
21:47 sri but was overruled in a vote
21:48 franzkafka damn democracy!
21:48 franzkafka Alright, well back to what I was doing now :D
21:49 franzkafka Quick Q, and this probably has little to do with Mojo::UA honestly. Is there any way to load just the text from a page? E.g., no javascript, no images, etc?
21:49 franzkafka I'm trying to make this faster
21:49 sri for the record
21:49 sri http://mojolicio.us/perldoc/Mojo/DOM#find
21:49 sri there are links to the list of selectors
21:49 Grinnz_ franzkafka: a get will get you that text, it's not going to load javascript or images unless you use a browser emulator
21:50 sri and the ::CSS docs contain a link to the selectors spec http://mojolicio.us/perldoc/Mojo/DOM/CSS#DESCRIPTION
21:50 Grinnz_ like Mechanize
21:50 sri which happens to be the canonical reference
21:50 franzkafka Grinnz_: interesting, I guess this thing is just damn slow. Takes ~10 hours for 2000 pages using IOLoop even :/
21:50 franzkafka sri, that is awesome!
21:50 franzkafka sri, half the problem is my inability to find the right documentation.
21:52 franzkafka Grinnz_: It's strange because my ping time to the server is 10ms, but an HTTP request takes 30+ seconds.
21:52 Grinnz_ franzkafka: is there network involved in this? is it over the internet?
21:53 franzkafka Grinnz_: It's local, but a lot of our servers are crap and have issues. Just old crap really. I have so many issues because 1/2 our servers don't support HTTP/1.1
21:53 Grinnz_ franzkafka: it could just be the server is taking that long to render a response
21:54 franzkafka I sincerely don't understand why big companies don't use the latest stable of a product. Why I have to do all my work in Perl 5.8.4!?
21:54 Grinnz_ franzkafka: if you open it in chrome with the dev tools open you can watch the time latency until you receive the actual response (independent of how long it takes to load other stuff)
21:54 Grinnz_ ouch, thats old
21:54 franzkafka Yeah, Firebug shows my first response as taking 47s
21:54 Grinnz_ damn
21:54 Grinnz_ yeah nothing you can do about that on the client side
21:55 franzkafka I really need to work for a startup rather than companies like Oracle, Wells Fargo, etc.
21:55 Grinnz_ heh
21:55 Grinnz_ pros and cons
21:55 franzkafka Startups are hip
21:55 franzkafka Grinnz_: We're not even allowed to use CPAN modules. It's ridiculous.
21:56 Grinnz_ yeah... um... might wanna keep your options open
21:56 franzkafka Grinnz_: To have to write a bunch of SNMP stuff without the use of Net::SNMP was ridiculous. Knowing that all this has already been done, arg!
21:56 Grinnz_ open source code, copy/paste into Totally::My::Own::SNMP
21:57 franzkafka haha
22:00 good_news_everyon joined #mojo
22:00 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/L9PYBA
22:00 good_news_everyon mojo/master 18fe6ff Sebastian Riedel: more knowledge of web technologies is required
22:00 good_news_everyon left #mojo
22:00 * sri dictates
22:01 sri to be fair, the web tech index page from mozilla is new
22:01 Grinnz_ that is a pretty nice page
22:02 Grinnz_ and yeah. if you're going to mention HTML you should have the others there, don't want people running around making websites from 1995
22:04 Grinnz_ hm, i guess WWW::Mechanize doesn't actually do javascript, heh
22:04 sri i've not actually used a mozilla browser in many years, but their docs are great
22:05 Grinnz_ https://metacpan.org/pod/WWW::Mechanize::FAQ#JavaScript
22:06 Grinnz_ not surprising, as a javascript interpreter is not a simple thing
22:07 sri it's not about the javascript interpreter
22:07 sri the APIs are much harder
22:08 sri https://developer.mozilla.org/en-US/docs/Web/Reference/API
22:11 Grinnz_ this page i don't really get... APIs are usually specific to some company or site, but this sounds like it's talking about APIs that are somehow global in JS
22:11 Grinnz_ so these are actually features of JS?
22:14 Grinnz_ i mean, i guess they're technically interfaces.. from the js application... but to me its just a weird label
22:15 Grinnz_ i could call my entire codebase at work an API :P
22:17 Grinnz_ this is more... like perl modules, for JS
22:17 Grinnz_ except its up to the browser what it includes..
22:18 Grinnz_ anyway yeah i can see those being difficult to implement
22:20 denis_boyun joined #mojo
22:36 good_news_everyon joined #mojo
22:36 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/9DpI-A
22:36 good_news_everyon mojo/master 94868cc Sebastian Riedel: another Mojo::Base example
22:36 good_news_everyon left #mojo
22:38 sugar joined #mojo
22:38 Adura joined #mojo
22:39 Grinnz_ silly question. why doesn't that bot just stay here :P
22:43 sugar_ joined #mojo
22:45 Grinnz_ also i figured out the websocket issue. i found a description at https://metacpan.org/pod/Mojo::UserAgent#websocket that says it returns a Mojo::Transaction::HTTP object if the handshake fails, and i realized the websocket_ok was failing
22:52 good_news_everyon joined #mojo
22:52 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/ZbuRCw
22:52 good_news_everyon mojo/master 63c5cfa Sebastian Riedel: use a simpler Mojo::Base example
22:52 good_news_everyon left #mojo
22:55 Grinnz_ sri: https://metacpan.org/pod/Test::Mojo#websocket_ok i'm guessing "$t->websocket" should be "$t->websocket_ok" in that second code block
22:57 sri correct
22:58 good_news_everyon joined #mojo
22:58 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/EOD_7w
22:58 good_news_everyon mojo/master 3c3e2a9 Sebastian Riedel: fixed typo in test example
22:58 good_news_everyon left #mojo
23:00 Grinnz_ now to figure out why i'm getting a 404 from this websocket...
23:05 mgrimes joined #mojo
23:05 Grinnz_ how do i get Test::Mojo's web app to spit out its debug output? shouldn't it be using the default logger that outputs to stderr?
23:06 Grinnz_ oh right, i set that logger in the app
23:06 Grinnz_ but its not getting logged there..
23:22 good_news_everyon joined #mojo
23:22 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/Rkl7WA
23:22 good_news_everyon mojo/master 2d46474 Sebastian Riedel: explain how Test::Mojo handles environment variables
23:22 good_news_everyon left #mojo
23:30 denis_boyun joined #mojo
23:30 good_news_everyon joined #mojo
23:30 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/wHtm-Q
23:30 good_news_everyon mojo/master 92ca82b Sebastian Riedel: mention prove too
23:30 good_news_everyon left #mojo
23:30 Grinnz_ aha
23:32 crab hm
23:32 crab i found some code that does Mojo::IOLoop->stream($self->tx->connection)->timeout(120)
23:33 crab before doing $self->ua->post($blah)
23:33 crab when is $self->tx assigned a connection? in other words, would that code actually work?
23:34 Averna joined #mojo
23:34 sri OH SHIT
23:34 sri this is a thing now :O http://www.w3.org/TR/html-json-forms/
23:35 Grinnz_ oh wow
23:36 Grinnz_ so that submits the form as application/json
23:37 Grinnz_ our workaround has been to throw encoded json into GET/POST params but this would simplify a few things
23:38 sri validating json mostly sucks
23:38 crab hm, defaulthelpers mentions that phrasing.
23:40 Grinnz_ this document could use a proofreading
23:40 Grinnz_ Enabling HTML forms to submit JSON directly simplifies implementation as it enables backend services to operate by accepting a single input format that is what's more able to encode richer structure than other form encodings (where structure has traditional had to be emulated).
23:42 crab what a gross hack
23:42 Grinnz_ ??
23:42 Grinnz_ not a hack at all, it's a different way to encode form data
23:43 Grinnz_ sri: my websocket testing seems to be functional now. thanks
23:44 preaction eh. sounds like it's codifying what other people have already been doing
23:44 Grinnz_ preaction: right, but skipping the step of encoding inside another form
23:45 preaction no, posting with application/json when you already have json. but also the name syntax reeks of php and jquery
23:45 Grinnz_ it seems like this would work without any javascript involved
23:46 preaction eh, it's all a bunch of developers with their hands in the cookie jar, with no real care for the long-term result of their desires
23:46 sri yea, name[foo][23][bar] is a total hack
23:47 Grinnz_ what would be a better way to specify that?
23:47 preaction ... not to specify it
23:47 Grinnz_ ??
23:47 dvinciguerra_ joined #mojo
23:47 sri your source data is not a structure
23:48 sri but key/value pairs
23:48 purl key/value pairs are just adjacent elements in a ndoe
23:48 dvinciguerra joined #mojo
23:48 Grinnz_ right, BUT
23:48 purl i think right, BUT is that still true in the branch?
23:48 Grinnz_ ...
23:48 Grinnz_ shut up purl
23:48 purl ;-(
23:48 sri botsnack!
23:48 purl thanks sri :)
23:48 Grinnz_ but anyway, a common usage for json forms at least for us, is when you have an arbitrary number of values for the same key
23:49 Grinnz_ aka, an array
23:49 Grinnz_ as for nested structures, yeah thats not really needed
23:50 preaction they're developing for a use-case that is uncommon and often a bad idea. making bad ideas easier is not a good thing
23:50 sri foo=bar&foo=baz&foo=yada is already totally valid
23:52 preaction but let's just keep on making web browsers more complex. that way we can ensure there is never any new players in the market, just like operating systems!
23:52 crab also fewer bugs
23:53 Grinnz_ i just hate query/form parameters... sigh
23:54 Grinnz_ ive definitely had instances where i did want a nested object or two, actually
23:54 Grinnz_ like, 10 fields for one address, 10 fields for another, so you have to get address1_x address1_y ... address2_x address2_y ...
23:54 preaction then, in those few instances, make the names how they describe, and write some JS to do what you want, or make the backend code interpret the names. the browser shouldn't have to do that for you
23:54 Grinnz_ in those instances i end up using json, because fuck parsing all that
23:54 sri Grinnz_: this has absolutely nothing to do with ajax
23:55 preaction an RFC would solve this without any code in the browsers
23:55 sri it's merely mapping form elements to a json structure
23:55 Grinnz_ sri: and what i said doesn't necessarily, either
23:55 sri you can already send json with jquery perfectly fine
23:56 Grinnz_ preaction: "making the backend code interpret the names" is exactly what i'm trying to avoid, there
23:57 crab so you don't validate it on the server?
23:57 preaction then make the frontend code do it. either way, no new magic in the browsers!
23:57 Grinnz_ crab: yes, i validate it, once it's a structure
23:58 preaction and while i'm at it, get rid of the javascript api for battery status!
23:58 Grinnz_ lol
23:58 Grinnz_ but, but, mobile sites!!
23:59 Grinnz_ (wtf does a website need to know your battery status for?)
23:59 preaction why does a _website_ need to know how my battery is doing?
23:59 Grinnz_ :)
23:59 preaction to realize steve jobs's dream of a pure web-based phone maybe?
23:59 Grinnz_ i thought that was chromeOS

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