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.
4
votes
1answer
49 views
Loading objects for users, roles, and groups from a query with LEFT OUTER JOINs
I have this function that returns me a list of users with their roles and groups. As you can see, this is how I fetch and create list of objects. I'm wondering whether this is a good approach and what ...
1
vote
0answers
15 views
Open JSON file: JSONDecodeError [closed]
I am trying to open a JSON file grabbed from the general twitter stream (e.g., https://archive.bk21.net/details/archiveteam-twitter-stream-2013-10). To do so, I use the following code:
...
-3
votes
0answers
38 views
fetching particular data from json [closed]
i am completely new to json.
i want to fetch only standard's values from json data file which is present in assets folder of android project.
i want to fetch only standards value from json into ...
0
votes
1answer
33 views
possible code optimizations while using JSONObject
I have following JSONArray object from a jsonobject key "elements"
...
4
votes
1answer
63 views
pyvdp - Python library for Visa Developer Program
I'm coming from PHP and recently started developing in Python. As a part of my self-study course, I developed a small library for access to Visa Developer Program APIs and published it on Github. It ...
2
votes
1answer
47 views
Gson to Model containing several return types for one key
i just had a problem converting the JSON from Phillips Hue Lights (Response) to a Model. Since it may contain several "unknown" keys in success and/or may contain just a String for success i had to ...
5
votes
1answer
60 views
Keep parsing JSON response until a field becomes false using GSON
I have JSON which is coming by executing a URL. I want to store all the value of id field in a List<String> by parsing ...
1
vote
1answer
46 views
TypeScript JSON-Array Validator
For my latest app I wanted to be able to code the front-end first, without having to do super extensive documentation and without forgetting my data types later on while coding the back-end.
I thus ...
4
votes
1answer
74 views
ValidationAttribute to validate a string against a JSON schema
This is my implementation of an .NET ValidationAttribute to validate a string against a JSON schema. The JSON schema file is stored within the application as an ...
1
vote
3answers
110 views
Post method exceptions with “if else” statments optimization and json object improvemnt
I would like to know how to know how can I optimize my current Post method , I initialize object where I am creating list of json items. Also how can I reduce many if and if else statments? For this ...
3
votes
1answer
83 views
Extracting JSON from string using regex
I need to get the value of item inside of this string and parse it as JSON. I've got some working code but I feel like it could be optimized (a lot) and cleaned up (a lot). Any tips or pointers are ...
0
votes
1answer
58 views
Javacript code to flatten JSON via recursion with conditional logic
I'm flattening a JSON structure where objects have their interaction type appended at the end, for use in an HTML/PDF generated file. I have variable names for Checkboxes, Text inputs, TextCheck is a ...
2
votes
2answers
259 views
Processing lots of JSON objects
I want to process a ton of JSON objects as quickly as possible.
I've done my best to make the processing as concise and efficient as I can.
How can I make it more efficient?
...
6
votes
2answers
80 views
Sending a Torrent magnet link using the Deluge JSON API
I have built this script that sends a magnet link to the client. As I never ever had any proper programming lessons I would want to ask you if this approach is good, if I am missing something, There ...
4
votes
0answers
73 views
Dynamically creating login screen on Android devices
This has been an experience. I'm well above "hello world" java is not a language I use often when programming and I don't program too much. I find myself a lot on Google.... basically just about for ...
3
votes
0answers
91 views
Firebase many to many relationship structure
I'm trying to create a logical and scalable many to many relationship data structure in Firebase. A user can authenticate with Facebook/Google, upload 3 photos, and a video. Users can also "star" ...
0
votes
1answer
45 views
0
votes
1answer
40 views
Parse JSON array into different Object using Reduce
I have an script that is receiving some JSON and then I am parsing it out using reduce. I am sure there is a more elegant way to do it.
JSON
...
3
votes
0answers
48 views
Passing a complex object across cross domain
I am working with two web applications, one is webform-based Site1 and other is an MVC application Site2.
TODO:
Pass a complex object from Site1 to Site2. In response get View from Site2 to Site1 ...
10
votes
0answers
117 views
Download images from an image board based on tags and blacklists
This code is meant to download images from an image board to create a local backup. Images are grouped by tags selected by the user and then downloaded using multiprocessing. Normal use of this ...
6
votes
3answers
526 views
Simple Product Inventory software using C# and OOP
I did this small program, as part of a list of coding exercises. The list proposes the coding of a small software that's supposed to manage an inventory of products. Here's what is requested:
...
2
votes
1answer
86 views
JSON pretty print
Here is my simple program to pretty print a JSON object. I'm looking for advice of better pretty print solutions, functional bugs, code style and algorithm time/space complexity improvements.
BTW, I ...
5
votes
2answers
55 views
3
votes
1answer
138 views
PHP Validate JSON objects with a JSON schema
I have a basic JSON API written in PHP. I want to validate incoming JSON data.
I know there are PHP JSON validators out there, here is a quick one I just rolled up.
...
4
votes
0answers
44 views
Encode object to JSON and encrypt with AES (with tests)
While the task at hand is relatively straightforward, it turned out AES in Go is a bit clunky so I was wondering if this seems right. Also, any tips on Go coding in general are more than welcome.
<...
0
votes
2answers
75 views
Nested file_get_contents / json_decode
I have this code but it takes over a minute to run. I'm looking at around 400 entries being brought back for the first loop. Any ideas on how it could be improved for speed?
...
4
votes
1answer
168 views
Writing CSV file from huge JSON data
I am writing a program that reads from DB and outputs to a CSV file. Besides the regular columnar data there are 2 JSON fields data as well. The table layout looks like this (other fields removed for ...
3
votes
0answers
43 views
Perl nagios plugin to query an api, obtain date from json, and determine if the date is within thresholds
This is an update of Using an API to obtain JSON data and get the date string and determine if data is stale
This is a nagios check that will use an API URL, get JSON data, flatten the data into a ...
4
votes
2answers
57 views
Getting JSON with jQuery, creating a function that displays the data from two separate feeds
I have written my first JavaScript program from scratch and am looking for advice to check whether it is efficient and effective or how it could be improved.
...
2
votes
2answers
82 views
Generic data converter for one type of data to another
I wrote a generic data converter that takes one kind of data and converts to JSON and XML types of file. Now, it reads data from the given ...
2
votes
0answers
40 views
2
votes
0answers
32 views
Cache for slow API
I work with an API which answers really slowly. I created a module which constantly asks the API and update some cached value. The code is degraded for study purposes:
...
6
votes
2answers
63 views
Using an API to obtain JSON data and get the date string and determine if data is stale
This is a nagios check that will use an API URL, get JSON data, flatten the data into a usable perl hash, and ultimately obtain a date string. Once the date is obtained, it should recognize the ...
0
votes
0answers
30 views
Implementation of dynamical forms for JSON ActiveRecord using JavaScript
I have some data in my database I store as JSON (PostgreSQL supports it). The data can be pretty flexible, something like work-experience, with names of previous companies and positions or education ...
1
vote
2answers
76 views
Checking an authentication decision in a JSON response
I've been working on this login screen logic.
It checks for the parameters in the JSON response to decide which action to follow. It works but it's kinda ugly and verbose. Any suggestions to ...
1
vote
0answers
40 views
Filtering and hiding content with React
This is some filtering logic, according to a simple data set:
Hiding tags (entertainment types/genres) that no longer are relevant
Representing the tags on levels (according to "tagelevel")
Stopping ...
1
vote
2answers
99 views
PHP create JSON file from Twitter API
I've been reading more on PHP JSON and APIs I wanted to play around and pull a user's tweets so I wrote a function that requires the TwitterAPIExchange wrapper.
The code:
...
1
vote
0answers
46 views
Class for managing (file I/O) data
I want to make an attempt to write my own simple RPG. As a preparation for this task I created a class which I could use to store/retrieve my in-game objects data to/from disc. I chose JSON format as ...
3
votes
0answers
35 views
Sorting upcoming events listed in JSON
I've written my first program in GO, a command line tool that parses JSON containing events from a file or from STDIN and outputs the upcoming events in sorted order. Please critique it!
...
4
votes
0answers
45 views
Angular directive to fetch resources to fill a table
I created a directive that solves my immediate problem, but I'm trying to find ways to make it more reusable.
My immediate problem was, I have a table and needed to fill in one of the columns with ...
4
votes
1answer
100 views
Testing a Pivotal API request client using lots of mocking
I have a class that is all about doing HTTP requests, and logging (in file system & database). It's only using 3 dependencies to do these things, so I'm fine with the code so far.
Here it is for ...
0
votes
0answers
37 views
Generating Django fixtures from .csv
I've written this script to create a Django .json fixture starting from a .csv.
The .csv must have 'model' and 'pk' fields. What do you think?
...
1
vote
0answers
35 views
Converting ActiveRecord array to JSON
I have two tables, devices and device_properties.
The devices table columns are as follows:
...
0
votes
1answer
53 views
Displaying a timetable
The following code displays a Timetable, but the code needs too long finish the whole process.
...
1
vote
0answers
24 views
JavaScript : Search highest ID in JSON-structure. Increment & return it
Task description:
Search the highest ID within a given JSON-structure: An array with objects as elements. Every object has a property "ID".
Then increment the highest ID and return it as a result. ...
1
vote
0answers
86 views
Populating an HTML table with JSON results
Could anyone suggest a better approach than the one I'm using now? I tried to keep it as minimal as possible, but this is the best I came up with. I did extensive research just to get to this point.
...
3
votes
1answer
338 views
Displaying JSON data from a server in a UICollectionView
This code pulls JSON from a server and delivers some data like imageURL, titleString and ...
3
votes
1answer
70 views
Finding an object in a nested object/array structure
I have an app with a bunch of questions defined in a yaml file. For various reasons I would like the data to be divided into sections (section_0, ...
1
vote
2answers
86 views
Taking some JSON data, converting the date format and calculating a user average
I'm originally a Java developer taking a stab at some Scala development. One of the main reasons I'm posting is because I know that in Scala you can write your code in a Java (OOP) way and it will run ...
1
vote
0answers
106 views
JSON schema visualizer
I have the following backbone function to read a JSON schema and draw the tree structure (as in the screenshot below). I want to make sure if checking against the type as object/array is alright or if ...