Call C++ code from Kotlin Native using a C bridge code

Submitted by Dickens A S on Sun, 05/28/2023 - 15:04

This article explains how to call C++ code from Kotlin Native using a C Bridge

The purpose of C Bridge is to overcome the short comings of Kotlin Native which does not support C++ interop

Therefore we create a C library and call the C++ codes in that code and then the C code is linked to Kotlin Native code

Important Note: this is not JNI, this is Kotlin Native which directly becomes an EXE file

C++ code which std::string

Kotlin XML XSLT using libxml2 and libxslt

Submitted by Dickens A S on Sun, 05/07/2023 - 08:33

This Article demonstrates how to parse xml in Kotlin Native using libxml2 and libxslt 

If the devloper working in linux, then the developer can install libxml and libxslt 

For example in Ubuntu Focal

sudo apt-get -y install libxml2 libxml2-dev libxml2-utils
sudo apt-get -y install libxslt1-dev libxslt1.1

if the developer user windows, then the developer can install MSYS2 and install the libraries

OpenGL cube vertex and indices explained

Submitted by Dickens A S on Wed, 10/26/2022 - 16:18

Understanding the vertex coordinates and corresponding indices slightly complicated. 
Sometimes the developer gets carried away due to too many numbers needs to be maintained in the VBO array

This article gives a typical approach to number in counter clockwise and group indices same way

Let us go by step by step

Front face
---------------

3 ---- -----2
|           |
|           |
0 ----------1

From bottom left you can count 0,1,2,3 counter clock wise

Back Face
----------------

Install Oracle Client with SQL Loader in RHEL / CentOS

Submitted by Dickens A S on Sat, 04/23/2022 - 02:49

This article explains how to install oracle client using RPM files

which ever version you want to choose you can choose for example 21.6

oracle-instantclient-basic-21.6.0.0.0-1.x86_64.rpm
oracle-instantclient-devel-21.6.0.0.0-1.x86_64.rpm
oracle-instantclient-jdbc-21.6.0.0.0-1.x86_64.rpm
oracle-instantclient-sqlplus-21.6.0.0.0-1.x86_64.rpm
oracle-instantclient-tools-21.6.0.0.0-1.x86_64.rpm

Download all these and issue the below RPM command lines

Windows 10 Docker Engine Installation with Minikube

Submitted by Dickens A S on Fri, 04/22/2022 - 05:01

Docker Engine is available as open source https://docs.docker.com/engine

Docker is licensed under the Apache License, Version 2.0

To make the docker engine work properly in windows 10 there are few features we need to enable

To do that, launch "Turn Windows features on or off" from control panel

And enable the below features

  • Containers
  • Hyper-V
  • Virtual Machine Platform
  • Windows Hypervisor Platform
  • Windows Subsystem for Linux

Then go to docker exe download site for windows

Selenium JavaScript element to WebElement conversion

Submitted by Dickens A S on Sun, 04/10/2022 - 09:04

This article explains sometimes the HTML element of a browser will be beyond the visible rendered region.

In that case Selenium XPath which got by the findElement or findElements will less in number

Therefore we can combine javascript code and find those elements and cast it to WebElement

Node modules from a different path using NODE_PATH

Submitted by Dickens A S on Sat, 04/09/2022 - 15:41

This article explains how to use node.js modules from different folder, for example you have installed "express" in a different folder and want to use it another application without installing inside local node_modules

How to do it

1.) Install express in a different folder

Example c:\dev\test1

npm install express

Now you have c:\dev\test1\node_modules created

2.) Go to another folder and create your index.js

Example c:\dev\test2

Android Concurrent Executor Interface

Submitted by Dickens A S on Sat, 03/26/2022 - 14:33

This article demonstrates how to use Core Java in android for concurrent Executor,

Question: Why we should use Core Java Executor? why not AsyncTask?

Answer: The reason is android based SDK announced AsyncTask is Deprecated

Question: So simple core java Runnable is good?

Answer: Not really, But in combination with java.util.concurrent.Executor Runnable is good

Question: Is this told by android SDK documentation

Answer: Yes, As shown below

Convert SVG to PNG using R programming

Submitted by Dickens A S on Sun, 10/03/2021 - 08:39
cygwin tools
------------
make
curl

cygwin libraries
--------------
libfftw3-devel
libsndfile-devel
libuv-devel
libxml2-devel
librsvg2-devel
libMagick-devel
libtirpc-devel
libicu-devel
libpcre2-devel
libcurl-devel
libncurses-devel
libbz2-devel
zlib-devel
lzma-devel
libiconv-devel
gmp-devel
mpfr-devel
gettext-devel
gcc-core
gcc-g++

Then within cygwin terminal type "R" in the terminal it will give you a prompt and issue the below commands