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

IRC log for #mojo, 2014-09-08

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

All times shown according to UTC.

Time Nick Message
00:10 woz joined #mojo
00:15 * jberger_ now understands how sri makes his living ;-)
00:18 d4rkie joined #mojo
00:41 woz joined #mojo
00:41 woz joined #mojo
01:48 actuallymarcus joined #mojo
01:50 Akron joined #mojo
02:49 actuallymarcus joined #mojo
02:56 noganex_ joined #mojo
03:08 basic6 joined #mojo
03:15 woz joined #mojo
03:37 cfedde joined #mojo
03:38 ashleydev joined #mojo
03:52 klapperl joined #mojo
03:52 ua_ joined #mojo
04:18 woz joined #mojo
04:26 woz joined #mojo
04:29 good_news_everyon joined #mojo
04:29 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/fnSa3A
04:29 good_news_everyon mojo/master 611cff8 Sebastian Riedel: optimized a few small things in Mojo::Parameters
04:29 good_news_everyon left #mojo
04:30 sri there has to be a better way to do this https://github.com/kraih/mojo/blob/master/lib/Mojo/Parameters.pm#L127
04:31 sri the pair functions in List::Util are kinda neat... but new in Perl 5.20
04:31 sri so i guess those are out for now
04:37 Averna joined #mojo
04:57 woz joined #mojo
05:19 actuallymarcus joined #mojo
05:24 good_news_everyon joined #mojo
05:24 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/xvijNw
05:24 good_news_everyon mojo/master 609c8d9 Sebastian Riedel: added empty path test
05:24 good_news_everyon left #mojo
05:25 sri i bet this one can be optimized as well https://github.com/kraih/mojo/blob/master/lib/Mojo/Path.pm#L13
05:47 cpan_mojo Mojo-Email-Checker-SMTP 0.03 by SNELIUS - http://metacpan.org/release/SNELIUS/Mojo-Email-Checker-SMTP-0.03
05:51 Eke- joined #mojo
05:53 fhelmber_ joined #mojo
05:53 dod joined #mojo
05:59 woz joined #mojo
06:09 Vandal joined #mojo
06:22 dp_ joined #mojo
06:25 Snelius joined #mojo
06:42 KCL_ joined #mojo
06:48 denis_boyun joined #mojo
07:00 woz joined #mojo
07:03 actuallymarcus joined #mojo
07:11 ver joined #mojo
07:11 woz joined #mojo
07:13 sujithm joined #mojo
07:15 basiliscos joined #mojo
07:24 rawler joined #mojo
07:26 trone joined #mojo
07:30 fhelmber_ joined #mojo
07:38 sujithm joined #mojo
07:47 odc who here uses SMTP email validation?
08:09 zapho53 joined #mojo
08:10 zapho53 Can someone tell me how Mojo has managed to succeed with its non-blocking IO web server where Ruby failed? Are Perl and Ruby that different to make this possible?
08:13 edestler joined #mojo
08:17 ashleydev joined #mojo
08:30 Snelius odc: yes i am
08:34 odc Snelius, how does that work for you? Are you able to validate all the addresses with it?
08:36 Snelius odc: yes i can, but false positive is possible too. If your server blacklisted for example ;)
08:37 odc oh
08:37 odc and i guess there is no way to know if you are blacklisted, right?
08:38 Snelius yep. bacause response is very different for this case.
08:39 Snelius but for common tasks it's very useful
08:42 Snelius odc: if ur blacklisted or other shit, the module set defined both variants (error and valid) for your choose for this case.
08:46 odc i see. Thanks Snelius!
08:47 ashleydev joined #mojo
08:49 Snelius u're welcome :)
09:02 basiliscos joined #mojo
09:04 ashleydev joined #mojo
09:18 sujithm joined #mojo
09:22 basiliscos joined #mojo
09:25 bzero Hello. What does "state" means? sub { state $db = ... }
09:26 bzero Ah. It's perlish ;) Sorry.
09:26 odc yep, perldoc -f sate
09:30 ashleydev joined #mojo
09:31 preaction joined #mojo
09:48 Lee joined #mojo
09:54 sujithm_ joined #mojo
09:59 ashleydev joined #mojo
10:03 sujithm joined #mojo
10:19 neyasov joined #mojo
10:22 sujithm_ joined #mojo
10:29 denis_boyun joined #mojo
10:31 ashleydev joined #mojo
10:46 cpan_mojo MojoX-CustomTemplateFileParser 0.05 by CSSON - http://metacpan.org/release/CSSON/MojoX-CustomTemplateFileParser-0.05
10:53 sujithm joined #mojo
10:53 cpan_mojo Mojolicious-Plugin-Sentry 0.1 by LIKHATSKI - http://metacpan.org/release/LIKHATSKI/Mojolicious-Plugin-Sentry-0.1
11:05 Insane joined #mojo
11:06 Insane hi all, how could I access my helpers inside before_render hook?
11:06 Insane $c->helpers->Helper() fails with error Event "read" failed: Can't locate object method "helpers" via package "Mojolicious::Controller" at
11:09 marcus Insane: $c->app->helpers ?
11:09 marty actually I think it's just $c->helper()
11:10 Insane $c->app->helpers : Event "read" failed: Can't locate object method "helpers" via package "Cto"
11:10 Insane Cto is the projct name
11:10 batman marty: is helper() an actual method, or the name of any "helper" ? like $c->db() ?
11:10 marty name of the helper
11:11 marty like $c->my_helper()
11:11 batman Insane: just call the helper method on $c
11:11 Insane Event "read" failed: Can't locate object method "ErrorReport" via package "Mojolicious::Controller"
11:11 marty tested it here, works for me
11:11 Insane huh, yes $c->helper works
11:11 Insane thx
11:20 d4rkie joined #mojo
11:23 Akron joined #mojo
11:24 Akron "drug empire approved" would be even a better tag line than "web development can be fun again"!
11:27 Akron Insane: $c->helpers->$helper is pretty new, may be your Mojo version is outdated.
11:28 punter joined #mojo
11:54 cpan_mojo Dist-Zilla-Plugin-Test-CreateFromMojoTemplates 0.04 by CSSON - http://metacpan.org/release/CSSON/Dist-Zilla-Plugin-Test-CreateFromMojoTemplates-0.04
12:02 suy joined #mojo
12:11 neilhwatson joined #mojo
12:12 sujithm joined #mojo
12:22 sujithm_ joined #mojo
12:26 howitdo joined #mojo
12:30 lipizzan joined #mojo
12:36 r0b3rt joined #mojo
12:39 Akron batman: Are there best practices for providing assets for AssetPacks from plugins? I now added support for AssetPack that way - don't know if it is what you would recommend: https://github.com/Akron/Mojolicious-Plugin-Notifications#notifications
12:40 batman Akron: maybe https://github.com/jhthorsen/mojolicious-plugin-bootstrap3/blob/master/lib/Mojolicious/Plugin/Bootstrap3.pm#L233 can give you some ideas
12:43 Akron batman: But that would create thew bundled assets. I like all scripts and styles in one file.
12:43 batman Akron: then i don't understand the question :(
12:44 batman ah! you're trying to tell the end user how to bundle -your- files inside their own packed asset?
12:44 batman your files = the files from your plugin
12:44 Akron Exactly.
12:45 batman then the way you did it makes sense, except the $assets variable is confusing imo
12:45 Akron Okay ... yeah, the example is a bit confusing.
12:46 batman i would just do $app->asset('app.js'  => $app->notifications->scripts);
12:46 aleksey joined #mojo
12:46 Akron Okay.
12:46 Akron Thanks.
12:46 aleksey left #mojo
12:46 batman or even, $app->asset('app.js'  => "js/your-own-script.js", $app->notifications->scripts);
12:46 Akron I thought if there is something like a default js-asset and a default css-asset, I could ask for that in the plugin and add assets right away.
12:47 Akron batman: Yepp - that's even more clear.
12:47 batman no, there's no such thing
12:47 batman you could also do $app->notifications->assets('js');
12:47 batman or maybe asset_list("js")
12:48 batman another thing...since you're asking for best practices... why do you call it $mojo??
12:48 batman my ($plugin, $mojo, $param) = @_;
12:49 batman i urge you to do my ($self, $app, $config)
12:49 Akron I am nearly always using $mojo, but you are right.
12:50 batman no-one else is using $mojo. that's my point.
12:50 batman my $helpers = $mojo->renderer->helpers; # where is $helpers used?
12:51 batman and why do $mojo->plugins->load_plugin($engine); when you can do $mojo->plugin($engine); ?
12:51 Akron The problem with this was the registering phase - don't know if this is still the case. load_plugin is not the same.
12:52 batman ah. sorry about that
12:52 Akron The $helpers was an artifact - thanks.
12:56 Akron batman: Thank you for your recommendations, I updated the code, though I like styles and scripts better than asset('js'), as the methods are also used to add scripts and styles.
12:56 Akron batman++
12:57 cpan_mojo Mojolicious-Plugin-BootstrapHelpers 0.014.001 by CSSON - http://metacpan.org/release/CSSON/Mojolicious-Plugin-BootstrapHelpers-0.014.001
13:00 cpan_mojo Mojolicious-Plugin-Notifications 0.4 by Nils Diewald - http://metacpan.org/release/AKRON/Mojolicious-Plugin-Notifications-0.4
13:01 Akron batman: Nowadays I use AssetPack everywhere, so I guess support by plugins should be as easy as possible.
13:02 batman i agree :)
13:02 batman Akron: do you also have "default" files? i see that you don't use jquery, but do you rely on polifyll libraries or anything like that?
13:03 batman the reason i'm asking is that if you might want to add an option to exclude the common js/css assets, if you happen to have something like that
13:06 Akron batman: Switches like -no_include are engine specific. Neither alertify nor humane are depending on further frameworks that might be already bundled. In that case an engine should have -no_jquery or something like that, I guess.
13:06 batman excellent
13:07 Akron But you are right - this should be also filtered for assets ... have to think about that.
13:07 Akron I guess as a parameter on registration. I should find a notification library to create such an example. ;)
13:08 batman don't add filter if you don't have colliding assets
13:08 Akron I think non-embedding of assets should be part of registrations as well.
13:08 Akron batman: What do you mean?
13:10 batman "this should be also filtered for assets" <-- don't do any filtering if all your assets are special for your plugin
13:12 Akron Sure. I meant: When I just have the switch for embedding ("-no_include"), this doesn't mean it's not in ->notifications->styles or ->notifications->scripts. But it should be filtered there in case it is used by other plugins or the app, e.g. on registration { MyEngine => { not_include => [qw/jquery scripts/]}} or similar.
13:13 Akron But this is all engine specific and doesn't change the way the plugin works.
13:16 batman ok
13:38 abhishekisnot joined #mojo
14:05 GillesM joined #mojo
14:18 sri so nobody can golf this down to something more elegant/efficient? https://github.com/kraih/mojo/blob/master/lib/Mojo/Parameters.pm#L127
14:19 sri bonus points for golfing down https://github.com/kraih/mojo/blob/master/lib/Mojo/Path.pm#L13
14:20 sri perl -Ilib -Mojo -E 'my $p = Mojo::Parameters->new("a=b&a=c&d=e&f=g&a=x&f=y"); n{ $p->to_hash } 100000'
14:20 sri a one-liner to make sure it's not slower
14:23 neyasov joined #mojo
14:24 * jberger_ will try later today
14:30 cpan_mojo Mojolicious-Plugin-CBOR 0.02 by DSHADOW - http://metacpan.org/release/DSHADOW/Mojolicious-Plugin-CBOR-0.02
14:40 r0b3rt joined #mojo
14:41 disputin joined #mojo
14:41 mst sri: http://paste.scsys.co.uk/422073 # not so much golfed as rethought, may or may not be faster
14:45 sh4 joined #mojo
14:50 sri mst: a lot slower i'm afraid, went from 1.3s to 1.6s here
14:52 mst wonder if it's the for/while change or the other one that matters
14:54 sri a sum of both actually, if i switch that back to for it drops to 1.5s
14:58 sujithm joined #mojo
14:59 sri (i did fix that one line mst forgot to remove btw... in case someone stumbles over this later)
15:00 sri this would be kinda nice and i bet fast... but new in 5.20... https://metacpan.org/pod/List::Util#pairmap
15:04 sri oh, it actually isn't
15:05 sri 1.5s
15:05 dp_ it might be a bit shorter if you use $self->param($name) I guess
15:06 sri and terribly slow
15:07 denny joined #mojo
15:07 dp_ and seems like param is calling to_hash anyway :)
15:08 sri the fact that pairmap is slow surprised me a little
15:24 disputin joined #mojo
15:29 sri interesting, promises are an anti-pattern at paypal http://www.slideshare.net/jeharrell/9-antipatterns-for-nodejs-teams
15:33 neyasov joined #mojo
15:35 sri i guess the performance point is valid
15:47 good_news_everyon joined #mojo
15:47 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/UsgCwQ
15:47 good_news_everyon mojo/master 065e4e3 Sebastian Riedel: fixed typo in cookbook
15:47 good_news_everyon left #mojo
16:01 disputin joined #mojo
16:05 dod joined #mojo
16:07 denis_boyun joined #mojo
16:26 sri batman/marcus: competition! https://github.com/erming/shout
16:26 cfedde anti-pattern #0 using the cool new thing for everything
16:32 sri not using a database makes it quite a bit easier to install
16:42 batman sri: looks good :)
16:44 sri an in-memory backend for convos could be nice, would certainly get me hacking on it
16:45 batman then we need to be limited to one process, right?
16:45 sri right
16:46 sri most people don't really need more, it's why you're non-blocking :)
16:46 batman i don't know why, but convos seems to be rather slow when using just one process.
16:46 batman i think we have messed up somewhere, but i can't figure out where
16:46 sri and if you need to scale up... switch to the redis backend
16:47 disputin joined #mojo
16:47 batman i might do in-memory when we get the archive system up and running
16:48 batman i need search() and some other things to work...
16:49 sri which reminds me... there is still no 3rd party backend for minion!
16:49 rawler joined #mojo
16:52 basiliscos joined #mojo
16:52 moritz sri: I was close to writing a RabbitMQ backend
16:52 moritz sri: but in the end, $work chose python + taskflow
17:03 btyler sri: the patch I submitted to Mojo::Redis2 was a prelude to starting to poke at a redis minion backend. I took a bit of a break to play with perl6 bindings to jansson and discount, but that's probably my next project
17:14 good_news_everyon joined #mojo
17:14 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/LC-Kgg
17:14 good_news_everyon mojo/master 13c8577 Sebastian Riedel: simplify canonicalization a little
17:14 good_news_everyon left #mojo
17:20 sri this list thread reminds me that the keeping $tx alive thing is not explained anywhere in the docs https://groups.google.com/forum/#!topic/mojolicious/raD_NRMmzpQ
17:25 sivoais joined #mojo
17:26 sujithm joined #mojo
17:33 sri maybe something like this would make sense https://gist.github.com/anonymous/450af60525af294150cf
17:33 marcus shout looks pretty good.
17:37 good_news_everyon joined #mojo
17:37 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/8CKO4w
17:37 good_news_everyon mojo/master 0eb0214 Sebastian Riedel: more detailed explanation for delay helper
17:37 good_news_everyon left #mojo
17:37 marcus We have a lot more features, but they win on simplicity so far.
17:40 sri yea, i couldn't irc without the dotted red line :)
17:40 sri but an in-memory backend would make getting started *A LOT* easier
17:41 sri "cpanm Convos; convos daemon" and you're ready to start... that would be cool
17:42 * marcus what's coming to replace Carton.
17:42 * marcus wonders even
17:45 marcus sri: it's kind of useless that it doesn't save any config at least tho
17:46 cfedde sqlite?
17:46 purl i guess sqlite is an instant database! also easy to backup (one file per database). like a local mysql install, but with a sane upgrade path. see DBD::SQLite (no server required! joy!), and also the fk trigger generator at http://xrl.us/t4tb or pfn but it has dangerous crocodiles or nice, but it will in rare situations throw strange errors at me. or acceptable or kicks the crap out of MySQL
17:46 marcus if you restart shout, it forgets what servers and channels you were on.
17:48 sri marcus: well, that can just be a json file
17:49 sri znc dumps its configuration into a text file too
18:00 rawler joined #mojo
18:01 Eke- joined #mojo
18:12 sri ah, there's a demo too http://shout-irc.com:9000/
18:19 batman marcus: i'm thinking config in json file and using the logs on disk as strorage
18:19 batman it's more than fast enough for testing
18:19 sri don't think you need logs on disk
18:19 batman sri: we already have that
18:19 sri oh, ok :)
18:20 batman sri: can be used to play back messages and search
18:20 batman https://github.com/Nordaaker/convos/pull/172
18:22 sri does that seem like a sensible description btw.? http://mojolicio.us/perldoc/Mojolicious/Plugin/DefaultHelpers#delay
18:22 sri the tx parts are new
18:26 batman this is a minor, but should there be a comma in "...closed early ,,,, and calls..." ?
18:26 batman i think i would also drop ", breaking the chain". mostly because the sentence is very long.
18:27 batman other than that: supa!
18:27 sri i think "breaking the chain" was an intentional addition... because someone got it wrong
18:28 batman ok
18:29 sri about the comma, i don't know
18:31 good_news_everyon joined #mojo
18:31 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/a-NKpw
18:31 good_news_everyon mojo/master 36b9849 Sebastian Riedel: one more comma
18:31 good_news_everyon left #mojo
18:31 sri i guess it looks better
18:31 sri batman++
18:34 batman thanks :)
18:39 cpan_mojo MojoX-CustomTemplateFileParser 0.06 by CSSON - http://metacpan.org/release/CSSON/MojoX-CustomTemplateFileParser-0.06
18:41 shout-user joined #mojo
18:42 KCL joined #mojo
18:43 rawler joined #mojo
18:45 good_news_everyon joined #mojo
18:45 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/gdZxeg
18:45 good_news_everyon mojo/master d57b910 Sebastian Riedel: added real example for delay helper
18:45 good_news_everyon left #mojo
18:47 sri ok, that makes everything look more balanced
18:52 bodgix joined #mojo
18:53 sri lol, is this the first time apple is redirecting http://www.apple.com/ ?
19:03 rawler joined #mojo
19:06 * batman is writing pure javascript
19:06 batman feels strange :)
19:06 jamesaxl joined #mojo
19:07 batman https://gist.github.com/jhthorsen/3738de6f44f180a29bbb
19:09 batman wonder where i got that idea from... ^^ :)
19:30 preaction joined #mojo
19:35 basiliscos joined #mojo
19:35 jberger batman: I've never seen anything like that before, you should write an event emitter module for mojo!
19:35 batman ;)
19:45 denis_boyun_ joined #mojo
20:00 disputin joined #mojo
20:02 disputin joined #mojo
20:11 cpan_mojo MojoX-CustomTemplateFileParser 0.07 by CSSON - http://metacpan.org/release/CSSON/MojoX-CustomTemplateFileParser-0.07
20:18 sri batman/marcus: btw. since you also get SOCKS support for free now through Mojo::IOLoop::Client, might be worth allowing anonymous irc through tor ;)
20:18 batman sri: make an issue if you _really_ want that :)
20:19 sri not _really_
20:19 sri what i _really_ want is a non-redis version ;p
20:19 batman :D
20:19 batman i guess i could start working on it any day, since marcus has merged in the archive branch...
20:20 batman i'm just feeling really tired now. hope i'm not getting sick :/
20:20 sri don't get sick :/
20:22 batman i will not to...
20:23 sri if someone here is really crazy about learning ioloop internals, i have a performance optimization task
20:24 berov joined #mojo
20:24 sri work on a sane version of this patch https://gist.github.com/anonymous/1f8e862f764930e51fe7
20:25 sri the idea is to attempt a write before making the reactor check if the socket is writable
20:27 sri the patch above bumps examples/microhttpd.pl from 15k rps to 20k rps for example
20:27 sri so there is potential
20:28 sri (problem with the patch above is that events are handled correctly and stuff)
20:28 sri note that i'm not saying this is easy... in fact it's pretty hardcore
20:32 bodgix left #mojo
20:32 jberger batman did you look at vedis? If you think it looks sane we could try to make a provisioning module ala DBD::SQLite
20:33 batman provisioning module?
20:33 jberger A module that provides it
20:33 batman jberger: if i want to do embedded database, i think i will do it in pure perl
20:33 jberger DBM::Deep?
20:33 purl DBM::Deep is more recent maintained than MLDBM, which I consider *dead* or rad or languishing
20:34 * jberger slaps purl with a fish
20:34 * purl slaps jberger with comically large fish in return
20:37 disputin joined #mojo
20:46 howitdo joined #mojo
20:47 disputin joined #mojo
21:06 GabrielVieira joined #mojo
21:08 GabrielV_ joined #mojo
21:08 cpan_mojo Dist-Zilla-Plugin-InsertExample-FromMojoTemplate 0.01.00 by CSSON - http://metacpan.org/release/CSSON/Dist-Zilla-Plugin-InsertExample-FromMojoTemplate-0.01.00
21:14 berov What would you guys recommend for a model layer for a Mojo app? I mean DBIx-ish (SQL).
21:15 berov I know the obvious answer...
21:16 sri i'm still waiting for someone to release a decent Mojo::Pg module i can recommend
21:16 berov mhm...
21:16 phillipadsmith sri: Mojo::Pg …?
21:17 phillipadsmith like async Postgres?
21:17 berov What about async DBD::SQLite ?
21:17 sri like this plugin, but without some questionable decisions and no plugin https://metacpan.org/pod/Mojolicious::Plugin::PgAsync
21:18 sri cleaner api too i guess
21:18 phillipadsmith Might want to ping @Theory about that
21:19 sri why?
21:19 berov hm in a perfect world I would like not to be bound to only one database
21:19 phillipadsmith Because he's an evil genius when it comes to Postgres
21:20 sri postgres is not the issue
21:20 sri it's DBI
21:20 jnbek bahh, DBI is infallible!!
21:20 * jnbek runs
21:21 berov ahh very revolutionary it sounds to me
21:21 sri in fact, the database is totally irrelevant, it's about DBD's that provide async functionality
21:21 phillipadsmith Yah, I figured that … but assumed there was something Pg specific you were hoping to recommend.
21:21 sri DBD::Pg just happens to have the best async api (it's still total garbage... but the best garbage we have)
21:23 berov how could it be done DBI to define api of async nad all DBDs just to respect it?
21:23 sri it can't
21:23 berov ..api for async and..*
21:23 berov uh
21:24 berov I am just a user, but ... why?
21:25 sri DBI relies heavily on the assumption that stuff happens sync
21:25 berov can it say: give your "file" handle $here
21:25 berov hm... ok
21:26 berov uh... then DBIx::Class...
21:27 berov for the kown future
21:27 berov ...
21:28 berov I played with my toys... but more brains is better than one
21:32 punter joined #mojo
22:07 denny joined #mojo
22:14 cpan_mojo Mojolicious-Plugin-SemanticUI 0.04 by Krasimir Berov - http://metacpan.org/release/BEROV/Mojolicious-Plugin-SemanticUI-0.04
22:29 cfedde joined #mojo
22:41 disputin joined #mojo
22:49 good_news_everyon joined #mojo
22:49 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/38fOgQ
22:49 good_news_everyon mojo/master 2f15c69 Sebastian Riedel: canonicalize in-place
22:49 good_news_everyon left #mojo
23:36 lipizzan joined #mojo
23:39 disputin joined #mojo

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