Skip to content

Instantly share code, notes, and snippets.



  • Tokyo, Japan
View GitHub Profile
U-MA / sample_merge.vfl
Last active Apr 18, 2020
VEX でカスタム COP 作成
View sample_merge.vfl
#pragma opname sample_merge
#pragma oplabel "SampleMerge"
#pragma opmaxinputs 4
#pragma inputlabel 1 "R"
#pragma inputlabel 2 "G"
#pragma inputlabel 3 "B"
#pragma inputlabel 4 "A"
#pragma label useChannelOfR "Use channel of R"
#pragma choice useChannelOfR "0" "R"
#pragma choice useChannelOfR "1" "G"
U-MA / va_list_sample.cpp
Last active Oct 8, 2015
View va_list_sample.cpp
#include <cstdio>
#include <cstdarg>
template<typename T>
T sumN(unsigned int n, ...)
va_list vl;
va_start(vl, n);
T sum = 0;
U-MA / count_if.vim
Created Sep 5, 2015
View count_if.vim
function! s:count_if(list, string) abort
let copy = deepcopy(a:list)
call filter(copy, a:string)
return len(copy)
View key_input_in_normal_command.vim
function! s:foo(second) abort
let l:start = reltime()
while str2float(reltimestr(reltime(l:start))) < float(a:second)
execute 'normal! r '
tabnew Sample
call setline(1, 'Please any keys for 2 seconds.')
U-MA / accum_sum
Created Jun 26, 2015
View accum_sum
/* 行列の対応する要素をaccumulateする
* このプログラムはいたるところにバグが潜んでいる、もしくは
* バグを起こしやすいので注意
#include <cstdio>
// 要素数がsize個の行列をmatrix_size個格納した配列matrixを
U-MA / now_loading.vim
Created May 17, 2015
文字列"Now loading..."がアニメーションする
View now_loading.vim
" Now loadingというアニメーションする文字列を表示する
" Version: 0.8
" Author: U-MA
" License: VIM LICENSE
" Command: :NowLoading
" Please press 'q' for stop to this program.
U-MA / 0_reuse_code.js
Last active Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
U-MA / hpc2014_answer.cpp
Created Nov 11, 2014
View hpc2014_answer.cpp
/// @file
/// @brief HPCAnswer.hpp の実装 (解答記述用ファイル)
/// @author ハル研究所プログラミングコンテスト実行委員会
/// @copyright Copyright (c) 2014 HAL Laboratory, Inc.
/// @attention このファイルの利用は、同梱のREADMEにある
/// 利用条件に従ってください
View gist:ff295e4114f979d8788d
#include <stdio.h>
#include <stdlib.h>
// read the array a of n elements from fp
void reada(FILE *fp, int *a, int *n);
// output the array a of n elements
void printa(int *a, int n);
// randomized quick sort
import java.awt.geom.Arc2D;
import java.awt.geom.Point2D;
import java.util.ArrayList;
import java.util.Random;
// 普通のセンサクラス
class SensorBase {
private Point2D.Double position;
private double battery;
You can’t perform that action at this time.