Skip to content

Instantly share code, notes, and snippets.

View henry0312's full-sized avatar
💭
I may be slow to respond.

OMOTO Tsukasa henry0312

💭
I may be slow to respond.
View GitHub Profile
@henry0312
henry0312 / optuna_cv.py
Last active June 24, 2023 07:57
k-fold cross validation with Optuna
class LocalObjective(object):
def __init__(self, params):
self.params = dict(params)
def __call__(self, trial):
# fit
return loss
class GlobalObjective(object):
==> Upgrading macvim --with-override-system-vim --with-lua --with-luajit --with-python3
==> Downloading https://github.com/macvim-dev/macvim/archive/snapshot-143.tar.gz
Already downloaded: /Users/tsukasa_omoto/Library/Caches/Homebrew/macvim-8.0-143.tar.gz
==> ./configure --with-features=huge --enable-multibyte --with-macarchs=x86_64 --enable-perlinterp --enable-rubyinterp --ena
==> make
Last 15 lines from /Users/tsukasa_omoto/Library/Logs/Homebrew/macvim/02.make:
export XCODE_DEVELOPER_USR_PATH=/Applications/Xcode.app/Contents/Developer/usr/bin/..
/Applications/Xcode.app/Contents/Developer/usr/bin/ibtool --strip /tmp/macvim-20171220-2976-1jlx0fa/macvim-snapshot-143/src/MacVim/build/Release/MacVim.app/Contents/Resources/English.lproj/FindAndReplace.nib --output-format human-readable-text /tmp/macvim-20171220-2976-1jlx0fa/macvim-snapshot-143/src/MacVim/English.lproj/FindAndReplace.nib
CopyPlistFile build/Release/MacVim.app/Contents/Resources/KeyBinding.plist KeyBinding.plist
@henry0312
henry0312 / dirichlet_distribution.hpp
Last active August 29, 2015 14:07
Dirichlet distribution
/*
* The MIT License (MIT)
*
* Copyright (c) 2014 Tsukasa ŌMOTO <henry0312@gmail.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@henry0312
henry0312 / mpv-open.sh
Last active August 29, 2015 14:03
mpv-open
mpv-open() {
mpv $@ "$(find . -type f \( -name "*.ts" -o -name "*.mp4" -o -name "*.mov" -o name "*.mkv" \) | peco)"
}
From: Tsukasa OMOTO <henry0312@gmail.com>
Date: Sun, 22 Jun 2014 23:14:40 +0900
Subject: [PATCH 1/3] index: Correct henry's real name.
---
index.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/index.html b/index.html
index ab0cab3..385f1bf 100644
@henry0312
henry0312 / AppDelegate.swift
Last active August 29, 2015 14:02
TracMix written in Swift
import Cocoa
class AppDelegate: NSObject, NSApplicationDelegate {
@IBOutlet var window: NSWindow
var track: Track!
@IBOutlet var textField : NSTextField
@IBOutlet var slider : NSSlider
import Cocoa
enum Node {
case Parent(NSMenu, Node)
case Child(NSMenuItem, Node)
}
--- Makefile.orig 2014-06-12 00:51:39.159419824 +0900
+++ Makefile 2014-06-12 00:51:47.811419492 +0900
@@ -8,7 +8,7 @@
# MAC_LDFLAGS = -lgsl -latlas -lcblas -L/sw/li
MAC_LDFLAGS = -lgsl -lgslcblas -L/opt/local/lib
-C2_LDFLAGS = -lgsl -lcblas -latlas
+C2_LDFLAGS = -lgsl -lcblas -latlas -lm
CYCLES_LDFLAGS = -lgsl -lgslcblas
LSOURCE = utils.c topic.c doc.c hyperparameter.c main.c gibbs.c
$ ./waf build -j2
Waf: Entering directory `/Users/henry/repos/mpv/build'
[ 1/230] macosx_icon.inc: TOOLS/osxbundle/mpv.app/Contents/Resources/icon.icns -> build/osdep/macosx_icon.inc
[ 2/230] x11_icon.inc: video/out/x11_icon.bin -> build/video/out/x11_icon.inc
[ 3/230] input_conf.h: etc/input.conf -> build/input/input_conf.h
[ 4/230] gl_video_shaders.h: video/out/gl_video_shaders.glsl -> build/video/out/gl_video_shaders.h
[ 5/230] osd_font.h: sub/osd_font.otf -> build/sub/osd_font.h
[ 6/230] defaults.inc: player/lua/defaults.lua -> build/player/lua/defaults.inc
[ 7/230] assdraw.inc: player/lua/assdraw.lua -> build/player/lua/assdraw.inc
[ 8/230] options.inc: player/lua/options.lua -> build/player/lua/options.inc
@henry0312
henry0312 / fizzbuzz.swift
Created June 8, 2014 15:35
FizzBuzz with Swift
func FizzBuzz(n: Int) {
for i in 1...n {
if i % 15 == 0 {
println("FizzBuzz")
} else if i % 3 == 0 {
println("Fizz")
} else if i % 5 == 0 {
println("Buzz")
} else {
println(i)