Posts

Showing posts from April, 2013

Install LogMeIn Hamachi with GUI On Ubuntu

LogMeIn Hamachi is a free VPN creator. Hamachi is normally used for playing (multiplayer) games like minecraft. You can install Hamachi on Ubuntu normally but the problem is that you have to use the terminal to work with Hamachi  (i.e there is no GUI). This problem can be tackled with the help of Haguichi. Haguichi gives Hamachi a user interface on Ubuntu. So here is how you install Hamachi with GUI on Ubuntu. Installing Hamachi: First we shall install Hamachi the normal way and then add a GUI to it. To install, download .deb install file for Hamachi: Hamachi For x86 (32-bit) Hamachi For x64 (64-bit) Open .deb after you download it. When you open the file you downloaded, the Ubuntu software center will open with the Hamachi page. Just click on install and Hamachi installation will start. After that is done, we need to install Haguichi. continue to the next step to install Haguichi. Insta...

Passing a string from c++ to Python function

Passing a string from c++ to Python function and vice-versa: Initialize all required variables first. Py_Initialize (); object main_module = import ( "__main__" ); //boost::python objects object dictionary = main_module . attr ( "__dict__" ); Run a code to create a variable and set an initial value and print it inside python. boost :: python :: exec ( "resultStr = 'oldvalue'" , dictionary ); PyRun_SimpleString ( "print resultStr" ); //new value will reflect in python read the same variable from c++. boost :: python :: object resultStr = dictionary [ "resultStr" ]; //read value from python to c++ std :: string & processedScript = extract < std :: string >( resultStr ); Above dictionary object is like a shared map. you can set a variable from c++. Then check the new value from python. dictionary [ "resultStr" ] = "new value" ; //set the variable value PyRun_SimpleString ( "print re...