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
44
votes
1answer
6k 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: ...
37
votes
0answers
1k views

JSON formatter in your least favorite language

Just joking guys, Brainfuck is an awesome, challenging language. I've tested the following code with bf-x86 compiler and rather big JSON file. I believe code is fully functional on a valid (!) JSON ...
35
votes
2answers
2k views

Random clothes generator

For the past four years I've attended a private school which requires its students to wear ties. I've found that it's far easier to figure out what combination of shirt, pants, and tie that go ...
30
votes
1answer
6k 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 ...
24
votes
2answers
6k views

QJsonView: A QWidget-based json explorer for Qt

I'm developing applications using Qt which highly make usage of the JSON language to communicate, store and load data of different types. I often need a simple viewer similar to the Firebug JSON ...
23
votes
3answers
6k views

Filtering a large (50gb+) JSON lines file matching CIDR's

I'm trying to speed up a Python script that reads a large log file (JSON lines, 50gb+) and filter out results that match 1 of 2000 CIDR ranges. Logfile 20 million lines ...
23
votes
2answers
2k views

To do tree application with undo/redo functionality

I am making a to-do tree application (Earlybird) in Python that will show checkable tasks/subtasks in a tree view. It includes higher-level groups of tasks grouped into blocks (e.g., Work block, Home ...
22
votes
2answers
1k 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 ...
19
votes
2answers
1k views

API for looking up Japanese postal code

Most of my experience is in Python, Java and embedded C, and I need to learn Scala and Play for a new job. As an exercise, I decided to create a very simple API for looking up area by postal code, ...
17
votes
4answers
4k views

User login database intended for beginners

I have been working on a small project intended for helping beginner Python programmers getting an idea of what a real project could be like (as opposed to programming exercises and such). This ...
15
votes
2answers
2k views

Minecraft block generator

This script is a tool to help minecraft mod development. When you want to add a new block to the game you have to create three json files. This script generates three JSON files in specific locations. ...
15
votes
1answer
1k views

Parsing log files of HearthStone: Loading card data without external libraries for JSON

I'm still working on a parser that can parse log entries from a game called HearthStone, the overall idea is that it will read the log file live when the game is running, parses the log file and show ...
15
votes
1answer
1k views

Simple xkcd comic downloader

I'd really appreciate some harsh/constructive criticism of what I would consider as my first program in Haskell. The program should download all of the xkcd comics into a folder in the current ...
15
votes
2answers
1k views

Gotta catch 'em all!

This week's challenge is essentially about fetching Json data from the Web, and deserializing it into objects. I don't have much time to devote to this one, so what I have is very basic: it displays ...
15
votes
1answer
290 views

Complicated article sort

In short I have a bunch of articles (~100k) which shall be ranked ("mixed", hence "newsmix") based on their newsValue (how important they are, between 1 and 10) and newsLifetime (how long they stay ...
14
votes
1answer
182 views

Download images from an image board based on tags and blacklists

This code is meant to download images from an image board to create a local backup. Images are grouped by tags selected by the user and then downloaded using multiprocessing. Normal use of this ...
13
votes
2answers
2k views

Current ISS latitude / longitude position

I'm looking into basic API examples and I've got the following to work as I want it to. Is there a better way to determine the direction of latitude and longitude? It feels like I could do it better. ...
13
votes
3answers
109 views

From Q to compiler in less than 30 seconds

As an adjunct to From new Q to compiler in 30 seconds, I've created a Python script to automatically download the markdown from any question on Code Review and save it to a local file using Unix-style ...
12
votes
2answers
167 views

A closer look at the chat's mumblings

The Go Playground was boring so I decided to make a small application that throws me into the language. It basically queries the chatroom every second for new messages and displays them in the output ...
12
votes
2answers
828 views

A minimal CLI password storage and retrieval manager

Its primary function is to retrieve+copy a PW to your clipboard. It'll also add, update, delete key/value(accountName/password) pairs from a JSON formatted dictionary(separate .txt file). It's ...
12
votes
2answers
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 ...
12
votes
1answer
65k views

Making a simple call to a server

Earlier this year, before I learnt about Code Review Stack Exchange, I gave this answer in response to a question about how to combine ASP.NET, jQuery, and JSON: I keep thinking that there must be a ...
12
votes
2answers
302 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: <...
12
votes
1answer
11k 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 ...
11
votes
3answers
2k 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+...
11
votes
3answers
8k views

Convert all CSV files in a given directory to JSON using Python

I am attempting to convert all files with the csv extension in a given directory to json with this python script. I am wondering if there is a better and more efficient way to do this? Here is my ...
11
votes
2answers
2k views

NewtonSoft Json.Net serialiser

I'm just starting to develop more in C# after being mainly a VB.NET developer and was looking for someone to critique my implementation of a NewtonSoft Json.Net serialiser. Can you provide some ...
11
votes
2answers
30k views

Merging multiple JSON files using Python

I have multiple (1000+) JSON files each of which contain a JSON array. I want to merge all these files into a single file. I came up with the following, which reads each of those files and creates a ...
11
votes
1answer
1k views

JSON C++14 library API/implementation [closed]

I'm creating a C++14 header-only JSON library for fun, learning experience and to use it in my personal projects. I'm looking for feedback on: Its API/interface: since I'm using modern C++, I want ...
10
votes
2answers
889 views

JSON Parsing in Bash

I have a json file which needs to be restructured. The following is the code. ...
10
votes
3answers
924 views

Displaying information about people from a JSON file

I'm working with Python 2.7.5 and I have written the following code: ...
10
votes
3answers
2k 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 ...
10
votes
1answer
157 views

Merging JSON and inserting into the DOM

I'm an aspiring junior dev. This is modified version of the code I wrote for a technical interview I did today (Didn't pass. Sad.). The problem was to fetch two json files, and display their data on a ...
10
votes
2answers
1k views

JSON parser in C#

I've writen a C# JSON parser, but its performance is not as good as JSON.NET. Running the same test, my parser takes 278 ms and JSON.NET takes 24 ms. What should I do to optimize it? It seems that ...
10
votes
0answers
446 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: ...
9
votes
3answers
2k views

Stack Overflow user info fetcher

I'm starting to look at Python and its facilities. I've just tried to make one simple program using some base libraries. I would like to hear some comments about anything you've noticed - style, ...
9
votes
4answers
8k views

Determine if a file is either in JSON or XML format

The purpose of this function is to determine if report_input_file is either in JSON format or XML format, this is what I came up with, just want to know if this is ...
9
votes
3answers
10k views

Simple JSON parser in C

Here is a simple recursive descent JSON parser, not a lot of extra functionality, although it does use the expandable vector class reviewed here (Simple expandable vector in C). I did not implement ...
9
votes
1answer
137k views

Getting multiple keys' values from nested object in JSON (w/out jQuery)

I'd like to ask if either my JSON data is ill-conceived and whether how I solved it is particularly inefficient/plain stupid/typical. Given the following JSON data: ...
9
votes
1answer
1k views

Using Reddit API in R

I'm scraping some comments from Reddit using Reddit JSON API and R. Since the data does not have a flat structure, extracting it is a little tricky, but I've found a way. To give you a flavour of ...
8
votes
3answers
2k views

Catching multiple types of exceptions when writing JSON

I have a class which throws a lot of exceptions: ...
8
votes
3answers
802 views

Soundcloud to CSV File

This program connects to Soundcloud and turns the supplied username into a CSV file with the user's like list. The code accomplishes this although it looks rather messy and was wondering what I could ...
8
votes
2answers
15k views

Insert JSON data into rendered template after AJAX call

I have an already rendered template and I want to update it with some JSON data I obtain via AJAX. The template as it is before rendering looks like this (using ...
8
votes
1answer
184 views

Timed requests and parsing JSON in Python

I wrote this tiny script to pull the JSON feed from the CitiBike website: ...
8
votes
1answer
191 views

Recursive parser from Binary to JSON output

Background I got this interview test and got declined due to not meeting their expectations, but never got a reason on what was bad and how they solved it. I want to improve and learn something out ...
8
votes
2answers
5k views

Reference implementation of HTML-to-JSON converter for PCG

I have opened a puzzle at Programming Puzzles and Code Golf. The question is not perceived well (yet) and one of the reasons is that no reference implementation is provided. To mitigate this ...
8
votes
1answer
34k views

Better way to fetch JSON data from a server from iOS app

I have successfully coded a network request to fetch JSON data from our server. The remote function is written in ColdFusion. However, the code is quite lengthy and involved. I also noticed in the API ...
8
votes
1answer
26k views

Optimize JSON insertion to SQLite (insert … on duplicate key ignore)

In current task, I'm refactoring the code of converting JSON file into SQLite database on Android device. Code compliant with Java 6. As a benchmark, grabbing the code from remote server takes ...
8
votes
1answer
58 views

JSON messaging queue with transformation and dispatch rules

I put together this code as part of a practice problem. The instructions for the program are to accept JSON messages, transform the messages and then dispatch them to the right queue according to a ...
8
votes
1answer
289 views

Parsing a Wikipedia page for a country

The program should accept a name of a country as input. It should then parse the Wikipedia page for that country and find all links to the wikipedia pages of other countries on that page and make a ...