Skip to content

Instantly share code, notes, and snippets.

View kunyuan's full-sized avatar

Kun Chen kunyuan

  • Flatiron Insititute
  • New York City
View GitHub Profile
import sys
import numpy
array = numpy.loadtxt("test.npy", converters={0: lambda s: eval(s)}).view(complex).reshape(-1)
print array
import os
import re
import subprocess
import ycm_core
def LoadSystemIncludes():
regex = re.compile(ur'(?:\#include \<...\> search starts here\:)(?P<list>.*?)(?:End of search list)', re.DOTALL);
process = subprocess.Popen(['clang', '-v', '-E', '-x', 'c++', '-'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE);
process_out, process_err = process.communicate('');
output = process_out + process_err;
@kunyuan
kunyuan / gist:32b1f5246205a61a20bc301f5668d613
Created July 7, 2017 22:35
Install Vim 8 with Python, Python 3, Ruby and Lua support on Ubuntu 16.04
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-gui-common
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev libncurses5-dev libatk1.0-dev libx11-dev libxpm-dev libxt-dev
#Optional: so vim can be uninstalled again via `dpkg -r vim`
sudo apt-get install checkinstall
sudo rm -rf /usr/local/share/vim /usr/bin/vim
cd ~
@kunyuan
kunyuan / Pseudopotential-Derived Band Structure of Silicon.ipynb
Created December 14, 2021 16:54 — forked from wmedlar/Pseudopotential-Derived Band Structure of Silicon.ipynb
The band structure of Silicon is calculated using the empirical pseudopotential method implemented in the Python programming language. A generalized routine is able to calculate the band structure of diamond and zincblende lattices. The energy splittings for Silicon at symmetry points appear to be very accurate with accepted values by diagonaliz…
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.