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

IRC log for #mojo, 2014-10-06

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

All times shown according to UTC.

Time Nick Message
00:02 ua1 joined #mojo
00:02 atmh joined #mojo
00:14 Akron joined #mojo
00:15 sri mst: btw. do you think that was a valid use of utf8::downgrade? https://github.com/kraih/mojo/commit/3f13a8a1a8c65f3db0a53e6487c50a0d641963ab#diff-ca9694676bc47b6c51420cb2af6591c6L70
00:17 sri or actually anyone else for that matter
00:18 sri of course we all know that utf8::is_utf8 is bad because of how unreliable it is
00:19 nicomen seriously I would expect a person to use 'use utf8' if you have utf8 encoded strings in your code
00:19 nicomen or decode it if comes from another source
00:20 sri nicomen: that's unrelated to the problem
00:20 nicomen ok, then I have totally misunderstood, I'm sorry
00:21 nicomen so you want to state the outgoing encoding?
00:21 nicomen ah right check on input, I see
00:28 sri don't worry, very few actually understand the problem
00:30 sri and my question is regarding correctness and special cases i might have missed
00:30 woz joined #mojo
00:53 ua joined #mojo
00:58 ua1 joined #mojo
01:01 neyasov_ joined #mojo
01:01 cpan_mojo Mojolicious-Plugin-Images 0.001-TRIAL by Alex - http://metacpan.org/release/ALEXBYK/Mojolicious-Plugin-Images-0.001-TRIAL
01:18 ua joined #mojo
01:21 ua1 joined #mojo
01:25 sujithm joined #mojo
01:30 woz joined #mojo
01:35 atmh joined #mojo
01:38 davido__ joined #mojo
01:47 atmh joined #mojo
01:49 atmh joined #mojo
01:51 nicomen joined #mojo
02:02 neyasov_ joined #mojo
02:07 sujithm_ joined #mojo
02:11 sujithm joined #mojo
02:13 sujithm_ joined #mojo
02:20 sujithm joined #mojo
02:28 ua joined #mojo
02:30 woz joined #mojo
02:37 zivester joined #mojo
02:41 ua1 joined #mojo
02:58 noganex_ joined #mojo
03:02 neyasov_ joined #mojo
03:07 cpan_mojo Mojolicious-Plugin-Images 0.002-TRIAL by Alex - http://metacpan.org/release/ALEXBYK/Mojolicious-Plugin-Images-0.002-TRIAL
03:21 cpan_mojo Mojolicious-Plugin-Images 0.003-TRIAL by Alex - http://metacpan.org/release/ALEXBYK/Mojolicious-Plugin-Images-0.003-TRIAL
03:24 ua joined #mojo
03:25 fhelmber_ joined #mojo
03:25 basic6 joined #mojo
03:26 Eke- joined #mojo
03:27 cpan_mojo Mojolicious-Plugin-Images 0.004-TRIAL by Alex - http://metacpan.org/release/ALEXBYK/Mojolicious-Plugin-Images-0.004-TRIAL
03:30 woz joined #mojo
03:33 d4rkie joined #mojo
03:39 ua1 joined #mojo
03:44 ua joined #mojo
03:46 ua1 joined #mojo
03:46 good_news_everyon joined #mojo
03:46 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/1GZbLw
03:46 good_news_everyon mojo/master 5709239 Sebastian Riedel: slightly more consistent Mojo::JSON internals
03:46 good_news_everyon left #mojo
03:53 ua joined #mojo
03:54 cpan_mojo Mojolicious-Plugin-Images 0.005-TRIAL by Alex - http://metacpan.org/release/ALEXBYK/Mojolicious-Plugin-Images-0.005-TRIAL
04:02 sujithm_ joined #mojo
04:03 neyasov_ joined #mojo
04:07 sujithm joined #mojo
04:10 laouji joined #mojo
04:15 rem_lex joined #mojo
04:17 ua1 joined #mojo
04:20 irq joined #mojo
04:30 woz joined #mojo
04:32 atmh left #mojo
04:44 preaction joined #mojo
05:04 neyasov_ joined #mojo
05:07 laouji joined #mojo
05:20 KCL_ joined #mojo
05:21 ua joined #mojo
05:30 woz joined #mojo
05:38 sujithm_ joined #mojo
05:47 ua1 joined #mojo
05:51 ua joined #mojo
05:56 Eke- joined #mojo
06:05 neyasov_ joined #mojo
06:07 dod joined #mojo
06:19 Dandre joined #mojo
06:30 woz joined #mojo
06:35 marcus sri: inlining entities.txt would solve my problem with http://marcus.nordaaker.com/building-ansible-modules-with-perl-and-mojolicious/
06:36 marcus Since it's not actually using the mvc functionality.
06:36 marcus I actually tested and deleted those lines from the fatpacked binary, and it ran beautyfully.
06:39 sujithm joined #mojo
06:50 dp_ joined #mojo
06:59 bpmedley marcus: Looks like a sweet site (Output).
07:00 marcus bpmedley: thanks. :)
07:02 neyasov_ joined #mojo
07:02 Insane joined #mojo
07:03 Insane hi all, what i I say: cpan install Mojo::UserAgent - will it install whole Mojolicious framework or just UsrAgent with maybe Mojo::DOM?
07:03 preaction it will install all of mojolicious
07:03 Insane ok
07:03 preaction you ask cpan to install a module, it looks for the dist that contains the module and installs that
07:08 d4rkie_ joined #mojo
07:14 rawler joined #mojo
07:26 trone joined #mojo
07:30 woz joined #mojo
07:32 odc joined #mojo
07:35 irq joined #mojo
07:38 Vandal joined #mojo
07:48 woz joined #mojo
08:05 neyasov_ joined #mojo
08:21 neyasov__ joined #mojo
08:22 basiliscos joined #mojo
08:28 denny joined #mojo
08:44 Dandre joined #mojo
08:52 phillipadsmith joined #mojo
08:57 fhelmber_ joined #mojo
09:09 ver joined #mojo
09:21 mr_boo joined #mojo
09:31 cpan_mojo MojoX-Session-Store-Memcached 0.02 by Alex - http://metacpan.org/release/PLCGI/MojoX-Session-Store-Memcached-0.02
09:41 meshl joined #mojo
10:10 Dandre joined #mojo
10:12 dotan1 joined #mojo
10:18 denny joined #mojo
10:38 Adurah joined #mojo
11:01 mojnew joined #mojo
11:01 denny joined #mojo
11:02 mojnew hi. I am writing my webapplication with mojolicious and am running my API (db backend, DBIX postgresql) on port 3001. my main mojo app is running on port 3000. how can I call my API non-blocking from within my main app?
11:02 mojnew should I use Mojo::UserAgent for this?
11:03 mojnew or can I run both in the same app and still can do non-blocking calls?
11:05 mojnew problem is, I have a large query to run each time a controller is being executed ( a route to /some/uri ), and I guess as long as this query is running ( waiting to be returned by the controller ) the request is blocked to other requests
11:10 denny- joined #mojo
11:38 sujithm joined #mojo
11:52 D4RK-PH0ENiX joined #mojo
12:18 denis_boyun joined #mojo
12:26 odc mojnew, you have the choice: you can use either mojo::useragent or Mojo::Pg. Both are non-blocking.
12:31 mojnew odc: ok thanks
12:32 Nei joined #mojo
12:32 mojnew but this is not DBIX
12:33 mojnew but this Mojo::IOLoop->delay looks good. I could use in my DBIX models
12:33 odc no, it's a very thin interface over DBD
12:33 mojnew can I use this?
12:33 mojnew with DBIX? mojo::IOLoop
12:33 Nei hi I wanted to check on your opinion if I should put http://paste.scsys.co.uk/428304 Mojo::Reactor::Irssi4 on cpan or better not
12:33 odc yes, but thoses 2 things are completely unrelated
12:34 mojnew ok
12:34 lipizzan joined #mojo
12:34 odc mojnew, DBIX is a blocking API, so i guess you'll have to keep your http server and make async requests with mojo::useragent
12:35 Nei he alread leave
12:35 odc oh :x
12:35 odc rode!
12:37 Nei pidgin has this nice feature to change the nickname when people go
12:37 odc Nei, are there any advantages using irssi instead of EV as an event loop?
12:42 neilhwatson joined #mojo
12:45 aleksey joined #mojo
12:45 Akron joined #mojo
12:47 zivester joined #mojo
12:48 doby joined #mojo
13:01 sujithm joined #mojo
13:28 Trelane joined #mojo
13:28 Trelane morning
13:29 Trelane So, I was curious (having not really used Mojo much as a web framework) how does Mojo::Pg do async db stuff?
13:29 firnsy joined #mojo
13:30 Nei odc imo that irssi is already there if you don't want to install anyevent
13:30 Trelane From what I'm reading it's actually watching the socket?
13:31 Nei I cant answer your question but async isn't that hard, it usually involves sockets and a way to check if new data is there on the socket
13:31 Nei without blocking and waiting until it is, that's the key point;)
13:32 odc yup
13:32 odc Trelane, https://github.com/kraih/mojo-pg/blob/master/lib/Mojo/Pg/Database.pm#L124
13:32 odc Nei, why did you say 'anyevent'? Did you mean libev?
13:33 Nei ah, maybe I was confusing things
13:34 odc heh, anyway, i don't why not posting this on cpan. It doesn't hurt anybody (i think?)
13:35 Nei yea, maybe. do you happen know if I can post it into Mojo::Reactor namespace or should it be somewhere else
13:36 odc hmm i'm not sure :/
13:36 firnsy joined #mojo
13:36 odc why is sri not here?
13:36 ignacio_ joined #mojo
13:36 Nei at least his body is
13:36 odc batman, jberger, marcus ^
13:37 batman what?
13:38 Nei hi ;)I had a question whether and where I should put up an irssi adaptor for mojo::reactor
13:38 odc can he use the mojo::reactor namespace?
13:38 batman Trelane: DBI does a blocking read on the socket, while Mojo register the filehandle inside the reactor which fire events when new data is available
13:39 batman it's not exactly "wathing" anything. the OS is triggering events when more data arrive
13:39 batman yeah, why not?
13:39 purl i guess yeah, why not is right. :-)
13:39 batman i would use Mojo::IOLoop::Stream directly instead because it's easier
13:39 mudler batman, with the last assetpack upgradei see that 'AssetPack failed to run \'/usr/local/bin/sass --stdin --scss -I /home/mudler/perl5/lib/perl5/Mojolicious/Plugin/Bootstrap3/sass\'. exit_code=-1 No child process'
13:40 mudler i'm doing something wrong..?
13:40 batman err... i would suggest (i'm using the reactor directly in Mojo::IOLoop::ReadWriteFork)
13:40 batman mudler: do you have sass installed? -1 would suggest that you haven't
13:41 mudler batman: i have it
13:41 batman mudler: there's a bug though: the asset file with the error message is kept around, so you need to manually delete it before trying again :(
13:41 mudler whereis sass tells  sass: /usr/local/bin/sass
13:41 Kripton joined #mojo
13:42 mudler i need to downgrade the plugin ?
13:42 batman let me check...
13:42 vytas joined #mojo
13:42 firnsy joined #mojo
13:42 batman it's not impossible that i screwed up :(
13:42 mudler batman: it gave me the same error on same file while upgrading convos two days ago
13:42 mudler but not on all the files
13:43 batman mudler: what happens if you run sass manually on the input file?
13:43 batman and which version do you have of assetpack?
13:43 mudler batman: i'll run it. just a mom  (0.24)
13:44 batman ok
13:44 mudler batman: if i run the exact same command it just waits for stdin, but the sass is reading
13:44 batman no. do "sass path/to/file.scss"
13:44 batman is this convos sass files..?
13:46 mudler batman: "sass bootstrap.scss" inside Mojolicious/Plugin/Bootstrap3/sass correctly gave me the css as output
13:46 batman oh! i'm trying to fix the bootstrap plugin.
13:47 batman i though you where trying to use AssetPack by your self
13:47 batman don't complain on assetpack, if you have issues with bootstrap3!
13:48 mudler ouch, sorry, the error was telling assetpack  and it seemed to break on using sass
13:48 * sri still would like an answer to his question from earlier
13:48 mudler (with that status code, of course)
13:49 batman mudler: yeah, you could be right, but i could also be fixing the wrong issue :/
13:49 mudler batman: one of the convos sass file giving error was sass/_landing_page.scss
13:49 sri is this use of utf8::downgrade acceptable or not? https://github.com/kraih/mojo/commit/3f13a8a1a8c65f3db0a53e6487c50a0d641963ab#diff-ca9694676bc47b6c51420cb2af6591c6L70
13:50 batman mudler: are you running convos master or an official release?
13:50 mudler batman: master ehm... :)
13:50 batman sri: count me out of utf8 questions. sorry :(
13:50 batman mudler: ok. let me check
13:51 mudler sri: same here
13:51 odc sri, ask on #p5p
13:51 mudler batman: also public/sass/_mixins.scss
13:51 sri thing is, right now we are using this little idiom... die "Wide character in input\n" unless utf8::downgrade($bytes, 1);
13:51 ribasushi sri: this is my take on "give me bytes, and convince me these are bytes": https://metacpan.org/source/RIBASUSHI/Devel-PeekPoke-0.03/lib/Devel/PeekPoke/PP.pm#L100
13:52 mudler and public/sass/_common.scss
13:52 sri ribasushi: interesting
13:52 batman mudler: what about sass --version ?
13:52 mudler batman: Sass 3.1.19 (Brainy Betty)
13:53 batman aha! there you are :) i got 3.4.5
13:53 mudler damn!
13:53 batman install it using "sudo gem install sass" or something...
13:53 batman http://sass-lang.com/install
13:53 mudler oh yes i know
13:54 batman hm... wonder if i can detect that somehow :/
13:54 batman pull request for AssetPack is wanted :)
13:54 mudler is that.. i wasn't expecting this, and on the debian vm i want to keep vendor ruby-sass
13:55 mudler batman: i'll fork it and have a deep look :)
13:55 batman then install it locally. i think that will work if you just don't use "sudo" and set PATH=
13:56 mudler batman: of course i will :)
13:56 batman mudler: sweet!
13:56 batman mudler: any idea on how to improve that error message is very much velcome
13:57 mudler well i think at least displaying the sass version aside it's a good idea for debug (well, my case can happen, and it helps to notice it)
13:58 batman i will look into it.
13:58 mudler or if you wish i can make a pull :P
14:00 sri hmm, all i've read so far seems to indicate that this would be ok... $input = decode('UTF-8', $input) if utf8::downgrade($input, 1);
14:01 batman mudler: sure! i can't guaranty i will accept it, but i can guaranty it will give me inspiration :)
14:01 sri it's not really worse than what we have now
14:01 mudler batman: good :)
14:02 sri great summary of how utf8::is_utf8 lies btw. http://blogs.perl.org/users/aristotle/2011/08/utf8-flag.html
14:02 mudler batman, by the way, since i'm here what do you think about https://groups.google.com/forum/#!topic/mojolicious/PEeEsmYGyd8 ?
14:03 batman sorry, i don't have time to look at it :(
14:03 mudler content_for , doesn't chain partial content right? that would be sweet
14:04 mudler nevermind :)
14:08 chansen sri: what are you trying to achieve with utf8::downgrade?
14:09 sri chansen: trying to see if the input string already contains wide characters which would indicate that it's not encoded UTF-8
14:11 sri i guess where things already get ugly is with decode_json('[1,2,3]'), which already depends on perls internal representation being UTF-8 and surviving a decode('UTF-8', $input)
14:12 sri the dark side of perl... we are not supposed to depend on perls internal representation for strings, but we can't really avoid it
14:14 chansen In perl we can't tell the difference between byte string and character string, you can only test for certain codepoint ranges. utf8::downgrade($input, 1) is equivalent to $input =~ /\A[\x00-\xFF]\z/
14:14 purl Hmm.  No matches for that, chansen.
14:15 chansen $ perl -CO -MEncode=decode -wle 'print $input = decode("ISO-8859-1", "\xE5\xE4\xF6"); print decode("UTF-8", $input) if utf8::downgrade($input, 1);'
14:15 chansen try the above ^^
14:18 chansen 1) You can't tell the difference between a character string and a byte string; 2) Forget about the utf8 flag, it will do you more harm than good!
14:20 chansen 3) Don't use the functions in utf8 package unless you are willing to accept and emit ill-formed UTF-8
14:20 ribasushi chansen: I know we've sparred on this before but I still maintain you are wrong. In perl one *can* assert *definitively* if a string is bytes-only. On everything else - I agree with you it is a toss-up
14:23 chansen ribasushi: you can't tell whether or not a scalar contains a byte string or a character string in perl! You can test the scalar for certain code-point ranges.
14:23 moritz because it's not a property of the string
14:23 moritz it's a property of the context
14:24 ribasushi chansen: right, you are asserting 2 things above, I disagree on the first one
14:24 moritz uc() for example will treat its argument as a text string, which means Latin-1 if the utf8 flag is not set
14:24 moritz even though the string looked like a very normal byte string before
14:24 sri chansen: perl -CO -MEncode=decode -wle 'print $input = decode("ISO-8859-1", "\xE5\xE4\xF6"); print Encode::find_encoding("UTF-8")->decode($input, 1) if utf8::downgrade($input, 1);'
14:25 Trelane sri: that downgrade is wrong
14:25 sri i'm kinda ok with the result
14:26 Trelane perl -e 'use Devel::Peek; my $foo = "\x{e9}"; utf8::downgrade($foo); Dump $foo;'
14:26 Trelane That gives me a single byte string
14:26 Trelane that's invalid utf8
14:26 ribasushi moritz: see the thing I linked to earlier: https://metacpan.org/source/RIBASUSHI/Devel-PeekPoke-0.03/lib/Devel/PeekPoke/PP.pm#L100
14:27 ribasushi moritz: I still maintain this code has *no* false positives (and may have false negatives, which is encoded in the exception)
14:27 sri Trelane: same result, it doesn't get past the decode('UTF-8', ...)
14:27 Trelane hmm, good point
14:27 purl nice and sharp
14:28 moritz ribasushi: well, if you stay into ASCII range, the difference between bytes and characters vanishes
14:29 moritz ribasushi: so yes, you have a point here
14:29 sh4 joined #mojo
14:29 chansen sri: yeah, the downgraded U+00E5 cannot be decoded in UTF-8. but it's still heuristical! try:
14:29 chansen perl -CO -MEncode=decode -wle 'print $input = decode("ISO-8859-1", "\xC2\xA9"); print Encode::find_encoding("UTF-8")->decode($input, 1) if utf8::downgrade($input, 1);
14:29 cpan_mojo Mojolicious-Plugin-AssetPack 0.25 by Jan Henning Thorsen - http://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-AssetPack-0.25
14:30 batman mudler: not better error message, but hopefully not worse either :) ^^
14:30 chansen sri: Trust me when I'm telling you that you can't tell the difference between a character string and a byt string in Perl! If you want that feature send a proposal to p5p
14:31 mudler batman: good :)
14:31 ribasushi moritz: but note that I am not limiting it to an ASCII range - I also allow for 80~FF, given the flags are right
14:32 Trelane you know what helps here?  lots of tests!
14:35 Dandre joined #mojo
14:37 chansen ribasushi: I would like to see a nopaste of you bullet proof routine
14:37 ribasushi chansen: it's very very short https://metacpan.org/source/RIBASUSHI/Devel-PeekPoke-0.03/lib/Devel/PeekPoke/PP.pm#L100
14:40 chansen ribasushi: thanks, I'll take a look later, GTG BBIAB
14:43 batman mudler: I hope I will have time to look at bootstrap3 later.
14:43 mudler batman: there is no rush, i downgraded it for the moment
14:43 batman But there's so many things going on now, so please bug me again :)
14:43 batman what is "it"?
14:43 purl hmmm... "it" is dbix-class.org?
14:43 mudler of course :)
14:44 mudler ehm, bootstrap3 :)
14:44 batman Ah. Which version is working?
14:44 mudler 3.1007
14:44 batman Thanks.
14:44 mudler batman: you are welcome :)
14:45 batman I like the latest assetpack: using objects instead of callbacks.
14:46 batman A lot cleaner. The sad part is that I knew I should have done that in 0.01, but I didn't :P
14:46 mudler ahahahaah
14:46 mudler batman: it happens
14:48 batman Too often.
14:49 batman I often ignore what I know is right. Hoping it's not :)
14:50 sri chansen: that actually gets past the current checks too https://github.com/kraih/mojo/blob/master/lib/Mojo/JSON.pm#L68-L73
14:53 basic6_ joined #mojo
15:02 hernan joined #mojo
15:02 sujithm joined #mojo
15:15 dmanto joined #mojo
15:17 dmanto hi
15:17 sri o/
15:17 dmanto have a question about mojo::ioloop
15:18 dmanto i'm getting a "demasiados puertos abiertos"
15:18 dmanto spanish for too many open ports
15:18 dmanto sorry "archivos" (ie files)
15:19 sri don't open so many ports ;p
15:19 dmanto Can't create listen socket: Demasiados archivos abiertos at /usr/local/share/perl/5.18.2/Mojo/IOLoop.pm line 120
15:19 dmanto exactly
15:19 dmanto that will fix it!
15:19 dmanto :))
15:20 dmanto no let me explain
15:20 dmanto i just want to have many websockets open
15:20 dmanto like 1000 per linux process
15:21 dmanto and i get problems beyond 252 ws opened
15:22 dmanto so i guess i should be able to modify that limit
15:22 sri here's an example for os x https://gist.github.com/kraih/ac0502106bf0f643ea10
15:23 dmanto ok i'l check that
15:24 hernan 10k websockets open ?
15:26 sri you have to tune your operating system and use a scalable EV backend, like kqueue or epoll
15:26 sri some of it is also mentioned here http://mojolicio.us/perldoc/Mojo/IOLoop#DESCRIPTION
15:26 purl okay, sri.
15:27 D4RK-PH0ENiX joined #mojo
15:30 sri allright... i guess the tricky case for the "decode() if downgrade()" hack will be json_decode(qq{["\xE9"]})
15:30 sri since that string can be downgraded, but does not pass UTF-8 decoding
15:30 Nei why are you people messing with downgrading
15:31 sri but it is actually valid JSON (in textual form without a charset applied)
15:32 sri Nei: to see if one function is able to accept UTF-8 encoded JSON as well as JSON that's not UTF-8 encoded
15:33 sri the problem is not false postitives, but false negatives i believe
15:53 marcus https://news.ycombinator.com/item?id=8415803
15:55 good_news_everyon joined #mojo
15:55 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/JH1lKQ
15:55 good_news_everyon mojo/master 139ac44 Sebastian Riedel: added from_json and to_json functions to Mojo::JSON
15:55 good_news_everyon left #mojo
15:55 sri that seems like the only way to do it
15:57 neyasov__ joined #mojo
16:01 sri marcus: he has a point
16:05 sujithm joined #mojo
16:06 sri and so does the parent
16:07 ribasushi joined #mojo
16:09 dod joined #mojo
16:10 marcus sri: seems like he likes to argue on the internet and is butthurt that people disagrees with him.
16:11 ua joined #mojo
16:11 marcus I've no idea about that framework naming thing tho. bdefoy deciding what people should be able to name their frameworks seems weird.
16:12 Nei that's been quite a while when there was still a required registration of namespaces
16:13 marcus I know it's *possible* to register your namespace, but I didn't think it was ever a requirement.
16:13 marcus Anyways, I'm curious who that commenter is.
16:14 marcus Oh, it says further down - David Helkowski
16:14 Nei aka CODECHILD
16:14 marcus http://arstechnica.com/information-technology/2014/05/why-he-hacked-university-of-maryland-contractor-turned-hacker-tells-all/
16:14 marcus first hit on google.
16:14 purl hmmm... first hit on google is phon.ucl.ac.uk which looks interesting
16:15 marcus Poor guy. :-/
16:15 Nei sounds like he did some stupid things
16:16 sri marcus: i meant in general, open source is mostly thankless work
16:17 sri no clue about the specific arguments
16:17 marcus sri: Ya, it's better to do it for yourself than for the admiration of the internet plebes :)
16:18 good_news_everyon joined #mojo
16:18 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/eV2LSw
16:18 good_news_everyon mojo/master c88ba3c Sebastian Riedel: use implicit $_ a bit more
16:18 good_news_everyon left #mojo
16:18 go|dfish https://github.com/nanoscopic/HTML-Bare seems to be the parser he mentioned
16:18 irq joined #mojo
16:19 marcus agpl seems like a quite restrictive license for an xml parser
16:21 sri talking about thankless work... some of you still owe us a quote! https://github.com/kraih/mojo/wiki/User-quotes
16:25 sri and does anyone have any good use cases for Mojo::Collection::pluck on hash references? https://github.com/kraih/mojo/commit/f132af616df188f7909fe79edeac84169983ca92
16:25 sri (aside from Mojo::Pg)
16:32 cpan_mojo Yars 1.01 by PLICEASE - http://metacpan.org/release/PLICEASE/Yars-1.01 (depends on Mojolicious)
16:36 ua1 joined #mojo
16:38 neilhwatson joined #mojo
16:41 sujithm joined #mojo
16:44 preaction joined #mojo
16:54 ua joined #mojo
16:58 neyasov__ joined #mojo
16:58 sri *crickets*
16:59 mst sri: my reaction to that line was to twitch, and file it under "I would want to run this past somebody who knew encodings better than me and document the possible failure modes, because I bet there's at least one non-obvious one"
16:59 disputin joined #mojo
16:59 mst sri: which isn't to say it might not have turned out to be the least worst choice, overall
17:00 sri mst: i think encode_json(qq{"\x9e"}) killed it
17:00 sri that's valid json text as far as i can see
17:02 sri (as in it should successfully roundtrip, but doesn't because it can be downgraded but not utf-8 decoded)
17:02 Nei downgrade doesn't sound right
17:03 sri you keep saying that
17:03 Nei your explanation on why it is needed doesn't make sense to me
17:04 sri what explanation?
17:04 purl explanation is kind of backwards, from the perspective of the MTA calling the SPF tester function.
17:04 mst sri: that sounds like precisely the sort of 'non-obvious failure mode' I was worried about, and, yeah, that doesn't sound like a price worth paying
17:05 Nei you said it was to "accept UTF-8 encoded JSON and not UTF-8 encoded JSON"
17:05 sri yea, i had a feeling such a case might exist too, which is why i kept bugging everyone here :)
17:07 sri Nei: the idea was to be reasonably sure we have something that can be UTF-8 decoded, by ckecking for code points above \xFF
17:08 Nei you must define clear rules what is fed in to the function and what comes out
17:08 neyasov__ joined #mojo
17:08 sri now you sound a bit preachy
17:09 Nei on the perl side in my experience the utf8 "flag" is confusing most users
17:10 sri i want to know why *exactly* it doesn't work
17:10 Nei if I remember correctly upgrade/downgrade change the internal string from latin1 to utf8
17:11 Nei tell me more about the failure
17:11 sri i'm getting the feeling you've not followed the discussion
17:12 sri you definitely shouldn't skip the backlog today, some very interesting facts have been pointed out above
17:12 * sri learned a lot
17:14 mst lemme try summarise: the idea was that the change would trap some cases that would otherwise appear to work, but not be reliable; the problem was that it also managed to trap cases that should've worked?
17:15 Nei no, I came in late. I read a bit of the backlog now. ribasushi is definitely experienced on this matter
17:15 * sri nods
17:16 sri and in the end i went with new functions for encoding and decoding https://github.com/kraih/mojo/commit/139ac4492381da4623f848936524acdd4b38df57
17:17 Nei "Decode JSON text without C<UTF-8> encoding " this is confusing me
17:17 sri haha, i just thought the same rereading it
17:18 good_news_everyon joined #mojo
17:18 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/3o65Tg
17:18 good_news_everyon mojo/master 40ff312 Sebastian Riedel: better description for from_json
17:18 good_news_everyon left #mojo
17:18 Nei I would prefer if the text talked about character data and octet data
17:18 Nei that's the only sane concept immediately clear to perl encoding mongers
17:18 Nei the stuff you get fron Encode::encode/decode
17:18 hernan Mojo::Pg ? you guys are crazy,, thanks !!
17:19 sri just be aware that Mojo::Pg is still very much experimental
17:19 hernan ahh
17:19 hernan i set a reference of dbix class as helper
17:20 Nei this is from the link in the backlog: "If you are designing an API in which bytes vs characters is a concern, then in each case it accepts a string you must decide whether you prefer bytes or characters there, then document that this is what you expect, and then write the code so it always treats that string the same way – either always as characters or always as bytes."
17:21 KCL joined #mojo
17:21 sri you're preaching again
17:22 sri i like to make my own style decisions based on facts, there are a lot of best practices out there that really aren't
17:22 sri like the good old bare "return;"
17:25 sri and i'm very glad a special case has been found that makes it perfectly clear that decode() if downgrade() doesn't work
17:25 cfedde I'm using Mojo::Template as part of a system that drives a cli. (pitty me).
17:25 Nei but you still don't understand it?
17:25 sri i do understand
17:25 Nei you cannot detect anything with downgrade for the critical latin1 part
17:25 cfedde never mind.  I can't decide what my real question is.
17:26 sri or rather... i have a vague idea of what's going on... only very few people *really* understand the problem
17:26 Nei I think there is a huge confusion but it shouldn't be too difficult to understand
17:26 Nei but that's why I preach to avoid these functions
17:26 marcus cfedde: consider yourself pitied.
17:27 sri Nei: and then the internal representation is ebcdic
17:27 Nei there were bugs related to this stuff in earlier versions of perl
17:27 mst Nei: your preaching provides a lovely description of what to do in an ideal world
17:27 Nei yes the internal rep is ebcdic and utf-ebcdic on ebcdic platforms
17:27 mst however, back over here in reality, if additional DWIM can be achieved without introducing bugs, it's not necessarily a bad thing
17:28 cfedde As long as DWIM realy is WIM
17:28 Nei I strongly disagree for this special case of character encodings
17:28 Nei a lot of people think/thought that
17:28 mst then your position is dogmatic rather than rational
17:29 Nei no it has caused me lots of grief
17:29 mst I will happily stipulate to "it's almost always a terrible idea to even try" ... but sri approached it in a sufficiently principled way that no harm came from his trying
17:29 mst your anecdata of people trying -badly- doesn't mean that nobody should ever try at all, it just means we should be really careful when we do
17:30 mst and you notice that once it was clear that it couldn't be done without also introducing problems, sri stopped
17:30 Nei if you can suggest how to do it
17:30 mst wut?
17:31 sri there are counter examples, like being optimistic about form data being UTF-8 encoded
17:31 Nei yes sure in the real world you need to guess encoding
17:31 Nei or use the hidden utf8-checkmark field or whatever hack
17:32 Nei but that's for data from the web
17:32 marcus We're guessing encoding for IRC in convos.
17:32 Nei or maybe irc, that's also some kind of web
17:32 marcus Using chansen's Unicode::UTF8
17:32 Nei but that's quite a grievance as well especially when you guess wrong
17:33 mst Nei: holding a preachy based dogmatic position that's sufficiently extreme to be quite easily falsifiable impedes effective arguments being made for the 99% of cases that are actually wrong
17:33 marcus Nei: You don't really have a choice when the encoding is undefined tho.
17:33 Nei I'm sure there are cpan modules to take a good guess at encodings
17:33 Nei but for the parts you can control, why not control it
17:34 * mst sighs
17:34 mst you're not actually responding to any of the things I've been saying
17:34 mst just repeating the same position; I already understand what that position is just fine.
17:34 Nei well I can't see how you would go about trying and succeeding, that's all
17:35 mst that doesn't mean nobody should ever try, though
17:35 mst just that they should be highly suspicious of any apparent success
17:35 Nei I have already the proof in my mind that any trial is futile
17:35 Nei which means noone should ever try :)
17:35 mst then write it up as a rigorous argument that demonstrates it's actually impossible
17:36 Nei which brings me back to our misunderstanding; what's the question?
17:36 cfedde If you have a second to set asside the etherial to consider the mundane? with Mojo::Template: I have a $action that contains a block name. Is there a way to envoke that block?
17:36 Nei round trip json encoding/decoding under various utf8 flag and up/downgrade influences?
17:37 Nei not to mention that you gladly found a counter example, this is quite easily provable
17:37 sri cfedde: define block name
17:37 * mst shrugs
17:37 noganex_ no... utf8 is killing me...
17:37 Nei mashing bytes and utf8 and latin1 together? yes I haven't written down the proof here at the moment (point for you) but I'm sure the perl pumpkins did spend some time thinking about it
17:38 cfedde sri: thanks!
17:38 sri cfedde: umm, that was a question xD
17:38 Nei which lead to this compatibility/internal representation./flag implementation which we have now and is documented in perldoc Encode
17:38 cfedde I see where I got confused there.
17:38 noganex_ i'm using MooseX::Storage together with mojo. and i'm not sure wether the problem is in MooseX::Storage::Format::JSON or mojo.
17:38 mst Nei: three pumpkings told me Devel::Declare was impossible
17:38 sri cfedde: glad i could help though! :D
17:38 Eke- joined #mojo
17:38 noganex_ i've written a small test script: https://gist.github.com/anonymous/27cbeca7efb952cda71a
17:39 cfedde sri: :-)
17:39 mst Nei: I will generally default to assuming they're right, but it's not 100% certain
17:39 Nei sure, they are also wrong
17:39 purl okay, Nei.
17:39 mst wtf?
17:39 mst please don't strawman me
17:39 cfedde sri: can i create a hash of blocks?  It seems like should just try.
17:39 marcus purl: fight me!
17:39 purl marcus: excuse me?
17:39 * marcus pushes purl down the stairs
17:39 * purl attaches herself to marcus using suction and a ham straw
17:40 mst "not 100% certain" is a fuckload different to "they are also wrong"
17:40 Nei but for the encoding case ... just think through it, latin1 (or "internal encoding") can be represented in 2 ways
17:40 sri Nei: allright, i think we can end this discussion now
17:40 noganex_ without the utf8::decode (copied from MooseX::Storage) it works just fine, but with it, it doesnt.
17:40 Nei yes especially since you have the next utf8 victim
17:41 mst I'm not sure it even counts as a discussion at this point; those normally involve people having the same conversation as each other :)
17:42 neyasov__ joined #mojo
17:44 sri noganex_: http://mojolicio.us/perldoc/Mojolicious/Guides/Rendering#Rendering-text
17:49 Trelane is it too late to put my two pence in?
17:50 Trelane my $json = JSON::Any->new(canonical => 1)->objToJson( [$data] );
17:50 Trelane $json should be octects here.  JSON is, by definintion, utf-8 encoded.
17:51 Trelane but then saying $c->render(text => $json);  # isn't $json here meant to be characters?
17:51 phips joined #mojo
17:51 sri he lifted code from MooseX::Storage::Format::JSON to make a minimal example
17:52 noganex_ yes. and swapping the json backend works, too. i guess it has nothing to do with mojo. sorry guys.
17:54 good_news_everyon joined #mojo
17:54 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/PaxaGA
17:54 good_news_everyon mojo/master 292e66b Sebastian Riedel: link to encoding attribute
17:54 good_news_everyon left #mojo
18:03 Trelane How do I work out how many nodes a Mojo::DOM represents?  $dom->contents->size ?
18:04 sri all_contents
18:04 purl all_contents is probably pretty recent, my version of Mojolicious is very old
18:04 * sri pats purl
18:04 * purl bites!
18:05 Trelane so $("p").size() would translate to $dom->find("p")->all_contents->size ?
18:06 sri $dom->find('p')->size
18:06 doby joined #mojo
18:07 sri contents methods would be for the nodes contained in those p elements
18:08 Trelane ah, find returns a Mojo::Collection.  I got all conufused.
18:09 sri which reminds me to put making Mojo::Collection not stringify on the table for Mojolicious 6.0
18:10 mst please. I'm sure I've seen that confuse people more than anything else.
18:12 sri it was fun for one-liners when the whole thing started... but trips me up every now and then too
18:17 dmanto sri: tryed your os x example (https://gist.github.com/kraih/ac0502106bf0f643ea10), couldn't find similar configurations on ubuntu
18:17 dmanto got 1K websockets
18:18 dmanto anyway is more than my test was able to do
18:18 dmanto only 250
18:19 sri give it a +1 if you feel strongly about it https://github.com/kraih/mojo/issues/684
18:24 dmanto mine is a test around the chat program in the wiki, trying to open n simultaneos chat users, you can clone it from https://github.com/dmanto/simultaneoswebsockets.git
18:24 good_news_everyon joined #mojo
18:24 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/RMt5JA
18:24 good_news_everyon mojo/master 44844d9 Sebastian Riedel: no need to say bytes twice
18:24 good_news_everyon left #mojo
18:38 neyasov___ joined #mojo
18:47 Eke- joined #mojo
19:01 Kripton_ joined #mojo
19:03 neyasov____ joined #mojo
19:07 neyasov____ joined #mojo
19:08 * mishantil yawns
19:12 ua1 joined #mojo
19:36 fhelmber_ joined #mojo
19:48 sri does this get the point across? https://github.com/kraih/mojo-pg/commit/a52abdfffead448cb75f0625d41a90958d120bb2
19:50 jzawodn_ sri: that seems clear to me, fwiw
19:50 sri \o/
19:50 meredith agreed, looks clear to me
19:51 mst alles klar
19:51 stephanj maybe add comments # create a db connection / # db connection 1 and # db connection 2 - that would make it ultra clear
19:51 stephanj but with some thinking it is already clear enough
19:52 preaction is there a connection limit? connection overhead or anything? Mojo::Pg does pooling and connection caching right? these questions are probably answered with other parts of the docs
19:54 sri just a limit on how many to cache, but not on creation
19:54 stephanj actually by readin the pod completly i could not make a backed up assumption that each call to $pg->db creates a new connection so maybe it should be written there (as i assume this is the behaviour the example should be showing)
20:03 sri postgresql doesn't appear to be very good at super high concurrency though
20:03 cfedde for dml or dql?
20:04 sri there's a process or thread dedicated to every connection
20:04 sri in general
20:04 purl In general, you do not want to disturb The General.
20:07 sri docs seem to suggest it is designed for hundreds of connections, not thousands
20:07 sri so idle connections are costly
20:08 cfedde docs represent a kinder gentler time. when we though that 100 was a big number.
20:09 cfedde there are a few wizards over in #postgresql that can help there and can talk to furture plans.  But then you know that.
20:09 sri reading some of the mailing list posts from a long long time ago make me smile http://grokbase.com/t/postgresql/pgsql-general/0595fecj8b/setting-up-a-database-for-10000-concurrent-users
20:10 sri "10GB of memory is not that far fetched"
20:10 sri good times
20:10 purl DON'T OPEN IT!  IT'LL CRASH AOL!
20:12 cfedde old meme is old.
20:27 ribasushi joined #mojo
20:37 ua joined #mojo
20:41 cpan_mojo Net-LeanKit 0.3 by ADAMJS - http://metacpan.org/release/ADAMJS/Net-LeanKit-0.3 (depends on Mojolicious)
20:45 sri that's pretty bold https://github.com/github/dmca/blob/master/2014-10-05-tildeslash.md
20:46 denis_boyun joined #mojo
20:47 nicomen aren't there some sql brokers that could handle the paralell connections for you?
20:49 nicomen sqlrelay?
20:49 purl it has been said that sqlrelay is free ?
20:50 nicomen wonder if dbi works transparently with: http://sqlrelay.sourceforge.net/sqlrelay/dropin/postgresql.html
21:00 sri muhahahaha... is cnn in the us some kind o comedy channel? i've never seen something this funny on the international version! https://pbs.twimg.com/media/BzR7LVhCUAA_ckO.jpg
21:01 Gedge joined #mojo
21:03 sri nicomen: better look here https://wiki.postgresql.org/wiki/Replication,_Clustering,_and_Connection_Pooling#Connection_Pooling_and_Acceleration
21:10 cfedde rule number 1. If you think that americans are dumb you are over estimating us.
21:11 cfedde there are two things in the news.  Lets do a third story on both of them.
21:42 ua1 joined #mojo
21:44 Gedge joined #mojo
21:57 ua joined #mojo
22:01 ua1 joined #mojo
22:04 Gedge joined #mojo
22:22 cpan_mojo Mojolicious-Plugin-Bootstrap3 3.2002 by Jan Henning Thorsen - http://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-Bootstrap3-3.2002
22:22 cpan_mojo Mojolicious-Plugin-AssetPack 0.26 by Jan Henning Thorsen - http://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-AssetPack-0.26
22:22 disputin joined #mojo
22:30 cpan_mojo Mojolicious-Plugin-AssetPack 0.27 by Jan Henning Thorsen - http://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-AssetPack-0.27
22:35 ua joined #mojo
22:44 good_news_everyon joined #mojo
22:44 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/MPGTZg
22:44 good_news_everyon mojo/master 52eb3e3 Sebastian Riedel: improved pluck method in Mojo::Collection to be able to extract values from hash references
22:44 good_news_everyon left #mojo
22:44 sri i know, i know ;p
22:57 good_news_everyon joined #mojo
22:57 good_news_everyon [mojo] kraih pushed 1 new commit to master: http://git.io/2pQSqg
22:57 good_news_everyon mojo/master b9c0dd1 Sebastian Riedel: slightly better description for pluck
22:57 good_news_everyon left #mojo
23:09 sri marcus: when you proposed inlining of all entities into the DATA section of Mojo::Util you were aware that there's 2231 lines of entities?
23:16 ua1 joined #mojo
23:20 Flying_Squirrel joined #mojo
23:20 Flying_Squirrel Hi all!
23:21 preaction hello
23:21 purl hello, preaction.
23:21 sri o/
23:21 D4RK-PH0ENiX joined #mojo
23:21 sri marcus: have you actually verified that fatpacker can handle DATA sections
23:21 ua joined #mojo
23:21 sri ?
23:23 sri i suppose you could make mojolicious fatpackable, but a lot of stuff would need to be rather ugly and hard to maintain
23:37 fhelmber_ joined #mojo
23:57 meshl joined #mojo

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