This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* this code is refered from Figure 1 of CUDA COMPILER DRIVER NVCC | |
* Reference Guide (TRM-06721-001_V5.5). | |
* | |
* CUDA COMPILER DRIVER NVCC Reference Guide | |
* http://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html | |
*/ | |
const int ACOS_TESTS = 5; | |
const int ACOS_THREAD_CNT = 128; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ArrayList<Sensor> nearest_neighbor(ArrayList<Sensor> field, User u) | |
{ | |
double a = 28.29; | |
// 構築された経路 | |
ArrayList<Sensor> route = new ArrayList<Sensor>(); | |
// 次のノードの候補 | |
ArrayList<Sensor> R = new ArrayList<Sensor>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//------------------------------------------------------------------------------ | |
/// @file | |
/// @brief HPCAnswer.hpp の実装 (解答記述用ファイル) | |
/// @author ハル研究所プログラミングコンテスト実行委員会 | |
/// | |
/// @copyright Copyright (c) 2014 HAL Laboratory, Inc. | |
/// @attention このファイルの利用は、同梱のREADMEにある | |
/// 利用条件に従ってください | |
//------------------------------------------------------------------------------ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Now loadingというアニメーションする文字列を表示する | |
" Version: 0.8 | |
" Author: U-MA | |
" License: VIM LICENSE | |
" USAGE: | |
" Command: :NowLoading | |
" | |
" Please press 'q' for stop to this program. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 行列の対応する要素をaccumulateする | |
* | |
* このプログラムはいたるところにバグが潜んでいる、もしくは | |
* バグを起こしやすいので注意 | |
*/ | |
#include <cstdio> | |
// 要素数がsize個の行列をmatrix_size個格納した配列matrixを |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! s:foo(second) abort | |
let l:start = reltime() | |
while str2float(reltimestr(reltime(l:start))) < float(a:second) | |
execute 'normal! r ' | |
endwhile | |
endfunction | |
tabnew Sample | |
call setline(1, 'Please any keys for 2 seconds.') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! s:count_if(list, string) abort | |
let copy = deepcopy(a:list) | |
call filter(copy, a:string) | |
return len(copy) | |
endfunction |
OlderNewer