The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,528 other followers

Archive for the ‘JSON’ Category

Stuff on my research list thanks to Martijn Laarman (@Mpdreamz)

Posted by jpluimers on 2018/02/08

Quite some time ago, I attended a great introductory elasticsearch/kibana workshop by Martijn Laarman (@Mpdreamz, github.com/Mpdreamz and SO martijn-laarman) that lead me into researching a lot of interesting new things:

–jeroen

Posted in Development, JavaScript/ECMAScript, JSON, Scripting, Software Development | Leave a Comment »

Sending various HTTP request kinds using curl

Posted by jpluimers on 2017/07/25

I’ve been using cURL but always had a feeling not to its potential basically because the cURL man page [WayBack] is both massive and lacks concrete useful practical examples.

For instance, I knew about the --header and --verbose options (I always use verbose names even though shorter -H and -v exist) to pass a specific header and get verbose output, but the man page basic examples like this by Tader:

curl --header --verbose "X-MyHeader: 123" http://www.google.com

source: How to send a header using a HTTP request through a curl call? – Stack Overflow [WayBack]

There are some more examples at bropages.org/curl but they’re hardly organised or documented.

So I was really glad I found the below answer [WayBack] by Amith Koujalgi to web services – HTTP POST and GET using cURL in Linux – Stack Overflow.

But first note that recent versions (around 7.22 or higher) of cURL now need to combine the --silent and --show-error (or in short -sS) parameters to suppress progress but show errors: linux – How do I get cURL to not show the progress bar? – Stack Overflow [WayBack]

Back to the examples

Read the rest of this entry »

Posted in *nix, Communications Development, cURL, Delphi, Development, HTTP, https, Internet protocol suite, JavaScript/ECMAScript, JSON, Power User, REST, Scripting, Security, Software Development, TCP, TLS, XML, XML/XSD | 1 Comment »

Bash that JSON (with jq) — Librato Blog

Posted by jpluimers on 2017/04/18

 Glueing together APIs requires working with JSON: parsing it, extracting it, transforming it. JQ is a fast, lightweight, flexible, CLI JSON processor, that does the job well. Learn how to use it by getting your hands dirty with a JSON blob that represents the open issues in the public Docker GitHub repository.

Source: Bash that JSON (with jq) — Librato Blog [WayBackhttp://blog.librato.com/posts/jq-json

via: http://blog.librato.com/posts/jq-json – Joe C. Hecht – Google+

–jeroen

Source: http://blog.librato.com/posts/jq-json

Posted in bash, Development, JavaScript/ECMAScript, JSON, Scripting, Software Development | Leave a Comment »

JavaScript. Sigh. No real RegExp support. Sigh. Google Search results. Sigh.

Posted by jpluimers on 2017/03/01

Prologue

Every time I need to use JavaScript there’s this tiny voice in the back of my head “Please don’t”, for instance because of

JavaScript has two sets of equality operators: === and !==, and their evil twins == and !=.

Verify a URI in JavaScript with a Regular Expression using Google Search examples

This time it did it again: I used JavaScript. My need was to verify a basic URI in JavaScript, so I wrote this function based on RFC 3986 [WayBack] which in Appendix B has a nice regular expression: ^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?

function isValidUri(uri){
    var uriRegExPattern = "^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?";
    var uriRegEx = new RegExp(uriRegExPattern); 

    return (uriRegEx.test(uri));
} 

It would crash. But JavaScript is JavaScript, so even a site like JSFiddle wouldn’t show an error (later I found out that enabling the console on http://jsbin.com/wamavacuco/edit?html,console,output does show the error in the console complete with stack trace).

Read the rest of this entry »

Posted in Development, JavaScript/ECMAScript, JSON, RegEx, Scripting, Software Development | Leave a Comment »

nst/JSONTestSuite: A comprehensive test suite for RFC 7159 compliant JSON parsers

Posted by jpluimers on 2016/11/01

Cool: nst/JSONTestSuite: A comprehensive test suite for RFC 7159 compliant JSON parsers

Which is the result of the presentation seriot.ch – Parsing JSON is a Minefield 💣[WayBack]

Both the tests and presentation are well worth reading.

The graph gives me ambivalent feelings and make me wonder how various .NET and Delphi based JSON parsers stack up.

I wonder how Delphi and C# libraries stack up against these results especially since questions like What is the best JSON library to use for Delphi 10.1? To read and write JSON. – Godfrey Fletcher – Google+ [WayBack].

Hopefully the results by David Berneda will be published soon: I’ll do a quick test with TeeBI json import and the different libraries (System.Json, SuperObject etc)

Edit: Stefan Glienke mentioned he wrote a DUnit testsuite at http://pastebin.com/k5ktBxh9 [WayBack] that shows the built-in TJSONObject [WayBack] parser fails at least 25 of the tests.

–jeroen

via: David Berneda – Google+ [WayBack]

Read the rest of this entry »

Posted in .NET, C#, Delphi, Development, JavaScript/ECMAScript, JSON, Scripting, Software Development | 1 Comment »

 
%d bloggers like this: