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
a = [1, 2, 3] | |
# Hash.[] <- とても読みにくい | |
h1 = Hash[ | |
a.map { |x| [x, "value#{x}"] } | |
] | |
# => {1=>"value1", 2=>"value2", 3=>"value3"} | |
# 手続き型言語っぽい書き方 | |
h2 = {} |
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
-module(lunch). | |
-export([calc/0]). | |
calc() -> | |
NDays = 7, | |
TotalInThePeriod = 2290, | |
Menus = [{set, 370}, {curry, 350}, {udon, 300}], | |
Seq = lists:seq(0, NDays), | |
Amounts = [[X, Y, Z] || | |
X <- Seq, Y <- Seq, Z <- Seq, X + Y + Z =:= NDays], |
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
description "Tiarra" | |
author "ocha <ochaochaocha3@example.net>" | |
start on runlevel [2345] | |
stop on runlevel [016] | |
exec start-stop-daemon --start --chuid irc --chdir /home/irc/tiarra --exec tiarra | |
respawn # 異常終了時に再起動する |
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
"1" | |
[Parse tree] | |
{:int=>"1"@0} | |
[Result] | |
1 | |
"1+2" |
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
# vim: fileencoding=utf-8 | |
require_relative '../../../spec_helper' | |
require 'rgrb/plugin/detatoko/generator' | |
describe RGRB::Plugin::Detatoko::Generator do | |
let(:generator) { described_class.new } | |
describe '#skill_decision' do | |
context '〜の場合' do |
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
# vim: fileencoding=utf-8 | |
require 'pp' | |
require 'parslet' | |
# require_relative 'calc_nodes' | |
# 計算機モジュール | |
module Calc | |
class BinaryOpNode |
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
# Short KISS instructions: | |
# 簡単な説明: | |
# | |
# - To add new languages: Add *.po target to LOCALES Make variable below | |
# 言語を追加するには: 下の LOCALES 変数に *.po ターゲットを追加する | |
# - Update and merge .po-files: make update-po | |
# .po ファイルを更新・マージする: make update-po | |
# - Only update the template .pot-file only: make update-pot | |
# テンプレート .pot ファイルのみを更新する: make update-pot | |
# - Run update-potfiles.sh when any new sourcefiles with translatable strings |
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
# DSSP で求めた二次構造を反映させる PyMOL スクリプトを生成する | |
# アミノ酸残基を表すクラス | |
class Residue | |
# 鎖 | |
attr_reader :chain | |
# 残基番号 | |
attr_reader :num | |
# 二次構造 | |
attr_reader :ss |
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
sound: sound.c | |
gcc -o sound $^ -lm |
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
%% 逆ポーランド記法計算機 | |
-module(calc). | |
-export([rpn/1, rpn_test/0]). | |
%% RPN 電卓 | |
rpn(L) when is_list(L) -> | |
case | |
lists:foldl(fun rpn/2, [], string:tokens(L, " ")) | |
of |