Skip to content

Instantly share code, notes, and snippets.

View stormxuwz's full-sized avatar
🤣
Sleepy?

Wenzhao Xu stormxuwz

🤣
Sleepy?
View GitHub Profile
@stormxuwz
stormxuwz / Triaxus_Excel2CSV.bas
Created May 26, 2014 04:42
Parse Triaxus Excel File into CSV file with Excel VBA
Sub outputfile_whole()
Dim Infilename, outfilename As String
Dim name As String
Filename = ThisWorkbook.FullName
filename1 = ThisWorkbook.name
filename1 = Left(filename1, Len(filename1) - 5)
@stormxuwz
stormxuwz / Google API.m
Created May 26, 2014 04:24
Matlab Google Street View and Direction API
origin='Madison,Chicago,IL';
destination='N+Michigan+Ave,Chicago,IL';
url1=['https://maps.googleapis.com/maps/api/directions/json?origin=' origin '&destination=' destination '&sensor=false&key= XXXX&departure_time=1343641500&mode=driving'];
direction=urlread(url1);
d=parse_json(direction);
steps=d{1}.routes{1}.legs{1}.steps;
[startpoints,endpoints]=cellfun(@parsecoord,steps);
@stormxuwz
stormxuwz / Compare.py
Last active August 29, 2015 13:57
Check two files are the same
# http://stackoverflow.com/questions/19120489/compare-two-files-report-difference-in-python
import difflib
import sys
with open('transect_2_night_1.bin_PB_2013-09-13_151717.dat', 'r') as hosts0:
with open('transect_3_day_1.bin_PB_2013-09-13_150838.dat', 'r') as hosts1:
diff = difflib.unified_diff(
hosts0.readlines(),
hosts1.readlines(),
fromfile='hosts0',
\usepackage[subsection]{algorithm} % algorithm float, number according to subsection
\usepackage{algpseudocode} % pseudo-code format
\begin{algorithm}[htbp]
\caption{Parallel CUDA algorithm for connect component labelling \#1}
\label{alg:imageLabellingGPU1}
\algblockdefx[kernel]{Kernel}{EndKernel}[2][default value]{{\bf kernel} {\footnotesize \uppercase{#1}(#2)}}{\bf end kernel}
\begin{algorithmic}