Author Archives: moon_man
How to trace/debug if g++ doesn’t like your templates based code
#c++ #templates
compile a directory & run
files=”” && ls -1 *.c|while read line; do files=”$line $files”; done && $(gcc -Wall $(echo $files) -o bin.x) && echo -ne “Running bin.x\n” && ./bin.x > bin.log & zsh saves variables. bash doesn’t. files=”” && ls -1 *.c|while read line; do files=”$files $line”; echo $files > files.lst; done && gcc -v -Wall `tail -n 1 […]
netstat on macos
lsof -i -P | grep -i “listen” is netstat -lnap|grep “LISTEN”
Redirect output to a file without buffering on linux/mac?
https://serverfault.com/questions/294218/is-there-a-way-to-redirect-output-to-a-file-without-buffering-on-unix-linux This buffers stdout up to a line: This disables stdout buffering altogether: This disables stdout buffering altogether:
From strace to dtruss
https://8thlight.com/blog/colin-jones/2015/11/06/dtrace-even-better-than-strace-for-osx.html
Why is it safer to use sizeof(*pointer) in malloc
https://stackoverflow.com/a/17258659 It is safer becuse you don’t have to mention the type name twice and don’t have to build the proper spelling for “dereferenced” version of the type. For example, you don’t have to “count the stars” in Compare that to the type-based sizeof in where you have too make sure you used the right number of * under sizeof. […]
Hello world!
Welcome to WordPress. This is your first post. Edit or delete it, then start writing!