A wrapper is an OOP technique where an object encapsulates (wraps) another object, hiding/protecting the object and controlling all access to it.
4
votes
2answers
80 views
C++ Wrapper for cURL: Multithreading and serializing asynchronous ops
I did this library to help me from one of my projects and decided to publish it on GitHub hoping people might find it useful, convenient and easy to use in their projects too.
It's a header-only ...
4
votes
0answers
33 views
Random generator extension for VSCode
Background
A VSCode extension that uses Chance.JS to generate random data types.
Concerns
My main concern is that there are 4 levels of function references that feels like a hack. From ...
0
votes
0answers
23 views
simpler pattern/extension built on top of telepot (telegram bot api wrapper)
simpler pattern/extension built on top of telepot (telegram bot api wrapper)
filter usage
...
2
votes
1answer
67 views
Wrapping Checkers
The next post in my Checker series: The C# wrapper for my F# library to make it cleaner for these methods to be called from C# code.
GeneralTypes.cs
...
2
votes
1answer
56 views
C++ Dirent.h “Wrapper”
I do not want to call this a wrapper, but no other name comes to mind right now, so I'll use it incorrectly for the rest of the question - It's just a class that adds C++ functions to ...
4
votes
1answer
48 views
C++ OpenGLBuffer class, wrapper around the raw OpenGL api
I am trying to code a thin wrapper around the OpenGL so I can use it more convenient. This class is not 100% done yet, but I don't want to do all typing for nothing. And I think the design is clear. I ...
0
votes
2answers
54 views
4
votes
0answers
42 views
PowerShell Export-CSV with Cultural Awareness
I recently had a requirement to export data to CSV in a different culture & hit an issue (see http://stackoverflow.com/a/40871162/361842).
Here's my workaround:
...
1
vote
1answer
50 views
Array whose first element is arbitralily indexed – writing a container wrapper
The problem:
In C++ arrays and SequenceContainers http://en.cppreference.com/w/cpp/concept/SequenceContainer (std::array, ...
5
votes
1answer
27 views
Short header file for safe CLI input handling in C
Proper input handling is a pain in the butt in C, so as part of a project of mine, this header is used to handle reoccurring command line input tasks such as input loops, reading lines and tokenizing ...
-1
votes
2answers
38 views
Wrapper Connection PDO PHP [closed]
This is my wrapper, how can i improve this? (With a Singleton too)
...
3
votes
2answers
37 views
Python 'wrapper' around `dig` for easier TSIG signing of queries
I wrote this Python script as a utility script for me. It's something that could be achieved in a simple shell script or alias, but it wasn't 'verbose' enough for me in that format, or customizable.
...
8
votes
3answers
156 views
Wrapping COM objects with IDisposable
One of the things believed to contribute to destabilizing Rubberduck 2.x, is the fact that a lot of COM object references are stored in many places, and ...
3
votes
1answer
99 views
C++ lock wrapper class around pointer
I have created a class which wraps pointers and behaves like a pointer would behave, minus a few cases. It is a lock wrapper class which simply locks before usage of the pointer and unlocks once the ...
7
votes
1answer
135 views
Primitive Type Wrapper in C++
In C++, primitive types are treated differently than user-defined types. If you do not initialize them, their values are undefined in some cases. This is an easy mistake to make.
I wanted to make a ...
3
votes
1answer
89 views
zlib wrapper class
I needed to write zlib wrapper class for my application, so I can change it with different algorithm later if I want to do so.
Here is the simple version:
...
1
vote
2answers
181 views
PHP PDO Wrapper
Here's a PHP PDO wrapper class that I wrote, along with example usage. This class features 2 primary methods for interacting with a database: Query(), which returns ...
3
votes
3answers
57 views
4
votes
2answers
83 views
Basic API wrapper around a Restful service - follow-up
This is a follow up from my previous post: Basic API wrapper around a Restful service
I'm writing a basic wrapper around a restful service that returns a list of Stores. Naturally, I want to make it ...
3
votes
2answers
336 views
Basic API wrapper around a Restful service
I'm writing a basic wrapper around a restful service that returns a list of Stores. I'm using RestSharp which I'm injecting into the class.
Naturally, I want to make it completely testable (that's a ...
5
votes
1answer
70 views
Wrapper class for the shell “dir” utility
I was inspired to throw this class together by an SO question and thought I'd subject it to some welcome criticism here.
The class is basically just a wrapper around the shell utility ...
5
votes
1answer
53 views
`ls` indicates when directory is empty/full of dotfiles
I want ls to print a message when run on an empty or full of dotfiles directory. Instead of:
$ ls empty_dir/ dotfiles/
$
I ...
2
votes
1answer
234 views
Shell script wrapper for Docker build and run
I have written a simple wrapper for docker build and docker run that allows me to build and run my image without having to use ...
5
votes
1answer
76 views
Python wrapper for Instagram API
This code wraps the user endpoint and media endpoint of Instagram API. Any best practices/ styles or glaring bugs you can see? I wrote some unit tests for each class but did not include for ...
2
votes
3answers
170 views
Wrapping a CSV file for access and testing
I have a simple class that represents and accesses the data from a CSV file (using the CsvHelper library). I've tried restructuring the code to allow for better unit testing, but I'm sure the ...
1
vote
0answers
61 views
Wrapper for a vendor API that lacks common interfaces
I know basic Java, but I struggle sometimes with object orientation design.
There is a vendor api I use, and I wanted to wrap it to be reusable as a lib in other projects.
All the services from the ...
1
vote
0answers
26 views
Wrap glium_text so that parameters aren't passed redundantly
I was annoyed by the API of glium_text, so I decided to make a wrapper that cleans up the API instead of coding my own text rendering. (I might do that later.)
The wrapping turned out to be rather ...
2
votes
0answers
48 views
Pointers for C++/CLI library header formatting, layout and design
I have designed a C++/CLI wrapper library that allows C++ applications on windows, and other platforms that can load C dlls (e.g. Java via JNA or Python) to make calls to my .Net library.
I was ...
1
vote
0answers
126 views
Session wrapper for PHP that supports alternative session handlers
I'm developing a session wrapper for the next version of a framework that I've been working on for the past few years. I want to support a variety of PHP session handlers. Laravel's session package ...
4
votes
1answer
61 views
Wrapping a non-unique handle with additional information
I have a situation where I'd like to wrap up some plain C handles into a class, with a destructor and other niceties, in C++. I would like the wrapper class to have the exact same size as the handle, ...
11
votes
2answers
132 views
Data marshaling wrapper for a TCP server
After a lot of research, I created this wrapper which I think fits very well to my needs. My project is a TCP server and I will be using this wrapper every time the server receives a packet. Basically,...
0
votes
1answer
569 views
Creating a wrapper function for jQuery Ajax
I am creating a few functions that wrap around jQuery's Ajax function to make it a bit quicker and easier to perform a request. For this I have this JavaScript file:
...
3
votes
1answer
58 views
Extended PDO class for MySQL
I recently started with object oriented programming in PHP and I am wondering if my database class is on the right track.
Am I doing something wrong? If so, how can I improve it?
Here is the class:
...
2
votes
2answers
99 views
console.log helper function
I've seen the code for this function in John Resig's book 'Secrets of JavaScript Ninja' yesterday.
I considered it useful at once because I've disliked repeatedly typing ...
3
votes
0answers
47 views
Wrapping a small animation library for Angular
I've started out working on a larger project using Angular for the first time.
For visual feedback, I'm using Waves (Github) (you can see a demo page here).
The standard way to use Waves is to ...
1
vote
0answers
32 views
Wrapping a function in other function to generate Json Patches
I have a view that is dynamically generated from a JSON file on Angular, and I am using JSON-Patch (RFC6902) to generate patches when the user modifies its values.
I start observing the JSON since ...
5
votes
2answers
471 views
C array wrapper
As part of a larger project I wanted to write my own size once RAII C array wrapper. Now I could have just used std::vector, which I'm sure is the first thing ...
1
vote
1answer
155 views
Xbox controller wrapper
I spent far too much time trying to simply get data from an Xbox controller with Python. This is the cleaned up result, classified. This requires xinput1_3 or possibly 1_4 - I'm running Windows 7 and ...
4
votes
2answers
2k views
Wrapping tuples to be used as keys in a Dictionary
I'm currently working on a project where I have to map some objects to several properties.
Basically I need a Dictionary with Tuples as keys and instances of MyClass as values.
As using tuples can ...
3
votes
1answer
497 views
.NET MSSQL Wrapper
Back in late 2012, I wrote the following C# .NET MSSQL Wrapper, which offered the following operations:
ExecuteScalar (for selecting single field from a row)
...
4
votes
2answers
305 views
Wrapper class for PHPMailer
Is this a right way to use/implement an external library into a project? If it's not how do you do it?
...
1
vote
0answers
56 views
Follow-up: Window Creation Wrapper Class
This is the revised version of the Window Creation Wrapper Class. I tried to improve the code due to the remarks of @user1118321 (see posted link) and I hope for further reviews. For instance, you ...
1
vote
1answer
93 views
Wrapper class for adding elements to HashSet
I have many object of class Test. I want to be sure that among them, there are no two objects o1 and ...
4
votes
1answer
236 views
Window Creation Wrapper Class
This Question now has a follow-up here
I don't think that there is any new technique in my code but in my opinion it's ok all in all (with a bit of magic). Maybe you can find something to improve or ...
4
votes
1answer
179 views
Angular wrapper for SignalR event aggregator
I created a little wrapper for one of my JavaScript libraries to enable Angular functionality. Are there any pitfalls I should be wary of with my code?
...
15
votes
1answer
200 views
Event-based Xbox Controller polling
The goal of the following code is to be able to use an Xbox Controller in a Java program, it works with the jinput library.
Unfortunately this library is rather old, has little to no documentation ...
3
votes
1answer
61 views
RAII style API wrapper for PyMongo
I just watched Raymond Hettinger's talk on making Python more Pythonic and realized I should be putting a lot of his ideas into practice, particularly wrapping API's in a class that makes everything ...
3
votes
2answers
159 views
Encryption wrapper
I am writing an encryption class using Crypto++. The idea is that the client connects using RSA (encrypt, decrypt) with username, password, 32 byte key. The server will then return using the stream ...
3
votes
2answers
101 views
BigDecimal wrapper that ignores zero operands
I want to perform mathematical operations on a range of values, where zeros should be ignored. This means that multiplication by zero does not result in zero but returns the first operand and likewise ...
2
votes
1answer
52 views
Simple DB API for inserting a record
I'm looking to make some improvements to a deliberately crude API written in PHP, it's designed to handle simple requests and talk to the DB.
I have the following DB class:
...