Skip to content

Instantly share code, notes, and snippets.

View zaltoprofen's full-sized avatar

Borscht zaltoprofen

  • Tokyo, Japan
View GitHub Profile

.NET Blog Performance Improvements で Peanut Butterと呼ばれる類の小手先の定数倍高速化まとめ(羅列) 個人的なメモをpublicにしただけなのであんまり信用しない方が。長文部分はだいたいわかってないで書いてる(数年前の自分・・・)
ランタイムやライブラリの進化で無意味になることがあります。
整えてないので見にくい。

原則

  • コピーを作らない
  • スタック上で完結させる(==アロケーションを避ける)Sapn<T>stackallocは強い。ただしスタック領域は狭い。
  • 仮想メソッドは遅い
  • ボックス化はもっと遅い
@itkq
itkq / Gemfile
Last active September 7, 2016 09:50
東工大修士向け2016年度3Q/4Qの文系選択を支援するやつ
# frozen_string_literal: true
# A sample Gemfile
source "https://rubygems.org"
gem "mechanize"
@yrevar
yrevar / imagenet1000_clsidx_to_labels.txt
Last active July 21, 2024 08:16
text: imagenet 1000 class idx to human readable labels (Fox, E., & Guestrin, C. (n.d.). Coursera Machine Learning Specialization.)
{0: 'tench, Tinca tinca',
1: 'goldfish, Carassius auratus',
2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias',
3: 'tiger shark, Galeocerdo cuvieri',
4: 'hammerhead, hammerhead shark',
5: 'electric ray, crampfish, numbfish, torpedo',
6: 'stingray',
7: 'cock',
8: 'hen',
9: 'ostrich, Struthio camelus',
@enukane
enukane / cupoftea.rb
Created February 18, 2016 02:35
cup of tea server
#!/usr/bin/env ruby
require "yaml"
require "optparse"
class CupOFTea
TEAPOT="#{ENV['HOME']}/.tea_pot"
TEAYML = <<LISTOFTEA
assam:
- bokel
@jmatsu
jmatsu / install_ruby_on_cent.sh
Last active August 29, 2015 14:15
Install Ruby x.y.z
#!/bin/sh
# Returns TRUE if $1 doesn't exist. $1 is command name, package name, or the fragment of them.
check_no_cmd()
{
# Does $PATH include $1?
which $1
if [ $? -eq 0 ]; then
return 1
fi
@jasonm23
jasonm23 / xterm-256color.svg
Last active July 10, 2024 20:18
Xterm 256color mode color chart, organised into sections. (used on Wikipedia/xterm)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@theconektd
theconektd / github.css
Created April 30, 2012 02:11
Github Markdown CSS - for Markdown Editor Preview
body {
font-family: Helvetica, arial, sans-serif;
font-size: 14px;
line-height: 1.6;
padding-top: 10px;
padding-bottom: 10px;
background-color: white;
padding: 30px; }
body > *:first-child {
@cdown
cdown / gist:1163649
Last active July 25, 2024 03:11
Bash urlencode and urldecode
urlencode() {
# urlencode <string>
old_lc_collate=$LC_COLLATE
LC_COLLATE=C
local length="${#1}"
for (( i = 0; i < length; i++ )); do
local c="${1:$i:1}"
case $c in