This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "ff.h" | |
#include "vfs_fat_internal.h" | |
/** | |
* Usage: | |
* | |
* Arduino: | |
* SD.begin(); | |
* format_sdcard(); | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import scipy.sparse | |
def correlate_sparse(matrix1, matrix2, mode='valid'): | |
""" | |
Cross-correlation of two 1-dimensional sparse CSR matrices. | |
Drop-in replacement for `np.correlate`. | |
Parameters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import urllib.request | |
from pathlib import Path | |
from bs4 import BeautifulSoup | |
from tqdm import trange, tqdm | |
url_page_template = "https://ukrlib.com.ua/books/rating.php?so=1&page={page_id}" | |
url_download_template = "https://ukrlib.com.ua/books/getfile.php?tid={tid}&type=3" | |
BEST_BOOKS_DIR = Path(__file__).parent / "best" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.jetbrains.annotations.NotNull; | |
import java.util.Iterator; | |
import java.util.NoSuchElementException; | |
/** | |
* Ring buffer (fixed size queue) implementation using a circular array (array | |
* with wrap-around). | |
*/ | |
public class RingByteBuffer implements Iterable<Byte> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import serial | |
ser = serial.Serial( | |
port='/dev/ttyACM0', # dmesg | grep tty | |
baudrate=115200, | |
parity=serial.PARITY_NONE, | |
stopbits=serial.STOPBITS_ONE, | |
bytesize=serial.EIGHTBITS, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` | |
[40m[1m[33mwarn[39m[22m[49m: ExtCore.WebApplication[0] | |
Error loading assembly 'SQLitePCLRaw.bundle_green' | |
[40m[1m[33mwarn[39m[22m[49m: ExtCore.WebApplication[0] | |
System.IO.FileNotFoundException: Could not load file or assembly 'SQLitePCLRaw.bundle_green, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified. | |
File name: 'SQLitePCLRaw.bundle_green, Culture=neutral, PublicKeyToken=null' | |
at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, IntPtr ptrLoadContextBinder) | |
at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, IntPtr ptrLoadContextBinder) | |
at System.Reflection.Assembly.Load(AssemblyName assemblyRef, IntPtr ptrLoadContextBinder) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# sudo crontab -e | |
# @reboot /home/dizcza/Programs/checkwifi.sh | |
# sudo update-rc.d cron defaults | |
/bin/sleep 30 | |
while true; do | |
/usr/bin/wget -T5 -q --spider google.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import date | |
from dateutil.rrule import rrule, DAILY | |
import itertools | |
masks = ( | |
# same | |
'aaaaaaaa', | |
'aaaaaaaaa', | |
'aaaaaaaaaa', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# based on tutorial: https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/#install-using-the-repository | |
sudo apt-get update | |
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo apt-key fingerprint 0EBFCD88 | |
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ | |
$(lsb_release -cs) \ | |
stable" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
import os | |
class GpuInfo(object): | |
def __init__(self, index, memory_total, memory_used, gpu_load): | |
""" | |
:param index: GPU index | |
:param memory_total: total GPU memory, Mb | |
:param memory_used: GPU memory already in use, Mb |
NewerOlder