C++Guns – RoboBlog

27.04.2015

rsync cron ssh - daily compressed remote backup

Filed under: Allgemein — Tags: — Thomas @ 12:04

Add user Add user on you lokal and remote host. Disable password auth on your remote host: # adduser --disabled-password user Create authentication keys on your lokal machine $ ssh-keygen -t rsa Copy user/.ssh/id_rsa.pub to the end of remote host user/.ssh/authorized_keys rsync command -h humand readable -P show progress -a archive mode -v verbode -z […]

24.04.2015

return void func call (Pseudo Bug of the day 3)

Filed under: Allgemein — Tags: — Thomas @ 08:04

Heute gefunden. Im Prinzip geht der pseudobug so: void calc(int a, int b) { std::cout

21.04.2015

Passing random generators around (functor)

Filed under: Allgemein — Tags: — Thomas @ 02:04

Update: Version with template instead of std::function C++ Guns: Passing function objects around (Update Example random generators) Consider the following problem: One has a parallelly callable function which needs a random generator for every thread. One wants to call the function several times and every time we want another random sequence. How can we implement […]

Calling multiple random generator in parallel c++11

Filed under: Allgemein — Tags: — Thomas @ 00:04

Standard random functions are not thread safe. Calling them in parallel may result in undefined behavior or the threads blocking each other. This is a little test to create the same random sequences in serial as in parallel too. Setting the same seed on a random generator as a start point should produce the same […]

11.04.2015

Local variable will not retain values between function invocations (Bug of the day 2)

Filed under: Allgemein — Tags: — Thomas @ 07:04

Lokale Variablen behalten ihren Wert NICHT zwischen Funktionsaufrufe! Es gibt in diesem Beispiel keinen Compilerfehler und auch keinen von Fortran erkannten Laufzeitfehler. Es gibt Compiler Warnings die diesen Fehler zeigen, aber dazu bedarf es mehr Code. Ich habe dieses Beispiel möglichst klein und übersichtlich gehalten. Ausgabe ohne Optimierung und ohne Fehler kater@ktux:~$ gfortran -Wall -Wextra […]

10.04.2015

Bug of the day 1

Filed under: Allgemein — Tags: — Thomas @ 08:04

Der bug of the day kommt diesmal von mir! Ich hab mir von eine Hand voll 3D Punkten neue Z Werte berechnet. Aber hab den Z Wert im Punkt nie aktualisiert. Und anstatt in der Ausgabedatei nun Bloedsinn steht oder lauter 0 Eintraege, finden sich dort Werte die mit einen berechneten immer ein bis zwei […]

09.04.2015

Polymorphie virtual abstract pure deconstrutor WTF?

Filed under: Allgemein — Tags: — Thomas @ 08:04

Okay ich fasse mal zusammen. Ich sehe 3 Fälle, vom einfachsten zum schwersten. 1) Ganz normal Klassen ableiten. class Base { public: ~Base() { cout

Powered by WordPress