Skip to content

Instantly share code, notes, and snippets.

View john-science's full-sized avatar

John Stilley john-science

View GitHub Profile
@john-science
john-science / python.dockerfile
Last active July 11, 2021 22:56
Installing Python v3.8 dev on Ubuntu 20.04 via Docker
FROM ubuntu:20.04
RUN apt-get update && \
apt-get install --no-install-recommends -y python3-pip python3.8-dev && \
apt-get install vim && \
apt-get install git
@john-science
john-science / where_to_buy_coins.md
Last active July 1, 2021 02:18
Trustworthy Coin Websites

Trustworthy Websites to Buy Coins

  • US Mint - Only modern US coins and proofs and such. But absolutely trustworthy.
  • VCoins - meta seller. Lots of old coins, lots of price ranges.
  • ma-shops - auction site, but "certified sellers"
  • Great Collections - Small, but all certified from trusted sellers
  • APMEX - good for silver Peace and Morgans
  • USA Coin Book - great for US coins
  • NumisBids - coin auction site. Lots of variety. Hard do search. Good for filling in a hole in a set (you can set an alert).
  • Heritage Auctions
@john-science
john-science / nuclear_engineering_reading.md
Last active June 1, 2021 11:01
A Reading List for Nuclear Engineering

A Nuclear Engineering Reading List

Good Places to Start

The MIT Nuclear Engineering Ciriculum

@john-science
john-science / gzip_files_in_python.md
Last active May 27, 2021 16:47
Reading & Writing GZIP Files Faster in Python

Reading & Writing GZIP Files in Python

I have been testing various ways to read and write text files with GZIP in Python. There were a lot of uninteresting results, but there were two I thought were worth sharing.

Writing GZIP files

If you have a big list of strings to write to a file, you might be tempted to do:

f = gzip.open(out_path, 'wb')

for line in lines:

@john-science
john-science / physics.md
Last active May 14, 2021 14:24
Step Right Up! Who wants to learn Physics?
@john-science
john-science / proj4_2_wkt.py
Last active May 11, 2021 06:26
Converting Proj4 String to Well-Known Text
from osgeo.osr import SpatialReference
"""
A quick script to get the Well-Known Text from a proj4 string.
"""
# build a spatial reference
sr = SpatialReference()
# enter the proj4 string
valid_code = sr.ImportFromProj4('+proj=lcc +lat_1=25 +lat_2=25 +lat_0=25.0 +lon_0=-95.0 +R=6371229.0')
@john-science
john-science / nuclear_systems_notes.md
Last active May 5, 2021 01:25
Notes on "Nuclear Systems" by Todreas and Kazimi

Notes on "Nuclear Systems"

These are just my notes on the textbook "Nuclear Systems" Volume 1, by Todreas and Kazimi. The textbook seems to be a classic on "Thermal Hydraulic Fundamentals" of nuclear power reactors.

Chapter 1: Principal Characteristic of Power Reactors

This chapter attempts to give a friendly, high-level comparison of the different kinds of nuclear power reactors out there. It gives some reference as to their similarities and differences, and general performance and safety characteristics.

Neutron Energy Range Energy Range Name
@john-science
john-science / OOCheatSheet.java
Last active January 14, 2021 09:36
Java: an Objected Oriented Cheat Sheet
/**
* The basic class syntax.
*/
public class BasicClass {
public BasicClass() {
// This is the constructor.
}
@john-science
john-science / latency.txt
Created January 13, 2021 16:11 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@john-science
john-science / vode_cython.md
Created January 13, 2021 12:18
Trying to Convert SciPy.integrate.ode.vode to Cython

Convert SciPy.integrate.ode.vode to Cython

This is a research task. The SciPy Vode ODE solver is 1600 lines of Fortran with 250 goto statements, so a direct translation is actually quite tedious. It would be much easier without the goto statements, or if the code was in C, C++, etcetera.

Links Roundup