Skip to content

Instantly share code, notes, and snippets.

@uhfx
uhfx / tic-tac-toe.ino
Last active Jan 14, 2019
2018 Logic Design
View tic-tac-toe.ino
/**********************************************************/
/* LEDの点灯,消灯プログラムは以下のサイトを参考にした. */
/* http://tsukutta.hatenablog.com/entry/2013/05/30/150231 */
/**********************************************************/
const int rl[9] = { 22,26,32,36,42,46,52,56,60 }; // 赤色LEDのピンの定義
const int bl[9] = { 23,27,33,37,43,47,53,57,61 }; // 青色LEDのピンの定義
const int rs[9] = { 24,28,34,38,44,48,54,58,62 }; // 赤色スイッチのピンの定義
const int bs[9] = { 25,29,35,39,45,49,55,59,63 }; // 青色スイッチのピンの定義
View prog3-3_.c
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<time.h>
int main(void)
{
double x, y, z, z_max, x_max, y_max;
srand((unsigned int) time(NULL));
int i;
View office.html
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title></title>
<style type="text/css">
.auto-style1 { text-align: center; font-family: "Meiryo UI", "MS UI Gothic", sans-serif; font-weight: bold; font-size: xx-large; color: #333333; margin-bottom: 27px; } .auto-style2 { font-family: "Meiryo UI", "MS UI Gothic", sans-serif; font-size: medium; color: #808080; text-align: center; } .auto-style3 { margin-top: 42px; }
</style>
</head>
<body style="background-color: #FFFFFF; text-align: center;">
View oauth
https://github.com/mpyw/TwistOAuth
View up.html
<!-- 「トップへ戻る」ボタン -->
<div id="back-to-top" style="position:fixed;right:12px;bottom:12px"><a href="#"><img src="画像のURLを用意" /></a></div>
<script>
$(function(){
$("#back-to-top").hide();
$(window).scroll(function(){
if($(this).scrollTop() > 500){
$("#back-to-top").fadeIn();
} else{
View calculation.cpp
#include <iostrea>
#include <cstdlib>
#include <ctime>
using namespace std;
int funcfor();
int main()
{
double answer;
int num;
int count=0;
View name_changer.rb
# -*- encoding: utf-8 -*-
require 'rubygems'
require 'tweetstream'
require 'twitter'
require './key.rb'
Twitter.configure do |config|
config.consumer_key = Const::CONSUMER_KEY
config.consumer_secret = Const::CONSUMER_SECRET
config.oauth_token = Const::ACCESS_TOKEN
View 6b36ex4-index.html
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<html lang="ja">
<meta http-equiv="Content-Type" content="text/html; charset=shift_jis">
<title>携帯電話の電波方式</title>
<style type="text/css">
.bg {
background-image: url(poke_fild5b.gif);
@uhfx
uhfx / sosu.c
Last active Dec 27, 2015
【超高速】素数を求めるプログラム
View sosu.c
#include <stdio.h>
#include <math.h>
int main(void)
{
int i,j,k;
printf("2 "); //あらかじめ2を書いておくという手法
for(i=10;i<=100;i+=2) //ここのiの値と10000の値をいじれば変わる
@uhfx
uhfx / sosu.c
Created Nov 8, 2013
【超低速】素数を求めるプログラム 範囲を指定できる
View sosu.c
#include <stdio.h>
int main(void)
{
int m, n, is_prime, i, num = 0;
scanf("%d", &m);
scanf("%d", &n);
for( num = m; num < n+1 ; num++ ){
is_prime = 1; /* num が変わるごとに再初期化しましょう */
for( i = 2; i< num+1 ; i++){
You can’t perform that action at this time.