In computing, memoization or memoisation
is an optimization technique used primarily
to speed up computer programs by storing
the results of expensive function calls and
returning the cached result when the same
inputs occur again.
— wikipedia
import { forEachObjIndexed } from "ramda"; | |
import * as React from "react"; | |
import { | |
Animated, | |
ScrollView, | |
View, | |
ViewStyle, | |
LayoutChangeEvent, | |
NativeScrollEvent, | |
} from "react-native"; |
/** | |
This is an implementation of Zigbee device communication using an XBee | |
and a Centralite Smart Switch 4256050-ZHAC | |
dave (www.desert-home.com) | |
source: http://www.desert-home.com/2014/10/zigbee-protocol-xbee-but-this-time.html | |
*/ | |
// This code will handle both a Uno and a Mega2560 by careful use of | |
// the defines. I tried it on both of them, and the only problem is that |
const path = require('path'); | |
const getWorkspaces = require('get-yarn-workspaces'); | |
const blacklist = require('metro-config/src/defaults/blacklist'); | |
const workspaces = getWorkspaces(__dirname); | |
module.exports = { | |
projectRoot: path.resolve(__dirname, 'packages/app'), |
When developing a Zigbee Home Automation application or Wanting to talk with a Zigbee Home Automation Device, the XBee module you should select is the XBee ZB SMT module or XBee ZB (Zigbee) Surface Mount module.
Using our XCTU software or some other Terminal Emulator or processor, the following settings within the XBee ZB SMT module would need to be set:
ZS 2
AP 1
AO 3
EE 1
// gif by dave @beesandbombs :) | |
int[][] result; | |
float t, c; | |
float ease(float p) { | |
return 3*p*p - 2*p*p*p; | |
} | |
float ease(float p, float g) { |
Quickly check for supported NVENC and NPP hardware acceleration capabilities in FFmpeg on your platform:
Depending on how you built ffmpeg, you may want to check the supported NVENC-based hardware acceleration capabilities in ffmpeg by running:
$ for i in encoders decoders filters; do
echo $i:; ffmpeg -hide_banner -${i} | egrep -i "npp|cuvid|nvenc|cuda|nvdec"
done
Sample output (as on my testbed):
Spawning multiple ffmpeg processes with xargs:
On standard NVIDIA GPUs (Not the Quadros and Tesla lines), NVENC encodes are limited to two simultaneous sessions. The sample below illustrates how to pass a list of AVI files to ffmpeg and encode them to HEVC on two encode sessions:
$ find Videos/ -type f -name \*.avi -print | sed 's/.avi$//' |\
xargs -n 1 -I@ -P 2 ffmpeg -i "@.avi" -c:a aac -c:v hevc_nvenc "@.mp4"
This will find all files with the ending .avi
in the directory Videos/
and transcode them into HEVC/H265+AAC files with the ending .mp4. The noteworthy part here is the -P 2
to xargs, which starts up to two processes in parallel.
#!/usr/bin/env bash | |
if ! [ "$#" -eq 1 ]; then | |
echo "Usage: install_ffmpeg_amzn_linux.sh build_directory" | |
exit 1 | |
fi | |
CPU_THREADS=`cat /proc/cpuinfo | grep processor | tail -1 | awk '{print $NF}'` | |
ROOT_DIR=$1 | |
SOURCES_DIR=$ROOT_DIR/ffmpeg_sources |
/* OctoWS2811 - High Performance WS2811 LED Display Library | |
http://www.pjrc.com/teensy/td_libs_OctoWS2811.html | |
Copyright (c) 2013 Paul Stoffregen, PJRC.COM, LLC | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |