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
zstyle ':completion:*' matcher-list '' 'm:{a-z}={A-Z}' '+m:{A-Z}={a-z}' |
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
// --------------------------------------- | |
template <class T> | |
void Swap( std::vector<T>::iterator it1, std::vector<T>::iterator it2) { | |
T temp = *it1; | |
*it1 = *it2; | |
*it2 = temp; | |
} | |
// ----------------------------------------- | |
template <class T> |
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
require "pp" | |
unless ARGV.size == 1 | |
$stderr.puts <<EOS | |
# ---------------------------------- | |
# usage : ruby solve.rb input.dat | |
# ---------------------------------- | |
EOS | |
raise "Invalid argument" | |
end |
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
// The practice of programming | |
// chapter 3 : problem 3-1 | |
// | |
// for testing mersenne twister and linear congruential random number generators | |
// prints normalized frequencies that i'th item is selected. | |
// statistical errors are printed as well. | |
#include <iostream> | |
#include <boost/random.hpp> | |
const size_t MAX = 1024; // number of elements to be selected |
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
# auto change directory | |
# | |
setopt auto_cd | |
# auto directory pushd that you can get dirs list by cd -[tab] | |
# | |
setopt auto_pushd | |
# command correct edition before each completion attempt | |
# |
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
(custom-set-variables | |
;; custom-set-variables was added by Custom. | |
;; If you edit it by hand, you could mess it up, so be careful. | |
;; Your init file should contain only one such instance. | |
;; If there is more than one, they won't work right. | |
'(global-font-lock-mode t nil (font-core)) | |
'(show-paren-mode t) | |
'(standard-indent 2) | |
'(transient-mark-mode t)) | |
(custom-set-faces |
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 <time.h> | |
int main() { | |
clock_t start, end; | |
start = clock(); | |
long sum = 0; |
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 <ctime> | |
#include <cmath> | |
// ---------------------------------------------- | |
size_t CountUpInteger( size_t nMax) { | |
size_t nSum = 0; | |
for( size_t i=0; i<nMax; i++) { | |
nSum += i; |
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
#!/usr/bin/env ruby | |
require 'fileutils' | |
require 'optparse' | |
if ARGV.size == 0 | |
raise "Usage epsplot plot1.plt (Specify gnuplot files)" | |
end | |
def thicken_lines( filename, bl=5, pl=3,point_size=51.5) |
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
require 'rspec' | |
# ------- OK case ---------- | |
describe "env X=1" do | |
before(:all) do | |
ENV['X'] = '1' | |
end | |
after(:all) do |
OlderNewer