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

IRC log for #mojo, 2017-12-14

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

All times shown according to UTC.

Time Nick Message
00:14 exp-innit joined #mojo
00:43 tinita hi, short question: is it intended that only Mojolicious.pm has a $VERSION, and not Mojo::JSON, for example?
00:46 pink_mist yes.
00:46 tinita background: I am generating this table: https://gist.github.com/perlpunk/cff476611612d7035c7ce275817ccc04
00:46 tinita and there the version number is empty
00:46 tinita because Mojo::JSON->VERSION returns undef
00:46 pink_mist it is intended.
00:46 tinita :-/
00:47 Grinnz you can consider Mojo::JSON's version to be that of the accompanying Mojolicious
00:47 tinita Grinnz: yeah, but then I have to get it tmanually
00:47 tinita I uploaded my script
00:47 Grinnz no way around it unfortunately
00:47 tinita to the gist
00:48 tinita there you can see I iterate over 5 json modules.
00:48 tinita of course I can add it manually, but I think it would be nice if all mojo modules had a version ;-)
00:48 gordonfish joined #mojo
00:48 Grinnz i've suggested that in the past, but it would realistically require mojo to adopt a different packaging mechanism than raw EUMM
00:49 tinita i see
00:50 pink_mist can't they all just have "use Mojolicious; *VERSION = \&Mojolicious::VERSION;" or something :P
00:50 Grinnz that would not be appropriate for PAUSE
00:50 Grinnz also, it would suck to have Mojolicious loaded in everything in Mojo::
00:51 pink_mist true
00:51 tinita Grinnz: another sad thing is: use Mojo::JSON; Mojolicious->VERSION == undef
00:52 tinita i also have to use it explicitly, it seems
00:52 Grinnz yes, you have to load Mojolicious.pm
00:52 Grinnz as Mojo::JSON doesn't need it
00:52 Grinnz i recommend doing so by 'require Mojolicious' rather than turning your script into a mojo app :P
00:53 Grinnz er, that's Mojolicious::Lite... time to go home
00:53 tinita ;-)
00:54 tinita actually, the gist is also a bug report about loading floats
00:56 Grinnz i think https://github.com/rurban/Cpanel-JSON-XS/pull/63 is the issue you're referring to
00:56 Grinnz and that's a bit of a tricky wicket; it was a breaking change for my app
00:56 tinita hm, I think Cpanel::JSON::XS is the only correct one
00:56 tinita but I'd have to check the JSON spec
00:57 tinita if it realy matches the YAML spec here, 0.3e3 and 3.0 should be loaded and dumped again as floats
00:57 Grinnz mostly because values can end up NOK in other ways than just because they came from a float
00:57 tinita Grinnz: hm, which?
00:57 purl it has been said that which is a risk for all the feeds that bossert is scraping that are http only… or a dell keyboard!
00:57 Grinnz xdg notes one example there: "scalars resulting from addition of numeric and non-numeric data wind up NOK (e.g. "42" + "bar")."
00:58 Grinnz i don't remember what my case was
00:58 tinita ok, thanks, I'll check
00:59 Grinnz i think it may have been "values that come from the database as strings and then are numified"
01:00 Grinnz but it was probably more complicated
01:00 pink_mist I don't think there'll ever be a way for 0.3e3 to roundtrip through perl
01:00 tinita yes, "42" + "bar" --> NV
01:01 Grinnz pink_mist: there is a way: a json decoder that only returns overloaded objects
01:02 Grinnz but thats about it :P
01:02 tinita pink_mist: I just implemented it in YAML::PP halfway
01:02 pink_mist tinita: oh, how? 0_o
01:02 tinita pink_mist: sec
01:02 pink_mist Grinnz: >_< maybe that should be my next project
01:02 pink_mist (joking)
01:03 tinita I implemented it to load correctly so far
01:03 tinita https://github.com/perlpunk/YAML-PP-p5/blob/schema/lib/YAML/PP.pm#L152
01:03 tinita for the dump I will check NV, IV, PV
01:04 tinita of course then things like "42" + "bar" will end up as 0.0
01:04 tinita but I don't care about that actually
01:04 tinita if people want that to be 0, they have to do it before dumping it
01:04 Grinnz https://metacpan.org/pod/JSON::Typist does that but only number vs string on the already-wrong output from JSON.pm
01:05 tinita another method eould be POSIX::strtod()
01:05 tinita *would
01:06 Grinnz tinita: he means 0.3e3 literally staying as that in the output
01:06 tinita oh
01:06 tinita I see
01:06 pink_mist yeah
01:06 Grinnz for that you need context data that could only be stored in an overloaded object
01:06 pink_mist using a dualvar might work :P
01:06 Grinnz or variable magic
01:06 tinita well, I will implement this also, but for that I need to build a DOM with the original content ;-)
01:07 tinita and I have to fork myself for that to have time
01:19 Leffe joined #mojo
01:41 Ya_ALLAH joined #mojo
01:41 Ya_ALLAH >>> youtube.com/watch?v=X8qL6cAI0zQ <<<
01:41 Ya_ALLAH left #mojo
01:52 Ya_ALLAH joined #mojo
01:52 Ya_ALLAH >>> youtube.com/watch?v=X8qL6cAI0zQ <<<
01:52 Ya_ALLAH left #mojo
02:00 tinita pink_mist: hm, dualvar might actually work
02:02 tinita it could also fork for things like 0xa
02:03 tinita so that it gets dumped as 0xa again instead of 10
02:03 Ya_ALLAH joined #mojo
02:03 Ya_ALLAH >>> youtube.com/watch?v=X8qL6cAI0zQ <<<
02:03 Ya_ALLAH left #mojo
02:03 tinita *sigh*
02:04 Leffe joined #mojo
02:04 tinita a couple of hours ago i was praising IRC on perlmonks.org...
02:14 Ya_ALLAH joined #mojo
02:14 Ya_ALLAH >>> youtube.com/watch?v=X8qL6cAI0zQ <<<
02:14 Ya_ALLAH left #mojo
02:58 ilbot2 joined #mojo
02:58 Topic for #mojo is now 🍩 nom nom | http://mojolicious.org | http://irclog.mojolicious.org | http://code-of-conduct.mojolicious.org
02:59 aborazmeh joined #mojo
03:14 jberger I love that its so easy to perl -i on the convos logs and nuke that crap
03:55 mohawk i for one welcome our new /ignore overlords
04:00 jberger do we have a recommended length for secrets?
04:23 Leffe joined #mojo
04:31 mohawk jberger, the blog post with the delay stuff cut out: https://gist.github.com/mohawk2/9aa59612601133d298eca6426ed960fd
04:32 jberger sweet!
04:33 mohawk ha ha!
04:33 mohawk is it up to the standard you need, or more tweaks still?
04:34 jberger oh I haven't read it over yet, just skimmed
04:34 mohawk ha ha, ok
04:34 mohawk well, if you could QA and accept/reject it while it's still in my head, that will help as it'll then be sorted
04:35 jberger maybe I should, if it is up to it it could go out for tomorrow
04:35 jberger my current post is a ways away, and while I would make it, it would be nice to call it an early evening :-P
04:35 mohawk that would be a win for both of us :-)
04:36 jberger while I read it, can you put together a two sentence blurb about yourself for the bottom of the post
04:36 mohawk sure
04:36 jberger and I know you aren't big on pictures of yourself, but do you have an avatar or something?
04:36 mohawk i'll add it to the bottom. feel free to format suitably
04:37 mohawk uh, not really :-(
04:37 mohawk i should probably make one
04:37 jberger It doesn't need one, I suppose, but it would fit for consistency
04:37 jberger your choice
04:37 mohawk another time (sigh, sorry)
04:38 jberger I mean, mohawk does sorta lend itself to a certain ... something
04:38 Leffe joined #mojo
04:38 mohawk ha ha
04:39 mohawk that was only ever a happy accident
04:39 mohawk when i came back to coding, i wanted to go on irc to ask a question about gimp
04:39 mohawk didn't want to install an irc client in case it didn't lead anywhere
04:39 mohawk went on mibbit, and they suggested a random name starting with "m", that being their branding thing
04:40 mohawk i kept the same nick over time so people would know it was the same person
04:40 mohawk and i've stuck with it
04:42 jberger ha
04:42 jberger I was surprised when I met you that the hair didn't match
04:42 mohawk ha ha!
04:42 mohawk i've never had hair that interesting
04:42 mohawk i've added a blurb at end, please refresh
04:43 jberger http://museprintables.com/images/propstoprint/mohawk-photo-booth-prop.png
04:43 jberger copyrighted tho
04:44 mohawk ha ha!
04:44 ghenry joined #mojo
04:44 mohawk if i did make an avatar it would be a drawn doodle, and those take a surprisingly long time if you're rubbish at drawing
04:48 jberger I might want to touch up some of the language, repeated use of "things" and "happens"
04:48 jberger would you mind?
04:48 mohawk no, that's fine
04:48 jberger and your example, I so want you to use __SUB__ and require 5.16, but that's probably more work explaining than it is worth
04:49 mohawk KISS ;-)
04:49 jberger kinda complex first example too, isn't it?
04:50 mohawk it's from the cookbook?
04:50 mohawk you mean the $fetch one?
04:50 jberger yeah
04:50 mohawk woops, i left a $delay - zapping
04:50 jberger heh, I didn't even notice :-P
04:50 mohawk done
04:51 mohawk i don't know why the author of that had to use a "my" and a coderef. a named function is just fine, surely
04:51 jberger so you talk about things being in succession, almost like blocking code, but then you give an example with only one then, that trampolines
04:52 mohawk yes, true
04:52 mohawk i've also just remembered that there was supposed to be talk and then/catch/finally
04:52 mohawk "talk and" -> "talk about"
04:52 jberger like if you could whip up a quick super-simple linear one first and then just with a two line break you could use that to show how they scale
04:53 mohawk hm, what would it be for, getting a web page?
04:53 jberger like maybe two sequenial requests
04:54 jberger $ua->get_p('/url)->then(sub{ say $tx->something; return $ua->get_p('/other') })->then({ say something })
04:54 jberger then they see your point about linearizing
04:55 mohawk that's what the given example does, though?
04:55 jberger and then when they see the exapmle that is currently the first one, it can be the "more complex" one that they don't feel they need to grok
04:55 jberger I know
04:55 jberger but they won't
04:55 mohawk oh, so you're saying first a single stream
04:55 jberger right
04:55 mohawk with 2
04:56 jberger exactly
04:56 mohawk then the existing one which is parallel streams
04:56 mohawk ok
04:56 mohawk and i'll introduce the non-official term "stream" a bit better, which i use later
04:56 jberger you are trying to punch home the line "The resulting code reads like sequential, synchronous code, even though it runs asynchronously:"
04:57 jberger then you can move to the example you have with something like "and the great thing is that this scales out very easily to many requests even in "parallel""
04:57 jberger or some such
04:58 mohawk i'm going to do it slightly different
04:58 mohawk only slightly though! "hold my beer"
04:59 jberger hehe
04:59 jberger I won't make you repeat my whole post here, but you can see how I built it up http://blogs.perl.org/users/joel_berger/2013/11/writing-non-blocking-applications-with-mojolicious-part-2.html
05:00 jberger but do it as you will
05:00 mohawk i'd like to think i do the building up thing with the real bit at the end
05:00 inokenty-w joined #mojo
05:01 jberger I just want to be sure that newcomers who've never seen this before get a taste before a whole meal
05:01 mohawk anyway, i'll just finish this draft
05:01 jberger sure
05:01 mohawk i'm very happy to keep improving this under your expert guidance :-)
05:01 jberger I don't know if I'd say expert
05:01 jberger but I do spend a lot of time thinking about pedagogy
05:02 bjakubski joined #mojo
05:03 irqq joined #mojo
05:07 jberger can you clarify what your examples are doing with suffixes?
05:07 mohawk sure, will add something
05:07 mohawk while i type this in, if you could tell me which bits you would update then i can do those myself :-)
05:08 jamesaxl joined #mojo
05:08 jberger specifically those first few sentences of background need some precision
05:09 jberger too much "something" and "happen" and "thing(s)"
05:12 jberger The essence of non-blocking code is rather than waiting for some result to be ready, you tell the framework what you want to happen once it is. In the meantime, the framework can then spend the time doing other tasks.
05:12 jberger (this is why it takes hours for me to write a post :-P)
05:13 mohawk ha ha
05:13 mohawk gotcha, ta
05:14 Leffe joined #mojo
05:25 mohawk ok, added the 2 thens and catch/finally
05:25 mohawk now going to update the bg
05:29 mohawk jberger, updated
05:29 mohawk i will now re-read :-)
05:30 mohawk dangit, the "placeholder" bit still needs more tweaking
05:31 mohawk done
05:33 jberger should "Another option for dealing with a number of concurrent activities, if you just want the first one that completes, is race." go after the example rather than before it?
05:33 jberger since that example doesn't use "race"?
05:34 mohawk just did that :-)
05:34 jberger and maybe say "get_p is like get but returns a promise rather than taking a callback"
05:34 mohawk on it
05:35 jberger getting pretty close though
05:36 mohawk to quote duffman: OH yeah
05:36 mohawk added a snippet after the code with that
05:37 mohawk i think i'll zap the reference to the "cookbook" and just put it at the end as a "see also"
05:38 jberger while you do it, can you make the references to documentation in mojo point to mojolicious.org rather than metacpan?
05:39 jberger got a preference of image between https://www.flickr.com/photos/hellokayla/2462794723 and https://www.flickr.com/photos/elsabordelossegundos/15418211523 ?
05:39 jberger for the banner?
05:39 jberger or neither
05:40 mohawk second one seems even sweeter than the first
05:40 mohawk let's go with that
05:40 jberger but there isn't a rich pool of pinky swear/promise with a permissive license online
05:41 jberger ok
05:41 mohawk big softy that i am
05:42 mohawk updated
05:45 mohawk i'll add a link to the Command version too :-)
05:46 mohawk i think that's it
05:53 dod joined #mojo
05:55 mohawk sri, is it possible to make the get_p a bit more "promise-y" by eg having it "reject" if !$tx->result->is_success else "resolve" with $tx->result?
05:56 mohawk doh, the doc suggests it already does?
05:57 mohawk or maybe that's only for a connection error
05:57 mohawk at least there could be $tx->result_p that behaved as above
05:58 geospeck joined #mojo
05:59 dod joined #mojo
06:01 Grinnz http error codes aren't always necessarily going to be an error, depends on the api
06:01 Grinnz so its up to the user to decide that
06:01 mohawk true
06:20 Vandal joined #mojo
06:29 jberger https://twitter.com/joelaberger/status/941193433510809609
06:29 jberger mohawk++
06:30 mohawk take a bow jberger!
06:30 jberger me?! its your day man
06:30 mohawk too kind
06:31 mohawk (no, seriously, too kind ;-)
06:33 jberger argh, typo in the tweet
06:33 jberger hold on
06:34 jberger https://twitter.com/joelaberger/status/941194500424241153
06:34 jberger now with less typo!
06:34 mohawk pesky promise vs Promise
06:36 jberger and tell vs tells (which was actually the one I felt it worthy to fix)
06:36 jberger the capitalization came along for the ride
06:47 jberger preaction: you still on for tomorrow night's post?
07:03 Leffe joined #mojo
07:14 dod joined #mojo
07:21 jkp joined #mojo
08:11 ghenry joined #mojo
08:28 McA joined #mojo
08:28 karjala_ joined #mojo
08:52 mohawk joined #mojo
09:27 tyldis The Mojo Advent calender is top notch. Thanks a lot foryour effort!
10:00 karjala_ How can a route handler properly handle the exceeding of max_request_size? Mojolicious produces error 500 or so before the route handler has a chance to produce its own more descriptive error
10:00 karjala_ most of the times, this happens
10:01 karjala_ so I can't find a way to customize this type of error
10:01 karjala_ maybe this could be fixed in a future version of M?
10:03 karjala_ Use case: The site I'm making accepts file uploads, and I'd like if the user sends more than 200MB to return a JSON 4xx error to the user, which JS can parse
10:05 sri mojolicious doesn't do that
10:07 karjala_ I'll check again.
10:08 sri it's literally in the tutorial http://mojolicious.org/perldoc/Mojolicious/Guides/Tutorial#File-uploads
10:12 ghenry joined #mojo
10:27 McA Hi all. When I start the app with -p (reverse proxy) how can the app access this information? It seems I'm too blind. (Yes, I found that a request has this information too, but I want it earlier in the app)
10:29 sri you can't, there is no connection from the app to the server at the moment
10:29 sri i wanted to add one, but so far nobody has proposed a nice enough way
10:31 nic McA: Perhaps there's a workaround....  are you on linux?
10:32 McA @sri: A pitty. But I'm happy I'm not too stupid in searching the docs and code
10:32 sri jberger/mohawk: don't you think you should make the examples a little more runnable? like, at least instantiate a Mojo::UserAgent?
10:32 McA @nic: Yes I'm on Linux
10:33 nic McA: How do you start up your app?
10:33 nic (for this particular use-case)
10:34 McA Mojolicious::Commands->start_app('MyApp');
10:35 nic ah, I've never used that way.  When you do that, what do you see for "ps aux | grep MyApp | grep -vw grep" ?
10:36 nic I thought you said you passed "-p"
10:36 Leffe joined #mojo
10:38 McA @nic: Just a moment
10:39 McA @nic: I see what you want to do. You're right. This can be a possibility.
10:40 nic Unfortunately, what you get on the effective commandline depends on how (using which server) the app is started up
10:41 nic morbo is especially secretive about what the original commandline was
10:41 McA ok
10:44 McA Another question: How can I exit the app while being in controller code? An exception is catched.
10:44 nic shutdown the server?
10:44 nic (if so, kill)
10:49 McA I thought of a clean shutdown method.
10:52 Afristar joined #mojo
10:58 McA Is there really no way to cleanly exit the request-response-loop within the app itself?
10:59 sri in case anyone feels like RFC reading and hacking on some of the easier parts of the mojo http stack https://github.com/kraih/mojo/pull/1163
10:59 sri some parts of that are real bugs
11:11 karjala_ sri, regarding my previous problem, a minimal demo: https://gist.github.com/akarelas-pt/892ba328a43ab0b14128ca82459279b5
11:12 karjala_ When the limit is 10kB, uploading 100kB works very well (as mojolicious docs show), but uploading 100MB (as I describe in the gist) fails with an error screen on my browser
11:14 dexteruk joined #mojo
11:14 karjala_ but when limit is set at 200MB, then browser request succeeds with exceeded: 0
11:15 tchaves joined #mojo
11:15 sri karjala_: if that's the case then it might be a bug
11:15 karjala_ :)
11:15 karjala_ glad I found something
11:16 sri please open an issue so it doesn't get forgotten
11:17 sri don't think i'll be able to look into it anytime soon, so volunteers would be good
11:20 dexteruk Hi everyone im trying to duplicate a curl request in mojo useragent. https://paste.ee/p/Fk5Az  but i get the responce mine: no media type
11:21 dexteruk I have duplicated everything in useragent but i cannot see why it would be give me this error at least according to the documentation
11:22 CandyAngel dexteruk: You can set UA debugging on to see exactly what is being sent
11:22 Leffe joined #mojo
11:22 CandyAngel dexteruk: http://mojolicious.org/perldoc/Mojo/UserAgent#DEBUGGING
11:22 CandyAngel Oh, I guess you are already, sorry
11:23 CandyAngel (was looking at 1163 :P)
11:25 CandyAngel Are you uploading different files?
11:26 dexteruk no same file
11:27 CandyAngel That PNG compresses super well then..
11:27 dexteruk ah yes
11:27 dexteruk i left the compressed file of the paste
11:28 dexteruk in the curl the file is sent only after it gets a 100 continue back
11:29 dexteruk do you have to slurp the file before sending it?
11:29 dexteruk or does the form file, do that?
11:30 dexteruk because the curl length is much larger
11:30 dexteruk content length
11:30 purl content length is set correctly
11:31 CandyAngel the form content generator reads the file for you if you give it a path
11:31 CandyAngel The curl length is larger because it isn't being compressed
11:33 dexteruk could it be the compression that is causing the problem
11:33 dexteruk can i send it uncompressed in the UA
11:33 CandyAngel Just checking you are using the form generator correctly
11:34 dexteruk i pasted the $ua->post()
11:34 dexteruk so you can compair the syntax
11:35 dexteruk it seemed quite clear in the documentation
11:35 CandyAngel Supposed to be form => {file => {filename => '...'}} I think..
11:35 dexteruk ok it made it look quite stright forward
11:35 sri CandyAngel: only responses can be compressed
11:36 sri since an http server can't advertise in advance that it supports compression
11:36 dexteruk yes i have tried it with and without []
11:37 CandyAngel my $tx = $t->tx(POST => 'http://example.com' => form => {mytext => {file => '/foo.txt'}});
11:38 ChmEarl joined #mojo
11:38 CandyAngel dexteruk: Actually, there is a key difference
11:39 CandyAngel curl is doing multipart/form-data, Mojolicious is doing form-data..
11:39 dexteruk so i can add multipart =>
11:39 CandyAngel There is a multipart content generator.. was added fairly recently I think
11:40 itaipu joined #mojo
11:40 CandyAngel But I'm pretty sure you're not actually sending the file :P
11:40 sri the content-length is too different, there is a more fundamental problem
11:41 CandyAngel Mhm
11:42 CandyAngel Looks like you are sending different files by the filename anyway..
11:42 karjala_ bug submitted
11:43 dexteruk yes one i generated dynamically by the /get function
11:43 dexteruk the curl is just using one of these created files
11:43 dexteruk but i have tested the same file after its been created by the get function
11:43 dexteruk with curl and it works
11:44 dexteruk so i have made sure the png file itself is not corrupted
11:47 dexteruk # Send "multipart/form-data" content via PUT
11:47 dexteruk $ua->put('upload.example.com' => form => {test => {content => 'Hello World!'}});
11:48 CandyAngel dexteruk: Use a quick test script to upload the same file via M::UA
11:48 sri and opened https://github.com/kraih/mojo/issues/1165
11:48 sri looking for volunteers
11:48 dexteruk OK
11:48 dexteruk i will write one
11:50 karjala_ sri: Where can I upload an image (screenshot of the browser error I see) so that it stays forever?
11:50 karjala_ or anyone else, for that matter
11:51 dexteruk ifps
11:51 dexteruk ipfs
11:51 karjala_ lol
11:51 dexteruk decentalised file system
11:51 sri karjala_: you can drag and drop images into github comments
11:51 sri but there is no need
11:52 sri i have confirmed the problem
11:52 karjala_ ok then
11:52 sri two bugs looking for volunteers now
11:52 sri both in the http stack, fun
11:55 CandyAngel sri: Isn't it just a case of adding another line to fix_headers?
11:56 sri CandyAngel: maybe
11:57 CandyAngel Hm, maybe not. ::Message doesn't know what the HTTP code is
11:57 CandyAngel Or it does and I'm rushing thinking this through >.>
11:59 CandyAngel Yeah, being stupid. It does know..
12:03 CandyAngel So yeah, I guess: $headers->remove('Content-Length') if $self->code =~ m/^(?:1\d{2}|204)$/; in ::Response::fix_headers()..?
12:06 sri CandyAngel: there's already a related is_ method i think
12:07 CandyAngel Is it supposed to be removed on 304 too?
12:07 CandyAngel is_empty could be used then
12:08 CandyAngel Doesn't say so in the RFC..
12:09 CandyAngel Oh
12:09 CandyAngel It could be if $self->is_info || $self->code == 204;
12:19 Leffe joined #mojo
12:22 dexteruk Hi Guys, ok i have created a test script
12:22 dexteruk https://paste.ee/p/lRVOG
12:23 dexteruk its giving me the same errors now you can see its getting the content-length correct
12:23 dexteruk its sending it as multipart/form-data
12:24 dexteruk however in the curl i see it asking for thei 100-continue
12:24 dexteruk then i see the server reply with 100 Continue
12:25 dexteruk and then the curl send the form-data
12:25 dexteruk Content-Disposition: form-data; name="file"; filename="8AF53B62-E0A4-11E7-9C6F-EFF04BFDC5F1.png".
12:25 dexteruk with Content-Type: application/octet-stream.
12:25 dexteruk the UA does not do any of this
12:26 dexteruk UA sends the POST
12:26 dexteruk does not wait for any kind of responce
12:26 dexteruk Content-Disposition: form-data; name="file"; filename="8AF53B62-E0A4-11E7-9C6F-EFF04BFDC5F1.png"
12:26 dexteruk and send the file
12:29 dexteruk i am using the same file in the exact same path
12:41 CandyAngel dexteruk: Change your 'form' content generator to multipart
12:41 purl CandyAngel: that doesn't look right
12:44 CandyAngel Hm.. I don't see anywhere where Mojo would generate the same headers anyway
12:46 CandyAngel dexteruk: Nevermind, was reading the wrong line.. I see the multipart/form-data bit
13:08 dexteruk I have tried LWP::Useragent that also works
13:13 CandyAngel Does it send the Expects: header?
13:14 dexteruk https://paste.ee/p/IBWxP
13:14 dexteruk no, here is the code
13:14 purl okay, dexteruk.
13:15 dexteruk in the LWP it send Content-Type: image/png. at the same time it send Content-Disposition
13:16 dexteruk Im sure im just missing something little
13:20 dexteruk CandyAngel: If i change the form to multipart mojo throws back an error uninitialized value $cb Transactor.pm line 121
13:20 ghenry joined #mojo
13:22 dexteruk Sorry to bother you with one
13:26 CandyAngel It's fine, it is submitting it as multipart how you had it in the paste anyway
13:27 CandyAngel You can build the transaction and add the Expect header, but I don't Mojolicious will wait for the response before sending the data
13:27 jberger Are you just missing the file's content type header?
13:27 CandyAngel But I don't think that should matter
13:27 CandyAngel Sorry, being distracted trying to figure out what my coworkers are doing -.-
13:27 CandyAngel They are messing everything up :P
13:28 jberger X-Stream-Error: mime: no media type
13:29 jberger Reading back that does seem to be your initial question
13:30 dexteruk that appears on all of them
13:30 dexteruk i guess that is a bug in the server said code not the UA
13:30 jberger Add it in the hash with filename
13:31 jberger http://mojolicious.org/perldoc/Mojo/UserAgent/Transactor#tx
13:31 jberger All the other keys in that hash are headers
13:31 dexteruk but on the curl and LWP they return {"Name":"8AF53B62-E0A4-11E7-9C6F-EFF04BFDC5F1.png","Hash":"QmdCPorQ9yZ3YzbReabNP3ivJKDzcK4FTb4rUu8dHmLN1n","Size":"7113"}
13:31 dexteruk the json
13:31 purl the json is Javascript Object Notation, at http://www.json.org/ or a good carrier for data in ajax or an obscenity, and its existence is an affront to the will of Allah or hateful because obj.toSource() doesn't generate compliant JSON data. or unicode or not the greatest format to type on the command line ;p
13:36 dexteruk jberger: yes in my original question i didnt realise where all returning the same error, but with the Curl and LWP
13:36 maschine joined #mojo
13:36 dexteruk i get the same error X-Stream-Error: mime: no media type. but i also get what i was expecting
13:37 dexteruk {"Name":"8AF53B62-E0A4-11E7-9C6F-EFF04BFDC5F1.png","Hash":"QmdCPorQ9yZ3YzbReabNP3ivJKDzcK4FTb4rUu8dHmLN1n","Size":"7113"}
13:37 dexteruk I do not get this with the Mojo UA
13:40 dexteruk with both curl and LWP after the Content-Disposition i get another content-type on curl its application/octet-stream and LWP its Content-Type: image/png.
13:40 dexteruk with mojo i dont see this at all
13:40 dexteruk and i have not found away to add it
13:40 jberger I just told you
13:40 jberger add it to the hash with the filename
13:41 dexteruk ok
13:42 dexteruk Yey that was it
13:42 jberger \o/
13:42 dexteruk whooo
13:43 dexteruk thank you guys sorry for the time
13:43 dexteruk its always much appreaciated
13:43 jberger no worries
13:43 dexteruk i know it would be something simple
14:06 Leffe joined #mojo
14:09 bwf joined #mojo
14:19 itaipu_ joined #mojo
14:20 gizmomathboy joined #mojo
14:26 good_news_everyon joined #mojo
14:26 good_news_everyon [mojo] jberger created content_length_rfc7230 (+1 new commit): https://git.io/vbVsM
14:26 good_news_everyon mojo/content_length_rfc7230 b8d21bb Joel Berger: Be more compliant with RFC7280 regarding Content-Length...
14:26 good_news_everyon left #mojo
14:33 Leffe joined #mojo
14:35 Leffe joined #mojo
14:36 yesWeCan joined #mojo
14:40 nic How I Learned to Stop Worrying and Love the Lite
14:41 nic Recently I hit a use-case where I need a kind of fat-packed app  <3
14:54 Leffe joined #mojo
15:01 good_news_everyon joined #mojo
15:01 good_news_everyon [mojo] jberger force-pushed content_length_rfc7230 from b8d21bb to a060424: https://git.io/vbVcp
15:01 good_news_everyon mojo/content_length_rfc7230 85d5ed5 Joel Berger: Be more compliant with RFC7280 regarding Content-Length in responses...
15:01 good_news_everyon mojo/content_length_rfc7230 a060424 Joel Berger: Be more compliant with RFC7280 regarding Content-Length in responses...
15:01 good_news_everyon left #mojo
15:02 jberger added some more tests and added a parallel for the request side
15:04 Kharec joined #mojo
15:05 Leffe joined #mojo
15:08 karjala_ Does there exist an extremely simple-to-use web-based .txt document manager/holder, that can show the diffs of the document from one version to the next?
15:08 Leffe joined #mojo
15:08 karjala_ would be useful for the specification documents of new projects, that change all the time
15:09 karjala_ (If not maybe I could make one)
15:09 pink_mist most wiki software?
15:09 karjala_ o
15:09 karjala_ kewl
15:12 gryphon joined #mojo
15:13 CandyAngel dexteruk: Sorry, I was probably more of a hinderance than a help -.-
15:14 ashimema joined #mojo
15:14 dexteruk CandyAngel: No, it was nice of you to give me some of your time
15:15 dexteruk CandyAngel: The Mojolicious community are the amongst the most helpful people i have come accross in the Open Source communityh
15:15 bellows joined #mojo
15:16 dexteruk I just wished people more people would understand that Mojolicious brings so much to the table and makes life so easy
15:18 CandyAngel Agreed on both counts :P
15:19 good_news_everyon joined #mojo
15:19 good_news_everyon [mojo] jberger force-pushed content_length_rfc7230 from a060424 to da70d9a: https://git.io/vbVcp
15:19 good_news_everyon mojo/content_length_rfc7230 da70d9a Joel Berger: Be more compliant with RFC7280 regarding Content-Length in responses...
15:19 good_news_everyon left #mojo
15:19 ghenry joined #mojo
15:19 CandyAngel I've never been shouted at for asking general, non-Mojo-related stuff.. maybe partly because I wait for it to be quiet before I do
15:20 CandyAngel but it's super hard not to ask, when there are such knowledgable people about :P
15:22 good_news_everyon joined #mojo
15:22 good_news_everyon [mojo] jberger force-pushed content_length_rfc7230 from da70d9a to 2c07fff: https://git.io/vbVcp
15:22 good_news_everyon mojo/content_length_rfc7230 2c07fff Joel Berger: Be more compliant with RFC7280 regarding Content-Length in responses...
15:22 good_news_everyon left #mojo
15:36 good_news_everyon joined #mojo
15:36 good_news_everyon [mojo] jberger force-pushed content_length_rfc7230 from 2c07fff to 8489511: https://git.io/vbVcp
15:36 good_news_everyon mojo/content_length_rfc7230 576480e Joel Berger: Be more compliant with RFC7280 regarding Content-Length in responses...
15:36 good_news_everyon mojo/content_length_rfc7230 8489511 Joel Berger: Be more compliant with RFC7280 regarding Content-Length in responses...
15:36 good_news_everyon left #mojo
15:40 geospeck joined #mojo
15:43 geospeck joined #mojo
15:51 karjala_ joined #mojo
16:38 kes joined #mojo
16:39 kes Hi. The end tag for 'tr', 'th', 'td' is optional: https://www.w3.org/TR/html401/struct/tables.html#edef-TD
16:39 kes is there a way to render these tags not closed?
16:40 sh14 joined #mojo
16:45 jberger kes, that's the HTML 4 spec
16:48 coolo jberger: in html5 too - https://www.w3.org/TR/html5/tabular-data.html#the-tr-element
16:49 jberger ok so that's permitted, is there any reason not to generate them?
16:49 jberger I'm assuming kes is asking about generating them
16:49 jberger because of course you can write anything you want
16:51 coolo jberger: I don't think so, no. this affects a lot of elements, but it doesn't make reading the generated html any easier
16:52 jberger kes: short answer I think is no
16:52 coolo e.g. <select><option>A<option>B<option>C</select>
16:55 gryphon joined #mojo
16:55 ghenry joined #mojo
16:56 kes jberger: the reason I want to escape closing tag: http://paste.scsys.co.uk/566160
16:58 CandyAngel kes: I don't see what is stopping you from implementing a helper that will do what you want..
16:59 CandyAngel You aren't forced to use "%= end" because there is a closing tag
16:59 CandyAngel It's because you are doing "begin"
16:59 kes without begin/end the tr tag willbe closed automatically
17:00 kes so I get: <tr></tr><td> ...
17:00 CandyAngel Oh I see, you want to do it with tr
17:01 CandyAngel Actually omitting them in the output sounds like a great way of having your site not render correctly :P
17:03 kes it is allowed by spec
17:03 kes so it MUST be rendered correctly
17:04 CandyAngel Unfortunately, not how reality works
17:05 jberger kes: but this is ultimately optional and a style choice, so as CandyAngel says, just make a different helper
17:05 jberger not rendering a close tag is not something Mojo core is likely to encourage
17:05 CandyAngel Can you make a helper that does like.. %= tr td(), td(), td(), td()
17:06 jberger or, again, just write the tags manually
17:06 CandyAngel Is this about making the template tidy or having control over what is actually output?
17:06 jberger there is very little magic in the mojo tag helpers for anything but input tags
17:09 kes I wanna to reuse 'tag' helper to not process arguments myself. but 'tag' auto close 'tr' tag when it is rendered.
17:10 kes so the only way to implement whole tag rendering myself?
17:11 jberger very sorry, but I think I'm going to put my foot down here, "because you don't wanna" to do something unusual and indeed something we don't want to encourage, isn't a good enough reason for us to change it
17:11 Grinnz karjala: gists also good for that, if you dont mind github hosting it
17:11 Grinnz or github wikis
17:11 purl github wikis are horrid
17:11 Grinnz heh
17:12 karjala ok
17:13 Pyritic joined #mojo
17:14 karjala Grinnz: you mean, i can place the image in a comment of a gist?
17:14 kes yes. I implement my own rendering. but it is good practice to reuse code if this possible. is not?
17:15 karjala i can't see how I can create a gist from an image
17:15 kes that is the reason I ask may I render tag without closing it.
17:15 good_news_everyon joined #mojo
17:15 good_news_everyon [minion] scottw opened pull request #62: Add worker dequeue_interval attribute to control the dequeue poll rate (master...master) https://git.io/vbViz
17:15 good_news_everyon left #mojo
17:16 Grinnz karjala: no, gists dont take images, i was referring to your question about versioned .txt
17:16 Grinnz karjala: for uploading images just use imgur
17:17 karjala oh ok
17:17 bif joined #mojo
17:17 good_news_everyon joined #mojo
17:17 good_news_everyon [mojo] jberger fast-forwarded master from 6341094 to 576480e: https://git.io/vbViS
17:17 good_news_everyon left #mojo
17:17 kes *I will implement (
17:18 geospeck joined #mojo
17:18 Grinnz kes: mojo is not going to implement leaving out closing tags. implement your own or write it in the template
17:18 karjala a kewl, (about gists)
17:19 sri ooh, i need this mug! https://www.forbiddenplanet.co.uk/hulk-fist-shaped-mug
17:23 * sri bangs hulk fist on table
17:23 Grinnz seems impractical when there's liquid in it :P
17:24 sri also, since when are pull requests announced on irc :O
17:31 good_news_everyon joined #mojo
17:31 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vbVX7
17:31 good_news_everyon mojo/master 4e674d8 Sebastian Riedel: update Changes
17:31 good_news_everyon left #mojo
17:39 dod joined #mojo
17:44 dod joined #mojo
17:56 good_news_everyon joined #mojo
17:56 good_news_everyon [minion] kraih closed pull request #62: Add worker dequeue_interval attribute to control the dequeue poll rate (master...master) https://git.io/vbViz
17:56 good_news_everyon left #mojo
17:56 sh14 joined #mojo
17:57 sri curious, i wonder if that's new or a setting i can enable for mojo too
17:57 Grinnz might have been cause his patch was on his master branch
17:57 sri although, close is kinda uninteresting
18:00 CandyAngel sri: Are you thinking of my PR? https://github.com/kraih/minion/pull/53
18:01 sri no
18:01 sri the one wher Grinnz fixed the sqlite backend
18:01 CandyAngel Ah
18:09 Grinnz sri: https://metacpan.org/source/SHANCOCK/Perl-Tidy-20171214/CHANGES it's a start
18:10 Grinnz good to see perltidy is still actively maintained
18:14 tyldis Does anyone in the Mojo community do on-premise training?
18:18 sri woot
18:19 tyldis Workshop-ish. Not too formal.
18:19 sri he said he'd release it on dec 14 and delivered \o/
18:21 sri tyldis: i think perl academy has a mojo training https://www.perl-academy.de
18:22 sri not sure if it's only german, hmm
18:23 tyldis I would want someone really into recent Mojo
18:24 sri reneeb is good, know him forever from the german perl community
18:24 sri don't know the training though
18:24 tyldis Okay, that's a good enough endorsement for me
18:25 tyldis Well, a workshop is more the kind of thing I'm looking for.
18:43 good_news_everyon joined #mojo
18:43 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vbV5s
18:43 good_news_everyon mojo/master c3b309d Sebastian Riedel: try the latest perltidy
18:43 good_news_everyon left #mojo
18:44 sri find . -name '*.t' -o -name '*.pm' -print -exec perltidy -pro=.../.perltidyrc -nst -b -bext='/' {} \;
18:44 sri btw.
18:48 sri perltidy now actually generates this, so promises are very usable now :) https://gist.github.com/anonymous/b27cb0aef2cbaca25f14d3e1c6bc3989
18:48 sri marcus: i know you wanted this very much
18:48 genio awesome
18:58 jberger while it is taking a little time, writing a "fetch" wrapper and redoing my work from the past couple days with it is MUCH more sane
18:59 jberger the wrapper is necessary because my app setup a bunch of handlers in jquery, like directing api requests to the appropriate server and tokens and things
18:59 jberger which is why I didn't just do that right away
19:02 Leffe joined #mojo
19:02 Grinnz that you were trying to make promises chains with .done and .fail makes your initial frustration make a lot more sense :P
19:03 sri yea, what fetch returns is a real promise
19:04 Leffe joined #mojo
19:06 * sri likes learning new tech from the browser vendor blog posts https://developers.google.com/web/updates/2015/03/introduction-to-fetch
19:07 sri they are usually pretty straight to the point
19:07 jberger one nit is that it doesn't have a handy way to go from data to query parameters
19:08 jberger but I already have a uri library in the page, so I just used that in my wrapper
19:08 jberger made an "init" key query that I remove and build into the url
19:08 jberger I use this one, even though it doesn't seem as well known, because it feels Mojo::URL-y https://github.com/derek-watson/jsUri
19:09 jberger not exactly of course, but the way it thinks
19:09 sri bye bye net neutrality in the us
19:09 jberger sigh
19:09 jberger that fucker was never going to listen
19:09 jberger this whole thing was always a charade
19:09 sri yea
19:10 jberger his extreme arrogance of it means there might actually be some chance to bring it back whenever we get a sane administration again
19:10 jberger this has clearly been his ego and this cronies vs everyone, the next administrator will be able to use that alone as fuel to attempt to go back
19:11 jberger s/this/his/
19:11 sri it's just about money
19:11 jberger plus you KNOW that one of the big ISPs is going to step in it soon
19:11 jberger the only reason to remove net neutrality is to violate it
19:12 jberger so they'll do it, giving a perfect case example of why the rule is needed
19:12 jberger sucks that the GOP can't learn anything without it being demonstrated to them
19:12 jberger but I'll stop now
19:14 genio we already went down that path though. the whole big FU to netflix and everything. we already _know_ they'll violate it.
19:14 genio this is more willful, spiteful ignorance.
19:16 Kharec joined #mojo
19:18 ftwrob joined #mojo
19:19 geospeck joined #mojo
19:21 jberger not even that
19:21 jberger ignorance implies no knowledge, willful or not
19:21 Kharec left #mojo
19:21 jberger this is spiteful <word for not caring>
19:22 disputin joined #mojo
19:23 Kharec joined #mojo
19:31 Grinnz no i think ignorance is the right word. literally ignoring the facts
19:32 genio choosing not to understand how something works before you gut the things that protect it is more what I was referring to.
19:34 Seth joined #mojo
19:36 Grinnz intentional ignorance is a recurring concept in politics these days
19:40 geospeck joined #mojo
19:43 sri i love vscode
19:44 genio I've found myself using it a bit more lately
19:44 sri in the new update if you go open the terminal and pipe anything to code "ls | code" it pops up as a new file in vscode
19:45 sri it's these small things
19:46 jberger see I disagree, I think he knows quite well what will happen, he wants that thing to happen, this is intentional
19:46 sri wish there was an intellisense extension for perl
19:47 jberger on a different topic, can I seek the knowledge of the channel on how to do one more browser promise/fetch thing?
19:47 sri apparently it's not even that hard
19:47 Grinnz jberger: i think that's in agreement with what I'm trying to say. he's intentionally ignorant of the consequences because he wants them
19:47 jberger so response.json() returns a promise
19:47 sri you write intellisense extensions as server in any language you like, speaking a simple vscode protocol
19:48 sri so you can have a perl intellisense server doing stuff with your project
19:48 jberger well, before I ask, I'm going to try a few things
19:51 Leffe joined #mojo
19:56 jberger ok I got it
19:57 jberger I still feel like I've got some arrow coding going on
19:57 jberger but it finally all works as it is supposed to \o/
20:05 Pyritic joined #mojo
20:36 bif I have a Minion question perhaps someone might be able to help with. Here is a simple job injector and worker: https://gist.github.com/scottw/18a95ddaab44837e92526cdbc93d4275
20:37 bif If you look at the output, you'll see that the jobs are handled every 5 seconds.
20:38 bif While the "delay" property is being met for the jobs, this bursty property of handling all available jobs at once is undesirable in my situation.
20:40 bif Anyone know how I can get my worker to take and run jobs when their delay time is up, rather than rounding up to the next 5s?
20:52 marcus sri: Wish there was https://langserver.org/ for perl
21:02 disputin joined #mojo
21:12 Pyritic joined #mojo
21:26 Seth joined #mojo
21:27 sri marcus: yea!
21:27 sri didn't know that was so organized already :o
21:27 berov joined #mojo
21:29 * sri tweets that link
21:30 sri you'd think some PPI folks would be all over that
21:34 sri i wish these modules would use an import flag for the monkey patch part https://metacpan.org/pod/Mojo::IOLoop::Thread
21:34 Seth joined #mojo
21:34 sri like use Mojo::IOLoop::Thread -infect; or so
21:37 jberger yeah, that's pretty gross
21:37 jberger I get why they do it, but yeah, would be much more polite with a flag
21:38 Grinnz i prefer my solution https://metacpan.org/pod/Mojo::IOLoop::Subprocess::Sereal
21:39 Grinnz (stolen from Safe::Isa)
21:39 jberger sure, but the monkey patch is necessary if third-party code uses subprocess by name and you are on say windows
21:40 Grinnz then you can have a flag that infects the existing method :P
21:41 itaipu joined #mojo
21:45 Grinnz I tried to think of a way to make a role version of that module, so it could be composed with other modifications to the subprocess method, but can't think of a way to make it work out right because of how it's structured
21:47 Grinnz mainly, it's a method and not a class that i'm trying to modify the behavior of
21:57 good_news_everyon joined #mojo
21:57 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vbwsI
21:57 good_news_everyon mojo/master ec7f9e0 Sebastian Riedel: improved subprocess method in Mojo::IOLoop to allow for easier role composition
21:57 good_news_everyon left #mojo
21:57 sri Grinnz: there you go
21:57 sri makes sense for custom serialization anyway
21:57 Grinnz :o neat
22:12 Leffe joined #mojo
23:02 Ya_ALLAH_Ya_Muhmd joined #mojo
23:02 Ya_ALLAH_Ya_Muhmd left #mojo
23:07 good_news_everyon joined #mojo
23:07 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/vbw8t
23:07 good_news_everyon mojo/master 91e1de5 Sebastian Riedel: Gratipay is shutting down
23:07 good_news_everyon left #mojo
23:36 Leffe joined #mojo
23:51 Seth joined #mojo

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