This file contains hidden or 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
void gotoxy(int x, int y){ | |
HANDLE hConsole = GetStdHandle( STD_OUTPUT_HANDLE ); | |
COORD coord={x, y}; | |
SetConsoleCursorPosition(hConsole, coord); | |
} | |
void setcolor(const char *fore, const char *back){ | |
WORD type=0; | |
while(*fore!='\0'){ | |
switch(*fore){ |
This file contains hidden or 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 |
This file contains hidden or 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
This is a very coarse chatroom written by php. I made it in a speech just for chatting with 2 friends. | |
WARNING: This one is very dangerous, which would be attacked by command injecttion, please BE CAREFUL using it. |
This file contains hidden or 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
" filetypes | |
filetype plugin on | |
filetype indent on | |
" ~/.vimrc ends here | |
set laststatus=2 | |
set statusline=%4*%<\ %1*[%F] | |
set statusline+=%4*\ %5*[%{&fileencoding}, " encoding | |
set statusline+=%{&fileformat}%{\"\".((exists(\"+bomb\")\ &&\ &bomb)?\",BOM\":\"\").\"\"}]%m | |
set statusline+=%4*%=\ %6*%y%4*\ %3*%l%4*,\ %3*%c%4*\ \<\ %2*%P%4*\ \> |
This file contains hidden or 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
all: p1 p2 | |
p1: p1.cpp | |
g++ -o p1 p1.cpp | |
p2: p2.cpp | |
g++ -o p2 p2.cpp | |
clean: | |
rm -f p1 p2 |
This file contains hidden or 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
encoding_utf8: encoding_utf8.c | |
gcc -o encoding_utf8 encoding_utf8.c | |
# I forget how to use variables....orz | |
#enc-$.c: encoding_utf8 $.c | |
# ./encoding_utf8 <$.c >enc-$.c | |
# | |
#$: enc-$.c | |
# gcc -o $ enc-$.c |
This file contains hidden or 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
http://www.ithome.com.tw/itadm/article.php?c=66229 |
This file contains hidden or 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 hidden or 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 hidden or 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 <iostream> | |
#include <bitset> | |
using namespace std; | |
int main () | |
{ | |
int x; | |
cout<<"Please input one number: "; | |
cin>>x; | |
cout << bitset<32>(x) << endl; |
OlderNewer