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

IRC log for #mojo, 2015-06-10

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

All times shown according to UTC.

Time Nick Message
00:02 disputin joined #mojo
00:16 woz joined #mojo
00:19 aggrolite joined #mojo
00:37 mattastrophe joined #mojo
01:13 bpmedley_ joined #mojo
01:18 punter joined #mojo
01:27 klapperl joined #mojo
01:34 damaya_ joined #mojo
02:06 woz joined #mojo
02:12 plicease joined #mojo
02:21 aggrolite joined #mojo
02:27 zivester joined #mojo
02:29 noganex_ joined #mojo
02:35 mattastrophe joined #mojo
02:36 hshong joined #mojo
02:38 plicease joined #mojo
02:58 aggrolite joined #mojo
03:12 aggrolite joined #mojo
03:26 kaare joined #mojo
03:51 aggrolite joined #mojo
04:19 davido__ joined #mojo
04:20 aggrolite joined #mojo
05:20 zivester joined #mojo
05:57 dotandimet joined #mojo
06:35 dod joined #mojo
06:38 dod joined #mojo
06:43 howitdo joined #mojo
06:53 panshin joined #mojo
07:00 McA joined #mojo
07:03 eseyman joined #mojo
07:09 damaya__ joined #mojo
07:09 damaya__ Is there a debug in Mojo::Pg to show the query?
07:14 ans joined #mojo
07:16 batman damaya__: DBI_TRACE=1 (or higher)
07:19 damaya__ ok perfect, forget sometimes it's just DBD::Pg under the hood.
07:20 turael joined #mojo
07:23 ToApolytoXaos joined #mojo
07:27 trone joined #mojo
07:33 amon joined #mojo
07:54 gatitskiy joined #mojo
08:12 Vandal joined #mojo
08:22 plicease joined #mojo
08:23 martin_ joined #mojo
08:31 plicease joined #mojo
08:33 martin_ anyone here aproached shibboleth authentication in mojo?
08:33 martin_ I've always done shibboleth with apache + cgi/plack or whatever so far...
08:34 martin_ I'm wondering if there's any aproaches to using hypnotoad with it?
08:34 martin_ using the native shibboleth package to do most of the work and using 'server variables' to pass attributes and the like as per the apache mod_shib approach
08:53 kininarimasu joined #mojo
09:06 ans1 joined #mojo
09:07 Adura joined #mojo
09:15 dotan joined #mojo
10:23 ans joined #mojo
10:37 batman i want to store a data structure from my app. what would be a fast way to do that? Storable? Data::Dumper...? any other option?
10:37 bpmedley How complex is the data structure?
10:38 pink_mist store it for what purpose? do you want to be able to retrieve it again? if so, definitely not Data::Dumper ...
10:39 pink_mist I'd rather suggest YAML
10:39 bpmedley I’d consider JSON
10:39 batman bpmedley: %data = ($uid => {key => 123, other_data => "foo"});
10:39 sri the old minion file backend wasn't too bad
10:40 sri Storable + gzip
10:40 batman sri: why does it use DBM::Deep now?
10:41 sri because DBM::Deep is nice
10:41 * tomboh likes Sereal
10:41 sri actually uses blocks
10:42 batman i'm confused... so the old version was nice, but you changed to DBM::Deep because it's nicer..? faster...? portable..?
10:42 sri DBM::Deep only accesses the blocks of data you need, not the entire file
10:42 sri DBM::Deep is basically a real database
10:43 batman aha. i see.
10:43 batman thanks
10:43 sri with Storable you just rewrite the whole file
10:43 sri very inefficient
10:43 sri but if you're just storing config data, it doesn't matter of course
10:44 sri for a job queue it does matter a lot
10:44 batman what about DBM::Deep v.s Cache::FastMMap ?
10:45 batman i guess they store things differently...
10:47 bpmedley Looks like Cache::FastMMap is geared towards sharing data between processes? In addition, FastMMap uses Storable.
10:49 batman bpmedley: Storable is used for serializing the "values"
10:49 batman nevermind. they can't really be compared i guess.
10:51 sri DBM::Deep is pretty unique
10:51 sri it's comparable to berkeleydb
10:52 sri just in pure perl
10:56 neilhwatson joined #mojo
11:08 martin_ now there's people around.. anyone have any thoughts on my earlier question.. shibboleth with hypnotoad?
11:32 * batman can't even pronounce shibboleth
11:33 Grinnz joined #mojo
11:44 * sri can't either
11:46 sri oh, os x 10.11 will be using libressl instead of openssl :o
11:49 stephan48 martin_: if you can make shibboleth use http headers instead of env variables, you might be able to get it working
12:04 ans joined #mojo
12:11 panshin joined #mojo
12:11 panshin joined #mojo
12:11 ans1 joined #mojo
12:19 frederic_ joined #mojo
12:23 dod joined #mojo
12:33 martin_ hmmm.. will have to delve further
12:36 bwf joined #mojo
13:03 dod joined #mojo
13:11 jberger sri: got some nice comments on my shirts the past few days
13:12 jberger Cloud and crossbones day 1, then perl 5 raptor yesterday
13:13 sri jberger++
13:13 jberger Someone else was wearing the failraptor yesterday too
13:14 sri how is the print quality of the failraptor one?
13:14 sri (not actually seen that one yet)
13:15 jberger Print quality is nice, though he wasn't add sure about the shirt fabric
13:20 ZoffixWork joined #mojo
13:21 * sri pokes Grinnz
13:23 Grinnz hi
13:23 * ZoffixWork pokes the pokes
13:24 jberger Who pokes the pokers?
13:25 ZoffixWork The pokers pokers, of course!
13:25 * pink_mist has a straight flush!
13:25 * genio folds
13:26 pink_mist (I might be bluffing)
13:27 jabberwok POKE 59458,62
13:27 genio I don't want to pay to find out; I have no cards and thus can't win.
13:32 gatitskiy joined #mojo
13:33 batman does anyone do failover when using Mojo::mysql or Mojo::Pg ? i got a master/slave setup, where i can read from both and i want to failover to the slave if the master is down.
13:34 batman sounds like something that must have been solved already...
13:36 sri is master/slave still the right terminology?
13:36 batman sri: i think it is in *mysql universe*
13:37 * sri thought you say master/replica of primary/secondary now
13:37 sri s/of/or/
13:40 * batman don't know
13:48 ribasushi correct, you say the above when you need to sound american
13:50 good_news_everyon joined #mojo
13:50 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vI6rB
13:50 good_news_everyon mojo/master b175311 Sebastian Riedel: welcome to the Mojolicious core team Dan Book
13:50 good_news_everyon left #mojo
13:50 sri \o/
13:51 jberger Grinnz++ welcome aboard!
13:51 sri (that is Grinnz++)
13:52 Grinnz :D
13:54 sri Grinnz: are you on twitter?
13:55 Grinnz technically but i dont use it much
13:55 Grinnz https://twitter.com/TheGrinnz
13:59 jkramer joined #mojo
13:59 jkramer Ahoy
14:00 jkramer Is there a nice way to dispatch routing to a controller and from there add more routes? Like in the nested routing example, but with the nested routes added from inside a controller
14:01 sri Grinnz: think i've assigned all permissions now, go crazy
14:01 jkramer I have plenty of routes in the base application module and I'd like to clean it up a little. Like /foo => Some::Controller, and then in Some::Controller add routes (/foo)/bar, (/foo)/baz etc to local actions
14:05 Grinnz jkramer, routes are added on startup, not in controllers
14:05 Grinnz you can make a route object for /foo, and then make sub routes for /bar and /baz
14:06 Grinnz set /foo as to(controller => 'Some::Controller') and /bar as to(action => 'blah') etc
14:07 jberger Grinnz: you aren't a REAL core member until you release Mojolicious
14:07 jberger :-P
14:07 jberger so get on it!
14:07 jberger (when there's something ready of course)
14:07 Grinnz hah
14:09 absolut_todd joined #mojo
14:09 jkramer Grinnz: Yeah, I was just hoping that I could somehow clean this route mess up a little by moving them somewhere else
14:12 sri yea, someone come up with a cool new feature so Grinnz can release something!
14:13 mad_hatter joined #mojo
14:13 mad_hatter hey...just out of curiosity...you guys haven't done a Mojo::mysql per chance?
14:15 Grinnz https://metacpan.org/pod/Mojo::mysql or https://metacpan.org/pod/Mojo::MySQL5
14:16 mad_hatter yep seen it just now
14:16 mad_hatter thanks grinnz
14:16 mad_hatter didn't know if that shipped with the mojolicious package
14:16 gryphon joined #mojo
14:16 jkramer How about adding this: $r->any('/foo')->to(dispatch => 'some-controller#dispatch'); sub Some::Controller::dispatch { my ($c, $r) = @_; $r->get('/bar')->to(action => 'bar') }
14:16 Grinnz no, neither does Mojo::Pg
14:16 jkramer Which would call Some::Controller::dispatch on startup with the routes object as param so it can add more routes
14:17 jkramer Or something like this
14:17 jkramer Then Grinnz has something to release :)
14:18 Grinnz i usually just pass the route object to a function that adds all its sub routes, but loading the controller class on startup is another thing entirely
14:18 jkramer Basically it would just do: my $u = $r->under('/foo'); Some::Controller->dispatch($u)
14:18 jkramer Grinnz: Yeah I thought about that too but I don't want to load controllers manually/explicitly
14:19 Grinnz theres no need to put the routes in the controller
14:19 jkramer No, but it would help keeping things cleaner
14:19 sri jkramer: already exists
14:19 sri http://blog.kraih.com/post/43198653667/mojolicious-hack-of-the-day-mojolyst
14:19 Grinnz nice
14:21 sri works because of http://mojolicio.us/perldoc/Mojolicious/Guides/Routing#Embed-applications
14:22 jkramer Hmm nice
14:24 jkramer Do embedded applications share all the goods with the main application, like config, loaded plugins etc?
14:24 jkramer Or are the complete seperate applications that just happen to appear under some path withing the main application?
14:27 sri separate
14:28 jkramer Hmm, then I can't use it
14:31 dotan Congrats, Grinnz! (reading backlog)
14:34 jabberwok jkramer: what is your use-case for wanting to do it that way
14:35 jkramer jabberwok: I just want to clean things up a little because I have a huge list of routes in the base application which gets a little hard to manage. I'd like to move the routes to the controllers where they're relevant
14:37 batman Grinnz: wohooo! :) awesome that you're onboard!
14:37 batman Grinnz: https://gist.github.com/jhthorsen/4eee9d2ebd57bc8c21dd <--- i made those notes when i got to be part of mojolicious core
14:37 Grinnz thanks batman :)
14:37 batman mad_hatter: not sure what "done a Mojo::mysql" means, but i wrote that module.
14:38 batman mad_hatter: i also wrote https://metacpan.org/pod/Mad::Mapper (ref your nick, hehe)
14:38 jkramer "7) notice you've included garbage files like .DS_Store and return to step 1" XD
14:38 Grinnz lol
14:38 batman yeah. it was some rough first hours....
14:39 batman hehehe
14:39 jkramer Nice, I didn't know there's a mojo twitter account
14:40 jkramer Where is it though? :D
14:42 batman jkramer: i don't think it exists...? you have @kraih and #mojolicious ...
14:43 Kogurr joined #mojo
14:44 jkramer Ah, I just thought because of "5) tweet release if there were noteworthy changes,"
14:44 batman ah. right. yeah, just "some cool new stuff in #mojolicious. Enjoy! #perl"
14:45 jkramer Ok :)
14:47 sri yea, we never managed to get a good mojolicious account on twitter
14:47 sri @mojolicious is just some redneck that never uses it :(
14:48 * Grinnz can always do a grammar nazi release if nothing better comes up ;)
14:48 pink_mist what about something like @perl-mojo or something?
15:04 aggrolite joined #mojo
15:07 jberger batman: re #7, I'm pretty sure I had cruft in my release
15:07 jberger sigh
15:08 jberger maybe we should take another look at our MANIFEST.SKIP
15:13 jkramer Grinnz: You could at sha512_{sum,bytes} to Mojo::Util if you're looking for something to release :)
15:14 jkramer *add
15:15 dvinciguerra joined #mojo
15:30 jberger is there any sane way to turn this into a useful plugin?
15:30 jberger https://gist.github.com/jberger/0006750cdfae8f078791
15:30 * jberger is feeling very CPAN-y
15:30 jberger this might also finally be the week that Class::Anonymous goes out
15:30 jberger preaction: ^^
15:31 ToApolytoXaos joined #mojo
15:31 jberger also working on a better Dancer::Template::MojoTemplate (which I probably will call Dancer::Template::EmbeddedPerl)
15:35 jabberwok so, that lets you pass named but arbitrarily positioned parameters properly to a function defined with Kavorka?  Fancy.  i always love data-driven-programming.
15:37 disputin joined #mojo
15:44 sri jberger: sane way? looks good enough to me
15:45 jberger its not super evil not to call $next?
15:45 sri nope
15:45 jberger hmmmmmmm
15:46 sri the last step does nothing else
15:46 sri would only matter if there are other around_action hooks, and then you can adjust the order
15:47 jberger or just warn the users that it has to be the first loaded plugin?
15:47 jberger (they go in reverse order right?)
15:47 sri i don't remember
15:47 jberger I knew when I first wrote this a few months ago
15:47 jberger I would be sure
15:47 sri it's a recipe in the guides btw. http://mojolicio.us/perldoc/Mojolicious/Guides/Routing#Hooks
15:48 jberger yeah, that was my inspiration
15:48 sri \o/
15:48 jberger I just haven't ever used a hook in a plugin that I shipped to CPAN
15:48 jberger at least not a hook that was that intrusive
15:49 jberger I think I might have an after_render somewhere
15:58 ZoffixWork Grinnz++ # core :)
16:01 aggrolite joined #mojo
16:05 damaya_ joined #mojo
16:10 damaya__ joined #mojo
16:26 sh4 joined #mojo
16:28 aggrolite joined #mojo
16:55 panshin joined #mojo
17:15 trone joined #mojo
17:15 asarch joined #mojo
17:25 TheGrinnz joined #mojo
17:54 aggrolite joined #mojo
18:04 PryMar56 joined #mojo
18:14 dod joined #mojo
18:30 bin_005 joined #mojo
18:36 gatitskiy joined #mojo
18:45 panshin joined #mojo
18:51 trone joined #mojo
18:53 gatitskiy joined #mojo
19:19 gatitski_ joined #mojo
19:21 aggrolite any mojo modules out there that help you easily submit a form? something like mech’s submit_form()
19:24 mishanti1 aggrolite: Mojo::UserAgent->new->post($url => form => {foo=>'bar'})?
19:24 mishanti1 Or something like that?
19:24 purl somebody said something like that was totally possible
19:25 aggrolite mishanti1, i would want something that help mojo::useragent build the form fields (for web scraping)
19:26 aggrolite e.g. submit a form that has input fields containing values that could change often
19:27 pink_mist aggrolite: but you need to know what to fill in anyway, so just post a request to where the form is meant to post
19:28 Grinnz_ aggrolite: the form is generated from a regular hashref, you can manipulate that as you want
19:28 Grinnz_ form => {} is a form generator
19:30 zackiv31 joined #mojo
19:33 jberger you all should be watching this teletype talk
19:33 pink_mist link?
19:34 jberger using Mojo to drive a literal teletype machine
19:34 aggrolite room?
19:34 purl WITH A MOOSE! or 581% quieter without the extra fans.  And three degrees cooler.
19:34 jberger http://www.yapcna.org/yn2015/talk/5943
19:34 pink_mist thanks
19:34 jberger B
19:36 jberger I'm not sure if you can see it in the stream, he has two of these things in the room
20:02 foutrelis joined #mojo
20:04 foutrelis something I was never able to figure out; do routes defined using 'get' in a mojolicious lite app get an implicit name I can pass to url_for in a template? e.g. would this route have a name assigned to it? https://github.com/foutrelis/arch-rebuilds/blob/master/master/server.pl#L122
20:05 jabberwok my dad and me renovated an ASR-33 back in 1979.  what a bundle of oil^H^H^H^H^H^H^H mechanical marvel
20:05 disputin joined #mojo
20:06 jberger foutrelis: I believe that that would be "logbaselog"
20:06 Grinnz_ foutrelis: routes in a lite app are still regular route objects, you just dont get the object normally
20:07 jberger foutrelis: you can also pass an explicit name as the last argument
20:07 jberger get '/log/(:base).log' => sub { ... } => 'log';
20:07 foutrelis ooh that's nifty :3
20:08 foutrelis thanks, I'll give your suggestions a try in a bit!
20:17 foutrelis yay, both implicit and explicit names work ^-^
20:21 sri interesting post about going async http://blog.parse.com/learn/how-we-moved-our-api-from-ruby-to-go-and-saved-our-sanity/
20:22 sri foutrelis: http://mojolicio.us/perldoc/Mojolicious/Guides/Routing#Named-routes
20:23 sri or even http://mojolicio.us/perldoc/Mojolicious/Guides/Tutorial#Route-names
20:24 sri how did you miss those?
20:24 foutrelis I might have missed the second one
20:24 foutrelis and couldn't apply the first to my lite app
20:27 bin_005 joined #mojo
20:32 sri guess we have no feature for Grinnz_ yet :/
20:33 sri jberger: any wishlist items from yapc?
20:35 mattastrophe joined #mojo
20:35 genio a magic, write-all-my-code-for-me-but-let-me-still-get-paid function?
20:39 pink_mist ohh, implement that, Grinnz_!
20:39 pink_mist +1
20:40 purl 1
20:40 Grinnz_ Mojo::Plugin::IllegalOutsourcing
20:52 gatitskiy joined #mojo
21:06 sivoais joined #mojo
21:31 aggrolite joined #mojo
21:37 aggrolite joined #mojo
22:07 jberger btw, the last lightning talk was about DNS and a monitoring tool
22:07 jberger https://github.com/reyjrar/DreamCatcher/blob/master/lib/DreamCatcher.pm
22:08 jberger use Mojo::Base 'Mojolicious';
22:08 jberger sri: lots of praise and several questions, no feature requests so far
22:33 absolut_todd joined #mojo
22:42 foutrelis left #mojo
23:03 theo_ joined #mojo
23:03 al joined #mojo
23:27 ningu joined #mojo
23:28 ningu say I have this: my $dom = Mojo::DOM->new('<div>foo<b>bar</b>'). is there any way to get the text out as 'foobar' rather than 'foo bar'?
23:28 ningu $dom->all_text(0) doesn't seem to work.
23:28 ningu er, forgot the </div> there but you get the idea :)
23:31 ningu apparently not. :( https://metacpan.org/source/SRI/Mojolicious-6.11/lib/Mojo/DOM.pm#L330
23:31 Grinnz_ $dom->descendant_nodes->map("text")->join
23:31 ningu aha
23:31 Grinnz_ is one way, probably not the most efficient
23:31 ningu interesting, though
23:31 dvinciguerra joined #mojo
23:32 jberger perl -Mojo -E 'x("<div>foo<b>bar</b></div>")->find("*")->map("text")->join->say'
23:32 ningu cool
23:33 jberger basically the same a Grinnz_
23:34 ningu separate one, what if I wanted to map the contents of each <b> tag or something? I guess $dom->find('b')->each(sub { $_->content(munge($_->content)) });
23:36 ningu that seems like it should work. will try it.
23:36 ningu by 'map' I meant transform in a particular way.
23:43 ningu hrm, I seem to be missing something here.
23:43 ningu my $ex = $entry->at('.unicode'); # where .unicode is something like: <span class="unicode">kora-kora</span>
23:43 ningu but if I do $ex->find('*')->map('text')->join I don't get kora-kora.

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