Skip to content

Instantly share code, notes, and snippets.

View namitkewat's full-sized avatar

Namit Kewat namitkewat

View GitHub Profile
@namitkewat
namitkewat / AWS StepFunction to Graphviz.ipynb
Created July 11, 2025 12:32
Visualizing AWS Step Functions with Python and Graphviz
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@namitkewat
namitkewat / get_clinfo.c
Created September 18, 2016 16:12
Get OpenCL platform details
#include "get_clinfo.h"
int get_device_info(){
size_t infoSize;
char * info;
const char * platformAttributeNames[5] = { "Platform Profile", "Platform Version",
"Platform Name", "Platform Vendor", "Platform Extensions" };
int platformAttrCount = sizeof(platformAttributeNames)/ sizeof(char*);
[unix_http_server]
file=/tmp/supervisor.sock ; path to your socket file
[supervisord]
logfile=/var/log/supervisord/supervisord.log ; supervisord log file
logfile_maxbytes=50MB ; maximum size of logfile before rotation
logfile_backups=10 ; number of backed up logfiles
loglevel=error ; info, debug, warn, trace
pidfile=/var/run/supervisord.pid ; pidfile location
nodaemon=false ; run supervisord as a daemon
@namitkewat
namitkewat / Makefile
Created February 10, 2013 09:09 — forked from nzjrs/Makefile
all: test libtest.so testmodule
libtest.so: libtest.o
$(CC) -shared -o $@ $< -lc
test: test_main.c libtest.o
$(CC) -o $@ $?
testmodule: testmodule.c
python setup.py build

Cython example of exposing C-computed arrays in Python without data copies

The goal of this example is to show how an existing C codebase for numerical computing (here c_code.c) can be wrapped in Cython to be exposed in Python.

The meat of the example is that the data is allocated in C, but exposed in Python without a copy using the PyArray_SimpleNewFromData numpy