Skip to content

Instantly share code, notes, and snippets.

View xreiju's full-sized avatar

Reiju xreiju

View GitHub Profile
@xreiju
xreiju / montecarloPi.d
Created May 7, 2017 02:36
Calculate Pi with Monte Carlo Method in D
import std.stdio, std.random, std.math;
const POINT_AMOUNT = 1000;
struct Point {
real x, y;
bool isInCircle() {
real num = pow(x, 2) + pow(y, 2);
return num <= 1;
}
import std.stdio : writeln;
import std.json : parseJSON, JSONValue;
import std.net.curl : get;
import std.parallelism : parallel;
import core.atomic : atomicOp;
import std.array : uninitializedArray;
void main()
{
immutable string KNH_URL = "http://api.knh.uno:8080/v1/challenge.json";
@xreiju
xreiju / Contents.swift
Last active July 13, 2020 11:59
オタクの過激発言の再現を可能にするコードです。
//: Playground - noun: a place where people can play
let クチャクチャ = 0
let 早口 = 0
let アディダスの財布 = 0
let ドヤ顔 = 0
let ギトギトの髪 = 0
let 運動靴 = 0
let 細い目 = 0
let 汚いメガネ = 0
@xreiju
xreiju / knh.d
Created February 25, 2017 11:53
import std.stdio, std.format;
class KNH {
private bool _burn = false;
void burn() {
this._burn = true;
}
}
@xreiju
xreiju / Misskey.md
Last active December 24, 2016 02:10
The document of Misskey.xyz.

Postの扱い方

Swiftではこのようにプロパティを用意してあげる

var created_at: Date = Date.distantPast
var media_ids: [String]?
var reply_to_id: String?
var repost_id: String?
var text: String?
#!/usr/bin/rdmd
import std.regex;
import std.net.curl;
import std.stdio;
int main() {
char[] content;
try {