文化式成人女子原型 | nbbbp.eps | New Bunka Basic Bodice Pattern | Bunka Sloper | 日本新文化式女装原型 | Pola Dasar Badan Wanita Bunka Baru
文化式成人女子原型をPostScript言語で描きます
Drafting New Bunka Basic Bodice Pattern in PostScript language
// csvcxx.cpp | |
//// | |
#include <iostream> | |
#include <sstream> | |
#include <string> | |
#include <vector> | |
int main(int argc, char **argv) | |
{ | |
for (int i=1;i<argc;++i) { |
C++11の乱数生成器 (random number generator; RNG) である<random>はとてもよくできている。 single threadで動くプログラムなら自作の珍妙なラッパを介さず直接使うべき。 thread safeなのでOpenMPからも使うことができる。 高速にかつ2カ所以上でRNGを使うことを前提にして、 ここgistに自作の珍妙なラッパを公開してみる。
thread数ぶん作った乱数生成エンジンを2カ所 (main.cpp と timing.h) で使う。
(* perceptron : float -> float -> float -> float -> float -> float *) | |
(* description: perceptron with two inputs x1 and x2*) | |
let perceptron b w1 w2 x1 x2 = if b +. w1 *. x1 +. w2 *. x2 >= 0.0 then 1.0 else 0.0 | |
let and_gate = perceptron ~-.0.7 0.5 0.5 | |
let nand_gate = perceptron 0.7 ~-.0.5 ~-.0.5 | |
let or_gate = perceptron ~-.0.5 1.0 1.0 | |
let nor_gate = perceptron 0.5 ~-.1.0 ~-.1.0 | |
let xor_gate x1 x2 = and_gate (nand_gate x1 x2) (or_gate x1 x2) | |
(* tests *) |
MacPortsのmath/fftw-3のconfigureオプションに--enable-openmpを加えたいが、 /usr/bin/clangが-fopenmpを受け付けてくれないので今のところうまくいかない。
$ sudo emacs /opt/local/etc/macports/sources.conf # add a line of "file:///Users/t-nissie/ports"
$ mkdir -p ~/ports/math/fftw-3/files
Git と A successful Git branching model の練習のためSourceForgueのSubversionレポジトリにあるxtalgrowthを GitHubへ移動させる。ssh-keyは双方について適宜設定されているものとする。
もっと冴えたやりかた等、ご意見募集中。
// graphtest.cpp tests the Boost Graph Library (BGL) | |
// Reference: http://faithandbrave.hateblo.jp/entry/20100413/1271129607 | |
//// | |
#include <iostream> | |
#include <vector> | |
#include <string> | |
#include <boost/graph/graph_traits.hpp> | |
#include <boost/graph/adjacency_list.hpp> | |
#include <boost/graph/dijkstra_shortest_paths.hpp> | |
#include <boost/graph/graph_utility.hpp> |
/* saturated_inc(x) http://qiita.com/shyouhei/items/e960e641882da80c8932 */ | |
#if __GNUC__ >= 7 | |
# define saturated_inc(x) __builtin_add_overflow_p(x, 1, x) ? x : ++x | |
#else | |
# define saturated_inc(x) ({__typeof__(x) y; __builtin_add_overflow(x, 1, &y) ? x : ++x; }) | |
#endif | |
signed long long | |
func(signed long long x) | |
{ | |
return saturated_inc(x); |
// large_array.c | |
// Gist: https://gist.github.com/t-nissie/38df694682cbdb08023567731f432fbf | |
// Description: pass a size_t as MPI_UINT64_T, allocate a large array of double, then first-touch it | |
// Author: Takeshi Nishimatsu | |
// License: GPLv3 | |
// Reference: https://github.com/jeffhammond/BigMPI/blob/master/test/test_reduce_x.c | |
//// | |
#include <mpi.h> | |
#include <stdio.h> | |
#include <stdlib.h> |
SnO2 is a crystal which have rutile structure.
Original files are in https://gist.github.com/t-nissie/662ce194be356b5456c563195a052427/ .
git clone https://gist.github.com/662ce194be356b5456c563195a052427.git SnO2-LDA-vc-relax-03-gist
cd SnO2-LDA-vc-relax-03-gist
.O.pw-mt_fhi.UPF
and Sn.pw-mt_fhi.UPF
form http://www.quantum-espresso.org/pseudopotentials/ .