Skip to content

Instantly share code, notes, and snippets.

import math
import numpy
from fractions import Fraction
m = [15.25, 16, 15.25, 16.75, 16, 15.25, 16.75, 16, 12.25, 3]
m_abs = []
runner = 0
for i in m:
runner += i
Schema = SCHEMA-TYPE TLV-LENGTH
StringTable
TokenTable
StringTable = STRING-TABLE-TYPE TLV-LENGTH *OCTET
TokenTable = TOKEN-TABLE-TYPE TLV-LENGTH *Token
Token = Offset Size
@cawka
cawka / qt-creator-ndn-style.xml
Created November 17, 2021 15:55
QT Creator NDN style approximation
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorCodeStyle>
<!-- Written by QtCreator 4.8.84, 2021-11-17T10:54:55. -->
<qtcreator>
<data>
<variable>CodeStyleData</variable>
<valuemap type="QVariantMap">
<value type="bool" key="AlignAssignments">false</value>
<value type="bool" key="AutoSpacesForTabs">false</value>
<value type="bool" key="BindStarToIdentifier">false</value>
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.define "dct-dev-1"
config.vm.box = "bento/ubuntu-20.04"
config.vm.hostname = "dct"
config.vm.provider "virtualbox" do |vb|
vb.name = "dct-dev-1"
vb.cpus = "8"
vb.memory = "16384"
@cawka
cawka / .zshrc
Created March 21, 2021 19:03
my zshrc
# setopt noautomenu
autoload -Uz compinit && compinit
autoload bashcompinit && bashcompinit
setopt autocd
bindkey "[D" backward-word
bindkey "[C" forward-word
bindkey "^[a" beginning-of-line
bindkey "^[e" end-of-line
b = 0
m_bits = 5
m_max = (1<<m_bits)
for i in range(0,256):
e = i >> m_bits
m = i & ((1<<m_bits) - 1)
if e == 0:
x = (0 + m / m_max) * pow(2, 1 + b)
rto = 3000
sample=0
x = [400.0, 200.0, 200.0, 200.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0]
srtt = 0
for i in x:
if srtt == 0:
srtt = i
devRtt = srtt / 2.0
else:
@cawka
cawka / rtt-unfairness.py
Created October 17, 2019 20:30
rtt-unfairness.py
flow1 = 1.0
flow2 = 1.0
for i in range(1, 100):
flow1 = flow1 * 2
# flow 2 twice as fast
flow2 = flow2 * 2
flow2 = flow2 * 2
#! /usr/bin/osascript
on run argv
if not (count argv) = 2
return "Usage:\n graffle2pdf <input file> <output file>"
end if
set pwd to do shell script "pwd"
set _input to item 1 of argv as text
#!/usr/bin/osascript
on run argv
if not (count argv) = 2
return "Usage:\n docx-to-pdf <input file> <output file>"
end if
set pwd to do shell script "pwd"
set _input to item 1 of argv as text