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
def function_f(tuple, m) | |
c = [-1, -1, 0] | |
if tuple.all? {|digit| digit == 0} | |
return c[0].abs | |
elsif tuple[0] == 1 and tuple[1..-1].all? {|digit| digit == 0} | |
return 0 | |
else | |
sum = 0 | |
tuple.each_index{|i| sum += c[i] * tuple[i] } | |
return sum % m |
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
require 'benchmark' | |
require 'inline' | |
class Test | |
include Math | |
inline do |builder| | |
builder.include('<math.h>') | |
builder.c <<-EOF | |
double | |
log_c(int 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
#!/bin/bash | |
if [ -n "$SESSION_NAME" ];then | |
session=$SESSION_NAME | |
else | |
session=multi-ssh-`date +%s` | |
fi | |
window=multi-ssh | |
### tmuxのセッションを作成 |
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
import io | |
import picamera | |
import sys | |
from time import sleep | |
from tensorflow.contrib import predictor | |
from picamera import PiCamera | |
import signal | |
import slacker |
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
import mlx.core as mx | |
import numpy as np | |
import faiss | |
import time | |
class MLXVecSearch(): | |
def __init__(self, stream=mx.gpu): | |
self._stream = stream |
OlderNewer