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.

learn more… | top users | synonyms

1
vote
0answers
8 views

Script to migrate event, artist, and venue information from MongoDB to Drupal

At first I brute forced the migration to just get it finished. However, the procedural program mixed the events with the venues so I rewrote it, this time using classes which I'm just beginning to ...
1
vote
0answers
16 views

Flask json rpc2.0 extension

I created a simple extension to handle JSON RPC 2.0 requests on flask I would like some feedback regarding usage here is an usage example: ...
1
vote
2answers
34 views

Fetching data from nested JSON using jQuery and displaying in table

I'm displaying JSON data in a tabular format on a html page using jQuery. In the function I'm looping the resp.DATA once to get the key names so it can be ...
6
votes
1answer
45 views

C# Regex to extract bug ID from Bugzilla JSON response

I have written a series of Regex.Replace() lines to take an input like {"id":36} and convert it to ...
1
vote
1answer
40 views

Google Maps coordinations JSON to object

I am trying to write a parser from JSON data which I get from Google requesting coordinates of a city, which will create my specified object structure. For parsing, I've written a custom ...
1
vote
2answers
30 views

Building categories block based on JSON

I'm not even sure if this is how you're supposed to do it, but this is what I have so far: ...
3
votes
0answers
56 views

Streaming Json Serialization Using C++

I've written a C++ library for serializing objects to a stream as Json with the following goals in mind: Minimal run-time overhead (write the contents of an existing object/array to the stream ...
4
votes
1answer
66 views

GitHub API client

Here is my Haskell program designed to list all of my GitHub repos along with their descriptions and languages via the GitHub JSON APIs: ...
7
votes
1answer
46 views

React & ES6 news app

I have written a small app that fetches news items from an endpoint and displays them in a grid. I used React to create components and use them throughout the app. This is the first thing I have ...
-1
votes
1answer
40 views

Proper Use of Keep Alive For Loop

I'm working to make a thread that monitors a web API to get the latest announcement via JSON. I cannot test this currently, so I'm unsure if anything needs to be changed with this. I've read through ...
2
votes
1answer
52 views

Read decibel level from a USB meter, display it as a live visualization, and send it via FTP

This question was posed to me by someone in my university's athletics department who had a USB sound level meter and a simple Python script which printed the current sound level (he was provided with ...
4
votes
1answer
139 views

PHP script to download json file and display data

display.php: ...
4
votes
2answers
97 views

Getting a substructure in a JSON-file

I'm currently playing with D3.js. While doing so I use this JSON-file as a data source: http://codepen.io/chriscoyier/pen/taqCe Example of the structure: ...
1
vote
1answer
50 views

CakePHP login action returning json

I have some questions on how I can improve this "add action" (method) in "controller": I'm using the add action only if post request. Is it correct? This ...
1
vote
0answers
59 views

Parsing JSON with generics

I get back two dictionaries, I need to parse through them and put in an array two objects. I think I did a very poor job and I have a feeling there is a better way to make the code more compact and ...
4
votes
1answer
40 views

A simple parcel checker Python script

My current student accommodation uses a manual paper and pen system for checking if students have mail so I made this simple Python script to help mitigate the problem of manually searching through ...
3
votes
2answers
52 views

Join JSON objects on common property

is there an easier/more efficient way to join two JSON objects on a common property than this? It's a GeoJSON file (basically an array of objects), and I want to pull in a property from another JSON ...
4
votes
3answers
219 views

Using argparse with parameters defined in config file

I understand that and why using eval is generally considered bad practice in most cases (see e.g. here). Related questions on config files and argparse don't use ...
3
votes
1answer
64 views

Downloading and parsing data

I developed this class to download a JSON from a server, parse the result and call a delegate back on the class that called it. Since I am self started I want to know if this is a good practise. ...
2
votes
1answer
39 views

JSON C pull parser

Back in the day in addition to DOM and SAX parsers for XML another parser type was relatively popular -- pull parsers. Recently I was looking for a JSON parser and figured that most JSON C parsers are ...
2
votes
1answer
88 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 ...
1
vote
2answers
49 views

Finding the differences between two revisions (or objects)

This detects the difference between two objects (or revisions): ...
4
votes
2answers
112 views

App to list books from JSON data

I recently submitted the code for this for an 2 hour interview but I was rejected. The app shows book information with a image, title, and author. Each entry has a title but some entries have no ...
0
votes
2answers
45 views

Concatenating multiple strings from a JSON response

I would like to concatenate a series of strings populated from an XHR response. So, I've chosen to do it like this: ...
3
votes
1answer
58 views

Renaming video files based on episode title lookup

I'm new to F#, so I've ported an old Python script I have to F#. It scans a directory for files named something like Game.Of.Thrones.S01E02.xvidblahblah.mp4 or ...
5
votes
3answers
81 views

Checking for an undefined nested variable in a JS object

Is there a better or shorthand way to perform a check on whether or not a variable within (possibly several levels of) an object is null or undefined? What I would currently do to check is: ...
4
votes
1answer
119 views

Converting string to dict using Python ast library

I have been trying to convert a string of dictionary objects as given below ...
4
votes
1answer
86 views

Convert XML files to JSON and move them

What the code does (tested basic, no errors, usecase): Reads all XML files (ending in .yin) from a directory. converts each to JSON store it in another directory, ...
0
votes
1answer
151 views

Fetching of JSON data through an API with AngularJS

I have been trying out AngularJS and developing a mobile application to test out its features and I wanted to see if I could somehow refactor to make my JSON response hopefully quicker in fetching the ...
2
votes
0answers
597 views

CSV to JSON conversion in Java

Since I've looked far and wide for a good example of this to no avail, I have created my own using the JSONArray and JSONObject ...
1
vote
1answer
87 views

Retrieving objects from JSON URLs

This is an accounting program (and my first attempt at a web app of any kind) where users need to get and retrieve objects from different JSON URLs and at different levels. Rails is used for the back. ...
1
vote
0answers
98 views

Create JSON object from self-nested LINQ query

I created this function to created nested JSON object using a Linq query. How can I optimize this and make it more readable? ...
7
votes
2answers
330 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 ...
3
votes
1answer
59 views

Generating JSON from a query

I am trying to generate JSON from a query. All this seems to be too much grinding it out. ...
2
votes
1answer
18 views

Saving and loading parts of configuration

I have a piece of code where I have string pairs (eg. 'a' and 'AA'), where both have their own unique ids. Id for first object is configured by user and second id is received at some point during ...
2
votes
0answers
128 views

Optimizing D3 Stream Graph Code

I have two javascript functions that generate a D3 Stream graph. I feel I may be excessively and unnecessarily iterating over my dataset to get it into the desired form. How might I optimize or ...
3
votes
1answer
468 views

Building Weather Forecast from JSON with optionals

I am looking for the best way of parsing JSON in Swift 2.0. I have this JSON ...
0
votes
2answers
342 views

MySQL JOIN to JSON array

I'm building a HTTP API and this part should return a JSON list of posts and their attached photos, like this: ...
3
votes
1answer
46 views

Complex sorting of nested data

I am retrieving data from Postgres (jsonb type) and I need to return an OrderedDict that has a predictable order for human and machine consumption. There are some ...
2
votes
1answer
158 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 ...
0
votes
0answers
98 views

Appending JSON values to the DOM

My code below uses JSON to append images into the DOM. It works properly but I want to optimize my JavaScript to see if I can write it in fewer lines or if there are methods I can use that optimize my ...
-1
votes
2answers
445 views

Program that filters JSON data based on user selection

I have made a basic program using AngularJS that displays data from a JSON file, and filters it according to the user's selection (specifically FIFA 15 chemistry cards). I did plenty of CSS work to ...
1
vote
2answers
55 views
3
votes
1answer
124 views

Second attempt at Hangman in Swift

I recently posted my Hangman game, and got some amazing feedback! The main thing suggested was to create a word generator that could read JSON files so that my hangman brain class didn't have to ...
3
votes
1answer
115 views

XSL template for converting XML to JSON

I used saxon v9 to profile an XSL transformation which converts XML to JSON. The profiler tells me that the function which escapes certain characters takes about 70% of the total processing time. The ...
4
votes
1answer
158 views

Iterate JSON GIF collection array to HTML file

I've written a piece of code which utilizes a for loop to iterate this array in JavaScript. This is my first attempt and I wonder if there is an optimal way to do ...
7
votes
1answer
94 views

Configuration concept and implementation

I created an API to load, save and read user configuration in my application. I've a Configuration interface which provides the basic methods to read, save and read ...
7
votes
2answers
141 views

Generating random HearthStone cards: Preparing the training data

For a little toy project of mine I need to have data available in a certain format in order to be able to feed into a Recurrent Neural Network (Long short term memory), it uses HearthStone card data ...
3
votes
2answers
58 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 ...
4
votes
1answer
76 views

Concatenating a SoundCloud Playlist Update JSON

I am currently working on an implementation of SoundCloud for a 3rd party iOS app, and as there is no SDK anymore I am doing all my calls via Alamofire. This is what SC expects you to send in your ...