git show <hash>:<file>
git log -p <filename>
| from mpl_toolkits.basemap import Basemap | |
| import matplotlib.pyplot as plt | |
| import csv | |
| #get list of temple name, location, dedication data, lat, and lon | |
| path = '/home/sm/Desktop/temple_data.csv' | |
| temples = [] #create a list to store the temple data from the spread sheet | |
| with open(path, 'rb') as csvfile: #open the csv file | |
| temple_data = csv.reader(csvfile, delimiter=',', quotechar='"') #load temple data | |
| for temple in temple_data: #iterate through data to change year to int |
| // Use Case: | |
| // | |
| // Say you have a bunch of decoupled components which access the same set of databases. | |
| // Since database/sql does connection pooling it makes sense for the components to share instances of *sql.DB | |
| // This package lets you do that with minimal code changes. | |
| package dbmanager | |
| import ( | |
| "database/sql" | |
| "time" |
| /** | |
| * K.jpg's OpenSimplex 2, smooth variant ("SuperSimplex") | |
| * | |
| * More language ports, as well as legacy 2014 OpenSimplex, can be found here: | |
| * https://github.com/KdotJPG/OpenSimplex2 | |
| */ | |
| public class OpenSimplex2S { | |
| private static final long PRIME_X = 0x5205402B9270C86FL; |
| /** | |
| * GOZORK Text Adventure Game | |
| * by apoc <http://apoc.cc> | |
| * | |
| * Inspired by the infamous beginning of Zork I. | |
| * Reading the source will obviously spoil the game. | |
| * The goal is to somehow kill the troll. | |
| * Oh yeah and: This is my first GO program! Which would be | |
| * my perfect excuse for the bad code quality1! | |
| * Here is a solution/transcript: |
| /* | |
| * HAVEGE: HArdware Volatile Entropy Gathering and Expansion | |
| * | |
| * Copyright (C) 2006-2007 Christophe Devine | |
| * | |
| * Redistribution and use in source and binary forms, with or without | |
| * modification, are permitted provided that the following conditions | |
| * are met: | |
| * | |
| * * Redistributions of source code must retain the above copyright |
| import time | |
| import random | |
| import struct | |
| import select | |
| import socket | |
| def chk(data): | |
| x = sum(x << 8 if i % 2 else x for i, x in enumerate(data)) & 0xFFFFFFFF | |
| x = (x >> 16) + (x & 0xFFFF) |
| #!/usr/bin/env python3 | |
| """ | |
| A pure Python "ping" implementation, based on a rewrite by Johannes Meyer, | |
| of a script originally by Matthew Dixon Cowles. Which in turn was derived | |
| from "ping.c", distributed in Linux's netkit. The version this was forked | |
| out of can be found here: https://gist.github.com/pklaus/856268 | |
| I've rewritten nearly everything for enhanced performance and readability, | |
| and removed unnecessary functions (assynchroneous PingQuery and related). |
| import math | |
| import random | |
| class Qubit: | |
| def __init__(self, a = 1, b = 0): | |
| '''Initialize a single qubit''' | |
| self.zero = complex(a) | |
| self.one = complex(b) | |
| def xgate(self): |