The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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
9
votes
3answers
11k 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 ...
0
votes
1answer
673 views

REST API design using spring boot

The following API caters to CRUD operations on users and their corresponding filters (kind of rules). These filters are applied on incoming data from various sources basing on user and then a variety ...
2
votes
1answer
815 views

Overriding properties at runtime but not for serialization

I have a use case where I need to deserialize some settings from a JSON file and override their values at runtime but when then configuration is saved, I want to keep the original value. Imagine a ...
2
votes
2answers
560 views

Infinite scroll for currency list

I made infinite scroll for a currency (in the code below: valute) list. The currency list is fetched via an AJAX-request from a remote server. After it starts the script displays 10 records. After the ...
3
votes
2answers
69 views

Object value-column mapping

How could I improve this code to not use so many _.each calls and not always verify the object emptiness of its properties (or basically trying to make more ...
1
vote
0answers
37 views

Java Market Summary - JSON

I am writing a java program that will print current market values from a websites api. I used gson to parse the incoming json and Timer to run it every 5 minutes. I was wondering if this was the best ...
1
vote
0answers
32 views

Factory method to make JSON requests for various types of list items

I have the following code: ...
1
vote
1answer
347 views

jQuery looping on fields after validation

I have the following code: ...
1
vote
1answer
501 views

utility class for reading in JSON

I'm reasonably happy with the execution: ...
0
votes
1answer
632 views

Golang visitor pattern for marshaling shapes as JSON, and XML

I was trying to implement visitor pattern in Golang, and came across an idea of using a generic func type instead if interface ...
2
votes
2answers
113 views

Optimise many namedtuple assignment statements [closed]

I'd just like to know if there's a way I can reduce the number of namedtuple assignment statements in the code below. The actual program has over 60 assignment ...
4
votes
2answers
508 views

Python script using Minneapolis / St. Paul Metro Transit's API to tell you how long till next bus

I have written a program which will tell you how long it is until the next bus on “BUS ROUTE” leaving from “BUS STOP NAME” going “DIRECTION” using the api defined at http://svc.metrotransit.org/. ...
1
vote
1answer
161 views

Mapping JSON object to HTML

This is a continuation of previous questions. I just started using react and I've managed to fetch a xml file, convert it to json and then loop through the data. But I think there should be a better ...
2
votes
1answer
357 views

Scrape a reddit post submission for comments and save comments to JSON file (revised)

This is the revised code after incorporating the suggestions from user Roman Susi. Link to the previous post here. Notable edits: I have factored out the bigger functions into smaller tasks. The ...
4
votes
1answer
541 views

Scrape a reddit post submission for comments and save comments to JSON file

Edit: For a revision to this code according to the comments, see here: "here." In regards to the code involving shortlinks and ...
2
votes
1answer
244 views

Handling several types of messages over a web socket connection

I have a UIViewController with a Socket Connection established once viewDidLoad. This web socket is a multi-directional ...
0
votes
1answer
1k views

JSON API call in an Angular service

I have followed this format in my application to call the API and get data from it: ...
2
votes
0answers
191 views

Search GitHub users when text field changes in Kotlin Android app

Problem: Search for users by their name using the GitHub API (sorted by the number of followers) and display the results in a RecyclerView. Implementation: Hitting the GitHub API every time when user ...
1
vote
0answers
99 views

Parsing .xls database export into a JSON-formatted database import

Input: Row at index 0 is always the titles of each column. Columns will always be expected to be properly arranged for the chosen format. There may be empty or incorrectly formatted ...
0
votes
1answer
1k views

Return a Promise for a JSON POST

Given this method, we don't know which syntax is the more appropriate. ...
1
vote
1answer
43 views

Listing blog posts, each of which may belong to multiple categories

I have 3 tables like this: ...
0
votes
1answer
60 views

Best practice to load settings to the web application

I have to load settings to an app when it's opened (It's an Electron application and I'm loading settings from the local json file) I'm loading settings right after the page is loaded: ...
1
vote
1answer
2k views

JavaScript sidebar menu with subitems from a Json Object

I'm kind of new to pure javascript and I wanted to try an exercise that I saw around the web. The exercise was to build from a json object (was not included in the exercise so I had to improvise ), a ...
3
votes
0answers
606 views

Implementing a JSON-serializable ORM model

I implemented a library which, amongst other things, implements a JSON-serializable ORM model based on the peewee framework. Here's the relevant excerpt: ...
3
votes
2answers
621 views

Serializing a class hierarchy to JSON

I have a hierarchical object structure which needs to be converted to JSON. I have a following basic implementation of how it will be done: ...
2
votes
1answer
338 views

C# class for translatable string

I would like a class to store a default string, and also store translated values for that string. The results will be stored in json. I'm looking for a peer review on how this could be improved. My ...
1
vote
0answers
337 views

Log visitor info like latitude, longitude to a database

I am collecting each visitor information like ip, lat, longitude, referrer and language and save it into db, then in db I have column in table with counter that increment if user revisits the web site ...
5
votes
1answer
10k views

Get a specific value from a big JSON response

I have this code to access travel time from the Google directions api JSON result: ...
0
votes
1answer
38 views

JSON-ification and processing of data with Python

My script looks like this: ...
4
votes
1answer
118 views

Simple angular app - Shopping website

In looking for a bit of feedback about an Angular app I have created. I'm new to angular I want to clean up the loose ends before I carry on and add new functionality. Below is the code snippet of ...
2
votes
1answer
357 views

Making currency rate requests in Java with CompletableFuture

here is my code to get quotes for forex pairs, using the CurrencyLayer API, with CompletableFuture. We do an HTTP GET, parse the JSON response and map it into my data structures (see sample output at ...
0
votes
1answer
1k views

File upload in AngularJS causes browser out of memory error

I have an AngularJS code to perform upload of files. At first I thought it works OK but when I've tried to upload bigger files (e.g. 5 files, 10 MB each) then I saw that this code has very poor ...
3
votes
1answer
529 views

Small DSL: Converting JSON to MSSQL query

Scenario Once upon a time, there was this human (ahem, me, ahem) who tried (and succeeded) to build a small program which would convert JSON to a MSSQL query using Python 3.x. How does it work? The ...
3
votes
1answer
369 views

Returning the results of four $resource calls as a JSON array in AngularJS

Title pretty much says it. I need a way to elegantly handle multiple $resource calls in AngularJS. Right now, I just calling each other call on the ...
2
votes
1answer
5k views

Load JSON from server using jQuery and display it in html5

I am just starting with JavaScript and jQuery, so I appreciate your help! I want to read items from a JSON file like this: ...
1
vote
1answer
90 views

Ruby Hangman with JSON to save and load

This was an assignment from "The Odin Project". This is my first program using JSON. I've been told I need work on structuring my classes, any advice will be appreciated! https://github.com/jmooree30/...
2
votes
1answer
65 views

REST-API 3rd party resource model class

I'm working on an integration for Magento 2 with a 3rd party. This class will fetch the articledata resource. This resource contains multiple items, with a maximum of 750 per call. The class is ...
12
votes
2answers
841 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 ...
5
votes
1answer
64 views

My simple jQuery website returns JSON data from two different servers

I'm looking advice from more experienced people about how I can improve my code. I also want to make my code object-oriented (create classes in separate .js files) but I don't how best to do it. How ...
3
votes
3answers
6k views

ES6 Javascript (React) code that maps and filters JSON data

I have the following code in my React app that creates tags out of JSON data: ...
2
votes
1answer
63 views

Small module for getting JSON to work with in Python

I currently have a module with Class / Methods I want to use in other scripts. Recently chess.com released a read-only REST API for beta-testing. The methods in my class build a URL for the API ...
2
votes
2answers
112 views

Optimize function for assigning existing 3D array values to values of keys in array of objects

I have JSON data from a Google sheet in a 3D array like this: ...
0
votes
1answer
67 views

JSON data serialization [closed]

I'm parsing a JSON data send from server to new JSON Object using JavaScript. JSON data from server will be in this format SERVER JSON: ...
-1
votes
2answers
98 views

Practicing Java servlets, MySQL and JSON - follow-up

(See the previous iteration.) What's new I have incorporated all the points of Dmytro Maslenko's answer. My code seems a little bit tidier. Code AddPersonController.java ...
1
vote
1answer
568 views

Practicing Java servlets, MySQL and JSON

(See the next iteration.) Introduction This is my attempt at a simplistic web application just for the sake of practice. I have three main servlets: ...
0
votes
3answers
1k views

Testing whether a string contains valid JSON by calling json_decode()

I had a code review and got told by the senior programmer that it was very bad programming practice to use the json_decode() function of php to determine if a string was not in JSON format. My ...
2
votes
1answer
812 views

Converting a JSON object to XML to be passed to an ASMX webservice

What I have is a scenario where we need to be able to call any ASMX web service and pass any data structure to it that has been constructed on the JavaScript side. Until now, I have been creating ...
1
vote
0answers
50 views

Node.js Cryptocoin wallettracker

At first I thought this was going to be easy, but the asynchronous Node.js really made things difficult for me. Currently, my tracker only features one coin and the address is hard-coded. I plan to ...
2
votes
2answers
225 views

Counting data points, grouped by country, occupation, and age, for charting

I would like to chart my data. However, the data I get from server needs to be completely transformed, and I would like to transform it as quick as possible. I believed reduce would be the best way to ...
2
votes
1answer
73 views

Serializing output of a match result web scraper

This is a follow up to a previous question. As part of learning the object oriented approach and web scraping in Python, I've set out to write a program that will give me match results of ...