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

IRC log for #mojo, 2014-10-29

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

All times shown according to UTC.

Time Nick Message
00:00 franzkafka Oh yeah, and with PostgreSQL
00:00 franzkafka sri++
00:15 sri talking about gamergate... this is quite impressive https://medium.com/message/72-h​ours-of-gamergate-e00513f7cf5d
00:20 franzkafka gamergate?
00:20 franzkafka haha, how stupid, sorry
00:20 franzkafka not the site you shared, this whole gamergate thing
00:20 sri if you've not been exposed to it yet... just turn around
00:21 franzkafka I absolutely cannot stand Anita Sarkeesian. Sorry, if you don't like the tropes in gaming then why don'
00:21 franzkafka t you shut the fuck up, go get a CS degree and start designing games, and encourage women to get into game development too.
00:22 franzkafka rather than being a 'pop culture critic'... what a title.
00:22 franzkafka ok, I'm done ranting.
00:22 sri yes, please no ranting here
00:22 franzkafka Or a design degree, or something.
00:23 franzkafka yeah
00:25 disputin joined #mojo
00:27 sri and sorry about the link... i guess that doesn't belong here
00:27 sri back to hello kitty conf :)
00:28 * sri will try to avoid controversial topics in the future
00:28 franzkafka haha
00:28 franzkafka Wait, are you a fan of Hello Kitty?
00:28 sri who isn't?
00:29 franzkafka Hm, I dig the design, I do.
00:29 franzkafka Is there a show or something?
00:29 sri http://www.theverge.com/tldr/2014/10/28/708​5967/beats-announces-hello-kitty-headphones
00:29 franzkafka wow, I just had no idea there was a HK following/fandom
00:30 franzkafka Those are some seriously awesome headphones actually
00:30 sri those are going to be unvailed during hello kitty conf... sooo basically there's now an apple event there ;p
00:30 franzkafka Speaking of cons, how did MojoConf go?
00:31 sri awesome
00:33 franzkafka Is Marcus Ramberg batman?
00:36 sri nope, that's jan henning thorsen
00:40 franzkafka Ah, I see
00:40 franzkafka jberger, you like thought experiments?
00:41 franzkafka jberger, I was a philosophy major, so I'm always interested in thought experiments in other fields.
00:45 bvierra joined #mojo
00:51 good_news_everyon joined #mojo
00:51 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/fBXXZA
00:51 good_news_everyon mojo/master 1fb8927 Sebastian Riedel: better description for default_message method
00:51 good_news_everyon left #mojo
00:57 good_news_everyon joined #mojo
00:57 good_news_everyon [mojo] kraih tagged v5.55 at 9ef2e1f: http://git.io/6q9YJg
00:57 good_news_everyon left #mojo
00:58 good_news_everyon joined #mojo
00:58 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/E6xRYA
00:58 good_news_everyon mojo/master bbd5f40 Sebastian Riedel: bump version
00:58 good_news_everyon left #mojo
01:11 jberger jzawodn++ see you there!
01:15 jberger franzkafka, what kind of physicist would I be if I didn't like thought experiments?
01:15 jberger what makes you ask?
01:25 jberger btw, if you aren't familiar with "the light clock" for special relativity, go find a good explaination now, its awesome
01:49 sri wonder why we've stolen nothing from meteor.js yet
01:51 sri hard to find anything interesting that's not mongodb specific
02:02 doublelel joined #mojo
02:06 jberger btw if anyone hasn't seen this yet: https://twitter.com/joelaberg​er/status/527264394401415168
02:08 sri wow
02:08 klapperl_ joined #mojo
02:08 jberger amazing isn't it :o
02:09 sri expensive fireworks
02:10 jberger very
02:11 jberger but impressive fireworks all the same
02:14 sri i think you're taking thins halloween thing a little too far
02:24 jberger we go all out over here :D
02:34 bpmedley https://github.com/kraih/mojo/issues/672  <— Greetings, the behaviour of v5.15 seems to have been reverted in v5.55.  Is the issue still valid?
02:38 sri i doubt there have been any changes
02:39 * sri always assumed the issue was silly
02:40 bpmedley Sorry, are you saying that v5.15, v5.16, and v5.55 should have the same output?
02:42 sri i'm saying there's a lot of undefined behavior in that issue
02:45 bpmedley I see.. hrmm.  I’ll look at a different issue.  Is 672 closable?
02:45 sri imo it was closable from the start ;p
02:45 bpmedley :)
02:45 sri i leave those issues open so volunteers have something to do ;)
02:45 sri for future reference, i label all good issues
02:45 bpmedley Awright, cool.
02:45 sri (and of course in case i overlooked something)
02:45 sri but most should be totally closable
02:46 sri haha, maybe there should be a special label... "needs clarification" or so
02:47 sri "incomprehensible"
02:47 bpmedley That might help people feel more involved.
02:47 sri but what to name such a label?
02:47 bpmedley Feedback requested?
02:47 sri "needs feedback" is a label for good stuff that needs real feedback
02:48 sri like pull requests and feature requests
02:48 sri i have no idea what to label something like this https://github.com/kraih/mojo/issues/697
02:48 bpmedley So, you want to differenitate the type of feedback requested?
02:48 bpmedley Clarification required?
02:48 sri hmm... maybe "needs investigation"
02:50 sri "needs more information"
02:50 jberger "feedback wanted"
02:50 * sri slaps jberger
02:50 * jberger slaps purl
02:50 jberger oh
02:50 sri :(
02:50 jberger :(
02:50 jberger SOMEONE BRING PURL BACK
02:51 sri told you it was a botnapping
02:51 jberger SOMEONE BRING DEMANDS
02:53 * sri puts away the labeling gun https://github.com/kraih/mojo/issues
03:00 bpmedley Cool, thanks for the, um, clarificaiton.. :P
03:05 sri although, now i wonder if those labels give the impression that those issues are handled
03:06 sri which is not the case of course
03:06 bpmedley https://github.com/kraih/mojo/issues/680  <— There’s not enough context to even discuss this one, is there?  Doesn’t seem to detail where the dom manipulation is happening…
03:09 * sri has been pondering the idea of an "wharrgarbl" label for that kinda issue :D http://www.popehat.com/wp-content/upl​oads/2009/05/dogsprinkler-300x240.jpg
03:09 jberger HAHAHAHAHAHHAAH
03:09 jberger (an actual LOL)
03:09 bpmedley Gaw
03:10 bpmedley Any concerns with me responding asking for a Mojolicious::Lite example script for some of these issues?
03:10 sri none whatsoever
03:14 jberger nicomen: you actually are trying to register the namespace eh?
03:14 jberger http://www.nntp.perl.org/group/pe​rl.modules/2014/10/msg91673.html
03:14 noganex_ joined #mojo
03:14 jberger I only registered one, realized that that had no purpose eventually, and removed the registration
03:15 jberger https://twitter.com/joelaberg​er/status/527297695359062016
03:16 bpmedley https://github.com/kraih/mojo/issues/672 <— Could it be mentioned that the code is relying on undefined behaviour that could change between releases?
03:35 fhelmber_ joined #mojo
03:46 bpmedley my @h = $dom->find('h1, h2, h3')->text(0)->each  <— Is this the proper fix for issue 697?
03:46 bpmedley https://github.com/kraih/mojo/issues/697
03:51 KCL joined #mojo
03:59 laouji joined #mojo
04:05 sujithm joined #mojo
04:08 Eke- joined #mojo
04:14 basic6_ joined #mojo
04:18 franzkafka Hi
04:19 franzkafka with Mojo::UA, say I have a bunch of these: http://pastebin.com/HDHvSGh7
04:19 franzkafka Meaning, a bunch of headings, and under the heading a <td> and <p>s inside.
04:19 franzkafka How could I extract the <p>s inside if heading equals X?
04:20 franzkafka It kills me working with stuff that does not use css classes
04:22 tempire Was there a consensus for schema migrations?
04:25 * tempire wonders if sqitch is better than DBIx::Class::DeploymentHandler
04:26 jberger dbicdh is rather hard to grok
04:30 tempire Seems like it's more likely to have nifty interaction with ::Migration and ::Fixtures
04:36 franzkafka Is there something like $tx->res->dom->find('h2') where I can say the text equals X?
04:39 franzkafka I hate sites that don't use CSS
04:44 franzkafka I want the text in the <p> tags under a few headings out of the many on this page
04:47 franzkafka jberger, my experience with thought experiments is in philosophy, such as Rawls' Original Position, etc.
04:47 franzkafka I'm always interested in thought experiments in other fields as well
04:49 franzkafka tempire, did you get a lot of shit for your talk at mojo conf?
04:49 franzkafka your lightning talk that is
04:49 tempire No
04:49 tempire I received no feedback at all
04:52 franzkafka I find it unfortunate that Perl has a reputation as you've said.
04:53 franzkafka And the only part of your talk that bothers me a little is, "Don't talk to people about Perl, talk to them about Mojolicious."
04:53 franzkafka As if Perl is a bad thing
04:55 franzkafka However, I agree with you on the aesthetics aspect of programming. I don't know why, but it is fundamental. I cannot work without a vim color scheme that I find beautiful.
05:04 preaction i drag up my continued enjoyment of Perl as a reason why nobody should take me seriously as a programmer :p as i do with C++ (which i also enjoy, or at least have not done enough to hate yet, like i have with python)
05:04 preaction people don't use Ruby, they use Rails. or Puppet. they don't use PHP, they use Wordpress or Drupal
05:05 preaction we're using Logstash at $work now. That's Ruby too. gotta use ruby to write plugins for it
05:05 Adurah joined #mojo
05:14 preaction soon. soon my irc bot routing will be complete! Mojo::IRC is very nice!
05:17 franzkafka preaction, the fact that I go to Perl for almost every problem is a good enough reason not to take me serious as a programmer... that and the fact that I can't figure out Mojo::DOM for the life of me.
05:18 laouji joined #mojo
05:19 preaction but that's not true. just because I use Perl doesn't mean that I'm somehow damaged as a programmer. it means that i spend most of my time at a bourne-compatible shell to do my work
05:20 preaction and in your defense, Mojo::DOM has to deal with HTML, and does so using CSS selectors, so you also need to understand both of those things
05:23 rem_lex|pivo joined #mojo
05:32 franzkafka preaction, I can use Mojo::DOM no issues when there is CSS in the source. That is not the case here. I am looking at the walk examples, and they do $dom->div, well turns out $dom->table does not work ;)
05:35 franzkafka no, no... I mean that I've used Perl so much I've nearly forgotten how to use anything else :)
05:35 franzkafka Back in 2000, before I was introduced to Perl, I worked in C quite extensively. I don't think I could anymore.
05:38 preaction ah. i constantly work in perl, python, javascript, and frequently java and c++, so i get refreshed quite a bit on those
05:42 dotandimet joined #mojo
05:52 franzkafka yeah, I pretty much work in Perl, ksh and tcl
05:52 franzkafka I need a new job
05:52 franzkafka haha
05:54 sujithm joined #mojo
06:03 d4rkie_ joined #mojo
06:24 hesperaux joined #mojo
06:34 Eke- joined #mojo
06:36 franzkafka I have this to grab the text inbetween the <b> tag: my $program = shift->b->text;
06:36 Insane joined #mojo
06:36 franzkafka How can I grab stuff before a <br> tag?
06:36 Insane hi all, could I somehow have a timer iside my mojo app? I need mojo to run some code daily withoud crontab job even if there are no http requests at rhis time
06:37 firnsy Insane: http://mojolicio.us/perldoc/Mojo/IOLoop#recurring
06:38 franzkafka http://pastebin.com/DA0CjRL3
06:38 franzkafka Insane, I guess it depends on what you're doing. I use an IOLoop for a job I have run every hour.
06:39 franzkafka I also use Proc::Daemon to run it as a daemon constantly
06:39 Insane so I can just place a Mojo::IOLoop definition into statup sub and it will work?
06:39 firnsy yes
06:40 Insane great o.O
06:47 franzkafka The other thing, on some of these there is no <b> tag, thus it fails with 'can't locate object method b', but not sure how to do a UNIVERSAL::can test on this
06:49 franzkafka really trying not to do something like $_ =~ /<b>/;
06:50 franzkafka or my @matches = $_ =~ m{(.*?)<br>}g;
06:51 franzkafka I just want to grab from this: <p><b>Agriculture & Related Sciences</b><br/>  Landscaping and Groundskeeping A C<br/></p>
06:52 franzkafka Agriculture & Related Sciences as $program, and anything before a <br/> as @majors.
06:53 franzkafka This does not seem like it should be so difficult :/
06:53 franzkafka OK, I need sleep. My brain is frazzlefried today.
06:54 franzkafka G'night all.
06:57 firnsy joined #mojo
07:02 Insane hm.. I'm using hypnotoad and have 1 parent process and 3 children, Mojo::IOLoop->recurring is running in all 4 processes
07:02 Insane how to run timer only in parent process?
07:03 Vandal joined #mojo
07:10 franzkafka It has b and br children. I can grab text from b's, but not br's
07:11 franzkafka I am assuming it is because b has <b>text</b> whereas br is text<br/>
07:11 franzkafka no opening tag
07:14 batman Insane: there's no ioloop in the parent process
07:15 franzkafka batman, so if there are 4 processes could s/he set workers to 1 and only have the loop running in the one child pid?
07:15 franzkafka batman, I am asking for my own clarification on how it works.
07:16 batman franzkafka: i think you're solving whatever-problem-you-have with the wrong tool.
07:16 batman it get's super complicated.
07:16 franzkafka I.e., reduce child processes from 4 -> 1.
07:16 batman you also need to take into account that the children restarts from time-to-time, so the whatever IOLoop you start, will not run forever
07:16 franzkafka batman, I'm just trying to scrape some stuff from HTML with no CSS
07:16 franzkafka batman, I have had an IOLoop running for about a year now, of course I am also using Proc::Daemon
07:17 franzkafka I am not using hypnotoad.
07:17 batman oh. i see
07:17 franzkafka batman, are you saying I am solving the problem with extracting from this HTML with the wrong tool?
07:18 batman but... didn't i answer insane..?
07:18 * batman is confused
07:18 batman franzkafka: i never answered you
07:18 franzkafka batman, if so, I disagree. I am solving the problem with the right tool I think, but I suck ass with this tool so I am not solving it at all.
07:18 batman franzkafka: ignore me. i was answering Insane, and got confused by your reply
07:19 franzkafka batman, oh, sorry about that, I was just asking for some clarification because I was wondering if that had to do with having 4 workers vs 1.
07:19 franzkafka batman, I have a cold. My brain is running on near empty, sorry for being confusing :)
07:19 batman Insane: see whatever i said to franzkafka, was really to you
07:20 batman franzkafka: i feel ya' ;)
07:20 franzkafka damned cold season
07:20 franzkafka have a good night, I am really off to bed this time
07:20 franzkafka This problem will be here for me in the morning
07:20 franzkafka haha
07:22 basiliscos joined #mojo
07:28 Eke|| joined #mojo
07:36 fhelmber_ joined #mojo
07:39 Guest-quest joined #mojo
08:14 rawler joined #mojo
08:22 vytas joined #mojo
08:31 trone joined #mojo
08:38 nicomen jberger: I hope it illustrates the bad documentation
08:42 Insane batman, I need mojo to sync internal SQLite DB with external API data once a day
08:43 Insane looks like there is only one 'good' way - to add custom command to mojo commandline and run it with cron
08:48 denis_boyun joined #mojo
08:48 dod joined #mojo
08:52 dod joined #mojo
09:00 Shaeto joined #mojo
09:06 batman Insane: crontab is your friend :)
09:13 dod joined #mojo
09:32 sujithm joined #mojo
09:42 neyasov joined #mojo
09:44 nicomen Insane: sounds like something you don't need mojo for? or is the syncing requireing lots of program logic?
09:48 nicomen does anyone have some suggestions when wanting to run test for a matrix of data? ie. combinations of several states/environments?
09:48 nicomen I don't want to duplicate tests, nor put all tests in one "run_tests" method...
09:57 Shaeto left #mojo
10:36 tbushell left #mojo
10:41 dp_ joined #mojo
11:21 amon joined #mojo
11:36 fhelmber_ joined #mojo
11:40 fhelmber_ joined #mojo
11:49 Kripton joined #mojo
11:57 * lb discovered a breaking change in 5.51 today, so that was fun
11:57 lb (yes, mojo::collection bool overload)
11:58 Guest-quest lb: ok
11:59 neilhwatson joined #mojo
12:03 jberger franzkafka: you might need to look at the traversal method like next and next_sibling
12:08 bjoernfan sri: "needs more information" => "INSUFFICIENT DATA FOR MEANINGFUL ANSWER."
12:09 jberger bjoernfan: o/
12:25 irq joined #mojo
12:49 * sri yawns
12:50 bjoernfan More Asimov references please. :)
12:50 bjoernfan jberger: yo
12:54 bjoernfan Are there any other channels you guys hang out in where I don't have to feel bad about not bringing anything to the table when it comes to Mojolicious? I'm just deep into sysadmin land now.
13:02 jberger_ joined #mojo
13:12 lipizzan joined #mojo
13:17 marty joined #mojo
13:20 marty_ joined #mojo
13:24 D4RK-PH0ENiX joined #mojo
13:33 ignacio_ joined #mojo
13:37 marty_ I’m a little late but that MVC article was to preachy for me.  Hell, I made a conscious decision to stop using all recreational drugs after high school because I witnessed what it was doing to my friends.  But I’ve never told anyone to not use recreational drugs or how to run their conference.  sheez
13:37 marty_ the author of that article is guilty of the behavior she is criticizing.
13:38 marty_ btw..   good morning.   :P
13:39 sri o/
13:42 * sri is german, and therefore considers beer a staple food
13:50 jberger__ joined #mojo
14:07 bwf joined #mojo
14:36 ryozi joined #mojo
14:45 * tempire has finally embraced signatures
14:45 tempire \o/
14:46 mst marty: hence my thing of "the bullet points of 'what to do' are good, but would've been better without the crap first"
14:50 jamesaxl joined #mojo
14:53 klapperl joined #mojo
14:58 Ptolemarch joined #mojo
14:59 tbushell joined #mojo
15:27 sri this is odd
15:27 sri perl -Mojo -E 'say g("mojolicio.us")->dom->at("h1")->first'
15:27 sh4 joined #mojo
15:27 sri Not a subroutine reference at -e line 1.
15:27 sri wtf?
15:27 sri perl -Mojo -E 'say g("mojolicio.us")->dom->at("h1")->last'
15:28 sri Can't locate object method "last" via package "Mojo::DOM" at -e line 1.
15:30 mst wtf
15:30 mst 'not a ubroutine reference' normally means you did ->foo->()
15:31 sri https://gist.github.com/ano​nymous/ece50f4f6daa8d4fa647
15:33 sri has to be something here https://github.com/kraih/mojo/blo​b/master/lib/Mojo/DOM.pm#L20-L31
15:33 tbushell left #mojo
15:35 sri no wait, AUTOLOAD is never called
15:36 sri oh crap
15:36 sri first is imported into Mojo::DOM
15:36 sri ARGH!
15:37 d4rkie joined #mojo
15:39 mst sri: and this is why I invented namespace::clean :)
15:39 mst though in my case, it was because I had a Moose class with an 'outer' attribute :)
15:40 klapperl_ joined #mojo
15:46 doublelel joined #mojo
15:51 KCL_ joined #mojo
16:01 rem_lex| joined #mojo
16:09 disputin joined #mojo
16:11 tempire deployment handler isn't so bad
16:12 tempire And the dbic-migration command looks pretty useful
16:13 sri argh... i ran right into the drama in #perl...
16:14 * tempire sprinkles glitter to counter the affects
16:14 sri tempire: there's also http://mojolicio.us/perldoc/Mojo::Pg::Migrations
16:15 tempire Saw that; wanted something that handles fixtures as well
16:16 sri i wanted support for fixtures too, but couldn't think of a good api
16:16 sri btw. the #perl drama was ultimately caused by Mojo::Collection::AUTOLOAD
16:17 sri and specifically ->find('foo')->at('bar') returning a collection
16:20 sri hmm, i guess if i do something about it now i'd be giving in to bad behavior
16:21 mst the question is: is it a bug
16:21 mst a bug reported dickishly by a dickhead is still a bug
16:21 mst a nonbug reported politely by your favourite person in the world is still not a bug
16:21 sri not a bug
16:21 mst then why would anything need to be done about it? :)
16:21 sri it would be a deprecation
16:22 sri it is true that the feature causes problems all the time
16:23 mst I have to say I think the AUTOLOAD is a pretty terrible idea
16:23 sri a possible change would be the deprecation of Mojo::DOM::AUTOLOAD and Mojo::Collection::AUTOLOAD
16:23 mst I kinda wish there was an elegant way to turn it on, only for cases where youn know it's what you want
16:23 mst but by that point there's probably no sugar gain
16:23 sri thing is... it was always meant as a toy for one-liners
16:23 sri and people like buu are using it in serious scripts
16:23 sri that's a problem
16:24 sri the AUTOLOAD description even points at ->children(...) for anything serious
16:24 mst yes, well, if he didn't give quite a lot of mostly pretty reasonable advice to quite a lot of newbies, he wouldn't still be in that channel
16:25 mst I ended up having to killfile him because he liked to bait me into tempbanning him and then scream op abuse
16:26 sri jberger, tempire, batman, marcus, crab: opinions?
16:27 tempire I think it was worse before the dom didn't default to collection methods
16:29 sri can you rephrase that?
16:29 sri Bender: trust tempire
16:29 Bender OK, sri
16:30 sri "before the dom didn't" trips me up
16:31 tempire People had more problems before Mojo::DOM::AUTOLOAD searched the children of an element
16:32 sri i don't think that's true
16:33 sri let me look back
16:33 tempire I certainly did.
16:33 tempire Maybe it was just me.
16:34 tempire You could always catch ->at as a special case
16:34 sri i don't think that helps
16:35 sri there's also ->div returning a collection or dom object depending on number of elements
16:36 tempire Hmm.
16:36 sri say you do $dom->find('div')->h1, now you've got a collection of dom elements and collections
16:36 sri mixed
16:36 sri it exists at least since 2.0 btw. https://github.com/kraih/mojo/​blob/v2.0/lib/Mojo/DOM.pm#L15
16:36 batman sri: i would like to keep it as-is.
16:39 basic6 joined #mojo
16:40 dvinciguerra joined #mojo
16:40 batman i like that mojolicious is well documented and tested, instead of having one million input checks or similar logic to check *wrong* usage
16:43 sri i don't like that it feels so magical to less experienced perl programmers
16:43 sri lets face it, if we want to expand, that's our target audience
16:48 tempire The more I think about it, the more I think it's probably better without it.
16:48 tempire But I haven't been using ::DOM lately.
16:48 tempire So I'm hesitant to commit to that.
16:57 sri the doc changes necessary are quite substantial
17:05 good_news_everyon joined #mojo
17:05 good_news_everyon [mojo] kraih created less_autoload (+1 new commit): http://git.io/WjtsHg
17:05 good_news_everyon mojo/less_autoload f785183 Sebastian Riedel: deprecated Mojo::Collection::AUTOLOAD and Mojo::DOM::AUTOLOAD
17:05 good_news_everyon left #mojo
17:05 sri that's only the doc changes i've found so far
17:05 sri $dom->find(':not(p)')->strip; becomes $dom->find(':not(p)')->pluck('strip');
17:06 sri some of that stuff is really painful
17:13 tempire I'd err on the side of keeping it since it's been there since forever.
17:16 neilhwatson joined #mojo
17:16 Akron joined #mojo
17:20 sri jberger, tempire, batman, marcus, crab: opinions?
17:30 batman It's a whole lot cleaner.
17:31 batman Can't argue that :/
17:31 batman I'm still unsure about the deprecation, even when I'm no fan of AUTOLOAD.
17:31 jberger_ It's a feature that I would be sad to lose
17:31 jberger_ But I get it
17:32 jberger_ You have to know what the return value of the methods are, and those are well documented
17:32 batman Is there a way to discourage it? Like no warnings "something";
17:32 jberger_ But it hasnt fixed the masses
17:33 batman Not that no-warnings is a serious suggestion...
17:37 ceej__ joined #mojo
17:42 good_news_everyon joined #mojo
17:42 good_news_everyon [mojo] kraih pushed 1 new commit to less_autoload: http://git.io/5xD2sw
17:42 good_news_everyon mojo/less_autoload fc8d2cf Sebastian Riedel: tests no longer use Mojo::DOM::AUTOLOAD and Mojo::Collection::AUTOLOAD
17:42 good_news_everyon left #mojo
17:42 sri ok, i think the branch would be complete now
17:43 sri https://github.com/kraih/m​ojo/compare/less_autoload
17:45 sri it's kinda funny that the real problem is that people use the feature *too much*
17:46 sri it's soooo easy to trial and error something together that kinda works... and then when it doesn't... people get really confused because it's really advanced features they've been using
17:47 sri like nested collections of dom objects... it can be nice when it just works... but when it doesn't... well
17:58 jberger_ Could ojo inject the AUTOLOAD methods :o
17:58 * jberger_ prepares to be slapped
18:00 neilhwatson joined #mojo
18:00 batman Haha
18:03 batman I'm leaning toward +1, since I'm no fan of AUTOLOAD.
18:04 batman Today I thought about making Mojo::FTP
18:04 batman ...but then I woke up, and realized it was just a bad dream
18:07 Ralesk :D
18:10 sri allright
18:10 sri https://github.com/kraih/mojo/pull/699
18:10 sri anyone can vote
18:11 franzkafka This is incredibly annoying: Can't locate object method "p" via package
18:12 irq joined #mojo
18:12 franzkafka Is there any way to say if that element does not exist just undef it?
18:12 sri right, you're simply not supposed to use that
18:12 franzkafka my $address = $tx->res->dom->html->body->table->[1]-​>tbody->tr->td->[0]->p->[0]->[0]->text // '';
18:13 sri it's only for quick scripts for HTML/XML documents where you know the exact strucutre
18:13 franzkafka well, there is no other way to extract the data from this because it does not use css classes or anything else I could use as a selector.
18:13 franzkafka I have to walk the DOM
18:13 sri umm
18:14 sri ->html->body is literally using CSS selectors
18:14 sri http://mojolicio.us/perldoc/Mojo/DOM/CSS#SELECTORS
18:14 sri it's nothing else than 'html > body'
18:15 sri anyway... this is the problem... we have less experienced programmers getting confused
18:19 franzkafka Any good examples of how to extract data from HTML tags?
18:20 franzkafka I.e., <html><body><table><tr><td><p><b>blah</b> Blah1<br/> Blah2<br/></p></td></tr></table></body></html>
18:20 franzkafka Say for example, something that illustrates how to get the blah, Blah1 and Blah2 from that.
18:21 franzkafka I can easily extract text from this: <h1 class="shit">Shit</h1>, obviously 'h1.shit')->text;
18:22 franzkafka It's just mildly annoying. I've worked extensively with DBIx::Class and others and never run into the constant walls I run into with Mojolicious
18:24 sri if you're not familiar with CSS selectors, Mojo::DOM will not be of much help to you
18:26 franzkafka I'll just go with a different framework, fuck it
18:26 Mikey franzkafka: CSS selectors allow you to select elements based on document structure.
18:27 Mikey franzkafka: don't run away from a challenge, staying here in an uncomfortable place for a sec would probably be more advantageous to you long term.
18:27 franzkafka Mikey, I realize that. e.g., /html/body/table[2]/tbody/tr[3]/td[1]/h2
18:27 Mikey i think thats like.. XPath?
18:27 bwf print $dom->find('td > p')->all_text;
18:28 franzkafka Yeah, I'm just frustrated, banging my head on this shit all day yesterday
18:28 Mikey that says "every p that directly descends from a td, print text"
18:28 franzkafka bwf, the issue is, I only want the <p>s from certain tables, and sometimes <p>s do not exist in these tables.
18:28 Mikey franzkafka: even more reason to power through this, man.
18:28 Mikey how do you know which are the tables you want <p>'s from?
18:28 franzkafka Ah, it's a problem of me not explaining myself very well. Back to the problem. I will figure it out.
18:28 franzkafka Thanks all
18:28 sri sorry if i upset anyone... somehow me trying to help always ends badly this week...
18:28 bwf print $dom->find('html > body > table > tr > td > p')->all_text;
18:29 * sri will step back again for a bit
18:29 franzkafka I only know from walking the DOM I guess
18:29 franzkafka https://bigfuture.collegeboard.org/college-u​niversity-search/print-college-profile?id=11
18:29 franzkafka The main address, degrees available, and all majors tables.
18:29 franzkafka sri, you didn't do anything man, I'm just frustrated
18:29 Akron joined #mojo
18:30 franzkafka sri, it's my problem.
18:30 good_news_everyon joined #mojo
18:30 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/FxzCTA
18:30 good_news_everyon mojo/master 6a06ad6 Sebastian Riedel: use less imports in classes with AUTOLOAD methods
18:30 good_news_everyon left #mojo
18:30 franzkafka And you're right, I don't know wtf I am doing.
18:31 Mikey the difference between the people this is easy for and the people this is hard for, is that the people who it's easy for pushed through the haze of uncertainty
18:31 Mikey everyone starts out from the same place.
18:32 Mikey and fuck we all know that frustrating feeling.
18:33 franzkafka Mikey, any book recommendations for understanding this stuff? If it was JSON it wouldn't be an issue, but dealing with the DOM has been such a pain in the ass for me.
18:33 franzkafka Mikey, or a good link explaining it.
18:33 Mikey im looking at your document right now
18:33 Mikey juse a sec.
18:33 franzkafka Mikey, I've looked extensively, but every example I've found deals with stuff that has CSS classes, or is somehow easy to pick out.
18:33 Mikey just*
18:34 Mikey let's go to PM
18:34 Akron franzkafka: css selectors are your friends here. If the docs sri showed you are not helpful, maybe you can have a look at jquery explanation, like here: http://www.w3schools.com/j​query/jquery_selectors.asp
18:35 Mikey yeah the jquery docs themselves are where i learned a ton of stuff
18:35 Akron There's also a link to a live editor - so you can try it in your browser. css selectors are really handy and less complicated than XPath. The great thing for you is, you don't have to climb down the tree node by node but you can make big jumps.
18:38 franzkafka Akron, thank you. I feel far less frustrated now. I'm looking at the jQuery doc now.
18:40 Akron franzkafka: Good luck!
18:41 Mikey have fun ;)
18:47 sri batman, jberger, marcus, tempire, crab: you too! https://github.com/kraih/mojo/pull/699
18:47 jnbek joined #mojo
18:47 sri looks like it is not as controversial as i expected
18:48 Eke- joined #mojo
18:52 sri Bender: trust batman
18:52 Bender OK, sri
18:53 sri so now we have batman back and marcus is missing :o
18:53 sri and purl :(
18:53 mst the latter's being looked at; hachi got distracted by IRL stuff
18:56 D4RK-PH0ENiX joined #mojo
18:58 davido_ joined #mojo
19:00 depesz joined #mojo
19:00 depesz hi. i know it's old news, but where can I find any rationale behind removing ->secret, and replacing it with ->secrets?
19:00 depesz also, is there any planned stabilization of api?
19:01 depesz i am *not* web developer. I wrote an app once, and it happens to work, and be used by some people. and then, every now and then, i get information that it stopped working, because someone installed new version of mojo, which is not backward compatible :/
19:02 Mikey what version did you upgrade from / to?
19:02 depesz i didn't upgrade at all.
19:02 sri http://mojolicio.us/perldoc/Mojol​icious/Guides/Contributing#Rules
19:02 Mikey the major point releases almost always break /something/ but it's usually not too much work to fix it
19:02 depesz a guy downloaded my app, installed, and it doesn't run.
19:02 sri http://mojolicio.us/perldoc/Mojolicious/Gui​des/FAQ#What-about-backwards-compatibility
19:03 depesz ok. so long story short - it will always break sooner or later, and the only way to keep the app working is to read all changelogs, and apply changes. with some "version-based-ifs" where needed.
19:04 Mikey just keep an eye out for the major point releases, if you need it to "just work" keep a version of mojo that it works with handy to distribute
19:04 depesz how can you write an app that many people can run, then? i mean - some might have old version, some new. so basically every bit of mojo-based app has to have some "if version <= ... else ... ?"
19:04 Mikey depesz: i distribute a dependency pack with my application.
19:04 batman depesz: you can use carton to bundle a given version of mojo with your app
19:04 Mikey that the application is 100% tested to work with
19:04 depesz Mikey: i just provide source code of the app/site. people download it (clone from github) whenever they feel like it.
19:05 depesz "carton"?
19:05 mst http://p3rl.org/Carton
19:05 Mikey there are too many moving parts to take any other approach.  you either dance with the moving parts, or you freeze them in place.
19:06 depesz 4.91 is "major version"?
19:06 depesz based on the changelog, it looks like very version is major, as it removes some things
19:07 Mikey so.. in "4.91" the number "4" is the major version
19:07 depesz well, "every" is too much.
19:07 Mikey the number "91" is the minor version
19:07 batman depesz: we changed it into secrets() because it makes Mojo better - security wize
19:07 depesz Mikey: 4.91 removed things. so did 4.90
19:07 batman Hum... "Wize"..? :/
19:07 depesz batman: i'm not arguing whether it's better or worse.
19:07 Mikey batman: i thought it looked cool.
19:07 depesz batman: where can I find more information about the change, rationale, discussion, problems it solves?
19:08 ryanc joined #mojo
19:08 Mikey depesz: the problem it solves is change.
19:08 Mikey the problem that plagues you most i am afraid.
19:09 batman depesz: http://mojolicio.us/perldoc/Mojolicious#secrets
19:11 depesz @batman: it shows how to use, but doesn't explain why it was changed.
19:11 depesz Mikey: ok. makes sense.
19:11 depesz just to get it straight: i'm not saying it's bad change. i'm in a position where I *have to* keep modifying software that "just is", simply because underlying framework changes in non-backward-compatible way.
19:12 batman depesz: it says it allows you to rotate secrets.
19:13 batman That's a pretty big win instead of having to invalidate all the sessions when you change the secret.
19:13 jnbek joined #mojo
19:13 Mikey i can assure you nothing's changing arbitrarily.  understand there are reasons behind the changes, and they're usually very good ones.  this dev team has been extremely careful about that stuff over the years.  I've brought a web app from 2.x all the way to whatever it is now minus prolly .05 or something
19:13 * batman need a break. Back to work in one hour...
19:14 Mikey over the course of 3 years without any release, major or minor, being more than 1-2 hours of work to fix
19:15 Mikey which is acceptable considering performance has improved, features have improved, security has improved, etc.  these are all part of the costs of doing business.
19:15 Mikey and my app is a 50k line codebase
19:16 Mikey commercial mojo app
19:16 depesz very likely. my problem now stems from the fact that I no longer write in perl, and for even longer time i no longer write webapps.
19:16 Mikey then fix it one last time, look at what version of mojo you have, and say "it requires this version"
19:17 franzkafka carton looks awesome, thanks mst.
19:18 Mikey i have specific non-perl binary deps so i distribute a tarball
19:19 Mikey actually i distribute a few tarballs for different architectures
19:19 Mikey hoping to move this whole thing to docker containers.
19:21 depesz ok. anyway - thanks. got the info i needed. will figure it out somehow :/
19:21 depesz left #mojo
19:27 good_news_everyon joined #mojo
19:27 good_news_everyon [mojo] kraih pushed 1 new commit to less_autoload: http://git.io/r6iKOw
19:27 good_news_everyon mojo/less_autoload d60d8f5 Sebastian Riedel: fixed a few more examples
19:27 good_news_everyon left #mojo
19:28 good_news_everyon joined #mojo
19:28 good_news_everyon [mojo] kraih deleted wantarray_security_fix at bdcc96a: http://git.io/08pumA
19:28 good_news_everyon left #mojo
19:28 good_news_everyon joined #mojo
19:28 good_news_everyon [mojo] kraih deleted json_text at 8156b11: http://git.io/DkKbOA
19:28 good_news_everyon left #mojo
19:32 fhelmber_ joined #mojo
19:35 neyasov_ joined #mojo
19:36 tempire hmm
19:36 tempire https://github.com/torodb/torodb
19:43 DaniBunny joined #mojo
19:45 DaniBunny left #mojo
19:54 cfedde interesting.
19:55 sri yay for anything that makes switching from mongodb to postgres easier
19:55 neilhwatson joined #mojo
19:56 cfedde anything to get my rocket scientists to learn a bit of sql.
19:56 cfedde I just sat through an explanation of a "join" being done using sub documents in a ES index.
20:03 Mikey sri: any plans to write a Mojo::Pg-based backend for Minion?
20:03 sri Mikey: yes
20:03 Mikey i knew it!  haha
20:04 sri i made migrations specifically for that
20:04 sri so it can just sync the schema and you don't have to do anything for upgrades
20:05 Mikey i am eager to get mongodb out of my depslist.  are you doing anything with the jsonb stuff in postgres or is it all sql?
20:06 sri not sure, i will certainly use some json, but i don't need indexes on it
20:06 Mikey when i saw Mojo::Pg it was like christmas morning
20:06 Mikey i am very excited about this stuff
20:09 * cfedde whispers Mojo::DBD
20:11 Mikey depending on how this all works out, i might be leaving dbic and database agnosticism behind and going 100% async postgres for everything
20:12 cfedde Most of what I do ends up being poly-rdbms
20:12 Mikey yeah, i use minion as a forking async job processor for blocking operations
20:13 Mikey but for the core app, with postgreSQL's 9.4 release having amazing doc store support, and so on..
20:13 Mikey i am about to kill so many birds with that one boulder.
20:14 Mikey i just dispatch to minion, and have all minion jobs tell zmq when they're done, it ends up being a fantastic situation where i both physically have cake, and also the opportunity to eat it.
20:14 sri i originally wanted to go poly-rdbms... then i learned more about postgres
20:14 cfedde reach into oracle to get a list of systems that have log data in sqlserver and confirm that a mysql table on the CPE has the right config data.
20:15 sri database without transactional ddl is a total no go for me
20:15 Mikey yep.  i can do all those operations in an async job and echo back the data in a nonblocking way to whatever server is interested in it using ZeroMQ
20:16 Mikey all without tying up my IOLoop with slow blocking queries
20:16 cfedde we use redis for that.
20:16 Mikey right now i use Sphinx, MongoDB, Memcached, AND Postgres
20:16 Mikey too much.
20:17 cfedde unfortunately our vendors get to make their own choices how they want to do persistance.
20:17 * cfedde puts his tiny violin away.
20:19 cfedde all I really want is an object system that represents the result of arbitrary DQL.  I'll write the sql myself thanks.
20:21 Mikey i really don't mind writing sql, i'm realizing.  even though i am perfectly happy with DBIx... the existence of a well written non blocking driver for my favorite rdbms that also happens to be a NoSQL db as well, is extremely compelling
20:23 cfedde of course postgres has hstore.  There is just so much value to the R part of rdbms in many cases. But there are places where it gets messy.
20:58 yuni I will need to build web service with Mojolicious fetching data from cassandra. Is there any recommended module for that? I found Net::Async::CassandraCQL, would it be work well with Mojolicious?
20:58 jberger_ joined #mojo
20:58 mst that's basically the only decent module, and IO::Async and Mojo::IOLoop will run together fine atop EV so far as I know
20:59 jberger_ franzkafka: did you see my message from earlier?
20:59 mst certainly, I believe that sri and LeoNerd expect it to work, and would consider it not doing to be somebody's bug
21:00 yuni i will test it out. just wanted to check if there is known issue.
21:00 yuni mst: thanks
21:00 franzkafka jberger_, your stackoverflow answer page is extensive
21:01 franzkafka it's a lot to go through
21:01 franzkafka jberger_, yes, and I am this close to being doing with it, finally, and without regexes
21:01 jberger_ Did you try the traversal methods?
21:01 franzkafka Now, after I am done I'd like to submit my code as a possible example in the docs
21:01 marcus joined #mojo
21:02 jberger_ Cool
21:02 sri Bender: trust marcus
21:02 Bender OK, sri
21:02 franzkafka jberger_, here's what I am doing: http://pastebin.com/ijjfNtwz
21:03 franzkafka I had to leave it for a bit (take my kid somewhere), but I am back and finishing it up now.
21:03 franzkafka jberger_, your advice was helpful as always, though I may not be doing exactly what you had in mind.
21:04 franzkafka Now, I am probably going to use a map in there, or something cleaner/nicer, but that's just my debugging to see if I can get at each <p> element under the h2 heading X
21:04 jberger_ I wish I had time to make an example for you
21:04 franzkafka sri, did you ever get your Bender hat?
21:05 jberger_ I might have an hour in about an hour, we'll see
21:05 franzkafka jberger_, it is cool, I like to figure things out myself. This may be a crappy solution, but I will continue working on it and hopefully make something decent.
21:05 franzkafka jberger_, thus the reason I am currently perusing your SO profile :D
21:06 franzkafka jberger_, but yeah, I definitely appreciate any guidance I get in here, and thank you for putting me on the right path
21:06 disputin joined #mojo
21:06 jberger_ I wish I could stomach SO  anymore
21:06 marcus https://github.com/torodb/torodb wow mom wow
21:06 jberger_ I did find it a useful way to help people
21:06 franzkafka What is it about SO that you can't stomach?
21:07 jberger_ No one searches anymore
21:07 jberger_ Just ask the same questions over and over
21:07 marcus I think I've never asked a question on SO
21:07 jberger_ The signal to noise has gone to almost zero
21:07 marcus but I've read a lot of answers
21:07 franzkafka jberger_, oh yeah, duplicates are annoying.
21:08 jberger_ Especially when you are trying to answer
21:08 jberger_ And the few good ones get "fastest gunned" immediately
21:09 franzkafka jberger_, I see you blog on perl.org now and then, what are your thoughts about that?
21:10 franzkafka jberger_, sometimes I read the comments and it just seems like the community nitpicks a lot more than they appreciate.
21:10 mst comments on the internet are invariably like that
21:11 mst in that the nitpickers are generally the ones with sufficient motivation to post
21:11 marcus I've gone a little crazy with keybindings on the mac lately :-/
21:11 mst generally if the comments to a post contain almost all nitpicks, that's a good sign that most readers broadly agreed with the post content but had nothing more meaningful than '+1' to contribute and so stayed silent
21:12 marcus Since I realized I could map the fn button to "hyper", I suddenly got a lot of available ones.
21:12 franzkafka mst, that's actually a good point
21:12 marcus I just removed comments from my blog. Didn't see the point.
21:12 marcus I'm reachable via twitter if there's anything.
21:13 marcus sri: did you see ToroDB? Now you can use Mango against postgres :)
21:14 jberger_ joined #mojo
21:14 franzkafka Hm, having a hard time finding an example passing a filehandle to Mojo::DOM... Do you just slurp the data into a variable and pass it that? I'm doing that and it works, but just making sure I'm not doing it wrong.
21:15 franzkafka sri> yay for anything that makes switching from mongodb to postgres easier
21:16 * marcus confuse
21:21 franzkafka Sorry, I was quoting sri's response to ToroDB :D
21:21 franzkafka I imagine that you're using convos though, so you didn't even miss it.
21:23 marcus franzkafka: thanks, I did miss it, because of a slight mishap with demo.convos.by which caused us to get banned from this network for the moment. :-/
21:29 marty haha.  the manufacturer representative from Toro (http://www.toro.com/en-us/ir​rigation/pages/default.aspx) was just in my office.   I am totally confused.
22:17 Ptolemarch joined #mojo
22:28 marmez joined #mojo
22:47 jberger franzkafka: I won't have time for a while yet
22:48 jberger sorry :(
22:48 jberger franzkafka: can you repost the source document?
22:50 jberger And perhaps a data structure you might hope to extract from it
22:50 bpmedley joined #mojo
23:09 sri marcus, jberger, batman, crab, batman: i'll merge this soon, last chance https://github.com/kraih/mojo/pull/699
23:09 sri s/batman/tempire/
23:13 davido_ joined #mojo
23:36 sri jberger: personally, i don't think i'll Mojo::DOM::AUTOLOAD at all
23:36 sri *+miss
23:37 sri ->at('foo > bar') is always better
23:37 sri just Mojo::Collection::AUTOLOAD hurts a little
23:38 sri because of the ->pluck(...) everywhere
23:39 sri and no, i don't think ojo could bring that back
23:40 sri perl -Mojo -E 'say g("mojolicio.us")->dom->find("h1, h2, h3")->text'
23:40 sri that was pretty neat
23:43 good_news_everyon joined #mojo
23:43 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/Aoo4_A
23:43 good_news_everyon mojo/master 6c8e9fa Sebastian Riedel: Merge pull request #699 from kraih/less_autoload...
23:43 good_news_everyon left #mojo
23:47 sri allright, you're all too late now! ;p
23:48 marty joined #mojo
23:54 good_news_everyon joined #mojo
23:54 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/8U96BQ
23:54 good_news_everyon mojo/master 358eb23 Sebastian Riedel: no imports in the base class either
23:54 good_news_everyon left #mojo
23:59 sri on the plus side, i think this also solves the Mojo::Collection stringify problem, since all Mojo::DOM return values are very predictable now

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