Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

1
vote
0answers
27 views

Arabic language lesson program Part 2

This is the second time I am asking for a review of this code (first time can be found here: Arabic language lesson program). The goal of the program hasn't changed - to house Arabic language lessons ...
2
votes
1answer
28 views

Read gzipped JSON file from URL

I am requesting a JSON file that's gzipped. First, I download file: ...
0
votes
1answer
50 views

Parse JSON strings as tables using Python

Needed a simple CSV file that had headers and no nesting of data to consume in Tableau. The JSON file I was consuming had nested dictionaries and lists (which sometimes had in themselves nested lists/...
1
vote
1answer
96 views

Extracting a list of objects from a repository as JSON

Currently, I am using the below code to make JSON data from list of objects. ...
0
votes
1answer
28 views

Saving Reddit posts and comments from JSON into ArrayLists

I'm trying to get and save in an ArrayList Reddit posts and comments. The code is very similar for both: The RedditThing is a parent of RedditPost and RedditComment: ...
1
vote
0answers
28 views

Python Text RPG Item Management System (with CLI tool for creating JSON files)

I've been working on a full RPG skeleton for a while, and I've just now reached a point on the module dealing with items where I feel comfortable sharing. My intent was to create a structure for the ...
1
vote
0answers
19 views

Simple json config provider

I'm pretty new to this so constructive criticism is acceptable. I'm trying to find any way I can improve this system, all it does is take a string, determine if that string is a web address or a file ...
2
votes
1answer
40 views

PHP RSS/XML reader basic class

I write this class to process and output xml/rss feeds. I'm still working on, but any suggestion will be appreciated. As a little trick if the xml file come from an online resource, I've added a ...
0
votes
1answer
42 views

Python client to fetch JSON data from REST API, retrying on failure

As a beginner, I'd like to see if anyone can suggest any better way of coding the below, as I'm duplicating code and nesting identical if statements as part of the following problem. I'm grabbing ...
6
votes
0answers
59 views

Using decorated methods in a subclass of deque to dump its state to a JSON file

I am sub-classing an object in python and I need to overload a bunch of the methods with very similar logic, essentially a call to super() and then some additional operations. I want to avoid ...
3
votes
2answers
79 views

Using Python to create a JSON file of recipes from MySQL

I needed to create a JSON file from a couple of MySQL tables to migrate some recipes from wordpress. This was my first time writing a script in python and would like to get some feedback on what I ...
2
votes
1answer
27 views

Encoding multiple rows from prepared statement in php

I have this code that hypothetically returns multiple rows from a database and encodes them in a JSON. I am wondering if this is the best and most presentable way to do it. Note: I am using msqli ...
2
votes
0answers
14 views

Looping JSON to get matching values from Database

I have a need to take in a payload that looks like this: ...
1
vote
1answer
51 views

Updating entries in a JSON file

I have the following Data.json file and I would like to update some of the values. ...
6
votes
0answers
61 views

HoloLens Unity program

I recently finished writing an HoloLens proof-of-concept program. It involves generating a user interface based on a connection with an OPC server. OPC involves industrial PLCs, one or more PLCs send ...
2
votes
1answer
81 views

Store nested json repsonses in relational database

The goal is to collect market data from a free rest api. The response is in json and size per response is above 1MB. I want to get at least updated data once per minute which means about 24h * 60min * ...
4
votes
2answers
65 views

Type-safe JSON deserialization

In a Python (3.6) application I receive messages from Kafka in JSON format. (The code base makes heavy use of static type annotations, and every file is automatically checked using ...
4
votes
2answers
59 views

Fetching data through HTTP and caching JSON result in a file

The task is to fetch some JSON data from an API with a GET request. If the location is not available for any reason, read a cache file. Otherwise write the cache file for future use. The following ...
2
votes
3answers
91 views

Converting objects into JSON and using the StringBuilder

In my scenario I have list of object in C# code and need to be converted into JavaScript object. But there are certain condition, where the value of the object might be dynamic based on certain key. ...
2
votes
1answer
159 views

Looping JSON in WebAPI Controller and Add new Property

I have a json array that is being passed into a function. Whenever the function comes across a field (call it Field1) in a record with a value that starts with "@!!!@" the function compile them into ...
3
votes
1answer
74 views

Extracting text from Bundestag proceedings as directed by XML files, and exporting to JSON

I have a long script here that does the following for me: I have 9000 XML files, from which I parse information, and then in about 7000 TXT files find the information out, and in the end it all save ...
17
votes
4answers
3k views

User login database intended for beginners

I have been working on a small project intended for helping beginner Python programmers getting an idea of what a real project could be like (as opposed to programming exercises and such). This ...
6
votes
2answers
321 views

Scan similar files in different directories and report differences

I wrote a program in Python that scans all files in a directory, makes dictionaries with stuff like date of creation and a hash of the contents of a file. Then i scan another directory which is just a ...
1
vote
1answer
273 views

Slow Converting from JsonArray to ArrayList

I have to convert a JsonArray to an ArrayList but unfortunately the code below is used very often during the execution of the program! How can I speed it up? Java: ...
2
votes
1answer
39 views

Convenience function for writing files in CSV, JSON, etc

The McCabe code complexity of the following function is 19 as found by pytest --mccabe test.py (from my toy-project mpu). While ...
0
votes
1answer
58 views

Live search project

I have a live search project and I don't know if it's secure enough or not. I don't access it directly, but I get data by JSON so I shouldn't worry about slashes or quotes, right? The PHP code: <...
3
votes
0answers
152 views

Show 3d models loaded via asynchronous request

First I explain the data to give context: We have the following folder structure: ...
4
votes
1answer
554 views

Trying to map JSON to different classes in web API [closed]

I have a controller action that takes JSON bodies. I know, that the JSON is either of type A or B, where both classes are of ...
1
vote
0answers
360 views

Function to Return a JSON Like Objects Using VBA Collections and Arrays

My goal is to create a compact function that can create a JSON Like object from JSON string. I want a function with a small footprint that I or anyone who wants to use it, can simply paste into a ...
3
votes
1answer
49 views

React pagination without JSX

I've published my first react project for pagination purposes. It's likely I'm making mistakes or there are any improvements to my code. I'd appreciate if anyone has any offers. ...
0
votes
2answers
366 views

Return json to browser via MVC controller for morris chart

Program is written in .Net Framework 4. Class: ...
0
votes
0answers
156 views

Fetching and displaying API data as an HTML list

I've written the following which works but it's the first API I have written and I just wanted to see the general opinion of what could be done differently in a better way so I can learn more and ...
0
votes
1answer
30 views
3
votes
2answers
1k views

Convert Json response to object array

I'm looking for the best solution. Here is a response from server and i need to get Organizations list: ...
6
votes
2answers
163 views

Program to calculate some stats from Facebook messages

I've written a program that parses JSON downloaded from Facebook to calculate some stats from a conversation between two parties. It attemps to count these things: Messages grouped by day of week ...
5
votes
2answers
273 views

Apple receipt validator

I'm working on a solution for validating Apple receipts. Here's the repository as whole. I based it mostly on the gdx-pay-server library. In my implementation, one of the classes I want to improve is <...
2
votes
0answers
336 views

Read and write to multiple json files

We have some json template files that get deployed to our prod, QA, integration, dev servers. Various fields need to be changed depending on the server being deployed to. Right now, this is done ...
0
votes
1answer
19 views

Get real time geojson on Javascript

I frequently need to obtain some info about coordinates, because I have dynamic elements on a map (in Openlayers). So I use SetInterval and XMLHttpRequest Object to do it. ...
24
votes
0answers
867 views

JSON formatter in your least favorite language

Just joking, guys, Brainfuck is awesome challenging language. I've tested the following code with bf-x86 compiler and rather big JSON file. I belive code is fully functional on a valid (!) JSON input....
0
votes
0answers
60 views

Normalize JSON for Single Level Children

The goal here is to normalize or flatten JSON: [{ "parent_key": { "child_key_1": "child_value_1", "child_key_2": "child_value_2" } }] To ...
5
votes
2answers
105 views

Convert JSON from a webservice to text file

I get list JSON text from a webservice and list_of_columns is predefined, I need the output in that format. I am not sure about few things which are as follows I ...
0
votes
0answers
169 views

Replace Every JSON Key's Instance with Value

Given the following using the Ammonite REPL: ...
2
votes
4answers
204 views

Set of jQuery .click functions

Restaurant Menu It works how I want it to, but the way I've written the jQuery looks like it could be simplified. How can I rewrite the jQuery so it does exactly the same thing but in much less code? ...
3
votes
1answer
416 views

Fetch, parse, and store JSON in PostgreSQL

I was given a task to read JSON from a URL and then parse it in python. Each field will be assigned to a variable to store the value. The value will then be stored into postgres table. Example of ...
2
votes
0answers
92 views

Determine the country by an IP

EDIT: I have updated the code, if you have comments about the previous version of the code, please do post them anyway. The task is to determine the country by an IP. Provided programme queries two ...
6
votes
2answers
107 views

Web Request Utility

Our company consumes a lot of telemetered data from sensors which we consume via an API. So I wrote a method to consume them a bit easier for internal applications. I didn't add a generic to the ...
1
vote
0answers
47 views

Parsing a JSON array from a JSON object

So its my first time using Kotlin, and for now I am converting old Java code to Kotlin. I took a simple function to parse a JSONArray from a ...
1
vote
0answers
20 views

Suppressing debug for JSON in FW/1

I am trying to suppress debug with doing a JSON request. Is this too early or too late in the request lifecycle? Is there a better variable to tap into? In application.cfc ...
2
votes
1answer
35 views

Generate a Json from Strings using Jackson library

I am pretty new to Java and I got a requirement of converting Strings to a json structure. My below codes works fine but I have to create multiple objects and my code looks bit ugly. I want to know ...