Skip to main content

Questions tagged [json]

JSON (JavaScript Object Notation) aka the Fat Free Alternative to XML is a lightweight data exchange format inspired by JavaScript object literals. It is often used with JavaScript, Ajax, and RESTful web services but is completely language independent.

Filter by
Sorted by
Tagged with
33 votes
1 answer
7k views

JSON Serializer

Carrying on from: Yet another C++ Json Parser Yet another C++ Json Parser (Recursive) All the code is available from git hub: ThorsSerializer but only reviewing a small section here. The idea is ...
Loki Astari's user avatar
  • 95.3k
15 votes
4 answers
344 views

From Q to compiler in less than 30 seconds

(See the newer version here: CodeReview question markdown downloader) As an adjunct to From new Q to compiler in 30 seconds, I've created a Python script to automatically download the markdown from ...
Edward's user avatar
  • 66.5k
49 votes
1 answer
7k views

Yet another C++ JSON parser

This is a framework for a JSON parser I put together last night. Any comments appreciated. JsonLexer.l: Breaks the input into lexemes JsonParser.y: Understands the language syntax JsonParser.h: ...
Loki Astari's user avatar
  • 95.3k
7 votes
0 answers
659 views

Chaining JSON transformations with visitors

I have currently two use-cases that require JSON transformations before it can be deserialized. The first use-case requires changing the custom short type property name from ...
t3chb0t's user avatar
  • 44.3k
5 votes
0 answers
74 views

JSON Test Harness: Part 1

Part 2: JSON Test Harness: Part 2 Part 3: JSON Test Harness: Part 3 Part 4: JSON Test Harness: Part 4 Time to review some test harness code I have written. https://github.com/Loki-Astari/...
Loki Astari's user avatar
  • 95.3k
5 votes
0 answers
45 views

JSON Test Harness: Part 2

Part 1: JSON Test Harness: Part 1 Part 3: JSON Test Harness: Part 3 Part 4: JSON Test Harness: Part 4 Time to review some test harness code I have written. https://github.com/Loki-Astari/...
Loki Astari's user avatar
  • 95.3k
4 votes
0 answers
49 views

JSON Test Harness: Part 4

Part 1: JSON Test Harness: Part 1 Part 2: JSON Test Harness: Part 2 Part 3: JSON Test Harness: Part 3 Time to review some test harness code I have written. https://github.com/Loki-Astari/...
Loki Astari's user avatar
  • 95.3k
3 votes
0 answers
33 views

JSON Test Harness: Part 3

Part 1: JSON Test Harness: Part 1 Part 2: JSON Test Harness: Part 2 Part 4: JSON Test Harness: Part 4 Time to review some test harness code I have written. https://github.com/Loki-Astari/...
Loki Astari's user avatar
  • 95.3k
24 votes
2 answers
2k views

parcel: a JSON parsing library in C

I've created a JSON parsing library in C, and would like some feedback on it (feel free to submit a pull request on GitHub). Any and all suggestions are acceptable, but I would prefer if reviews were ...
syb0rg's user avatar
  • 21.8k
12 votes
2 answers
4k views

More efficient way to retrieve data from JSON

I am using the jsmn JSON parser (source code) to get extract data from a JSON string. jsmn stores the data in tokens that just point to the token boundaries in the JSON string instead of copying the ...
syb0rg's user avatar
  • 21.8k
11 votes
1 answer
514 views

Serialization: Step 1 Json Parser

As nobody has provided input, I have updated the question. (The next one is coming soon) Coding to this interface: ...
Loki Astari's user avatar
  • 95.3k
8 votes
1 answer
283 views

Post json using http and verify whether all actions completed successfully or not

I am working on a project where I need to work with http apis and call them using Python language. Below is what I need to do: Take few input parameters like - <...
AndyP's user avatar
  • 239
5 votes
2 answers
148 views

Tracking Containers in a Train Station

This is a time line for control over the events of some containers in a train station. It gets all the data to build the time line by getting a JSON from a database via REST service. The app resets ...
Vhalad's user avatar
  • 91
5 votes
1 answer
275 views

Setting up keyboard bindings using JSON and reflection

My game uses configuration files in JSON format. One of them is used for setting up control bindings, and it looks like this: ...
Big McLargeHuge's user avatar
4 votes
1 answer
3k views

Yet another C++ Json Parser (Recursive)

Following on from this request Yet another C++ Json Parser A friend pointed out that he though a recursive decent parser would be more efficient. Before I agree I want to test it so I wrote it for ...
Loki Astari's user avatar
  • 95.3k
2 votes
1 answer
2k views

Extract data from large JSON and find frequency of contiguous sub lists

I have been writing some code (see component parts here and here) that: Takes a very large JSON (15GB gzipped, ~10million records) Extracts the relevant parts of the JSON into a list of lists Creates ...
ADatoo's user avatar
  • 85
0 votes
2 answers
2k views

JSON string parsing

I need to parse a simple JSON string (flat JSON, no hierarchy) for keys and values, and there is a system constraint that I cannot use any built-in JSON library and can only read a string once due to ...
Lin Ma's user avatar
  • 3,453
20 votes
4 answers
2k views

CodeReview question markdown downloader

This is an update to my earlier question From Q to compiler in less than 30 seconds. As with that version, this Python script automatically downloads the markdown from any question on Code Review and ...
Edward's user avatar
  • 66.5k
16 votes
2 answers
16k views

Java JSON parsing with the Nashorn API

Some time ago I found a website about the Java Nashorn API which allows you to run JavaScript from Java code. I thought about creating a JSON parser in pure Java (without external libraries) which ...
Datagrammar's user avatar
12 votes
2 answers
343 views

Setting up keyboard bindings using JSON (no reflection!)

I got a lot of good feedback on my other question. So I will take another swing at it, post my revisions, and hopefully get some more. First, the configuration hasn't changed. Here's the JSON file: <...
Big McLargeHuge's user avatar
12 votes
3 answers
3k views

Prettify JSON class

It's not much, but I tried employing some of the things I learned yet never really got to use, since that kind of code isn't really needed where I work (for the most part). I tried making it as much C+...
Borisas's user avatar
  • 141
11 votes
3 answers
3k views

Fetch, Parse, and Save JSON

I've written a program in Java that will fetch JSON information from a service through their API and save it. As I'm new to Java, I want my code looking clean as possible and to understand the ...
Jon.H's user avatar
  • 263
10 votes
3 answers
949 views

Displaying information about people from a JSON file

I'm working with Python 2.7.5 and I have written the following code: ...
user2421117's user avatar
9 votes
2 answers
251 views

JSON4 parser in Typescript

Context I may have accidentally gotten a little sidetracked during homeschooling, and wrote a JSON4 parser in Typescript during the down-time. This project started as an idea that I got while ...
Patrick Hollweck's user avatar
8 votes
3 answers
3k views

Catching multiple types of exceptions when writing JSON

I have a class which throws a lot of exceptions: ...
blue-sky's user avatar
  • 557
7 votes
2 answers
537 views

Using an API to obtain JSON data and get the date string and determine if data is stale

This is a nagios check that will use an API URL, get JSON data, flatten the data into a usable perl hash, and ultimately obtain a date string. Once the date is obtained, it should recognize the ...
japtain.cack's user avatar
6 votes
0 answers
1k views

Recursive conversion from ExpandoObject to Dictionary<string, object> #2

Because my original question was lacking many details, I have been advised to ask a new question. I will repeat the important parts of the original question and add examples etc to hopefully make it ...
Joelius's user avatar
  • 355
6 votes
1 answer
240 views

Work order spatial query (Part 1)

Part 1: General Cleanup (Edit: Part 2 is here.) I have a script in a Work Order Management System (Maximo) that performs a spatial query. Details: Takes the X&Y coordinates of a work order in ...
User1974's user avatar
  • 198
6 votes
1 answer
1k views

Dict of names and birth dates which prints with age at birthday of current year

As a beginner (Learn Python the Hard Way), I've set myself this exercise with classes and it works but looks very inelegant to me. I'm trying to write classes which could be re-used in other code. I'...
j-o's user avatar
  • 137
6 votes
2 answers
7k views

Yet another JSON parser and serializer for Qt, but with additional features

I wrote QJson, a utility class in/for Qt, I need you to take a look at. It is both a JSON parser and serializer, but with extended functionality (going beyond the ...
leemes's user avatar
  • 495
5 votes
1 answer
186 views

Arabic language lesson program Part 2

This is the second time I am asking for a review of this code (first time can be found here: Arabic language lesson program). The goal of the program hasn't changed - to house Arabic language lessons ...
Jack Duane's user avatar
5 votes
1 answer
729 views

Fetch and Save Weather Data as JSON

This is part 2 to Fetch, Parse, and Save JSON. As the code evolved, I wanted to post the program with changes for review again. The objective of the program is to fetch JSON information from a ...
Jon.H's user avatar
  • 263
5 votes
2 answers
727 views

Asynchronous HTTP JSON request

For asynchronous requests, I use Alamofire. I have created one method for requesting async data. ...
saurabh's user avatar
  • 156
4 votes
2 answers
309 views

Data Persistence

I was wondering if I could get some feedback on the library I created to persist data online. JitterPushDemo.java ...
Malik Brahimi's user avatar
4 votes
1 answer
984 views

Scrape a reddit post submission for comments and save comments to JSON file

Edit: For a revision to this code according to the comments, see here: "here." In regards to the code involving shortlinks and ...
Homer's user avatar
  • 287
4 votes
2 answers
335 views

PHP script that writes a JSON file with iextrading API data

iextrading has two APIs (v1, v2) which provide financial market data. Following script records a JSON file with their equity information (using a CRON job). Would you be kind and review it for any ...
Emma's user avatar
  • 3,527
4 votes
2 answers
617 views

Slurp JSON trading cards to valid HTML

For Cardshifter TCG we pretty frequently update our list of available cards, so I tried to think of a way to make it easy to transform an exported JSON file containing all the cards into a decent HTML ...
Phrancis's user avatar
  • 20.4k
4 votes
1 answer
623 views

Fetching specific foreign exchange rates from fixer using curl and jsconcpp in C++

I am trying to create my own algorithmic trading system using C++. I have searched the web for a nice tutorial for such systems and I didn't find any. Then I started to learn about ...
Eka's user avatar
  • 349
4 votes
1 answer
2k views

Converting JSON to CSV using powershell

I have a very large JSON Lines File with 4.000.000 Rows, and I need to convert several events from every row. The resulted CSV File contains 15.000.000 rows. How can I optimize this script? I'm using ...
user avatar
4 votes
1 answer
237 views

Perl Nagios plugin to query an API, obtain date from JSON, and determine if the date is within thresholds

This is an update of Using an API to obtain JSON data and get the date string and determine if data is stale This is a Nagios check that will use an API URL, get JSON data, flatten the data into a ...
japtain.cack's user avatar
4 votes
2 answers
3k views

Download entire localStorage as file

I would like to download the entire contents from localStorage to a json file (in a "clear" formatting). I've tried this and it works perfectly. However, ...
Gibberish's user avatar
  • 109
4 votes
2 answers
185 views

IsoStorageManager

A manager for a speedy async saving objects to isolated storage, using serialization from Newtonsoft.Json. A project to play with is here. ...
Vitalii Vasylenko's user avatar
4 votes
2 answers
1k views

Generate thousands of JSON documents in Go

I recently decided to try to learn the Go language. In order to do this, I wrote a small program which parses a JSON configuration file, and generates N bson documents according to its properties. For ...
felix's user avatar
  • 588
3 votes
2 answers
89 views

Saving and reading the last successful execution as a json-file

I've got some tools that run perdiodically like weekly or monthly that don't support any retry mechanism. In order to increase their chance to succeed in case a database wasn't reachable or some other ...
t3chb0t's user avatar
  • 44.3k
3 votes
1 answer
1k views

JSON serialization helper class

I wrote this class to one-line all my JSON serialization, and I'm curious of any input on it. It's only responsible for serializing/deserializing any type to/from JSON. The comments and code are ...
Der Kommissar's user avatar
3 votes
2 answers
183 views

Validating a CSV list of contacts and convert it to JSON

I've written a class that takes a file, validates the formatting of the lines from an input file and writes the set of valid lines to an output file. Each line of the file should have a first name, ...
loremIpsum1771's user avatar
3 votes
2 answers
396 views

Parsing JSON in one go

I need to parse a simple JSON string (flat JSON, no hierarchy) for keys and values, and there is a system constraint that I cannot use any built-in JSON library and can only read a string once due to ...
Lin Ma's user avatar
  • 3,453
3 votes
1 answer
777 views

Script to store, search, and delete IPFS data with description in JSON file

Here is the script that I would like reviewed for the following: Best practices and design pattern usage Correctness in unanticipated cases Better dictionary access The script is made to store (IPFS)...
Troy Wilson's user avatar
3 votes
1 answer
420 views

Parsing Solr log files - version 2

This post is in reference to: Parsing Solr log files I re-wrote most of the code and split it up into a couple of classes. Currently, the class functionality is pretty limited, but I can see that I ...
nick_v1's user avatar
  • 185
2 votes
2 answers
1k views

Infinite scroll for currency list

I made infinite scroll for a currency (in the code below: valute) list. The currency list is fetched via an AJAX-request from a remote server. After it starts the script displays 10 records. After the ...
cyklop77's user avatar
  • 311