RSSAmplifier

Blog

edryd

Recent content on edryd

edryd.orgRSS feed ↗26 posts

Latest posts

Developing Black and White Film

One of the best ways to improve your craft of photography is by shooting film.
Analog photography allows you to focus on what matters: creating good photos.
Film cameras tend to be very minimalist,
removing the clutter on modern digital cameras.
Unless you are doing very technical photography, 1 
the shiny newest specs of a modern digital camera might just be a distraction to…

Tisp v0.1 Release

After over 7 years of off-and-on development (but mostly off),
I am finally releasing the first version of Tisp, the tiny lisp programming language.
Tisp is far from complete or being ready to use in the real world,
but I am now satisfied at the current state of features. 
 Before the idea of tisp ever formed, I worked on a shell interpreter called s .
It is a traditional shell…

Read Files at Compile Time in C

Any beginners C tutorial will teach the basics of the C standard library’s
file reading functions (eg fopen ). The limitations of these interfaces is that they are designed
for run time reading, meaning that the file will be opened and read when the program is executed.
For most cases this is exactly what is wanted, often the file is only given at
run time by the user.…

Intro to Lattice Quantum Chromodynamics

At the start of the 20th century two new revolutionary and counterintuitive areas of
physics were being developed, quantum mechanics and special relativity. While quantum mechanics
describes the strange world of the subatomic with discrete energies, special relativity describes
the effects of moving incredibly fast: time dilation and space contraction (general relativity is
needed…

DIY Trackpoint Mechanic Keyboard


 
 
 

 
 I’ve used a mechanical keyboard for many years now. I currently own a
tenkeyless layout, even though as a programmer I almost never use the
arrow cluster or function row, so I to try the much more compact 60%
design. I also no longer care for the Cherry MX blue switches on my old board
since they are quite loud, so I went with MX clears…

The Dangers of C Macros

C macros, while being extremely powerful when used correctly, can also be the
cause for a lot of unnecessary headaches if you are not aware of their
limitations. It is easy to view macros as just a fast shorthand for making
simple functions, but there are very important differences which need to be
addressed. 
 This post outlines some real life examples of macros I have come…

Protein Folding with Homology Simulations

This article is based on research I did as a freshman undergrad, see the full project
here . 
 
 
 
 

 
 Proteins naturally fold into their lowest energy configuration, just like a ball rolling down a
hill to a lower potential. This folded structure gives proteins their function, similar to
how which lock a key can open is determined by its shape, not the…

Multivariable Calculus Cheatsheet

trig identities 
 $$\sin^2 \theta + \cos^2 \theta = 1$$ 
 $$1+ \tan^2 \theta = \sec^2 \theta$$ 
 $$1+ \cot^2 \theta = \csc^2 \theta$$ 
 $$\sin(a \pm b) = \sin(a)\cos(b) \pm \cos(a)\sin(b)$$ 
 $$\cos(a \pm b) = \cos(a)\cos(b) \pm \sin(a)\sin(b)$$ 
 $$\sin(-\theta) = -\sin \theta$$ 
 $$\cos(-\theta) = \cos \theta$$ 
 $$\tan(-\theta) = -\tan \theta$$ 
 derivatives…

Proof of Derivative Properties

derivation of the quotient rule 
 The quotient rule is used to take the derivative of a function with divided
expressions: 
 $$
\left(\frac{u}{v}\right)’ = \frac{vu’ - uv’}{v^2}
$$ 
 It is possible to prove this rule by utilizing the definition of the
derivative; however, this is not nearly as elegant as the following simple
proofs which use other…

Overview of libsl


 
 
 

 
 libsl is an extremely small library used to write better and clearer C
programs. The code was created by the suckless community, a small group of
C hackers and developers creating powerful yet simple programs for Linux
designed to be lightweight, configurable, and easier to maintain then the many
other unnecessarily bloated alternatives . You can…

General Physics Cheatsheet

$ \newcommand{\e}[1]{ \times 10^{#1}} $ 
 constants 
 $m_e = 9.11\e{-31} kg = .511 \frac{MeV}{c^2} = 5.4858\e{-4} u$ 
 $m_p = 1.673\e{-27} kg = 938 \frac{MeV}{c^2} = 1.007276 u$ 
 $m_n = 1.675\e{-27} kg = 940 \frac{MeV}{c^2} = 1.008665 u$ 
 $u = 1.6605\e{-27} kg = 931.5 \frac{MeV}{c^2}$ 
 $e = 1.6012\e{-19} C$ 
 $\mu_0 = 4\pi\e{-7}$ 
 $k = 8.988\e9 \frac{Nm^2}{C^2}$…

Understanding Vim's Indenting System


 
 
 

 
 Like most things in Vim, the indenting (tabs) system is complex making it
extremely flexible so that it can fit any programming language or use case.
However, the commands and terminology can be confusing for beginners, this
post is designed to explain all the different commands and options needed to
fully control and customize tab’s size,…

aln2grishin

aln2grishin.py: &#xA; #!/usr/bin/env python &#xA; '''&#xA; Convert clustal alignment files to grishin format for use in Rosetta&#xA; protein homology simulatoins&#xA; &#xA; Author: Ed van Bruggen <edvb@uw.edu>&#xA; ''' &#xA; &#xA; import argparse &#xA; from argparse import RawTextHelpFormatter&#xA; &#xA; parser = argparse . ArgumentParser(description = __doc__ , formatter_class =…

body

body: &#xA; #!/usr/bin/env bash&#xA; &#xA; # body: print the body of a file &#xA; # &#xA; # if only two arguments are given print the file given by the first at the line &#xA; # number from the second. If a third argument is given print until that line. &#xA; &#xA; if [[ $# == 2 ]] ; then &#xA; sed -n $2 p $1 &#xA; elif [[ $# == 3 ]] ; then &#xA; sed -n $2 , $3 p $1 &#xA; else &#xA; echo 'usage:…

calc

calc: &#xA; #!/usr/bin/env bash&#xA; &#xA; # calc: preform fast calculations on the go &#xA; # &#xA; # Tired of having to open a new terminal, run `bc`, type the calculation, only &#xA; # to exit right after seeing the answer? Suffer no longer! Now just type &#xA; # `calc 2+2` and instantly see the answer! &#xA; &#xA; echo ' $@ ' | bc -l&#xA;

dmenium

&#xA; browse : return selected file or folder &#xA; calc : calculator using bc &#xA; dwm-mode : change dwm window mode &#xA; m8ball : magic 8 ball &#xA; man : open man page in terminal &#xA; menu : select different programs or dmenu scripts &#xA; prog : launch program &#xA; quit : select logout, reboot, shutdown, or lock &#xA; todo : view, add or delete todos from a file &#xA; win : focus on an…

dotfiles

This is the place I use to store all my configuration files for programs such&#xA;as Vim, Bash, Tmux, etc. These files are only designed to be used on Linux. I&#xA;recommend you not to just copy whole files, but instead copy one line at a time&#xA;that you understand and slowly build up a huge file. This way you have a setup&#xA;that fits you best. &#xA; installation &#xA; Simply run make install…

echk

echk: &#xA; #!/usr/bin/env bash&#xA; &#xA; # echk: functions to display shell error code &#xA; &#xA; echk_color () { &#xA; # set color depending on if the last command succeed or not &#xA; if [[ $? -eq 0 ]] ; then &#xA; echo -ne '\033[0;32m' &#xA; return 0 &#xA; else &#xA; echo -ne '\033[0;31m' &#xA; # need to return a value so that the other functions here will &#xA; # know if last command ran OK…

g

g: &#xA; #!/usr/bin/env bash&#xA; &#xA; # g: tiny git wrapper &#xA; &#xA; if [[ $# -eq 0 ]] ; then &#xA; &#x9;git status&#xA; else &#xA; &#x9;git ' $@ ' &#xA; fi &#xA;

gst

Easy way to create GitHub Gists through the command line. Simply give it the&#xA;files to upload and gst will return the URL to the new gist. &#xA; Options &#xA; -e ID &#xA; Edit previously created gist specified with ID &#xA; -d DESCRIPTION &#xA; Set gist description &#xA; -D FILE &#xA; Delete FILE from gist being edited &#xA; -f FILENAME &#xA; Set file name when reading from stdin &#xA; -g URL…

markman

Simple ad hoc generation of Unix man pages from markdown files.&#xA;It includes customizations and ability to supply additional information or formatting needed for man&#xA;pages not found in traditional markdown.&#xA;For example, you can add a synopsis section from a command&rsquo;s help message, convert the title&#xA;header into the name section, or add a description header before the first…

nt

SYNOPSIS &#xA; nt [ -Dilvy ] [ -f FILE ] [ -e NOTE ] [ -d NOTE ] [ -t [ TAG ]] [ -n NUM | -NUM ] [ NOTE &hellip;] &#xA; DESCRIPTION &#xA; Simple note taker for the command line. To take a note simply run the command&#xA;with the new note as arguments or from stdin. The note will be saved to a plain&#xA;text file with each line being a note. The file is saved to the file either&#xA;specified with…

pub

pub: &#xA; #!/usr/bin/env bash&#xA; &#xA; # pub: prepare post to be published &#xA; # &#xA; # Moves given draft into the posts directory and prefixes the filename with the &#xA; # date so that it is ready to be published. &#xA; &#xA; if [[ $# == 0 || $# > 2 || ! -f ' $1 ' ]] ; then &#xA; echo 'usage: pub FILE [POSTDIR]' &#xA; exit 1 &#xA; fi &#xA; &#xA; date = $( date + '%Y-%m-%d' ) &#xA; file =…

sett

sett: &#xA; #!/usr/bin/env bash&#xA; &#xA; # sett: set title of a terminal &#xA; # &#xA; # Change the title of any terminal window. If no argument is given it sets the &#xA; # title to the working directory, otherwise the supplied TITLE is used. &#xA; &#xA; title = $1 &#xA; if [[ -z $title ]] ; then &#xA; &#x9; title = ' $( basename ' $PWD ' ) ' &#xA; fi &#xA; echo -n ']0; $title ' &#xA;

slant

slant.css: &#xA; /* &#xA; * Add slants to edge of a HTML element&#xA; * To use simply add class='slant-up' to your HTML element &#xA; */ &#xA; &#xA; . slant-up {&#xA; clip-path : polygon ( 0 5 vw , 100 % 0 , 100 % calc ( 100 % - 5 vw ), 0 100 % );&#xA; }&#xA; &#xA; . slant-down {&#xA; clip-path : polygon ( 0 0 , 100 % 5 vw , 100 % 100 % , 0 calc ( 100 % - 5 vw ));&#xA; }&#xA; &#xA; . slant-t-up…

tg

tg: &#xA; #!/usr/bin/env bash&#xA; &#xA; # tg: quickly tag files &#xA; # &#xA; # Rename files based on the given tag. For example `tg old file.txt` changes &#xA; # `file.txt` to `file-old.txt`. If the file already contains the suppied tag, &#xA; # it is removed. &#xA; &#xA; if [[ $# ! = 2 ]] ; then &#xA; printf 'usage: tg TAG FILE \n' &#xA; exit 1 &#xA; fi &#xA; &#xA; if [ -z ' ${ 2 ##*.* } ' ] ;…

edryd · RSS Amplifier