Skip to content

Instantly share code, notes, and snippets.

View ktnyt's full-sized avatar
💫

ktnyt ktnyt

💫
View GitHub Profile
class HashArray(object):
def __init__(self):
self.items = []
def __getitem__(self, key):
if isinstance(key, slice):
items = self.items[key.start:key.stop:key.step]
_, values = zip(*items)
return list(values)
#include "mpi.h"
class Component {
public:
Component(Functor& f, int wanted, int tag = 0)
: f(f), wanted(wanted), request(MPI_REQUEST_NULL), tag(tag), size(0) {
MPI_Comm_rank(MPI_COMM_WORLD, &actual);
}
void collect() {
@ktnyt
ktnyt / ktnyt_fb.md
Created November 8, 2017 04:48
Future bass系まとめ

今ハマっているEDM/Future Bass系統まとめ

Kawaii Future Bassの仕掛け人、ハマるきっかけになったPixel Galaxyはノスタルジックな8-bit風シンセサウンドにFuture Bass的な構成を組み合わせていて新鮮だけどどこか懐かしい雰囲気が漂う不思議な作品。

アイドルマスターシリーズにも数多く楽曲を提供しているBNEI所属のクリエイター、特にお気に入りなのがさよならアンドロメダ全体的な展開はPopなFuture Bassながら二回目のDropでガチガチのChillstepになっていてDnBジャンキーだった私の好みに直球ど真ん中の曲。他にも言われるまではアイドルマスターの楽曲とは思えないほどに正統派なEDMに仕上がっているHotel MoonsideやChill系のFuture Bassに仕上がっている秘密のトワレ -Midnight Lab Remix-、ポップなチューンのRadio Happyなど。シンセサイザーの使い方がとにかくすごい。

幅広いジャンルの音楽をプロデュースしているADSR Sounds所属のサウンドエンジニア。Youtubeに制作課程を公開しているWhite LightがChill感が強く

@ktnyt
ktnyt / react-rest.md
Last active September 21, 2017 13:46
react-rest memorandum

前提

REST APIとは何か?

  • フロントエンドはビュー
    • f(モデル)→ビュー
    • 外部サービスとの連携
  • バックエンドは永続化
    • リソースの操作に関するロジック
    • アクセス・コントロール

永続化したデータへのアクセスをHTTP上で実現するための取り決めが一定の法則に従って実装されているのがREST API。

#include <memory>
struct Human { std::shared_ptr<Human> lover; };
struct Mika : public Human {};
struct Miria : public Human {};
int main() {
auto mika = std::make_shared<Mika>();
{
"description": "The settings in this file are persisted server-side. This file is generated automatically. Editing it is not recommended. Modify SettingsToPersist.json to specify which settings are persisted.",
"files": [
{
"name": "Game.cfg",
"sections": [
{
"name": "Chat",
"settings": [
{
@ktnyt
ktnyt / laplus.hpp
Last active November 10, 2016 15:15
Simple C++ CBLAS wrapper
/******************************************************************************
*
* laplus/laplus.hpp
*
* Copyright (C) 2016 Kotone Itaya
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
@ktnyt
ktnyt / cppgen.py
Last active January 30, 2023 09:02
C++ boilerplate code generator
#!/usr/bin/env python
################################################################################
#
# Copyright (c) 2016 Kotone Itaya
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@ktnyt
ktnyt / wts_setup.sh
Last active October 2, 2016 00:06
Setup the wts16 environment
#!/bin/sh
if [ ! -d $HOME/wts16 ]; then
mkdir $HOME/wts16
fi
touch $HOME/.login
echo "setenv LANG ja_JP.UTF-8" >> $HOME/.login
EMACS_CONF=$HOME/.emacs