WIF = base58check encode ([version byte][private key][checksum])
version byte = 80 for mainnet, ef for testnet and regtest
checksum = first 4 bytes of double SHA256 of private key
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
$ gst-launch-1.0 -e v4l2src device=/dev/video0 do-timestamp=true ! 'video/x-raw, width=640, height=480, framerate=30/1' ! tee name=t \ | |
t. ! queue ! videoconvert ! autovideosink \ | |
t. ! queue leaky=downstream ! videoconvert ! x264enc tune=zerolatency speed-preset=ultrafast key-int-max=30 byte-stream=true ! splitmuxsink muxer=mp4mux location=output.mp4 | |
Notes: | |
x264enc appears to be not playing nice with streams. Removing its options blocks the pipeline. Replacing it with vaapih264enc works but then splitmuxsink has to be replaced with filesink for some reason... | |
vaapih264enc enables hardware acceleration on systems with Intel hardware. The plugin is available if you install an extra package: sudo apt install gstreamer1.0-vaapi |
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
System: MacOS Sonoma 14.1.2 | |
First, try to unplug and plug back the Yubikey. | |
Second, try rebooting the system. | |
Make sure `opensc` package is up to date. I am using Macports to install utilities/libraries and other command-line utils. | |
``` | |
$ sudo port upgrade opensc | |
``` |
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
$ find . -maxdepth 1 -type d \( ! -name . \) -exec bash -c "cd '{}' && git pull" \; |
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 Microsoft.ML.Probabilistic.Math; | |
using Vector = Microsoft.ML.Probabilistic.Math.Vector; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Vector x = Vector.FromArray(new double[] { 0, 1 }); | |
//Vector x = new Vector(); | |
//Vector mean = new Vector(new double[] { 0.1, 1.1 }); |
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
// Two balls in the bag: | |
// (1) fifty/fifty red (true) or green (false) | |
// (2) 100% red | |
// | |
// Process: | |
// - pull out the first ball and observe it is red | |
// - Question: what is the probability the remaining ball is red too? | |
var model = function() { | |
var b1 = flip(0.5) |
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 java.io.IOException; | |
import javax.servlet.ServletException; | |
import javax.servlet.annotation.WebServlet; | |
import javax.servlet.http.HttpServlet; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; | |
@WebServlet(name = "HelloServlet", urlPatterns = {"hello"}, loadOnStartup = 1) | |
public class HelloServlet extends HttpServlet { | |
protected void doGet(HttpServletRequest request, HttpServletResponse response) |
Note: these instructions are for pre-Sierra MacOS. Sierra and newer users see https://gist.github.com/gravitylow/fb595186ce6068537a6e9da6d8b5b96d by @gravitylow.
If you are getting this in gdb on OSX while trying to run a program:
Unable to find Mach task port for process-id 57573: (os/kern) failure (0x5).
(please check gdb is codesigned - see taskgated(8))
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 Microsoft.ML.Probabilistic.Models; | |
namespace twodice | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Variable<int> six = Variable.DiscreteUniform(6); |
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
// | |
// Zoo: Infer prevalence of 3 animals after a zoo visit | |
// | |
// Observed: 3 lions, 2 tigers and 1 bear | |
// | |
// Questions: | |
// - Prevalence of each species | |
// - Probability of seeing a bear next time | |
// |
NewerOlder