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

IRC log for #mojo, 2015-10-16

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

All times shown according to UTC.

Time Nick Message
00:02 meshl joined #mojo
00:04 jberger Zoffix: https://github.com/jberger/Mojo-Phantom/blob/master/lib/Mojo/Phantom.pm#L128
00:04 Zoffix :)
00:12 asarch joined #mojo
00:22 ajr_ joined #mojo
00:29 aborazmeh joined #mojo
00:44 CandyAngel Errr
00:45 CandyAngel Never mind, it's 2am and my brain has shut off
00:45 CandyAngel Of course unpacking @_ and then passing those variable on does something different to just passing @_ on >.<
00:50 CandyAngel That undermines Function::Parameters usage (in my case)
00:50 CandyAngel >.<
01:00 tempire ooh!
01:01 tempire The sqlite with json support has been released
01:06 Grinnz oh good, time to rewrite Mojo::SQLite
01:07 Grinnz (once DBD::SQLite updates to that version)
01:07 Grinnz which they did 36 minutes ago on github
01:08 sri wow, that was fast
01:09 bayashi joined #mojo
01:09 Grinnz it's just an "extension" so far
01:17 * Zoffix is yet to feel the usefulness of JSON in SQL
01:18 Zoffix At least my experience with it with PostgreSQL resulted in "screw this; I rather handle JSON in Perl"
01:21 jberger Zoffix: have you used/enjoyed nosql?
01:21 Zoffix jberger, never
01:21 jberger then I don't expect you to understand :-P
01:21 Zoffix :(
01:22 sri minion uses json in postgres
01:23 disputin joined #mojo
01:25 Zoffix I don't really remember what it was that made me feel it's useless, but it might've been inability to do 'SELECT * FROM foo WHERE bar:json->{foo}{bar} is 'mer';
01:25 lluad Being able to generate a json document from a sql query, then just ship it off to the web app untouched, is very convenient.
01:26 Zoffix And last I recall was a stackoverflow answer that showed like an X-line answer that wasn't worth the 1-line Perl answer.
01:26 sri Zoffix: actually you can do that
01:26 Zoffix sri, sure, but how much SQL will you need to write?
01:26 lluad Heck, you can do that with an indexed query (which is where it's really useful).
01:26 jberger Zoffix: a schema
01:27 sri Zoffix: not much at all
01:27 Zoffix Maybe I'm thinking of the wrong issue then
01:28 lluad For postgresql, at least, support for json has been gradual. A couple of years ago it was pretty minimal / crappy, so if that's what you're thinking of ...
01:28 bpmedley Zoffix: What PostgreSQL version are you using?
01:28 sri Zoffix: see jsonb in postgres 9.4
01:28 sri it's actually pretty awesome
01:29 Zoffix bpmedley, latest, I suppose
01:29 sri http://schinckel.net/2014/05/25/querying-json-in-postgres/
01:30 sri tons of operators
01:31 tianon joined #mojo
01:33 sri of course the json and arrays can ge automatically generated for placeholders
01:35 sri it's not just about json though, arrays alone are sooooo valuable
01:36 Grinnz yeah i haven't pined for JSON in mysql much, but for arrays, definitely
01:37 sri here for example i use a subquery to find all jobs a worker is currently dealing with and put them in an array https://github.com/kraih/minion/blob/master/lib/Minion/Backend/Pg.pm#L176
01:38 Zoffix I think it was something with having a particular datatype as root JSON.
01:38 * Zoffix has just grepped commits on XTaTIK, but did not find what the issue was.
01:38 sri Zoffix: you should rest your case with that kind of argument ;p
01:38 Zoffix ¯\_(ツ)_/¯ maybe I'm just an idiot who doesn't know what they're doing :PO
01:39 gaunt joined #mojo
01:39 * sri waves pitchfork
01:41 sri don't think of it as json, jsonb is really just arbitrary data structures
01:45 sri glad mongodb seems to be going out of fasion
02:13 zivester joined #mojo
02:17 noganex_ joined #mojo
03:02 SmokeMachine joined #mojo
03:02 Lucas1 joined #mojo
03:25 zivester joined #mojo
04:23 inokenty-w joined #mojo
05:08 sh4 joined #mojo
06:29 panshin joined #mojo
06:30 panshin joined #mojo
06:36 irqq joined #mojo
07:13 trone joined #mojo
07:26 AndrewIsh joined #mojo
07:40 eseyman joined #mojo
07:46 ashimema that's my favourite postgres post of the moment :)
07:51 meshl joined #mojo
07:54 sugar_ joined #mojo
08:30 damaya joined #mojo
08:32 Vandal joined #mojo
08:32 damaya Hey, quick question, how do I redirect to the referring page? E.g., someone logs in not from index page, but contact us page, redirect back to contact us page.
08:34 coolo seems to be a popular question lately
08:35 nic damaya: The most popular approach is a hidden field in the login form
08:35 damaya Ahk, thanks nic :D
08:36 nic And it's most reliable if passed as a query param
08:36 nic When testing, make sure you're correctly handling the case where the first login attempt fails
08:36 sugar_ joined #mojo
08:36 damaya ohh yeah... didn't even think of that
08:36 damaya hehe
08:37 Quaii and, dont trust the input. make sure no-one has been tampering with the value, redirecting the user off-site after logging in.
08:38 nic point
08:41 nic You don't have to do the same, but I handle that by only accepting route aliases, which in my case m{\w+}
08:41 nic m{^\w+$}
08:43 damaya Do you guys know any examples in the documentation or on Github?
08:46 vanHoesel joined #mojo
09:32 gaunt_ joined #mojo
09:55 panshin joined #mojo
09:56 panshin joined #mojo
10:24 jontaylor joined #mojo
10:27 asarch joined #mojo
10:38 dvinciguerra joined #mojo
11:03 neilhwatson joined #mojo
11:17 damaya Is there a method (or default helper) to get route + params, like so: /user/bob/delete (where user is route, and bob is a param) as a string (i.e. /user/bob/delete)?
11:26 pink_mist just set your route to /user/:name/delete ?
11:28 pink_mist https://metacpan.org/pod/distribution/Mojolicious/lib/Mojolicious/Guides/Tutorial.pod#Placeholders
11:29 damaya No, I mean in the controller I'd like to get the route with params, so $r->get('/user/:name/:action')->to('user#delete'); then in User.pm sub delete { my $c = shift; my $route = ??? }
11:30 damaya I guess I could do my $route = $c->current_route . '/' . $c->whatever_method_to_get_params (haven't looked at the documentation on this yet).
11:31 damaya I'm thinking about setting a flash, stash or session value (not sure which yet) in each controller, that way I can redirect_to that value on login, logout, register, etc
11:32 Lee damaya: http://mojolicio.us/perldoc/Mojo/Message/Request#url
11:33 Lee so $c->req->url
11:33 damaya hurr, durr
11:33 damaya yeah
11:33 pink_mist ah, thanks to Lee's answer I finally understood what it was you were asking for :P
11:33 pink_mist Lee++
11:33 damaya cool, and it's already a Mojo::URL object, cool
11:34 damaya I'm tired to the point my brain is starting to kinda shut off every few minutes, lol
11:57 nic damaya: (in case you read this in the log) http://mojolicio.us/perldoc/Mojolicious/Guides/Routing#Named-routes is wot I use
12:00 nic it's almost as simple as $destination = $c->url_with($route // $default_route)
12:00 nic but from $route you exclude anything going to 'login' or 'logout'
12:01 nic no need to work with urls directly or put more stuff in the stash
12:08 jberger sri: wow you can select an array?!
12:09 jberger gone are the days of GROUP_CONCAT and split then eh?
12:10 pink_mist jberger: postgresql has had arrays since forever (or at least as long as I've been using it), so those days you're talking about never existed for me =)
12:11 jberger Nah, I'm talking about mysql
12:12 jberger Work uses mysql and I've only ever really used sqlite bore that
12:12 jberger before
12:12 pink_mist well, I'm not sure I'd want to give the moniker 'db' to mysql :P
12:13 jberger Various nosql as well of course
12:14 jberger And the moniker only lightly applies there too
12:15 nic It's very hard to pin down what people mean by 'db'
12:15 nic Often people mean 'a collection of schemata being served from the same rdbms'
12:16 nic A small crime committed by mysql is to "show databases()" instead of 'schemata'
12:17 nic which is part of the reason people are so confused
12:48 damaya joined #mojo
12:52 * sri was a rdbms hater before postgres
12:53 sri or rather, before postgres 9
12:54 kyshtynbai joined #mojo
13:00 crab 9i!
13:04 PryMar56 joined #mojo
13:14 ajr_ joined #mojo
13:15 sugar_ joined #mojo
13:16 fvox joined #mojo
13:26 sri oh, redhat bought ansible
13:51 gryphon joined #mojo
14:15 jontaylor joined #mojo
14:24 panshin joined #mojo
14:36 damaya joined #mojo
14:50 meshl joined #mojo
14:52 hernan605 joined #mojo
14:57 mattastrophe joined #mojo
14:57 damaya joined #mojo
15:19 jberger again, the headline: http://www.infoworld.com/article/2990353/application-development/perl-6-what-it-will-bring.html
15:19 jberger "After a long wait, the next version of the Perl programming language will undergo a few betas, followed by a general release this year"
15:20 jberger Perl 5 de-factor dies this christmas
15:20 jberger yay
15:20 jberger de-facto
15:22 Grinnz_ :|
15:22 panshin joined #mojo
15:22 sh4 joined #mojo
15:27 damaya joined #mojo
15:31 mattastrophe joined #mojo
15:35 dvinciguerra joined #mojo
15:56 yt7fms joined #mojo
16:04 kivilahtio_ joined #mojo
16:07 irqq joined #mojo
16:12 damaya joined #mojo
16:14 mattastrophe joined #mojo
16:16 disputin joined #mojo
16:18 sri jberger: the more i learn about perl6 the more sure i am that the christmas release will be a mess
16:18 sri honestly, i don't think i even see perl6 as a serious langauge anymore
16:19 sri think about what those trying it will experience
16:19 sri there's a lot of fun ideas, but it's not usable for anything serious
16:22 sri people will publish devastating benchmarks, and praise the design of certain features, it's going to inspire other languages, but not be successful on its own
16:23 sri my prediction for the future ;p
16:25 sri it will come down to perl6 not having a niche
16:34 sri even golang is arguably still far from becoming a mainstream language
16:35 sri in recent years, i think the only new language that has entered mainstream was swift
16:35 Mikey and apple have the strongest brand / best marketing on the planet.
16:36 sri also helps that they dictate the language for their eco system ;p
16:37 Mikey i think the perl community has a special place.  we, the remaining BSD communities, and a few other open source groups are the last of the original lineage of open source developers.  everyone else from the netsec scene, to the linux kernel, to python... have all been bought out by coporate america
16:37 sri most of us are employed by corporate america too
16:38 Mikey but the direction of Perl has remained relatively autonomous.. like GOOG is driving Go, Python.. Apple is driving Obj-C and Swift.. but we are still doing our thing
16:39 Mikey imo this is as much a bad thing as it is a good thing, but it's all about spin and perception :)
16:40 sri meanwhile booking.com pays for performance optimizations in perl5 ;p
16:40 sri and larry is employed by craigslist
16:41 sri guido is not even at GOOG anymore
16:41 Mikey i'm not saying corporations don't use perl, or contribute to the cause.. i'm saying they don't steer it.
16:42 sri GOOG never steered python, guido was working on code review tools there
16:43 genio yea, I don't think I'm at all happy about Perl 6.
16:43 sri side note: i'm totally corrupt, if some company wants to pay me to get new features into mojolicious, i'm game! :)
16:43 Mikey i don't think google can take an interest in something without influencing it heavily.
16:44 Mikey sri: i'll keep that in mind :)
16:45 damaya joined #mojo
16:45 Mikey but honestly its stuff like mojo that kind of emphasize what i am trying to say.. here's this brilliant piece of engineering, that wasn't really commissioned, a second system written with discipline instead of the kitchen sink in mind..
16:45 Mikey thats such a Perl happening!
16:46 Mikey it's the people's language :)
16:46 sri comrade
16:46 Mikey lol
16:47 Mikey all of that said i agree with your Perl 6 forecast completely.
16:48 sri of course i'm german, so i guess my perception is generally a little different... if you're experiencing the san francisco tech scene i guess it all feels much more corrupted
16:49 Mikey yeah that makes sense.. i totally feel like Perl is the punk rock of programming languages.
16:49 Mikey the more time goes by the more i feel like i should just try and move to europe
16:49 Grinnz_ funny, i hate punk rock
16:49 sri :O
16:49 mantovani sri: usually people don't do nothing serious in a not ready production language.
16:50 Grinnz_ what do you think people are going to expect to do with a language that they think is the "next version" of perl?
16:50 Grinnz_ they're going to expect to write sysadmin stuff, text munging production stuff
16:51 mantovani Grinnz_: I know many people who delivery complete software solution in Perl
16:51 Mikey you're thinking to practically, Grinnz_.  all of this stuff has become fashion.
16:51 mantovani not using Mojo which break every release but something more serius like Catalyst.
16:51 mantovani which my code of 2 years ago still working in the last version of the framework.
16:51 sri found the troll :)
16:52 * sri hugs mantovani
16:52 Grinnz_ that's what catalyst is designed for, but i dont know what that has to do with p6
16:52 * mantovani hugs sri back
16:52 Mikey mantovani: i've brought what's become an almost 100k line project through every major mojo revision since 2.x so i really dont know what you're on about
16:53 mantovani Mikey: does your 2 years code work in the last Mojo release ?
16:53 Mikey i've probably spent less than 20 man hours doing it, too
16:53 Mikey i've had to *gasp* update my code, it's true.
16:53 mantovani good I do a lot of hobby too Mikey
16:53 Mikey to support changes that made sense
16:53 mantovani Mikey: I'm overloading all  maths perl5 operators to use CUDA just for fun
16:54 mantovani will be very slow and not usable
16:54 Mikey yeah definitely a troll.
16:55 mantovani sri: you don't have an ideia how Mojo help me :)
16:55 Grinnz_ what?
16:55 mantovani sri: I do a lot work of AIX and is terrible install modules there so Mojo fits perfect.
16:55 mantovani s/of AIX/on AIX/
16:56 * sri is still wondering if rust will turn out to be a success
16:56 sri it's niche of beautiful systems language seems rather narrow
16:58 sri s/'//
17:01 mantovani sri: I expect that you develop some brilliant web framework using perl 6 semantic as you did with perl 5 (Catalyst)
17:15 bpmedley What is the recommended way to change the logging directory?
17:23 sri this post reminds me that i wanted to benchmark cperl http://wollmers-perl.blogspot.co.at/2015/10/install-cperl-with-perlbrew.html
17:32 damaya joined #mojo
17:38 stephen joined #mojo
17:42 jberger bpmedley: in the startup method
17:42 jberger Or overload log
17:43 bpmedley jberger: app->log( Mojo::Log->new( path => , level => 'debug' ) );  <-- something like this or app->log->path("/abs/path/to/file.log") ?
17:44 jberger Either works
17:44 bpmedley Thanks!
17:45 trone joined #mojo
17:49 sri heh, cperl doesn't compile on os x
17:50 jberger why should it? rurban only cares about everything when and where it affects him
17:51 jberger </snark>
17:51 genio hrm.  what's cperl?
17:53 genio ah, perl11.org/cperl
17:56 disputin joined #mojo
17:57 genio another thing to continue pretending doesn't exist. :)
17:57 disputin1 joined #mojo
18:01 zivester joined #mojo
18:06 MartinR joined #mojo
18:21 rakshasa joined #mojo
18:30 panshin joined #mojo
18:43 sri ETOOMUCHSNARK
18:45 Grinnz_ bpmedley: the second one won't work if you've already logged anything; the first one won't respect the application mode
18:46 Grinnz_ you need to delete app->log->{handle} for the second one, which is why i wrote https://metacpan.org/pod/Mojo::Log::Clearable
18:46 bpmedley Grinnz_: That makes perfect sense.  Thanks.
19:04 glauber joined #mojo
19:09 disputin joined #mojo
19:20 damaya joined #mojo
19:42 disputin1 joined #mojo
19:44 disputin2 joined #mojo
19:46 sri wow, hapi.js now even dedicates individual releases to sponsors https://github.com/hapijs/hapi/issues/2850
19:47 sri really interesting strategy
20:02 jberger sri: that sounds easily doable, if there is any demand
20:21 damaya joined #mojo
20:29 neilhwatson joined #mojo
21:05 jb360 joined #mojo
21:12 genio joined #mojo
21:20 genio_ joined #mojo
21:25 al joined #mojo
21:37 damaya joined #mojo
21:48 fvox joined #mojo
21:50 panshin joined #mojo
22:27 meshl joined #mojo
22:35 pink_mist joined #mojo
22:37 cpan_mojo Mojo-CSV-1.001001 by ZOFFIX https://metacpan.org/release/ZOFFIX/Mojo-CSV-1.001001
22:38 damaya joined #mojo
22:58 al joined #mojo
23:26 disputin joined #mojo
23:39 damaya joined #mojo
23:50 Grinnz_ joined #mojo
23:50 Repaster joined #mojo
23:51 meshl joined #mojo
23:52 disputin joined #mojo
23:52 dabudabu joined #mojo
23:53 panshin joined #mojo
23:57 ajr_ joined #mojo
23:59 damaya joined #mojo

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