Skip to content

Instantly share code, notes, and snippets.

View ayutaz's full-sized avatar

yousan ayutaz

View GitHub Profile
@ayutaz
ayutaz / 2.py
Created December 12, 2018 08:14
pythoの並列計算,最大のプロセス数とは・・・? ref: https://qiita.com/ayousanz/items/4f82efb47c217b07a0a2
# -*- coding: utf-8 -*-
import multiprocessing as mp
L = 100000
proc = 500 # 8並列とする
# 各プロセスが実行する計算
def subcalc(p): # p = 0,1,...,7
subtotal = 0
@ayutaz
ayutaz / file0.txt
Last active December 21, 2018 03:47
ターミナルで時間を知らせる ref: https://qiita.com/ayousanz/items/e6508a0cd8e8901ec531
#coding:utf-8
# まずは,入力した時間になったらターミナルで知らせてくれるものを作ってみる
from datetime import datetime
from time import sleep
print(datetime.now())
my_time_hour=int(input("時間を入力してください:"))
my_time_minute=int(input())
while True:
h=int(datetime.now().hour)
@ayutaz
ayutaz / file0.txt
Last active December 21, 2018 04:06
GUI(tkinter)を使い,時刻を表示する No.1 ref: https://qiita.com/ayousanz/items/3022f58caef6b131bac9
# ウインドウを作成し,時刻を出力する.このときに出力する時刻は,更新しないものとする.
from datetime import datetime
import tkinter
from tkinter import font
from time import sleep
root=tkinter.Tk()
root.title("timer")
today_time=datetime.now()
root.geometry("400x300")
@ayutaz
ayutaz / file0.txt
Last active December 21, 2018 04:34
GUI(tkinter)を使い,時刻を表示する No.2 ref: https://qiita.com/ayousanz/items/ac09dbfbb3d0f1d8a835
# ウインドウの時間が適度に更新されるようにする.
# 入力した時間にウインドウが作成される.
from tkinter import font
import tkinter
from datetime import datetime,time
def show_time():
today_time=datetime.now()
label1 = tkinter.Label(root, text=today_time)
label1.pack(side="top")
@ayutaz
ayutaz / file0.txt
Created December 23, 2018 12:39
GUI(tkinter)を使い,時刻を表示する No.3 ref: https://qiita.com/ayousanz/items/109eed7dbf8286db87a3
from datetime import datetime
import tkinter
import time
w=800
h=600
root1=tkinter.Tk()
root1.title("timer")
root1.geometry("800x450")
@ayutaz
ayutaz / main.html
Last active December 24, 2019 15:04
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="main.css">
<title>calculator</title>
</head>
<body>
@ayutaz
ayutaz / code.cs
Last active December 24, 2019 15:17
Particleを使用してエフェクト効果をつける(Unity,Particle pack)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CreateMagic : MonoBehaviour
{
public GameObject Prefab1;
public GameObject Prefab2;
public GameObject Prefab3;
public GameObject Prefab4;
using UnityEngine;
using System.Collections;
public class PlayerControl : MonoBehaviour {
//Rigidbodyを変数に入れる
Rigidbody rb;
//移動スピード
public float speed = 3f;
using UnityEngine;
using UnityEngine.SceneManagement;
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
public class PlayerController : MonoBehaviour {
    
    public float speed = 4f; //歩くスピード
public float jumpPower = 400; //ジャンプ力
@ayutaz
ayutaz / code1.cs
Created December 24, 2019 15:32
キャラクターの状態によってテキストの表示を変更する (Unity,text,enum)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class JunkochanControl: MonoBehaviour {
    private float InputH;//Horizontal Input (A & D key)
    private float InputV;//Vertical Input (W & S key)
    private GameObject JKCCam;//Camera which chases Junkochan
    private CharacterController JKCController;//Character controller component attached to Junkochan
    private Animator JKCAnim;//Animator component attached to Junkochan