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
# install needed libraries | |
sudo yum install texinfo libXpm-devel giflib-devel libtiff-devel libotf-devel automake ncurses-devel | |
# compile autoconf | |
cd /tmp | |
wget ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.68.tar.bz2 | |
tar xjvf autoconf-2.68.tar.bz2 | |
cd autoconf-2.68/ | |
./configure && make && sudo make install |
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 <iostream> | |
#include <iomanip> | |
#include <sstream> | |
int main() | |
{ | |
std::string number = "111111111.2"; | |
std::cout << std::setprecision(20) << atof(number.c_str()) << std::endl; // double: 111111111.20000000298 | |
std::stringstream ss; | |
ss << number; |
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 | |
#ifndef NDEBUG | |
#include <iostream> | |
#include <iomanip> | |
#include <vector> | |
template <typename T> | |
void print(T arg, std::string delim = " ") { |
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
(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. | |
) | |
(custom-set-faces | |
;; custom-set-faces 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. |
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 <iostream> | |
using namespace std; | |
class A | |
{ | |
protected: | |
public: | |
int count; | |
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 <iostream> | |
using namespace std; | |
class A | |
{ | |
protected: | |
public: | |
int count; | |
A() : count(1) { }; |
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 <iostream> | |
#include <stdlib.h> | |
#include "scans.h" | |
#include "Timer.h" | |
using namespace std; | |
const long long size = 1024*1024*128; // 1GB | |
int main() |
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
inline uint64_t rdtsc() { | |
uint32_t lo, hi; | |
__asm__ __volatile__ ( | |
"xorl %%eax, %%eax\n" | |
"cpuid\n" | |
"rdtsc\n" | |
: "=a" (lo), "=d" (hi) | |
: | |
: "%ebx", "%ecx"); | |
return (uint64_t)hi << 32 | lo; |
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
#!/bin/bash | |
set +H | |
path=`find src/ -type f` | |
ssed -i "s/using namespace std;//" $path; | |
ssed -i "s/using std::.*//" $path; | |
# std-ize templates | |
for symbol in stack map list vector queue set pair priority_queue make_shared dynamic_pointer_cast numeric_limits back_insert_iterator |
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
module ListPoint = struct | |
type point = int list | |
let make x y = [x; y] | |
let getX p = List.nth p 0 | |
let getY p = List.nth p 1 | |
let origin = [0; 0] | |
let print p = print_int (getX p); print_string " "; print_int (getY p); print_endline "" | |
end;; | |
module Square = struct |
OlderNewer