November 20, 2008, Thursday, 324

Tip

From IdeA thinKING

Jump to: navigation, search

Contents

C++ template for temporary compilation

#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <iterator>
#include <sstream>
#include <deque>
 
using namespace std;
 
#define SIZE(X) sizeof(X) / sizeof(*(X))
#define ALL(X) X.begin(), X.end()
 
#define FOR(C, It) \
      for(typeof(C.begin()) It = C.begin(); It != C.end(); It++) 
 
typedef vector<int> VI;
typedef vector<vector<int> > VVI;
typedef vector<string> VS;
typedef vector<vector<string> > VVS;
typedef signed long long i64;
typedef unsigned long long u64; 
typedef pair<int, int> PII;
 
template <class T>
ostream& operator << (ostream& os, vector<T> const& v)
{
  if (v.empty()) return os;
  copy(v.begin(), v.end() - 1, ostream_iterator<T>(os, " "));
  os << *(v.end() - 1);
  return os;
}
 
template <class T>
void printall(ostream& os, T* v, int N)
{
  copy(&v[0], &v[N - 1], ostream_iterator<T>(os, " "));
  os << v[N - 1] << endl;
}
 
VI parseint(string const& s)
{
  istringstream iss(s);
  VI ret;
  copy(istream_iterator<int>(iss), istream_iterator<int>(), back_inserter(ret));
  return ret;  
}
 
 
int main()
{
 
}

Apache

  1. mods-available 에서 필요한 .conf와 .load를 mods-enabled로 cp
  2. sudo /etc/init.d/apache2 restart

CVS

To delete a branch

cvs -Bd branch-name

To start a project from existing files

export CVS_RSH=ssh
export CVSROOT=:ext:developername@mgsim.cvs.sourceforge.net:/cvsroot/mgsim
 
cvs import -m "Imported sources" mgsim ideathinking start

To check out files

cvs -z3 -d:ext:iwongu@mgsim.cvs.sourceforge.net:/cvsroot/mgsim co -P mgsim

.cvsignore

각 디렉토리에서 cvs로 관리하지 않을 파일 리스트를 가진 파일로 이 파일은 cvs에 checkin한다.

Windows

  1. 탐색기에서 내장 ZIP 폴더 기능 끄는 법
  2. Google Talk 사용법
    • 바로가기 만들고 command line option에 /nogaiaauth 추가

Ubuntu

  1. Enabling/Adding Extra Repositories
  2. Installing flash-plugin
    • sudo apt-get install -y flashplugin-nonfree
  3. Installing Microsoft True Type Fonts
    • sudo apt-get install -y msttcorefonts
  4. Installing unrar
    • sudo apt-get -y install unrar
  5. Installing Adobe Reader
  6. Updating the system
  7. Installing beagle
    • sudo apt-get install -y beagle
  8. Installing gdesklets
    • sudo apt-get install -y gdesklets
  9. (BONUS!) Frozen Bubble
    • apt-get install frozen-bubble
  10. After you install Ubuntu 6.06 in a VMWare session, do the following:
    1. Get a root shell: sudo bash
    2. Update your list package list: apt-get update
    3. Upgrade your components: apt-get upgrade
      • Note: Repeat the previous step as many times as you need to get all the available updates installed.
    4. If necessary, do a dist-upgrade: apt-get dist-upgrade
    5. Once you have have done all the core updates you can, edit the /etc/apt/sources.list file and uncomment all the application repositories you want to include in your updates. I usually uncomment them all, but that is your call.
    6. Repeat steps 2 and 3 until all patches have been applied. Once this is done, you are ready to install the packages VMWare will need.
    7. Install build tools: apt-get install build-essential
    8. Get version of your kernel: uname -r. You will use the output from this step in the next step.
    9. Install the linux headers for your kernel. Issue: apt-get install linux-headers-{output of prev step here}. This will install the linux headers VMWare needs to compile their tools.
  1. Archive mirror 바꾸기
    • /etc/apt/sources.list 에서 us.을 kr.으로.
  2. 마우스 휠이 안될때
    • /etc/X11/xorg.conf에서 Mouse 부분 수정