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

IRC log for #mojo, 2014-10-13

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

All times shown according to UTC.

Time Nick Message
00:02 genio I now have to figure out what order and the separation used with the C# HttpRequestMessage.Content.Headers.ContentMD5.ToString() and HttpRequestMessage.Content.Headers.ContentType.ToString() methods in order sign these things or the service barfs
00:05 genio after that, base64 the hmac_sha1   request method, those two things, current date/time in UTC, path and query string for the request
00:05 genio although if the query string isn't in the right order, it barfs as well
00:17 human39 joined #mojo
00:46 Averna joined #mojo
01:05 snap_ hi, I'm getting segfaults when starting up hypnotoad (morbo just hangs)... I am not getitng any messaging or other logging; anything i can do to try to fix this? it all previously worked on this system so I'm kinda guessing some sort of library incompatability
01:07 nicomen try running it with PERL5OPT=-d:Trace (needs Devel::Trace) and you should see which perl command that triggers the segfault
01:07 nicomen snap_: ^
01:08 jberger snap_: what os?
01:08 snap_ arch linux
01:08 purl i think arch linux is not as cool as demi linux.
01:09 jberger snap_: did you do any recent upgrades?
01:11 snap_ i've done several normal updates since last time i've ran it
01:11 * jberger must repost: https://dis.4chan.org/read/prog/1312655446/4
01:11 jberger snap_: then do the trace
01:13 jberger I'm so glad for two things, 1 the crazy weekend is over, 2 I have tomorrow off
01:20 snap_ http://paste2.org/8wZhyaP4
01:22 howitdo joined #mojo
01:27 klapperl joined #mojo
01:27 D4RK-PH0ENiX joined #mojo
01:33 jberger snap_: try this:
01:33 jberger perl -MParams::Util -E 1
01:35 jberger or better probably:
01:35 jberger perl -MParams::Util -E 'say "lived"'
01:36 jberger also, is it correct that your perl lives in /usr/share/perl5
01:36 jberger but your modules live in /usr/lib/perl5/
01:36 jberger ?
01:37 jberger might be ok, I never use the system perl anymore, so I don't remember
01:38 jberger it seems that it tries to load Params::Util and the xs bootstrap fails, which makes me think that perhaps you are using a binary incompatible perl to execute it
01:42 jberger (fwiw, my system perl does have those paths, so you might be ok on that front)
01:45 * jberger felt dirty using the system perl even that long .... ewwwwwww
01:45 * firnsy feels dirty using anything installed via a programming languages distribution mechanism
01:48 preaction huh?
01:49 jberger firnsy: you put a lot of faith into your platform's packagers
01:49 jberger someone packaged libmodule-build-cleaninstall-perl
01:50 jberger if they had talked to me, they would have known that that is really not necessary
01:50 firnsy the same amount of faith i put into a module writer i guess
01:50 preaction and those packagers probably use the language's toolchain, because the toolchain builds the modules
01:55 priodev joined #mojo
02:17 woz joined #mojo
02:50 noganex_ joined #mojo
02:53 woz joined #mojo
02:56 doublelel joined #mojo
03:03 jberger tempire: ahahahahahaha
03:03 jberger hahahahaha
03:03 purl LOLCON 5 reached.
03:03 jberger https://github.com/tempire/mojolicious-plugin-zombieapocalypse/blob/master/lib/Mojolicious/Plugin/ZombieApocalypse.pm
03:06 genio heh "Zombies are dead, so they're RESTful"
03:27 basic6_ joined #mojo
03:48 snap_ jberger: [1]    7346 segmentation fault (core dumped)  perl -MParams::Util -E 'say "lived"'
03:50 KCL joined #mojo
04:02 jberger try reinstalling that module then
04:10 sri maybe try exorcism
04:18 disputin joined #mojo
04:19 sri one of these days i need someone to explain this pattern to me, i just don't get how any of the DESTROYs can be triggered if there's a non-weakened circular reference active https://github.com/oliwer/mango/commit/e187205acd0c9fadffaa8cd83d03378545aa76a2
04:21 sri all i see is a leak, which is kept small because the Mango::Database instances get reused
04:21 * sri shrugs
04:22 sri it would be really cool if someone could implement the most minimal version possible of this for teaching purposes
04:23 sri if the pattern actually works, i'm sure it could be reused in more situations... but i remain sceptical
04:28 sri i never really understood the DBIx::Class implementation either... but my impression was always that one direction is still weakened, but when the DESTROY triggers an unweaken based on certain conditions keeping the object alive
04:28 sri s/when//
04:29 sri seriously.... i'd love a minimal example of this
04:33 zivester joined #mojo
04:40 irq joined #mojo
05:15 snap_ jberger: reinstalling Params::Util fixed that, but its still segfaulting when i start up hypnotoad
05:35 rwp_ joined #mojo
05:47 suy joined #mojo
06:02 suy joined #mojo
06:09 dod joined #mojo
06:11 dod joined #mojo
06:13 preaction joined #mojo
06:14 rwp joined #mojo
06:20 arpadszasz joined #mojo
06:42 suy joined #mojo
06:42 doublelel joined #mojo
06:51 suy joined #mojo
06:52 rawler joined #mojo
07:01 suy joined #mojo
07:04 Dandre joined #mojo
07:08 irq joined #mojo
07:19 Vandal joined #mojo
07:23 trone joined #mojo
07:31 vytas joined #mojo
07:34 odc sri, yup, i won't claim i totally understand it either, but i've been told it works great. So i'm giving it a try. I'm not releasing anything until it has been thoroughly tested though.
07:37 basiliscos joined #mojo
07:46 dp_ joined #mojo
07:50 doublelel joined #mojo
07:54 neyasov joined #mojo
08:04 marcus joined #mojo
08:05 jberger_ joined #mojo
08:05 batman joined #mojo
08:05 arthas joined #mojo
08:07 batman joined #mojo
08:08 jberger_ joined #mojo
08:08 marcus joined #mojo
08:11 woz_ joined #mojo
08:21 sri joined #mojo
08:21 * batman resurrecting sri :)
08:22 batman sri: we're online on a new server.
08:22 fhelmber_ joined #mojo
08:22 batman twice as much memory...
08:25 fhelmbe__ joined #mojo
08:37 mishantil batman: ..as is the way of "the cloud"? DOUBLE ALL THE THINGS!
08:38 batman i don't get it :(
08:40 mishantil Yeah, my jokes never do seem to hit the mark. :p
08:40 mishantil I was just referring to hosting-providers these days offering tiers, and prices, where everything is doubled. Like, you go from 2 GB ram, to 4GB, to 8GB, to 16gb etc.
08:43 batman :)
09:02 basiliscos joined #mojo
09:10 mudler joined #mojo
09:23 basiliscos joined #mojo
09:38 preaction joined #mojo
09:42 Dandre Hello,
09:45 Dandre usinf Mojo::Test, is there any way to name tests run. ie I want to name $t->get(http://192.168.1.1) to something more meaningfull than GET - http://192.168.1.1
09:46 Dandre I have tried $t->get("http://192.168.1.1","connect to my url...") but this doesn't work
09:48 aleksey_ joined #mojo
10:01 denis_boyun joined #mojo
10:04 neyasov_ joined #mojo
11:06 et joined #mojo
11:06 et Hi.
11:15 mishantil \o
11:17 et So I guess there's not a lot of traffic in this channel ;)
11:18 et I have trouble with hpynotoad on FreeBSD with the hot deployment and pinned it down to kqueue. Is there anybody here who want's to get into this?
11:18 bc547 et: depends on time of day :-)
11:25 et 4 AppServer laufen.
11:27 et Bye!
11:27 et left #mojo
11:28 dod joined #mojo
11:30 nicomen Dandre: I don't think you can due to the amount of params get_ok() accepts
11:30 nicomen Dandre: is it ok to do:
11:31 nicomen $ perl -MTest::Mojo -MTest::More -wle 'my $t = Test::Mojo->new(); $t->get_ok("http://www.google.no/")->status_is(200, "Google.no works"); done_testing;'
11:31 nicomen ok 1 - GET http://www.google.no/
11:31 nicomen ok 2 - Google.no works
11:31 nicomen 1..2
11:41 cpan_mojo Mojo-mysql 0.03 by Jan Henning Thorsen - http://metacpan.org/release/JHTHORSEN/Mojo-mysql-0.03
11:45 batman pause: "Permission missing" \o/ :(
11:51 Kripton joined #mojo
11:52 Dandre nicomen: yes that's what I will do
11:53 Dandre is there a list of tests that accept a description parameter?
11:55 arpadszasz joined #mojo
11:57 nicomen Dandre: I think "all" do, except get_ok() which accepts, callbacks, headers, and a lot of slightly non-deterministic parameter orders
12:00 nicomen but maybe I am wrong
12:03 Dandre ok thanks
12:03 irq how to combine render_to_string and render_maybe ?
12:04 punter joined #mojo
12:27 jberger snap_: since one compiled module was corrupted I'm assuming all are
12:28 jberger you might be better off installing a new clean perl
12:28 jberger anyway, I think we are safe in saying that it's not a mojo problem at this point
12:32 jberger Dandre: nicomen is right. you cannot pass a description to get_ok
12:33 lipizzan joined #mojo
12:33 jberger I usually use subtest for that purpose since probably what you are doing is making the group of tests
12:34 jberger s/making/naming/ # I guess it's that kind of swipe type day
12:36 zivester joined #mojo
12:43 D4RK-PH0ENiX joined #mojo
12:47 asarch joined #mojo
12:56 ryozi joined #mojo
12:58 D4RK-PH0ENiX joined #mojo
13:16 sri \o\
13:16 sri /o/
13:18 marcus o/ sri
13:21 jberger \say \o marcus and sri
13:22 jberger told you it was that kinda day
13:22 marcus \say \what
13:22 sri \say o/
13:22 marcus ding ding ding ding ding ding ding
13:22 marcus purl: what does the fox say?
13:22 purl i haven't a clue, marcus
13:23 marcus purl: don't disappoint me again!
13:23 purl marcus: what?
13:24 marcus purl: you've failed me for the last time.
13:24 purl marcus: sorry...
13:25 jberger oh we can totally fix that one!
13:26 nicomen the fox says moo
13:36 jberger what does the fox say?
13:36 jberger dang it purl!
13:40 jberger what does the fox say?
13:40 purl Fraka-kaka-kaka-kaka-kow!
13:41 jberger hehe
13:42 genio ok, all you europeans!  I'm taking over tomorrow in Paris.  beware
13:43 sri what does the bot say?
13:43 purl kill all the humans!
13:44 jberger https://www.youtube.com/watch?v=B1BdQcJ2ZYY
13:44 odc genio, what are you going to do in paris? 8|
13:44 genio odc: Visiting in-laws. Then traveling up to Strasbourg for my brother-in-law's wedding
13:45 genio but most importantly, I'm getting away from the US for a little while
13:45 genio \o/
13:45 odc oh i see :)
13:45 odc bring your coat!
13:47 genio Yea.  I'm leaving 31°C to travel somwehre that it's 18°C.  It'll be nice for a change, I guess
13:48 genio somewhere, too
13:49 genio I'm mostly looking forward to not working, eating great food, and drinking beer
13:51 odc a fine plan
13:52 odc i would replace beer by wine though
14:01 fhelmber_ joined #mojo
14:04 genio https://www.youtube.com/watch?v=9U4Ha9HQvMo
14:05 genio haha.. US news ^^
14:11 odc heh
14:21 purl joined #mojo
14:27 sri what's up with metacpan? is the design broken for anyone else? https://metacpan.org/pod/DBD::Pg
14:29 r0b3rt joined #mojo
14:29 jberger sri: broken how?
14:30 sri like not using any css at all
14:30 jberger also, why does vim-airline need patched fonts? seriously with all of unicode it couldn't find the chars it needed?
14:30 jberger sri; I'm not see that
14:30 sri interesting
14:31 sri what i see http://i.imgur.com/pKyC2Xj.png
14:33 sri ah, it works after i log out
14:33 sri how odd
14:33 jberger should I try logging in?
14:34 jberger still looks fine
14:35 * sri shrugs
14:38 basic6 joined #mojo
14:38 aleksey left #mojo
14:39 sh4 joined #mojo
14:49 sri btw. i still want to know this! http://irclog.perlgeek.de/mojo/2014-10-13#i_9498053
14:50 sri odc: btw. i've confirmed that it totally leaks like hell
14:51 sri perl -Ilib -MMango -E 'my $m = Mango->new; $m->db("foo_$_") for 1 .. 10000000'
14:52 sri so i guess that's not how DBIx::Class does it
14:52 odc sri, doh!
14:53 odc i pretty much copy/pasted DBIx::Class
14:54 batman odc: test, test, test, test, test, test, test, test
14:54 odc sri, do you know a good module to check leakages?
14:54 batman https://metacpan.org/search?q=Mojo%3A%3Amysql&size=20 # wohoo! i'm indexed :)
14:54 sri Devel::Cycle is good when you just use weaken a lot like me
14:55 sri i don't even understand how the DBIx::Class trick is supposed to work, so i have no idea how to test it
14:55 sri my one-liner above seems like a good test case though
14:56 odc sri, how do you know your test case leaks? you're just creating a million databases and exit
14:56 sri right, they should be garbage collected since they are not assigned to anything
14:57 odc oh
14:57 odc i'm not sure that's what i want though
14:57 sri i stopped the one-liner when it reached 700mb or so
14:58 sri well, then you want it to leak
14:59 sri but that decidion is up to you and the other Mango users
14:59 odc hm, well that depends how you use it
14:59 sri s/d/s/
15:00 odc i'm wondering how i can make it works with both ways
15:00 sri if you find a way let me know :)
15:00 odc sure
15:00 sri that's like the holy grail of perl memory management
15:02 sri i do wonder however if it doesn't really work in DBIx::Class either, or if their requirements are just different
15:02 sri (or if you made a mistake copying)
15:02 batman odc: YOU DO NOT WANT IT TO LEAK
15:03 sri oh wait, there is a way
15:03 sri but it's not a very nice one
15:03 odc cheelax yo
15:03 sri odc: inside out storage
15:04 sri like Mojo::IOLoop::Delay uses
15:04 odc inside out?
15:04 purl inside out are to objects.  they're just asshole objects
15:04 sri it's rather complicated though
15:04 sri you basically do manual memory management
15:05 odc sri, you mean like checking if i can reuse a DB object each time i create one?
15:05 sri https://github.com/kraih/mojo/blob/master/lib/Mojo/IOLoop/Delay.pm#L10
15:05 sri i don't consider it most of the time because it's hard to manage
15:08 sri i made a patch for Promises too https://github.com/stevan/promises-perl/pull/32
15:08 sri i suck at explaining this stuff though... don't bother asking ;p
15:10 odc interesting :)
15:14 jberger odc: with inside-out storage, there reference to the other object is not contained within the self reference, so no cycles
15:15 odc jberger, yup, in an external hash. I'm just learning about fieldhashes (first time i see them)
15:23 neyasov_ joined #mojo
15:29 _eugen joined #mojo
15:50 KCL_ joined #mojo
15:56 irq how to combine render_to_string and render_maybe ?
15:56 jberger irq: what would you expect it to do?
15:58 irq render a partial response (to string) from a template that might not exists. Was that possible with < 5.00, saying render_maybe( foo => partial => 1) ?
16:00 jberger and what does render_to_string do if it does not find a template?
16:02 jberger perl -Mojo -E 'a("/" => sub { say $_->render_to_string("no_template") || "no template"; $_->render( text => "hi" ) })->start' get /
16:05 irq OK, got it. Nice oneliner.
16:06 jberger ojo++
16:25 dsterne joined #mojo
16:32 disputin joined #mojo
16:41 jamesaxl joined #mojo
16:51 * sri wonders what's a better default username and password for Mojo::Pg, empty string or undef
16:52 sri apparently empty string allows PG* env vars, while undef allows PG* env vars and DBI_USER/PASS
16:53 sri DBI_DSN will not work, since the default dsn is dbi:Pg:, which allows other PG* env vars to just work like PGDATABASE
16:54 sri it's a maze of env vars
16:59 batman sri: could you do local $ENV{...}; before DBI->connect to make sure nothing magical happens?
16:59 sri batman: why do i care?
17:00 batman not sure.
17:00 batman has username => sub { rand > 0.5 ? '' : undef };
17:01 * batman runs away
17:01 batman i will go and make dinner now and minding my own business.
17:09 sri there's always a way to screw up env vars... trying to prevent it is an impossible fight
17:21 Kripton joined #mojo
17:21 dod joined #mojo
17:24 cpan_mojo Mojo-Pg 0.08 by Sebastian Riedel - http://metacpan.org/release/SRI/Mojo-Pg-0.08
17:29 aramisf joined #mojo
17:40 risugg joined #mojo
18:02 irq joined #mojo
18:25 basiliscos joined #mojo
18:32 denis_boyun joined #mojo
18:36 denis_boyun_ joined #mojo
18:37 r0b3rt left #mojo
18:39 r0b3rt joined #mojo
18:53 * sri counted the poll results https://groups.google.com/d/msg/mojolicious/3B7OXkk640E/2SjMPnHONpMJ
18:53 sri mysql is still damn strong
18:56 denis_boyun joined #mojo
19:02 batman +1 on pg for me :)
19:02 batman just started using it the other day
19:02 batman *barely*
19:03 disputin joined #mojo
19:09 chansen sri: Intresting, I'm surprised that neither DB2 or Oracle is on that list
19:09 sri indeed
19:10 berov joined #mojo
19:10 sri but i guess enterprise people don't really like participating in these polls
19:12 sri both have been mentioned on the list at least
19:13 * tempire is switching to postgres
19:24 sri batman: folks are +1-ing the old dist Mojo::MySQL -.-
19:24 sri POSTGRES ALL THE THINGS
19:25 genio I am a fan of Postgres thus far (using it for several years now).  sanity++
19:26 sri i guess the word sanity described postgres best
19:27 sri so far all the parts i find stupid are just part of ansi sql
19:27 sri like the funky quoting rules
19:29 berov I +ed it when :mysql was not yet available
19:33 devroot joined #mojo
19:34 devroot Is is possible to override ->render to add a 'Access-Control-Allow-Origin' header each time?
19:35 batman sri: Mojo::MySQL will be gone soon
19:35 batman i wonder if anyone will "transfer" their +1 :)
19:50 berov batman: I did it today
19:50 berov on metacpan
19:50 batman there's no +1 here https://metacpan.org/pod/Mojo::mysql
19:50 berov hm really now I did it
19:51 batman that's weird...
19:51 batman still can't see it
19:51 batman anyway... i'm off to bed.
19:51 batman not feeling to good :/
19:51 batman +o
19:52 berov sleep well
19:52 berov now it has to be there
19:52 denis_boyun joined #mojo
20:11 * berov created https://github.com/DBD-SQLite/DBD-SQLite/issues/6 feature request for asynchronous queries in DBD::SQLite wanders if it is possible :S
20:12 cfedde heh
20:12 berov s/a/o/
20:13 cfedde what would async access mean when talking to a single threaded database?
20:15 berov I do not know :)
20:15 woz joined #mojo
20:19 berov like having render_later  in a Mojolicious app using DBD::SQLite
20:20 sri it seems rather pointless
20:20 meredith it kinda requires setting up another process or thread to do the work.  i mean, you can call sqlite3_step() less often to let other things happen in your process, cooperative style, but it's where all of the sqlite work happens for responding to a query
20:20 meredith so it slows down responses
20:22 meredith if your needs move beyond having your db embedded in-process, may as well get something that's actually engineered for being a service
20:24 berov I am ignorant about async IO, altough I sued it with Mojo::UserAgent  and felt the benefits
20:24 berov used*
20:24 denis_boyun_ joined #mojo
20:27 berov then a hypotetical Mojo::SQLite woould be just a wrapper to provide the API much like Mojo::Pg and Mojo::mysql
20:27 meredith yeah, with sqlite your process is literally doing the work.  with redis, postgres, sqlite, etc, you have a socket to them and just get to let the OS tell you when something interesting appears on the socket.
20:28 berov this would allow a Mojolicous user to interchangeably use them in different deployments
20:28 berov much like with DBI
20:31 berov meredith: thanks
20:39 * sri wonders what else he could do to make Mojo::Pg feel more like Mojo::DOM
20:40 sri (that's the goal in case it's not obvious ;p)
20:41 sri ideally using sql just feels like using a css selector
20:41 dmanto joined #mojo
20:44 berov sri: this sounds revolutionary to me , just because I haven't thought on it this way
20:49 sri i was hoping examples like this one bring the point across $db->query('select * from names')->hashes->pluck('name')->join("\n")->say;
20:51 Adura '#names *'
20:55 berov I think the goal should be stated explicitly :)
20:55 Adura A join: '#names #posts .id.pid'
20:55 Adura Just CSSy.
20:56 berov for me it looked like common Mojo API style, but haven't tought about DOM specifically
20:56 berov or CSS
21:02 jberger I looked at async sqlite once
21:02 jberger I seem to remember thinking that it wasn't totally useless
21:07 berov jberger: :))) really :)
21:07 berov ?
21:07 jberger it was a file io thing
21:10 panzana` joined #mojo
21:10 dmanto hi, i'm getting some errors when running websocket tests, marked "(in cleanup)", saying that can't call my helper on an undefined value at .... and is in my ->on(finish => sub {...
21:10 meredith there is a way to get part of writes async, but it doesn't change the interface Perl is touching, it just makes it so execution steps outside perl for slightly less time.
21:10 dmanto that i try to clean something
21:13 chansen jberger: I would not say that SQlite's asynchronous possibilities is useless, but you would have to give up one of the ACID properties, Durability. Personally I would never use a non ACID compliant API/RDBM for any critical work, it's fundamental property for data IMO.
21:13 dmanto it doesn't happen all the time, just once every 10 or 20 times i run the tests. If i do the cleaning only when $self is defined ( i mean, inside the finish event), the problem stops but i guess im not doing the internal cleaning
21:14 meredith it's probably best to just have a lot of worker processes each doing its own blocking work with sqlite than to try to make your dealings with sqlite more complex.
21:15 dmanto well anyway it doesn't actually stop the problem, just happens much less but with the "renderer" helper inside Mojolicious::Controller
21:16 meredith dmanto: you may need to pastebin something so folks can take a look
21:16 dmanto oops sory
21:18 woz joined #mojo
21:28 berov sri: Mojo/Pg/Database.pm looking at query .. It does not call $dbh->prepare() every time, right?
21:29 berov if called multiple times - e.g. in a loop with different bind valriables
21:39 preaction joined #mojo
21:55 woz joined #mojo
22:01 dmanto meredith: i'm trying to write a simplified version to reproduce the error, but it never fails, tryied like a thousand times :(, give another try tomorrow and get back to #mojo
22:04 meredith ah, sorry to hear that.  sometimes trying to reduce things down to an example for sharing ends up helping you isolate the issue :)
22:05 mib_ez7n6g joined #mojo
22:07 disputin joined #mojo
22:07 chansen dmanto, meredith: whiteout a small reproducible case it would be impossible to help you!
22:59 Averna joined #mojo
23:21 vytas joined #mojo
23:28 human39 joined #mojo

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