View raised_wall.py
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 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 |
View schema.ebnf
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
Schema = SCHEMA-TYPE TLV-LENGTH | |
StringTable | |
TokenTable | |
StringTable = STRING-TABLE-TYPE TLV-LENGTH *OCTET | |
TokenTable = TOKEN-TABLE-TYPE TLV-LENGTH *Token | |
Token = Offset Size |
View qt-creator-ndn-style.xml
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
<?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> |
View gist:b556ed037f0a663b21d14dbdaced865f
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
# -*- 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" |
View .zshrc
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
# 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 |
View time_tlv.py
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
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) |
View rto-analysis.py
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
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: |
View rtt-unfairness.py
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
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 |
View graffle2pdf
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
#! /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 |
View docx-to-pdf.scr
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
#!/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 |
NewerOlder