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
3
votes
0answers
543 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
607 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: ...
1
vote
1answer
233 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
312 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
9k 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
37 views

JSON-ification and processing of data with Python

My script looks like this: ...
4
votes
1answer
115 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
332 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
482 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
335 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
4k 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
86 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
829 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
5k 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
111 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
97 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
534 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
734 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
185 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
71 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 ...
4
votes
1answer
8k views

Insert data to PostgreSQL

Im inserting data to a PostgreSQL database using the below function. Im not very happy with the solution for the IF statements to handle the adaptation of Python <...
3
votes
2answers
241 views

Generate thousands of JSON documents in Go

I recently decided to try to learn the Go language. In order to do this, I wrote a small program which parses a JSON configuration file, and generates N bson documents according to its properties. ...
0
votes
1answer
57 views

Clean up PHP & MYSQL code (Picked up by Swift as blog reader iOS app)

New to PHP and was just wondering if any improvements can be made, maybe increase efficiency or just clean up code? I know I'm using an old MYSQL maybe we can update it. Just want to make sure the ...
3
votes
0answers
577 views

D3 Force-Directed Graph with Numerous Functionalities

I have a d3.js force directed graph that is driven by the code below. I am relatively new to d3, and much of the code is pieced together from various examples found online. If anyone has a moment or ...
3
votes
1answer
86 views

Scraper for parsing email-ID using email sending button

I've written a script in python with POST request which is able to send email using send button and then catch the response of that email and finally parse the ID from that. I don't know whether the ...
5
votes
1answer
505 views

Creating ICS calendar events from JSON-like file

the purpose of this code is to take a Taskwarrior (it's a todo list application) server file that is mostly JSON and create unique ICS calendar events. The logic mostly works: I still see some ...
3
votes
1answer
707 views

JSON Cache Program

I have some code that is intended to be a package (so that it can be accessed via import cachejson). Here is the code for the package: The update variable is ...
4
votes
1answer
107 views

Selecting which variables to read from file

I'm reading in data from an external file. The data comes in different types, both integers and strings and is shown here: ...
1
vote
0answers
2k views

Reading and storing nested data

I'm reading data from a json-structure that describe aquariums and how many fish they contain (among other things). Overall, the structure of the data is like this: "house" "info" "animals" "fish" ...
3
votes
1answer
417 views

Reading values from a file and assigning to another class

I'm assigning values to an object by passing it to another class. Basically, I'm reading values from a file and assigning it by passing it to another class. This is the POJO class for the details in ...
2
votes
0answers
120 views

Scraping data from json response using twofold request

I've written a script which is able to get javascript encrypted links from a webpage and then using those newly produced links by making another request It can reach the target page and going there it ...
2
votes
1answer
1k views

Populate TableView with JSON data

I basically want to display JSON data in a TableView. The TableView always displays a List ...
6
votes
1answer
49 views

ItemFactory Class - Creates copies of predefined items by name and returns by pointer

I'm working on writing a text based RPG game, and I've decided to define each possible item as a JSON file in a specific directory. The item factory is meant to act as a singleton, and uses static ...
23
votes
3answers
6k views

Filtering a large (50gb+) JSON lines file matching CIDR's

I'm trying to speed up a Python script that reads a large log file (JSON lines, 50gb+) and filter out results that match 1 of 2000 CIDR ranges. Logfile 20 million lines ...
4
votes
1answer
8k views

Creating a array of custom objects from JSON, sent using PHP from a MySQL database

I'm using PHP to send data in JSON to create an array of custom objects in Swift. I've been told retrieveData() is bad code because it's in an infinite loop. I'm ...
1
vote
0answers
674 views

Scraping json data using vba

I've created a scraper using vba which is able to parse json response. When I was thinking of using scripting dictionary or json converter to scrape json data I could notice that applying split ...
5
votes
1answer
757 views

Using chartJS in Angularjs to plot IOT data

I am a Javascript and AngularJS beginner. Below is the code inside my chartController. What this does is get IOT data from a back-end call and display it in my front-end with a chart. There are two ...
2
votes
1answer
325 views

Restructuring a file to JSON

I created a program that parses a Credit Reporting file which is in the Metro 2 file format as described here. Parsing a file is generally trivial but the issue is that in this case, there are no ...
7
votes
2answers
392 views

Tic Tac Toe implemented With jQuery table pseudo-buttons

I made this code myself and was experimenting with making buttons from a table, and decided to make a game of Tic-Tac-Toe with it. The code loads from JSON a grid, and then makes a Tic-Tac-Toe game ...
4
votes
1answer
2k views

Generic Json parser c++

I am implementing a json parser in C++. I have written some code and wanted to share it on Stack Overflow. While writing this program I assumed that the json will only have objects and arrays are ...
3
votes
1answer
7k views

Filtering JSON by object property value

I am attempting to filter JSON into an array of arrays containing a property value based on the product. The form is as follows: ...
13
votes
2answers
2k views

Current ISS latitude / longitude position

I'm looking into basic API examples and I've got the following to work as I want it to. Is there a better way to determine the direction of latitude and longitude? It feels like I could do it better. ...
4
votes
1answer
3k views

Mapping a CSV with UTF-8 encoding to JSON in Python

I'm not a programmer, just a guy who needs to solve particular things using code. I needed to create a JSON from a CSV with predefined headers. I'm downloading an attachment from JIRA (REST API), ...