There is a variable $RANDOM than you can read in bash or zsh to get a random number beteen 0 and 32767. Here in zsh on my (old) mac:
% echo $RANDOM
13757
% echo $RANDOM
16896
Due to unexpected failures of github's LaTeX parsing (which were not evident until I published this, but have persisted afterwards), and since the mathematical parts are important in this, I have migrated this proposal to a blog post with identical content, but correctly formatted equations.
Please continue to put any comments here.
This post discusses limitations of current Bitcoin Core RBF policy and attempts to start a conversation about how we can improve it, summarizing some ideas that have been discussed. Please reply if you have any new input on issues to be solved and ideas for improvement!
Please feel free to skip this section if you are already familiar
A friend recently learned about Proebsting's law and mentioned it to me off hand. I knew about the law's existence but I never really asked myself - do I believe in it?
For people who aren't aware, Proebsting's law states:
Compiler Advances Double Computing Power Every 18 Years
Which is to say, if you upgrade your compiler every 18 years, you would expect on average your code to double in performance on the same hardware.
This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project:
/*
* Copyright CC0 Angel Leon <@gubatron>
*/
Update: I believe now it's better to use lldb
, at least on MacOS, here's a LLDB to GDB command map
Here's how to use gdb
to debug issues you might be having hacking bitcoinclassic (or any other C++ program)
A "prefix code" is a type of encoding mechanism ("code"). For something to be a prefix code, the entire set of possible encoded values ("codewords") must not contain any values that start with any other value in the set.
For example: [3, 11, 22]
is a prefix code, because none of the values start with ("have a prefix of") any of the other values. However, [1, 12, 33]
is not a prefix code, because one of the values (12) starts with another of the values (1).
Prefix codes are useful because, if you have a complete and accurate sequence of values, you can pick out each value without needing to know where one value starts and ends.
For example, let's say we have the following codewords: [1, 2, 33, 34, 50, 61]
. And let's say that the sequence of numbers we've received looks like this:
1611333425012
#!/bin/bash | |
# a shell scipt to prepend i3status with more stuff | |
i3status --config ~/.i3status.conf | while : | |
do | |
read line | |
LG=$(setxkbmap -query | awk '/layout/{print $2}') | |
echo "LG: $LG | $line" || exit 1 | |
done |
# Input data | |
list_0 = [1, 3, 6, 7, 8, 9, 10, 2, 3, 4] | |
list_1 = [12, 56, 3, 78, 34, 56, 2, 10] | |
list_2 = [123, 567, 234, 890] | |
list_3 = [5, 7, 8, 9, 3, -2, -4, -2, 5, 6, 8, 11, 2] | |
# Iterative algorithm | |
def maximum(L): | |
biggest_item = L[0] | |
for item in L: |
/* | |
Packet sniffer using libpcap library | |
*/ | |
#include<pcap.h> | |
#include<stdio.h> | |
#include<stdlib.h> // for exit() | |
#include<string.h> //for memset | |
#include<sys/socket.h> | |
#include<arpa/inet.h> // for inet_ntoa() |