$ sudo npm install cylon cylon-ble -g
$ npm install sphero noble
$ cylon-ble-scan
im.resize({ | |
srcPath: src , | |
dstPath: dst, | |
width: 200, | |
height: "200^", | |
customArgs: [ | |
"-gravity", "center", | |
"-extent", "200x200" | |
] | |
}, function(err, stdout, stderr) { |
#!/usr/bin/env python | |
# ROT: encode and decode letters and numbers using ROT13 and ROT5 | |
# Author: Andrea Stagi <stagi.andrea@gmail.com> | |
# License: c'mon default header, don't be silly :D | |
def rot_encode(clr_str): | |
rot_chars = [] |
#define Py_LIMITED_API | |
#include <Python.h> | |
#include "libnewmath.h" | |
PyObject *sum_wrapper(PyObject *obj, PyObject *args) { | |
const long a, b; | |
if (!PyArg_ParseTuple(args, "LL", &a, &b)) | |
return NULL; |
package main | |
import "C" | |
//export sum | |
func sum(a, b int) int { | |
return (a + b) | |
} |
#include <Python.h> | |
// ... | |
int is_a_long(PyObject * p) { | |
return PyLong_Check(p); | |
} |
#define Py_LIMITED_API | |
#include <Python.h> | |
int PyArg_ParseTuple_LL( | |
PyObject * args, | |
long long * a, | |
long long * b | |
) { | |
return PyArg_ParseTuple(args, "LL", a, b); | |
} |
package main | |
// #cgo pkg-config: python3 | |
// #include <Python.h> | |
// int PyArg_ParseTuple_LL(PyObject *, long long *, long long *); | |
import "C" | |
import ( | |
"fmt" | |
) |
from newmath import sum | |
print (sum(5,4)) |
#include <Python.h> | |
static PyObject *sum(PyObject *self, PyObject *args) { | |
const long a, b; | |
if (!PyArg_ParseTuple(args, "LL", &a, &b)) | |
return NULL; | |
return PyLong_FromLong(a + b); | |
} | |
static PyMethodDef MathMethods[] = { |