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

IRC log for #mojo, 2016-10-05

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

All times shown according to UTC.

Time Nick Message
00:21 vmvm joined #mojo
00:21 lluad joined #mojo
00:22 bpmedley https://gist.github.com/brianmed/c473222845ec723169eba05fded3e573 <-- I believe this shows that tx->connetion($id) has not been called given the scenario depicted in Issue 1003.  Is that accurate?
00:28 bpmedley Sorry, 1003 --> 1004
00:59 vytas joined #mojo
01:05 mikegrb joined #mojo
01:09 karjala joined #mojo
01:59 kes joined #mojo
02:57 noganex_ joined #mojo
03:09 kaare joined #mojo
03:15 lluad joined #mojo
03:34 mikegrb joined #mojo
04:25 mib_qit49y joined #mojo
05:55 dod joined #mojo
05:59 dod joined #mojo
06:21 inokenty-w joined #mojo
06:38 che-quest joined #mojo
07:10 AndrewIsh joined #mojo
07:17 janl joined #mojo
07:22 trone joined #mojo
07:41 mbudde joined #mojo
07:57 vinnix joined #mojo
08:16 osfabibisi joined #mojo
08:28 vinnix joined #mojo
08:41 rshadow joined #mojo
08:59 Atog joined #mojo
09:38 inokenty joined #mojo
10:21 che-quest joined #mojo
10:31 vinnix joined #mojo
10:32 hummeleBop joined #mojo
10:53 enkidu joined #mojo
11:15 tchaves joined #mojo
12:04 itaipu joined #mojo
12:06 juikuen joined #mojo
12:35 geira joined #mojo
12:50 schelcj joined #mojo
13:00 marty joined #mojo
13:01 Dandre left #mojo
13:10 gizmomathboy joined #mojo
13:11 mib_157e9y joined #mojo
13:13 ramortegui joined #mojo
13:14 bwf joined #mojo
13:21 gregf_ joined #mojo
13:52 gregf_ joined #mojo
14:02 mcsnolte joined #mojo
14:03 geira joined #mojo
14:03 gregf_ joined #mojo
14:14 PryMar56 joined #mojo
14:49 marty_ joined #mojo
14:52 asarch joined #mojo
14:57 enkidu I've got a Mojo app with a database connection running under hypnotoad.  When I reload it with "hypnotoad script/myapp" it loses the db connection.  Is there a DESTROY method in Mojo where I can close the database connection?
14:58 enkidu Is this even a sensible question?
14:58 pink_mist how are you connecting to your db? straight DBI? using one of the Mojo::{Pg,mysql,SQLite} things? DBIC?
14:59 enkidu straight DBI to Oracle
14:59 pink_mist oh, oracle :X
14:59 pink_mist well, try switching to DBIx::Connector perhaps
14:59 enkidu yes, I've found a lot of funny errors in production that didn't show up in development
15:00 enkidu i started out with dbic, but had problems with a non-normalized db and multiple joins
15:00 pink_mist DBIx::Connector has specific support for oracle even, so it should do the right thing
15:01 enkidu ahh, thread safety which may solve the next problem I've got.  I'll have a look, thanks.
15:02 preaction my wild guess would be it depends on which side of the fork you connect to the database on
15:02 jberger but either way, the current connect will close
15:03 jberger you need something like DBIx::Connector to make sure that a new one is available for you
15:03 enkidu i've been connecting in the startup method and using methods in the Controller to create a sth
15:04 jberger yeah, you probably want something a little more robust than that
15:05 genio DBIx::Connector++
15:05 enkidu i'm looking at Joel's db example on perl blogs.  is there something that goes even deeper out there?
15:06 jberger hmmm, that might be really old/bad
15:07 enkidu it included the update following Aristotle's comment of separating out the insert/select code
15:07 enkidu actually, any github projects that are public with some code I could look at?
15:09 disputin joined #mojo
15:09 lluad joined #mojo
15:17 ashimema +1 for that
15:20 itaipu joined #mojo
15:33 eseyman joined #mojo
15:33 mbudde joined #mojo
15:33 batman joined #mojo
15:33 mcsnolte joined #mojo
15:33 gizmomathboy joined #mojo
15:33 AndrewIsh joined #mojo
15:33 ramortegui joined #mojo
15:33 noganex joined #mojo
15:33 marty joined #mojo
15:33 mikegrb joined #mojo
15:33 geira joined #mojo
15:34 orev joined #mojo
15:38 itaipu joined #mojo
15:43 enkidu left #mojo
16:03 dod joined #mojo
16:20 ptolemarch joined #mojo
16:28 osfabibisi joined #mojo
17:12 genio https://news.ycombinator.com/item?id=12641936 :(
18:15 itaipu joined #mojo
18:39 vicash there is nothing that these databases do that Postgres cannot do with proper optimizations and design.
18:41 jberger well, other than HA scale out
18:41 jberger even that seems to be getting closer though
18:43 vicash we use Postgres' inheritance table feature to scale out large database tables into smaller bits on a distributed cluster
18:44 vicash it is a timeseries database with over 500GB data and growing daily
18:51 itaipu joined #mojo
19:15 Grinnz i think for particular use cases, some of them are designed more specifically for those problems so are either easier to setup or easier to optimize for that problem
19:15 Grinnz but it is nice if you can get postgres to solve more of your problems
19:17 Grinnz i wonder how much postgres's fulltext indexing could replace something like elasticsearch or sphinxsearch
19:17 Grinnz that's a very different problem from the usual
19:18 vicash '
19:18 Grinnz mysql's version, of course, is not even worth considering
19:24 orev joined #mojo
19:24 vicash mysql requires tons of work and the plugin codebase is not as mature (as of 2012) when we looked at it.. plus the whole innodb vs myisam nonsense is painful
19:25 vicash elastic search is still pretty fast and allows the database work to be offloaded out... we dont use it but that's how i would design it..
19:25 Grinnz yeah we use sphinxsearch but it has the same benefit of offloading that work from the DB (even if mysql was usable for it)
19:27 Grinnz maintaining mysql is a ton of work, but converting to postgres would also be a ton of work, so it's an ongoing conversation
19:27 Grinnz all our tables are finally on innoDB at least lol
19:28 vinnix joined #mojo
19:29 rshadow joined #mojo
19:35 marty joined #mojo
19:57 vicash Grinnz: man sphinxsearch is such a CPU hog.. i cannot understand how to fix that. we run Security Onion and damn that process pegs the CPU sometimes exhausting memory
19:57 Grinnz hmm it can be
21:52 grayKot joined #mojo
22:13 viktor joined #mojo
22:14 viktor Are questions about Mojo::DOM ok to ask here?
22:14 viktor DOM
22:14 genio sure
22:17 viktor Awesome, thank you. I have a document I'm parsing that contains HTML bullet point entities (&bull;). It parses great, but when I render the DOM they're output as actual bullet points instead of the original entities. Is there a way to have Mojo::DOM keep the entities round-trip?
22:17 viktor Oi vay. These smilies are annoying. Hopefully you get what I mean.
22:24 preaction i don't see the smilies, so yes
22:28 Grinnz viktor: is the document you're parsing HTML?
22:28 viktor Yes.
22:28 Grinnz unless the entities are double-encoded (e.g. &amp;bull;) in the original document, it's supposed to render a bullet point when viewed
22:28 Grinnz that's rather the point
22:29 Grinnz Mojo::DOM isn't doing anything to them
22:32 Grinnz Mojo::DOM would decode those when parsing, and encode them again on output
22:32 Grinnz then an HTML renderer, like a browser, would decode them to display
22:32 viktor Even in a terminal? When I print the DOM to screen or to a file handle, it's sending an actual bullet, not the entity.
22:33 preaction right. isn't that the idea?
22:33 Grinnz ah hmm, it probably isn't re-escaping it because it doesn't need to
22:33 batman joined #mojo
22:34 viktor I need the original HTML entities to pipe it to Prince XML. But it's also general question, since I like Mojo::DOM, but I want to be able to manipulate things and store them back in the database with the entities in tack.
22:34 preaction you can re-encode the entities using xml_encode in Mojo::Util, if you want
22:35 Grinnz preaction: that's exactly what it's doing, and that doesn't escape it because it doesn't need to
22:35 Grinnz viktor: round trip isn't really guaranteed in Mojo::DOM in general, it tries to construct a valid DOM even from bad input for example
22:35 preaction oh, there's an original set of entities that you don't want to fool with
22:37 Grinnz is there a particular reason that entity needs to be encoded?
22:37 Grinnz or just for consistency with the input?
22:38 batman joined #mojo
22:39 viktor My immediate need is that I'm converting the output to a PDF with a program called Prince XML (the XML is deceiving, it accepts html and html5), and it's choking on the unescaped bullets. I'm exploring both sides of the problem. :)
22:40 Grinnz viktor: that would suggest to me that the encoding is going wrong somewhere, so it's getting the UTF-8 encoding of the bullet
22:40 Grinnz at least that would be my first guess
22:40 preaction the HTML::Entities module will allow you to encode any arbitrary characters
22:41 preaction how do you declare a character encoding in html without http? does it understand meta charset?
22:43 viktor It does, and you just gave me a great idea to try.
22:43 Grinnz <meta charset="UTF-8">
22:44 Grinnz if it understands HTML5, anyway
22:44 preaction otherwise, if it understands xml, it understands xhtml, which means you could use the xml prologue to declare your charset
22:46 Grinnz example of where Mojo::DOM would not give you a round-trip: $ perl -MMojo::DOM -E'say Mojo::DOM->new(shift)' '<p><span><p>'
22:47 viktor Bam! Problem solved. In a way that wasn't a Mojo DOM problem, so thank you very much for the off-topic assistance. :P I'll keep the other ideas in mind for my other uses though, so this was very helpful.
22:47 viktor Thank you very much.
22:47 Grinnz cool
22:51 viktor Thank you for time, that was awesome. I ♥ Mojolicious!
23:01 disputin joined #mojo

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