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

IRC log for #mojo, 2017-08-30

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

All times shown according to UTC.

Time Nick Message
00:04 disputin joined #mojo
00:18 tchaves joined #mojo
00:25 rickbol_ joined #mojo
00:32 tchaves joined #mojo
00:45 rickbol joined #mojo
00:53 rickbol_ joined #mojo
00:58 tchaves joined #mojo
01:06 rickbol joined #mojo
02:19 rickbol_ joined #mojo
02:28 noganex_ joined #mojo
03:22 rickbol joined #mojo
04:04 dboehmer joined #mojo
04:15 karjala_ joined #mojo
05:58 Pyritic joined #mojo
06:05 preaction joined #mojo
06:14 inokenty-w joined #mojo
06:36 karjala_ joined #mojo
07:14 Vandal joined #mojo
07:15 AndrewIsh joined #mojo
07:21 prg joined #mojo
07:31 kwa joined #mojo
07:32 trone joined #mojo
07:44 bianca joined #mojo
07:48 petru joined #mojo
07:48 n16gel joined #mojo
08:11 bianca joined #mojo
08:12 jasanj joined #mojo
08:12 jasanj https://github.com/kraih/mojo/issues/1127
08:14 jasanj file another issue on Windows, hope someone take a look
08:15 jasanj about Mojo::File::slurp
08:37 kiwiroy joined #mojo
08:57 rshadow joined #mojo
09:02 haarg jasanj: can you try your tests again with $Data::Dumper::Useqq=1?
09:04 haarg and possibly adding a manual read: my $content = do { open my $fh, '<:raw', $ARGV[0] or die $!; local $/; <$fh> };
09:04 haarg s/adding/adding a test with/
09:14 jasanj haarg: by set $Data::Dumper::Useqq=1, i got $VAR1 = "sdsdsd\r\nsdsdsd"; with Mojo::File::slurp
09:14 jasanj seems correct
09:14 haarg yes, that is correct
09:14 haarg the problem is in your output, not how Mojo is reading the file
09:15 haarg STDOUT is translating \n to \r\n
09:17 trone joined #mojo
09:18 jasanj yes, that make sense
09:18 jasanj this auto translating is very confuse ...
09:18 jasanj thank you haarg
09:19 haarg i'm not a big fan of the newline translation on windows
09:26 trone joined #mojo
09:41 trone joined #mojo
10:14 kiwiroy joined #mojo
10:30 kiwiroy joined #mojo
10:32 gregf_ joined #mojo
10:45 CandyAngel Hm, I don't suppose it is possible to remove newlines/whitespace around a tag that is on a line on its own, is there?
10:46 CandyAngel Stripping out the tags is making everything really spaced out
11:06 tchaves joined #mojo
11:21 bianca joined #mojo
12:02 stryx` joined #mojo
12:20 gizmomathboy joined #mojo
12:55 tcohen joined #mojo
13:07 kwa CandyAngel: http://mojolicious.org/perldoc/Mojo/Template - "Whitespace characters around tags can be trimmed by adding an additional equal sign to the end of a tag.
13:08 CandyAngel kwa: I'm stripping out tags in Mojo::DOM: $dom->find('*')->each('strip');
13:13 petru joined #mojo
13:21 tcohen hola #mojo
13:23 Pyritic joined #mojo
13:30 CandyAngel Heyas tcohen
13:57 Pyritic joined #mojo
14:00 dantti_laptop joined #mojo
14:04 jacoby joined #mojo
14:09 mcsnolte joined #mojo
14:10 foursixnine joined #mojo
14:25 gizmomathboy joined #mojo
14:45 marty_ joined #mojo
14:55 jberger tcohen o/
15:03 disputin joined #mojo
15:17 ChmEarl joined #mojo
15:32 tcohen \o
15:34 disputin joined #mojo
15:39 CandyAngel Yay, meeting with IT is tomorrow
15:39 CandyAngel Found 2 more things today to demonstrate their system can't be trusted \o/
15:39 CandyAngel I'm going to take marshmallows into the meeting :P
15:40 PopeFelix lol
15:41 Grinnz as bait, or a prop?
15:41 CandyAngel For smores.. IT are going to be roasted
15:41 PopeFelix Non-Mojo related, but I figure someone here knows it. The regex /[\300-\375][\200-\277]/ will match a string containing a character with octal code point between 300 and 375, followed by one with code point between 200 and 275, or one multi-byte character?
15:41 * PopeFelix is trying to understand the crazy way someone decided to handle UTF-8 support
15:42 Grinnz there's no such thing as a multi-byte character
15:42 PopeFelix OK, then my nomenclature is wrong.
15:42 Grinnz characters are not represented by bytes, but you might encode them to bytes
15:42 jberger CandyAngel: http://tinyurl.com/y8xskls6
15:42 Grinnz which would be a different string
15:42 * PopeFelix nods
15:42 cfedde As with lots of these things programmers are often their own worst enemy.
15:42 PopeFelix lol
15:42 CandyAngel jberger: I love it
15:43 * PopeFelix knows this to be true
15:43 Grinnz so, the answer to your question is, it depends whether your string is bytes or characters
15:43 Grinnz and the only way to know that is to figure out where it came from
15:43 PopeFelix it came from a MySQL database
15:43 * jberger runs away
15:43 Grinnz oh good, so you're probably using the broken DBD::mysql
15:43 jberger and broken mysql utf handling
15:44 spicyjack someone should start a DBD::Shell::MySQL
15:44 Grinnz well the only issue on mysql side is that the utf8 charset doesn't cover all of unicode
15:44 spicyjack that calls out to the mysql client for SQL requests
15:44 PopeFelix it looks like we're using MySQL.pm
15:44 Grinnz so you need utf8mb4 which doesn't work before mysql 5.5
15:44 Grinnz er, what
15:44 cfedde yay Legacy Code!
15:45 Grinnz spicyjack: that surely wouldn't introduce more encoding confusion at all :)
15:45 PopeFelix I'm looking at this database class, and it calls for MySQL.pm
15:45 PopeFelix But.
15:45 PopeFelix I misspoke
15:45 cfedde is that a localism?
15:45 spicyjack Grinnz: it would be more maintainable that way
15:45 spicyjack Grinnz: less prone to forking ;)
15:45 Grinnz http://cpanmeta.grinnz.com/#=mysql
15:45 PopeFelix It's a URL-encoded query string stored in the database
15:46 Grinnz apparently Mysql.pm is from an ancient version of DBD::mysql?
15:46 spicyjack there used to be just Mysql.pm IIRC
15:46 spicyjack then came DBD::mysql
15:46 PopeFelix So the data are actually coming from URI::Encode::uri_decode
15:46 cfedde way back before perl5 we had sybperl and the rest.
15:46 Grinnz well, it doesn't exist anymore, someone should really delete those old versions from being indexed
15:48 Grinnz PopeFelix: that module does not appear to decode from UTF-8 afterward, so you'll need to do that yourself
15:48 spicyjack sorry, I was thinking of DBD::mysql and DBD::mSQL
15:48 spicyjack from the DBI book
15:48 Grinnz PopeFelix: ... despite the fact that its encode function *does* encode to UTF-8
15:48 Grinnz also, there's at least 3 modules you should probably be using instead of that one
15:49 PopeFelix Grinnz, What looks to be happening *without* this regex is that URI::Encode is outputting UTF-8 strings.
15:49 cfedde iirc the guy tht did mSQL was going to get rich selling it.  I wonder how that worked out.
15:49 PopeFelix Grinnz, legacy code.
15:50 PopeFelix But I agree that the code should be modernized.
16:00 PopeFelix Anyway, I'm just trying to understand what the original author was doing. It looks like I'm getting UTF-8 formatted strings out of URI::Encode and not Perl internal format.
16:00 Grinnz you get utf-8 encoded strings yes, according to the documentation
16:00 Grinnz so decode them
16:01 PopeFelix I don't want to do anything to the strings until I understand what the original author was trying to do.
16:01 PopeFelix So since I have UTF-8 strings, is that regex matching bytes or characters?
16:01 Grinnz the most likely case is usually that the original author has no idea how encoding works
16:02 PopeFelix Grinnz, I would not be surprised if that were so.
16:02 Grinnz the regex matches characters, but your characters are utf-8 encoded bytes
16:03 PopeFelix So the regex is going to match on a pair of bytes, then?
16:04 PopeFelix e.g. 0xC080
16:04 Grinnz it would always do that, the question is whether your string has those
16:04 PopeFelix Right, right
16:05 Grinnz as a perl string, that would be U+00C0 U+0080
16:05 PopeFelix OK. That helps.
16:08 PopeFelix Thank you.
16:13 sri purl: CandyAngel is also http://tinyurl.com/y8xskls6
16:13 purl OK, sri.
16:14 jberger seconded
16:44 n16gel joined #mojo
16:44 karjala_ joined #mojo
16:50 disputin joined #mojo
17:01 trone joined #mojo
17:07 CandyAngel Also? Should I be worried about the other thing(s)? :P
17:24 tchaves joined #mojo
17:45 n16gel joined #mojo
17:46 jberger purl: CandyAngel
17:46 purl i guess CandyAngel is http://tinyurl.com/y8xskls6
17:46 jberger nope
17:46 jberger not yet at least
17:47 jberger (in infobot syntax "also" is "append")
18:03 sri they tend to get very weird over time
18:03 rshadow joined #mojo
18:12 bianca joined #mojo
18:37 rickbol_ joined #mojo
18:46 rickbol joined #mojo
18:53 bianca joined #mojo
19:01 bianca joined #mojo
19:12 rickbol joined #mojo
19:19 jberger purl: sri?
19:19 purl jberger: bugger all, i dunno
19:19 jberger Oo
19:19 jberger purl: sri
19:19 purl jberger: sorry...
19:19 jberger oh NO!
19:21 jberger this is more like it https://irclog.perlgeek.de/mojo/2016-08-23#i_13072513
19:21 jberger we can restore it, we have the technology
19:26 Grinnz that was quite an entry
19:50 kavuria joined #mojo
19:52 bianca joined #mojo
20:02 rshadow joined #mojo
20:38 bianca joined #mojo
20:53 leffe joined #mojo
20:53 leffe Hi again!
20:53 leffe Question:
20:54 leffe I want to use a route to go to a particular place in a page
20:54 leffe that is page#anchor
20:55 leffe it doesn't work
20:55 Pyritic joined #mojo
20:55 sri Grinnz: i've been around for some time :p
20:57 leffe do I have to write the route with this syntax: page*anchor
20:58 leffe what I do in the controller is just to save a value and redirect it to another page.
20:59 leffe do I have to re-compund the route again, that is $c->redirect_to( 'page' . "#" .  $anchor)
20:59 leffe or is there a better way?
20:59 leffe thanks
21:02 jberger (mostly) restored
21:04 Grinnz leffe: what do you mean "use a route"
21:04 Grinnz leffe: the URL fragment is never sent to the backend, it's only for the browser to use
21:06 Grinnz so naturally the routing system will never be able to match or use it
21:14 jberger with the caveat that Grinnz just mentioned, if you still need to generate a redirect with an anchor you can $c->redirect_to($c->url_for('page')->fragment('anchor'))
21:33 leffe Grinz: well it's a complicated issue. it's a 'back' url I send from a page to another page. when it finishes it sends a post to save changes, then it redirect to the page and place where it was called
21:33 Grinnz i'm not sure what that has to do with routing?
21:35 leffe it's simpler
21:35 Grinnz a redirect can be done like jberger said, but getting the anchor serverside isn't going to happen to begin with, youd need javascript to save that
21:35 leffe if I click something like page#redirect it doesn't match to page
21:35 Grinnz ?
21:36 leffe I'll give you an example tomorrow
21:37 leffe thanks again
21:47 n16gel joined #mojo
22:30 disputin joined #mojo
22:30 disputin1 joined #mojo

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