Skip to content

Instantly share code, notes, and snippets.

View lgylym's full-sized avatar
🎯
Focusing

lgylym lgylym

🎯
Focusing
View GitHub Profile
@lgylym
lgylym / gist:a2bb6a9af46b85cb4d6d
Created June 16, 2014 12:11
from webgraph datasets create simple graph files (csv)
import it.unimi.dsi.webgraph.*;
import java.io.File;
import java.io.FileWriter;
/**
* Created by yluo on 6/13/2014.
* webgraph: http://webgraph.di.unimi.it/
*
* output format: node [children]
@lgylym
lgylym / gist:88f734b9e88c52b6e0ef
Last active August 29, 2015 14:02
delete folder and files created by apache, without the admin privilege.
<html>
<!-- http://stackoverflow.com/questions/3338123/how-do-i-recursively-delete-a-directory-and-its-entire-contents-filessub-dirs -->
<head>
<title>PHP Test</title>
</head>
<body>
<?php echo '<p>Hello World</p>'; ?>
<?php
function rrmdir($dir) {
@lgylym
lgylym / gist:e37dede42f3421075030
Created June 18, 2014 12:00
placeholder for some picture
\begin{pgfpicture}
\pgftext{\pgfimage[width=4cm,height=3.5cm]{scratch.png}}
\end{pgfpicture}
rsync -avz --remove-source-files /sourcedir user@host:/targetdir
@lgylym
lgylym / gist:a492cc1092d64fa4a200
Created June 30, 2014 08:34
add a space between for and each in algorithm2e
\SetKwFor{ForEach}{for each}{do}{endfch}
@lgylym
lgylym / algorithm2e_template
Last active August 29, 2015 14:03
algorithm2e template for my thesis
\begin{algorithm2e}
\SetKwFor{ForEach}{for each}{do}{endfch}%separate foreach with a space
\SetArgSty{textrm} %do not automatically use italic in arguments
\DontPrintSemicolon % Some LaTeX compilers require you to use \dontprintsemicolon instead
%\NoCaptionOfAlgo %using this to not print the bold Algorithm in caption, usful in inline algo explainations
\KwIn{input}
\KwOut{output}
\Return{return value}
\caption{caption}
\label{algo:label}
@lgylym
lgylym / gist:7b964c451f9d39abe678
Last active August 29, 2015 14:04
find certain files on a remote machine
ssh ngrid01 "find /scratch/yluo/ -name 'power*log'"
@lgylym
lgylym / gist:ba5c43385067434ba74b
Created July 16, 2014 15:22
customize table vertical space
\def\arraystretch{1.5}
\begin{tabular}{lll}
\toprule
\midrule
\bottomrule
\end{tabular}
@lgylym
lgylym / gbk2utf8
Last active August 29, 2015 14:05
from gbk to utf8 txt file
//convert file name
convmv -f gbk -t utf8 -r .
//convert file content
iconv -f gbk -t utf8 file.txt -o output.txt
@lgylym
lgylym / algorithm2e_mapreduce
Last active August 29, 2015 14:06
mapreduce template for algorithm2e
\begin{algorithm2e}[htbp]
\SetKwFor{ForEach}{for each}{do}{endfch}%separate foreach with a space
\SetArgSty{textrm} %do not automatically use italic in arguments
\SetKwFunction{Map}{Map}
\SetKwFunction{Reduce}{Reduce}
\SetKwProg{myproc}{Procedure}{}{}
\DontPrintSemicolon % Some LaTeX compilers require you to use \dontprintsemicolon instead
\KwIn{}
\KwOut{}
\myproc{\Map{[(key, value)]}}{