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

IRC log for #mojo, 2016-07-01

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

All times shown according to UTC.

Time Nick Message
02:09 noganex joined #mojo
02:54 inokenty joined #mojo
03:08 jberger hmmm $c->req->json doesn't show up in any of the guides
03:09 jberger $tx->res->json only shows up in the Cookbook
03:09 PryMar56 joined #mojo
03:10 jberger I think I might put together a quick "JSON Service" section for the Tutorial (I'll PR it for comment)
03:14 jberger btw I have replied to the guy via email with (what I hope is) an olive branch
03:14 jberger I jumped too quickly too
03:14 jberger we know that posting a "me too" on an old thread is not proper but not everyone does
03:15 jberger the guy even has Mojolicious and his current version number on his site
03:46 good_news_everyon joined #mojo
03:46 good_news_everyon [mojo] jberger created tutorial_json_service (+1 new commit): https://git.io/voh5O
03:46 good_news_everyon mojo/tutorial_json_service 9397544 Joel Berger: add an example of a json service
03:46 good_news_everyon left #mojo
03:52 jberger I have opened a PR here for discussion, I'm happy to change things https://github.com/kraih/mojo/pull/978
03:56 good_news_everyon joined #mojo
03:56 good_news_everyon [mojo] jberger pushed 1 new commit to tutorial_json_service: https://git.io/voh57
03:56 good_news_everyon mojo/tutorial_json_service 34139f9 Joel Berger: improve the relevency of the JSON Services section
03:56 good_news_everyon left #mojo
05:38 inokenty-w joined #mojo
06:01 prajith joined #mojo
06:26 dod joined #mojo
06:48 dod joined #mojo
06:52 dod joined #mojo
06:58 AndrewIsh joined #mojo
07:01 trone joined #mojo
07:08 trone joined #mojo
07:13 Vandal joined #mojo
07:35 mdom joined #mojo
07:52 osfabibisi joined #mojo
07:52 ashimema I agree to marcus's comment, but otherwise it looks good to me jberger
07:57 batman jberger: i'm not sure about the command line example... it's useful, but i think i would rather 1) just focus on the server side 2) add a Mojo::UserAgent code example
08:12 val40 joined #mojo
08:16 jberger I wanted to make a usage example since it is explicitly trying to show how the request is handled
08:17 jberger But I could be convinced otherwise (say a comment somewhere)
08:17 jberger And yes marcus is right
08:19 salva joined #mojo
08:23 jberger Then again I think that the json pointer example is nice right after the previous section ends in one too
08:32 CHYC 08:41 [ JohnS] I've had my share of HPE lunches and other conferences and stuff I'd say this year. Otherwise if no one else volunteers, I'll give it a go.
08:32 CHYC 08:41 [ JohnS] :)
08:32 CHYC Urgh, sorry
09:03 nic http://jeffcarp.github.io/frontend-hyperpolyglot/
09:33 cuechan joined #mojo
09:46 prajith joined #mojo
10:21 kaare joined #mojo
10:58 tchaves joined #mojo
11:36 lluad joined #mojo
11:39 user_8587 joined #mojo
11:41 user_8587 my $tx = $tx->res->json;        $tx->{current_carrier}->{network_type};      $tx->{current_carrier}->{....}.
11:41 user_8587 How do you guys handle this?
11:41 user_8587 In rare cases some hashes are not filled and will cause in morbo to raise an exception
11:42 user_8587 if(defined($tx)) would just check if $tx is defined
11:42 nic What is that middle part trying to do?
11:43 pink_mist what is the last part trying to do?
11:43 pink_mist what is it that needs to be "handled"?
11:43 nic calling your json structure $tx is very confusing, btw.  Best not do that
11:43 user_8587 it's just a nested hash that has some numbers/values
11:43 user_8587 but sometimes they are undef.
11:43 punter joined #mojo
11:44 nic are you looking for 'exists'?
11:44 pink_mist do you need to validate it?
11:44 user_8587 validation is not needed
11:44 nic (we're still waiting for a question we can parse)
11:44 user_8587 {hash} //= ''; shall i use the operator before accesing it?
11:45 nic how about putting a small almost-working example in a pastebin?
11:46 user_8587 Hold on.
11:46 nic if (exists $json->{current_carrier}) {...}
11:47 nic my $network_type = ($json->{current_carrier} // {})->{network_type};
11:48 nic ofc I'm just guessing what the question is
11:49 pink_mist nic: that last bit is not needed at all unless you have 'no autovivification;' in scope
11:49 pink_mist (I think)
11:51 nic I don't like autovivification
11:51 nic for example, it stops 'exists' being a useful test
11:53 pink_mist eh, it only makes you write fragile looking constructs like the one you just showed :P that won't even protect against when the current_carrier value is something other than undef and a hashref :P
11:55 nic there's nothing fragile there.  You're misunderstanding something
11:55 user_8587 it's rather a perl question, but here is it. http://nopaste.linux-dev.org/?1119167
11:56 pink_mist so you do want to validate it
11:57 genio and for your sanity, don't name a variable "str" if it's going to contain a hashref
11:57 nic user_8587: no, don't assign to it, just use // in the check as I put above
11:58 nic I'd start with my $network_type = $json->{network_type} or die "..."
11:59 nic ... and ($network_type->{another_value} // '') eq 'Hello') {...}
12:00 user_8587 i see.
12:00 nic but you're right, #perl-help is one of the right places for those questions
12:02 mpapec joined #mojo
12:03 user_8587 right
12:11 * sri has to vote against https://github.com/kraih/mojo/pull/978#issuecomment-229931039
12:15 sri it's no good in context, the user agent is introduced in the tutorial already, but much later
12:17 jabberwok Hm, after spending a day or two researching for my current project I had come up with >> my $user_info = Mojo::JSON::decode_json($self->req->body); << because I never came across >> $c->req->json; << ... That does need to be much more obvious
12:19 jabberwok Where _would_ be a good place for what #978 says?
12:19 sri umm, Mojo::JSON::decode_json is fine, even better in one case
12:19 sri $tx->req->json has the weakness that it can't handle the json document "null"
12:22 sri jabberwok: don't know, but this exists... http://mojolicious.org/perldoc/Mojolicious/Guides/Tutorial#User-agent
12:24 sri btw. the guy is harassing me on twitter now https://twitter.com/real_currents/status/748700975385411584
12:24 * sri pokes jberger
12:31 gizmomathboy joined #mojo
12:32 Lee "after scanning the documentation" - W(hy)TF don't people acutal *read* the docs :/
12:33 genio sri: ugh. just do your best to ignore that guy.
12:33 prajith joined #mojo
12:48 genio I don't really understand Twitter.  That post doesn't show up on his page nor yours, nor do I find it when searching the "hashtags" he referenced.  I think I'm too old or something
12:49 sri because it's addressed at me, you should find it under "Tweets and replies"
12:53 genio ah.  So, when you address someone at the beginning of a tweet, it doesn't show up in the normal area, but in the special area.
13:10 Kripton joined #mojo
13:15 zivester joined #mojo
13:18 renormalist joined #mojo
13:20 Kripton joined #mojo
13:21 irqq joined #mojo
13:44 Grinnz genio, yeah that's why you see the ".@somebody" thing sometimes, like people do "./something" in irc
13:44 Grinnz it's ... not the greatest system
13:55 Adura Should be @@ like // on IRC.
13:56 Grinnz heh
13:58 sri mishanti1: omg, the apple repair guy who's youtube channel you recommended to me is getting sued by apple and might have to delete all videos :O
13:58 Mikey joined #mojo
13:58 Grinnz facepalm
14:07 prajith joined #mojo
14:24 jabberwok updated   http://wlindley.com/mojo/Mojo.html   with cross-reference.  If you look under 'json' you'll immediately find Mojo::Message ... Hm, what more should i clean up before this is truly usable?
14:25 meshl joined #mojo
14:27 prajith any idea why this always returns undef?
14:27 prajith $self->ioloop->stream($id)
14:28 prajith even if the id is there
14:28 prajith connection id*
14:30 jkramer joined #mojo
14:30 sri wrong event loop?
14:30 jkramer Ahoy
14:31 jkramer How can I POST a plain (not form-data) file/binary data with Mojo::UserAgent?
14:31 jkramer I only find the form => {} version in the docs
14:32 sri jkramer: http://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#Content-generators
14:33 jkramer Thanks!
14:34 inokenty joined #mojo
14:37 prajith sri: if you don't mind, can you please check this?
14:37 prajith https://gist.github.com/Prajithp/ac6d6ca6a59d4f7ab534ab1b1dd50c18
14:38 sri prajith: sorry, tldr
14:39 Adura Just put it all on one line.
14:39 prajith okay no pbm
14:48 ptolemarch joined #mojo
14:53 mishanti1 sri: What? Jeez. That's a _real_ low, even for Apple.
15:05 sri jberger: btw. i don't disagree with a json example, just some of the content
15:11 zivester joined #mojo
15:17 val40 joined #mojo
16:06 val40 joined #mojo
16:36 jberger I'm happy to iterate on it
16:37 jberger And I just tried my best (again) to diffuse that guy
16:37 jberger If he responds snarky again I'm going to consider him an outright troll and that will be that
16:40 trone joined #mojo
16:44 sri ok, now he's harassing me on github too
16:44 sri giving my comments -1 votes
16:46 sri and why the hell are you pulling the github twitter account into this?
16:48 sri going to block him completely on github until he convinces me he's not malicious
16:48 stryx` joined #mojo
16:53 jberger When i replied it was there. I didn't want to break the thread
17:01 prajith joined #mojo
17:08 stryx` joined #mojo
17:09 sri at the very least he's dishonest
17:09 sri after all he included "#dysfunctional #Perl #community" in his tweet for crying out loud
17:09 sri "Sorry for the apparent (yet, unintended) "snark" in previous comments."
17:09 sri are you fricking kidding me?
17:09 ribasushi that particular line is hardly dishonest ;)
17:09 ribasushi ( all else aside )
17:11 jberger I'm getting pretty tired of him
17:11 pink_mist ribasushi: I don't think it's honest; using those hashtags and saying any snark was unintended is completely dishonest
17:13 ribasushi pink_mist: I was hoping to lighten the mood via cynicism (the community at large is a fucked up place after all) - I guess I missed the mark ;)
17:13 jberger Especially as he has now "apologized" several times and still not changed his tone
17:13 jberger Yeah i think he's used to that expectation and came in guns blazing
17:13 sri jberger: i think the correct term is non-apology apologies
17:18 mishanti1 sri: Btw, thanks for tipping me about the case (whatever it is _really_ about). I'm hoping he get proper legal counsel.
17:18 mishanti1 The good thing is that there is nothing Apple really can do to stop his videos.
17:19 mishanti1 Sad this is that they can ruin him both privately and his business.
17:19 pink_mist perhaps he can apply to the EFF for lawyering up support
17:19 pink_mist don't they help with such things?
17:20 mishanti1 pink_mist: I'm hoping w will. They have been involved in similar cases in the past if I remember correclt.
17:20 mishanti1 s/clt/ctly/
17:21 sri mishanti1: copyright maybe, since he commonly shows apple blueprints in his videos
17:22 sri mishanti1: that said, it's us of a, apple lawyers can prolly just ruin him by dragging out the case for years
17:23 mishanti1 sri: It is practically the same here really. It is the company with the most money who wins.
17:29 prajith joined #mojo
17:29 salva joined #mojo
17:46 dod joined #mojo
17:58 itaipu joined #mojo
18:12 irqq joined #mojo
18:20 disputin joined #mojo
18:30 Kripton joined #mojo
18:45 sri jberger: think a json roundtrip example modifying the document would have been fine for an early example
18:45 sri jberger: but i do understand if you don't want to take this any further
18:48 sri i don't even https://twitter.com/real_currents/status/748940879352782848
18:48 jberger I still think we should have an example of some kind
18:48 jberger I'm still happy to iterate on it too
18:48 jberger but I'm pretty pissed right now
18:49 jberger and I'm going to go on a hike with my wife
18:49 sri enjoy your hike
18:55 jberger sri: thanks
19:01 kes joined #mojo
19:41 dod joined #mojo
20:06 val40 joined #mojo
20:30 marcus jberger: have a good hike
20:35 Kripton joined #mojo
21:14 PryMar56 joined #mojo
21:41 Kripton joined #mojo
22:28 tchaves joined #mojo
22:35 bwf joined #mojo

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