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

IRC log for #mojo, 2016-02-13

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

All times shown according to UTC.

Time Nick Message
01:03 sugar__ joined #mojo
03:02 * sri wonders how useful a $pg->db->tables method would be
03:02 sri i keep forgetting how to list tables all the time and keep needing it for tests ;p
03:04 sri super simple https://gist.github.com/anonymous/f9108d363408bde16f66
03:09 noganex joined #mojo
03:18 sri yea this is convenient https://github.com/kraih/mojo-pg/commit/7e643ac7d203f266ddd3f8291e792147b2a134c0
03:33 mcsnolte joined #mojo
03:39 PryMar56 joined #mojo
03:48 sri and a little note on how to grow with Mojo::Pg http://mojolicious.org/perldoc/Mojo/Pg#GROWING
03:48 * sri feels productive today :)
04:25 disputin joined #mojo
04:31 disputin joined #mojo
06:33 cpan_mojo Mojo-Pg-2.21 by SRI https://metacpan.org/release/SRI/Mojo-Pg-2.21
07:01 melo joined #mojo
08:04 Vandal joined #mojo
10:03 dod joined #mojo
10:03 dod joined #mojo
10:09 dod joined #mojo
10:23 punter joined #mojo
10:47 FloydATC What is wrong with this line?  $ua->post($url, { Accept=>'*/*' }, form => {}, $delay->begin);
10:48 FloydATC Mojo::Reactor::Poll: I/O watcher failed: Mojo::IOLoop::Delay: Mojo::Transaction::HTTP=HASH(0x4c9ca60) at /usr/local/share/perl/5.18.2/Mojo/EventEmitter.pm line 19.
10:53 FloydATC ooooh nevermind, I found the problem
11:59 bowtie joined #mojo
12:04 bowtie_ joined #mojo
12:10 bowtie_ joined #mojo
12:18 kes joined #mojo
14:30 stryx` joined #mojo
15:17 stryx` joined #mojo
15:37 disputin joined #mojo
15:49 sri anyone have a good reason why? https://github.com/kraih/mojo-pg/commit/7e643ac7d203f266ddd3f8291e792147b2a134c0#commitcomment-16078784
15:53 * batman doesn't
15:54 batman but i also don't know why you need tables() ...
15:54 sri for tests
15:55 sri https://github.com/kraih/mojo-pg/commit/7e643ac7d203f266ddd3f8291e792147b2a134c0#diff-6e14f0738d9420d65b33a14434de88d0L25
15:55 sri it's right there
15:56 batman yeah. i saw that, but i just wouldn't add a method just for making my tests smoother :/
15:56 sri that's how i design apis
15:56 genio The only reason I can think of is semantics.  A view is not a table, really.
15:56 sri if my tests get smoother, i would *always* add the method
15:57 batman sri: ok. i will keep that in mind :)
15:57 sri it's the same with $pg->db->ping vs $pg->db->dbh->ping
15:58 sri genio: materialized views are tables
15:59 genio In the sense that you can select from them, join with them, add clauses against them, yes.  But insertion and deletion on them...  my only point of contention.  Is it a real reason _not_ to include them, I don't think so
16:00 jberger I officially abstain
16:00 * jberger yawns
16:00 sri genio: in the sense that they actually exist on disk as a table
16:01 jberger bpmedley: I'm thinking about foisting that mock class we made upon the cpan world, at least in some form
16:02 sri anyway, if there's a good reason for excluding views we can always change that
16:02 jberger mark it as experimental if you think its possible it would change
16:03 jberger something we haven't done in the mojo world in a while
16:03 sri if including views is wrong it would be a bug ;p
16:03 ribasushi without having a horse in the game, ->result_sources / ->sources  is neutral yet conveys exactly what you mean (stuff that exists in some form a select() can run against )
16:03 ribasushi </just an idea>
16:04 genio ribasushi++ # removing semantic arguments
16:04 cpan_mojo Mad-Mapper-0.08 by JHTHORSEN https://metacpan.org/release/JHTHORSEN/Mad-Mapper-0.08
16:04 sri btw. from DBD::Pg "tables: Supported by this driver as proposed by DBI. This method returns all tables and/or views (including materialized views) which are visible to the current user: ..."
16:05 sri not that i could ever figure out how to use that method correctly ;p
16:05 genio heh
16:05 sri https://metacpan.org/pod/DBD::Pg#tables
16:06 sri how odd, mojolicious is losing stars on github
16:09 jberger how many?
16:10 sri < 20 in the last few days
16:10 sri but a few every day
16:10 jberger IMO stars have become less relevant it seems, I know I don't star nearly as many things as I used to
16:10 jberger wow, that does seem like a lot though
16:11 jberger is it possible that github is reclaiming old accounts perhaps?
16:11 sri i wouldn't say that it has in general, this thing exists only for a week https://github.com/kennethreitz/records
16:11 * ribasushi has never starred anything on any platform that has "positive feedback only" mechanism in place
16:12 jberger why not, I kinda like the "positive feedback only" mechanism?
16:12 sri yea, negative feedback options will always get abused
16:12 jberger lend credence to things you like
16:13 jberger and what sri said
16:13 ribasushi in my experience stuff with positive feedback only is abused way more
16:13 PryMar56 joined #mojo
16:13 ribasushi .oO( we seem to be in anecdata territory ;)
16:13 jberger meaning ballot stuffing?
16:14 * jberger is from Chicago: "vote early and often"
16:14 sri abuse of negative feedback can seriously hurt projects, abuse of positive feedback makes a few more people look at worst
16:22 asarch joined #mojo
16:32 sri been thinking a little more about how to do stats right in minion
16:32 sri maybe a stats table would be better, and then we collect data for jobs that have since been deleted too
16:34 sri downside is that it would prolly require a bunch of triggers to update the table
16:44 meredith i'm pretty open with my stars and ++es, i use them as a mix of "i use this", tiny encouragement, and/or "i'd like to remember this for later"
16:54 lsm joined #mojo
17:44 vicash there are a lot of github starring bots as well. maybe they're cleaning house
17:45 vicash for example using ingy's git-hub command i just starred mojo's repo "git hub star kraih/mojo"
17:46 jberger vicash: is that against the rules? I assume you have to have a github token (tied to your account) to call that command
17:47 vicash anybody can create an account though.
17:47 vicash i dont know about whether there are any rules or not
17:50 sri ouch, materialized views don't actually show up in information_schema.tables
17:51 meredith man i hope they prioritize one-off accounts for harassment campaigns for removal before they go after that nefarious star-stuffing :P
17:54 cpan_mojo Mad-Mapper-0.09 by SADAMS https://metacpan.org/release/SADAMS/Mad-Mapper-0.09
17:54 vicash i believe, recruiters use github stars and forks to determine if they want to contact you or not. i have been contacted a few times from random ones citing my github account. i see star-stuffing and fork-stuffing as a way to get recruiters to contact you. there is some advantage to using bots ;)
17:56 jberger vicash: that's true, but can you register for an account via a bot? of course throwaway accounts are a problem but they aren't necessarily related to bots
17:57 vicash jberger: i have not tried building a bot to test opening an account.
17:58 jberger right, but I'm just saying that having an api (how the bots do their thing) which can star an account isn't the problem
17:58 jberger nevermind, not worth arguing about :-P
18:02 stryx` joined #mojo
18:04 sri i built a github account creation bot once and posted it in this channel ;p
18:07 sri i think the old metacpan voting system was borked, and we used those accounts to game the system and push underdog modules to the top
18:07 jberger Oo
18:08 sri it was funny for a day, and the voting system got revamped quickly
18:13 sri i think form handling with Mojo::UserAgent was a big topic back then
18:13 sri was a pretty good test case
18:21 jberger must have been before my time
18:21 jberger though I do remember the content generation refactor
18:26 zz_Foxcool joined #mojo
18:41 jberger I know there are other mocking libraries out there but would anyone find this useful? https://github.com/jberger/Mock-MonkeyPatch
18:41 jberger note that I haven't even run that code yet, but its basically extracted from something we use at $work
18:42 dvinciguerra joined #mojo
18:44 Grinnz oh, it keeps state of calls to the mocked function, neat
19:25 bpmedley jberger : In regards to the mock class - that's super sweet..
19:27 bpmedley My perl 5 mug is /awesome/
19:28 avenj jberger: I'd probably use it
19:34 bowtie_ joined #mojo
19:44 thowe joined #mojo
20:32 dvinci joined #mojo
20:42 sri actually really annoying that materialized views are so special in postgres
20:43 mspo vs oracle?
20:49 sri no vs
20:52 cpan_mojo Mojo-Pg-2.22 by SRI https://metacpan.org/release/SRI/Mojo-Pg-2.22
21:01 s1037989 joined #mojo
21:28 sri for the record, materialized tables don't show up in information_schema because they are not in the sql spec
21:28 sri s/tables/views/
21:31 jberger do views show up there?
21:32 sri yes
21:32 sri just materialized views are excluded
21:32 jberger so if tables and views do, doesn't it seem liek tables that are view should too?
21:33 sri you'd think so, but they handle information_schema according to the sql spec, which doesn't include them
21:33 jberger thats weird
21:33 sri information_schema is just a bunch of views based on the sql spec, while pg_catalog is the actual data postgres uses itself
21:33 jberger ah
21:34 sugar__ joined #mojo
21:42 sri some of the DBD::Pg code is really bad
21:43 ribasushi in my experience it's the lowest quality DBD we have
21:44 sri i wanted to know how it gets the data for table_info... https://metacpan.org/source/TURNSTEP/DBD-Pg-3.5.3/Pg.pm#L1005
21:46 Averna joined #mojo
21:49 ribasushi sri: that particular piece of code is just a hairy problem domain, there aren't too many avenues to improve things
21:49 ribasushi got to execute the individual SQL pieces in the various cases anyway
21:51 ribasushi in other words: while DBD::Pg is full of problems, this ain't something I count towards the blacklist ;)
21:51 sri :S
22:07 sri actually hard to decide how the tables method in Mojo::Pg should work exactly
22:07 sri tempted to do this https://gist.github.com/anonymous/847d0fdc118553c46730
22:08 sri let it include tables and views, but only those visible to the current user, and let DBD::Pg do the actual work
22:08 sri with that mess i linked to earlier ;p
22:20 sri ok, last chance
22:21 sri are there good reasons for excluding views?
22:21 sri for my primary use case (testing) it's more of a plus to include them
22:28 sri allright, this is how it stays then ;p
22:29 cpan_mojo Mojo-Pg-2.23 by SRI https://metacpan.org/release/SRI/Mojo-Pg-2.23
22:30 Averna joined #mojo
22:30 sri ¯\_(ツ)_/¯
22:40 Averna joined #mojo
22:52 jontaylor joined #mojo
22:59 disputin joined #mojo
23:04 hummeleBop joined #mojo
23:23 Adura joined #mojo
23:50 s1037989 Can Mojo::Collection be used to group data?  I have a dataset from Mojo::SQLite using hashes().  It's a Mojo::Collection of hash-based rows.  How could I group by id and sort each of the grouped collections by date?  Is this a job for Mojo::Collection?  Or should I be looking at something else?
23:51 jberger s1037989: you can certainly use it to iterate
23:52 jberger Whether it can be an appropriate output container depends largely on how you want your output structured
23:53 s1037989 Ok, so it can do the job.  Cool -- thanks!  I guess I have to figure out what I want my output to be!  :)

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