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

IRC log for #mojo, 2018-02-14

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

All times shown according to UTC.

Time Nick Message
00:59 tchaves joined #mojo
01:08 aborazmeh joined #mojo
01:31 nefarious joined #mojo
01:36 marty joined #mojo
02:16 marty joined #mojo
02:49 dikim joined #mojo
02:57 ilbot2 joined #mojo
02:57 Topic for #mojo is now 🍩 nom nom | http://mojolicious.org | http://irclog.mojolicious.org | http://code-of-conduct.mojolicious.org
04:17 shoorick joined #mojo
04:48 shoorick left #mojo
05:04 dboehmer_ joined #mojo
06:29 eseyman joined #mojo
07:08 polettix joined #mojo
07:09 Vandal joined #mojo
07:47 noganex joined #mojo
08:18 inokenty-w joined #mojo
08:23 trone joined #mojo
08:32 berov joined #mojo
08:55 good_news_everyon joined #mojo
08:55 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vAszu
08:55 good_news_everyon mojo/master b2ae603 Sebastian Riedel: bump version
08:55 good_news_everyon left #mojo
08:55 good_news_everyon joined #mojo
08:55 good_news_everyon [mojo] kraih tagged v7.66 at 368276f: https://git.io/vAszz
08:55 good_news_everyon left #mojo
08:58 Edward joined #mojo
09:13 sri this is so weird, suddenly everyone is discovering the HoL blocking issues in HTTP/2 https://www.twilio.com/blog/2017/10/http2-issues.html
09:14 sri (and jumping on the QUIC bandwagon)
09:16 kaare joined #mojo
09:30 karjala_ joined #mojo
09:37 McA joined #mojo
09:40 petru_ joined #mojo
09:40 petru_ joined #mojo
09:41 petru_ hi, is this a correct way of sending a notification to all users of a platform when using mojo?
09:41 petru_ https://perlbot.pl/p/388icu
10:29 anony joined #mojo
10:39 ghenry joined #mojo
10:46 karjala_ left #mojo
11:51 karjala_ joined #mojo
12:49 tcohen joined #mojo
12:52 aborazmeh joined #mojo
13:24 pink_mist pretty sure he also needs to waitpid() - in fact, so do I for one of my things I just realised
13:26 haarg the else case will never run, because $pid will be undef if the fork fails.  the == 0 check would be true, but with a warning.
13:27 haarg elsif (defined $pid)
13:36 pink_mist yeah, I would have told him that as well had he stuck around
13:36 pink_mist only made a comment that applied to myself since he didn't :P
13:39 pink_mist (actually, his waitpid() would likely be better as a $SIG{CHILD}='IGNORE'; since otherwise it would block
13:39 pink_mist )
13:46 pink_mist (or he could just Mojo::IOLoop::Subprocess it
13:47 pink_mist ) (damn, I missed the ending parens *again*)
13:53 seba joined #mojo
13:56 maschine joined #mojo
14:07 bwf joined #mojo
14:16 sri (
14:30 exp-innit is there a recommended way to serve a file built in memory in mojo? specifically i'm generating a spreadsheet using Excel::Writer::XLSX which can output to a filehandle
14:30 jabberwok (((car (cdr (car (cdr....
14:31 exp-innit but Mojo::Asset::Memory doesn't appear to encompass a handle
14:31 exp-innit so I can obviously just store it in a local handle, set content disposition etc
14:31 exp-innit but I assume there's some tightly integrated, pretty way to do it
14:32 seba left #mojo
14:33 Pyritic joined #mojo
14:33 maschine I've done that lots..  But I'll have to look at it to remember :p
14:34 exp-innit no worries, I have to brb also
14:34 exp-innit any advice much welcomed
14:44 maschine exp-innit:  this is how I'm doing it with Archive::Zip::SimpleZip - http://bit.ly/2ErBP6H
14:44 maschine I think it would work with Excel::Writer::XLSX, different headers of course
14:44 exp-innit maschine: tyvm
14:45 exp-innit maschine: yep that looks pretty much identical to what i thought :)
14:45 maschine I use Excel::Writer::XLSX in another project but I haven't tried it without saving the file to disk
14:45 maschine it's really handy here since the zip file contains a batch script that has to be created on the fly - a file saved to disk would be useless. :p
14:45 exp-innit yeah understandable, in this case there's no backend state kept anywhere
14:46 exp-innit everything is safely read-only and sharded
14:46 exp-innit immutable infrastructure etc
14:48 karjala_ joined #mojo
14:50 pink_mist isn't it just something like: $c->reply->asset(Mojo::Asset::File->new->handle($fh)->path('foo.xlsx')); ? possibly you need to seek() the $fh to the start first
14:51 pink_mist (I'm not sure this is the case though, never tried it)
14:52 exp-innit pink_mist: oh that's a good point, handle is an attribute
14:52 exp-innit i am not sure!
14:53 pink_mist hmm, looking at the code I don't think you need to seek first
14:53 pink_mist it seeks itself anytime it wants to read
14:56 jabberwok hm, how does that work in a hypnotoad environment, wouldnt' that only create the asset in one worker?
14:56 pink_mist yes
14:56 pink_mist only the one worker that needs it
15:01 jabberwok which is slightly splendid
15:03 exp-innit pink_mist: well let's give it a try
15:04 pink_mist also probably $c->res->headers->content_type() magic
15:04 pink_mist (before $c->reply
15:04 pink_mist )
15:04 pink_mist (damnit!!)
15:05 sri )
15:05 pink_mist oh thank god, you closed your own parens :P
15:06 exp-innit pink_mist: doesn't seem to be particularly happy
15:06 exp-innit i'll debug a bit more later
15:10 sri pink_mist waiting this past hour for those parens to get closed :D https://i2.wp.com/media.giphy.com/media/nEovVMM8Z5H6U/giphy.gif?resize=500%2C402&ssl=1
15:11 pink_mist lol
15:12 mohawk bender seems to have 3 rows of teeth
15:12 exp-innit he's 64% teeth
15:13 mohawk a great silver shark
15:13 pink_mist exp-innit++
15:16 jberger BTW https://metacpan.org/pod/Mojolicious::Plugin::ReplyTable shows how one can render xlsx etc
15:17 exp-innit jberger: ++ × ∞
15:20 exp-innit jberger: so manual first row = column headers here?
15:20 exp-innit looks that way
15:26 mohawk jberger, that's a great bit of work
15:28 tcohen1 joined #mojo
15:35 gryphon joined #mojo
15:37 jberger exp-innit: hmmmm, yes I did add a header row option to the html renderer but that stash value could (and probably should) be used in the other generators
15:38 jberger oh, right, that's why
15:38 jberger because there is no distinction
15:38 jberger except in the html where those are th vs td
15:38 exp-innit jberger: yeah, it turns out i can't really use this
15:39 exp-innit because i need to reflect on column type and use custom write methods
15:39 exp-innit still a nice module
15:39 jberger oh, sure, that module is really simplistic
15:39 jberger but the code still is a reasonable example for many things
15:39 jberger that code came out of something at $job[-2]
15:39 exp-innit roger that
15:40 jberger $boss wanted to support as many formats as possible for reports because he thought different people would want different formats and he didn't know who or what
15:44 jberger hmmmm, I guess for spreadsheets it could still respect header_row
15:44 Pyritic joined #mojo
15:45 jberger honestly I use spreadsheets so little that I forgot that you could name columns :-P
15:46 exp-innit hah, yeah user requested
15:46 exp-innit i prefer my latex PDFs of course ;)
15:51 chandwki joined #mojo
15:54 gizmomathboy joined #mojo
16:10 jberger if I could reliably split tables across pages I'd happily support LaTeX
16:13 sh14 joined #mojo
16:13 jabberwok sort of a modern "Spreadsheets won't, HTML can't" conundrum
16:14 sri if i have to look any longer at the new bootstrap 4 colors on the minion admin ui i think my eyes will start bleeding :S
16:18 sri batman: haha, that is clever https://gist.github.com/jhthorsen/0ad4c5c84661588e89da910a08460e88
16:18 jabberwok sri: Are eclipse-proof glasses any help?
16:23 jberger sri / batman : isn't that basically how the final incarnation of stevan's stuff works?
16:23 jberger https://metacpan.org/pod/UNIVERSAL::Object
16:24 sri dunno, just saw batman posted it to the mailing list
16:27 jberger I've been trying to keep an eye on it
16:27 jberger it seems like a thing that Mojo::Base could support/play-nice-with
16:27 jberger if we want to do things like introspection we should look that way before inventing something of our own (IMO)
16:30 sri sure
16:37 Pyritic joined #mojo
16:40 Peppard joined #mojo
16:44 kgoess joined #mojo
16:46 nefarious joined #mojo
16:55 karjala_ joined #mojo
17:16 sh14 joined #mojo
17:18 mishantil joined #mojo
17:23 mishanti1 joined #mojo
17:52 karjala_ joined #mojo
18:13 karjala_ joined #mojo
18:29 epiphero joined #mojo
18:48 trone joined #mojo
18:53 polettix joined #mojo
19:06 karjala_ joined #mojo
19:32 ChmEarl joined #mojo
19:37 Pyritic joined #mojo
19:39 Seth joined #mojo
19:44 berov joined #mojo
20:02 karjala_ joined #mojo
20:27 Seth joined #mojo
21:04 polettix joined #mojo
21:16 batman sri: thanks :)
21:17 batman i think that all attribute should be lazy by default. i don't get why that isn't built into UNIVERSAL::Object
21:17 batman sri: i on purpose called it for %ATTRS, instead of %HAS to not collide with stevan
21:18 batman the only issue with my solution is if you monkey patch stuff in runtime, since my code will think it's an attribute
21:18 batman also, adding a method/attribute later on will not be tracked
21:19 batman but it would be easy enough to just replace "has" from my module and keep on tracking attributes
21:22 jamesaxl joined #mojo
21:24 Seth joined #mojo
21:30 Pyritic joined #mojo
21:38 jamesaxl joined #mojo
21:51 jabberwok In a Minion worker, I can trap » local $SIG{TERM} « and successfully complete the job task, but once the task code returns, the Minion worker terminates.  Is there a way to override that, or is there some subtlety to signals I'm missing?
22:21 Seth joined #mojo
22:22 tchaves joined #mojo
22:33 Seth joined #mojo
22:47 Seth joined #mojo
23:29 odiemus joined #mojo
23:30 odiemus hi people
23:30 odiemus i have an issue with mojolicious: is it possible to render without any headers added my mojolicious?
23:31 pink_mist 0_o doubt it, but don't take my word for it
23:32 maschine render to string maybe?
23:32 maschine http://mojolicious.org/perldoc/Mojolicious/Guides/Rendering#toc
23:32 odiemus i read this ... already.... in all possible directions...
23:32 maschine maybe if you describe your problem better we could help you come to a better solution :)
23:33 sri why would you want mojolicious to generate invalid HTTP?
23:33 odiemus yea.. goin to describe
23:35 odiemus mojolicious is adding: Connection: close, Cache-Control: max-age=0, Set-Cookie: blablabla, Date: date..., Access-Control-Allow-Origin: *, Server: ....
23:35 sri no, it isn't
23:36 sri only Connection is required of those
23:36 odiemus and it adds Content-Length: ....
23:36 odiemus i don't need them all
23:36 odiemus just content-type andf then after cr my content
23:36 sri everything else is because you triggered it somehow or didn't remove them
23:36 sri some are not ever generated by mojolicious
23:37 odiemus oh... is it possible to remove content-length?
23:37 sri yes
23:37 odiemus ok... i'll try to make simples possible sample now to check what headers are on very plain mojolicious without any plugins...
23:38 sri you did not tell us the why
23:38 sri what you're doing is most likely wrong
23:38 odiemus $c->res->content->headers->remove('Content-Length') in controller doesn't remove content-length...
23:38 sri very wrong
23:38 odiemus I have some proprietary software i need to interface with
23:39 odiemus when i run simple CGI.pm-based solution everything works ok,
23:39 odiemus my script it generating XML and i did tcpdumps of both working stream from my old CGI.pm script and from Mojolicious script and the only difference in output was in headers
23:40 odiemus software is eating xml from old script without any trouble but rejects xml generated by mojolicious script
23:41 odiemus i understand i am doing a thing wrong, but i can't fix proprietary software nor get rid of it :(
23:42 dikim joined #mojo
23:42 odiemus there is a windows propgram which can fetch data via xml from other systems via CommerceML protocol
23:43 odiemus i wrote simple script with CGI.pm to run on server and generate XML for this win-proggy
23:43 odiemus and it worked well
23:44 odiemus now i need to consolidate all pieces together so i moved xml-generator under mojolicious and started to get my valid xml to reject by this proggy
23:44 odiemus program just issues get-request and server replies with xml
23:56 Grinnz are you sure it's not an encoding issue? with CGI.pm you need to handle encoding manually but in mojo it assumes the output should be encoded to UTF-8 by default
23:57 odiemus I am absolutely shure, I tcpdumped both streams, workign and not working and difference was only in headers
23:57 mohawk odiemus, is this under IIS?
23:57 odiemus under nginx
23:57 Grinnz is the Content-Type header the same?
23:57 mohawk ok
23:57 odiemus nginx+linux
23:58 odiemus couldb xml identation with spaces or tabs cause such effects?
23:58 Grinnz not if they're parsing xml correctly, but who knows
23:59 good_news_everyon joined #mojo
23:59 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vAZnE
23:59 good_news_everyon mojo/master 3772ff1 Sebastian Riedel: add another streaming example
23:59 good_news_everyon left #mojo

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