This file contains hidden or 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 binary_search(a, start_idx, end_idx, target){ | |
var start = start_idx; | |
var end = end_idx; | |
while((end - start) >= 0){ | |
var mid = Math.floor((end + start) / 2); | |
if(a[mid] === target){ | |
return { | |
flag: true, | |
index: mid | |
}; |
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="description" content=""> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Visualize Binary Search(JS)</title> | |
<style> | |
@import url(http://fonts.googleapis.com/earlyaccess/notosansjapanese.css); | |
html, body{ |
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="description" content=""> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>加速度センサーの値を取る</title> | |
<style> | |
@import url(http://fonts.googleapis.com/earlyaccess/notosansjapanese.css); | |
html, body{ |
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Mouse座標取得</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<style> | |
html, body{ | |
text-align: center; | |
background-color: #fafafa; |
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="description" content=""> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Twitter API(Tweet Web Intent) Test</title> | |
<style> | |
@import url(http://fonts.googleapis.com/earlyaccess/notosansjapanese.css); | |
html, |
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="utf-8"> | |
<title>棒グラフ</title> | |
<meta name="description" content=""> | |
<style> | |
body { | |
backgorund-color: #fafafa; |
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="utf-8"> | |
<title>折れ線グラフ</title> | |
<meta name="description" content=""> | |
<style> | |
body { | |
background-color: #fafafa; |
This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="utf-8"> | |
<title>円グラフ</title> | |
<meta name="description" content=""> | |
<style> | |
body { | |
background-color: #fafafa; |
This file contains hidden or 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 motionAnime(canvas_id, canvas_config, motionFunc, motion_config, outside_process){ | |
var canvas = document.getElementById(canvas_id); | |
if(!canvas){ | |
console.log('wrong canvas_id'); | |
return false; | |
} | |
if(!motion_config.ball_config){ | |
console.log('Not ball_config in motion_config.'); | |
return false; |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>コッホ曲線</title> | |
<style> | |
#canvas { | |
border: 1px solid gray; | |
display: block; | |
margin-left: auto; |