FG830入手

K.Yairi SR-10,YAMAHA FG830 パーカッシブギター練習のために購入。 FG830はSR-10より一回り大きい。重い。 音色も十分。サスティンが長い。

Generative Art1

https://gist.github.com/kencoba/a5d0feb113ab292f22b401dcee8797f1

Ubuntu 14.10 Unity上でのcaps,ctrl入れ替え

やっと動いたー。 gsettings reset org.gnome.settings-daemon.plugins.keyboard active dconf write /org/gnome/desktop/input-sources/xkb-options "['ctrl:nocaps']"

Install BitNami Redmine into CentOS on Vagrant.

> mkdir redmine > cd redmine > vagrant init chef/centos-6.5 > vim Vagrantfile # enable gui # vb.cutomize ["modifyvm", :id, "--memory", "2048"] # IP address: 10.0.0.100 > vagrant upuser name: vagrant password : vagrant$ wget --no-check-cert…

Solution of Exercise for section 2.8

It can take some work to show that something is not an affine variety. For example, consider the set[tex: X = \{(x,x) : x \in \mathbb{R}, x \neq 1} \

特定のセルに値を設定する

アンケートをExcelブックで取るとか、 そういう処理において、「氏名を記入してください!!!!」 と言っても聞いてない人がいる。そんなのは最初から設定してしまえばいい。 ディレクトリ名 ブック名 シート名 セル名 値 の形式のシートを作成して、以下の…

Source Code Formatter

プログラミング教育をしていると、ソースコードをWord文書や PowerPointスライドに貼り付ける作業をすることがある。 そんなときのWordVBAマクロ。1. Wordの新規文書に、ソースコードを貼り付ける。 2. マクロを実行する。 3. 表形式にフォーマットされたソ…

2014-04-17 Ideals, Varieties, and Algorithms Exercises 1.2

http://d.hatena.ne.jp/kencoba/20140417の訂正。a. .b. . is wrong answer because .c. if n is even. if n is odd.

Ideals, Varieties, and Algorithms Exercises 1.2

2. let be the field from Exercise 1. a. Consider the polynomial . Show that for every , and explain why this does not contradict Proposition 5. b. Find a nonzero polynomial in which vanishes at every point of . Try to find one involving al…

Gitの情報まとめ

Git

http://programmerbox.com/2013-07-17_git_summary/

Train Gate Controll

http://qiita.com/kencoba/items/82a0ff70737a6c150148

複数Excelブックの、特定シート、特定列を全部マージする

VBA

http://qiita.com/kencoba/items/8f5c35a874bda4b00fcd

「形式手法入門」のP22「2.1.3 抽象データの表現と解析」

P25の「代数的な性質の検査」の4条件のうち、2と4はandじゃなくてimpliesになるのでは。 module Queue abstract sig Node { next : lone Node } abstract sig Queue { root : lone Node } fact noCycle { no n : Node | n in n.^next } fact noReflexive { n…

ディレクトリ内のファイルに対して再帰的に処理する

require 'find' require 'pp' def eachPath(root,pattern) find_entries = Array.new Find.find(root) do |path| find_entries.push(path) end selectedPath = find_entries.select {|p| p =~ pattern} selectedPath.each {|path| yield path } end eachPath…

PPTで特定の名前を持つShapeを削除する

VBA

Option Explicit Public Sub CSharpのキーワードの色を変更する() Dim keywordList() As String keywordList = Split("テキスト", ",") Dim keywordColor As Long keywordColor = RGB(0, 0, 255) Dim backGroundColor As Long backGroundColor = RGB(128, 0,…

JavaMail

import java.util.Properties import java.security.Security import javax.mail.URLName import javax.mail.Session import javax.mail.Store import javax.mail.Folder import javax.mail.search.FlagTerm import javax.mail.Flags import javax.mail.Mess…

PowerPointのスライドに対し、索引を作成する(1)改

VBA

コマンドラインから実行できるようにした。 ' > cscript PPT2Text.vbs powerpoint-filename Option Explicit ' ファイル名を実行時パラメータから取得する Dim pptFilename pptFilename = WScript.Arguments.Item(0) Dim oApp Set oApp = CreateObject("Powe…

PPTファイルの索引データを作成する

https://github.com/kencoba/PPT2IndexPowerPointファイルの索引データ(キーワードとページ番号リストの対)を 出力するプログラムを作成した。PPT2Index.bat PowerPointファイル テキストデータ抽出ファイル 索引用キーワードファイルとして実行する。「テキ…

PowerPointのスライドに対し、索引を作成する(2)

import scala.xml.XML import scala.xml.Elem import scala.io.Source // 索引を付けるPPTファイルから抽出したxml // <Slides> // <Slide> // <SlideNumber value=""> // <SlideBody></SlideBody> // </Slide> // </Slides> val f = new java.io.File("d:\\tmp\\text.pptx.x…

PowerPointのスライドに対し、索引を作成する(1)

VBA

PPTファイルのスライドの内容を、ノート部分も含めてすべてテキストファイルに出力する Option Explicit Sub Extract() Dim myFilePath As String ' 書き出しファイルを指定する myFilePath = CreateObject("WScript.Shell").SpecialFolders("Desktop") & _ …

セル内の文字列の改行操作

VBA

Excelシートにアンケートコメントを格納した場合、 印刷時に最後の行が表示されなくなることがあります。 PC画面上では見えているのに、印刷では見えない。対策としては、「各セルの文字列の最後に改行を入れる」 というのがありますが、非常に煩雑です。 手…

シートを同一形式にそろえる

VBA

こういうのが地味に便利。 Attribute VB_Name = "FormatSheet" Sub シート設定() Const 範囲 = "$A$1:$S$9" ' 罫線を引く With Range(範囲) '上段 With .Borders(xlEdgeTop) .LineStyle = xlContinuous .Weight = xlThin .ColorIndex = xlAutomatic End With…

VBAでの単純な変換関数を生成する

こんなプログラムを作って、VBを自分で書く量を減らそうとしている。 def conv(funcName:String, params:List[(String,String)]): String = { val cases = params.map(p => s"""| Case "${p._1}" | result = "${p._2}" """.stripMargin).mkString val functi…

VBの戻り値設定記述を楽にする

VBAを書いていると一番嫌になるのが、関数の戻り値記述。 単純に「return 戻り値」って書けばいいんじゃないのか。 なぜ「関数名 = 戻り値」なのか。 関数名が長くなると、読みにくいことこの上ない。 ということで、Emacs上で入力を楽にする手段を考えた。 …

2つのシートの差分

VBA

こういうものが無いと不安な仕事があるのです。 ' 指定された2つのシートの差分を新しいシートに出力する Sub Diff(ByRef 比較対象1 As Worksheet, ByRef 比較対象2 As Worksheet) Dim 出力 As Worksheet Set 出力 = Worksheets.Add Dim endOfRow As Long en…

どうしてもprivateメンバをテストしたい人に対する、JUnit4での解決案

そもそもJUnitは、振る舞いのテスト(≒ブラックボックステスト)を前提としている(こんなデータを入れたら、こんな結果が返りますよーという意味で)。privateメンバをテストしたいというのは、ホワイトボックステストをしたいということである(このメソッドは…

JSFデバッグ用PhaseListener

https://gist.github.com/kencoba/6097635まぁこんなのがあれば、無いよりはましであろう。

Multiplication table of Tetrahedral group

正四面体群の乗積表を手作業で作るのは、私には無理だった・・・https://gist.github.com/kencoba/6093972 id tl tm tn a1 a2 b1 b2 c1 c2 d1 d2 ------------------------------------- id| id tl tm tn a1 a2 b1 b2 c1 c2 d1 d2 tl| tl id tn tm c1 d2 d1 …

配布物ラベルシートを作成するマクロ

VBA

こんなマクロが必要になることがしょっちゅうあります。 Public Sub ラベルシート作成() Dim 講座名列番号 As Long Dim 資料名列番号 As Long Dim 配布日列番号 As Long Dim 配布No列番号 As Long Dim ラベル対象列番号 As Long 講座名列番号 = 1 資料名列番…

transformation between Excel column name and column number.

def toNum(col:String):Int = { def alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" def char2num(c:Char):Int = alpha.indexOf(c) + 1 def digit(n:Int): Stream[Int] = Stream.cons(n,digit(n*26)) val nums = col.reverse.map(char2num) val zipped = nums.zip(di…