Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class UnityChan : MonoBehaviour { | |
public float speed = 1f; | |
Animator animator; |
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
import numpy as np | |
chars = np.array(['a', 'b', 'c', 'd', 'e', 'f']) | |
mask1 = np.random.choice(6, 4) | |
mask2 = np.random.choice(6, 4, replace=False) | |
print(mask1) # ex:[4 5 0 5] | |
print(chars[mask1]) # ex:['e' 'f' 'a' 'f'] | |
print(mask2) # ex:[0 5 4 2] | |
print(chars[mask2]) # ex:['a' 'f' 'e' 'c'] |
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
import numpy as np | |
import matplotlib.pyplot as plt | |
def step_function(x): | |
return np.array(x > 0, dtype=np.int) | |
def sigmoid(x): | |
return 1 / (1 + np.exp(-x)) | |
def relu(x): |
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
# -*- coding: utf-8 -*- | |
values = [1, 2, 3, 4, 5] | |
strs = map(str, values) | |
print(" ".join(strs)) |
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; | |
namespace ConsoleApp | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
int[] values = new int[5] { 1, 2, 3, 4, 5 }; | |
Console.WriteLine(string.Join(" ", values)); |
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
# -*- coding: utf-8 -*- | |
ITEMS = 5 | |
SIZE = [2, 3, 5, 6, 9] | |
VALUE = [2, 4, 7, 10, 14] | |
NAP_SIZE = 16 | |
nap_value = [0] * (NAP_SIZE + 1) | |
print("ナップザックの大きさ:", end="") | |
for i in range(1, NAP_SIZE+1): |
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
# -*- coding: utf-8 -*- | |
class OldRobot(): | |
def __init__(self): | |
self.speed = 5 | |
def walk(self): | |
print("old robot walking {} km/h.".format(self.speed)) | |
class NewRobot(): |
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
# -*- coding: utf-8 -*- | |
names = ["alice", "becky", "charlie", "Dave"] | |
ages = [25, 38, 12] | |
for name, age in zip(names, ages): | |
print(name, age) | |
# alice 25 | |
# becky 38 |
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
# -*- coding: utf-8 -*- | |
while True: | |
bins = input().split() | |
if len(bins) == 0: | |
break | |
for b in bins: | |
print(chr(int(b,2)), end='') |