Questions tagged [api]

API, for code implementing (NOT using) an Application Programming Interface. A program's API defines the proper way for a developer to request services from that program, site and/or service.

Filter by
Sorted by
Tagged with
27 votes
2 answers
3k views

C++ API for interfacing with Lua

I wanted a good way to move objects back and forth between Lua and C++, and I didn't want to use anything like LuaBind or the other available libraries I could find, so I instead wrote this. It's ...
Alex Ames's user avatar
  • 463
25 votes
2 answers
27k views

Sending a C++ array to Python/NumPy and back

I am going to send a C++ array to a Python function as NumPy array and get back another NumPy array. After consulting with NumPy documentation and some other threads and tweaking the code, the code is ...
rowman's user avatar
  • 304
23 votes
3 answers
3k views

Parsing log files of HearthStone: The log reading API

I'm still working on a parser that can parse log entries from a game called HearthStone, the overall idea is that it will read the log file live when the game is running, parses the log file and show ...
skiwi's user avatar
  • 10.7k
15 votes
3 answers
5k views

Building a better Collection. Enumerable in VBA

VBA's 'Collection' is.... lacking, so, I've been working on a better Collection object that implements many of the features of C#'s Enumerable. This is very much inspired by this question and a follow ...
RubberDuck's user avatar
  • 30.8k
14 votes
1 answer
3k views

Nested Sets in JavaScript

I created a procedural implementation of the nested set model in JavaScript. The use case for this small library was that the front-end(presented as an MVC) needs to traverse hierarchical data from ...
nand's user avatar
  • 161
14 votes
1 answer
1k views

Tick. Tick. *breathe* BOOM! - Setting up real, stable asynchronous callbacks with WinAPI Timers in VBA

WinAPI Timers can be quite tricky to work with, as anyone who's tried to use them and fallen foul of one of the many pitfalls probably knows. Problems such as screen freezing, crashes, uncontrolled ...
Greedo's user avatar
  • 2,345
13 votes
2 answers
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. ...
Luke's user avatar
  • 1,100
12 votes
2 answers
3k views

Async wrapper around public API

Tear it apart. I'm mostly concerned around the appropriate use of ConfigureAwait(false), and possible poor handling and duplication of the ...
Prescott's user avatar
  • 225
12 votes
1 answer
275 views

Inspector Rubberduck

Our Rubberduck open-source VBE add-in project is coming along nicely. One of the main features we're going to be implementing in the next release, is code inspections. I started by defining an ...
Mathieu Guindon's user avatar
12 votes
1 answer
414 views

The thing that makes API requests

I'm creating a thing that does things. Part of the things the thing does is querying an API for information about movies and TV shows. The API allows me to query for changes to their data so I will ...
Jeroen Vannevel's user avatar
12 votes
2 answers
1k views

Java API without exposing implementation details

I am creating an API for consumption by other developers to interface with an internal framework. My goal is to be able to have the developers type something like: ...
cldfzn's user avatar
  • 165
12 votes
2 answers
6k views

Managing a programmatically accessible stack trace

VBA has a call stack... but there's no programmatic way to tap into it, which means in order to get a stack trace for a runtime error, one has to manage it manually. Here's some example code that ...
Mathieu Guindon's user avatar
11 votes
2 answers
10k views

Logging into WebAPI 2 site from c# desktop application

I'm trying to login into a webapi2 site from a desktop application. After a lot of googling, I cobbled together a working prototype. Since we are talking about security I wanted to do a peer review. ...
Sander Obdeijn's user avatar
11 votes
2 answers
1k views

Date Format provider

I am facing a issue with an API to handle dates in Java. I am not a very experienced programmer and my English is very bad. Problem I'm working in a large project with many subsystems, and I want to ...
Arturo Volpe's user avatar
11 votes
1 answer
400 views

Writing PDF files in C#

I have been making C# software to write PDF files. It's intended to be simple to use, compact, efficient and also reasonably simple to understand, maintain and extend as required. The basic ...
George Barwood's user avatar
11 votes
1 answer
529 views

Wrapper class for the Rotten Tomatoes API

I'm working on a site that has to do with movies. I am consuming the Rotten Tomatoes API to get my movie information and using EF5 with a code first approach to get that into the database. I'm using ...
bflemi3's user avatar
  • 211
11 votes
2 answers
2k views

Parsing log files of HearthStone: The API

I am working on a parser that can parse log entries from a game called HearthStone, the overall idea is that it will read the log file live when the game is running, parses the log file and show ...
skiwi's user avatar
  • 10.7k
11 votes
1 answer
1k views

JSON C++14 library API/implementation [closed]

I'm creating a C++14 header-only JSON library for fun, learning experience and to use it in my personal projects. I'm looking for feedback on: Its API/interface: since I'm using modern C++, I want ...
Vittorio Romeo's user avatar
10 votes
3 answers
1k views

General purpose replacement for enum with FlagsAttribute

Enums with the FlagsAttribute have the disadvantage that you need to be careful when assigning their values. They are also inconvenient when you would like to allow ...
t3chb0t's user avatar
  • 44.2k
10 votes
4 answers
404 views

XmlCmdBuilder - doing away with inline xml

I have to work with a 3rd-party API that allows me to define and execute "commands", using XML. Since I don't like seeing mixed abstraction levels, I managed to remove all the inline XML / string ...
Mathieu Guindon's user avatar
10 votes
1 answer
154 views

Key Press Handler

I have made a class to import into my projects to more easily handle the state of the keyboard so I can use stuff like: if(Keys.returnKey(37)){ As opposed to ...
Kris Welsh's user avatar
10 votes
1 answer
7k views

Simple yet Hackable WhatsApp API [UNOFFICIAL]

There is no official WhatsApp API. Here is a simple python class which satisfies the need. ...
VISWESWARAN NAGASIVAM's user avatar
10 votes
1 answer
3k views

Multi-dictionary API using Python Flask-RESTful

I'm working on a simple online dictionary tool, using Python Flask-RESTful as the RESTful API backend. The dictionary tool is modular, it can handle multiple dictionaries, implemented as independent ...
janos's user avatar
  • 111k
10 votes
1 answer
262 views

Linq-to-Sage Implementation

Following-up on my last question where I wrapped the Sage API with a familiar IRepository interface, I decided to push the abstraction a step further, and... ...
Mathieu Guindon's user avatar
9 votes
4 answers
3k views

Player data collection program

I'm working on a program that uses the RIOT API League of Legends for collecting player data and calculate how skilled a player is by using a grading system (as of right now it just the average of the ...
drakebakincake's user avatar
9 votes
2 answers
480 views

Responding to API requests with much complexity

So having used the SE API multiple times, I like how all responses are in a Wrapper object, and for my own API design I figured it was a good method to follow. Of ...
Der Kommissar's user avatar
9 votes
3 answers
783 views

Carousel in Vanilla JavaScript

I finally got my carousel to work in JavaScript, and I want to know what you guys think about it and what I can do better. ...
Jordan Baron's user avatar
9 votes
2 answers
2k views

Python Export Decorator

In Python, we use __all__ to explicitly denote the public API of a module or package. That looks like this: ...
Aaron Hall's user avatar
  • 1,558
9 votes
5 answers
4k views

Providing unchecked exception "wrapper" interfaces for an API with checked exceptions

I recently had a discussion in the forum of an API, because they changed an exception from checked to unchecked. I believed it needs to be checked, because it is recoverable. The arguments of "the ...
Bozho's user avatar
  • 191
9 votes
1 answer
155 views

Mixed-width operations for std::bitset

When I was looking to use std::bitset instead of GCC's __uint128 in my RDS error-corrector, I found that it was hard to use, ...
Toby Speight's user avatar
  • 74.4k
9 votes
1 answer
214 views

Flight API querier

I am learning Go and wrote a small application that queries the Skyscanner API as my first attempt at learning. I was hoping someone more expert than me in the language could look over it at broad ...
Spencer Stolworthy's user avatar
9 votes
1 answer
2k views

Simple cryptocurrency portfolio rebalancer

EDIT: the code has been changed significantly since the OP based on the first posted answer and some refactoring. Feedback on the general design of the app itself is still more than welcome. The ...
KBriggs's user avatar
  • 193
9 votes
1 answer
3k views

Getting all likes from a specific user on a news wall with fewer graph API calls

Right now, my solution counting likes of a specific user is Starting a recursive call on the "/{user-id}/posts" edge Iterate through all posts On each post iterate through each like on the likes ...
Cornelius Bütikofer's user avatar
8 votes
4 answers
3k views

API method to validate Facebook OAuth token

I am new to Java / OOP and I'm concerned that I have a method which is doing far too much "stuff" - but I don't easily see how it can be shortened in a way which is not contrived / arbitrary. This is ...
user92462's user avatar
8 votes
2 answers
5k views

Security of API Keygen for a cryptocurrency trading platform

Here is an API key gen script for a cryptocurrency trading platform I am building. First it checks to see if a key exists in the db for the user ID. If it does exist, it displays the key. If it doesn'...
r3wt's user avatar
  • 472
8 votes
1 answer
1k views

League of Legends Summoner Analysis

This program will ask for user to insert summoner and base from the last 20 games of said summoner, it will give avg stats and see if good or not by wins in last 20 games(a simple grading system). <...
drakebakincake's user avatar
8 votes
2 answers
1k views

Efficiently parsing JSON response data in python

I'm using this API to get information on sports-betting odds. I am then processing it in Python to discard the irrelevant information. Here's what the response looks like: ...
jtb's user avatar
  • 185
8 votes
2 answers
600 views

Microservice that fetches data from REST repository endpoints on Github

I have code in Python 3 where I fetch data from the GitHub API, and I want some advice on the architecture of this code. ...
E.Mohammed's user avatar
8 votes
1 answer
345 views

Normalize whitespace and describe string

The most valuable of all talents is that of never using two words when one will do. Thomas Jefferson. NuGet and GitHub I found it useful to automatically normalize string content a little bit and ...
Dmitry Nogin's user avatar
  • 6,131
8 votes
1 answer
206 views

A PHP API which has an endpoint for processing a user's facebook login details

I'm working on a PHP API for my angular JS Phonegap application. At the moment I'm focusing on working with a user's facebook public profile data. I'll explain the process a little first: The user ...
Sarah's user avatar
  • 401
8 votes
1 answer
124 views

ArXiV Technical Paper API Github Repo

My name is Ethan and I am trying to build an API for scaping technical papers to use for developers. Right now it only works for ArXiV but I would greatly appreciate some mentoring or a code review of ...
evader110's user avatar
  • 133
8 votes
1 answer
635 views

Stack Exchange API Python library

I wrote a package a few years ago to make my interactions with the Stack Exchange API more straightforward. I've maintained it over the years and used it in several scripts I've written that interact ...
Andy's user avatar
  • 181
8 votes
1 answer
182 views

The effect of typing a sentence out

The following code is complete and works perfectly. What I want to do to is make it more modular in a way where I can use the code again - similar to an api. I also hardly ever code in javascript, ...
Menelik Tucker's user avatar
8 votes
2 answers
474 views

Django API Implementation

I am building a backend to a mobile application that will be hosted on a Django site connected to a PostgreSQL database. I have never built anything to accomplish this before and this is my first go ...
KDEx's user avatar
  • 151
7 votes
4 answers
2k views

If/else produce code duplication

I have the following class: ...
takotsubo's user avatar
  • 209
7 votes
2 answers
15k views

Clean call api from client, with good practice

I am working on architecture where I can have any client + server API. I need to call API as clean as possible and get, post, put any object I want to. For me, it is important to have clean secure ...
Raskolnikov's user avatar
7 votes
3 answers
19k views

Getting weather data from Open Weather Map API

I'm trying to make a simple app in C# that gets the weather data from http://openweathermap.org/api (OWM). Here attached are two classes that I use to initialize WeatherData for selected City and to ...
Dominik Roszkowski's user avatar
7 votes
2 answers
334 views

Java command-line API client to fetch Bitcoin exchange rates

I am building a simple Java command-line application. And I want to know the best practice and make my code clean. Can anybody suggest to me how many different classes I can make and what more method ...
forhadmethun's user avatar
7 votes
1 answer
234 views

Build a set of REST interfaces using Symfony framework

I have got a technical challenge from a company but they reject my code and I'm not sure how to do this challenge in a more efficient way so I'm here to get some guidance. The Technical challenge was:...
Muhammad Shahzad's user avatar
7 votes
2 answers
2k views

C++ wrapper for graphviz library

Background The code below is (obviously minimally) ripped out of a current live project. The project does reasonably sized data extraction, cleaning, analysis, clustering and visualisation (on a ...
Oliver Schönrock's user avatar

1
2 3 4 5
12