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

0
votes
0answers
66 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 ...
-3
votes
0answers
48 views

Send JSON data on HTML Form with ajax type POST [closed]

Hi am traying this code it will help me. In this code the html form field converting into json object and send it via ajax on server using type POST. ...
-1
votes
2answers
34 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
60 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
28 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
107 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
2answers
51 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
41 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
47 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 ...
2
votes
2answers
61 views

Parsing JSON string from HTTP request

HTTP request is made, and a JSON string is returned, which needs to be parsed. Example response: ...
1
vote
1answer
45 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: ...
1
vote
0answers
64 views

Custom `Decodable` for enum

I need to implement a decoding in the next JSONs: First variant: {} Second variant: ...
3
votes
1answer
30 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 ...
4
votes
1answer
67 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 ...
1
vote
2answers
44 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 ...
5
votes
3answers
346 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 ...
4
votes
1answer
98 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
134 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 ...
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
112 views

Asynchronous HTTP JSON request

For asynchronous requests, I use Alamofire. I have created one method for requesting async data. ...
3
votes
1answer
56 views
4
votes
1answer
61 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: ...
4
votes
2answers
103 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 ...
2
votes
1answer
227 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 ...
1
vote
2answers
154 views

Reading data from database, saving to new list and adding list to grid

I made some changes to how I was saving the data in order for it to show up on a kendo grid. Right now my giant method is getting data from the database (using ...
3
votes
1answer
53 views

Fetching, processing, and storing Mixpanel analytics data to SQLite

I'm a self-taught Python programmer and I never really learned the fundamentals of programming, so I want to see how to improve upon this script and make it adhere to best practices. The script has ...
1
vote
0answers
29 views
7
votes
1answer
72 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 ...
3
votes
2answers
122 views

Generate URLs from a complex JSON object using recursion

My task is here as follows : Input : A complex/nested JSON object with nested arrays as well objects Output : A JSON object that contains a set of URLs with their titles: ( key,value ) ...
1
vote
1answer
79 views

Inner loops within Python from multi-dimensional JSON

I am writing an application that consumes a JSON web-service in Python. I have an outer loop and inner loop, my inner loop is pretty ugly; how can I codense this to function more like my outer loop? ...
5
votes
0answers
568 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 ...
5
votes
1answer
73 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 ...
2
votes
0answers
43 views

Restful API for parsing records

I'm trying to implement my own API. This code excerpt should show the basic working routines. The storage is temporary an in-memory-array and the only HTTP method for now is POST. I outsourced the ...
8
votes
3answers
282 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 ...
4
votes
1answer
91 views

Numerate every item in dict

I have a .json file with a complex structure: dict in a dict, it has no constant structure and is dynamically changed. The goal is to make new dict where the keys are numbers of hierarchy and values ...
3
votes
1answer
122 views

Creating a menu as nested unordered lists from JSON data

I have a JSON input using which I have written below function to recursively create an unordered list. Is there more precise way to achieve it? ...
-1
votes
1answer
34 views
15
votes
2answers
227 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 ...
5
votes
1answer
73 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 ...
12
votes
2answers
133 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 ...
2
votes
1answer
44 views

Return JSON data based on GeoDjango Queryset

My code below returns a JSON data based on user's input or query in my HTML page or template. However, I need to modify or do some tweaking with my JSON data in order for me to use it in my datatables ...
6
votes
1answer
256 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 ...
0
votes
0answers
48 views

Building JSON array containing HTML

So, One of my companies developers wrote this. Not me. Alright, it was me. How can improve this puke? ...
2
votes
1answer
697 views

Swift extension: Dictionary<String, AnyObject> to JSON string for URL parameter

Here's a quick extension for [String: AnyObject] dictionaries in Swift. The output needs to be in the following format (order and spacing don't matter): ...
4
votes
2answers
87 views

Return existing values inside database

Here's a method inside my controller that reads the values of angle and point data from my database. Then it grabs the data and adds it to a new list and sends the JSON to the view. I can't simplify ...
5
votes
2answers
66 views

App for displaying pictures to like

I am making an app that shows some pictures and you can like each picture. I am sending a POST request from the Android device. In my backend I have a Python script that takes parameters category and ...
0
votes
0answers
47 views

Calculate discipline level from attendance record given a set of rules

I have written an attendance calculator that compares a set of rules against an employee's attendance record and determines what level of progressive discipline that employee is at (how much trouble ...
2
votes
1answer
60 views

Controller to list users

I think I put too much code in my controller that was supposed to go in the model. This is a part of my controller, I'm not gonna paste everything since there is a lot of code. ...
2
votes
1answer
43 views

Getting distinct array of objects

I would like to get a distinct array of objects. The code below is the first thing that came to mind. Do you see any room for improvements? ...
7
votes
1answer
105 views

Small console app to execute some remote scripts

I'm learning F# and functional programming, from a background in C# and imperative/OOP. I've ported a small, one-off console app from C# to F#. The port worked (the app behaves the same way), but I'd ...