Skip to content
Advertisement

Tag: c++

Python with statement in C++

I am trying to implement something similar to the Python with statement in C++. As I plan to use it mainly with Qt-OpenGL the methods are called bind and release (in Python __enter__, __exit__). Code I came up with: header: cpp: Usage: Questions: Needing class A and class B feels a bit clumsy. Is there a better alternative? Are there

detecting bind mounts on linux

I am looking for a way to determine if a given path is a bind mount point (on linux). The standard techniques for detecting regular mount points don’t seem to work. Even the mountpoint command fails to detect bind mounts. Answer I’m not sure there is supposed to be a way to do that (except perhaps thru /etc/mtab or /etc/fstab)

PIL’s colour space conversion YCbCr -> RGB

The algorithm used by PIL v1.1.7 gives ‘washed out’ looking results. When converting the same source data using ffmpeg it looks correct. Using mplayer gives identical results to ffmpeg (perhaps they use the same library underneath). This leads me to believe PIL may be stuffing up the colour space conversions. The conversion seems to be sourced in libImaging/ConvertYCbCr.c: This is

Implementing a function in Python vs C

Is there a difference (in terms of execution time) between implementing a function in Python and implementing it in C and then calling it from Python? If so, why? Answer Python (at least the “standard” CPython implementation) never actually compiles to native machine code; it compiles to bytecode which is then interpreted. So a C function which is in fact

Convert Python program to C/C++ code? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 4 months ago. Improve this question is it possible to convert a Python program to C/C++? I need to implement a couple of algorithms, and I’m

Advertisement