Wenn die üblichen Encodings wie UTF8, Latin1, ISO-8859-15 nicht funktionieren kann man CP437 versuchen. Das ist der Original-Zeichensatz des IBM-PC ab 1981. Dieser enthält Umlaute die in den üblicherweise eingestellten Encodings nicht angezeigt werden. Hier mein erster Versuch CP437 nach UTF8 zu konvertieren. Die Sourcecode Datei und der Compiler und das ganze Betriebssystem ist selbstverständlich […]
24.07.2023
19.06.2023
How to convert from UTC to local time in C++?
Convert from a broken down date time structure from UTC to localtime in C++. See Stackoverflow: How to convert from UTC to local time in C? I converted the code from C to C++ and make it shorter.
17.09.2022
C++ Guns: throw and catch all standard exceptions for fun
This example throw and catch all standard exceptions just for fun exception list from https://en.cppreference.com/w/cpp/error/exception sorted after C++ Standard searching a stack trace? look at https://en.cppreference.com/w/cpp/utility/basic_stacktrace $ ./a.out All exceptions which was thrown was catched
07.09.2022
C++ Guns: Streams display the format flags
Display which format flags are currently set e.g. fixed, scientific, dec, hex Example output dec fixed skipws https://en.cppreference.com/w/cpp/io/ios_base/flags
30.05.2022
C++ Guns: MPI Dataype; send struct
Das Beispiel habe ich von https://www.mpi-forum.org/docs/mpi-3.1/mpi31-report/node425.htm Jeder Thread erstellt einen MPI Datentyp welcher die Offsett Addressen der struct Member Variablen hat. Thread 1 sendet Daten zu Thread 0 Thread 0 empfaenge Daten von Thread1 und seine eigenen Daten, so dass alle in einem Array dann liegen. $ mpic++ -g -ggdb -Wall test_MPI_struct.cpp $ mpiexec -n […]
14.05.2022
Kaffeetassenwärmer Optimierungsaufgabe
Niemand mag kalten Kaffee! Darum muss ein Kaffeetassenwärmer her! Aber das Zeug was man kaufen kann taugt alles nichts! USB2/1 liefert nicht genügend Leistung und USB3 ist eine Vergewaltigung der kleine Kabelchen. Noch dazu habe ich keinen USB3 Port am Laptop. Eine simple Heizplatte mit einem EIN/AUS Schalter langt doch vollkommen. So wie die in […]
16.02.2022
C++ Guns: Play with std::tuple and std::apply
Part 1: print std::array with std::integer_sequence Part 2: convert tuple to parameter pack Part 3: print std::array with std::apply and fold Part 4: fold over std::tuple und erzeugten Assembler Code Part 5: fold over std::tuple of std::vector of Types ... Part 6: apply generic lambda to tuple Part 7: Play with std::tuple and std::apply 1 […]
02.10.2021
CppCon 2021
Differentiable Programming in C++ GraphBLAS: Building a C++ Matrix API for Graph Algorithms Misra Parallelism Safety-critical Guidelines for C++11, 17, Then C++20, 23 Faster, Easier, Simpler Vectors Making Out the Most of Your Compiler SIMD in C++20: EVE of a new Era POINTER ALARM Testing Compile-time Constructs Within a Runtime Unit Testing Framework Back To […]
18.09.2021
Vektorisieren leicht gemacht
Als Beispiel sollen ein paar reduzierte Zeilen Code aus der Datei computeFluxes.h [1] aus dem Vplna-OP2 [2] Projekt dienen, welche auf unterschiedliche Arten vektorisiert werden sollen. Um so nah wie möglich am original Code zu bleiben, werden die Pointer Argumente der Funktionen, welche Arrays darstellen, wo es möglich ist nicht durch einen passerenden Typen ersetzt. […]
18.06.2021
C++ Guns: template Spezialisierung mit concepts
Die requires Klausel ist echt toll!