Skip to content

Instantly share code, notes, and snippets.

Hisayuki Mima youxkei

Block or report user

Report or block youxkei

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View scrapbox_to_opml.d
import std.stdio;
import std.array;
import std.algorithm;
import std.format;
import std.conv;
import std.range;
// gron scrapbox.json | rg 'lines\[' | rg --pcre2 -o '(?<= = ").*\S(?=";)' | sed -e 's/\\t/ /g' -e 's/&/\&amp;/g' -e 's/\\"/\&quot;/g' | ./scrapbox_to_opml
void main()
View 4digits.rb
(0..9).to_a.repeated_combination(4).each do |fourDigits|
ten = false
first = false
fourDigits.permutation.each do |a, b, c, d|
['+', '-', '*', '/'].repeated_permutation(3).each do |op1, op2, op3|
term = "((#{a}.0#{op1}#{b}.0)#{op2}#{c}.0)#{op3}#{d}.0"
if (eval(term) == 10.0 rescue false)
ten = true
break
end
View file_lock.cpp
#include <unistd.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <boost/interprocess/sync/file_lock.hpp>
#include <boost/interprocess/sync/scoped_lock.hpp>
View generator.js
const wait = function*(bullet, n) {
for(let i = 0; i < n; ++i) {
bullet = yield {
isChangeScript: false,
changedBullet: bullet,
newBullets: [],
};
}
return bullet;
View lonely.d
import std.stdio : writeln;
import std.range : iota;
import std.array : array;
import std.algorithm : fold, nextPermutation, all, sort;
import std.typecons : tuple, Tuple;
import std.parallelism : parallel;
enum MAX = 20;
bool isPrime(in int n){
View xlibtest.cpp
#include <unistd.h>
#include <X11/Xlib.h>
#include <X11/Xft/Xft.h>
#include <string>
#include <iostream>
int main() {
if (setlocale(LC_CTYPE, "") == 0) {
std::cerr << "Can't set locale" << std::endl;
View ndslicetest.d
import std.experimental.ndslice : sliced, blocks;
import std.range : iota;
import std.array : array;
import std.stdio : writeln;
enum MATRIX_WIDTH_PANELS = 2;
enum MATRIX_HEIGHT_PANELS = 2;
enum PANEL_WIDTH_DOTS = 3;
enum PANEL_HEIGHT_DOTS = 3;
enum BYTES_PER_DOT = 3;
View erutaso.d
import std.algorithm : map, each;
import std.conv : to;
import std.range : retro, zip, iota, cycle;
import std.array : array, join;
import std.functional : adjoin;
import std.stdio : writeln;
void main()
{
static immutable ERUTASO = ["えー", "びー", "しー", "でぃー", "いー", "えふ", "じー", "えいち", "あい", "じぇー", "けー", "える", "えむ", "えぬ", "おー", "ぴー", "きゅー", "あーる", "えす", "てぃー", "ゆー", "ぶい", "だぶりゅー", "えっくす", "わい", "ぜっと"];
View assert_that.d
import std.meta : AliasSeq;
mixin template assertThat(string lhs, alias matcher, string file = __FILE__, ulong line = __LINE__)
{
int UNUSED_VARIABLE = ()
{
import core.exception : AssertError;
import std.string : join;
string[] errors;
View pionpion.md

ロジバンで心ぴょんぴょんしたい

この記事はAizu Advent Calendar 2015の8日目の記事です。ロジバンでいかに心がぴょんぴょんすることを伝えるかについて考えていきます。

ロジバンとは?

ロジバンとは、人間同士のコミュニケーションのための人工言語です。

  • 自然言語ではなく述語論理を元に文法が作られている。
  • 構文に曖昧さが無い。
  • 話者の態度、感情を表す単語(心態詞)がある。
  • 音(音素)と文字が完全に対応している。
You can’t perform that action at this time.