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

IRC log for #mojo, 2015-10-24

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

All times shown according to UTC.

Time Nick Message
00:11 cpan_mojo Mojo-Pg-2.13 by SRI https://metacpan.org/release/SRI/Mojo-Pg-2.13
00:20 * sri waits for someone to tell him why Mojo::Pg::search_path is silly... now that it's released :)
00:23 Grinnz i think it's a good idea for testing like the example shows especially
00:23 Grinnz otherwise though ive never really used search path heh
01:02 sri hmm, the PerlTricks account on twitter is getting really annoying
01:02 sri tweets get deleted and reposted every few hours
01:03 sri unfollow i guess
01:04 Grinnz weird
01:06 sri sadly becoming a more and more common strategy with news accounts
01:07 sri also had to unfollow theverge because it was getting way too much
01:10 damaya joined #mojo
01:17 nnutter Mojo::PgX::Cursor v0.01 is up: https://metacpan.org/pod/Mojo::PgX::Cursor
01:46 sri nnutter: why is monkey_patch still there?
01:47 sri otherwise it looks pretty nice
01:47 sri first synopsis example is exactly what i expected, very simple :)
01:49 sri i guess having the monkey_patch option doesn't hurt, but i imagine it could look confusing to some
01:50 aborazmeh joined #mojo
01:53 nnutter I feel like it might be a bigger pain to use it without.
01:54 nnutter But I was also thinking about just documenting how to monkey_patch instead of "supporting" it.
02:24 tencendur joined #mojo
02:50 mattp_ joined #mojo
02:52 asarch joined #mojo
02:58 * sri never really liked the return values of Mojo::DOM::replace and remove
02:59 sri maybe it would have been better to return the old value detached
03:03 sri we are not the only ones with these kinds of problems though
03:04 sri nokogiri has swap and replace methods that only have different return values
03:07 nnutter sri: Why do the Mojo::Pg tests do `BEGIN { $ENV{MOJO_REACTOR} = 'Mojo::Reactor::Poll' }`?  Is it just for consistency in case EV is installed or whatever?
03:07 sri yes
03:08 sri EV can also be a bit problematic on certain platforms
03:09 sri if it was just endusers i wouldn't really bother, but the reports from cpantesters can be annoying
03:10 nnutter ah
03:15 PryMar56 joined #mojo
03:34 damaya joined #mojo
03:50 damaya joined #mojo
04:59 damaya joined #mojo
05:07 nnutter sri: I'm seeing a `Can't call method "FETCH" on an undefined value at .../Mojo/Pg/Results.pm line 13, <DATA> line 2231 during global destruction.` error and I'm wondering if Mojo::Pg::Results::DESTORY needs something like https://github.com/kraih/mojo-pg/commit/a8dbeab671ec2e4c980637beb3d7627fc74f74f6?
05:08 nnutter One of my Mojo::PgX::Cursor tests is producing it and sometime I see multiple so I suspect it's a bit of a race condition that produces it.
05:08 nnutter Also seems like it's something internal to DBI croaking or something because Mojo::Pg::Results isn't calling FETCH.
05:09 nnutter I guess I could try the patch and see if it goes away. ;-)
05:10 nnutter Though, I'm pretty sure that patch pretty directly targets that.
05:11 nnutter I'll create an issue.
05:36 asm35 joined #mojo
06:00 mmp joined #mojo
06:04 kaare joined #mojo
06:25 Onigiri joined #mojo
06:26 Onigiri joined #mojo
06:29 Onigiri joined #mojo
06:32 Grinnz yeah, DBI handles are implemented as a weird combination of reference and tied hashref
06:32 Grinnz sounds like one of them is going away before the other in global destruction
06:34 Onigiri joined #mojo
06:36 damaya joined #mojo
06:43 nnutter or right, the FETCH reference is to the tied hashref?
06:44 cpan_mojo Mojo-PgX-Cursor-0.04 by NNUTTER https://metacpan.org/release/NNUTTER/Mojo-PgX-Cursor-0.04
06:44 nnutter how exciting =)
07:09 cpan_mojo Mojo-PgX-Cursor-0.500000 by NNUTTER https://metacpan.org/release/NNUTTER/Mojo-PgX-Cursor-0.500000
08:02 CIAvash joined #mojo
08:11 meshl joined #mojo
08:25 Vandal joined #mojo
08:35 bpmedley joined #mojo
09:55 damaya joined #mojo
09:59 osfameron can you *delete* an attribute with Mojo::DOM ?
10:09 osfameron hmm.  you don't seem to be able to?  e.g. I have <div id="template" /> which I clone.  I don't want all the cloned divs to have that id
10:09 osfameron I can set ->attr(id => undef) which gives <div id>
10:09 osfameron or (id => '') which gives <div id="">... I suppose that will do
10:29 irqq joined #mojo
10:41 batman joined #mojo
11:18 meshl joined #mojo
12:05 sugar joined #mojo
12:17 mudler joined #mojo
12:29 asarch joined #mojo
12:40 huihui joined #mojo
13:12 damaya joined #mojo
13:17 good_news_everyon joined #mojo
13:17 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vWuKx
13:17 good_news_everyon mojo/master 74b60ae Sebastian Riedel: a few more attribute examples
13:17 good_news_everyon left #mojo
13:17 sri nnutter: test case!
13:17 sri osfameron: see commit
13:18 osfameron sri: wonderful, thanks!
13:20 jberger joined #mojo
13:24 * sri is tempted to deprecate Mojo::DOM::remove and Mojo::DOM::replace, and add a new Mojo::DOM::swap method with a different return value
13:26 yt7fms joined #mojo
13:27 sri actually, i think the "correct" return value might be a collection with the newly added nodes
13:27 yt7fms left #mojo
13:27 pink_mist is ::remove supposed to be replaced by a ::swap with an empty value then?
13:27 sri my $collection = $dom->at('p')->swap('123<p>test</p>');
13:28 sri pink_mist: remove is literally sub remove { shift->replace('') }
13:28 * pink_mist is not sure how intuitive that'd be
13:28 pink_mist sure, that's how it's implemented internally
13:28 pink_mist but pushing that on the user? not intuitive at all
13:29 sri i wouldn't mind bringing back ->remove with different return value after the deprecation period
13:29 pink_mist well ok, guess I can live with that
13:30 sri don't really see another way with deprecations
13:31 pink_mist might rename it to ->delete with the new semantics?
13:34 sri doesn't seem as fitting
13:36 sri delete is more for attributes
13:37 sri nokogiri has an unlink method, which is aliased to remove
13:42 tencendur joined #mojo
13:52 sri or we just keep everything the way it is now
13:52 * sri shrugs
13:53 pink_mist well as I said, I wouldn't complain if ->remove got put back in after the deprecation period, so for me at least that's fine
13:53 sri not even sure what the right return value would be
13:54 sri parent seems weird, but does work reasonably well for chaining
13:57 pink_mist parent sounds sane to me, yeah
13:57 pink_mist err, not yeah
13:58 pink_mist what was the conclusion of the detach conversation?
14:00 damaya joined #mojo
14:01 * jberger hacks a merge between Minion::Monitor and bpmedley's minion_ui
14:08 sri pink_mist: ->detach only makes sense with with the dclone optimizations
14:08 sri (imo)
14:09 sri there were a dozen versions of ->detach flying around
14:14 jberger is X-Died a thing? http://www.olafalders.com/2015/10/24/httpresponse-may-have-a-different-definition-of-success-than-you-do/
14:15 jberger we have the same problem at $work, the original authors of our api return 200 even on error, with a JSON response like { success => \0, ... }
14:16 jberger you have to know that is_success is just checking the status code, no user agent can anticipate all the crazy things an api may do to tell you about failure
14:20 nic you succeeded in finding out about your failure
14:45 sri i don't think we do
14:46 sri only problem i've ever seen is people not checking at all ;p http://mojolicio.us/perldoc/Mojo/Transaction#success
14:47 theo joined #mojo
14:49 good_news_everyon joined #mojo
14:49 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/vWubU
14:49 good_news_everyon mojo/master c65fa82 Sebastian Riedel: quote response codes consistently
14:49 good_news_everyon left #mojo
14:53 jberger oh, X-Died is internal to LWP
14:53 jberger and yet LWP doesn't interpret X-Died to be failure on the user agent side
14:53 jberger makes a little more sense now
14:54 sri the anyevent user agent does something similar i believe
14:54 * sri never liked abusing headers that way
14:55 sri not that $tx->error is great, but it's at least a little better
14:56 jberger I don't see why that's a bad thing
14:57 jberger we have an object that represents the transaction. if the transaction has an error, where better to note it?
15:03 zivester joined #mojo
15:07 PryMar56 joined #mojo
15:40 ajr_ joined #mojo
15:53 sh4 joined #mojo
16:05 thowe joined #mojo
16:08 ajmrch joined #mojo
16:12 damaya joined #mojo
16:28 damaya joined #mojo
17:08 sri re optimizing $dom->append($dom2) and the like
17:08 sri it might also be worth looking into speeding up Mojo::DOM::HTML in general
17:09 sri while it is pretty fast, an expert review surely wouldn't hurt
17:10 * sri has a feeling there are regex tricks we could be using
17:11 sri especially considering that we can use 5.10 features
17:12 sri jberger: guess that's true, just wondering if there's a prettier solution
17:32 sri nnutter: btw. when i say test case i mean something that shows there's actually a problem in Mojo::Pg::Results, so i'd be fine with a cpantesters report showing those warnings too
17:32 sri in case it's very random
17:36 trone joined #mojo
18:08 jberger sri / bpmedley / all: https://github.com/jberger/minion_ui
18:09 sri jberger: there's only one screenshot ;p
18:10 jberger just like bpmedley's
18:10 jberger mostly been cleaning up the code
18:10 sri ah
18:10 jberger I like the backend structure of mine much better, but I seem to be incapable of front-end programming
18:13 jberger I like it being an app in its own right, with a plugin that attaches it to another app, and a command that does that for you and starts the daemon
18:13 sri front-end programming is not hard, just steal something pretty and customize the colors with a palette you got from a palette rating site :)
18:14 jberger hahaha, yeah, tempire told me something similar once
18:14 sri seriously, design is all about stealing and customizing
18:16 jberger its not that, its the reactive frameworks
18:17 jberger I keep wanting to learn them, then I get halfway in and just cant make myself care enough to write that much javascript
18:17 sri doubt they are that important
18:18 sri the mobile app aesthetic is kinda neat though
18:19 sri you can get away with very little design that way too :)
18:19 sri that said, looking at the screenshot again, the blue flatline is kinda silly
18:20 jberger yeah, galileo made use of the "clean aesthetic" too
18:20 jberger I'm assuming that the plots are all d3.js
18:20 sri there is no point having two lines
18:21 jberger what line would you keep?
18:21 sri i thought it was https://fastly.github.io/epoch/
18:21 sri the orange
18:21 sri blue is implied by the numbers
18:21 jberger oh, yeah its that
18:21 jberger d3 is included too though
18:22 sri epoch uses d3
18:22 jberger ah
18:23 sri think just one area for active workers would look best https://fastly.github.io/epoch/real-time/#area
18:39 damaya joined #mojo
18:40 nnutter sri: It kind of feels like a double standard given the previous issue/commit but I'm trying to figure something out.
18:42 sri nnutter: what do you mean?
18:45 nnutter The similarity to kraih/mojo-pg#4, the difficulty in creating a test, and the eventual avoidance of the problem with a8dbeab.
18:48 sri i see
18:50 sri can't find ou why i added it, so i'll remove it again
18:51 nnutter You added it in #4?
18:52 sri so there was a test case demonstrating the issue
18:53 nnutter Sorta.
18:53 nnutter You couldn't reproduce it.
18:53 sri anyway, i don't to be accused of applying double standards, the line goes away
18:54 nnutter Honestly, it seems like DBI is at fault.
18:55 nnutter Grinnz seemed to think it had to do with DBI using ties.
18:55 sri gone from master
18:58 sri we have no rules for where to add that DESTROY idiom, so i'll only do it if there's a test case demonstrating it
19:00 mudler joined #mojo
19:01 sri if someone here wants me to throw around the idiom preemptively, please come up with sensible rules
19:07 damaya joined #mojo
19:15 Snelius joined #mojo
19:15 disputin joined #mojo
19:28 asm35 joined #mojo
19:55 sri nnutter: hard to say who is "at fault"
19:55 sri we are accessing $dbh->{Active} in a DESTROY
19:56 sri if this was just random destruction order, i'd assume a one-liner would trigger the problem every now and then
19:56 sri like
19:56 sri perl -Mojo -MMojo::Pg -E 'my $pg = Mojo::Pg->new("postgresql://tester:testing@/test"); say $pg->db->query("show search_path")->array->[0]'
19:56 sri but i can't trigger it
19:57 nnutter I did similar and can't trigger it either.
19:57 stephen joined #mojo
19:57 nnutter With my test I can trigger it every time though.
19:59 nnutter Does destruction run randomly between statements?  I would have assumed at scope exits or something.
20:03 nnutter Looks like maybe it's immediately after refcount drops to zero.
20:03 nnutter Was wondering if there could have been a race condition between the `my $sth = $self->sth` line and the next line `$sth->finish`.
20:05 trone [OT] I was looking module to draw a ASCII table ... and I find the Text::SimpleTable. sri, you are everywhere!
20:06 sri just don't look at the code, it is a very old module ;p
20:09 trone sri: its competitors do not look much younger (ex: Text::ASCIITable).
20:10 sri yea, i think catalyst used that before
20:10 trone Furthermore yours go really straight to the point
20:10 damaya joined #mojo
20:10 jberger hunh, I don't think I came across Text::SimpleTable for Mojolicious::Plugin::ReplyTable
20:11 jberger I settled on https://metacpan.org/pod/Text::Table::Tiny if available
20:11 jberger otherwise tablify
20:12 sri Text::SimpleTable does this reflow text thing because i wanted to make catalyst debug logs pretty on 80 char terminals :)
20:13 * jberger looks at his huge screens and cares very little about small terminals
20:13 sri https://www.youtube.com/watch?v=e7qQ6_RV4VQ
20:14 jberger I was recently thinking about getting rid of my 90 char warning line in my vimrc: https://github.com/jberger/dotfiles/blob/master/.vimrc#L68
20:14 trone ahaha
20:15 jberger he's strumming all downstrokes, that would make my hand tired!
20:18 damaya joined #mojo
20:34 damaya joined #mojo
21:27 damaya joined #mojo
21:51 cpan_mojo Mojo-PgX-Cursor-0.500001 by NNUTTER https://metacpan.org/release/NNUTTER/Mojo-PgX-Cursor-0.500001
22:24 meshl joined #mojo
22:32 sri nnutter: you never mentioned the DBI/DBD::Pg versions
22:34 damaya joined #mojo
22:49 bpmedley joined #mojo
23:27 * sri still wonders what to do about fixtures in Mojo::Pg
23:28 sri now that parallel tests is a non-issue, fixtures would be nice
23:43 sri perhaps somethign like this is too simple https://gist.github.com/anonymous/aab568d210be47c9539f
23:59 sri coincidentally another postgres article just popped up on my twitter stream :) https://www.compose.io/articles/what-postgresql-has-over-other-open-source-sql-databases-part-ii/

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