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
| # coding: utf-8 | |
| # DQN(Deep Q-Network)によるUNOゲームの強化学習 | |
| # PyTorchを使用して、AIエージェントがUNOのような簡易カードゲームを学習する | |
| # 強化学習:環境と相互作用しながら、報酬を最大化する行動を学習する機械学習手法 | |
| # DQN:Q学習にディープニューラルネットワークを組み合わせた手法 | |
| import torch # PyTorch:ディープラーニングフレームワーク | |
| import torch.nn as nn # ニューラルネットワークモジュール | |
| import torch.optim as optim # 最適化アルゴリズム | |
| import numpy as np # 数値計算ライブラリ |
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
| final int numBlocksCols = 5, numBlocksRows = 10; | |
| final int numBlocks = numBlocksCols * numBlocksRows; | |
| final int blockWidth = 30, blockHeight = 10, space = 2; | |
| final int padWidth = 40, padHeight = 10; | |
| final color std_colors[] = {color(255, 0, 0) // red | |
| , color(255, 0, 255) // magenta | |
| , color(255, 255, 0) // yellow | |
| , color(0, 255, 255) // cyan | |
| , color(0, 255, 0) // green | |
| }; |
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
| // 🇸🇬 | |
| size(120, 120); | |
| background(255); | |
| noStroke(); | |
| fill(152, 251, 152); | |
| int a[] = {1,4,2,5,3}; | |
| int b; | |
| float x; | |
| float y; |
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
| size(60, 60); | |
| background(255); | |
| noStroke(); | |
| fill(152, 251, 152); | |
| int b; | |
| int a[] = {1,4,2,5,3}; | |
| beginShape(); | |
| for (int i = 0; i < 5; i++) { |
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
| #include <stdio.h> | |
| int main(void) | |
| { | |
| int i = 0; | |
| // 今は入力値は101を与えてあげる。出力は1が文字列中に2つなので2になる | |
| char *str = "101"; | |
| int counter = 0; // strに1が何回あるか数える変数 | |
| while (※strの文字列の長さの回数繰り返す) | |
| { |
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
| #include <stdio.h> | |
| int main() | |
| { | |
| int a, b, c; | |
| a = 1; | |
| b = 2; | |
| c = 3; | |
| char s[101]; | |
| s = 'test'; | |
| // 整数の入力 |
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
| remove Lock = Caps_Lock | |
| keysym Caps_Lock = Control_L | |
| add Control = Control_L |
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
| load A | |
| sub B | |
| ifp ABig | |
| ifn BBig | |
| ABig:load A | |
| store Z | |
| jump CompC | |
| BBig:load B | |
| store Z | |
| jump CompC |
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
| # [Dokku - The smallest PaaS implementation you've ever seen](http://dokku.viewdocs.io/dokku/deployment/application-deployment/#deploying-to-dokku) | |
| # login root user. | |
| dokku apps:create ruby-rails-sample | |
| # install the postgres plugin | |
| # plugin installation requires root, hence the user change | |
| dokku plugin:install https://github.com/dokku/dokku-postgres.git | |
| # create a postgres service with the name rails-database |
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
| # [Dokku - The smallest PaaS implementation you've ever seen](http://dokku.viewdocs.io/dokku/getting-started/installation/) | |
| # for debian systems, installs Dokku via apt-get | |
| cd ~/ | |
| wget https://raw.githubusercontent.com/dokku/dokku/v0.11.6/bootstrap.sh | |
| sudo DOKKU_TAG=v0.11.6 bash bootstrap.sh |
NewerOlder