Author: bitshiftjo1

Move semantics vs Copy semantics; And when to use them.

#include <vector> #include <iostream> class Semantics { public: // Pass by value to store a new copy using std::move // (rvalue is moved, lvalue is copied) Semantics(std::vector<int> in) : m_v(std::move(in)) { } std::vector<int> get() const { return m_v; } // Pass by reference to modify an `out` parameter: lvalue only void append(std::vector<int> &out) { out.insert(out.end(),…

Read the full article

FTDI Linux Misery

1. install ftdi-eeprom and libftdi using apt chris@chris-MacBookPro:~$ apt list –installed | grep ftdi ftdi-eeprom/jammy,now 1.5-5build3 amd64 [installed] libftdi1-2/jammy,now 1.5-5build3 amd64 [installed] libftdi1-dev/jammy,now 1.5-5build3 amd64 [installed] libftdi1-doc/jammy,jammy,now 1.5-5build3 all [installed,automatic] 2. Update udev rules Add a script that will unload the ftdi_sio and usbserial drivers. These drivers conflict with the libftdi driver and prevent ftdi_eeprom…

Read the full article

UDEV tips

Monitor udev rules when devices are plugged/unplugged udevadm monitor Reload the udev rules without restart/logout sudo udevadm control –reload Note it might not seem like this is always necessary but if you skipp this command then you will get false positives and false negatives. After making changes to the .rule file, you should unplug the…

Read the full article