[23-08-2017]
Parameter Expansion – POSIX (bash)
source: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_02
source: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_02
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 […]
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 […]
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 […]
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 […]
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 […]
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 […]
cat MyClass.java | grep ^import | sort | uniq
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.
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 […]
defaults write org.R-project.R force.LANG en_US.UTF-8
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, […]
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
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: […]
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 […]
Simple one liner that helps to find all config locations inside your HOME directory ls -a1 $HOME | grep ‘^\.’
iTunes -> Windows -> Equaliser # alternatively: Option + Command + E
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
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 […]