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
// g++ -std=c++0x random.cpp -o random | |
#include <iostream> | |
#include <random> | |
#include <functional> | |
class RandomGenerator { | |
private: | |
std::mt19937 e_; | |
std::uniform_real_distribution<long double> dist_; |
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
// g++ -std=c++11 `pkg-config gtkmm-2.4 --cflags --libs` -o gtkmm gtkmm.cpp | |
#include <gtkmm/drawingarea.h> | |
#include <gtkmm/main.h> | |
#include <gtkmm/window.h> | |
#include <cairomm/context.h> | |
class IchimatsuArea : public Gtk::DrawingArea | |
{ | |
public: |
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 <vector> | |
#include <algorithm> | |
using std::vector; | |
using std::cout; | |
using std::endl; | |
int main() { | |
vector<int> a = {5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5}; | |
auto min = min_element(a.begin(), a.end(), [](int a, int b) { | |
return ((a != 0) && (b == 0)) || a < b; |
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 <vector> | |
#include <algorithm> | |
using std::vector; | |
using std::cout; | |
using std::endl; | |
int main() { | |
vector<int> a = {0, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 0}; | |
auto min = min_element(a.begin(), a.end(), [](int a, int b) { | |
return (a == 0) ? false : (b == 0) || a < b; |
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
(reduce #'+ (mapcar #'rest | |
'((LAND-OF-LISP . 3990) | |
(PAIP . 9660) | |
(ANSI-COMMON-LISP . 3570) | |
(ON-LISP . 3800) | |
(LET-OVER-LAMBDA . 3200)))) |
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
(ql:quickload :cl-ppcre) | |
(defpackage :expand | |
(:use :cl :ppcre)) | |
(in-package :expand) | |
(defconstant +regex+ "\\$\\{(.*?)\\}") | |
(defun expand-string (string) |
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
(defun nn (n) | |
(let ((*print-base* n)) | |
(loop for i from 1 below n | |
do (loop for j from 1 below n | |
do (format t "~2A " (* i j))) | |
do (terpri)))) |
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 <stdio.h> | |
void A(void) { | |
int i; | |
for (i=0; i<100; ++i) { | |
printf("%d %g %g\n", i, (i / 10 + 1) * 0.1, (i % 10 + 1) * 0.1); | |
} | |
} | |
void B(void) { |
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
(setq initial-frame-alist | |
'((width . 100) | |
(height . 39) | |
(top . 0) | |
(left . 0) | |
(font . "VL Gothic-10"))) | |
(setq default-frame-alist initial-frame-alist) | |
(show-paren-mode 1) |
OlderNewer