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 () { | |
var indexedDB = window.indexedDB; | |
var db = null; | |
var request = indexedDB.open('library', 1); | |
request.onupgradeneeded = function (event) { | |
db = event.target.result; | |
var store = db.createObjectStore('books', { keyPath: 'isbn' }); | |
store.createIndex('index', 'isbn', false); | |
}; | |
request.onsuccess = function (event) { |
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
using System; | |
// 角度が30°の場合 | |
var angle = 30; | |
var sin = Math.Sin(angle * (Math.PI / 180)); | |
var cos = Math.Cos(angle * (Math.PI / 180)); | |
var tan = Math.Tan(angle * (Math.PI / 180)); | |
//"Sin:0.5, Cos:0.87, Tan:0.58" ※少数第二位で四捨五入 | |
Console.WriteLine("Sin:{0}, Cos:{1}, Tan:{2}", sin, cos, tan); |
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
var Counter = (function () { | |
function Counter() { | |
var _this = this; | |
this.countUp = function () { | |
_this.count++; | |
alert(_this.count); | |
}; | |
this.countDown = function () { | |
_this.count--; | |
alert(_this.count); |
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
var list = document.getElementById('list1').getElementsByTagName('li'); | |
// 1 | |
console.log(list.length); | |
var list1Item = document.createElement('li'); | |
list1Item.innerText = 'List1_Item2'; | |
document.getElementById('list1').appendChild(list1Item); | |
var list2Item = document.createElement('li'); |
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(modules) { // webpackBootstrap | |
/******/ // The module cache | |
/******/ var installedModules = {}; | |
/******/ // The require function | |
/******/ function __webpack_require__(moduleId) { | |
/******/ // Check if module is in cache | |
/******/ if(installedModules[moduleId]) | |
/******/ return installedModules[moduleId].exports; |
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 <math.h> // sqrt用 | |
#include <time.h> // clock用 | |
#define NUM 10000 | |
int main(void){ | |
clock_t start, end; | |
int i, j; | |
int prime[NUM]; | |
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 <time.h> // clock用 | |
// 最大公約数の計算(ユークリッドの互除法) | |
int calcGCD(int in1, int in2) | |
{ | |
int big, small, r; | |
// 入力値の大小を判定する | |
if (in1 < in2) | |
{ |
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
chrome.runtime.onMessage.addListener( | |
function (request, sender, sendResponse) { | |
switch (request.type) { | |
case 'add': | |
add(request.value, sendResponse); | |
break; | |
case 'search': | |
search(request.value, sendResponse); | |
break; | |
default: |
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
<!doctype html> | |
<html lang="ja"> | |
<head> | |
<meta chraset="utf-8"> | |
<title>ファイル出力</title> | |
</head> | |
<body> | |
<span id="export-link"></span> | |
<script src="index.js"></script> | |
</body> |
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
<!doctype html> | |
<html lang="ja"> | |
<head> | |
<meta chraset="utf-8"> | |
<title>ファイル出力</title> | |
<link href="style.css" rel="stylesheet" type="text/css"> | |
</head> | |
<body> | |
<div id="transition-demo"> | |
<input type="text" v-model="input | validator" /> |
OlderNewer