2014-01-01から1年間の記事一覧

ファイルの改行コードを知る・改行コードを変換する

■ 改行コードを知る。catコマンド # 行末(LF)に「$」・表示不可文字(CRなど)を「^M」で表示 cat -e ファイル名 # 行末(LF)に「$」・表示不可文字(CRなど)を「^M」・タブを「^I」で表示 cat -A ファイル名 ■改行コードを変換する(nkf) 主要なオプションは以…

テストファースト

2004年に出たJUnit本が予想以上に勉強になった。 - 感謝のプログラミング

Python から Java コードの呼び出し

Caller & Callee each other between Scala & Java

Scala REPL help

scala> :help All commands can be abbreviated, e.g. :he instead of :help. Those marked with a * have more detailed help, e.g. :help imports. :cp add a jar or directory to the classpath :help [command] print this summary or command-specific …

How to call main function from Interpreter Scala REPL

Following the information in Scalaプログラミング入門以下のサンプルコードを実行するとすると。 1: object Hello { 2: def main(args: Array[String]) { 3: println("Hello Kobe!") 4: } 5: } REPL を起動して、以下を実行。 # 私の場合、emacs のScalaモ…

emacs24 の python mode インストール方法

以下を参考にhttp://mymemo.weby117.com/develop/emacs_9.htmlhaskell-mode パッケージが配布されているため、apt-get コマンドでインストール可能。ターミナルより以下を実行。$ sudo apt-get install haskell-modeEmacs設定ファイル .emacs に以下を追加。…

nkf を使った 改行コード・文字コードの確認・変換方法

文字コードと改行コード | UNIX & Linux コマンド・シェルスクリプト リファレンス 使用されている改行コードを調べる 以下を実行。 file textfile 実行結果。 $ file lf.txt lf.txt: ASCII text ※↑ファイルの改行コードは LF (UNIX / Linux 形式)。$ file c…

MaxSAT Problem(s)

SAT

MaxSAT Problem(s) MaxSAT: All clauses are soft Maximize number of satisfied soft clauses Minimize number of unsatisfied soft clauses Partial MaxSAT: Hard clauses must be satisfied Minimize number of unsatisfied soft clauses Weighted MaxSAT…

How to encode a partial MaxSAT problem to PBO(Pseudo Boolean Optimization)

SAT

Example. Consider the following weighted partial MaxSAT instance. \phi_h = { (x1 ∨ x 2 ∨ ~x3 ),(~x2 ∨ x3 ),(~x1 ∨ x3 )} \phi_s = { (~x3 ,6),(x1 ∨ x2 ,3),(x1 ∨ x3 ,2)} (2) According to the described encoding, the corresponding PBO instance …

Categories of MAXSAT

MAXSAT (ms) (standard MAXSAT ): no hard clauses and all clause have weight 1. Solution maximizes the number of satisfied clauses. Weighted MAXSAT (wms): no hard clauses. Partial MAXSAT (pms): have hard clauses but all soft clauses have wei…

how to make escape sequence in haskell regular expression

How to escape characters in Haskell's Text.Regex library? - Stack Overflow > matchRegex (mkRegex "[*]") "*" Just [] which works, but it seems like a hack, especially if I want to escape several things in a row (e.g. mkRegex "[[(][)]]" whic…

common bugs in writing

Common Bugs in WritingEditorial Rules

Git for Windows でレポジトリー上の CR LF を LF に変換する手順

git

git で add をすると以下のWarning がでた。 git warning: LF will be replaced by CRLF in 以下の情報が解決に役立った。Git for Windows でレポジトリー上の CR LF を LF に変換する手順 - てっく煮ブログ

cygwin で .bashrc 反映されない件とその解決法

~/.bash_profile に以下を記載すると反映されるようになった。 if [ -e ~/.bashrc ] ; then source ~/.bashrc fi より詳しくは、以下を参考にした。 cygwin bashrc エイリアスがうまくできない 【OKWAVE】 Cygwin Bash Shellアイコンをダブルクリックすると…

チュートリアル1 ブランチを使ってみよう! 6. マージでの衝突を解決する

git

サルでもわかるGit入門〜バージョン管理を使いこなそう〜【プロジェクト管理ツールBacklog】

15. Cancel Staged changes (before committing)

git

http://githowto.com/undoing_staged_changes

WindowsやMacなど様々なOSからGitを使うときの改行コードの扱い

git

http://tech-tec.com/archives/107http://tech-tec.com/archives/107 結論を先に今回は込み入った説明にもなるので先に結論を言ってしまいます。 Windowsではgit config –global core.autocrlf true MacやLinuxではgit config –global core.autocrlf inputと…

Lists all the files being tracked by your git repo.

git

lists all the files being tracked by your git repo. git ls-tree --full-tree -r HEAD

gitのリモートリポジトリの更新を確認する

gitのリモートリポジトリの更新を確認する - Qiita方法1の後、pull するとローカルに反映される。 gitのリモートリポジトリが更新されているかどうかを確認する方法はいくつかあります。方法1: git fetch 後にdiffをとる $ git fetch origin $ git diff orig…

Open Source Initiative for Automotive Software Development Tools

Open Source Initiative for Automotive Software Development Tools http://wiki.eclipse.org/Auto_IWG#Objectives ObjectivesInnovation in the automotive industry is mostly achieved by electronics and software functions. The system automobile is…

cbmc

CBMC(C Bounded Model Checker) を試した。windows+cygwin では、うまくできなかった。Parsing のエラーが出た。Ubuntu ではすぐにできた。以下にインストールメモを残す。まずは、インストール。 > apt-get install cbmc 例として、以下のファイル file1.c …

Automated Test Generation using CBMC (Bounded Model Checking for C programs) to reach full Modified Condition/Decision Coverage.

Synatx of actitivey diagram

http://www.claudiodesio.com/ooa&d/UMLSR_EN/DSR/ACTD.htm @startuml start :ClickServlet.handleRequest(); :new page; if (Page.onSecurityCheck) then (true) :Page.onInit(); if (isForward?) then (no) :Process controls; if (continue processing?) …

Eliciting security requirements with misuse cases

Another possibility is to align misuse cases with traditional fault-tree analysis methods from the safety area, such as threat trees [49] or attack trees [50, 51]. Adapted for security analysis, these trees would decompose security threats…

Coherency of fault trees; Coherent and non-coherent fault trees

Fault trees are classified according to their logic function. If during fault tree construction only AND gates and OR gates are used, the resulting fault tree is defined as coherent. If NOT logic is used or directly implied, the resulting …

Minimal Cut Sets

Minimal Cut Sets Traditional solution of reliability block diagrams and fault trees involves the determination of the so-called minimal cut sets. Cut sets are the unique combinations of component failures that can cause system failure. Spe…

同時にに変数の値を変える nusmv コード

同時にに変数の値を変える nusmv コード MODULE main VAR var1 : boolean; var2 : boolean; ASSIGN init(var1) := TRUE; next(var1) := case TRUE : {TRUE, FALSE}; esac; init(var2) := TRUE; next(var2) := case TRUE : {TRUE, FALSE}; esac;実行例 NuSMV …