Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
if [ $# -ne 1 ] ; then
echo "Usage: $0 DIRECTORY"
fi
cd "$1" &&
find . -type f -name '*.avi' -print0 |
while IFS= read -r -d $'\0' file; do
printf "%s\t" "$file"
@jerry73204
jerry73204 / controller.py
Created October 25, 2021 13:35
The controller template for Lab3
import rclpy
from rclpy.node import Node
from nav_msgs.msg import Odometry
from lgsvl_msgs.msg import VehicleControlData, Detection3DArray
class Driver(Node):
def __init__(self):
super().__init__('Driver')
@jerry73204
jerry73204 / PKGBUILD-darknet-alexeyab-yolov4-pre
Last active October 18, 2020 18:34
PKGBUILD file for darknet-alexeyab
# Maintainer: acxz <akashpatel2008 at yahoo dot com>
pkgname=darknet-alexeyab
pkgver=r1833.bef28445
pkgrel=1
pkgdesc='YOLO: Real Time Object Detection Neural Network Library (AlexeyAB fork)'
arch=('i686' 'x86_64')
url='https://github.com/AlexeyAB/darknet'
license=('YOLO')
depends=()
optdepends=(opencv)
@jerry73204
jerry73204 / tch-serde.rs
Created June 3, 2020 19:09
serde on tch-rs types example
use failure::Fallible;
use serde::{
de::Error as DeserializeError, ser::Error as SerializeError, Deserialize, Deserializer,
Serialize, Serializer,
};
use std::fs;
use tch::{Device, Kind, Tensor};
fn main() -> Fallible<()> {
let json = fs::read_to_string("example.json")?;
use failure::Fallible;
use ndarray::Array;
use std::convert::TryFrom;
use tch::Tensor;
fn main() -> Fallible<()> {
let tensor = Tensor::try_from(Array::from_shape_fn(
(3, 300, 200),
|(channel, _row, _col)| match channel {
0 => 1f32,
@jerry73204
jerry73204 / install-opencv-4.3.0.sh
Last active May 23, 2020 07:38
OpenCV 4.3.0 installation example
# Set the version we use
pkgver=4.3.0
# Download and unpack OpenCV source code
# Skip it if you already downloaded the file.
aria2c https://github.com/opencv/opencv/archive/$pkgver.tar.gz
tar -xf opencv-$pkgver.tar.gz
# Download and unpack OpenCV extra and plugins source code
# Skip it if you already downloaded the file.
use gnuplot::{AxesCommon, Figure};
use ndarray::{prelude::*, Array1};
use std::f64::consts::PI;
type RealFn = fn(f64) -> f64;
struct NamedFunction(String, RealFn);
struct Wave<F1, F2>
where
F1: Fn(f64) -> f64,
use gnuplot::{AxesCommon, Figure};
use ndarray::{prelude::*, Array1};
use std::f64::consts::PI;
type RealFn = fn(f64) -> f64;
struct NamedFunction(String, RealFn);
struct Wave {
U: Array1<f64>,
f: Box<dyn Fn(f64) -> f64>,
use gnuplot::{AxesCommon, Figure};
use ndarray::{prelude::*, Array1};
use std::f64::consts::PI;
type RealFn = fn(f64) -> f64;
struct NamedFunction(String, RealFn);
struct Wave {
U: Array1<f64>,
f: Box<Fn(f64) -> f64>,
Fresh cfg-if v0.1.10
Fresh autocfg v1.0.0
Fresh unicode-xid v0.2.0
Fresh pkg-config v0.3.17
Fresh lazy_static v1.4.0
Fresh version_check v0.9.1
Fresh slab v0.4.2
Fresh smallvec v1.2.0
Fresh itoa v0.4.5
Fresh futures-core v0.3.4