Use the following snippet at the top of your Juyter Notebook or iPython shell:
%load_ext autoreload
%autoreload 2
Then you can use it as so:
# Add the source | |
echo "deb http://packages.azlux.fr/debian/ buster main" | sudo tee /etc/apt/sources.list.d/azlux.list | |
wget -qO - https://azlux.fr/repo.gpg.key | sudo apt-key add - | |
# Refresh sources | |
sudo apt update |
// Copies a string to the clipboard. Must be called from within an | |
// event handler such as click. May return false if it failed, but | |
// this is not always possible. Browser support for Chrome 43+, | |
// Firefox 42+, Safari 10+, Edge and Internet Explorer 10+. | |
// Internet Explorer: The clipboard feature may be disabled by | |
// an administrator. By default a prompt is shown the first | |
// time the clipboard is used (per session). | |
function copyToClipboard(text) { | |
if (window.clipboardData && window.clipboardData.setData) { | |
// Internet Explorer-specific code path to prevent textarea being shown while dialog is visible. |
"""Multiprocessing demo with externally accessible variables | |
""" | |
import time | |
from ctypes import c_bool | |
from multiprocessing import Process, Value | |
class MyProcess: | |
def __init__(self): | |
self._thread = None |
#!/usr/bin/env bash | |
"""Monitor a directory and rsync to a remote host on file change. | |
Example usage: | |
./rsync-watch.sh [email protected] . /home/pi/myproject | |
""" | |
RED=`tput setaf 1` | |
GREEN=`tput setaf 2` | |
YELLOW=`tput setaf 3` |
Use the following snippet at the top of your Juyter Notebook or iPython shell:
%load_ext autoreload
%autoreload 2
Then you can use it as so:
Official documentation here, but steps had to be slightly modified to install it on python3.
Install the package:
pip3 install virtualenvwrapper
#include "Arduino.h" | |
#include "FSR.h" | |
#define CFD_DELAY_MS 500 | |
#define CFD_ZERO_CROSSING_TRIGGER_VALUE 50.0 | |
Fsr::Fsr(int pin, int threshold) :pin(pin), threshold(threshold) { | |
cfd_timer = millis(); | |
cfd_prev_value = -read(); | |
} |
class Flasher | |
{ | |
// Class Member Variables | |
// These are initialized at startup | |
int ledPin; // the number of the LED pin | |
long OnTime; // milliseconds of on-time | |
long OffTime; // milliseconds of off-time | |
// These maintain the current state | |
int ledState; // ledState used to set the LED |
To find the partition, use the command:
$ df
The output will be something like below. In this case, the SD card is on /dev/mmcblk
(ignore the two partitions).
Filesystem Size Used Avail Use% Mounted on
import matplotlib.pyplot as plt | |
import matplotlib.animation as animation | |
class LivePlot(): | |
def __init__(self, y_range:list, x_points=200, interval_ms=50, title="Data Stream", ylabel="Data", xlabel="Samples"): | |
"""Creates a figure that continually updates with live data. | |
To set data value stream, the user must inherit this class. | |
Example: |