wrapper

How to use a C++ class library in a .net project

My .net project needs to use a third party class library written in C++. I have already tried directly adding a reference to this DLL from the project's context menu 'Add a refence...'' but it did not work as I assume this DLL does not implement the COM object model. What options do I have now? Some suggest to create a .net wrapper aro...

how to write python wrappers?

I am currently interested in writing a python wrapper for some php code. I was wondering if there was practice for writing wrappers, in any language for that matter. I am mainly concerned with php for now. Any tips and best practices would be appreciated. Please and thank you. ...

How do I wrap an REPL using .NET?

I'm trying to make a .NET wrapper for an REPL (specifically Scheme, but I haven't got to where it matters). I looked for some sort of expect-style library, but I couldn't find one, so I've been using a System.Diagnostics.Process. I don't think I'm succeeding at reading and writing correctly. Here's my code; it's in IronPython, but I h...

How to run Javah from Eclipse

So I'm trying to run the 'javah' tool on a compiled .class file in Eclipse, but I have no idea how to do it. The examples I found simply said something along the lines of 'run javah on your class...' but I don't really know where I'd find such a command line in Eclipse. If someone can give me a set of idiot proof instructions get this ...

Game Engine: Write in C++ and expose to C# or write directly in C#?

Hello! I am doing a bit of research before I am going to write my own 2D (and maybe some 3D) game engine. I have made an engine before using C# and XNA but I want to go cross platform this time by making my new engine in C++ using opengl etc. But ... I still want the fast iteration times from C# and have access to the game engine there...

VTK Wrapping JNI Issues

Hello VTK users, I currently have a project that's in both Java and C++, and part of the project involves a wrapper using the Java Native Interface (JNI) where I use functionality from my C++ libraries in the Java code. Now the problem that I face is, both my Java and C++ codes use VTK objects - and when I pass down, say a vtkPolyDataA...

Include sub-element inside JSF 2.0 component

This must be simple. I am trying to pass sub-element into a JSF component. I have my component declared as: <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http...

C# - integration of limited web/js/jQuery local browser with "connected to Internet check"

I need some suggestions on libraries and such to use for a simple website-to-desktop wrapper project in Visual Studio 2010. The website has been "compiled to HTML", so that the only serverside functionality needed is an AJAX call to send data on user prompt (if there is no valid sever response after X seconds, a javascript timer indica...

How to create IPP (Intel Performace primitives) C++ wrapper functions?

IPP is a C library, with hundreds of functions like this: IppStatus ippiTranspose_8u_C1R(const Ipp8u* pSrc, int srcStep, Ipp8u* pDst, int dstStep, IppiSize roiSize)); To be able to call these functions in a more convenient, safe and consistent way, we need a C++ wrapper fun...

What is the correct C# design pattern for multiple methods, all accepting as params differing derived classes?

Hi, I have a base class: class Message And two deriving classes: class SimpleMessage : Message class ComplexMesssage : Message These types are used in another part of the code as such: void ProcessSimpleMessage(SimpleMessage m) void ProcessComplexMessage(ComplexMessage m) These methods are not inside the class Message, as the p...

Enumset wrapper for AbstractActions

I'd like to load a series of Swing Actions into a container at runtime and access them by a constant name as is possible with an Enum. The purpose of this would be to both restrict the Actions possible and also improve readability. Initially, I was considering a sort of dynamic enum (see http://blog.xebia.com/2009/04/02/dynamic-enums-in...

YouTube PHP Wrapper

Is there any YouTube php wrapper that I can use to retrieve video's rating by their id? ...

How do I abstract away from using RogueWave in legacy code?

I have been tasked with removing RogueWave components from a legacy C++ codebase. To do so, I am attempting to build wrappers around the existing components, make sure that the code functions the same, and then choose a different library like boost to stick into the wrappers. One of the problems I am coming against is that much of the ...

Hide class type in header

I'm not sure if this is even possible, but here goes: I have a library whose interface is, at best, complex. Unfortunately, not only is it a 3rd-party library (and far too big to rewrite), I'm using a few other libraries that are dependent on it. So that interface has to stay how it is. To solve that, I'm trying to essentially wrap the...

optional parameters

I have taken (with the authors permission on the site) a wrapper class for writing fetch requests to my Core Data stack. The guy who wrote it says it has "optional parameters" and I wondered what this meant. Anywho, the static methods are written as such... +(NSMutableArray *) searchObjectsFromContext : (NSString*) entityName ...

adding a shadow border to my wrapper

I have a #wrapper, which contains all page content, and I'd like to place another div around it with a shadow border, #shadowwrap. I've been staring at this stuff for way to long today, and my brain's stuck... #shadowwrap { background:url("images/shadowborder.png") repeat-y center; background-color:transparent; max-width:10...

C# database wrapper design

Hi, I am designing a database wrapper for C#. Below are the two options I have: Option A: class DBWrapper:IDisposable { private SqlConnection sqlConn; public DBWrapper() { sqlConn = new SqlConnection("my connection string"); sqlConn.Open(); } public DataTable RunQuery(string Sql) ...

How a class that wraps and provides access to a single file should be designed?

MyClass is all about providing access to a single file. It must CheckHeader(), ReadSomeData(), UpdateHeader(WithInfo), etc. But since the file that this class represents is very complex, it requires special design considerations. That file contains a potentially huge folder-like tree structure with various node types and is block/c...

What is the most complete mocking framework for HttpContext

I'm looking for as comprehensive as possible of a mock replacement and wrapper for the ASP.NET HttpContext in my applications. A comprehensive mock replacement could potentially increase the testability of my ASP.NET web applications substantially, without necessitating migrating every application to more-testable frameworks such as MVC....

Wrap a function in python supplying an additional boolean

I'm porting some code from Perl to Python, and one of the functions I am moving does the following: sub _Run($verbose, $cmd, $other_stuff...) { ... } sub Run { _Run(1, @_); } sub RunSilent { _Run(0, @_); } so to do it Python, I naively thought I could do the following: def _Run(verbose, cmd, other_stuff...) ... def Run(*ar...