Camelia, the Perl 6 bug

IRC log for #mojo, 2012-07-03

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

All times shown according to UTC.

Time Nick Message
00:13 lammel2 joined #mojo
00:55 bird joined #mojo
00:56 laouji joined #mojo
01:02 scott_ joined #mojo
01:47 CromeDome joined #mojo
02:00 d4rkie joined #mojo
02:16 noganex_ joined #mojo
04:21 Leandr joined #mojo
04:25 cfouts joined #mojo
04:35 sandeepdb joined #mojo
04:51 asarch joined #mojo
05:02 sri https://github.com/kraih/mojo/issues/347 # thoughts?
05:11 ovnimancer joined #mojo
05:16 rem_lex|pivo joined #mojo
05:19 Leandr joined #mojo
05:35 vishwanathms joined #mojo
05:35 vishwanathms_ joined #mojo
05:36 sri hmm, all our ->grep() examples use regular expressions, i guess that could count as real world use case
05:46 GitHub58 joined #mojo
05:46 GitHub58 [mojo] kraih pushed 1 new commit to master: http://git.io/FmFnZw
05:46 GitHub58 [mojo/master] added regular expression support to grep method in Mojo::Collection (closes #347) - Sebastian Riedel
05:46 GitHub58 left #mojo
05:47 Foxcool joined #mojo
05:59 bird joined #mojo
06:03 bird_ joined #mojo
06:04 GitHub39 joined #mojo
06:04 GitHub39 [mojo] kraih pushed 1 new commit to master: http://git.io/0zXECA
06:04 GitHub39 [mojo/master] more grep tests - Sebastian Riedel
06:04 GitHub39 left #mojo
06:15 ynonperek joined #mojo
06:17 sandeepdb left #mojo
06:25 fhelmber_ joined #mojo
07:08 pau4o joined #mojo
07:16 Vandal joined #mojo
07:22 i_am_batman joined #mojo
07:23 davido joined #mojo
07:29 marcus yay grep
07:31 crab derp sounds a bit like grep
07:32 sri herp derp
07:32 sri no purl :(
07:36 sri just wish there was a way to make ->map() more pretty
07:36 sri ->map(sub { $_->text })->grep(qr/mojo/)
07:37 sri ->map('text')->grep(qr/mojo/) seems a bit too magical
07:38 sri or even ->map(text => 0)->grep(qr/mojo/)
07:50 andrefs joined #mojo
07:52 davido This seems like a silly question, but if I have a route that accepts get/post, and I pass a form via post, is there a simple way to render a link to the last action?
07:53 davido seems like with 'url_for' I'm probably close to there.
07:54 mire joined #mojo
08:02 davido Oh, url_with.  Nevermind. :)
08:02 andrefs joined #mojo
08:10 davido Hmm, no, url_with isn't it either. ;)
08:21 spleenjack joined #mojo
08:23 davido Ok, I got it: $c->url_for('/perldoc')->query(foo => 'bar');
08:25 tempire I'd like to see perlbrew support perl5i
08:26 tempire oh.  I misunderstood what it is.
08:39 sri http://underscorejs.org/#invoke # hmm
08:41 marcus sri: for the collection class?
08:41 sri ye
08:42 sri i'm looking for examples in other languages atm
08:45 sri i've found nothing yet that actually collects the return values though
09:02 robinsmidsrod joined #mojo
09:03 marcus shouldn't morbo be aborting if something else is hogging port 3000?
09:03 marcus now it just says 'listening', and you get this other thing..
09:05 GitHub160 joined #mojo
09:05 GitHub160 [mojo] kraih pushed 1 new commit to master: http://git.io/t3iUcw
09:05 GitHub160 [mojo/master] added regular expression support to first method in Mojo::Collection - Sebastian Riedel
09:05 GitHub160 left #mojo
09:05 Grauwolf doesn anybody know if i can use nested sql in an orlite ->create statement? https://metacpan.org/module/ORLite#create1
09:07 sri marcus: "Can't create listen socket: Address already in use at /Users/sri/perl5/perlbrew/perls/perl-5.1​6.0/lib/site_perl/5.16.0/Mojo/IOLoop.pm line 148."
09:09 marcus sri: http://nordaaker.com/docs/skitch/1._marcus%40l​abs__%7E_%28perl5.14.1%29-20120703-110920.jpg
09:09 sri marcus: not what i'm seeing
09:10 marcus sri: It works if I fire up two instances of the same app.
09:11 marcus maybe because rails listens to 0.0.0.0 and mojo listens to 127.0.0.1?
09:11 sri no idea, and can't say i care much tbh
09:11 sri IO::Socket::* responsibility to complain
09:23 geira joined #mojo
09:23 brambles joined #mojo
09:48 nic When I have apache using :8080 and try to start up morbo with that port, morbo gives the expected error message
09:50 nic hm, it actually keeps running, even though it can't use the port
09:51 asarch joined #mojo
09:53 spleenjack1 joined #mojo
10:12 migo joined #mojo
10:19 Psyche^ joined #mojo
10:24 sri morbo is just a restarter, it knows nothing about sockets, and the process that does is expected to die from time to time
10:28 vishwanathms_ joined #mojo
10:29 vishwanathms joined #mojo
10:54 dotan joined #mojo
10:55 spleenjack joined #mojo
10:58 spleenjack joined #mojo
11:02 mire joined #mojo
11:06 spleenjack joined #mojo
11:14 andrefs joined #mojo
11:21 sri ah, prototype.js calls it pluck()
11:22 sri same for underscore.js
11:22 sri it's just about property values there
11:24 sri ->find('div')->pluck(attrs => 'id')->grep(qr/mojo/)
11:24 sri ->find('div')->pluck('text')->grep(qr/mojo/)
11:28 Andrei666 joined #mojo
11:28 sri perl -Ilib -Mojo -E 'g("mojolicio.us")->dom->find("h1,h2,​h3")->pluck("text")->join("\n")->say'
11:29 sri good idea or bad idea?
11:39 daxim joined #mojo
11:40 migo joined #mojo
11:42 amirite i need some mojo love
11:44 marty moin
11:46 spleenjack joined #mojo
11:46 amirite what should i hook into or bind to if i want to run some pre-processing for all actions on a specific controller
11:46 marty sri:  I like that idea.  pluck seems semantically elegant
11:46 amirite i.e. it's not appropriate to put it in the base startup method because it's relevant on the controller level
11:47 amirite you seem semantically elegant
11:47 * marty bows
11:48 * crab plucks marty from a vine
11:49 crab amirite: no easy way to do that directly
11:49 amirite :-( but it's easy in catalyst
11:49 * amirite whines with justification
11:49 crab amirite: if you are creating the route to that controller all in one place, you can use a common bridge
11:49 crab routes
11:50 marty amirite:  You could use a bridge if you structured your urls accordingly
11:51 amirite I don't know what a bridge is
11:51 marty ahhh. crab, you beat me to it.  :)
11:51 crab are you using Lite or Fat?
11:51 amirite should i grep Mojo routes for keyword bridge?\
11:51 amirite i'm using fat
11:51 marty http://mojolicio.us/perldoc/Moj​olicious/Guides/Routing#Bridges
11:51 crab yes, look for bridges in Mojolicious::Guides::Routing
11:52 crab most of the time, organising your routes and using a common bridge is good enough for the kind of thing you describe.
11:54 sri marty: thanks
11:54 sri any other opinions on ->pluck() and possibly ->invoke()?
11:55 jamadam joined #mojo
11:57 spleenjack joined #mojo
12:01 mire joined #mojo
12:02 amirite sweet, it worked on first try
12:02 * amirite bows
12:03 amirite mojolicious calls what catalyst refers to as chains bridges
12:04 sri many catalyst concepts can be found in mojolicious in some form or another
12:09 spleenjack joined #mojo
12:09 dotan @sri - Ext.js has a store.collect('column name') which is conceptually similar
12:09 amirite new frameworks and apis are frustating only until one makes a mental map of how API documentation is structured
12:09 dotan ->pluck() sounds good because it's a rarer word.
12:10 amirite ->quack()
12:11 sri it would have to be two methods i think
12:11 sri i tend towards pluck() and invoke() atm
12:11 sri one collects return values and one just calls the method
12:12 spleenjack joined #mojo
12:14 crab amirite: so can you do what you want with a bridge?
12:15 sri perl -Ilib -Mojo -E 'say g("mojolicio.us")->dom->find("h1​,h2,h3")->invoke(replace_content => "Test!")->first->root'
12:15 amirite yes crab
12:15 sri (replace all headers with Test! and render html)
12:18 sri as opposed to perl -Ilib -Mojo -E 'say g("mojolicio.us")->dom->find("h1,h2,h3")->each(sub { $_->replace_content("Test!") })->first->root'
12:18 sri perhaps invoke goes a step too far
12:19 * sri is unsure
12:21 crab i think it does
12:21 crab but i don't feel strongly about it
12:22 sri crab: and about pluck()?
12:23 sri perhaps we should try pluck() first and see how it goes
12:23 crab those little anonymous subs are familiar enough to people by now that i don't think there's a whole lot to be gained by introducing special syntax (which will anyway not eliminate the subs, for more complex things)
12:23 crab what does pluck do?
12:24 sri lets say you want all the header text from mojolicio.us
12:24 sri perl -Mojo -E 'say g("mojolicio.us")->dom("h1, h2, h3")->pluck("text")'
12:24 sri calls ->text on all elements and collects the return values
12:24 crab the argument to pluck must be a valid method to call on the element, i guess?
12:24 sri yes
12:24 crab ah
12:25 sri it's also an answer to the recent discussion about a special Mojo::DOM::Collection class
12:25 crab i don't object to it, but to be honest i don't like the name much.
12:26 sri it seems to be the most commonly used name
12:26 sri the other alternative is ->collect()
12:27 crab hmm. when it's ->text, what it's doing is really more like extract(), but perhaps that name is not general enough for other methods.
12:28 jamadam joined #mojo
12:29 * sri pokes marcus and tempire
12:29 spleenjack joined #mojo
12:31 sri ok, invoke() is out for now, the question is only if we want to try pluck()/collect()
12:33 sri jamadam: you should have an opinion about it too i suppose :)
12:33 marcus pluck seems good
12:34 sri marcus: and the idea in general?
12:34 marcus $('a').pluck('text') ?
12:34 sri exactly
12:34 sri just method calls instead of properties
12:34 marcus it's a nice convenience
12:34 marcus and popular both in js and ruby afaik
12:35 sri actually, ruby doesn't have it
12:35 marcus I guess it comes from ruby Array
12:35 marcus oh, you are right
12:35 sri surprised me a little
12:36 amirite can $self->session ever return undef? or will it do the right thing and return a reference to an empty hash if there are no keys
12:37 amirite can i have ops
12:37 amirite i want to kickban
12:38 crab it won't return undef
12:38 crab you can't have ops. no kickbanning for you.
12:38 amirite was kicked by sri: amirite
12:38 sri :o
12:38 amirite joined #mojo
12:39 sri too slow ;p
12:43 GitHub140 joined #mojo
12:43 GitHub140 [mojo] kraih pushed 1 new commit to master: http://git.io/7qEfMw
12:43 GitHub140 [mojo/master] added pluck method to Mojo::Collection - Sebastian Riedel
12:43 GitHub140 left #mojo
12:43 sri lets see how it goes
12:44 amirite hmm why does mojolicky return a 404 when something goes wrong instead of an error in development mode
12:44 amirite maybe i'm supposed to return a truish value from the bridged method that gets called?
12:44 * amirite tries
12:45 amirite yep, evidentally (sp?) so
12:45 amirite neat
12:45 amirite that's a good thing
12:45 amirite so that we can stop chained (bridged) routines when something flops along the way
12:46 sri perl -Mojo -E 'g("mojolicio.us")->dom("h1, h2, h3")->pluck("text")->shuffle->join("\n")->say'
12:46 migo joined #mojo
12:46 spleenjack joined #mojo
12:47 ryozi joined #mojo
12:47 * sri pokes jamadam
12:50 sri perl -Mojo -E 'g("mojolicio.us")->dom("[href]")->plu​ck("type")->shuffle->join("\n")->say'
12:50 sri a lot of interesting oneliners got rather pleasant to write
12:51 sri perl -Mojo -E 'g("mojolicio.us")->dom("[href]")->pluck(attrs => "href")->join("\n")->say'
12:51 sri (extract all link urls)
12:51 spleenjack1 joined #mojo
12:52 sri perl -Mojo -E 'g("mojolicio.us")->dom("[href]")->pluck(attrs => "href")->grep(qr/^http/)->join("\n")->say'
12:52 sri (only absolute ones)
12:52 * sri stops spamming now
12:52 amirite you're pleasant to write
12:53 irs not anymore!
12:59 GitHub57 joined #mojo
12:59 GitHub57 [mojo] kraih pushed 1 new commit to master: http://git.io/NybOiA
12:59 GitHub57 [mojo/master] show alternative to pluck - Sebastian Riedel
12:59 GitHub57 left #mojo
13:09 CromeDome joined #mojo
13:11 sandeepdb joined #mojo
13:11 jamadam is reading logs
13:12 amirite captain's log?
13:13 jamadam IRC log. what's captain's log :)
13:20 jamadam sri:thanks poking. pluck, interesting!
13:20 irs :)
13:20 gryphon joined #mojo
13:20 irs perl -Mojo -E 'g("mojolicio.us")->dom("*")->p​luck("type")->join("\n")->say'
13:20 irs (list all tags on a page in order)
13:21 jamadam cool
13:27 noganex mh.. i'm trying to write a custom template handler. is there a method which will return the requested template automatically (from file, __DATA__ or inline)?
13:28 irs there's a recipe for that in the rendering guide, but no, it is not that simple
13:30 noganex mh... wouldn't it be cleaner to have a common way to do this? from what i've seen so far every renderer plugin is getting the template a bit different.
13:32 migo joined #mojo
13:38 GitHub28 joined #mojo
13:38 GitHub28 [mojo] kraih pushed 1 new commit to master: http://git.io/v6nowg
13:38 GitHub28 [mojo/master] added uniq method to Mojo::Collection - Sebastian Riedel
13:38 GitHub28 left #mojo
13:39 jamadam tried pluck. it's easy and fun :)
13:39 irs \o/
13:40 irs perl -Mojo -E 'say g("mojolicio.us")->dom("*")->pluck("type")->uniq'
13:40 irs all uniq tags on a page :)
13:40 irs s/uniq/unique/
13:40 jamadam oh
13:41 irs eliminating duplicates is a little tedious when you have to do it manually, and common enough for a method imo
13:42 jamadam perl -Mojo -E 'say g("mojolicio.us")->dom("*")->pluck(attrs => "href")->uniq'
13:42 irs indeed :)
13:42 jamadam collecting URLs
13:43 irs better use [href] though
13:43 jamadam yes, many undef warnings :)
13:44 irs perl -Mojo -E 'say g("mojolicio.us")->dom("[href]")->pluck(attrs => "href")->grep(qr/^http/)->uniq'
13:44 irs unique absolute urls
13:45 jamadam i got it
13:45 jamadam oh
13:45 irs grep without closure is also new :)
13:45 jamadam grep with regex is also covenient
13:46 jamadam yes i checked
13:46 jontaylor joined #mojo
13:48 d4rkie joined #mojo
13:55 irs perl -Mojo -E 'say g("reddit.com")->dom("[class]")->pluck(attrs => "class")->uniq->size'
13:55 irs number of unique class combinations :)
13:56 irs 1308 with duplicates, 246 unique
13:56 irs yay for useless but fun hacks
14:11 Ulti joined #mojo
14:13 Ulti eval {}; if($@) {}  doesn't appear to swallow exceptions before Mojolicious attempts to handle them, is there a way to stop this?
14:14 Ulti im trying to catch the exception and just rerender my form with a warning for the element that threw the exception, but with morbo I always hit the Mojolicious default exception template
14:17 migo joined #mojo
14:19 Ulti ahhh ok found in the mailing list logs I have to catch $SIG{__DIE__} myself
14:22 spleenjack joined #mojo
14:29 Leandr joined #mojo
14:42 inokenty joined #mojo
14:46 Foxcool joined #mojo
15:06 amirite bobobobo
15:09 amirite where do i want to hook into if i want to 302 redirect the user based on conditions
15:19 mire joined #mojo
15:24 GitHub123 joined #mojo
15:24 GitHub123 [mojo] kraih pushed 1 new commit to master: http://git.io/zgrjng
15:24 GitHub123 [mojo/master] more modern Mojo::DOM examples - Sebastian Riedel
15:24 GitHub123 left #mojo
15:25 irs pluck is fun
15:56 * sri still wonders if ->collect() would be a better name than ->pluck()
16:01 diegok amirite: you probably need a router bridge ;)
16:01 sri bridges are the answer to everything :)
16:02 diegok sri: :-p
16:03 diegok amirite: bridges are really close to catalyst chained (IIRC you came from catalyst).
16:04 diegok sri: sure, you also came from catalyst ;-)
16:04 sri yes i did!
16:05 sri ;p
16:05 diegok :)
16:07 pau4o left #mojo
16:09 amirite how do i tell what the next method in the chain/bridge will be from within a predecessorbridged action
16:09 sri ->pick(), ->gather() and ->take() also work
16:10 sri take looks neat
16:11 sri ->find('h1, h2, h3')->take('text')->join("\n")->say
16:12 amirite seems arbitrary
16:12 amirite take ?
16:12 sri just as arbitrary as pluck()
16:13 amirite why not use ->text()
16:13 amirite defining take means the user needs to memorize keyword strings to pass as arguments to take
16:13 diegok amirite: all are better than pluck()... but pluck is the funniest :)
16:13 sri heh
16:13 diegok ^ not for amirite
16:14 amirite why not use ->scrape()
16:15 diegok pick, take and collect or gather are my choices...
16:15 daxim gather/take are keywords from perl 6, they have been implemented in p5 at least 5 times
16:15 diegok ouch!
16:15 diegok :)
16:15 sri not relevant
16:16 daxim just pointing out where the names come from
16:16 sri we redefine each as a method too
16:16 diegok collect should be easy for rubyists...
16:17 sri i like the idea of using a very short method name
16:17 diegok pick?
16:17 sri or take
16:17 * sri still prefers take to pick
16:18 sri pluck is not that long either though
16:19 diegok take sounds much better, but I feel pick is a closest concept to pluck (in my wrong english) :)
16:19 sri just forget about pluck, it's an arbitrary name ;p
16:19 sri assume we start from zero
16:19 diegok sri: all are arbitrary names... :-p
16:20 diegok well, pluck and pick sounds to me what this method does.
16:20 sri ->find('h1, h2, h3')->pick('text')->join("\n")->say
16:21 sri that sounds right to you?
16:22 nic pick suggests you get a single result, pluck suggests multiple results
16:22 diegok ->find('h1, h2, h3')->take('text')->join("\n")->say
16:22 nic "pick a present" "pluck these feathers"
16:22 sri take the whole treasure?
16:23 Ulti don't suppose anyone could give me a working example of doing the following https://groups.google.com/forum/?from​groups#!topic/mojolicious/n3gIKXMHGKE
16:23 Ulti my attempt is here http://pastebin.com/vcpxPZ8m
16:23 nic I didn't like 'take' cos the result isn't going anywhere, but it might be growing on me
16:23 diegok eheh, I'm starting to like pluck :-p (oh hell!)
16:24 sri citizen, pick up that can!
16:25 sri so everybody loves pluck()? :S
16:25 i_am_batman joined #mojo
16:25 * marty loves pluck()
16:25 nic I already have its birthday marked in my diary
16:27 diegok yay
16:27 diegok :-/
16:27 diegok :-|
16:27 diegok :-)
16:27 sri Oo
16:27 sri oO
16:28 diegok the cool guys use pluck: http://guides.rubyonrails.org/ac​tive_record_querying.html#pluck :-p
16:29 * nic ponders whether using pluck is the key to becoming cooler
16:29 Ulti also ->select('text')   :P
16:29 marty The most common uses of pluck in the US is "pluck a chicken", "pluck a hair" etc...  It implies searching for "something" within an area of "something else" and taking just the thingys you want.
16:30 nic the key being the plural in that
16:30 marty I plucks yer eyebrows!
16:30 marty :)
16:30 nic and it suggests speed instead of pausing to make choices (pick, select)
16:30 * marty nods
16:31 Ulti pluck is hardly a common word use though, even in programming... though I guess it fits Perl with croak and similar
16:33 * marty runs through the chatroom plucking ponycorns from the sky
16:33 Ulti you should go for "plunk" the sound of plucking
16:33 nic Ulti: But using Mojolicious is hardly common (yet) but one day everyone will be talking about 'pluck' and being as cool as us
16:33 nic oh
16:33 Ulti ->plunk('text')
16:33 Ulti -____-
16:33 Ulti nic I dunno, I'm a random Bioinformatician and I'm using it
16:34 marty In highschool we used "pluke" as a synonym for shagging
16:34 Ulti just making up verb words that sound right is probably better than using real ones
16:34 marty shagging of course being slang for dinner and dancing.  :)
16:34 nic In UK 'pluke' means one of those bad teenage spots that spurts white puss
16:34 nic oh
16:35 Ulti you should also consider ->conjour('text')
16:35 Ulti :)
16:35 Ulti nic really? I've never heard anyone say that
16:35 nic conjure?
16:35 * diegok learning english...
16:36 Ulti no you want to use a stupid spelling, thats what programming is about
16:36 nic Ulti: Maybe people were too polite to mention plukes within your earshot
16:37 Ulti doubt it somehow considering the company I keep
16:37 nic Well, I'm glad we sorted all of that out.  sri, did that help?
16:37 marty Would be great to have a conjour method.   So Mojolicous can conjour up some spells of.. whatever.
16:37 * Ulti gives up trying to catch this exception
16:37 Ulti :'(
16:37 Ulti I'll just write my own parser instead of using BioPerl, it'll be easier
16:38 sri thanks all! that didn't help at all :o
16:38 * sri is even more confused now
16:38 Ulti plugins are quite close to conjuring
16:38 nic say no to the majyk!
16:39 sri ->brew()
16:39 Ulti ->stew()
16:39 nic ->ferment()
16:40 nic ->fester()
16:40 Ulti I love how munge is in most dictionaries now
16:40 Ulti was it originally even a word?
16:41 nic I only heard it in perl world, but it instantly sounded right
16:42 Ulti ->grock('text')
16:42 nic ah, I thought 'transmogrify' was made up in Calvin & Hobbes, but it dates from 1650
16:43 nic (nearly an hour ago by clock)
16:43 * Ulti plucks off home
16:44 * nic shuts up and goes back to tracking mysqld bugs
17:04 * sri shakes tempire
17:09 crab argh
17:10 lammel2 joined #mojo
17:10 lammel2 joined #mojo
17:17 Debolaz[Lo] joined #mojo
17:26 Ulti sri: https://github.com/kraih/mojo/commit/f8​67e854519c4c4d120e51b4304cb0ff0dcc2ee6  did this make its way into Mojolicious before 3.01?
17:27 Ulti if it did there must be something very quirky about the modules I'm using and how they throw exceptions
17:27 Ulti if thats not already in, can I +1 it?
17:27 sri that commit is a year old
17:28 Ulti ok, I need to look into what these modules are doing
17:28 sri the code is prolly dead already
17:28 Ulti oh
17:28 sri exception handling changed a few times after that
17:29 sri https://github.com/kraih/mojo/blob/mas​ter/t/mojolicious/exception_lite_app.t
17:30 sri test seems to be still there though
17:30 sri (and a lot more)
17:34 Ulti thanks sri
18:14 jontaylor joined #mojo
18:26 jontaylor joined #mojo
18:28 jontaylor joined #mojo
18:30 GitHub132 joined #mojo
18:30 GitHub132 [mojo] kraih pushed 1 new commit to master: http://git.io/DTpggw
18:30 GitHub132 [mojo/master] fixed small text extraction bug in Mojo::DOM - Sebastian Riedel
18:30 GitHub132 left #mojo
18:32 vishwanathms joined #mojo
18:36 vishwanathms_ joined #mojo
18:36 GitHub19 joined #mojo
18:36 GitHub19 [mojo] kraih pushed 1 new commit to master: http://git.io/ZQv3Vg
18:36 GitHub19 [mojo/master] fixed small attribute extraction bug in Mojo::DOM - Sebastian Riedel
18:36 GitHub19 left #mojo
18:41 vishwanathms joined #mojo
18:53 GitHub106 joined #mojo
18:53 GitHub106 [mojo] kraih pushed 1 new commit to master: http://git.io/1OIxlw
18:53 GitHub106 [mojo/master] fixed another small attribute extraction bug in Mojo::DOM - Sebastian Riedel
18:53 GitHub106 left #mojo
18:54 jontaylor joined #mojo
18:56 * sri wonders if we need a ->true method in Mojo::Collection
18:57 sri perl -Ilib -Mojo -E 'say g("mojolicio.us")->dom("*")->pluck(attrs => "href")->grep(sub { !!$_ })'
18:57 sri it currently looks like that
18:58 sri (better names are welcome too)
19:00 sri or perhaps uniq should ignore an empty string
19:00 * sri scratches head
19:04 sri hmm, is empty string a valid unique value?
19:11 tempire I don't like take
19:11 sri :o
19:12 tempire I'm partial to pluck because of its quirkiness
19:12 tempire but select also seems to make sense
19:12 tempire no, select is bad
19:12 sri select is confusing because of css selectors
19:12 tempire right
19:12 sri quirky it is then
19:13 tempire ->quirk()
19:15 sri feel like uploading a release? i want ->pluck() out there!
19:16 tempire ok!
19:16 * sri starts to really like it
19:16 sri with the Mojo::DOM fixes you can even do this without warnings
19:16 sri perl -Mojo -E 'say g("mojolicio.us")->dom("*")->pluck(attrs => "href")->uniq'
19:18 sri perl -Mojo -E 'say g("mojolicio.us")->dom("*")->pluck(attrs => "href")->grep(qr/^http/)'
19:21 tempire pluck is in the wild
19:21 sri \o/
19:21 sri tempire++
19:22 sri perl -Mojo -E 'say g("reddit.com")->dom("*")->​pluck("type")->uniq->size'
19:22 sri reddit uses 1933 tags, but only 36 unique :)
19:23 tempire this is pretty cool
19:27 sri don't forget to push your tag
19:34 sri \o\
19:34 sri /o/
19:35 marty pluck lives!   \o/
19:40 tempire tagged
19:45 mire joined #mojo
19:55 gryphon joined #mojo
20:00 fhelmber_ joined #mojo
20:01 dog_chocolate joined #mojo
20:03 batman joined #mojo
20:04 batman joined #mojo
21:01 batman joined #mojo
21:11 marty is it ok to use $self->param() versus $self->req->param()
21:16 CromeDome joined #mojo
21:18 tempire it is ok
21:22 xaka joined #mojo
21:25 marty Thank you, tempire.
21:45 lukep joined #mojo
22:28 andrefs joined #mojo
22:44 preflex joined #mojo
23:12 marty interesting.  As of jquery 1.8  all ajax requests are asysnc.  No more async: false config option.
23:41 tokuhirom joined #mojo
23:54 mire joined #mojo

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