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

IRC log for #mojo, 2016-07-21

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

All times shown according to UTC.

Time Nick Message
00:28 meshl joined #mojo
01:06 tchaves joined #mojo
01:23 jberger punter: i wrote a Minion::Notifier that might be useful to you
01:41 sri hehe http://stackstatus.net/post/147710624694/outage-postmortem-july-20-2016
01:42 sri i can see why regexes are hated so much in other languages
01:45 Grinnz "This regular expression has been replaced with a substring function." heh
01:45 Grinnz always gotta be careful of backtracking
01:45 Grinnz a possessive quantifier probably would have solved that problem as well
01:45 Grinnz since the backtracking was unnecessary
02:09 inbioz joined #mojo
02:18 kid51 joined #mojo
02:26 zivester joined #mojo
02:37 noganex_ joined #mojo
03:15 che-quest joined #mojo
03:37 kaare joined #mojo
04:59 anton joined #mojo
06:13 dod joined #mojo
06:40 dod joined #mojo
06:42 dod joined #mojo
06:47 Lee_ joined #mojo
07:05 mbudde joined #mojo
07:12 ksmadsen joined #mojo
07:15 CW joined #mojo
07:16 ningu joined #mojo
07:16 ningu so the Mojo::Pg object lives both on the controller as $c->pg and the app as $app->pg. it's the same object, I assume? so I can call ->db on either?
07:19 Vandal joined #mojo
07:22 trone joined #mojo
07:24 che-quest ningu: It depends on how you define $app->pg and $c->pg
07:27 che-quest may be in controller: has pg => sub {shift->app->pg};
07:32 ningu oh right
07:32 ningu no, it's a helper on the app, sorry
07:32 ningu $app->helper(pg => sub { state $pg = Mojo::Pg->new(...) });
07:33 coolo according to github my app is 44% perl and 12% perl6 - I wonder what makes perl code perl6 :)
07:35 jberger coolo: the code to look at is called linguist and it does a terrible job determining perl5 from perl5 (and occasionally from prolog!)
07:35 che-quest ningu: i think same object pg
07:36 ribasushi coolo: I collected the bugreports in this commit msg: https://github.com/dbsrgits/dbix-class/commit/cab79c9109
07:39 coolo ribasushi: ah, thx for the link
07:39 coolo not that I really cared what github thinks, I was just curious
07:44 cpan_mojo Mojolicious-Plugin-ReplyTable-0.06 by JBERGER https://metacpan.org/release/JBERGER/Mojolicious-Plugin-ReplyTable-0.06
07:45 Lee joined #mojo
08:11 jamesaxl joined #mojo
08:14 jberger here's a thing I didn't know (and IMO it is ok that mojo doesn't follow this)
08:15 jberger but did you know that outside of Mojo::Loader the __END__ section doesn't generally end the __DATA__ section
08:15 jberger I always assumed it did because Mojo::Loader does that
08:23 ribasushi jberger: M::L (or anything else perl-side) interprets things
08:23 ribasushi but on the syscall level this is not how __DATA__ works
08:24 jberger yeah
08:24 jberger I get that now
08:24 ribasushi a __DATA__ marker for perl the executable is simply a command of "stop reading from the filehandle you were working on, leave it open, seek it back to the byte after __DATA__, pass the fh into perl-space, move on
08:25 ribasushi ( the reading of files generally happens in 8k chunks, hence the "seek back" )
08:26 jberger thinking about it now I understand that that is true, I never thought about it enough
08:26 ribasushi this is also why __DATA__ is frowned upon in lib-code: there would be an ever-growing need for file descriptors
08:26 jberger I think (IIRC) that mst's "The __END__ of everything" talk (which I love) also implies that __END__ ends __DATA__
08:26 ribasushi and on most systems the default max is 256 per process
08:27 ribasushi __END__ == __DATA__ except it doesn't do the "keep file open" bit
08:39 jberger http://boingboing.net/2016/07/20/someone-built-a-wall-around-do.html
09:27 cosimo joined #mojo
09:35 dotan joined #mojo
09:59 cpan_mojo Mojolicious-Plugin-RelativeUrlFor-0.052 by MEMOWE https://metacpan.org/release/MEMOWE/Mojolicious-Plugin-RelativeUrlFor-0.052
10:57 tchaves joined #mojo
11:17 tchaves joined #mojo
11:28 cpan_mojo Mojolicious-Plugin-RoutesAuthDBI-0.781 by MCHE https://metacpan.org/release/MCHE/Mojolicious-Plugin-RoutesAuthDBI-0.781
11:28 Bender AD HUT!
11:43 ningu joined #mojo
11:54 kid51 joined #mojo
12:03 jamesaxl joined #mojo
12:50 neilhwatson joined #mojo
13:00 dhg joined #mojo
13:20 zivester joined #mojo
13:21 dvinciguerra_ joined #mojo
13:29 gizmomathboy joined #mojo
14:00 sri hmm, google trends for web frameworks look weird
14:00 sri https://www.google.com/trends/explore#q=mojolicious
14:00 sri https://www.google.com/trends/explore#q=ruby+on+rails
14:00 sri similar progression
14:03 sri django is winning it seems :o
14:03 sri https://www.google.com/trends/explore#q=python+django
14:07 sri must be because python is taught in so many schools now
14:10 dotan perl+mojolicious trend results are identical to perl - I think it charts perl or mojolicious, so perl drowns out mojolicious
14:11 dotan I bet the infamous @mojolicious is what is actually being trended by google, which is why it's all US
14:13 sri lol
14:13 sri the curve fits the release cycle of mojolicious
14:14 sri little spike in 2007 is funny
14:14 sri no clue where that came from
14:16 sri also interesting "perl dancer" is a related interest
14:16 sri https://www.google.com/trends/explore#q=%22perl%20dancer%22%2C%20mojolicious
14:17 sri august 2010 seems to be the moment everything was decided :)
14:18 sri wow
14:18 sri https://www.google.com/trends/explore#q=%22perl%20dancer%22%2C%20mojolicious%2C%20perl%20catalyst
14:18 sri catalyst was much much bigger
14:19 sri looks like i left shortly after peak catalyst
14:25 PopeFelix joined #mojo
14:32 ptolemarch joined #mojo
15:11 zivester joined #mojo
15:16 ningu joined #mojo
15:29 noganex joined #mojo
15:41 * sri is melting
15:51 disputin joined #mojo
16:11 PryMar56 joined #mojo
16:14 sri btw. the best book on http/2 is now free online https://hpbn.co
16:15 dhg joined #mojo
16:29 itaipu joined #mojo
16:35 inbioz joined #mojo
16:37 inbioz joined #mojo
16:49 dhg joined #mojo
16:59 inbioz_ joined #mojo
17:07 kid51 joined #mojo
17:22 inbioz joined #mojo
17:28 disputin joined #mojo
17:29 punter joined #mojo
17:47 disputin joined #mojo
17:50 inbioz joined #mojo
17:56 mtj joined #mojo
18:01 lluad joined #mojo
18:08 disputin joined #mojo
18:15 inbioz_ joined #mojo
18:22 disputin joined #mojo
18:41 dod joined #mojo
18:49 disputin joined #mojo
18:59 disputin joined #mojo
19:04 kid51 joined #mojo
19:21 disputin joined #mojo
19:22 inbioz joined #mojo
19:28 cuechan joined #mojo
19:30 bwf Is there a reason why Minion::Backend::Pg uses the "time since epoch" for job_info instead of human readable timestamp?
19:31 sri easier to work with
19:33 bwf Seems hard to get an answer to "how long did this job take" without a calculator.  Maybe it could display "time since epoch" and a timestamp?
19:38 sri it's an api
19:41 bwf An API and the output of Minion::Command::minion::job
19:44 Grinnz $timestamp = scalar localtime $epoch; $human_readable_duration = Time::Duration::duration($epoch2 - $epoch1)
19:49 bwf Timestamps useful here:    ./script/app minion job 555
19:50 sri yea, the command was meant to be a temporary solution until we have a web ui
19:52 bwf I guess I can try a pull request and see if it gets votes either way.
19:53 sri minion pull requests tend not to get too many votes i'm afraid, it's still mostly dictated by me
19:57 Kripton joined #mojo
19:58 jberger bwf I'd be happy for help on Minion::Monitor
19:59 jberger that's one of the web uis in the works
19:59 jberger its on my github
19:59 jberger I haven't had much time for it in a while
20:00 bwf I will take a look at Minion::Monitor.
20:04 jberger https://github.com/jberger/Minion-Monitor
20:05 jberger darn that thing still has no docs
20:05 jberger guess it never seemed worth it while I was tinkering but now if I want to recruit contributors
20:05 jberger .... sigh
20:11 sri somehow doubt a web ui can work as a side project
20:12 sri if a good one emerges it will have been built as an internal tool at some company
20:12 sri or someone had a few weeks of free time
20:14 jberger the json api I present in Minion::Monitor is a pretty close pass-through to the perl api
20:15 jberger I don't think there is much to do there (unless I haven't kept it up to date with new features which I probably haven't)
20:15 jberger but other than that
20:15 jberger the actual UI is where there is still a fair amount of work to do
20:18 sri the ui is the hard part
20:18 disputin joined #mojo
20:24 disputin joined #mojo
20:24 Gedge joined #mojo
20:33 cstamas joined #mojo
20:34 cstamas hi
20:34 cstamas doing packaging for debian and the toolset found a few spelling errors http://paste.debian.net/plainh/f5426f69
20:34 cstamas just wanted to let you know as i saw a few spelling related fixes recently
20:37 Grinnz_ neat
20:37 sri cstamas: thanks
20:37 good_news_everyon joined #mojo
20:37 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vK1YV
20:37 good_news_everyon mojo/master dcedecf Sebastian Riedel: fix a few typos
20:37 good_news_everyon left #mojo
20:38 cstamas sri: thanks, for the fast turnaround :)
20:57 dvinciguerra_ joined #mojo
20:58 miller joined #mojo
21:05 dod joined #mojo
21:16 tchaves joined #mojo
21:27 tchaves joined #mojo
21:41 inbioz joined #mojo
21:45 disputin joined #mojo
22:04 CW2 joined #mojo
22:31 jberger is there no way in postgres to conditionally use the column default value?
22:32 jberger create table thingy (..., mynum not null default 42); insert into thingy (mynum) values (coalesce(?, DEFAULT));
22:33 jberger that doesn't work and neither does anything else I can think of
22:35 jberger hmmm it seems like I could use a before trigger, but ugh
23:02 mishanti1 jberger: What are you trying to do exactly?
23:04 mishanti1 jberger: if you have a column defined as `foo text not null default 'plonk'` and insert `null` for that column postgres will substitute null for 'plonk'.
23:10 Vitrifur joined #mojo
23:12 jberger mishanti1: no, mysql will do that but aparently not postgres
23:14 mishanti1 jberger: Ah, you mean when you _explicitly_ send the value as null, instead of the field not being present?
23:14 mishanti1 If so, yes you are correct.
23:14 jberger the problem is that I only sometimes want to pass a value to the query
23:15 jberger I would write two different queries or I could template the query but ewwww
23:15 jberger or I can always pass a value (where the false value would just be a copy of the default) but then I've got duplicated functionality
23:15 jberger like especially if I want to change the default I'll have to know/remember to change it in both places
23:16 jberger I suppose I could just remove the column default and leave it at that
23:16 jberger always pass a value in the insert query
23:19 Grinnz_ jberger: thats what $DBDPG_DEFAULT was supposed to be for, but don't think that ever got fixed
23:19 jberger yeah, I eventually got round to trying that, but I get an error
23:19 jberger DBD::Pg::st execute failed: ERROR:  invalid input syntax for type interval: "DBD::Pg::DefaultValue=HASH(0x3c76058)" at ....
23:19 Grinnz_ https://rt.cpan.org/Public/Bug/Display.html?id=112309
23:20 jberger ah yep
23:20 mishanti1 jberger: For your situation I think I would do the coalesce outside of code and send literal DEFAULT instead of a bound and escaped value if no value was provided.
23:21 mishanti1 `insert into foo(bar,baz)values('würst', DEFAULT);
23:21 mishanti1 or when you hava a value `insert into foo(bar,baz)values('würst', 'omnomnom');
23:21 jberger hmmm, maybe the least bad thing
23:21 Grinnz_ thats what he said he tried first
23:21 jberger Grinnz_: I can't do it automatically
23:22 Grinnz_ oh, not in coalesce
23:22 jberger with say coalesce
23:22 Grinnz_ what error do you get from using it in coalesce?
23:22 jberger and it seems that that is basically what DBDPG_DEFAULT does
23:22 jberger syntax error, you can't use the DEFAULT token that way
23:30 mishanti1 jberger: If you want some fun one day and haven't already done so then you should have a look at postgres windowing functions. Very fun stuff. Totally unrelated to what you are doing now. Just mentioning it. :)
23:41 jberger yeah, I have seen those a little bit, look powerful
23:41 jberger haven't used them yet
23:42 mishanti1 The problem for me was that they were the hammer that made everything look like a nail.
23:42 mishanti1 So I had to stop using it.

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