Skip to content

Instantly share code, notes, and snippets.

View keitin's full-sized avatar

Keita Matsushita keitin

View GitHub Profile
local function keyCode(key, modifiers)
modifiers = modifiers or {}
return function()
hs.eventtap.event.newKeyEvent(modifiers, string.lower(key), true):post()
hs.timer.usleep(1000)
hs.eventtap.event.newKeyEvent(modifiers, string.lower(key), false):post()
end
end
local function remapKey(modifiers, key, keyCode)
public class Solution {
public int countPrimes(int n) {
int count = 0;
boolean[] notPrime = new boolean[n];
for (int i = 2; i < n; i++) {
if (!notPrime[i]) {
count++;
for (int j = 2; j * i < n; j++) {
import java.util.Scanner;
public class DavisStaircase {
public static void main(String[] args) {
DavisStaircaseSolution.main(args);
}
}
class DavisStaircaseSolution {
static int[] dp;
class PascalTriangle {
int N;
long[][] dp;
PascalTriangle(int N) {
this.N = N;
this.dp = new long[N + 1][N + 1];
makeTriangle();
}
import java.util.Scanner;
import java.util.Arrays;
public class ABC057DDSolve {
public static void main(String[] args) {
ABC057DD solve = new ABC057DD();
solve.main();
}
}
import java.util.Scanner;
public class ABC057CC {
public static void main(String[] args) {
ABC057CCSolve solve = new ABC057CCSolve();
solve.main();
}
}
class ABC057CCSolve {
def sigmoid(x):
return 1 / (1 + np.exp(-x))
def step_function(x):
if x > 0:
return 1
else:
return 0
y = h(b + w1*x1 + w2*x2) //hという関数を定義して考える
h(x) => 0 (x <= 0)
h(x) => 1 (x > 0)
def AND(x1, x2):
x = np.array([x1, x2])
w = np.array([???, ???]) # 重みの設定
b = ??? # バイアスの設定
tmp = np.sum(w * x) + b
if tmp <= 0:
return 0
else:
return 1