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
1answer
32 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
55 views

Asynchronous HTTP JSON request

For asynchronous requests, I use Alamofire. I have created one method for requesting async data. ...
3
votes
1answer
48 views
4
votes
1answer
48 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
81 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 ...
0
votes
0answers
13 views

Avoiding duplicate values in jQuery array [closed]

I have the following code for using with select2. I am using Ajax to get the JSON from Mashape API. I received the object and can retrieve the value into tags. But I am having few values repeating. ...
2
votes
0answers
43 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 ...
2
votes
2answers
78 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
25 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
11 views
7
votes
1answer
45 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
102 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
71 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
148 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
47 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 ...
0
votes
0answers
11 views

Node.js - Asynchronous JSON query (probably easy fix) [migrated]

I apologize if this is a stupid question, but I am new to Javascript and Node.js really hurts my head because it is asynchronous. My goal is to query for a JSON object from an API and be able to work ...
2
votes
0answers
30 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
172 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
81 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
43 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? ...
0
votes
1answer
26 views
15
votes
2answers
187 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
68 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
127 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
35 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 ...
4
votes
0answers
102 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
44 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
107 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
76 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
58 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
33 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
59 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. ...
1
vote
1answer
33 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
79 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 ...
0
votes
0answers
26 views

Jekyll plugin for creating CSV files

I recently created a gem for Jekyll plugin to create some CSV files. I put a little more effort into it and tried to make it something that others might be able to use. I'm a little lost on how to ...
2
votes
0answers
28 views

Song search app with dynamic tables

I decided to make a Ruby app to search for songs, it 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 like ...
2
votes
1answer
128 views

Empty an array on focusout - jQuery UI Autocomplete

Is it good to empty an array on focusout? ...
2
votes
1answer
64 views

Web API controller to get details of a travel plan or a leave request

My web API has 3 controllers for get, post and users CRUD. I named it as DetailsControllor, FormControllor and ...
0
votes
0answers
40 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 ...
3
votes
2answers
275 views

Data Persistence

I was wondering if I could get some feedback on the library I created to persist data online. JitterPushDemo.java ...
0
votes
0answers
52 views

Make knockoutjs model simpler and avoid full observable array refresh

The form creates / updates /deletes a category. The category is simple: ID and name properties in backend (Laravel) model. UI: Clicking on a category enables "edit mode": I need 2 things here: ...
8
votes
2answers
134 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 ...
5
votes
2answers
62 views

Command line utility to output modified Markdown

What this command line utility does is to take a text file and update the content a bit before turning it into Markdown. For example, the first for loop searches all the straight quotes and replace ...
8
votes
3answers
377 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 ...
2
votes
0answers
137 views

PDF-to-JSON converter

I've created some methods to help me convert PDF to text and then text to a JSON object. I've never done this before and I'm using this exercise as a way to improve my knowledge of Ruby. The ...
14
votes
1answer
234 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 ...
3
votes
0answers
33 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 ...
2
votes
0answers
158 views

Get local Dropbox path with Delphi XE7

I've put together a function in Delphi XE7 which returns the Dropbox directory path on my machine, as this path can be customized by the user. This function currently works on my computer, but it ...
1
vote
0answers
33 views

Improving JavaScript processing of Ruby Regex

I have a basic webapp that basically serves the same purpose as Rubular.com, but for gsub. It runs some simple JavaScript, which POST's to a Sinatra app, which then updates page with the results. ...
1
vote
1answer
61 views

Python script to convert hierarchical JSON to LaTeX itemize

I have the following JSON: ...