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

IRC log for #mojo, 2016-02-20

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

All times shown according to UTC.

Time Nick Message
00:07 pink_mist ohh, I'll buy that (unless it's €100 or more)
00:09 pink_mist oh wait, all donation shirts are €100 or more
00:09 pink_mist I could have sworn you had a €50 tier
00:10 sri the glow in the dark one, which didn't sell once in the last 12 months ;p
00:13 pink_mist d'oh .. right ^^;
00:13 sri i mean... glow in the dark is a bit niche
00:13 sri pink glitter is so much more mainstream
00:13 pink_mist haha so true :P
00:49 lbus255 joined #mojo
01:23 asarch joined #mojo
01:29 bpmedley One input vector for Mojolicious is via test suites and Test::Mojo / Mojo::UserAgent.. Everyone has curl or some other HTTP lib in use for their test suite.. All the utility functions combined with integrated JSON and DOM processing is super sweet.
01:29 bpmedley Just stating the obvious.. :)
02:23 s1037989 Hey!  I bought a glow in the dark shirt!  :D
02:23 s1037989 I love it!!
02:48 user_5132 joined #mojo
02:48 user_5132 http://search.cpan.org/~jhthorsen/Mojolicious-5.17/lib/Mojo/JSON.pm
02:48 user_5132 my $json = Mojo::JSON->new;
02:48 user_5132 that's not really working
02:49 bpmedley user_5132 : Do you have an example script you can pastie?
02:49 user_5132 http://nopaste.linux-dev.org/?945578
02:50 user_5132 code seems to be correct
02:50 bpmedley user_5132 : Is that from a Mojolicious::Lite app?
02:50 user_5132 yes
02:51 bpmedley Would you pastie enough of the app to demonstrate the issue?
02:51 user_5132 One moment
02:54 user_5132 http://nopaste.linux-dev.org/?945579
02:54 user_5132 post anything to it with curl and Mojo::JSON will throw an error
02:55 bpmedley user_5132 : c->req->json->{key} <-- try something like that
02:55 user_5132 It seems  Mojo::JSON->new; is the problem
02:56 user_5132 -> new simply doesnt exist, while it is mentioned in the documents?
02:56 bpmedley user_5132 : Are you trying to parse the JSON returned by the user?
02:56 bpmedley returned -> sent
02:57 user_5132 Yes, decode and parse for processing
02:57 bpmedley What's wrong with '$c->req->json' ?
02:58 bpmedley http://mojolicious.org/perldoc/Mojo/Message#json
03:05 user_5132 [error] Missing or empty input
03:06 user_5132 my $json = decode_json($self->req->json);
03:09 csson user_5132: Mojo::JSON->new was removed in 5.73, you were looking at 5.17: https://metacpan.org/changes/distribution/Mojolicious#L432
03:11 bpmedley user_5132 : I believe the issue is that you're trying to manually decode JSON that is already parsed via $self->req->json
03:12 user_5132 Let me check
03:12 user_5132 It makes sense now
03:13 user_5132 i'm sending amount, so I try to access it now with my $json = $self->req->json->{amount};
03:14 bpmedley Sweet!!
03:14 user_5132 it's undefined value ;/
03:15 user_5132 in case it would work, how can I check if the parsed json is valid?
03:19 bpmedley user_5132 : $c->app->log->debug($c->dumper($c->req->json))  <-- does this log anything?
03:20 user_5132 Yes
03:20 user_5132 undef
03:24 bpmedley What are you using to send the POST request?
03:25 user_5132 curl http://localhost:3000/checkaddress -X POST -d @checkaddress.json -H "Content-Type: application/json" -H "Accept: application/json" -v
03:25 user_5132 * upload completely sent off: 24 out of 24 bytes
03:25 user_5132 my json file is 24 bytes, and it's valid json
03:26 user_5132 Mojo says req->json is undef
03:28 user_5132 [Sat Feb 20 04:27:59 2016] [debug] "\357\273\277{    \"amount\": \"0.1\"}"
03:28 user_5132 if i use req->body, it displays
03:30 user_5132 but it's malformated
03:30 user_5132 it seems
03:42 bpmedley user_5132 : Malformatted?
03:56 noganex joined #mojo
04:00 taichi joined #mojo
04:04 preaction misinformatted
04:07 bpmedley https://bitbucket.org/snippets/bpmedley/nrryo <-- Anyone have time to test a telnet 'esque text network tool thingy?  [http://bmedley.org/socket_fun.mov]
04:16 bpmedley Perhaps tomorrow.. :)
04:25 inokenty-w joined #mojo
05:04 taichi joined #mojo
05:38 davido joined #mojo
05:51 user_5132 joined #mojo
05:58 user_5132 my $json = $self->req->json;
05:58 user_5132 this doesn't definitely not hold anything
05:59 taichi joined #mojo
06:05 user_5132 where can I find propery documentation to read the posted JSON?
06:05 taichi joined #mojo
06:17 trone joined #mojo
06:24 mspo joined #mojo
07:02 davido joined #mojo
07:04 kaare joined #mojo
07:27 user_5132 anyone here can help with json parsing?
07:39 taichi joined #mojo
08:23 Vandal joined #mojo
10:22 dhg joined #mojo
11:23 melo joined #mojo
12:33 punter joined #mojo
12:36 * sri yawns
12:37 CandyAngel A wild sri appears!
12:37 * CandyAngel throws a pokeball at him
12:37 pink_mist gotta catch 'em all
12:39 CandyAngel jbergémon!
12:44 sri https://media.giphy.com/media/tOiFLs50fhGnu/giphy.gif
12:56 sri btw. there's a pink glitter shirt today ;p https://shop.spreadshirt.com/kraih/
12:57 CandyAngel Too late, already bought one :P
12:57 CandyAngel or mostly bought one (split donation with a friend, who will actually wear it)
12:58 sri \o/
12:58 pink_mist :( it's not on the EU shop =(
12:58 sri not available for eu
12:59 sri but shipping costs seem to be the same now anyway
12:59 CandyAngel So yeah. Thank you for making Mojolicious, thank you for helping me learn it and thank you for making me a better coder :D
13:00 sri thanks for being part of the community \o/
13:06 pink_mist :( the us shop is refusing to take either my mastercard or my visa :( "Your payment could not be concluded. Please check your data entry." I did :/ thrice :/
13:07 pink_mist ah well, guess I won't get that shirt then =(
13:07 sri how odd, my german visa worked
13:14 sri jberger: you never said how the quality of the frosted mug actually is?
13:15 sri does the print look good?
13:23 asarch joined #mojo
13:24 sri (if something is not awesome i want to know too! because it needs to be removed)
13:50 lluad joined #mojo
14:03 bpmedley https://bitbucket.org/snippets/bpmedley/nrryo <-- Anyone have time to test a telnet 'esque text network tool thingy?  [http://bmedley.org/socket_fun.mov]
14:04 sri i tried to open it, but now my chrome hangs :S
14:05 bpmedley Oh dear, so you downloaded the bitbucket code and ran it?
14:05 sri no, i tried to open your link
14:05 bpmedley The .mov or the bitbucket link?
14:05 sri bitbucket
14:06 sri is that like a huge file with a million lines or so?
14:07 ribasushi sri: it's the entire 5k lines of jquery.terminal
14:07 ribasushi among with other stuff
14:08 ribasushi sri: the interesting part (I think): https://bitbucket.org/!api/2.0/snippets/bpmedley/nrryo/08700a2bbc0313ece4425b1efd3cc1b68a148f21/files/socket.pl
14:10 ribasushi *along (wtf... among?)
14:10 bpmedley sri : Yeah, I wasn't sure of the best way to include the jquery plugin..
14:11 bpmedley ribasushi : Thank you for perusing, are you saying there are questions as to what I'm doing?
14:12 ribasushi bpmedley: no idea, not my area of expertise, just saw the confused exchange and pasted a better link
14:14 bpmedley https://gist.github.com/brianmed/8eb92949846d296412cb <-- Here is just the lite app
14:23 jberger sri I haven't used it yet but the mug feels quite supple
14:23 bpmedley Can the mug fend off an attacker?
14:23 sri jberger: and the print?
14:24 jberger Oh with a good swing I bet it could do some harm to an attacker
14:24 jberger sri: the print looked good though I'll admit I didn't study it intently
14:25 jberger I put it back into it's box, I'm bringing it to the next Chicago.pm
14:25 jberger And well now I'm not even home
14:25 marcus stabbed in the next with a mojolicious cup
14:25 CandyAngel sri: You have a WebKit browser? Because bitbucket hangs WebKit browsers
14:25 marcus *neck
14:25 sri oh, it flew away with the house then :o
14:26 jberger Yeah probably did
14:26 jberger I guess that means I'm in Oz?
14:26 sri CandyAngel: yea
14:26 bpmedley CandyAngel : Yuck, I didn't know that.. let me change to a github repo
14:26 sri jberger: you could have been if you stayed at home!
14:27 jberger "bitbucket hangs WebKit" srsly?
14:27 jberger You'd think atlassian would have a vested interest in testing that
14:27 sri well, a few thousand lines of synatx highlighted code tend to make life miserable for any browser
14:28 sri think github now just refuses to display code of a certain size
14:28 CandyAngel It isn't that, it will just hang it indefinitely on like.. almost any page
14:28 jberger I'm assumimg people have played with crashopera.com (I think that was it)
14:29 CandyAngel https://github.com/fanglingsu/vimb/issues/203#issuecomment-152868165
14:29 jberger bpmedley: looks like you are kinda adapting my blog post?
14:29 bpmedley Which blog post?
14:30 CandyAngel It was very annoying because I was using uzbl-browser and bitbucket (for perl-openhmd) at the time
14:31 jberger Hmmm is perltricks down?
14:32 jberger bpmedley:  http://blogs.perl.org/users/joel_berger/2016/02/get-an-in-browser-remote-desktop-with-mojolicious-and-novnc.html
14:32 jberger Ah now it's working
14:33 jberger http://perltricks.com/article/212/2016/2/2/Get-an-in-browser-remote-desktop-with-Mojolicious-and-noVNC/
14:33 CandyAngel bpmedley: That's exactly why perl-openhmd moved to github from bitbucket :P
14:34 bpmedley jberger: While I've been influenced by may of your blog posts, I don't believe I took any code from the novnc post..
14:34 bpmedley I was frustrated because sometimes telnet is not installed and it's easier to install Mojolicious than get a new package on a box
14:37 jberger bpmedley: just good timing then
14:38 jberger Mojo makes that kind of connection chaining so easy it's likely to happen from time to time
14:39 bpmedley jberger : The goal over the next few ? time frame is to make the output context aware so that IMAP, SMTP, HTTP, etc can be debugged
14:41 taichi joined #mojo
14:42 sri reminds me of the backpressure problem
14:42 bpmedley https://github.com/brianmed/network_console
14:43 sri don't even remember what the conclusion was the last time it came up
14:44 jberger Kinda just got dropped
14:45 jberger You almost proposed a new event
14:45 sri right, i investigated a congestion event
14:45 sri and that was the end of it http://irclog.perlgeek.de/mojo/2016-02-01#i_11970300
14:46 sri oh, i actually committed something https://github.com/kraih/mojo/commit/ea5fe0482d95864a209759da5b625f5d698c72e7
14:47 sri interesting topic
14:49 sri i've rejected a lot of my patches recently :(
14:53 genio heh
15:09 jberger sri: for bigger features like that our like the router changes the other day, would it help if they were done as branches so that they could be discussed without it feeling like it was quite so "on the clock" being in master
15:10 taichi joined #mojo
15:12 sri both had big problems, so i don't think it would have
15:13 sri the congestion event didn't work for "$c->send('whatever') for 1 .. 1000000"
15:13 sri and typed placeholders overlap too much with restrictive placeholders
15:14 sri both are fundamental problems
15:14 jberger Yeah
15:14 taichi joined #mojo
15:34 mcsnolte joined #mojo
15:43 ichi joined #mojo
15:47 thowe good morning
15:52 ichi hi.
15:52 ichi i want use ws, but i don't know how to send data to client without client request?
15:52 zivester joined #mojo
15:54 ichi example, my app waiting data from memcached, and if get data need send clients
15:59 PryMar56 joined #mojo
15:59 sri http://mojolicious.org/perldoc/Mojolicious/Guides/Cookbook#WebSocket-web-service
15:59 taichi joined #mojo
16:00 sri https://github.com/kraih/mojo-pg/blob/master/examples/chat.pl
16:19 dhg joined #mojo
16:20 taichi joined #mojo
16:23 ichi sri, Wow! thx
17:55 Adura joined #mojo
18:16 dhg joined #mojo
18:33 dhg joined #mojo
18:39 Topic for #mojo is now Hi
18:40 taichi joined #mojo
18:44 sri Adura: what are you doing?
18:44 sri change it back
18:44 Adura How...? I didn't expect it to work.
18:45 sri ...
18:45 Adura I could copy/paste...
18:45 Topic for #mojo is now 🍻 cheers | http://mojolicious.org | http://irclog.mojolicious.org | http://code-of-conduct.mojolicious.org
18:45 Adura Anything lost?
19:15 asarch joined #mojo
19:27 chansen https://gist.github.com/chansen/6dde6200729f1fdde7fb
19:27 chansen sri: ^^ robust implementation of epoch_to_datetime(), also includes 100 test failures for Mojo::Date
20:07 mdom Is Mojo::Base something you would expect Third-Party developers to use? Or is it meant as internal library? I'm just pondering if i should use it on a project where i already use Mojo::UserAgent and Moo, and i don't use anything in Moo that Mojo::Base does not provide...
20:08 CandyAngel mdom: If it is useful, use it
20:08 CandyAngel I have several projects which are using it, including the Voxel Engine I'm coding right now :P
20:17 pink_mist mdom: I think there's lots of projects that use it, but your users might be miffed at having to install Mojolicious as a dep unless your project obviously needs it
20:19 vicash mdom you may want to use Mo instead of Moo then
20:20 vicash mdom the advantage of Mo is that it is really tiny and only the developer installs it. Then you can create a custom Base class for your module as part of its code and that's how most users embed Mo as part of their module
20:30 vicash mdom refer perldoc Mo::Inline for more details
20:32 sri chansen: i think consensus was not to do that
20:35 sri maybe batman and CandyAngel still care?
20:35 sri personally i have other priorities now
20:38 CandyAngel Still care about what?
20:38 sri log timestamp format
20:44 CandyAngel I'd still prefer it, but it's just a nitpick sort of thing
20:55 punter joined #mojo
20:56 sri yea, the cost is way too high for the level of interest
21:00 bpmedley jberger : I just perused the code of your noVNC post.. the pattern used seems very similar.  Kinda cool.
21:02 chansen sri: ok, but the script also includes test failures for Mojo::Date. Mojo::Date fails because it treats floating point numbers as strings
21:02 sri patch welcome i guess
21:03 sri (not that i'm in the right mindset now to actually comment)
21:10 mdom pink_mist: As i said, i already use Mojo::UserAgent, so it has zero cost for my users (if there are any... :)
21:10 mdom vicash: Thanks, i take a look
21:10 pink_mist mdom: right, then I'd say go ahead =)
21:49 sri chansen: your implementation doesn't actually appear to be compatible with rfc 3339
21:49 sri i see examples like 1985-04-12T23:20:50.52Z
21:51 sri rounding is not even mentioned
21:52 sri "time-secfrac    = "." 1*DIGIT" is the definition for fractional seconds
21:52 chansen The implementation is conformant with ISO 8601:2004 and RFC 3339.
21:52 sri we don't care about iso8601
21:53 chansen RFC3339 is a subset of ISO 8601 (with a few exceptions)
21:55 chansen RFC 3339 and ISO 8601:2004 doesn't specify the number of decimals in the fraction
21:55 sri why exactly is treating fractional seconds as strings wrong?
21:55 chansen Did you run the test?
21:55 sri please explain first
21:58 sri so far my opinion is that your tests are flawed
21:59 sri i see no reason why 0.99999 should become 1970-01-01T00:00:00.999990Z and not 1970-01-01T00:00:00.99999Z
22:01 sri i have no idea if iso8601 dictates a stricter format, but rfc 3339 definitely does not, the bnf is very clear there
22:01 chansen Fractional seconds is de facto formatted either as milli, micro, nano or peta
22:04 chansen Microsoft OS is an exception, which uses hecto nano
22:14 chansen The reason you shouldn't treat floating point values as string is because you looses precision.
22:14 chansen $ perl -wE 'my $f = 1609459199; say for ($f, $f + 0.000_004);'
22:14 chansen 1609459199
22:14 chansen 1609459199
22:15 Vitrifur joined #mojo
22:16 Adura Tighten that precision!
22:17 pink_mist but pretending that 0.99999 is 0.999990 adds precision that isn't there
22:26 cfedde joined #mojo

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