Go functions often return os.Error objects, which include a String() method. This allows the caller to check for an error condition as follows:
特徴statically typed でも型推論や自動的に satisfy される interface のお蔭でお手軽に書けるのが素晴らしい。concurrent language goroutine という軽量プロセスとチャネルベースの通信。CSP といや分かる人はわかるね。 複数 CPU 使うのも runtime.GOMAXPROCS() を呼び出すだけというお手軽さ。GC 当然基本的にスタティックリンク ランタイム内包なので動かすの楽defer RAII や with みたいなことが構文的にとても簡単に書けるようになっている。アンチ例外 panic で基本死ぬようになっている。色々な型の例外を飛ばすというのは、仕様の面で難しいので採用しなかったんだろう。 後発言語の潔さ・割り切り感があっていい。言語仕様がコンパクト オブジェクト指向回りは複雑なことはしないが、十分に強力。ある程度豊富
ないだろうと思いながらぐぐってみたら、 shUnit2 is a xUnit unit test framework for Bourne based shell scripts, and it is designed to work in a similar manner to JUnit, PyUnit, etc. If you have ever had the desire to write a unit test for a shell script, shUnit2 can do the job. Google Code Archive - Long-term storage for Google Code Project Hosting. あるじゃないか! とりあえず、動かしてみよ。 shunit2 をダウンロードして解凍して、 $ mkdir -p ~/Documents/
シェルスクリプトのユニットテストフレームワーク "shUnit2" を使ってみた - ablog のつづき。 実際に自分で作った bash スクリプトのユニットテストを実行してみた。 最初のディレクトリ構成はこんなの。 $ su - oracle $ cd /home/oracle/scripts $ tree -pfug . |-- [-rwxr-xr-x oracle oinstall] ./stop_listener.sh <-- テストしたいスクリプト `-- [drwxr-xr-x oracle oinstall] ./test 1 directory, 1 file stop_listener.sh のソースコードはこんなの。 #!/bin/bash if [ "$1" != 'exec' ]; then echo "usage: ${BASE_NAME} exec" exit
Eliminate bugs and weeds from shell scripts Auxiliary README, INSTALLING, COPYING, AUTHORS Manuals roundup(1) Eliminate bugs and weeds from shell scripts roundup(5) Test plan conventions, helpers, and technique Annotated Source roundup roundup(5) test roundup(1) test Edge case tests See Also Contest Copyright © 2010 Blake Mizerany
One of the most powerful aspects of popular high-level languages is the existence of a comprehensive standard library. Unfortunately, the most popular Linux shell, bash, lacks a full-featured library bundled with it. A number of people have written libraries to compensate for this lack, which can make your life infinitely easier if you need to write complex bash scripts. Here are links to all the
6 Dec, 2010 In the course of my current project, I've been writing a bunch of command-line utilities. While they're just Ruby scripts, much of their work is interacting with the user: accepting command-line options and arguments, and providing useful feedback in case of errors. So, I wrote a little framework to make it easier. It's called Clamp. Clamp models a command as a Ruby class, and a comman
ちょっとシェルスクリプトを書く機会があったので、ユニットテストできるかなーと思って調べてみたのでメモ。 こんなんがあった。 Google Code Archive - Long-term storage for Google Code Project Hosting. ダウンロードして解凍 $ wget http://shunit2.googlecode.com/files/shunit2-2.1.5.tgz $ tar zxvf shunit2-2.1.5.tgz サンプル実行 $ cd shunit2-2.1.5 $ ls Makefile doc lib src bin examples share $ cd examples/ $ ls equality_test.sh math.inc mkdir_test.sh lineno_test.sh math_test.sh party
まぁ、不慮の例外といいますか、突然飛んでくる例外というのはいろいろあるわけで。 そりゃ、例外なんて名前がついているから、例外的に突然飛んでくるのは当たり前だろうとこともありますね。 では、この例外をだれが投げたかを C++ で追跡することはできるのでしょうか。 _ □□ _ ___、、、 //_ [][]// ,,-―''':::::::::::::::ヽヾヽ':::::/、 誰 投 こ // \\ // /::::::::::::::::::::::::::::::i l | l i:::::::ミ だ げ の  ̄  ̄  ̄/ /:::::::::,,,-‐,/i/`''' ̄ ̄ ̄ `i::;| あ た 例 ―`―--^--、__ /:::::::::=ソ / ヽ、 / ,,|/ っ の 外 /f ),f
カーネル/VM Advent Calendar の記事です。 それは、小さなメモリチップの中で繰り広げられる電脳戦のお話。 ひと足早いなのは完売(じょうほうせん)を楽しみましょう。 特定の処理の中に、自分の任意の処理を挟む行為をフックと呼びますが、フックから自分のプロセスを守りぬく方法はあるのでしょうか? windows環境でのanti hookのお話をします。 DLL Injection Hook windowsではさまざまなフック形式を用いることができます。 ほとんどのフックにおいて、最終的には自分のフック用DLLを相手のプロセスに叩きこんで、そこを橋頭堡として、フックを行います。 これはOSのプロセスのメモリ保護をかいくぐるのにフックDLLが便利だからです。 (ついでに8086のジャンプが相対アドレスってゆーのもありそうですがね。) これらのフックは、DLLを対象プロセスに挿入するの
iPhoneアプリの良いアイデアが出たので、これから作り始めようというところである。 さて、iPhoneアプリ開発童貞ってわけではないが、今までただ闇雲に作っていた感があるので、 実際にXcodeを起動してコードを書き始める前の設計をどうしていこうかと考えている。 ソフトウェアの作成はじめてではもちろん無いのでだいたい勝手は分かるものの、 iPhone特有の設計思考が必要な気がして、文献を漁っている。 ところが、世に出回っているiPhoneアプリ本にはUIKitをいじくるだけの解説ばかりではないか! で、つまるところ設計について有益だと思えたのは以下3つの文献だった。 「iOSアプリケーションプログラミングガイド」Appleのサイトからダウンロードできる 「iPhoneアプリ設計の極意 - 思わずタップしたくなるアプリのデザイン」のfladdictさんの章 「iOS開発におけるパターンによ
Nov 28, 2017 iOS 11 ProgrammingでCore MLについて書きました. Sep 27, 2017 High Sierraのインストール問題 Sep 20, 2017 HTMLSpecialCharactersの内部実装の速度について Sep 18, 2017 iOSDC2017 Jun 30, 2017 iOS11 Programming - CoreML Mar 28, 2017 try swift 2017 感想 Nov 17, 2016 質問の大切さ,おもしろさ Apr 25, 2016 Let's Encryptを疑え!信用はお金で買え! Apr 14, 2016 imgurで画像アップロードできないので怒った Jan 26, 2016 ガチエンジニアがお勧めする科学絵本シリーズ〜よーするに医学絵本シリーズ Jan 26, 2016 ガチエンジニアがお勧
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く