[15-09-2017]

Compiling Slatec on macOS

# SLATEC Common Mathematical Library, Version 4.1, July 1993 # a comprehensive software library containing over # 1400 general purpose mathematical and statistical routines # written in Fortran 77. If you want to install SLATEC, you need to make sure to install gfortran. Take a look here for a brief instructions, somewhere in the middle […]


[12-09-2017]

Jekyll on macOS

1. Install Ruby I prefer to install from sources: https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.1.tar.gz > ./configure –prefix=$HOME/opt/ruby > make > make install 2. Install RubyGems I prefer to install from sources: https://rubygems.org/pages/download > export PATH=$HOME/opt/ruby/bin:$PATH > ruby setup.rb 3. Change repo location I compile Ruby without ssh support. I have to change the ruby gems repo > gem sources […]


[31-08-2017]

git, github and multiple users

Different solutions for working with github repos when you have multiple accounts If you have two user accounts at github: {user_a} and {user_b}. Sometimes, you may encounter issues while pushing changes back remote: Permission to {user}/{repo}.git denied to {user_a}. fatal: unable to access ‘https://github.com/{user}/{repo}.git/’: The requested URL returned error: 403 If you are using https, […]


[28-08-2017]

SVN and meld

> svn diff –diff-cmd=’meld’ file_you_have_changed.c


[28-08-2017]

SVN and multiline log comments

> svn commit -m"We tend to forget\ that multiline comments, in SVN, are supper easy.\ And, they can help to introduce multiple changes\ inside one commit. Like:\ – improvements,\ – bug fixes,\ – motivations behind the code." my_super_file.c


[23-08-2017]

Parameter Expansion – POSIX (bash)

+———————-+—————–+—————–+ | parameter | parameter | parameter | | Set and Not Null | Set But Null | Unset | +——————–+———————-+—————–+—————–+ | ${parameter:-word} | substitute parameter | substitute word | substitute word | +——————–+———————-+—————–+—————–+ | ${parameter-word} | substitute parameter | substitute null | substitute word | +——————–+———————-+—————–+—————–+ | ${parameter:=word} | substitute parameter | assign word […]


[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 tree . ├── Makefile └── main.cpp Source code is supper simple. int main() { return 0; } 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 […]


[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: […]