[23-08-2017]

Parameter Expansion – POSIX (bash)

source: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_02


[10-08-2017]

R 3.4, rJava, macOS and even more mess ;)

So, you want to have rJava (e.g. rJava_0.9-8.tar.gz) inside your fresh, new installation of R 3.4 and you are running macOS. There are bad news and good news ;) Bad news. It will fail with default clang that comes with XCode. You need something better here, something with support for OpenMP. And you can get […]


[08-08-2017]

Retro Like (8bit) Terminal Game – playing for Fun and Profit :)

So, what do you think about playing retro style, terminal based, game where you can gain some real life experience as well. If you are interested, take a look below (click the image for the full experience – or click here for full screen size). I find Cathode to be supper fancy terminal emulator with […]


[02-08-2017]

How to share enum between C++ and Java ;)

Note! This is not actual suggestion for proceeding like this during development ;) It’s one of this “fake it till you make it” solutions. So, please, don’t try it at home! ;) There was this question at Stack Overflow. How to share enums. And you want to share them between C++ and Java. Well, there […]


[10-07-2017]

Running GDB in macOS sierra

At some point Apple dropped GNU based toolchain in favor of LLVM. However, sometimes you need these tools. One of such examples is debugging Fortran codes. lldb is not able to do it properly, yet. You can trace the execution of code, you can step over, but you can’t examine variables. In that case, you […]


[07-06-2017]

R, Java, rJava and macOS adventures

For updated info (for R3.4) take a look HERE. R, rJava, Java and macOS is a mess. In fact, Java itself is a mess when it comes to macOS. First of all, you can have different Java installations: Oracle based or system based. # this is the place where Java Framework resides /System/Library/Frameworks/JavaVM.framework # this […]


[05-06-2017]

There are daemons in Java ;)

Take a look here, for more details: recipe № 029


[25-05-2017]

JNI, Python and _Py_Zero that was not there

Recently, I had this issue with JNI code calling Python script using shared libraries provided by Python itself. The schema is quite easy to follow, and you can easily apply it inside C based code. // Initialize Python (can be done once – for a whole life of JVM) Py_Initialize(); // Remember to reserve PyGILState […]


[15-05-2017]

Remove redundant imports in Java file in CLI

cat MyClass.java | grep ^import | sort | uniq


[03-05-2017]

Multiple threads and JVM access from C code

In case you are looking for sample code related to JVM and accessing it from C (like this one): take a look here: recipe № 027.


[21-04-2017]

requested Java version ((null)) not available. Using Java at “” instead

If you are getting following errors while trying to install xlsx package in R (macOS) > library(xlsx) Loading required package: rJava Error : .onLoad failed in loadNamespace() for ‘rJava’, details: > library(xlsx) JavaVM: requested Java version ((null)) not available. Using Java at “” instead. JavaVM: Failed to load JVM: /bundle/Libraries/libserver.dylib JavaVM FATAL: Failed to load […]


[12-04-2017]

Enforce LANG settings in R – macOS

defaults write org.R-project.R force.LANG en_US.UTF-8


[07-04-2017]

What if you want to modify Makefile content while building your code

Well, it’s possible. Let’s say we have directory with source code: main.cpp Source code is supper simple. What we want to do is to run Makefile and make sure that all occurrences of main will be changed to directory name (e.g. myCode). All we have to do is to get location of Makefile, update it, […]


[07-04-2017]

Change file name to directory name

OK, I am not sure whether anybody really needs something like this. But, in case you want to change your executable name to the same name as your directory name, try this BASENAME := $(notdir $(CURDIR)) all: copy exe copy: @cp main.cpp $(BASENAME).cpp exe: copy $(BASENAME).cpp gcc -o $(BASENAME).o $(BASENAME).cpp


[05-04-2017]

/bin/sh: @echo: command not found

If you get this one, remember about missing new line after shell call that spans over multiple lines that are split with \. You will get this error in case you don’t add explicit new line and you want to silence the command using @ symbol at the same time. LIST=a b c d all: […]


[14-03-2017]

Running Open MPI on macOS

I am, generally, against all these automation stuff (brew, etc.) at macOS. I prefer to install everything from sources (as long as it is possible). So, here are few steps to get Open MPI up and running at macOS. Please make sure to download source package from: https://www.open-mpi.org/software/ompi/v2.0/downloads/openmpi-2.0.2.tar.gz. # put this file somewhere inside your […]


[06-03-2017]

Get all hidden files inside $HOME

Simple one liner that helps to find all config locations inside your HOME directory ls -a1 $HOME | grep ‘^\.’


[17-02-2017]

In case you like more bass, the same way I do ;)

iTunes -> Windows -> Equaliser # alternatively: Option + Command + E


[17-02-2017]

apps keep asking for key chain access

1. Open Key Chain Access and unlock all key chains 2. use security utility to set timeout for keychain security -v set-keychain-settings -t 72000 login.keychain You can read more about security using man man security


[12-02-2017]

Scratch Coding Cards by Natalie Rusk

Summary: So far, the best Scratch Coding resource I have found :) “Old school” way of learning (one that industrial era developed) is based on reading. To know something, you have to read something. Well, that’s not always the best idea. And let me remind you, that an old philosopher, long, long time ago in […]