Skip to content

Instantly share code, notes, and snippets.

@yipo
yipo / Make.bat
Last active December 13, 2015 22:19
Why `javac' can't work in the Makefile? Solution: you don't have to double-quote paths in the variable PATH, even they have spaces.
@ECHO OFF
CD /D %~dp0
ECHO [Before]
javac -version
PATH %PATH%;C:\MinGW\bin;C:\Program Files (x86)\Java\jdk1.7.0_13\bin
ECHO [After]
javac -version
@yipo
yipo / ShellMake.reg
Created February 25, 2013 18:19
To execute the command `make` or `make clean` via the context menu of the Windows shell. (Note: You must have `make' command in your environment at first.)
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Background\shell\make]
@="make"
"Icon"="shell32.dll,2"
[HKEY_CLASSES_ROOT\Directory\Background\shell\make\command]
@="cmd.exe /c make"
[HKEY_CLASSES_ROOT\Directory\Background\shell\make_clean]
@yipo
yipo / .htaccess
Last active December 17, 2015 00:19
Redirect from HTTP to HTTPS.
# Reference: Apache Module mod_ssl
# http://httpd.apache.org/docs/current/mod/mod_ssl.html
<IfModule ssl_module>
# Reference: Apache Module mod_rewrite
# http://httpd.apache.org/docs/current/mod/mod_rewrite.html
<IfModule rewrite_module>
@yipo
yipo / Makefile
Created January 20, 2014 20:12
CB-VCS Adapter: version control with Git --> version control by appending date to filenames.
# Chang-Biau Version Control System Adapter v1.0
# Author: Yi-Pu Guo (YiPo)
# License: MIT
FILE = thesis/thesis_guoyp.tex
# fill your own filename above.
fp = $(basename $(FILE))
fs = $(suffix $(FILE))
@yipo
yipo / README.md
Last active March 25, 2019 15:29
A vanilla flavored MacType profile.
  • Anti-aliasing: gray scale
  • LCD Mode: No optimization

All the others are kept as default.


The following issues are fixed:

@yipo
yipo / 10099.cpp
Last active August 29, 2015 14:00
The Tourist Guide
#include <vector>
#include <queue>
#include <iostream>
using namespace std;
typedef int vertex;
typedef vector< pair<vertex,int> > edge_list;
const int MAX=1<<30;
@yipo
yipo / 11039.cpp
Last active August 29, 2015 14:01
Building designing
#include <vector>
#include <algorithm> // for sort()
#include <cstdlib> // for abs()
#include <iostream>
using namespace std;
inline int back_or_0(const vector<int> &v) {
return (v.size()>0)? v.back(): 0;
}
inline int pop_out(vector<int> &v) {
@yipo
yipo / 1101.cpp
Last active August 29, 2015 14:02
To Add or to Multiply
#include <vector>
#include <string>
#include <sstream>
#include <iostream>
using namespace std;
typedef long long lint;
const int INF=1<<30;
inline int pow(int base,int exp) {
@yipo
yipo / .gitignore
Last active August 29, 2015 14:07
webpage-slide
/pages.json
#include <iostream>
using namespace std;
int main() {
int n,x,sum=0;
cin>>n;
while (n--) {
cin>>x;
sum+=x;
}