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.
0
votes
1answer
37 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
241 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
62 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
52 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 ...
-1
votes
0answers
24 views
Swift 3 pod Alamofire 4.3 ObjectMapper 2.2 pod and AlamofireObjectMapper 4.0 [closed]
Here is the API response which I want to parse into the model file.
API Response: Link
...
3
votes
0answers
24 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
28 views
0
votes
1answer
35 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
42 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 ...
8
votes
0answers
107 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
503 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
65 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
47 views
3
votes
1answer
92 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.
...
3
votes
0answers
32 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
57 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
139 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
28 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
55 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
69 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
36 views
2
votes
0answers
29 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
57 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
28 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
65 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
34 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 ...
0
votes
2answers
73 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
40 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
40 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
96 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
32 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
31 views
Converting ActiveRecord array to JSON
I have two tables, devices and device_properties.
The devices table columns are as follows:
...
0
votes
1answer
48 views
Displaying a timetable
The following code displays a Timetable, but the code needs too long finish the whole process.
...
1
vote
0answers
20 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
52 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
244 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
67 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
83 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
84 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 ...
3
votes
2answers
52 views
Parsing and saving JSON result from GoEuro API
I am new to python so I decided to write a script that parses a json array and writes data in a file.
I wrote the code that does that but I think it can be done way better, So I was hoping to get ...
2
votes
1answer
84 views
Loading attributes of cars and orders from JSON
I am creating an application that deals with cars and orders.
A order contains a car and other information (BUYER, OWNER, ...), which constructs an orderObject.
...
3
votes
1answer
95 views
Decoding and encoding JSON for a PHP service
I am writing a PHP service which will listen for JSON requests (made using jQuery) and will return the JSON responses.
The whole template for such services (there will be 5) I have shortened into ...
3
votes
1answer
48 views
Managing Httpcache from C# using JSON configuration
I have written an efficient way to control data to be cached/not-cached in HttpCache using JSON and C# controlling it.
The reason for this implementation is to make use of existing application ...
2
votes
0answers
23 views
Selectively flatten JSON structure
Today I spent quite some time on providing a solution for a Stack Overflow answer. It looked quite easy to me, but my solution is complex.
The question can be found here and this is my answer.
If I ...
0
votes
0answers
49 views
Sending JSON from a checkbox form
I coded this, which is working but I think there is a better way to do this.. I have a form where the user can check from checkboxes. For each checkbox I have multiple info that I want to send to my ...
2
votes
1answer
117 views
Combining json responses of recursive web service calls with PHP and curl
I'm implementing the Hotel Price List API from Skyscanner. This requires a first call to the service to implement a session followed by 1 or more calls to the service to get the actual results. I've ...
1
vote
3answers
92 views
3
votes
2answers
142 views
Search and sort customers from JSON file
I have just completed my first JavaScript/jquery project. It searches customers from .JSON file and sorts them by name or ID. Everything just works fine. The thing is, I am not sure that I have ...
2
votes
1answer
52 views
Reverse lookup ID by value
Is there a faster way of getting the key of 1 or 2 by using the accs value for my getID function? Unfortunately I cannot use an ...