Skip to content

Instantly share code, notes, and snippets.

@robbmcleod
robbmcleod / clr_array_convert.md
Last active April 9, 2024 08:29
Convert NumPy `ndarray` to C# `System.Array` and back again

Originally for Python 3.7 and PythonNet 2.4.0 I wrote a snippet of code to transform NumPy ndarray into System.Array from CLR and back again using pure python and the ctypes package memmove function:

https://github.com/pythonnet/pythonnet/issues/514
https://github.com/pythonnet/pythonnet/issues/652

However, after the release of PythonNet 2.5.0 there were some changes to the PythonNet interface that created some small breaks in my code snippet:

@mayankgupta804
mayankgupta804 / functional.groovy
Created February 26, 2017 18:18 — forked from anonymous/functional.groovy
Functional Groovy Crashcourse This short Groovy script I wrote to provide my students the most common functional programming techniques of the programming language Groovy in a very condensed form.
// Functional Groovy Crashcourse
//
// This short Groovy script I wrote to provide my students the most common functional
// programming techniques of the programming language Groovy in a very condensed form.
//
// Author: Nane Kratzke (Luebeck University of Applied Sciences)
// License: Free for every one
// Date: 22. March 2013
// Here is how you can define a list in Groovy.