TRNSYS

Tips and tricks for TRNSYS

In the C/C++ language, the argument needs to be replaced as shown in the table below.

FORTRAN C/C++

Integer

int*

Real(8),
Double Precision

double*

Character(Len=n)

char*, size_t n

Integer

TRNSYS.h

extern "C" __declspec(dllimport) void _cdecl SETTYPEVERSION(int* ver);

#define setTypeVersion SETTYPEVERSION


OS

Tips and tricks for using operating system (Linux,Windows,etc.)

Compiling a software from source in linux

For installing the software in a specified directory
mkdir ~/directory
./configure --prefix=$HOME/directory
make
make install

More information can be found here

Linux: tar extract files
Extract or Unpack a TarBall file
To unpack or extract a tar file, type:
tar -xvf file.tar

More information can be found here

Q: How can I sort the output of 'ls' by last modified date?
A: ls -t or (for reverse) ls -tr

How to change file permissions in linux


Vim

Read more

undo: u
redo: ctrl+r
The :substitute command searches for a text pattern, and replaces it with a text string :%s/foo/bar/g
Find each occurence of 'foo' (in all lines), and replace it with 'bar'
:s/foo/bar/g
Find each occurrence of 'foo' (in the current line only), and replace it with 'bar'.
:%s/foo/bar/gc
Change each 'foo' to 'bar', but ask for confirmation first.
:%s/\/bar/gc
Change only whole words exactly matching 'foo' to 'bar'; ask for confirmation.
sed, a stream editor Q: How to delete all lines of the files in Vim
A:
1. Type gg to move the cursor to the first line of the file.
2. Type dG to delete all the lines.


Python

Tips and tricks for using python

Matplotlib

Package and environment managers

The two most popular tools for setting up environments are:
PIP (a Python package manager; funnily enough, it stands for “Pip Installs Packages”) with virtualenv (a tool for creating isolated environments) Conda (a package and environment manager)
Create a new environment: conda create --name python3 python3
Create a new environment and install all the standard anaconda packages installed by default:
conda create --name python3 python3 anaconda
To active the environment:
source activate python3 (linux)
To deactivate
source deactivate

Useful python scripts

Building an API using Python

CAO

SketchUP

Tips and tricks for using CAO tools Q: Default SketchUp axes orientations?
A:
SketchUp axes orientations

Git

Git

Tips and tricks for using Git Q1: What is the simplest way to list confilicted files in git?
A1: git diff --name-only --diff-filter=U or maybe just git status Q2: What is the simplest way to accept all (incomming or current) changes in confilicted files in git?
A2: git checkout --theirs -- filenames or maybe just git status Q3: Setting up multiple GitHub accounts on Windows A3: http://kevinpelgrims.com/blog/2012/07/20/setting-up-multiple-github-accounts-on-windows/