Skip to content Skip to sidebar Skip to footer
Showing posts with the label C++

How To Compile Static Library With -fpic From Boost.python

By default, libboostpython.a is compiled without -fPIC. But I have to make a python extension and i… Read more How To Compile Static Library With -fpic From Boost.python

Error When Compiling Cpython: Cannot Convert From Pylongobject To Pyobject

I've been trying to learn to use CPython and for it, I tried creating a simple factorial functi… Read more Error When Compiling Cpython: Cannot Convert From Pylongobject To Pyobject

Syntax Invalid While Translating C Code To Python

I have C snippet(decompiled from IDA) to be translated to Python: # v29 = 0; # v30 = -134292497… Read more Syntax Invalid While Translating C Code To Python

Ecdsa Signing And Verifying Issue Between Python Ecdsa And C Micro-ecc Library

I am facing an issue when I do the following : Created a Public Private key pair using python for … Read more Ecdsa Signing And Verifying Issue Between Python Ecdsa And C Micro-ecc Library

Value Of Py_none

It is clear to me that None is used to signify the lack of a value. But since everything must have … Read more Value Of Py_none

I Have 2 Very Similar C Functions Being Called From Python And Java. How Can I Combine The 2 Libraries Into 1 That Can Be Called From Both Languages?

Basically I have 2 implementations of a C function 'encrypt' which I call from python using… Read more I Have 2 Very Similar C Functions Being Called From Python And Java. How Can I Combine The 2 Libraries Into 1 That Can Be Called From Both Languages?

Moving Average Of 3 Elements By C Or Python

I want to calculate the moving average of 3 elements. For example, I have a 25 elements of sales d… Read more Moving Average Of 3 Elements By C Or Python

Python: Improving Sub-string Search By Embedding Sophisticated Algorithms

I am extending my previous question python efficient substring search, I am interested to improve … Read more Python: Improving Sub-string Search By Embedding Sophisticated Algorithms

How To Find The Number Of Parameters To A Python Function From C?

I'm using the Python C API to call Python functions from my application. I'd like to presen… Read more How To Find The Number Of Parameters To A Python Function From C?

High Precision Arithmetric In Python And/or C/c++?

Abstract: Which Python package or C-Library is the best option for very high precision arithmetic o… Read more High Precision Arithmetric In Python And/or C/c++?

Return A 2d Cython Pointer To Python Array

I am currently passing from Cython to C the following pointer of a pointer: #convert the input… Read more Return A 2d Cython Pointer To Python Array

Can A Python Program Be Run On A Computer Without Python? What About C/c++?

Can I create a Python program, send it to a remote computer, and run it there without that computer… Read more Can A Python Program Be Run On A Computer Without Python? What About C/c++?

Embedding Matplotlib In C

I have a double pointer in C, and I want to plot it with matplotlib from C. I'm not understandi… Read more Embedding Matplotlib In C

Clean And Type-safe State Machine Implementation In A Statically Typed Language?

I implemented a simple state machine in Python: import time def a(): print 'a()' r… Read more Clean And Type-safe State Machine Implementation In A Statically Typed Language?

Sine Wave That Exponentialy Changes Between Frequencies F1 And F2 At Given Time/amount Of Samples

I'm trying to implement Python method that generates sine wave, which ramps up between two freq… Read more Sine Wave That Exponentialy Changes Between Frequencies F1 And F2 At Given Time/amount Of Samples

Difference Between Np.int, Np.int_, Int, And Np.int_t In Cython?

I am a bit struggled with so many int data types in cython. np.int, np.int_, np.int_t, int I guess … Read more Difference Between Np.int, Np.int_, Int, And Np.int_t In Cython?

C Code For Python's Property Function?

I am really curious as to how Python's interpreter makes an attribute x out of a method x throu… Read more C Code For Python's Property Function?

Struct Alignment With Pyopencl

update: the int4 in my kernel was wrong. I am using pyopencl but am unable to get struct alignment … Read more Struct Alignment With Pyopencl

How To Pass A 2d Array From Python To C?

I'm trying to pass a 2d array from Python to C, using ctypes. The array dtype is uint16. I wrot… Read more How To Pass A 2d Array From Python To C?

Is There An Equivalent To The Matlab Function Bsxfun In Python?

I'm trying to port some of my code from matlab to python, and some of it uses the bsxfun() func… Read more Is There An Equivalent To The Matlab Function Bsxfun In Python?