How do I turn a repetitive string into a function?

At the moment I'm getting information from an API - I want to convert that information onto my site in a more user friendly way to see. The issue here is that the amount of the variable that I'm looking for keeps changing along with the answers in it...
more »

2017-12-03 23:12 (1) Answers

How do I define classes for this JSON?

https://pastebin.com/P13GjAGy My JSON is at that link. It's too long to be posted here. I created an ArrayList of type Binding(class) in a class Result. And in Binding, I have objects of type Symbol, Open, High, Close, etc. In them I have Strings ...
more »

2017-12-03 23:12 (0) Answers

Reading content from REST web service in MATLAB

I'm using the webread() function to retrieve sunrise and sunset data from the sunrise-sunset.org api here. here is what my code looks like: function [E_total] = solar_energy(lng, lat, yr, month, day) % Generate URL url = strcat('https://api.sunris...
more »

2017-12-03 18:12 (1) Answers

Do I need a map using @POST with jersey in tomcat

I'm trying to create a rest API with Jersey in a tomcat server, my application collects input from other services (no database). I have created the following pojos: //this a pojo for parameters the application takes in the @POST request, a location ...
more »

2017-12-03 12:12 (1) Answers

Remove null values from json file javascript

I am new to javascript and I have encountered a problem I need to remove all null values from a json file. But I have not been able to get it I have tried different methods that I found on the site but they do not work for me. One of the ways I found...
more »

2017-12-02 23:12 (1) Answers

Angular - upload file as base64

I am trying to upload files from Angular 4 app to a JSON API service that accepts base64 strings as file content. So what I do is - read the file with FileReader.readAsDataURL, then when user confirms the upload I will create a JSON request to the ...
more »

2017-12-02 01:12 (1) Answers

Efficient query to join three tables

My app has a users table, a teams table, a teams_users table, and an assessments table. Oversimplified: **users** id **teams** id **teams_users** team_id user_id **assessments** id user_id team_id A user can have many assessments. When I grab ...
more »

2017-12-02 00:12 (1) Answers

Passing JSON object into a list

I am new to programming and have a json object with data related to a coin. I want to take the data from the json object and display it using google charts. However I can't seem to be able to get it working. Any input is appreciated. Json object ...
more »

2017-12-01 19:12 (1) Answers

Get jsons value with js

I want to get the "appid" of this json but the problem is that the objects title change during the time so I need a js code where the "appid" is selected by being the first (second, third) object in the list. I tried this but it doesn't work :( var ...
more »

2017-12-01 15:12 (7) Answers

JSON data not coming through from Django REST API

I have a Django REST API with an Angular Front-end. I am getting no errors on the front-end, but no json data is logging to the console. I have a service like so: import { Injectable } from '@angular/core'; import { Http, Response } from '@angular...
more »

2017-11-30 19:11 (1) Answers

append new data to json file in python

I have bellow json array in a data.json file [{"type": "Even", "id": 1}, {"type": "Odd", "id": 2}, {"type": "Even", "id": 3}] and i was trying to append new data to this json file using this code def foo(filename, dict_data): with open(fi...
more »

2017-11-30 17:11 (2) Answers

Mapping json to multiple Pojo classes

So I'm working on a project for a Java class and I need to fetch weather data. I'm using the weather underground api. I haven't really learned yet how to do APIs so I'm self taught. I've gotten a location API working by using JsonSchemaToPojo to cre...
more »

2017-11-29 21:11 (0) Answers

Creating a JSON object from Google Sheets

I am trying to learn AppScript and I am using Google Sheets as an example. I want to create a simple JSON object using some data populated in the Sheet. Table Example Name ID Price Qty ABC 123 100 1 DEF 342 56 2 HIJ ...
more »

2017-11-29 15:11 (1) Answers

send json object on form submit

i have a usual form. the only thing i'm trying to differently is group 3 of the input values into a json. and when i click on submit, i want to send other inputs as usual but those 3 as one json. I have made it into json using jquery but unable to un...
more »

2017-11-29 08:11 (3) Answers

Validate A Game Board, And Fast

I am creating a multiplayer Battleship game using an Apache/PHP server (yes, I know Node would be much better for this, but I'll get around to learning it later). Anyways, I am at the point in which both players are uploading their game boards to sta...
more »

2017-11-29 06:11 (3) Answers