kotlin

GTK3 and Glade3 using Kotlin

Submitted by Dickens A S on Sat, 11/30/2019 - 14:13

GTK windows design using glade builder

GitHubhttps://github.com/dickensas/kotlin-gradle-templates/tree/master/gtk3-glade3

This code explains how to use Kotlin to program GTK3 and Glade3 using Cygwin Glade designer

Install cygwin with below dependencies (basic cygwin installation explained here install R using cygwin)

Call OpenCL from Kotlin or embed OpenCL inside Kotlin

Submitted by Dickens A S on Fri, 11/29/2019 - 17:29

Embedded OpenCL inside Kotlin

GitHubhttps://github.com/dickensas/kotlin-gradle-templates/tree/master/embed-opencl

OpenCL code which runs from kotlin

#pragma OPENCL EXTENSION cl_khr_byte_addressable_store : enable
__constant char hw[] = "Hello World";
__kernel void hello(__global char * A) {
    size_t tid = get_global_id(0);
    A[tid] = hw[tid];
}

 

Kotlin code which runs OpenCL

Artificial Neural Network in Kotlin - FANN

Submitted by Dickens A S on Thu, 11/28/2019 - 13:53

FANN is an open source library  https://libfann.github.io/fann/docs/files/fann-h.html

which offers C based API which can be invoked from Kotlin

Below Kotlin example shows how it can be invoked

import fann.*

fun main() 
{

    var ann = fann_create_standard(4, 2, 8, 9, 1)
    
    fann_print_connections(ann)
    
    fann_destroy(ann)
}

Below is the sample output from MSYS2 terminal

Call MATLAB function octave Mex from Kotlin

Submitted by Dickens A S on Thu, 11/28/2019 - 09:06

GNU Octave https://www.gnu.org/software/octave/ 

Is one of the popular Scientific Programming Language or platform

general MATLAB functions will work in Octave

It can be download https://www.gnu.org/software/octave/download.html and installed for free

This Article explains how to trigger Mex script from Kotlin using "mex.h" and "octave.h" C API in Kotlin

Octave is installed in C:\octave with below structure and files