Skip to content

Instantly share code, notes, and snippets.

View zhantongz's full-sized avatar

Zhan Tong Zhang zhantongz

View GitHub Profile
@zhantongz
zhantongz / g16.py
Created March 12, 2018 04:45
Basic Gaussian 16 log file parser (no job flags etc.; basic HF/DFT/TDDFT jobs only)
import re
import sys
import argparse
from datetime import datetime
import numpy as np
def isfloat(value):
try:
float(value)
@zhantongz
zhantongz / tully.js
Last active January 10, 2018 05:39
CH-452 Project
"use strict";
/* simulation parameters */
const NMESH = 512; // mesh points
const DT = 0.1; // time step
const NSTEP = 50000; // number of steps
const NECAL = 1;
const NNCAL = 1000;
/* system parameters */
const M = 2000; // mass
@zhantongz
zhantongz / ar.top
Created February 24, 2017 06:40
Argon topology???
[ defaults ]
; nbfunc comb-rule gen-pairs fudgeLJ fudgeQQ
1 1 no 1.0 1.0
[ atomtypes ]
Ar 39.948 0.0 A 0.00622127 9.69576e-06
[ moleculetype ]
; molname nrexcl
Arg 2
@zhantongz
zhantongz / index.js
Created February 24, 2017 01:47
A very very very simple velocity-Verlet algorithm for a particle under harmonic potential
var k, m, pos0, vel0, PREC;
PREC = 1e-5; // tolerance for float num
k = 1.0; // potential(x) = k * x^2 / 2
m = 1.0; // mass
pos0 = 1.0; // init condition pos(0)
vel0 = 1.0; // init condition vel(0)
var equalZero = function(n) {
@zhantongz
zhantongz / Alberta
Created July 10, 2016 08:21
GEV Counting
stvCount v16.05.1 (c) Z. Tong Zhang
Fifth General Election
********** COUNTING STARTS **********
----- dm-1 dm-2 withdrawn -----
########## ROUND 1 ##########
+++++ round count +++++
┌───────────────────┬────┐
│ Unownuzer717 │ 4 │
├───────────────────┼────┤
│ Cameron-Galisky │ 10 │
@zhantongz
zhantongz / keybase.md
Created June 22, 2016 04:38
keybase.md

Keybase proof

I hereby claim:

  • I am zhantongz on github.
  • I am zhantongz (https://keybase.io/zhantongz) on keybase.
  • I have a public key whose fingerprint is 65D2 7ED1 1FA1 FFB7 5ADF 6AEA C463 D59B AA68 1AEF

To claim this, I am signing this object:

### Keybase proof
I hereby claim:
* I am zhantongz on github.
* I am zhantongz (https://keybase.io/zhantongz) on keybase.
* I have a public key whose fingerprint is 16D4 A531 1579 0F31 FB02 FE54 F029 1B24 7CFA E1B8
To claim this, I am signing this object:
@zhantongz
zhantongz / Building.java
Created June 9, 2014 22:37
Computer Science 30 Final Project
public class Building {
String name;
int cost;
int monthlyCost;
int price;
double attraction;
int area;
}
@zhantongz
zhantongz / youtubeCN.js
Last active August 29, 2015 13:56
Simple YouTube embedment with alternate source for Jekyll
// put it in source/javascripts/ directory
var icon = "http://s.ytimg.com/yts/img/favicon-vfldLzJxy.ico";
var locationWall = (! $('<img src="'+ icon +'">').load()); // false if out of Mainland; true otherwise
var plid="td"; // remove tudou if outside of Mainland
if(locationWall)
{
plid="yt" // remove youtube if inside of Mainland
}
var player=document.getElementById(plid);
player.parentNode.removeChild(player);
@zhantongz
zhantongz / ifInWall.js
Last active August 29, 2015 13:56
A simple JS to determine if a user is restricted by GFW with jQuery
var icon = "http://s.ytimg.com/yts/img/favicon-vfldLzJxy.ico";
var locationWall = (! $('<img src="'+ icon +'">').load()); // false if out of Mainland; true otherwise
if(locationWall)
{
console.log("You are restricted by the Wall.")
}