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

IRC log for #mojo, 2017-07-21

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

All times shown according to UTC.

Time Nick Message
00:25 marty joined #mojo
00:46 schelcj joined #mojo
02:08 noganex joined #mojo
02:09 genio https://github.com/libuv/libuv/blob/v1.x/test/test-poll.c#L296-L301 Shouldn't that actually have data in buffer before sending?
02:11 arcanez jberger: jkm says there might have been some sort of inside joke but he doesn't remember now, in regards to 'joel is a slug'
02:15 genio I'm guessing it sends whatever gobblygook is in memory since the array hasn't yet been initialized and that means I should just throw some crap in the Perl buffer equivalent?
03:53 karjala_ joined #mojo
03:57 karjala_ joined #mojo
04:18 prajith joined #mojo
06:16 dod joined #mojo
06:23 dod joined #mojo
06:49 zach if you wanted to have mojolicious know what browser someone was using and log it, how would you get that within the app?
06:57 AndrewIsh joined #mojo
06:58 inokenty-w joined #mojo
06:59 dabudabu zach: $req->headers->user_agent I guess
07:04 karjala_ joined #mojo
07:09 CandyAngel Well, that would tell you what browser the browser claims to be, not guaranteed to be what it actually is :P
07:12 mib_rdaom7 joined #mojo
07:19 kimoto joined #mojo
07:19 zach well, I'm not THAT concerned about them saying they're using google safari 10.10
07:27 Vandal joined #mojo
07:33 trone joined #mojo
07:37 sri anyone else feel like voting? https://github.com/kraih/mojo/pull/1108
07:42 arcanez haha
07:42 arcanez Joel is a slug
07:45 zach I don't get what slugify is
07:45 arcanez zach: https://docs.djangoproject.com/en/1.11/ref/utils/#django.utils.text.slugify
07:46 arcanez it's kinda a newspaper-ish term
07:46 arcanez or at least publishing
07:46 arcanez https://en.wikipedia.org/wiki/Slug_(publishing)
07:46 zach oh
07:47 arcanez django has had it (probably from the beginning), due to their roots
07:47 mtths joined #mojo
07:47 arcanez starting at a newspaper
07:48 arcanez huh, nor Jacob or Adrian are mentioned on the wikipedia page for django
07:48 arcanez oh wait, Adrian and Simon are
07:54 good_news_everyon joined #mojo
07:54 good_news_everyon [mojo] kraih pushed 2 new commits to master: https://git.io/v7ULP
07:54 good_news_everyon mojo/master 71ed745 Dan Book: slugify util function
07:54 good_news_everyon mojo/master 99bf694 Sebastian Riedel: Merge pull request #1108 from Grinnz/util_slugify...
07:54 good_news_everyon left #mojo
07:54 zach for some reason I thought when you go to some site and make something like that link above here
07:54 zach the git.io/whatevel
07:54 zach like where you make some token that translates to a route
07:55 arcanez that's short url
07:55 zach lol I like how the bot enters to announce stuff and then shamefully leaves
07:55 * arcanez hides join/parts, so I just see good_news_everyon when sri commits
07:55 sri Joel is a slug \o/
07:55 zach Maybe we need a Wernstrom
07:56 zach :P I saw that too
07:56 arcanez zzz time, nearly 0100
07:57 * arcanez will hopefully be able to play with Mojolicious::Plugin::OpenAPI tomorrow
07:59 dod joined #mojo
08:01 zach yeah it's 1am here and I'm losing it too
08:02 good_news_everyon joined #mojo
08:02 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/v7UtV
08:02 good_news_everyon mojo/master d2ac34a Sebastian Riedel: update Changes
08:02 good_news_everyon left #mojo
08:02 zach sri: whereabouts are you?
08:02 sri germany
08:02 arcanez auf deutschland
08:03 zach ah
08:04 zach california
08:04 purl somebody said california was druggy druggy druggy druggy druggy druggy druggy. or smoggy and crowded. or the land of the shiny happy people or degenerating or home of one of the most beautiful stretches of coast in the US (PCH from Santa Barbara to Santa Cruz) or (: california people) or the granola state or the land of fruits and nuts or on the Left Coast
08:04 zach lolwut
08:11 arcanez AZ
08:11 arcanez &
08:11 arcanez purl: me?
08:11 purl you are wishing the bot was omniscient rather than actually fixing the bloody factoids or wishing he was still a pineapple or also the ctcp burglar or a mega blog slacker or a forgetster or packing jhannah's donkey or an evildoer or learning mysql or quick with the mouse or old or a contributor to DBIC or here from the past to give you good perl advice or Mr. Non-Sequitur
08:11 arcanez purl: good bot
08:11 purl :)
08:37 gregf_ joined #mojo
08:54 prg joined #mojo
08:55 rshadow joined #mojo
09:05 stryx` joined #mojo
09:51 zerah joined #mojo
10:23 petru joined #mojo
10:35 necrophcodr joined #mojo
10:35 necrophcodr https://pastebin.com/R5nVev5C
10:36 necrophcodr 'Premature connection close'
10:36 necrophcodr I know this is probably a common and boring issue, but I'm having problems wrapping my head properly around the non-blocking stuff, and the tiny code I pasted presents the error above.
10:37 sri http://mojolicious.org/perldoc/Mojolicious/Guides/FAQ#What-does-Premature-connection-close-mean
10:40 necrophcodr sri, i did read it, but as i mention i'm having trouble wrapping my head around the non-blocking stuff.
10:40 necrophcodr the server sure doesn't close early, so i guess it gets destroyed? but i don't know how to work around that.
10:40 necrophcodr i'm afraid i don't even understand why.
10:41 sri my $ua needs to be outside
10:41 sri you're just throwing it away at the moment
10:41 necrophcodr oooh, shit you're so right! that was a lot more obvious than i thought.
10:41 necrophcodr sri, thanks, i'm sorry for wasting you guys' time! :D
10:57 kes joined #mojo
10:57 nicomen the "keep a reference to $ua outside" thing is a very frequently given answer to that FAQ ;)
11:34 itaipu joined #mojo
11:52 kaare joined #mojo
11:57 itaipu joined #mojo
12:00 tchaves joined #mojo
12:23 bianca joined #mojo
12:50 tchaves joined #mojo
13:14 gizmomathboy joined #mojo
13:40 PryMar56 joined #mojo
13:41 tchaves joined #mojo
13:44 kes Hi. Should I do something special to force morbo another worker if current one is died?
13:45 kes *to force morbo start another worker
13:47 bjakubski joined #mojo
14:02 arcanez kes: ?
14:03 kes http://paste.scsys.co.uk/564661
14:04 kes and there is no any messages on the console where I run `morbo bin/app`
14:05 kes I CTRL+C and run morbo again.
14:05 kes I thought that morbo monitor worker and rerun it again if that worker dies
14:08 rick_soc joined #mojo
14:09 rick_soc good morning
14:09 purl For you maybe.
14:09 rick_soc I love you purl
14:10 arcanez kes: morbo is the dev server. hynotoad might do what you're expecting, but I don't know
14:11 rick_soc I need some advice.  I've got the I18N plugin running just fine, now what I would like to do is add a dropdown list to my page with the langauges I'm supporting
14:12 kes hypnotoad do not reload workes if sources are changed
14:12 arcanez correct
14:13 arcanez kes: why are you sending ABRT to the morbo process?
14:16 kes that for testing purpose: Will morbo restart worker or not
14:17 arcanez I think you have your answer?
14:18 kes no
14:19 kes I do not know how to force morbo to restart died worker
14:21 kes Actually I debug application. When I want to restart query I just quit current worker ( 'q' debugger command) and expect morbo restart it
14:27 petru_ joined #mojo
14:32 zivester joined #mojo
14:43 arcanez Could not load document from data://main/api.json: api.json could not be found in __DATA__ section of main.
14:43 arcanez all I did was copy the SYNOPSYS of Mojolicious::Plugin::OpenAPI
14:49 arcanez I guess throwing it all into a .psgi and morbo'ing it doesn't do 'package main;' by default /shrug
15:15 jberger yeah, I have no idea how __DATA__ , package and .psgi files would play together
15:18 sri morbo is also not a psgi server
15:18 purl okay, sri.
15:25 arcanez yeah, I guess I shouldn't have an extension on my lite apps.. or just make full apps
15:26 arcanez ::Plugin::OpenAPI will force me to write a full app
15:27 sri if it's just the extension it doesn't matter
15:27 sri just PSGI code won't work
15:34 jberger arcanez: M::P::OpenAPI does work in lite apps but by the time you get to any real size (which presumably you will, because your app is large enough to want an openapi spec) then you really should go for full
15:35 jberger and no, I didn't see the morbo in the question above, I assumed (incorrectly) that arcanez was using plackup or something because of the .psgi extension
15:35 jberger that one's on me
15:44 arcanez sri: it's just me being dumb and throwing .psgi on because I'd written raw before..
15:44 jnbek joined #mojo
15:45 arcanez but morbo+ M::P::OpenAPI synopsis didn't work until I put 'package main;' in, which I figured would have been the implicit 'default' anyway
15:45 arcanez but now I'm going to create a full app and make the json a file, so moot
15:46 sh14 joined #mojo
15:46 karjala_ joined #mojo
15:46 sri main wouldn't work as soon as you have two lite apps loaded at the same time
16:06 marty joined #mojo
16:11 good_news_everyon joined #mojo
16:11 good_news_everyon [mojo] kraih pushed 1 new commit to master: https://git.io/v7Tfk
16:11 good_news_everyon mojo/master 051aeab Sebastian Riedel: show an example for $ua going out of scope too early
16:11 good_news_everyon left #mojo
16:14 sri btw. i think we could really use more monitoring functionality
16:15 sri a simple way to figure out what the server is doing at the moment, which routes are the slowest...
16:15 petru joined #mojo
16:16 sri perhaps something with generic hooks to collect more metrics
16:44 * sri would really like something in core, but there's just no way to do it without xs deps
17:10 arcanez please tell me someone has written in.xs
17:14 schelcj joined #mojo
17:24 genio Grinnz: Did you get a chance to move any further along in the Reactor::UV?
17:25 genio I spent quite some time moving the huge test-poll.c they have into a Perl test last night.  I have to figure out what's going wrong in that now (although I think most of the problem is the test code).
17:25 Grinnz I don't know enough to really do anything else atm
17:27 genio Once I'm sure the new poll.t is correct and it's testing properly, I'll look back at Reactor and try to figure out what's going on.  ETOOMANYTHINGSTOLEARN
17:28 Grinnz with the arguments for the poll callback fixed, the only problem the test is running into is the segfault
17:28 genio I'm not sure who else to mention this whole fiasco to. I keep hoping someone with XS experience will review it and point out my stupid
17:28 Grinnz I could do some debugging to figure out exactly which part causes it but i don't really have time right now
17:29 genio Sounds good.  At this point I only see segfaults if I free something (UV's close() methods free memory in some cases) and then try to use it again
17:29 Grinnz that's the real difficulty of XS. so few people know enough perl internals to be able to help
17:29 genio and I've tried to work around most of those problems
17:30 genio LeoNerd helped out quite a bit with pointing out some things I was doing not so well and also providing the correct way
17:31 genio The rest of what I get is, "you could probably do <insert many words that all make sense individually> but I'm not sure how you'd do it there"
17:33 genio heh... I could always ask mlehmann for help.
17:35 Grinnz that could be educational, about a lot of things you didn't ask about, too
17:56 sri can't you use ffi instead of xs?
18:01 schelcj joined #mojo
18:08 zivester joined #mojo
18:10 trone joined #mojo
18:17 genio I could step back and attempt to figure out how to work with FFI for a lower level binding. It'd require some Perl on top to maintain state of callbacks pointing to the Perl user's callback, etc.
18:18 sri i was mostly just wondering why your first choice was xs
18:20 genio with a complex library like libuv I figured I'd _have_ to do some craziness to get other Perl objects into shape for working with the C. Many beginning XS things were out there, so... I tried.
18:21 genio Assuming I'd fail, I figured I'd flail about until I figured something out and move on to the next flailing.  I also assumed it'd go a bit more smoothly since there was EV to steal from
18:21 sri i see
18:21 genio Basically lots of assumptions that maybe weren't the best in hindsight. I also figured I'd get help once there was some semblance of things "working"
18:23 genio Again, assuming the reason why people haven't yet implemented it is because of all of hte annoying steps to go through. So, (with lots of help from preaction and some others) I chipped away at the steps. Alien::libuv, UV::Util, getting UV::Loop doing the right thing, getting UV::Timer behaving.  Now, I'm on the next complex problems, UV::Poll, which does lots of Socket stuff that I'm having to figure out properly.
18:24 genio in the end, it's a never ending attempt at implementing something I'm just learning.
18:25 genio Throwing away the XS I've written so far to try an FFI attempt won't kill me, but it's certainly going back and re-learning some of the beginning steps
18:25 karjala_ joined #mojo
18:26 genio Might indeed be best in the long run though.  I can't get help from C people about most of the C because they also have to know XS to understand the insane amount of macros you have to deal with.
18:26 sri re segfaults, did you get past this problem? https://metacpan.org/pod/Net::DNS::Native#INSTALLATION-WARNING
18:26 genio cuts the talent pool to get help from down TREMENDOUSLY
18:28 sri just thought of it, since i remember all the segfaults with the old UV module when you made a getaddrinfo call
18:29 sri (which uses the libuv thread pool)
18:31 genio sri++  # that explains a lot of the issues I was having with the request types.  I'll look into that
18:32 sri http://s2.quickmeme.com/img/1d/1da738e105f96db3f37cbbfc3dfd64203d756bad9dfdbb034f92ca9466140368.jpg
18:32 genio looks like I should be able to steal from their Makefile.PL a bit
18:36 genio FFI::Raw also requires 5.10
18:37 genio gah. $work thing I'm looking into at the moment is shortened to PPI and I keep typing FFI instead now.
18:47 csson joined #mojo
18:51 itaipu joined #mojo
18:54 maschine joined #mojo
19:17 itaipu joined #mojo
19:43 itaipu joined #mojo
19:44 arcanez if you set basePath to '' with M::P::OpenAPI, what is the url for the .html or .json route that renders your specification?
19:44 arcanez basePath of '/api' does /api.(html|json)
19:47 Grinnz you probably want '/'
19:48 Grinnz behavior with a base path of '' is probably undefined since it ends up creating a route for the path '' which is undefined behavior i believe
19:50 arcanez using "/" results in json output (in my web browser) instead of html, but I think it is correct
19:50 arcanez the accept header must be json
19:51 arcanez or json is default without one
19:59 arcanez "parameters": [ {"in": "path", "x-mojo-placeholder": ":", "name": "host", "type": "string", "required": true } ]
19:59 arcanez should match '/api/mapping/foo', right?
20:00 arcanez (basePath is '/api')
20:02 arcanez purl: seen batman
20:02 purl batman was last seen on #mojo 4 days, 2 hours, 24 minutes and 47 seconds ago, saying: need to register your app as a snap first thought.  [Jul 17 12:37:26 2017]
20:18 arcanez bah, my path was wrong, missing the {host}
20:55 batman arcanez: should ask in #swagger ...
20:55 batman anyhow, did you try /.html ?
21:12 arcanez no, I did not
21:45 jacobydave joined #mojo
21:58 lplp joined #mojo
22:08 genio Well, my tests are failing because I'm doing something stupid with IO::Socket::INET
22:11 pink_mist I'd suggest depending on IO::Socket::IP
22:11 pink_mist instead of ::INET
22:17 VVelox joined #mojo

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