Author: akhilketkar

100 Books for 2020

  1. Berkshire Hathaway letters to shareholders 1965 – 2018
  2. Buffet Partnership Letters 1957 – 1970
  3. Marissa Mayer and the Fight to Save Yahoo
  4. Thinking in Systems
  5. Bottle of Lies
  6. Dear Chairman
  7. Who says Elephants Can’t Dance
  8. The Misbehavior of Markets
  9. Quality Investing
  10. What I talk about when I talk about Running
  11. Loonshots
  12. The Investment Checklist
  13. Uninhabitable Earth – didn’t finish

Notes 5/2/2016

def setUp(self):
self.server_log_file = open('.tsdb_server.log.test','w')
self.server_proc = subprocess.Popen(['python', 'go_server.py']
,stdout=self.server_log_file,stderr=subprocess.STDOUT)
time.sleep(1)

def tearDown(self):
self.server_proc.terminate()
self.server_log_file.close()
time.sleep(1)
  • Check if any python jobs are running in the background (of course this doesn’t have to be python)
jobs
ps aux | grep 'python'
#!/bin/bash

if [ $1 == "-h" ]; then
echo "Syntax::sh scriptname output-file classifer-name num-epochs"
exit
fi

# check outputfile
if [ -z $1 ]; then
echo "Output file not specified. Using 'output.all' "
OUTFILE="output.all"
else
OUTFILE=$1
if [ -e $OUTFILE ]; then
echo "Emptying " $OUTFILE
rm $OUTFILE
fi
echo "Output File = " $OUTFILE
fi
  • Get a specific file from a different branch on git
git checkout branch2 file.py
  • Get a specific file from a different branch on git and check changes line by line
git checkout --patch branch2 file.py

1/5/2016 Puzzle

  • agar – Food thickener

  • roust – means exactly the same thing as rouse

  • sabot – Dutch shoe

  • eiger – dangerous Alpine peak

  • inez – Don Juan’s Mother

  • etui – small ornamental case for holding needles, thread etc

  • orange pekoe – grade of black teas

  • cosi fan tutte – Mozart Opera (translates to “Woman are like that”)

Memorable Words

  • orrery – model of the solar system, used to be made out of wood
  • cur – rabid dog
  • sca – genre of music that reggae came out of
  • statal – of or relating to a state (usually a nation state)
  • egad – expressing surprise (like oh god)
  • roos – slang for kangaroos
  • gnu – deer like animal found in Africa
  • tse-tse – bees that spread disease
  • petit four – small french pastries

awk and sed

awk

Found this helpful for going though log files since they are naturally separated into fields. Good general tutorial here.

Useful predefined variables. Good write up here

  1. FILENAME – name of the file you’re in
  2. NR – line number that you’re on (global)
  3. FNR -line number that you’re on relative to current file
  4. NF – number of “fields” or words separated by the given delimiter on the line.
  5. FS – field seperator (space is the default)
  6. OFS – ouput field seperator (space is the default)

Useful Code Snippets

select lines where the third column is equal to 2 and compute the mean sum of squares of the eighth, ninth and tenth columms
awk 'BEGIN {r=0; num=0} {if ($3==2) {r += $8^2 + $9^2 + $10^2; num++}} END {print r/num}' filename

select lines with a 0 and atleast 20 columns and print the first and last column
awk '/0/ {if (NF > 20) print $1,$NF}' log.spparks.4 > hyd_diff_temp_2

select lines from a file where the second column is larger than 20 and print the filename with some additional columns
awk ' {if($2 > 20) print FILENAME,$1*10,$2}' size_time_*_1

sed

Generally used to replace texts but can be used more powerfully. Useful tutorial here.
replace “size_time” with blank
sed 's/size_time_//'

replace “size_time_someNumber_1” with “someNumber”
sed 's/size_time_\([0-9]*\)_1/\1/'

Podcast Updates (Nov 2015)

Since Grantland got shut down

The B.S Report is now the B. S. Podcast

Hollywood Prospectus is now The Watch

NBA After Dark is now Sources Say

Slate

Culture Gabfest – Started listening to it during the two weeks in which we had no HP pods. Slightly higher brow with a slightly douchy who will occasionally rant about “fruit forward” wine.

Political Gabfest – American Politics was definitely a hole in my podcast world and this fills it nicely.

Other

Common Sense – Dan Carlin’s show on current events.

The Allusionist – Like a much shorter hardcore history about words. I like the short etymology section at the top of the show more than the actual show. Why is a warewolf called a warewolf and not a manwolf?

 

Podcasts

You’ll almost never see me walking around without headphones. This is a list of things I listen to in decreasing order of goodness.

Must Listen
  • This American Life – easily the best on a week to week basis. This, this and this are examples of how amazing it can be. I might have a slight crush on Ira.
  • Radiolab – a not-so-close second. Purportedly more “science driven” but actually just a TAL 2.
Highly Recommended
Unless you have a 100 hour week
If you have a 50 hour week
  • Rationally Speaking – My interest in skepticism is waning but this is still worth a listen. Although now that Massimo is leaving…
  • Wait Wait Don’t Tell Me – NPR’s News Quiz. Should really be higher on the list but I just don’t get to it often enough
Dormant
  • Start Up – Alex Blumberg’s fantastic podcast about his startup that creates podcasts. Listen and understand
  • Serial – Unless you’ve been living under a rock this one needs no introduction. If you didn’t give them money for season 2, you’re an asshole
  • Hardcore History – Incredible Journey’s through major historical events. Wrath of the Khans is my favorite.
Running / Triathlon

I used to listen to these religiously when I was training for various events but now that I’ve decided to be a fatty, listening to them just makes me sad.

  • Zen and the art of Triathlon – Long. Which make them perfect for those 20 milers.
  • Ginger Runner Live – Cool dude. Fun podcast. Not much in terms of actionable advice.
  • Endurance Planet – The host Tawnee can get a bit annoying sometimes. Ben Greenfield sounds like a crazy person (the last Rich Roll podcast I heard was one in which Ben and Rich are agreeing on how we shouldn’t vaccinate our children. Ben gave his child some oil which apparently does the trick). But Lucho is great. The advise is helpful.
Disrecommends
  • Rich Roll Podcast – This went from being one of my go to fitness podcasts to completely off my iPhone in a month. Rich (and mainly his wife) espouses a “positive”, “earth loving”, “spirit freeing”, barf educing, anti-GMO, anti-vaccination, non-evidence based view of the world that should not be anywhere near your earballs. Btw, there are excellent evidence based and ethically sound reasons to be a vegetarian.
  • Invisibilia – Overrated. The “batman” episode was alright I guess.