This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
#-*- encoding: utf8 | |
# sudo easy_install PIL | |
import Image | |
import ImageFont | |
import ImageDraw | |
import sys | |
import os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <utility> | |
// | |
// Quick sort for single linked list | |
// | |
// Template arguments: | |
// T: node's pointer type | |
// Next: function/functor to get next node | |
// Compare: functor to compare 2 arguments | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function _ps1_git(){ | |
local ref cnt branch clean | |
ref=$(git symbolic-ref HEAD 2> /dev/null) | |
cnt=$(git branch 2> /dev/null|grep -c -E '*') | |
branch=$(echo "${ref#refs/heads/}") | |
if [[ "${branch}" == "" ]] | |
then | |
return | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <cstdlib> | |
#include <cmath> | |
#include <ctime> | |
#include <cstdlib> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> // printf | |
#include <cstdlib> // NULL | |
#include <algorithm> // fill | |
#include <vector> | |
#include <queue> | |
using namespace std; | |
//use constant instead of macro | |
const int MAXV = 1000; // maximum value of vertex |