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

IRC log for #mojo, 2016-11-01

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

All times shown according to UTC.

Time Nick Message
00:55 tchaves joined #mojo
01:16 Grinnz hmm https://github.com/blog/2267-introducing-github-community-guidelines
01:22 itaipu joined #mojo
01:39 Adura First they came for WEBM for Retards, and I did not speak out-- Because I was not a retard.
01:54 jberger Adura: are you going to make me say it? Please don't use the word "retard" in a pejorative way.
01:56 Adura You're telling me you don't get the context?
01:58 aborazmeh joined #mojo
02:00 jberger I guess I don't, no
02:03 jberger ok now with googling, I'm not opposed to github's action in concept (though I hope they asked for a voluntary change first), and the use of those terms in that quote is really not productive
02:04 Adura I think it's a fine reference. Let's hope one of those github employees don't take the Austin Powers interpretation of Mojo as offensive.
02:05 Grinnz *facepalm*
02:05 Grinnz Adura: please don't. useless argument
02:14 nicomen what? no bullying, that's it, I'm going back to SourceForge…
02:22 Adura The only ones in a position of power to bully are github employees themselves.
02:24 suede man, i can't wait to see what the ircv3 people do after these guidelines are set in place
02:24 suede there are endless flamewars on the spec issues :P
02:25 Adura IRC, sounds about right.
02:29 jberger Adura: are you saying that removing a project with an offensive name was bullying the authors of the project with the offensive name?
02:30 jberger you know what, I don't think I want to hear the answer to that
02:30 Adura Offense is relative, power is absolute.
02:35 jberger so now you are saying github abused its power as private corporation in regulating offensively name projects that they host for free?
02:36 Adura Private corporations do that all the times.
02:36 Adura *-s
02:36 suede jberger: I'm not even sure why github needs these rules
02:37 suede Project maintainers already have moderation tools for issues
02:37 suede Which, for all intents and purposes, is the only on-site vector for any of the things they mentioned
02:37 jberger the problem WAS the project maintainers
02:38 suede jberger: in what way?
02:38 jberger they named their project an offensive name
02:38 suede Ohh
02:38 suede My problem with the new rules is this here
02:40 suede Actually, re-reading what I *thought* I had a problem with, forget it
02:40 suede I don't have a problem with the new rules
03:08 khfeng joined #mojo
03:58 noganex joined #mojo
04:35 stryx` joined #mojo
04:37 suede okay, i'm very new to perl, and i'm trying to pass navbar links to my templates
04:37 suede this is how i'm currently doing it
04:38 suede uh one second
04:38 purl i think one second is second is the duration of 9,192,631,770 periods of the radiation corresponding to the transition between the two hyperfine levels of the ground state of the caesium-133 atom.
04:40 suede is this how i /should/ be doing it? i'm trying to figure out if i understand perl arrays and scalars correctly
04:40 suede https://paste.whitefire.in/view/1rCgq8XqdK/raw
04:40 Adura With Perl, you try and see if it works first.
04:41 suede i already know it works
04:42 Adura Then you've Perl'd.
05:08 stryx` joined #mojo
05:12 polettix joined #mojo
05:20 bpmedley suede : That's not bad.  If you'd like we can create a Mojolicous::Lite app and have some fun with idioms 'n things
05:22 stryx` joined #mojo
05:23 suede bpmedley i think i've got bigger fish to fry right now
05:23 suede uh
05:23 suede when i try and run my website daemon through carton when i include Mojo::Pg, it segfaults
05:24 suede i think
05:24 suede it's because i don't have something installed locally
05:24 bpmedley That's odd.  Is the issue the Mojo::Pg install, or something else?
05:24 suede regarding postgresql
05:25 suede bpmedley: i thought for a minute that it was the upgrade from 7.08 to 7.09 mojolicious but i tested it on an app i previously wrote with 7.08 and it does the same thing
05:25 suede so i have a feeling
05:25 suede it's just
05:25 suede broken on my machine
05:25 bpmedley Egads, the constant steady march of progress can be a pita..
05:26 suede i've been having trouble with homebrew symlinks for some reason
05:26 bpmedley I sense a daemonic possession
05:26 suede hahaha
05:40 suede bpmedley: it's definitely on-include with mojo pg but i have no idea what could be causing it
05:41 bpmedley suede : Is carton downloading, compiling, and installing Mojo::Pg in that step?
05:43 suede bpmedley: i'm reinstalling all of the dependencies and temporarily removing the snapshot file to see if that will do anything
05:43 suede but i have a feeling it won't help much
05:43 bpmedley I would try installing DBI and DBD::pg standalone
05:45 suede i tried including DBD::pg and it segfaulted there also
05:45 suede i'm gonna go take a look at the source code of DBD::Pg
06:03 inokenty-w joined #mojo
06:04 Grinnz have you upgraded perl recently?
06:04 suede i'm doing so now
06:04 Grinnz ... that's not what i meant
06:04 Grinnz if you upgrade perl, your XS modules will break
06:04 Grinnz usually, they will segfault
06:05 suede ah hm
06:05 suede how can i fix it?
06:06 Grinnz reinstall any XS modules you installed to site_perl
06:06 Grinnz and in the future, install them to a local::lib instead, or don't upgrade system perl
06:06 suede i'm using my home folders local::lib instance, and installing deps with carton inside the project folder
06:10 Grinnz then it might be an issue binding to the pg lib
06:10 suede hrm
06:10 suede weird
06:12 bpmedley suede : I would use something like Perl Build and create a perl in /opt/perl-testing, or somesuch.   Then, try installing DBD::Pg into that..
06:13 suede what's weird is that psycopg2 in Python works fine
06:13 suede i wish it was easier to step through carton exec and see what's going on
06:26 suede okay, i'm manually installing DBI, which i think is the problem
06:26 suede it uh
06:26 suede it's taking a very long time to install
06:28 suede well
06:28 suede it seems to have installed fine
06:28 suede but use DBI; segfaults perl
06:29 bpmedley suede : Would you consider installing DBI with a newly installed perl?
06:30 suede bpmedley: that's pretty much exactly what i did
06:30 bpmedley I missed where you installed the new perl..
06:30 suede i completely reinstalled it
06:30 suede but didn't say anything
06:33 bpmedley suede : Are you in Linux?  If so, what distro?
06:33 suede OSX
06:33 suede not linux
06:34 bpmedley which release?
06:34 purl which release is this?
06:34 suede el capitan i believe
06:36 bpmedley Do you have Xcode 8.1?
06:36 suede oh uh
06:36 suede hm
06:36 suede let's see
06:38 suede that's... weird
06:39 suede mas isn't listing it in my installed app store packages
06:39 suede i guess i'll install it \o/
06:39 suede i had it before though :|
06:39 ccakes you might have just installed the xcode command line tools
06:39 bpmedley Hopefully that's it.  Also, hopefully no other apps uninstalled themselves..
06:39 ccakes its the c compiler and assoc bits without the full xcode ui
06:40 bpmedley suede : gcc --version  <-- Does that work for you?
06:40 suede yes
06:40 bpmedley Apple LLVM version 8.0.0 (clang-800.0.42.1)   <-- This is my version
06:41 suede Apple LLVM version 8.0.0 (clang-800.0.38)
06:50 bpmedley suede : I just installed 5.20.3 and DBI.  Works for me.  Weird.  Do you have anything in dmesg?
06:54 Vandal joined #mojo
06:58 marcus really wish cpanm had a --verbose-on-failure mode
07:02 bpmedley suede : pkgutil --pkgs=.\+Xcode.\+ | xargs -I % pkgutil --verify %
07:03 suede bpmedley: nothing in dmesg, that command also outputs nothing
07:03 bpmedley pkgutil outputs nothing?
07:03 suede yea
07:03 suede yeah*
07:03 suede should it be outputting something?
07:04 bpmedley What about without the xargs?
07:04 suede nope, nothing
07:04 purl i think nope, nothing is runned
07:04 suede i have the xcode command line tools installed, do i need anything else?
07:05 mbudde joined #mojo
07:05 bpmedley I'm not sure what the minimum requirements are; further, I"m not sure what would have changed..
07:11 che-quest joined #mojo
07:14 bpmedley $ mdfind date:this week  <-- this show anything weird?
07:33 dod joined #mojo
07:37 irqq joined #mojo
07:37 dod joined #mojo
07:52 AndrewIsh joined #mojo
08:06 rshadow joined #mojo
08:26 polettix joined #mojo
08:28 suede if anyone here uses Mojo::Pg, I just wrote a pretty nice Mojolicious migration command for its migration system
08:28 suede https://paste.whitefire.in/view/mhmmdso55q
08:28 suede https://paste.whitefire.in/view/mhmmdso55q/raw <-- curlable link
08:44 osfabibisi joined #mojo
08:56 batman suede: cool! want feedback?
08:56 suede batman: yes please!
08:57 batman I would change "There is nothing to do." to "Database is already running version $active"
08:57 suede Sure!
08:57 batman and i don't understand why you do upgrade($self) instead of $self->upgrade or even $self->upgrade(@_);
08:57 suede i wasn't exactly sure what $self was and i was in a hurry to get it working
08:58 suede now that i know that $self is the command module, i'll switch that out
08:58 batman :)
08:58 batman also, i would do die $self->usage() instead of "Wrong number of arguments"
08:58 suede Okay :)
08:58 batman i like to get as much help served when just randomly writing a command.
09:00 batman so i would do: die $self->usage unless unless $function and grep { $function eq $_ } qw(up down full to);
09:06 suede batman: i'm surprised i understood that
09:06 suede it works perfectly also
09:06 suede just a sec i'll paste the newest script
09:07 suede https://paste.whitefire.in/view/8moNvE4pwg and https://paste.whitefire.in/view/8moNvE4pwg/raw
09:09 suede batman: thank you for all of your help :)
09:10 batman suede: this is quite confusing: `my $self = shift->app;` i would do `my $self = shift; my $app = $self->app;`
09:10 suede okay
09:10 suede let me just fix that real quick
09:11 batman $self should always refer to the class you're currently in.
09:12 batman looks nice :)
09:13 suede https://paste.whitefire.in/view/IJMmUQBnGk
09:13 suede https://paste.whitefire.in/view/IJMmUQBnGk/raw
09:13 bpmedley suede : In "run" have you considered: $self->$function() or similar?
09:13 suede you can do that?
09:14 bpmedley The args could match the function names that can be called..
09:14 suede wow, php really is a perl rip-off
09:14 bpmedley suede : Method Call Variations in perldoc perlobj
09:18 nic suede: There's a big and important difference... the person who formulated perl had a solid and deep understanding of programming languages and their design
09:19 nic take a look at how php does operator precedence for "... ? ... : ..."
09:20 suede believe me, i'm fully aware of how bad PHP is
09:20 suede https://paste.whitefire.in/view/dAPTJtyv0W/raw
09:20 suede final script, i think
09:20 nic but, to put that in context, over the years php has slowly addressed more than half of the breakage, and 'modern' php isn't half as bad as it used to be
09:21 suede that's true
09:21 suede it's also a lot faster
09:21 nic (where 'half' is not an ISO measure)
09:21 suede php7 is benchmarking close to hhvm at the moment
09:22 janl joined #mojo
09:22 janl a webdav module for mojo?
09:22 batman suede: I typically do $method = "action_$function" or something. That way the user can only call a subset of allowed methods.
09:23 batman suede: maybe you want to read this: http://shadow.cat/blog/matt-s-trout/madness-with-methods/
09:24 suede i am definitely interested
09:24 suede i'lll read it now
09:26 suede hahahaha wow, perl is great
09:26 suede i'm only halfway through and i'm loving this
09:33 batman cool!
09:33 batman glad you like it.
09:41 stryx` joined #mojo
10:41 itaipu joined #mojo
10:53 rshadow joined #mojo
10:58 polettix joined #mojo
11:03 itaipu joined #mojo
11:04 tchaves joined #mojo
11:16 janl joined #mojo
11:26 sri hmm
11:26 sri i kinda want to add a Mojo::Util::getopt
11:26 sri which would be a wrapper around Getopt::Long that localizes the config
11:27 sri https://github.com/kraih/mojo/blob/master/lib/Mojolicious/Commands.pm#L78-L84
11:27 sri just like that
11:28 sri copypastaing that around for every command is just a little clunky
11:29 sri is anyone even using other Getopt::Long config options?
11:37 sri guess only question would be how to handle pass_through
11:49 sri hmm, the cost for the most minimalistic version is one extra line
11:53 dod joined #mojo
11:58 polettix joined #mojo
12:00 jkramer Yes please! I don't care about implementation details, just hide those ugly uppercase functions from us and make it pretty to use :)
12:01 sri this is what i had in mind https://gist.github.com/anonymous/1c6e1b3af61009c15a1b4205cb90b1dc
12:02 sri think it looks very mojo-ish
12:03 sri the pass_through case is addressed with an optional second arrayref for Getopt::Long options
12:04 sri and yea, those Getopt::Long functions deserve to be hidden from our command authors
12:10 jkramer Yeah, looks fine to me. Maybe even add some (optional) "has options => ..." to Command people writing their own commands can easily add their own options
12:10 jkramer *so
12:14 batman looks nice sri :)
12:14 jkramer You know, like allowing people to define their opts as an attribute in a Command subclass, then getopt is called with that (if defined) before run() is ran
12:16 jkramer And while you're at it, auto-generate some nice usage text from the option definitions :D
12:25 sri baby steps
12:25 purl baby steps! baby steps!
12:26 good_news_everyon joined #mojo
12:26 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vXYNz
12:26 good_news_everyon mojo/master d9ccbf6 Sebastian Riedel: add getopt function to Mojo::Util
12:26 good_news_everyon left #mojo
12:30 jkramer I guess this gets asked a lot, but are there plans for a perl6 port in the near future?
12:30 jkramer I recently discovered the sub MAIN() options thing in p6 and it blew my mind :D
12:31 jkramer So much good stuff there
12:34 sri there were plans, but perl6 went nowhere and now it's not really a priority... there is no money in perl6
12:34 sri you might just as well ask if there are plans for a ruby port
12:43 jkramer Ruby is not extremely awesome though :)
12:53 janl isn't ruby all hot wetness?
13:03 gizmomathboy joined #mojo
13:13 ramortegui joined #mojo
13:17 * nic is waiting for perl7
13:18 good_news_everyon joined #mojo
13:18 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vXOeo
13:18 good_news_everyon mojo/master 8632e65 Sebastian Riedel: do not rely on the global configuration at all
13:18 good_news_everyon left #mojo
13:18 sri now it costs two lines
13:22 sri definitely belongs in Mojo::Util though, so many things to watch out for... even i missed the need to reset with default there
13:31 jberger interesting
13:32 jberger that might really cleanup a few ugly bits on some of my modules
13:32 jberger Mojolicious::Command::nopaste most obviously
13:39 mcsnolte joined #mojo
13:43 Janos joined #mojo
13:47 stryx` joined #mojo
14:28 kaare joined #mojo
14:32 gizmomathboy joined #mojo
14:53 disputin joined #mojo
15:01 disputin joined #mojo
15:39 xinming joined #mojo
15:39 sh14 joined #mojo
15:57 Grinnz sri: the only other Getopt::Long config i usually use is gnu_getopt
16:00 Grinnz wtf, the so called object oriented interface in Getopt::Long is a mess
16:02 Grinnz it sets the global configuration, then sets the global configuration back to retrieve the object's config and store it in the object
16:03 Grinnz and then sets that config globally every time you call ->getoptions on it
16:03 sri yea, i remember when we tried that in mojolicious and it ended in tears
16:04 Grinnz any part of it in particular? it does 4 things iirc
16:04 sri think Mojo::Util::getopt might be the only sensible way to handle it
16:04 Grinnz oh you mean the oo interface
16:04 sri yea
16:04 sri never used the gnu setting
16:04 Grinnz yeah what you have now seems sensible
16:05 Grinnz https://metacpan.org/pod/Getopt::Long::Modern#gnu_getopt is how i remember what it does
16:05 polettix is there some documentation about how to use migrations for sharing the same db between Minion and other code?
16:05 sri migrations have a name
16:06 polettix I tried the example setting a name different from "minion", but it seems to prevent minion to work properly
16:06 sri as long as yours is not called "minion" you're fine
16:06 polettix uhm ok, I'll try to simplify to troubleshoot then, thanks
16:07 good_news_everyon joined #mojo
16:07 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vXOBg
16:07 good_news_everyon mojo/master d79e37a Sebastian Riedel: fix order
16:07 good_news_everyon left #mojo
16:09 khfeng_ joined #mojo
16:09 jberger polettix: you might need to use a different Mojo::Pg instance for Minion
16:10 jberger since the Mojo::Pg::Migrations instance bound to it is what holds the migrations name
16:14 disputin joined #mojo
16:16 polettix jberger: this is what I was starting to suspect, as I was retrieving the same instance indeed
16:17 polettix thanks for the hint
16:17 sri oh, yea, that's a bad idea
16:19 jberger I've started to notice that reusing Mojo::Pg instances can get hairy
16:19 jberger another case is when you set the schema path
16:19 jberger because connections that already exist in the pool don't have the path set
16:22 polettix that did it, thanks
16:22 polettix wouldn't a "clone" method be useful for such cases?
16:23 sri what would it do?
16:24 sri how would one use it?
16:25 polettix something like:   sub clone { return $self->new->dsn($self->dsn); }
16:26 polettix use:    my $safe_db = minion->backend->pg->clone;
16:26 polettix ehr,     app->minion->...
16:27 sri so it would not include settings like the search_path?
16:28 sri have to say, we'll definitely not do that
16:28 sri it's extremely confusing
16:28 polettix well, my mojo::<any-db> fu is extremely weak so I don't know actually. Just thought it might be useful
16:29 polettix but my weakness can tell you that also doing minion->backend->pg can be extremely confusing :)
16:29 sri you asked if it would be useful, if you can't explain how it even works, nobody will be able to tell you
16:30 polettix sorry, confused "what" with "how". It would create another connection to the database just like a starting one, but without being subject to side effects like this one with migrations
16:31 Janos joined #mojo
16:32 gizmomathboy joined #mojo
16:34 suede is this correct while doing validation
16:34 suede ?
16:34 suede $validation->required('username')->size(3, 12)->like(qr/^[a-zA-Z0-9_]/);
16:34 suede it doesn't seem to actually fail when it uses a bad character
16:38 Sebbe suede: You're validating that the first character is alphanumeric. Is that what you want?
16:38 polettix suede: you mean a bad starting character?
16:39 suede oh duh
16:39 suede sorry i forgot how regex worked temporarily
16:39 suede one momeny
16:39 suede one moment
16:39 PryMar56 joined #mojo
16:46 suede $validation->required('username')->size(3, 12)->like(qr/^[a-zA-Z0-9_]+$/);
16:46 suede this isn't working either
16:50 trwww joined #mojo
17:20 good_news_everyon joined #mojo
17:20 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vXOPv
17:20 good_news_everyon mojo/master bcf2943 Sebastian Riedel: show an example too
17:20 good_news_everyon left #mojo
17:24 hrupp joined #mojo
17:28 hrupp joined #mojo
17:32 itaipu joined #mojo
17:44 polettix joined #mojo
17:58 suede hrm
17:58 suede I still can't get my ->like validator working
17:58 suede $validation->required('username')->size(3, 12)->like(qr/^[a-zA-Z0-9_]+/);
17:58 suede am i doing something wrong here?
17:58 suede when i input a username like test%%%username it doesn't invalidate that parameter
17:58 suede well
17:58 suede anything with symbols in it
17:59 suede i think that one would fail because it's too long
18:04 sri there are examples in the guides
18:06 suede sri: not for validation, as far as I can tell. I had to figure it out on my own based on the docs for controller/validation/validator
18:06 sri i wrote most of the guides, i should know
18:07 sri http://mojolicious.org/perldoc/Mojolicious/Guides/Rendering#Form-validation
18:07 vicash suede: $validation->required('username', 'trim')->size(3, 12)->like(qr/^[\w]+$/); works for me in my app
18:11 polettix joined #mojo
18:29 sri guess this one will end up getting closed as impossible to debug https://github.com/kraih/mojo/issues/1011
18:35 stryx` joined #mojo
18:36 good_news_everyon joined #mojo
18:36 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vXONe
18:36 good_news_everyon mojo/master 1ee6074 Sebastian Riedel: use getopt everywhere
18:36 good_news_everyon left #mojo
18:48 che-quest joined #mojo
18:49 sri stickermule has magnets now too https://www.stickermule.com/products/custom-magnets
18:49 rshadow joined #mojo
19:01 good_news_everyon joined #mojo
19:01 good_news_everyon [mojo] kraih tagged v7.10 at c3057b0: https://git.io/vXOhw
19:01 good_news_everyon left #mojo
19:02 good_news_everyon joined #mojo
19:02 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vXOh1
19:02 good_news_everyon mojo/master eea5e0e Sebastian Riedel: bump version
19:02 good_news_everyon left #mojo
19:31 Pyritic joined #mojo
19:53 rshadow joined #mojo
19:59 disputin joined #mojo
20:02 itaipu joined #mojo
20:47 stryx` joined #mojo
21:09 good_news_everyon joined #mojo
21:09 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vX3Cc
21:09 good_news_everyon mojo/master 49dd3e7 Sebastian Riedel: we are only importing one function
21:09 good_news_everyon left #mojo
21:30 disputin joined #mojo
23:07 lluad joined #mojo

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