wrapper

Simple way to get wrapper class type in Java

I have a piece of code where i need to pass the class of a field in a method. Because of the mechanics of my code i can only handle reference objects only and not primitives. I want an easy way of determining if a Field's type is primitive and swap it with the appropriate wrapper class. So in code what i do so far is something like this ...

How to use C++ in Go?

In the new Go language, how do I call C++ code? In other words, how can I wrap my C++ classes and use them in Go? ...

How to wrap built-in methods in Python? (or 'how to pass them by reference')

I want to wrap the default open method with a wrapper that should also catch exceptions. Here's a test example that works: truemethod = open def fn(*args, **kwargs): try: return truemethod(*args, **kwargs) except (IOError, OSError): sys.exit('Can\'t open \'{0}\'. Error #{1[0]}: {1[1]}'.format(args[0], sys.exc_inf...

Easiest language to produce a Windows executable to prefix running another executable with system calls?

I want to run some system commands (to fix things) before running an executable. I have a reasonably locked down (work) Windows XP system and so can't change what a shortcut points to. For my users' convenience, I must keep the same shortcut. However, I am able to swap out the .exe (renaming) and potentially replace it with another .exe ...

What is meant by "implement a wrapper method"?

I have been given a programming assignment and one of the things I have to do is implement method which a wrapper method which relies on another method to sort the coordinates from lowest to highest. I am unsure on what exactly is meant by implementing a wrapper method. static void sortCoordsByZ(double[][] coords) { //implement the wra...

Is there a C header parser tool for wrapper generation like gccxml?

I need to write a few c header wrappers for a new programming language and would like something like gccxml but without the full dependency on gcc and the problems it gives on a windows system. Just needs to read C not C++. Output in any format is okay as long it is fully documented. Need it for Curl, SQLite, GTK2, SDL, OpenGL, Win32 A...

Updating Google Visualization API with <div> button

Fellow Coders, I'm trying to update a Google Visualization API that has already been populated with data. Here's the background: The user get's to choose several options from drop down menu's. After which, the user may select to update the Google API from a button. Do I need a QueryWrapper function, initiated through the button...

Does a Facebook wrapper class written in PHP exist? like Twitter wrapper class written in PHP.

Where can i get a similiar http://code.google.com/p/php-twitter/ class for facebook? The above class is very easy if i need to update my status on twitter i just do $twitter->updatestatus("blabla"); i need a similiar class for facebook where can i get it? ...

Writing a C++ DLL, then wrapping it in C#.

Hello, I am a bit confused about wrapping a c++ dll in c#. What kind of dll should i create? A normal dll or an mfc dll? Should i prefix every proto with "extern..." ? Should i write the functions in a def file? My last effort was in vain, c# would crash with an error like "bad image format", which means that the dll format is not corr...

Wrapping primitives using the new operator vs wrapping primitives using valueOf

What's the difference between, Integer i = new Integer("42"); and Integer i = Integer.valueOf("42"); Thanks. ...

strange function definition in Scilab<->C interface

Hi there, I'am talking about this example of a Scilab<->C wrapper: http://www.scilab.org/doc/intro/node89.html. The strange part is this one: int intsfoubare(fname) char *fname; { ....(some code) } It is some kind of function defintion but I really don't understand what the char *fname is good for also just fname as par...

How can C++/CLI make this situation easier?

I have a little piece of a library that I would like to write a .NET wrapper for. At the moment, I'm using P/Invoke, but since I don't have the library's source code or a whole lot of C knowledge, I'm having a difficult time with marshaling. It works so far (sort of), but it feels like a hack. C Signatures typedef struct { unsigned...

Good Windows Registry Wrapper for C++

Hi, Does anyone know of any good free/open source Windows Registry wrappers for VC++ which do not require MFC (i.e. can be run in a console app)? ...

C++ class hierarchy for collection providing iterators

I'm currently working on a project in which I'd like to define a generic 'collection' interface that may be implemented in different ways. The collection interface should specify that the collection has methods that return iterators by value. Using classes that wrap pointers I came up with the following (greatly simplified): Collection....

How to implement a stdin, stdout wrapper ?

I have an interactive program that runs stdin and stdout. I need to create wrapper that will send X to it's stdin, check that it prints Y and then redirects wrapper's stdin and stdout to program's stdin and stdout just like program would be executed directly. How to implement this ? X and Y can be hardcoded. Bash? Python? Edit: I can't...

Breaking up a large Hibernate class

Dear all, I have a Hibernate class which is essentially just a wrapper around loads of collections. So the class is (massively simplified/pseudo) something like: @Entity public class MyClass { @OneToMany Map1 @OneToMany Map2 @OneToMany Map3 AddToMap1(); AddToMap2(); AddToMap3(); RemoveFromMap1()...

python instancemethod attributes inside wrapper

Possible Duplicate: Python decorator makes function forget that it belongs to a class Is there a way to know that wrapped method belongs to particular class? In code below: def guessname(func): def this(*args, **kwargs): print "myname = %s" % func.__name__ return func(*args, **kwargs) return this class...

Wrapping a PropertySheet; how to handle callbacks?

I'm writing an (unmanaged) C++ class to wrap the Windows PropertySheet. Essentially, something like this: class PropSheet { PROPSHEETHEADER d_header; public: PropSheet(/* parameters */); INT_PTR show(); private: static int CALLBACK *propSheetProc(HWND hwnd, UINT msg, LPARAM lParam); }; The constructor just i...

If class Number is abstract why I'm I allowed to write Number n = 5?

Number n = new Number(5) is illegal, but Number n = 5 isn't. Why? ...

Automatically creating a wrapper to implement an interface

Hi, I have some classes that don't implement a certain interface but structurally comply to that interface. interface IFoo { void method(); } class Bar { // does not implement IFoo public void method() {...} } Now, I could write a wrapper around those classes that simply delegate to the wrapped class class BarWrapper : IFoo...