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

IRC log for #mojo, 2015-04-05

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

All times shown according to UTC.

Time Nick Message
00:37 asarch joined #mojo
00:53 mattastrophe joined #mojo
00:57 noganex joined #mojo
01:06 hummeleBop joined #mojo
01:50 klapperl_ joined #mojo
01:51 mattastrophe joined #mojo
02:08 sawtooth joined #mojo
02:12 noganex_ joined #mojo
03:25 mattastrophe joined #mojo
03:27 Zoffix How can I generate the standard "Raptor not found" 404?
03:27 Zoffix Doing $c->reply->not_found;  isn't working :/
03:27 Zoffix Oh
03:27 Zoffix Never mind. In non-production mode you get the debug page, that's why.
03:56 basic6 joined #mojo
04:11 kaare joined #mojo
04:14 asarch joined #mojo
04:25 KCL_ joined #mojo
05:33 dotandimet joined #mojo
06:07 inokenty-m1 joined #mojo
06:09 disputin joined #mojo
06:09 inokenty-m2 joined #mojo
06:10 inokenty-m3 joined #mojo
06:44 dotandimet joined #mojo
07:05 Oleg joined #mojo
07:20 cpan_mojo Mojolicious-Plugin-AssetPack 0.48 by Jan Henning Thorsen - http://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-AssetPack-0.48
07:24 cpan_mojo Mojolicious-Plugin-LinkEmbedder 0.2301 by Jan Henning Thorsen - http://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-LinkEmbedder-0.2301
07:56 cpan_mojo Mojolicious-Plugin-AssetPack 0.49 by Jan Henning Thorsen - http://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-AssetPack-0.49
07:56 Vandal joined #mojo
07:57 dod joined #mojo
08:03 dod joined #mojo
08:59 berov joined #mojo
09:07 inokenty-m joined #mojo
09:25 trone joined #mojo
09:48 amon joined #mojo
10:30 mattastrophe joined #mojo
11:07 kaare joined #mojo
12:28 marty joined #mojo
12:29 mattastrophe joined #mojo
13:03 sh4 joined #mojo
13:04 punter joined #mojo
13:13 good_news_everyon joined #mojo
13:13 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/veC4f
13:13 good_news_everyon mojo/master 3bcced3 Sebastian Riedel: improve Mojo::DOM::CSS to handle attribute selectors with single quotes correctly (closes #777)
13:13 good_news_everyon left #mojo
13:14 asarch joined #mojo
13:15 sri normally i would have said "meh, who needs single quotes?", but that was a well written report... so i just made it work :)
13:15 sri Zoffix++
13:19 sh4|2 joined #mojo
13:21 sh4 joined #mojo
13:31 sh4|2 joined #mojo
13:45 DaniBunny joined #mojo
13:45 punter Is it true that route handlers in blocking webapps are not allowed to take more than 20 seconds to execute?
13:55 dod joined #mojo
14:36 mattastrophe joined #mojo
14:37 gryphon joined #mojo
15:07 Zoffix lol
15:10 batman sri++
15:10 batman Zoffix++
15:12 batman crap. it's waaaaay to easy to write a plugin
15:12 batman :)
15:30 Zoffix punter, http://mojolicio.us/perldoc/Mojolicious/Guides/FAQ#What-does-Inactivity-timeout-mean
15:38 Oleg joined #mojo
15:43 mattastrophe joined #mojo
15:44 * sri has a feeling that #775 will not reach consensus https://github.com/kraih/mojo/pull/775
15:45 Zoffix Yeah, I have the same feeling. We probably should close it, until more demand for the feature surfaces.
15:46 * Zoffix can always subclass Test::Mojo for this one app where he uses the proposed test
15:46 cpan_mojo Ado 0.87 by Krasimir Berov - http://metacpan.org/release/BEROV/Ado-0.87 (depends on Mojolicious::Plugin::DSC)
15:46 cpan_mojo Mojolicious-Plugin-Ical 0.01 by Jan Henning Thorsen - http://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-Ical-0.01
15:46 sri make it a cpan module, with jbergers test thingy
15:46 sri https://metacpan.org/pod/Test::Mojo::Role
15:46 batman Zoffix: you can also do $_count_is = sub { .... }; and $t->$_count_is("div", 8);
15:47 Zoffix neat
15:58 kaare joined #mojo
16:12 good_news_everyon joined #mojo
16:12 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/veWIs
16:12 good_news_everyon mojo/master bbdd6d6 Sebastian Riedel: more consistent formatting
16:12 good_news_everyon left #mojo
16:14 sri this is the first scraping dsl i like https://github.com/rc0x03/node-osmosis#example-scrape-all-craigslist-listings
16:22 cpan_mojo Mojo-Pg 2.04 by Sebastian Riedel - http://metacpan.org/release/SRI/Mojo-Pg-2.04
16:23 cpan_mojo Mojolicious-Plugin-Ical 0.02 by Jan Henning Thorsen - http://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-Ical-0.02
16:24 batman i hope i've done respond_to() correct... ^^
16:25 basic6_ joined #mojo
16:25 sri might want to mention the content type in the docs too
16:26 batman Ah! Thanks :)
16:27 batman I wonder where... Got any example?
16:29 sri oh, look what i just stumbled over :) http://casperjs.readthedocs.org/en/latest/modules/tester.html#assertelementcount
16:31 batman element_count_is() ? :)
16:31 sri yea
16:34 batman Sweet!
16:34 batman +1
16:34 purl 1
16:36 batman I'm so happy about Mojolicious. It still amazes me how easy it is to use, and how easy it is to extend.
16:36 batman Thanks sri.
16:36 purl Thanks sri. is there a way to delay without blocking other jobs?
16:37 batman I only wish I was better at making applications instead of just modules :/
16:40 jberger batman: honestly I'm having that sane experience at $work
16:40 jberger I'm so used to writing modules
16:41 jberger but with an in house app I can use hooks and router conditions and features of recent perls
16:42 jberger Zoffix: yeah you could make a test role if it doesn't make mojo core
16:42 Zoffix I'm already at "writing docs" stage :)
16:42 sri Zoffix: what's the use case for >n and <n anyway?
16:42 sri i can't find any test module that does that
16:42 sri just exact number of elements tests
16:43 jberger Zoffix: if you need an example of use, my unreleased phantom module has examples
16:43 jberger it's in a holding pattern waiting for the new test::more
16:44 Zoffix sri, say, ->element_count('#paginated_content li', '<101', 'We set to have at most 100 items per page');
16:44 Zoffix But I really added it as an afterthought..
16:44 sri shouldn't you know how many items your test database contains?
16:45 Zoffix Probably
16:45 sri to actually test that pagination works ;p
16:45 Zoffix :)
16:54 batman +1 on removing <x and >x
16:55 batman and i hope it turns into element_count_is (with _is at the end). i think that's consistent with the other methods
16:55 Zoffix It already is
16:58 batman jberger: btw: i released the Ical plugin because i'm making a schedule for MCT.
16:58 batman going to use http://fullcalendar.io/ as well
17:22 mattastrophe joined #mojo
17:38 fhelmber_ joined #mojo
17:44 cpan_mojo Test-Mojo-Role-ElementCounter 1.001001 by Zoffix Znet - http://metacpan.org/release/ZOFFIX/Test-Mojo-Role-ElementCounter-1.001001
17:47 Zoffix Removed ranges from 755
17:47 Zoffix *775
17:48 sri Zoffix: you can now just use an "is" test
17:50 Zoffix Updated
17:51 Vandal joined #mojo
17:59 * Grinnz tends to prefer cmp_ok '==' for numeric tests, after running into "issues" testing Math::Calc::Parser results with is
18:00 Zoffix What sort of issues?
18:00 Grinnz the usual, string comparison of numbers issues
18:01 Grinnz probably wouldnt matter in this case
18:03 jberger batman++
18:03 jberger Zoffix++
18:03 batman what did i do now..?
18:03 jberger released an Ical plugin
18:03 batman aha. :)
18:04 batman jberger: what do you think about using Mad::Mapper in MCT?
18:05 jberger I really haven't used/looked at it much
18:06 batman it's only available on github.
18:06 jberger but yeah the queries are starting to get a little hairy aren't they?
18:06 batman yeah. a bit.
18:07 batman not sure if Mad::Mapper helps much there, but at least it has "has_many" :)
18:07 batman and it can also generate more sql...
18:08 jberger lots of family things this weekend for the holiday
18:08 jberger don't have much time for coding
18:08 jberger I need to find some time for a mojoconf blog post
18:09 jberger I'll do that tonight
18:10 preaction for "test a bunch of DOM elements", i've been using things like Test::Deep::cmp_deeply [ $dom->find( 'a' )->map( attr => 'href' )->each ], \@expected_hrefs
18:10 batman jberger: cool
18:17 mattastrophe joined #mojo
18:37 mattastrophe joined #mojo
18:40 L0ck3D joined #mojo
18:55 harry joined #mojo
18:57 batman harry: hey! :)
18:57 harry hi
18:57 purl niihau, harry.
18:58 batman harry: i don't mean that we should remove transactions from migrations, because i will probably not make any difference.
18:58 batman the user should put BEGIN WORK (or whatever) manually to the migration script if he/she wants to run parts inside a transaction
18:59 batman and the reason for this is that most of the statements in the transaction script will issue a COMMIT and render begin_work() useless.
18:59 batman sorry. i started out wrong: i mean we _should_ remove transactions from migrations.
19:01 batman mysql works in mysterious ways (implicit commit in this case), so in most cases begin_work() will give the impression that the db server can do something it can't
19:01 batman harry: ^ at least to me, it comes as a surprise, so therefor i think it's best to make it explicit that we're not providing any transactions.
19:02 harry I do not agree
19:02 harry If migration script has error, who will issue the ROLLBACK
19:03 batman noone, because there's most probably isn't anything to rollback to.
19:03 batman the db is messed up :(
19:03 batman that's why we tell them to make a backup before running the migrations :)
19:05 batman let's say #1 alter table #2 delete data #3 alter column #4 BOOM #5 ROLLBACK...? uhm... to what? :/
19:05 dod joined #mojo
19:06 harry If the user has BEGIN WORK in his script, he expects ROLLBACK to be called on error
19:06 harry and now this will happen
19:07 batman ok. let's keep ROLLBACK, but remove begin_work() then.
19:07 batman no. sorry. i don't agree.
19:08 batman the db should be disconnected which again does an implicit rollback on error.
19:09 batman hm... never thought about this actually: is there anything that issue rollback if AutoCommit=0 ?
19:10 batman sri: is that an issue in Mojo::Pg...? can a $dbh get put back into the pool, while in a transaction?
19:14 harry its dangerous if you put dbh back in pool if autocommit is off or is in transaction
19:15 batman i agree
19:15 mattastrophe joined #mojo
19:15 harry excuting migrations in transaction ensures that autocommit is on and not in transaction, either on success or failure
19:16 batman harry: maybe we should do $dbh->rollback unless $dbh->{AutoCommit}; in DESTROY() ?
19:22 batman harry: i think we should discourage everything that has to do with BEGIN WORK in the migrations step...
19:22 harry its possible, but code will be more complicated than current
19:22 mst well, making data changes in a transaction is nice
19:22 batman unless you can help me see a case where that is useful
19:22 batman harry: ok. let's drop the DESTROY idea
19:23 harry soon mariadb will have transactional DDL https://mariadb.atlassian.net/browse/MDEV-4259
19:23 batman harry: okidoki. i cave :)
19:24 harry 10x
19:25 harry see the last chnage in POD, it explains all the caveats with MySQL transactions I remembered
19:27 batman harry: "but only DML statements after the last implicit or explicit C<COMMIT> can be reverted." <-- is that correct? i thought the programmer had to explicit add BEGIN WORK after each explicit (DDL) COMMIT statement
19:27 harry its correct
19:27 harry because of the autocommit=0 no explicit BEGIN WORK is needed
19:28 batman i don't get it: #1 begin work #2 alter table #3 delete data #4 insert data #5 BOOM <--- will delete data be rolled back?
19:28 batman after all, the database has done an implicit commit after #2
19:29 batman i have to test that.
19:29 harry yes #3 and #4 will be reverted
19:30 mst not until 4259 lands it won't
19:30 mst it'
19:30 mst it's mysql, #2 will cause a silent implicit commit
19:30 mst you'd have to BEGIN a second time after the alter to get the delete and insert in a txn
19:31 mst certainly the last time I tested it; it may be differently fucked up in newer versions
19:31 batman harry: i think mst is right. autocommit=0 is just visible in the object, and not reflected on the server (i believe)
19:31 batman or... i'm not even sure if autocommit gets changed
19:32 batman (or not)
19:32 harry not correct
19:32 * batman checks
19:32 harry if you set $sth->{AutoCommit}=x SET autocommit=x is executed on server
19:34 mst harry: AutoCommit 0 causes a BEGIN to be issued immediately before whatever the next query is
19:34 batman but what happens after implicit commit?
19:34 mst batman: you're fucked.
19:34 batman that's what i thought
19:36 harry MySQL keeps two different states for AUTOCOMMIT and IN_TRANS
19:38 harry after implicit COMMIT STATUS_IN_TRANS is 0, but since STATUS_AUTOCOMMIT is off it acts as in transaction
19:38 romel hello. i want to query my database with Mojo::Pg using data received from client through GET request. what's the best practice for avoiding sql injections in such situations?
19:38 mst romel: use placeholders
19:39 Grinnz you should never insert any user data directly in a query
19:39 romel mst: is that a DBD::Pg term?
19:39 mst romel: no, it's a DBI term
19:39 romel alright. thank you
19:39 mst romel: "SELECT ... WHERE foo = ?" <- the ?
19:40 Grinnz in DBD::Pg you can use either ? or $1, $2, etc
19:40 batman romel: $pg->db->query("SELECT whatever FROM your_table WHERE foo=?", "placeholder_for_the_question_mark");
19:40 Grinnz i usually use single-quote for the query, to enforce that no variable data is used directly (in most cases)
19:41 batman harry: wow. that is crazy.
19:41 batman you know too much about mysql :)
19:41 Grinnz MADNESS?!
19:41 purl Welcome to the House of Fun!
19:41 Grinnz THIS IS MYSQL!
19:42 * Grinnz kicks purl into a pit
19:42 romel that's the way i am doing it at the moment. going to find out how does placeholders prevent injections. thank you guys
19:42 mst harry: ok, I've just gone and read the DBD::mysql sources
19:42 batman harry: the best is that the mysql documentation does not seem to reveal any such information :(
19:42 Grinnz romel, simple: because placeholder values cannot be misread as query syntax
19:42 mst harry: that's (a) bizarre (b) not how anything else works AFAIK
19:42 pink_mist romel: becuase the user data is simply not interpreted as SQL.
19:43 mst batman: but it appears harry is correct
19:43 harry I found this while debugging the Mojo::MySQL5::Connection module
19:43 batman mst: how is the mysql-way how anyone else does it? haha :)
19:43 Grinnz yeah sounds like par for the course
19:44 batman harry: ok. now i'm _really_ starting to agree with you.
19:44 jberger joined #mojo
19:45 batman harry: but... just so i get it: it will still do implicit commit on the previous statements, right..?
19:45 batman nevermind.
19:45 purl Well piss off then, batman
19:46 harry yes, it will
19:46 mst batman: yes, so it's still going to suck -somewhat-, but that's all you get
19:46 batman then i think we should just replace "can" with "will" in https://github.com/jhthorsen/mojo-mysql/pull/16/files
19:46 cono joined #mojo
19:47 harry "can" is more correct
19:47 Grinnz which one?
19:47 batman both imo.
19:47 harry for example if it is on MYISAM table it "will" no
19:47 harry "will" not
19:48 batman ok. i agree.
19:48 batman but on the second... how about "This means database will most probably be left in unknown state...." ?
19:49 Grinnz "most likely" - better grammar :P
19:49 batman Grinnz: thanks.
19:51 mattastrophe joined #mojo
19:53 harry pushed "most likely"
19:55 harry I still do not like the "backup your database", this POD is for developers, backup if for users of their applications
19:55 batman more and more devops. i think it's a good idea.
19:55 batman the developers can even copy/paste this information on to the users of their application.
19:56 batman "on to the users of" => "on to the documentation in"
19:56 batman i would rather have more information, than missing out on details.
19:57 batman harry: how about the links? should we refer to them? https://github.com/jhthorsen/mojo-mysql/pull/16#issuecomment-89515512
19:59 batman harry: i'm sorry that PR has taken so long time. it's just that i want to be sure i'm not misleading the users, so they are left with a messed up database without any notice.
20:00 * harry Yes, I understand
20:00 batman thanks
20:00 batman want me to hit the merge button?
20:00 Grinnz hit the red button!
20:00 harry Not sure about the links, they state excatly the same as we already stated
20:01 harry Yes, do the merge
20:01 batman okidoki. hitting merge now :)
20:01 batman harry++
20:01 preaction Gronk! Pull the lever!
20:01 batman harry: thanks for joining #mojo. i think it's much easier to discuss here.
20:01 batman nice talking to you :)
20:03 batman harry: wanna make a new release?
20:04 mst harry: being able to snapshot the database is commonly something integrated into the deployment process for an application, so it is dev-relevant
20:04 mst harry: and even if the users are separate, the devs need to know to warn their users to do a backup
20:06 harry I will make new release for both Mojo::mysql and Mojo::MySQL5, same changes in both
20:07 batman i can release Mojo::mysql if you like
20:09 harry One last change: t/migration.t as in Mojo::Pg
20:10 batman ok. go crazy :)
20:20 mst harry: btw, sorry for doubting you, I thought the 'BEGIN before next statement' thing was standard rather than merely common
20:22 mattastrophe joined #mojo
20:23 harry mst: quiet implicit commit is non standard
20:25 mst harry: yeah, but I knew about that part, it was the server side 'set autocommit' that was new to me
20:25 mst had the DBD issued a BEGIN WORK like I expected it to, everything I said would've been accurate
20:25 mst however the source code makes it very clear that you were right and I was wrong there :)
20:27 btyler joined #mojo
20:29 cono hey guys, didn't want to spam here too much. May I have your attention here: https://groups.google.com/forum/#!topic/mojolicious/OQEH0Aisouo TIA
20:35 Grinnz cono, generally, you use FindBin to find the location of the executable
20:35 Grinnz i'm not sure if that would help your issue
20:36 mattastrophe joined #mojo
20:36 cono Grinnz: actually - no :) My issue with another thing
20:37 Zoffix joined #mojo
20:38 cpan_mojo Mojo-mysql 0.10 by HARRYL - http://metacpan.org/release/HARRYL/Mojo-mysql-0.10
20:40 cpan_mojo Mojo-MySQL5 0.04 by HARRYL - http://metacpan.org/release/HARRYL/Mojo-MySQL5-0.04
20:44 batman harry++
20:45 KCL joined #mojo
20:46 Zoffix joined #mojo
20:51 harry batman: I used git-ship to make the release
20:51 harry It replaced repository from 'https://github.com/harry-bix/mojo-MySQL5.git' to 'https://github.com///github.com/harry-bix/mojo-MySQL5.git'
20:52 harry in the Makefile.pl
20:55 batman which release? Mojo::mysql or Mojo-MySQL5 ?
20:56 batman harry: what does "git remote -v|grep origin|head -n1" say?
20:57 harry originhttps://github.com/harry-bix/mojo-MySQL5.git (fetch)
21:23 marcusr o/
21:23 marcusr don't watch Focus. What a crap movie..
21:24 jberger cono: could a mode specific configuration file help you here?
21:24 jberger http://mojolicio.us/perldoc/Mojolicious/Plugin/Config#DESCRIPTION
21:25 jberger it's solving you're problem a very different way, but I don't know the answer to the specific question you are asking
21:25 jberger *your
21:29 noganex joined #mojo
21:34 batman harry: https://metacpan.org/release/JHTHORSEN/App-git-ship-0.13
21:35 batman harry: thanks for reporting in. i would be super happy if there's anything else i should improve in git-ship
21:36 * batman is calling it a day
21:36 batman back tomorrow
21:36 harry batman: 10x
21:36 batman you're welcome. thanks for using my code :)
21:37 cono jberger: oh, thanks, will read about it. Looks like I missed it when I was reading doc for the first time :) Thanks
22:00 alnewkirk joined #mojo
22:05 mattastrophe joined #mojo
22:13 * Zoffix ponders how to debug "Use of uninitialized value in subroutine entry at /home/zoffix/perl5/perlbrew/perls/perl-5.20.1/lib/site_perl/5.20.1/Mojo/Util.pm line 113,"
22:19 Zoffix hmpf... Seems something with 404s... oh well, screw it
22:19 Grinnz Zoffix, if that's current version of mojo, something is calling Mojo::Util::hmac_sha1_sum with undef, possibly the session cookie mechanism
22:19 Grinnz undef secret or data
22:39 nicomen1 joined #mojo
22:42 nicomen joined #mojo
22:47 mattastrophe joined #mojo
23:05 sri hahaha, the .sucks tld is brilliant
23:05 mst sri: my favourite domain so far is bad.solutions
23:06 sri $9.95 for consumers, $2500 for businesses
23:09 Grinnz heh
23:11 mattastrophe joined #mojo
23:32 _dave_ is "microsoft.sucks" registered yet?
23:34 _dave_ damn it is
23:36 _dave_ I take that back, seems there's some automatic answer for *.sucks
23:37 mattastrophe1 joined #mojo

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