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.
5
votes
0answers
90 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 ...
-2
votes
0answers
19 views
Draw a map from encoded polylines [on hold]
I'm using the google maps web services service to find a route. From the json response I parse it encoded polylines and store it on coordinates String.
Then, coordinates is passed as parameter to ...
2
votes
0answers
19 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
14 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
15 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
85 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
...
1
vote
2answers
45 views
0
votes
1answer
76 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:
...
4
votes
1answer
33 views
Consolidating a raw csv of two ids to grouped set of ids in json
The file I'm processing here is an outputted file from a Java library called duke.
Its goal was go through all purchases made on a site and group them into a single customer. The output is a csv ...
8
votes
1answer
708 views
Loop through JSON and create prefab in Unity3D
I am creating an app in Unity3D and it is my first time coding in C#.
I use the following code to parse a JSON file hosted on my server and use the information to render prefabs within my scene:
...
3
votes
1answer
27 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
67 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 ...
4
votes
1answer
1k views
JSON templates in Python
I am looking for a general review of my project here. I have written some Python, but not enough to feel confident in my ability to produce idiomatic code.
...
0
votes
0answers
74 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
60 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 ...
3
votes
1answer
69 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
34 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
94 views
Dealing with messy JSON API and UTF-8 encoding problems
I am using an API that returns a JSON object that has "encoded_polyline" fields that tend to result in errors like this one:
UnicodeEncodeError: 'utf-8' codec ...
4
votes
1answer
119 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 ...
12
votes
2answers
2k 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 ...
16
votes
2answers
513 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 ...
3
votes
2answers
49 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 ...
7
votes
2answers
66 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 ...
1
vote
0answers
41 views
2
votes
2answers
66 views
Parsing JSON string from HTTP request
HTTP request is made, and a JSON string is returned, which needs to be parsed.
Example response:
...
2
votes
1answer
463 views
Java JSON Stringifier with the Nashorn API
I have written a Java JSON stringifier with the Nashorn API. Since this code is slow, I wanted to ask if I can improve it. My target is the highest possible performance to make it an alternative to ...
0
votes
2answers
956 views
UDP server and JSON parser script
I am a Python beginner and wrote a script which should run on a Raspberry PI as a UDP server. It reads and writes to a serial device and has to process and forward JSON strings.
Because there is ...
4
votes
1answer
54 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 ...
12
votes
1answer
2k 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 ...
3
votes
1answer
42 views
Song search app with dynamic tables
I decided to make a Ruby app to search for songs, which uses the tinysong API. Things got really cryptic and weird in the view. I managed to get dynamic tables that adjust to data length, but I feel ...
1
vote
1answer
54 views
Converting table data into nested JSON
I'm new to C# (coming from a JavaScript background) and it seems like this code could be greatly improved.
This SQL query:
...
4
votes
1answer
7k views
Getting JSON with jQuery and creating lists with click events calling more jQuery and JSON
I have two elements on my page:
<ul id="VerticalMenu></ul>
<ul id="AccordionMenu"></ul>
I'm calling some JSON with jQuery and loading ...
14
votes
1answer
258 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 ...
1
vote
0answers
64 views
Custom `Decodable` for enum
I need to implement a decoding in the next JSONs:
First variant:
{}
Second variant:
...
6
votes
1answer
393 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 ...
8
votes
1answer
18k 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 ...
0
votes
2answers
951 views
JSON API in C++ with Node.native, RapidJSON, and MySQL
I was hoping I might get some feedback and ideas for improvement on this, particularly the WebRouter class.
...
7
votes
1answer
305 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 ...
1
vote
2answers
46 views
Reloading selects with JSON
My JavaScript code is slow for large inputs. However, it is especially slow in IE. The browser will freeze for about a minute while the select is being reloaded. Any ideas for how to optimize this ...
3
votes
1answer
63 views
JSON extraction
Given the code below, is there a better way to essentially create different native objects without changing the native constructor or the nativeList.json file? The only option I can see is adding a ...
5
votes
3answers
372 views
Login for desktop application
I am building a login using an API call to a URL that returns JSON data. The login works and is functional but in terms of "correctness" and "professionalism", I am looking to get input from some of ...
1
vote
1answer
73 views
Rendering JSON array as a tree
This code is working fine for me, but I want to simplify it.
Function parents is defining parents of the tree and children ...
4
votes
1answer
117 views
Daily Desktop Background
I've created a simple command-line program that downloads the Bing Image of the Day, then sets it as my desktop background.
It is a console application, and closes immediately after setting my ...
6
votes
1answer
214 views
JSON serializer using generics rather than System.Object
I recently created a custom static class in C# to encode, hopefully, any object it is given (or collection of objects), because I was, at the time, unaware of a native C# library that did the same ...
5
votes
1answer
74 views
Uses game API to post stats about user when requested
First Python script, so my code is pretty laughable. Sensitive information has been redacted. One thing that I'd like to point out is that there is an inconsistent use of '' and "". This is an old ...
1
vote
1answer
36 views
Testing class that transforms JSON into a spreadsheet
I am creating unit tests but the class uses objects that have long JSON. What can I do to improve the readability of this?
In tests, only insert those JSON really needed for the test. The class I ...
4
votes
2answers
150 views
Asynchronous HTTP JSON request
For asynchronous requests, I use Alamofire.
I have created one method for requesting async data.
...
3
votes
1answer
66 views
4
votes
2answers
116 views
Fetching the definition of a word using a REST API
This is the code I'm using to GET the definition of a word from Wordnik's REST API. I don't want to ignore any error but this is causing the code to be ridiculously long. I'm new to Swift so I'd ...
4
votes
1answer
72 views
Create Java object from from page content or plain text
My job is to make a specified java objects from web page that contains following text:
Companies:
...