-
Install the
pdftk
for the PDF stream, andbbe
to do binary replacement (sed
for binaries).brew install pdftk-java bbe
-
Decompress the PDF.
pdftk infile.pdf output uncompressed.pdf uncompress
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
using System; | |
using System.Runtime.InteropServices; | |
using System.Text; | |
namespace NvmlWrapper | |
{ | |
/// <summary> | |
/// Nvml return codes | |
/// </summary> | |
public enum nvmlReturn_t |
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
Host *.trycloudflare.* | |
Hostname %h | |
# This setup is originally used to connect Google Colab machine. | |
User root | |
Port 22 | |
IdentityFile ~/.ssh/colab/id_ecdsa | |
# NOTE https://github.com/PowerShell/Win32-OpenSSH/issues/1185 | |
# this limits to WIN-only connection, files are shared across WSL2 and host. |
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 | |
# get host address | |
HOST=$(ip address show dev eth0 | awk -F '[ /]+' '/inet / { print $3 }') | |
# start the server | |
powershell.exe -Command '& "C:\Program Files\VcXsrv\vcxsrv.exe" -multiwindow -nowgl' | |
# configure xhost | |
WSLENV="$WSLENV:DISPLAY" |
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
<?xml version="1.0" encoding="UTF-8" ?> | |
<config | |
Name="Microsoft Visual C++ 2019 (C)" | |
ShortName="MSVC160" | |
Manufacturer="Microsoft" | |
Version="16.0" | |
Language="C" | |
Priority="A" | |
Location="$VCROOT\" > | |
<Details |
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 python | |
# This is used for automatically setup DPT-RP1 to usb-network, before python | |
# package dptrp1 starts. | |
import serial | |
with serial.Serial('/dev/ttyACM0', 115200) as tty: | |
# Activate CDC/ECM mode | |
tty.write(b"\x01\x00\x00\x01\x00\x00\x00\x01\x01\x04") |
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
# all operations work under SOURCE | |
cd SOURCE | |
# list files | |
rsync -avzm --stats --safe-links --ignore-existing --dry-run --human-readable \ | |
SOURCE DESTINATION > FILE_LIST | |
# rsync files | |
cat FILE_LIST | parallel --will-cite -j NUM_THREADS \ | |
rsync -avzm --relative --stats --safe-links --ignore-existing --human-readable {} \ |
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 io | |
import logging | |
from multiprocessing import Pool | |
import os | |
from functools import partial | |
import random | |
import re | |
import sched | |
import signal | |
import time |
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
""" | |
Concat spectrum from different sensors. | |
""" | |
from io import StringIO | |
import logging | |
import click | |
import coloredlogs | |
import numpy as np | |
import pandas as pd |
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 <iostream> | |
#include <fstream> | |
#include <sstream> | |
#include <vector> | |
#include <chrono> | |
#include <random> | |
#include <algorithm> | |
#include <cmath> | |
#define DATASET_FILENAME "iris.data" |
NewerOlder