API stands for Application Programming Interface. A program's API defines the proper way for a developer to request services from that program.
3
votes
2answers
96 views
Save multiple group permissions in one go
The method SaveGroupStepPermissions(...) is a database API class.
If an error occurs within the method the exception is trapped. Whether this is good design or not ...
0
votes
0answers
19 views
Logging the start and end time of an API call to the log file [closed]
Here is a code sample that I am planning to log for every API call. Can you make it more useful, cleaner and easier?
...
0
votes
0answers
28 views
A generic interface for nearest-neighbor data structures
I have written the following interface to represent data structures such as VP trees that perform nearest-neighbor searches.
...
4
votes
1answer
70 views
Uploading data to Google Drive
I have created a project which uploads data from my local storage to my Google Drive account using the Google Drive API.
You can read about how to run it on its Github repository.
The main script ...
2
votes
1answer
27 views
Using GetTempFileName api function to check write access to a directory
On windows, to find out if I have write access to a directory, I found that it is easiest to just create a file in that directory.
In order to do so, I found ...
4
votes
1answer
61 views
GitHub API client
Here is my Haskell program designed to list all of my GitHub repos along with their descriptions and languages via the GitHub JSON APIs:
...
4
votes
1answer
49 views
Function outcome: consistent approach and easy logging
My goal is to make a consistent and easy way to determine how a function fails/succeeds. I'm looking for code review of my Status class for any bad practices, code ...
0
votes
1answer
45 views
Angular JS $HTTP for nested array
I'm using a factory for my $http get requests.
When I pull single json objects from the $http, it works pretty quickly
I now have items coming through as an array. It is very inefficient, & ...
8
votes
4answers
854 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 ...
3
votes
2answers
37 views
Finding all restaurants at given lat/long in Python
This is a program I wrote to grab restaurants/bars from Google, Yelp, and Foursquare. It then ranks them more effectively based on the rating, the number of ratings, and the number of data sources ...
5
votes
0answers
98 views
Using commands as deferred behaviour
I was thinking of building a really flexible fluent API for my persistence layer. One of my goals is to achieve somehow the following result:
...
3
votes
2answers
127 views
Searching the Foursquare API with Python
I'd like some feedback on the readability, style, and potential problems or issues.
foursquare.py
...
1
vote
0answers
207 views
Node.js module architecture for third party API
(If my questions below code seems too broad for coderewiew, please feel free to downvote this topic)
I'm writing a node.js module that is basically a wrapper for some API functions of third party ...
7
votes
3answers
79 views
Ruby module for Docker DNS updates
I wrote a Ruby module to update DNS zones on certain events of the Docker API. Its purpose is to make container reachable by their name over a network. I know this is also possible through ...
1
vote
0answers
45 views
Dictionary operations on a Binary Search Tree data structure?
today I tried to code all the dictionary operations such as Search, Successor, Predecessor, Minimum, Maximum, Insert, Delete etc. for a Binary Search Tree data structure using the Java programming ...
4
votes
1answer
54 views
String formatting of unit types
I have a units of measure library that I added string formatting to. Here is sample code:
...
2
votes
3answers
229 views
A Get method for an API, with three modes
Is this good way to create a get API method with different service methods?
Based on the scope parameter, it decides what service method in the API to call.
Enum:
...
2
votes
2answers
124 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 ...
1
vote
0answers
189 views
JWT - Simple API example
I have created this fake API just because I want to learn how to use JWT. It is a simple unsigned token exchange with two methods call: login and adminPassword.
I've used ...
3
votes
1answer
99 views
Web API Interview Practical Test
A week ago, I applied for a 'Software Engineering Internship' at one of the company. Since I know C++, C#, Java well and have worked on couple of ASP.NET MVC projects with MS SQL server before, I knew ...
3
votes
1answer
53 views
Rails validating API parameters
I wanted to keep my API request logic separate form the controller logic. I therefore make use of a separate model (EmailChecker) that creates an instance of this ...
5
votes
1answer
65 views
Mixed scripting language API to determine file upload location and scrape city government website to find corresponding government official
I wrote this script as an NYC-specific-API for file upload for a mobile app. Users upload a video file and also their geographic coordinates.
I then use an external API to get the corresponding ...
2
votes
1answer
107 views
Laravel API design
I've been designing and coding my Laravel API boilerplate for couple days now, and I'd like to hear some advice/improvement hints!
I'm pretty satisfied with the result, but I'm also aware, there ...
5
votes
1answer
96 views
Strawpoll fetch API in Python
As a beginner to Python with some rookie experience in building software, I decided writing an API wrapper for Strawpoll would be a good exercise in learning the language and design patterns.
The ...
1
vote
1answer
78 views
Handle network response and parse it
First I have method called in LoginActivity to call my login API. This is my Listener that reads user input and then passes it to a method to call the API:
...
2
votes
1answer
103 views
Simple and reusable system for user registration and tracking and auto-updates
I created a bunch of small and mostly internal WPF applications for my company - usually for some file manipulation etc. For these programs, I would like to start collecting user info - who uses them, ...
2
votes
2answers
75 views
Move code from controller to model
I'm working a rails application that has a lot of logic in the controller that should be in the model. In the app/controllers/customers_controller.rb#create there ...
5
votes
2answers
258 views
Restful API Building: Dependency injection + factory patterns
I am learning OOP. I feel I have a grasp of basic dependency injection in that as a rule of thumb, you pass an object to a method rather than the parameters to create an object. As such, never create ...
5
votes
1answer
111 views
JavaScript API for REST
I have a REST API, which naturally you can just use HTTP calls (mainly Ajax) in order to send and receive data. I am building a layer of abstraction on top of the raw REST API for JavaScript ...
5
votes
2answers
951 views
Slim API with 3 layer architecture
I'm new to Slim and the three layered approach I'm using below. So far I have the API, a Presentation layer (leaving out for now), a Business Logic Layer, and a Data Access Layer. The code's working, ...
1
vote
1answer
110 views
System to handle the short lived async task
I'm developing an application in which there are many short-lived tasks which are run in separate threads. I've developed a generic and reusable system to handle such a requirement. The code snippet ...
5
votes
2answers
751 views
External API calls from a C#.NET client
I have a simple c# mvc client that calls an external api..here is my attempt
...
11
votes
1answer
1k 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 ...
0
votes
0answers
105 views
PHP connector for communicating with a REST API (part 2)
I wrote a PHP connector that will allow me to communicate with a REST API using PHP.
The class was little over 1500 lines of code, it was difficult to manage it. It was a nightmare to even look at it ...
1
vote
3answers
78 views
Fast tag replacements
This uses the Stack Exchange API to quickly batch replace tags in questions.
I still need to fully comment and make the Wiki, but are there any glaring mistakes in it?
I have tried to use ...
2
votes
1answer
99 views
PHP connector for communicating with a REST API (Part 1)
I wrote a PHP connector that will allow me to communicate with a REST API. This is the first time I am trying to make my code as clean as possible. I want to help myself learning how to better code.
...
2
votes
0answers
51 views
Restful API for parsing records
I'm trying to implement my own API. This code excerpt should show the basic working routines. The storage is temporary an in-memory-array and the only HTTP method for now is POST.
I outsourced the ...
3
votes
2answers
69 views
Removing nested for loops to hasten API call response time
I've got an MVC APU project that I'm working on to feed data to some JavaScript charts. This beast below takes nearly 1 second of server time to process before it is served to the chart. I know that ...
-1
votes
1answer
68 views
5
votes
1answer
75 views
Uses game API to post stats about user when requested
First Python script, so my code is pretty laughable. Sensitive information has been redacted. One thing that I'd like to point out is that there is an inconsistent use of '' and "". This is an old ...
8
votes
1answer
144 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, ...
3
votes
1answer
289 views
Handling new user requests from a Swift client
I am starting to play with POST request to save in my server the user token so I can send push notifications in Swift (this is the Swift code). This is the PHP file that processes the request (please ...
3
votes
2answers
371 views
REST API using PHP
I am trying to write an REST API using php from scratch which I am gonna use to play with Angular.js. It is working fine now and I need your opinions on the things I have done in this code to improve ...
2
votes
1answer
192 views
Web API controller to get details of a travel plan or a leave request
My web API has 3 controllers for get, post and users CRUD. I named it as DetailsControllor, FormControllor and ...
5
votes
1answer
299 views
Swift API controller
I've just started iOS development and learning Swift. My code below works, but I'm interested to know in ways I can improve it having no experience in iOS Swift prior to this attempt.
...
4
votes
0answers
53 views
Entity component system Lua API
The destruction of the objects are handled by the garbage-collector metamethod.
(Does this make sense? This means that an out-of-scope object will stay visible in game until garbage collection.)
The ...
2
votes
0answers
218 views
Imgur API implementation using Retrofit
I've recently (an hour ago) started a project for making a wrapper for Imgur's API using the REST client Retrofit.
I've only implemented a single endpoint so far as I'm questioning my design. While ...
0
votes
2answers
64 views
Should Domain objects for a public API be able to save/send themselves?
My main questions: FileWithSave handles its saving itself, but delegates it to a repository object. This allows implementation details to be available without being present in the API when saving ...
1
vote
1answer
54 views
Fetching ALL data set from API iterating via response data
Does this make sense? How would you achieve the same thing, with cleaner code?
...
0
votes
1answer
54 views
Naming a complex crud function
I have a function below that does the following uses a bunch of smaller CRUD operations which I call create, ...