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

IRC log for #mojo, 2014-09-30

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

All times shown according to UTC.

Time Nick Message
00:02 callumgare joined #mojo
00:33 zivester joined #mojo
00:35 neyasov____________ joined #mojo
00:39 woz joined #mojo
01:13 disputin joined #mojo
01:15 preaction joined #mojo
01:36 neyasov____________ joined #mojo
01:40 woz joined #mojo
02:08 noganex joined #mojo
02:09 Averna joined #mojo
02:30 jberger Ah interesting nugget :
02:31 jberger "the subroutine with the postfix dereference is always called in scalar context despite what you are doing with the result or how you are assigning it. A reference is always a scalar, and that’s a single thing."
02:32 jberger From http://www.effectiveperlprogramming.com/2014/09/use-postfix-dereferencing
02:32 jberger By bdfoy
02:36 neyasov____________ joined #mojo
02:41 woz joined #mojo
03:02 basic6_ joined #mojo
03:24 brainbuz joined #mojo
03:27 r0b3rt http://www.myspacegraphics24.com/graphics/alcohol/alcohol47.jpg
03:37 neyasov____________ joined #mojo
03:39 gvenkat joined #mojo
03:42 woz joined #mojo
03:49 jberger Woo-hoo!
04:05 rblackwe joined #mojo
04:38 neyasov____________ joined #mojo
04:43 woz joined #mojo
04:51 irq joined #mojo
05:01 gvenkat_ joined #mojo
05:08 ua_ joined #mojo
05:20 KCL_ joined #mojo
05:29 dotandimet joined #mojo
05:37 dod joined #mojo
05:39 neyasov____________ joined #mojo
05:44 woz joined #mojo
06:06 preaction joined #mojo
06:06 ryanc joined #mojo
06:12 batman jberger: https://twitter.com/iearnsomething/status/516754610384809984 :)
06:23 dotandimet joined #mojo
06:25 sujithm joined #mojo
06:29 sujithm joined #mojo
06:33 Vandal joined #mojo
06:36 dp_ joined #mojo
06:40 neyasov____________ joined #mojo
06:45 woz joined #mojo
06:58 mtths joined #mojo
07:00 dod joined #mojo
07:10 sugar joined #mojo
07:26 neyasov____________ joined #mojo
07:37 denis_boyun joined #mojo
07:47 woz joined #mojo
07:47 basiliscos joined #mojo
07:52 dotandimet joined #mojo
07:55 dod joined #mojo
08:22 trone joined #mojo
08:29 d4rkie joined #mojo
08:48 woz joined #mojo
09:08 basiliscos joined #mojo
09:10 dod joined #mojo
09:18 basiliscos joined #mojo
09:26 Dandre joined #mojo
09:26 basiliscos joined #mojo
09:29 basiliscos joined #mojo
09:46 zgarnog joined #mojo
09:49 woz joined #mojo
09:58 jwang joined #mojo
10:01 basiliscos joined #mojo
10:02 Dandre joined #mojo
10:06 fhelmber_ joined #mojo
10:08 denis_boyun joined #mojo
10:13 dod joined #mojo
10:14 basiliscos joined #mojo
10:27 odc problem: i've made a Memoized function which returns a Mojo::DOM object. The first time I call it it works. But after that, the function return a XML string instead of the DOM object
10:27 odc any idea how to fix that?
10:33 basiliscos joined #mojo
10:45 d4rkie joined #mojo
10:50 woz joined #mojo
10:58 d4rkie joined #mojo
11:07 cosimo joined #mojo
11:09 basiliscos1 joined #mojo
11:24 fhelmber_ joined #mojo
11:25 ryozi joined #mojo
11:47 jberger batman: nice
11:48 jberger odc: something is stringifying the object
11:51 woz joined #mojo
11:52 odc yup, looks like it's memoize
11:52 odc grrr
12:06 neilhwatson joined #mojo
12:29 batman jberger:)
12:33 ladnaV joined #mojo
12:39 mib_z9fsrk joined #mojo
12:43 basiliscos joined #mojo
12:53 woz joined #mojo
12:54 nicomen has anyone encountered issues with Plack or FCGI and wrong encoding of the URL? (PATH_INFO or REQUEST_URI or whatever it uses)
12:54 nicomen (with mojolicious of coursE)
12:57 zgarnog joined #mojo
13:04 agorman joined #mojo
13:20 jberger_ Btw that picture is clearly taken from the west looking east
13:21 jberger_ batman: when are you coming to visit?
13:21 batman jberger_: hehe... been there done that! ;)
13:21 batman or... i haven't actually visited you.
13:22 batman no idea when that could happen :/
13:22 jberger_ WAT! Why didn't you visit!?
13:22 batman before i knew you
13:23 jberger_ Doesn't matter!
13:23 jberger_ :-P
13:24 batman haha
13:24 batman took the train from nyc. went to milwaukee iirc
13:28 ghandi|work joined #mojo
13:31 zivester joined #mojo
13:33 marty joined #mojo
13:43 cosimo joined #mojo
13:45 ver joined #mojo
13:54 woz joined #mojo
13:54 sugar joined #mojo
14:03 arthas joined #mojo
14:11 neyasov joined #mojo
14:30 sh4 joined #mojo
14:32 dexteruk joined #mojo
14:43 * sri yawns
14:46 * genio stuffs donuts in there
14:48 disputin joined #mojo
14:49 sri nom
14:49 neyasov joined #mojo
14:52 dexteruk joined #mojo
14:55 woz joined #mojo
15:03 rawler joined #mojo
15:32 dexteruk joined #mojo
15:55 sanya_com_ua joined #mojo
15:57 woz joined #mojo
15:59 lipizzan joined #mojo
16:16 basiliscos joined #mojo
16:54 jamesaxl joined #mojo
16:58 woz joined #mojo
17:06 jamesaxl joined #mojo
17:20 KCL joined #mojo
17:49 gunt joined #mojo
17:50 gunt hi, can someone tell me how to fix this error? Mojo::Reactor::Poll: Timer 8fc595776abb18dc49d099f769065ddb failed: Can't call method "_error" on an undefined value at /usr/local/share/perl/5.14.2/Mojo/UserAgent.pm line 122.
17:50 dvinciguerra joined #mojo
17:52 gunt http://irclog.perlgeek.de/mojo/2014-07-10#i_9001085
17:59 woz joined #mojo
18:02 sugar joined #mojo
18:05 preaction joined #mojo
18:20 basiliscos joined #mojo
18:24 sujithm joined #mojo
18:25 sujithm_ joined #mojo
18:35 * genio kicks MySQL in the teeth for lack of FULL OUTER JOIN.
18:35 genio wasting my damn time
18:35 mst er
18:36 mst hm
18:36 genio (... left outer join ... ) UNION ALL ( ... right outer join ... ) is a very annoying way to have to go about that.
18:37 mst I was thinking "but it has CROSS" but that's no use to you
18:38 * sri loves the IF NOT EXISTS stuff in postgresql
18:43 genio it seems all I can find are more reasons to hate MySQL
18:47 sri and i'm wondering when i will start finding reasons to hate postgresql for... got nothing so far
18:49 sri ten years ago it was easy to hate postgres because it was slow... but now it's everything but
18:52 neilhwatson It's always sad when I see a shiny app that supports mysql only.  Seems short sighted.
18:53 mst ten years ago it was slower than mysql for small workloads but scaled really nicely if you tuned it properly
19:00 woz joined #mojo
19:03 disputin joined #mojo
19:10 fhelmber_ joined #mojo
19:10 disputin joined #mojo
19:35 Ptolemarch joined #mojo
19:46 noganex joined #mojo
19:47 preaction joined #mojo
19:50 risugg i tried to install my mojolicious app on a server that had 5.20.1 (only tested under 5.14), and it works fine with morbo or hypnotoad -f, but I get the "mysql has gone away" message if I run it as a daemon with hypnotoad. I read and followed the faq on how to not start your db connection in the startup method. Any ideas?
19:58 mst explicitly disable mysql_auto_reconnect
19:58 mst and make sure that your DBI code uses DBIx::Connector for connection management
20:01 woz joined #mojo
20:08 sri odc: you now have co-maint for Mango
20:20 batman sri++
20:20 genio risugg: are you using straight DBI or DBIx::Connector, etc.?
20:21 risugg yes, using DBIx::Connector, but I do not explicitly disable auto_reconnect
20:21 risugg will try that
20:21 mst mysql_auto_reconnect is a complete cock
20:23 risugg same thing with mysql_auto_reconnect => 0
20:24 mst how are you using DBIx::Connector ?
20:24 moritz risugg: are you connecting to the DB anywhere in the mainline code of the modules?
20:24 moritz (that is, outside of a method)
20:25 risugg has dbconnector => sub { ...; DBIx::Connector->new(@creds, { mysql_auto_reconnect => 0, ...}) };
20:25 mst right, and then
20:26 mst $self->dbconnector->run(fixup => sub ($dbh) { ... });
20:26 mst right?
20:26 risugg has db => sub { $self->dbconnector->dbh };
20:26 mst yeah, that's completely wrong
20:26 risugg oh...
20:26 mst read the DBIx::Connector docs, you should be calling ->run and ->txn on the connector object
20:26 mst what your code above did was pull a dbh out of the connector once
20:26 mst then bypass it completely
20:26 mst thereby meaning the reconnect logic could never run
20:26 risugg well dern...
20:26 mst which would explain why it didn't reconnect :)
20:26 risugg ok - thanks for letting me know!
20:27 mst actually, I *think* if you chaged that code to
20:27 mst sub db { $_[0]->dbconnector->dbh }
20:27 mst so it wasn't cached
20:27 mst you might be ok
20:27 odc` joined #mojo
20:27 risugg I like that better ;)
20:27 risugg btw - did I misread the mojo docs at https://github.com/kraih/mojo/wiki/Hypnotoad-prefork-web-server#dbixconnector
20:28 mst risugg: note that you should still use ->txn for transactions
20:28 mst and honestly ->run is better
20:28 mst but hacking your 'sub db' will do until you have a chance to unfuck your code
20:29 mst risugg: those docs show how to get the $dbh when you need one
20:29 mst it was making it into an attribute that was the mistake
20:29 risugg ah - gotcha
20:29 mst because that meant it was cached
20:29 odc` sri, do you remember this line? https://github.com/kraih/mango/blob/master/lib/Mango.pm#L37
20:30 batman https://gist.github.com/jhthorsen/aa7f7fdfe0bd8288ab9f # never seen this before :/
20:30 batman odc`: what about that line=?
20:30 odc` it causes bugs
20:31 odc` but if i remove it it may cause leaks :/
20:31 batman odc`: when? it should be fine if you keep $mongo around
20:31 odc` it's not fine, i've often had the case where $db->{mongo} gets undefined
20:32 odc` it does not happen if you use a help to keep you $mongo
20:32 batman exactly.
20:32 mst right, this is the same problem DBIx::Class used to have
20:32 odc` but if you don't, perl will undef it soon or later
20:32 mst where you had to keep the $schema
20:32 mst you're welcome to copy the fix
20:33 odc` there is no solution ir guess?
20:33 mst sure there is
20:33 odc` oh? :)
20:33 odc` thx
20:33 batman mst: where is the code?
20:33 purl the code is farly clear for me :)
20:33 mst DESTROY on ::Schema and ::ResultSource IIRC
20:35 batman i wish my $neighbor had a DESTROY() method...
20:36 odc` lel
20:36 batman odc`: https://metacpan.org/source/RIBASUSHI/DBIx-Class-0.082800/lib/DBIx/Class/Schema.pm#L1390
20:36 batman lel?
20:36 purl lel is, like, a 1400km cycle ride from London to Edinburgh and back
20:37 odc` yep, found it. Now i'm trying to understand...
20:37 batman it un-weakens the weaken
20:37 mst more moves it
20:38 risugg moritz and mst - made the change and it works - many thanks! -- now getting to work on doing it the right way
20:39 mst risugg: note that DBIx::Connector's logic is basically the same as what DBIx::Class uses - and we got tim bunce to help us design that before dave wheeler extracted it - so once you do do it its way, it should be totally solid
20:39 risugg awesome - good to know
20:39 mst there's probably a little bit of my code still in there somewhere but all the important bits have been rewritten by more competent people ;)
20:40 cosimo joined #mojo
20:48 * sri hates how ->txn and ->run look in DBIx::Connector
20:49 sri anyway,  i need to manage a pool of handles :)
20:56 sri wonder if the postgresql connection limit might ruin my day
20:58 sri you know, some things about DBI are pretty ugly, like $dbh->{Active}, but it's still a million times better than dealing with mongodb
20:59 sugar joined #mojo
21:02 woz joined #mojo
21:05 odc` will you stop it already? :D
21:10 sugar_ joined #mojo
21:11 cosimo joined #mojo
21:20 sri did you know mongodb could only utilize one index per query until 2.6? now it can use a whole two indexes! -.-
21:21 * sri has just stumbled over http://www.postgresql.org/docs/9.4/static/planner-optimizer.html
21:22 odc` mongodb is young
21:26 preaction and is not learning from the mistakes made by the old...
21:28 odc` i guess the original plan was to make a really simple database with mmap. Then, people started wanting more and now they have to catch up with the other rdbms
21:29 sri think the closest i have come to finding weaknesses in postgresql so far is the lack of native support for sharding, and the need for a dedicated thread/process per client connection
21:30 odc` huh
21:30 sri originally mongodb was part of a cloud app development platform like googles app engine
21:31 sri the platform sucked, but people liked the database api, so the api became a database
21:31 odc` i admit, just because of the api, it would be very hard for me to go back to sql
21:32 sri yea, i still love the mongodb api
21:32 sri but i was always aware that the core server is pretty bad
21:32 sri in retrospect, i guess it makes perfect sense that they want to push more functionality to the client side ;p
21:33 odc` lol
21:33 * sri notes that he never defended mongodb at mojoconf... so it's ok if he hates on it now!
21:33 odc` <_<
21:35 sri there's literally a picture of me where i raised my hands and said "i'm not defending mongodb here" http://instagram.com/p/oY64z2jQec/
21:35 odc` sri, did the crapy core server ever really bothered you? MongoDB has quite good performances
21:35 sri honestly... all the time
21:35 cfedde but is it webscale?
21:36 odc` do you have a lot of traffic?
21:36 odc` (i don't)
21:36 * cfedde crawls back under his rock.
21:36 sri from never ending memory usage to cpu spinning up for idle tailable cursors on capped collections
21:36 sri not even a lot of traffic, just stuff that doesn't work at all
21:36 odc` oh right, i forgot the last one
21:37 odc` do you still have the jira ID for that bug?
21:37 oalders joined #mojo
21:38 sri nope
21:38 sri btw. mongodb also uses a thread per connection
21:38 sri so that's not exclusive to postgres
21:39 sri on the protocol level you'll encounter lots of bad design
21:40 sri like, the core protocol uses message ids and is capable of multiplexing, but then they added features like the exhaust flag that make using it impossible
21:40 odc` heh
21:40 odc` i can't switch anyway :(
21:41 sri basically, you always have a request and a reponse, sharing an id, pretty simpe really... then you set the exhaust flag, and the server starts spewing responses with everything that's still on the cursor until you close the connection
21:41 sri BECAUSE FAST IS GOOD
21:43 sri of course there's a chance mongodb will turn into a great database at some point, it is as you said, still young
21:43 sri and the api is great
21:44 odc` i'm reading a bug about CPU usage
21:44 odc` it seems it's linux's fault
21:44 odc` NUMA stuff
21:44 sri but i've been burned too often already, i want something i can get genuinely excited about right now :)
21:45 odc` sri, but it's 80's technology :D
21:45 sri postgresql actually started in the 70s
21:45 sri well... at least the ingres stuff
21:50 sri i've tried ORMs many times, but they just don't work for me... i hope fully embracing SQL will turn out better
22:03 woz joined #mojo
22:04 odc` omg i'm just reading now your message on the ML sri
22:04 odc` Thanks! (i guess)
22:05 odc` and good night
22:19 dvinciguerra_ joined #mojo
22:22 marty joined #mojo
22:33 cfedde we need a good NOSQL type restapi infront of pg.
22:35 sri cfedde: funny thing is, mysql just got one http://blog.ulf-wendel.de/2014/mysql-5-7-http-plugin-mysql/
22:35 sri "good" is relative of course
22:36 cfedde that'll be interesting.  One of the big pushbacks from the devkids around here is having to learn rdbms and sql.
22:37 cfedde and by default most database interfaces returns hard to use result sets
22:37 sri do they?
22:37 cfedde arrays of arrays?
22:38 sri i just made my little Mojo/Postgres module return an array of hashes and it's rather pleasant to use
22:39 cfedde yeah {Slice =>{}} works well most of the time.
22:39 cfedde it's still not an object though.
22:40 sri $c->db->query('select * from users')->hashes->each(sub { say $_->{name} });
22:40 sri Mojo::Collection objects of hashes actually ;p
22:42 cfedde that might please the kinder.
22:43 sri hopefully it will please me
22:43 cfedde which is key, of course.
22:44 sri think what i want is basically DBIx::Simple, with some mojo flair and async sprinkled on top
22:45 sri i've not thought much about automatic type conversion yet though... especially perl/json
22:46 sri which is an interesting topic with postgres
22:48 sri trying to hide all the magic... ->db with handle dbh pooling behind the scenes, with fork support.... and ->query(...) will have an sth cache
22:48 cfedde if you are mapping relational results to json rather than just hstore.
22:49 sri s/with/will/
22:50 sri and as usual ->db->query('select * from users' => sub { my ($db, $err, $results) = @_ }); for async
22:52 bpmedley Something really cool is building REST api’s that can be consumed with hybrid apps made with things like PhoneGap/Cordova.  Mojolicious works well in that arena.
22:52 sri (yea, i'm using "async" intentionally since it's not really non-blocking ;p)
22:52 sri gotta figure out the correct terminology still
22:59 jberger_ Actually i did note that sri was staying out of mongo discussions
22:59 jberger_ At MojoConf
23:01 d4rkie joined #mojo
23:02 howitdo joined #mojo
23:05 woz joined #mojo
23:10 fhelmber_ joined #mojo
23:14 sri damn, this IF NOT EXISTS stuff is soooooo nice for testing when your tests just break in the middle every now and then
23:15 sri no manual cleaning up... a few tests just fail once... your normal cleanup code kicks in... and next run everything is fine
23:29 basiliscos joined #mojo
23:37 sri that's the fun part of being a noob, you get to be excited about the small stuff :)
23:38 sri i never really got past baby sql with any database before
23:44 Akron joined #mojo
23:45 mst sri: if it's any consolation, I was years into DBIx::Class before I knew any of this shit
23:45 sri heh, it actually is
23:46 bpmedley This may be helpful: http://imgur.com/LHqRfBz
23:46 mst for raw DBI code, I believe there are only two methods
23:46 mst $dbh->do($sql, {}, @args)
23:46 sri i'm flip flopping between "this is awesome!" and feeling like a sucker for not knowing this before :D
23:46 mst $dbh->selectall_arrayref($self, { Slice => {} }, @args)
23:46 mst plus DBIx::Connector for management
23:47 mst bah, s/self/sql/
23:47 sri bpmedley: thanks, but joins were one of the few things i knew before actually :)
23:47 mst sri: note: shadowcat has multiple production Web::Simple apps doing exactly that
23:47 bpmedley Understood.  Did you have the visualization of how they work in set theory?
23:47 mst the code I'm thinking about makes Mojolicious look complicated
23:48 mst (and I mean that as a compliment, there's very few use cases where we can manage that ;)
23:49 bpmedley Also, as an aside, http://www.telerik.com/kendo-ui/open-source-core
23:49 bpmedley woops
23:49 bpmedley The mobile framework aspect of that library is really fun to use with Mojolicious
23:50 mst sri: torrent 'The Art of SQL'
23:50 mst sri: if it works for your brain, you will love it, and buy a copy
23:50 mst sri: if not, eh
23:53 sri bpmedley: i have no formal cs education, i learned it from some blog post :D
23:53 mst I'm a pure maths grad
23:53 mst the art of sql was the first book on databases I ever read
23:53 bpmedley Very cool.  I have a lot of respect for people that do that.
23:53 mst in about '08 or '09
23:54 mst when I realised that maybe as the author of a popular ORM I should have some fuckin' clue what I was talking about
23:54 mst total accident
23:54 mst hell, I was working on a systems automation thing when I first met sri on #catalyst
23:54 mst it was just too much fun so I didn't leave
23:55 sri never even heard of the art of sql
23:55 mst well, no, after you threatend to work DBIx::Class to Catalyst::DBI in 2006 you pretty much left me to it :D
23:56 bpmedley Are there other good automation projects in Perl such as Rex?
23:57 mst bpmedley: my Object::Remote makes it easy to build one
23:57 mst it isn't one in and of itself
23:57 sri got a bit silent around the big automation projects recently
23:58 bpmedley mst: That looks really cool.
23:58 sri i only ever hear docker docker docker docker docker...
23:58 mst bpmedley: the really nice thing is Object::Remote::FromData
23:58 mst so you stick the control part of your script in the script
23:59 mst then the classes to run on the far side in __DATA__
23:59 mst and then it just works
23:59 bpmedley Oh wow.. it sparkles.. :)

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