トップ 最新 追記

ヨタの日々

2001|08|09|10|11|12|
2002|01|02|03|04|05|06|07|08|09|10|11|12|
2003|01|02|03|04|05|06|07|08|09|10|11|12|
2004|01|02|03|04|05|06|07|08|09|10|11|12|
2005|01|02|03|04|05|06|07|08|09|10|11|12|
2006|01|02|03|04|05|06|07|08|09|10|11|12|
2007|01|02|03|04|05|06|07|08|09|10|11|12|
2008|01|02|03|04|05|06|07|08|09|10|11|12|
2009|01|02|03|04|05|06|07|08|09|10|11|12|
2010|01|02|03|04|05|06|07|08|09|10|11|12|
2011|01|02|03|04|05|06|07|08|09|10|11|12|
2012|01|02|03|04|05|06|07|08|09|10|11|12|
2013|01|02|03|04|05|06|07|08|09|10|11|12|
2014|01|02|03|04|05|06|07|08|09|10|11|12|
2015|01|02|03|04|05|06|07|08|09|10|11|12|
2016|01|02|03|04|05|06|07|08|09|10|11|12|
2017|01|02|03|04|05|06|07|08|09|10|11|12|
2018|01|02|03|04|05|06|07|08|09|10|11|12|
2019|01|02|03|04|05|06|07|08|09|10|11|12|
2020|01|02|03|04|05|06|07|08|09|10|11|12|
2021|01|02|03|04|05|06|07|08|09|10|11|12|
2022|01|02|03|04|05|06|07|08|09|10|11|12|
2023|01|02|03|04|05|06|07|08|12|
2024|01|02|03|

2012-06-01 :-(

_ 読書メーター

5月の読書メーター
読んだ本の数:15冊
読んだページ数:2742ページ
ナイス数:8ナイス

シングルモルト「超」入門シングルモルト「超」入門
おもなウィスキーの紹介と世界の蒸留所探訪
読了日:05月31日 著者:土屋 守
日本酒入門 蔵元を訪れ美食を楽しむ (地球の歩き方GEM STONE)日本酒入門 蔵元を訪れ美食を楽しむ (地球の歩き方GEM STONE)
日本酒の製造工程の紹介や全国の蔵など
読了日:05月31日 著者:寺田 好文
発酵は力なり―食と人類の知恵 (NHKライブラリー)発酵は力なり―食と人類の知恵 (NHKライブラリー)
醸すぞー / 発酵を利用した食べ物とその文化の紹介 / ちょっと甘酒買ってくるわ
読了日:05月29日 著者:小泉 武夫
放送技術80年のドラマ ラジオ、白黒TV、そして地上波デジタル放送へ放送技術80年のドラマ ラジオ、白黒TV、そして地上波デジタル放送へ
ラジオから始まり現在のテレビまでの歴史
読了日:05月29日 著者:村瀬 孝矢,林 正儀
史上最強カラー図解 プロが教える船のすべてがわかる本史上最強カラー図解 プロが教える船のすべてがわかる本
船の組み立てから運用まで
読了日:05月24日 著者:
花王の「日々工夫」する仕事術花王の「日々工夫」する仕事術
「コラム」に愚痴が集まっており面白い。どこも大企業病はあるのだなあ
読了日:05月23日 著者:高井 尚之
日本の香り (コロナ・ブックス)日本の香り (コロナ・ブックス)
太古からある香りの歴史。動物の分泌物が割りと人気があるらしく
読了日:05月22日 著者:
新ハイスピード・ドライビング新ハイスピード・ドライビング
GT5とか超速いひとからオススメされた本。自動車にかかる力について物理的に説明している。GT5初回特典を読み終えたら次に読むとよい。第9章「レーシングドライバーになるには」はレーシングドライバーの心がけについて説明されている。熱い。
読了日:05月15日 著者:ポール フレール
ヨーロッパ古城物語 (「知の再発見」双書)ヨーロッパ古城物語 (「知の再発見」双書)
10世紀~13世紀あたりの城の歴史。当初は領主の権力の象徴というだけだったものが要塞化していくなどいろいろ。巻末の「資料編」が地味に熱い / 図がたくさんあるのはいいんだがなんなのだこの配置は。読みづらい。
読了日:05月14日 著者:ジャン メスキ
お屋敷散歩 (らんぷの本)お屋敷散歩 (らんぷの本)
和風、洋風のいくつかの屋敷について歴史を紹介。和風はうなぎ屋、洋風は喫茶店という感じがするけどそういう店の中には屋敷を利用したものがいくつもあるのだろう。
読了日:05月14日 著者:内田 青蔵
鎌倉の西洋館 昭和モダン建築をめぐる鎌倉の西洋館 昭和モダン建築をめぐる
本のタイトルそのままなんだが、大正辺りで建てられた鎌倉の邸宅の写真集。住みたい (*´Д`)
読了日:05月12日 著者:柴田 泉
明治の皇室建築―国家が求めた“和風”像 (歴史文化ライブラリー)明治の皇室建築―国家が求めた“和風”像 (歴史文化ライブラリー)
和風とは何か、洋風とは何か。明治からの皇室関連の建物の造りとその造られた背景をひもとき、皇室が考えた「天皇をどう見せるか」と、庶民が考えた「天皇をどう見たいか」という視点の違いからくる建物の造りの違いなどを観察し、和風の文化と洋風の文化を解説している。手軽にとった本なんだが資料集といえるんではないか
読了日:05月08日 著者:小沢 朝江
<イラスト図解>工場のしくみ<イラスト図解>工場のしくみ
工場の生産ラインだけでなく、生産管理や原価管理など工場に関わる仕事について広く説明してる。
読了日:05月06日 著者:松林 光男,渡部 弘
カラー版徹底図解 旅客機が飛ぶしくみカラー版徹底図解 旅客機が飛ぶしくみ
航空機の運用に関わるひとびとと機材(DMEやILSなど)について離陸前から着陸後まで順に追って説明している。航空管制(;゚∀゚)=3ハァハァ
読了日:05月05日 著者:
実装パターン実装パターン
うーん。デザインパターンに限らずコード書くときの定石集。割りと抽象的に書いてあるのでコードがもっと欲しかった。
読了日:05月01日 著者:ケント・ベック,Kent Beck

2012年5月の読書メーターまとめ詳細
読書メーター

_ 午前

0520 起床

0830 出勤

0900 検討

_ 午後

1300 検討

1730 退勤

_

1900 pkgsrcほげ

2100 飯

_ 検索バーの管理

Chromeの検索エンジンにUNIXのman検索を追加した - Glide Note - グライドノート

割りと普通だと思ってたんだがところで私の Firefox の検索バーはこのようになっている。

s00.png

_ GitでHTTPプロキシ越しにcloneする

ref. GitでHTTPプロキシ越しにcloneする。 - 設計と実装の狭間で。

http proxy 内で github から clone しようとするとエラーになった。

% git clone https://github.com/tdiary/tdiary-blogkit.git
Cloning into 'tdiary-blogkit'...
error: Couldn't resolve host 'github.com' while accessing https://github.com/tdiary/tdiary-blogkit.git/info/refs
fatal: HTTP request failed

環境変数 HTTP_PROXY は設定している。

export HTTP_PROXY=http://USER:PASS@proxy.example.net:8080

んだが、どうも git の場合は環境変数 HTTP_PROXY を見ない? らしい? ような? 知らね分かんね。

config の http.proxy を設定すればいいらしい。

% git config --global http.proxy http://USER:PASS@proxy.example.net:8080

わあい clone できたよー

% git clone https://github.com/tdiary/tdiary-blogkit.git
Cloning into 'tdiary-blogkit'...
remote: Counting objects: 933, done.
remote: Compressing objects: 100% (201/201), done.
remote: Total 933 (delta 748), reused 893 (delta 715)
Receiving objects: 100% (933/933), 136.25 KiB | 114 KiB/s, done.
Resolving deltas: 100% (748/748), done.

.gitconfig にはこれが追加された。

[http]
	proxy = http://USER:PASS@proxy.example.net:8080

_ /usr/pkgsrc で ls するとターミナルが落ちる

  • Dell Inspiron
  • NetBSD 6.99.6
  • cvs で取得した pkgsrc

↓では cd doc したあとに ls してるんだがその瞬間に screen のウィンドウが 1 つ死ぬ。分からん。


2012-06-02 :-)

_ 午前

0930 起床 || 部屋掃除

1130 おひる

_ 午後

1330 生田緑地ばら苑

1600 買い物

_

1700 アニメ消化

2100 飯

_ 生田緑地ばら苑

行ってきた。

向ヶ丘遊園跡地の階段が懐かしい。

IMG_0141

プリンセス サヤコ: 花名はフランス大統領ミッテラン氏が来日した際に紀宮清子内親王に謹呈した事による

IMG_0163

IMG_0159

プリンセス ミチコ

IMG_0164

IMG_0166


2012-06-03 :-)

_ 午前

0700 起床 || 走る

0830 プリキュア

1030 おひる

_ 午後

1200 NetBSDほげ

1600 散歩

アジサイ

IMG_0217

IMG_0221

_

1900 寝る

2100 飯

2200 探索ほげ

_ ふぁぼったー

50 fav (>'A`)>

f00.png

_ [アルゴリズム][ディジタル探索]アルゴリズム辞典 - ディジタル探索 (C実装)

/* -------------------------------------------------------------------------
 *  アルゴリズム辞典
 *  島内剛一 野下浩平 伏見正則 有沢誠 浜田穂積
 *
 *  ディジタル探索 pp. 522-523
 * ---------------------------------------------------------------------- */


#include <stdio.h>
#include <stdlib.h>

typedef struct node
{
  char key;
  struct node* right;
  struct node* left;
} node;

static node head = { 0x0, NULL, NULL };
static char mask[9] = { 0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 };

// 探索
node* search ( char key )
{
    node* np;
    int idx;
    idx = 0;
    np = head.left;
    // キーの idx 行が 1(0) ならば右(左)へ
    while( np != NULL && key != np->key )
    {
      np = ( key & mask[ ++idx ] ) ? np->right : np->left;
    }

    return np;
}


// 挿入
void insert( char key )
{
  node *np, *father = &head;
  int idx;

  // ステップ1 キーの探索
  idx = 0;
  np = father->left;
  while( np != NULL && key != np->key )
  {
    father = np;
    np = ( key & mask[ ++idx ] ) ? np->right : np->left;
  }

  // ステップ2 キー挿入
  if( np != NULL )
    printf( "%c はすでにある\n", key );
  else
  {
    // 新しい節を作り
    np = calloc( 1, sizeof( node ));

    // キーを置き親とつなぐ
    np->key = key;
    np->right = np->left = NULL;

    if( key & mask[ idx ] )
      father->right = np;
    else
      father->left = np;
  }

  return;

}


// 削除
void delete ( char key )
{
  node *np, *father = &head, *x;
  int idx;

  // ステップ1 キーの探索
  idx = 0;
  np = head.left;
  while( np != NULL && key != np->key )
  {
    father = np;
    np = ( key & mask[ ++idx ] ) ? np->right : np->left;
  }


  // ステップ2 キー削除
  if( np == NULL )
  {
    printf( "%c はない\n", key );
    return;
  }

  // np の子孫中の葉を探す
  x = np;
  while( x->left != NULL || x->right != NULL )
  {
    father = x;
    idx++;
    x = ( x->left == NULL ) ? x->right : x->left;
  }

  // 葉のキーを np に置き、葉を切り離す
  np->key = x->key;
  if( x->key & mask[ idx ] )
    father->right = NULL;
  else
    father->left = NULL;

  return;
}


int main( int ac, char** av )
{
  node *np;

  insert( 'a' );
  insert( 'b' );
  insert( 'c' );
  insert( 'd' );

  np = search( 'a' );
  if( np != NULL )
    printf( "key hit: %c\n", np->key );


  np = search( 'a' );
  if( np != NULL )
    printf( "key hit: %c\n", np->key );

  np = search( 'b' );
  if( np != NULL )
    printf( "key hit: %c\n", np->key );

  delete( 'b' );
  printf( "delete key: %c\n", 'b' );

  np = search( 'a' );
  if( np != NULL )
    printf( "key hit: %c\n", np->key );

  np = search( 'b' );
  if( np != NULL )
    printf( "key hit: %c\n", np->key );

  delete( 'a' );
  printf( "delete key: %c\n", 'a' );

  np = search( 'a' );
  if( np != NULL )
    printf( "key hit: %c\n", np->key );

  return;
}
% ./a.exe
key hit: a
key hit: a
key hit: b
delete key: b
key hit: a
delete key: a

4320027094

_ [アルゴリズム][ディジタル探索]アルゴリズム辞典 - ディジタル探索 (ruby実装)

# アルゴリズム辞典
# 島内剛一 野下浩平 伏見正則 有沢誠 浜田穂積
#
# ディジタル探索 pp. 522-523

require 'pp'

class Node
  attr_accessor :key, :left, :right

  def initialize(key, left, right)
    @key = key
    @left = left
    @right = right
  end
end

class DigitalSearch
  def initialize()
    @head = Node.new(0, nil, nil)
    @mask = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80]
  end

  # 探索
  def search(key)
    idx = 0
    np = @head.left

    while np != nil && key != np.key
      # キーの idx 桁が 1(0) ならば右(左)へ
      idx += 1
      np = (key[0] & @mask[idx] != 0) ? np.right : np.left
    end

    return np

  end

  # 挿入
  def insert(key)
    father = @head
    idx = 0

    # ステップ1 キーの探索
    np = father.left
    while np != nil && key != np.key
      father = np
      idx += 1
      np = (key[0] & @mask[idx] != 0) ? np.right : np.left
    end

    # ステップ2 キー挿入
    if np != nil
      puts "#{key} はすでにある"
    else
      # 新しい節を作り
      np = Node.new(key, nil, nil)
      # キーを置き親とつなぐ
      if key[0] & @mask[idx] != 0
        father.right = np
      else
        father.left = np
      end
    end

  end

  # 削除
  def delete(key)

    # ステップ1 キーの探索
    idx = 0
    np = @head.left
    while np != nil && key != np.key
      father = np
      idx += 1
      np = (key[0] & @mask[idx] != 0) ? np.right : np.left
    end


    # ステップ2 キー削除
    if np == nil
      puts "#{key} はない"
      return
    end

    # np の子孫中の葉を探す
    x = np
    while x.left != nil || x.right != nil
      father = x
      idx += 1
      x = x.left == nil ? x.right : x.left
    end

    # 葉のキーを np に置き、葉を切り離す
    np.key = x.key
    if x.key[0] & @mask[idx] != 0
      father.right = nil
    else
      father.left = nil
    end
  end
end


def main()
  digi = DigitalSearch.new()
  digi.insert('a')
  digi.insert('b')
  digi.insert('c')
  digi.insert('d')

  np = digi.search('a')
  if np != nil
    puts "key hit: #{np.key}"
  end

  np = digi.search('a')
  if np != nil
    puts "key hit: #{np.key}"
  end

  np = digi.search('b')
  if np != nil
    puts "key hit: #{np.key}"
  end

  np = digi.search('c')
  if np != nil
    puts "key hit: #{np.key}"
  end

  np = digi.search('d')
  if np != nil
    puts "key hit: #{np.key}"
  end

  digi.delete('b')
  puts "delete key: b"

  np = digi.search('a')
  if np != nil
    puts "key hit: #{np.key}"
  end

  np = digi.search('b')
  if np != nil
    puts "key hit: #{np.key}"
  end

  digi.delete('a');
  puts "delete key: a"

  np = digi.search('a')
  if np != nil
    puts "key hit: #{np.key}"
  end

end


main()
% ruby digi.rb
key hit: a
key hit: a
key hit: b
key hit: c
key hit: d
delete key: b
key hit: a
delete key: a

if 0 がなぜ真になるのだ! と 30 分くらい悩んで ruby だということを思い出した。

制御構造

Ruby では false または nil だけが偽で、それ以外は 0 や空文字列も含め全て真です。

4320027094


2012-06-04 :-(

_ 午前

0520 起床

0830 出勤

0900 検討

_ 午後

1300 検討

1700 残業アワー

_

1940 退勤 || 3 歩進んで 2 歩下がる

2130 飯。ブリの照り焼き


2012-06-05 :-(

_ 午前

0520 起床

0830 出勤

0900 検討

_ 午後

1300 検討

1700 残業アワー

_

2020 退勤 || 3 歩進んで 4 歩下がる

2150 飯


2012-06-06 :-(

_ 午前

0520 起床

0830 出勤

0900 検討

_ 午後

1300 検討

1700 退勤

_

1800 飯

_ 鉄人部 慰労会

沖縄地料理 波照間 ラゾーナ川崎

仕事場のひとたちが派遣終了するので送別の意味で宴会。

IMG_0001.jpg

夜なのにランチ

IMG_0003.jpg

IMG_0004.jpg

IMG_0005.jpg

IMG_0006.jpg

IMG_0007.jpg

IMG_0008.jpg

IMG_0009.jpg

IMG_0010.jpg

IMG_0011.jpg

IMG_0012.jpg

IMG_0013.jpg

IMG_0014.jpg

IMG_0015.jpg

IMG_0016.jpg

IMG_0017.jpg


2012-06-07 :-(

_ 午前

0520 起床

0830 出勤

0900 検討

_ 午後

1300 検討

1700 残業アワー

_

1840 退勤

2030 飯。チンジャオロース

_ [BitNami Redmine][Backlogs]BitNami Redmine と Backlogs 入れてみた

環境

BitNami Redmine

Redmine 1.4.2-1 を使う。

BitNami Redmine からダウンロードして実行すれば ok

Backlogs

Redmine Backlogs :: Installation の手順どおり。なのだがいろいろトラブル。

BitNami RedmineとBacklogsをインストールしてみたよ! - うさぎ組

BitNamiでインストールしたruby/binパス上でgem installしないと、他のRubyのgem installが実行されてRedmineに反映されない。Redmineで使用するRubyで実行すること。

ということで C:\Redmine\use_redmine.bat を実行。コマンドプロンプトが起動する。

C:\Redmine\apps\redmine\vendor\plugins\redmine_backlogs へ移動。

HTTP プロキシ内ならば環境変数を設定しておく( Windows の環境変数 )

> set HTTP_PROXY=http://USER:PASS@proxy.example.net:8080

RAILS_ENV 設定する。

> set RAILS_ENV=production

bundle install する。Development Kit をインストールしろと言われた。

> bundle install
Updating https://github.com/Vanuan/cucumber-rails.git
Fetching source index for http://rubygems.org/
Using Ascii85 (1.0.1)
Using holidays (1.0.3)
Using icalendar (1.1.6)
Installing json (1.7.3)
Gem::InstallError: The 'json' native gem requires installed build tools.

Please update your PATH to include build tools or download the DevKit
from 'http://rubyinstaller.org/downloads' and follow the instructions
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'
An error occured while installing json (1.7.3), and Bundler cannot continue.
Make sure that `gem install json -v '1.7.3'` succeeds before bundling.
Development Kit

ということで Development Kit をインストールする。

Development Kit · oneclick/rubyinstaller Wiki の手順どおり。

Development Kit をダウンロードし、自己展開形式なので .exe を実行する。書庫名などのフォルダを作っておいて、その中に展開しないとファイルが散らかることになる。

C:\Redmine\use_redmine.bat を実行したときのコマンドプロンプトをそのまま使う。DevKit は C:\Redmine の ruby 環境にインストールしないといけないんだが、ruby が複数インストールしてある環境の場合( cygwin とかいろいろ入れてあるとか )はちゃんと PATH を適切に設定しておかないと DevKit が C:\Redmine の ruby 環境にインストールされない。

C:\Redmine\scripts\setenv.bat ( C:\Redmine\use_redmine.bat から呼ばれる。ここで環境変数を設定している )を実行したうえで devkitvars.bat を実行しておく。

init する

> ruby dk.rb init

config.yml が生成されるけど中身が空っぽなので追記。

  - C:/Redmine/ruby

インストール

> ruby dk.rb install

再度 Backlogs

上で起動したコマンドプロンプトのまま C:\Redmine\apps\redmine へ移動

> set RAILS_ENV=production
> bundle exec rake db:migrate

gem が不足していると bundle install しろと言われるので実行しておく。

> bundle install

再度

> bundle exec rake db:migrate

redmine

redmine 再起動

> C:\Redmine\servicerun.bat STOP
> C:\Redmine\servicerun.bat START

バックログ

BitNami RedmineとBacklogsをインストールしてみたよ! - うさぎ組 をコピペ

9.プロジェクトを新規作成する。モジュールでBacklogsのチェックボックスをオンにする。

http://localhost/redmine/projects/new

10.プロジェクトのバージョンを設定する(Backlogsのスプリントになる)

http://localhost/redmine/projects/sample/settings

11.BacklogsのMasterBacklogsでストーリーを追加する。

http://localhost/redmine/rb/master_backlogs/sample

12.Backlogsのタスクボードでストーリーに対するタスクを追加、更新する。

http://localhost/redmine/rb/taskboards/1

An error occured while installing json (1.7.3), and Bundler cannot continue

上記の bat の環境を作り C:\Redmine の ruby 環境にインストールしておかないと DevKit が意図しないところにインストールされたことになるなどして以下のように怒られたりする。

> bundle install
Updating https://github.com/Vanuan/cucumber-rails.git
Fetching source index for http://rubygems.org/
Using Ascii85 (1.0.1)
Using holidays (1.0.3)
Using icalendar (1.1.6)
Installing json (1.7.3) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        C:/Redmine/ruby/bin/ruby.exe extconf.rb
creating Makefile

make
Makefile:121: *** target pattern contains no `%'.  Stop.


Gem files will remain installed in C:/Redmine/ruby/lib/ruby/gems/1.8/gems/json-1.7.3 for inspection.
Results logged to C:/Redmine/ruby/lib/ruby/gems/1.8/gems/json-1.7.3/ext/json/ext/parser/gem_make.out
An error occured while installing json (1.7.3), and Bundler cannot continue.
Make sure that `gem install json -v '1.7.3'` succeeds before bundling.

2012-06-08 :-(

_ 午前

0520 起床

0830 出勤

0900 検討

_ 午後

1300 検討

1700 退勤

_

1830 飯

_ ナカタカ

送別会らしきもの。予約せずに行って 1F の席に着席したんだが 2F の席がしばらく空いているということで 2F に通してもらった。ありがたやー

泉家 川崎

IMG_0020.jpg

IMG_0021.jpg

IMG_0023.jpg

IMG_0025.jpg

IMG_0026.jpg

_ 買い物

amazon

B006ZTJOVQ


2012-06-09 :-)

_ 午前

1030 起床 || 部屋掃除

_ 午後

1230 おひる

1300 アニメ消化

_

1700 買い物

2100 飯


2012-06-10 :-)

_ 午前

0800 起床

1030 おひる

1200 読書

_ 午後

1400 納車

_

1800 動画編集

2100 飯。パエリア

_ [mazda][AXELA][マツダ][アクセラ]You've Got a New Machine

_ ,

モザイクがダサいとか微妙に写り込んでるとか Windows ムービーメーカーのテンプレのままだとか言わない。

本日のツッコミ(全5件) [ツッコミを入れる]

_ youichi [とりあえず現実路線でこのあたりはどうでしょう? http://www.akibaoo.com/02/commodit..]

_ みわ [もう乗られてるのか (>'A`)>]

_ エモエモ [突っ込みどころ多い件(´-ω-)]

_ Fryght [思わず吹いてしまった]

_ みわ [(´・ω・`)]


2012-06-11 :-(

_ 午前

0520 起床

0830 出勤

0900 検討

_ 午後

1300 検討

1700 残業アワー || 定時近くに作業すると事故るというジンクスは生きていた || ていうか脳が働かない || die

_

1900 退勤

2100 飯。鮭のムニエル


2012-06-12 :-(

_ 午前

0520 起床

0830 出勤

0900 検討

_ 午後

1300 検討

1700 残業アワー

_

2000 退勤

2130 飯。豚肉の生姜焼き

_ [C][ポインタ]プログラム初心者にC言語のポインタを不本意ながら教える羽目になったなら、こう教えると良いよ - 驟雨のカーネル探検隊(只今遭難中w

Just read objdump -d -S ./a.out.

Or die.

enviroment

  • cygwin
  • gcc (GCC) 4.5.3
  • GNU objdump (GNU Binutils) 2.22.52.20120326

code

#include <stdio.h>

int main(int ac, char** av )
{
  puts("おれは人間をやめるぞ!ジョジョーーーーッ!! ");
  return 0;
}

build

% gcc hello.c

disassemble

% objdump -d -S ./a.exe
./a.exe:     file format pei-i386


Disassembly of section .text:

00401000 <_WinMainCRTStartup>:
  401000:	55                   	push   %ebp
  401001:	89 e5                	mov    %esp,%ebp
  401003:	83 ec 18             	sub    $0x18,%esp
  401006:	83 e4 f0             	and    $0xfffffff0,%esp
  401009:	c7 04 24 70 11 40 00 	movl   $0x401170,(%esp)
  401010:	e8 8b 01 00 00       	call   4011a0 <_cygwin_crt0>
  401015:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  40101c:	00
  40101d:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  401024:	00
  401025:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  40102c:	e8 9f 01 00 00       	call   4011d0 <_cygwin_premain0>
  401031:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  401038:	00
  401039:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  401040:	00
  401041:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  401048:	e8 93 01 00 00       	call   4011e0 <_cygwin_premain1>
  40104d:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  401054:	00
  401055:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  40105c:	00
  40105d:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  401064:	e8 87 01 00 00       	call   4011f0 <_cygwin_premain2>
  401069:	c7 44 24 08 00 00 00 	movl   $0x0,0x8(%esp)
  401070:	00
  401071:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  401078:	00
  401079:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  401080:	e8 7b 01 00 00       	call   401200 <_cygwin_premain3>
  401085:	c9                   	leave
  401086:	c3                   	ret
  401087:	90                   	nop
  401088:	90                   	nop
  401089:	90                   	nop
  40108a:	90                   	nop
  40108b:	90                   	nop
  40108c:	90                   	nop
  40108d:	90                   	nop
  40108e:	90                   	nop
  40108f:	90                   	nop

00401090 <___gcc_register_frame>:
  401090:	55                   	push   %ebp
  401091:	89 e5                	mov    %esp,%ebp
  401093:	83 ec 18             	sub    $0x18,%esp
  401096:	c7 04 24 20 20 40 00 	movl   $0x402020,(%esp)
  40109d:	e8 56 06 00 00       	call   4016f8 <_GetModuleHandleA@4>
  4010a2:	89 c2                	mov    %eax,%edx
  4010a4:	83 ec 04             	sub    $0x4,%esp
  4010a7:	85 d2                	test   %edx,%edx
  4010a9:	b8 00 00 00 00       	mov    $0x0,%eax
  4010ae:	74 13                	je     4010c3 <___gcc_register_frame+0x33>
  4010b0:	c7 44 24 04 2f 20 40 	movl   $0x40202f,0x4(%esp)
  4010b7:	00
  4010b8:	89 14 24             	mov    %edx,(%esp)
  4010bb:	e8 40 06 00 00       	call   401700 <_GetProcAddress@8>
  4010c0:	83 ec 08             	sub    $0x8,%esp
  4010c3:	85 c0                	test   %eax,%eax
  4010c5:	74 11                	je     4010d8 <___gcc_register_frame+0x48>
  4010c7:	c7 44 24 04 00 40 40 	movl   $0x404000,0x4(%esp)
  4010ce:	00
  4010cf:	c7 04 24 00 30 40 00 	movl   $0x403000,(%esp)
  4010d6:	ff d0                	call   *%eax
  4010d8:	a1 b0 20 40 00       	mov    0x4020b0,%eax
  4010dd:	85 c0                	test   %eax,%eax
  4010df:	74 3a                	je     40111b <___gcc_register_frame+0x8b>
  4010e1:	c7 04 24 45 20 40 00 	movl   $0x402045,(%esp)
  4010e8:	e8 0b 06 00 00       	call   4016f8 <_GetModuleHandleA@4>
  4010ed:	89 c2                	mov    %eax,%edx
  4010ef:	83 ec 04             	sub    $0x4,%esp
  4010f2:	85 d2                	test   %edx,%edx
  4010f4:	b8 00 00 00 00       	mov    $0x0,%eax
  4010f9:	74 13                	je     40110e <___gcc_register_frame+0x7e>
  4010fb:	c7 44 24 04 53 20 40 	movl   $0x402053,0x4(%esp)
  401102:	00
  401103:	89 14 24             	mov    %edx,(%esp)
  401106:	e8 f5 05 00 00       	call   401700 <_GetProcAddress@8>
  40110b:	83 ec 08             	sub    $0x8,%esp
  40110e:	85 c0                	test   %eax,%eax
  401110:	74 09                	je     40111b <___gcc_register_frame+0x8b>
  401112:	c7 04 24 b0 20 40 00 	movl   $0x4020b0,(%esp)
  401119:	ff d0                	call   *%eax
  40111b:	c9                   	leave
  40111c:	c3                   	ret
  40111d:	8d 76 00             	lea    0x0(%esi),%esi

00401120 <___gcc_deregister_frame>:
  401120:	55                   	push   %ebp
  401121:	89 e5                	mov    %esp,%ebp
  401123:	83 ec 18             	sub    $0x18,%esp
  401126:	c7 04 24 20 20 40 00 	movl   $0x402020,(%esp)
  40112d:	e8 c6 05 00 00       	call   4016f8 <_GetModuleHandleA@4>
  401132:	89 c2                	mov    %eax,%edx
  401134:	83 ec 04             	sub    $0x4,%esp
  401137:	85 d2                	test   %edx,%edx
  401139:	b8 00 00 00 00       	mov    $0x0,%eax
  40113e:	74 13                	je     401153 <___gcc_deregister_frame+0x33>
  401140:	c7 44 24 04 67 20 40 	movl   $0x402067,0x4(%esp)
  401147:	00
  401148:	89 14 24             	mov    %edx,(%esp)
  40114b:	e8 b0 05 00 00       	call   401700 <_GetProcAddress@8>
  401150:	83 ec 08             	sub    $0x8,%esp
  401153:	85 c0                	test   %eax,%eax
  401155:	74 09                	je     401160 <___gcc_deregister_frame+0x40>
  401157:	c7 04 24 00 30 40 00 	movl   $0x403000,(%esp)
  40115e:	ff d0                	call   *%eax
  401160:	c9                   	leave
  401161:	c3                   	ret
  401162:	90                   	nop
  401163:	90                   	nop
  401164:	90                   	nop
  401165:	90                   	nop
  401166:	90                   	nop
  401167:	90                   	nop
  401168:	90                   	nop
  401169:	90                   	nop
  40116a:	90                   	nop
  40116b:	90                   	nop
  40116c:	90                   	nop
  40116d:	90                   	nop
  40116e:	90                   	nop
  40116f:	90                   	nop

00401170 <_main>:
  401170:	55                   	push   %ebp
  401171:	89 e5                	mov    %esp,%ebp
  401173:	83 e4 f0             	and    $0xfffffff0,%esp
  401176:	83 ec 10             	sub    $0x10,%esp
  401179:	e8 92 00 00 00       	call   401210 <___main>
  40117e:	c7 04 24 80 20 40 00 	movl   $0x402080,(%esp)
  401185:	e8 8e 00 00 00       	call   401218 <_puts>
  40118a:	b8 00 00 00 00       	mov    $0x0,%eax
  40118f:	c9                   	leave
  401190:	c3                   	ret
  401191:	90                   	nop
  401192:	90                   	nop
  401193:	90                   	nop
  401194:	66 90                	xchg   %ax,%ax
  401196:	66 90                	xchg   %ax,%ax
  401198:	66 90                	xchg   %ax,%ax
  40119a:	66 90                	xchg   %ax,%ax
  40119c:	66 90                	xchg   %ax,%ax
  40119e:	66 90                	xchg   %ax,%ax

004011a0 <_cygwin_crt0>:
  4011a0:	55                   	push   %ebp
  4011a1:	89 e5                	mov    %esp,%ebp
  4011a3:	83 ec 18             	sub    $0x18,%esp
  4011a6:	8b 45 08             	mov    0x8(%ebp),%eax
  4011a9:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  4011b0:	00
  4011b1:	89 04 24             	mov    %eax,(%esp)
  4011b4:	e8 67 00 00 00       	call   401220 <__cygwin_crt0_common@8>
  4011b9:	83 ec 08             	sub    $0x8,%esp
  4011bc:	ff 15 7c 50 40 00    	call   *0x40507c
  4011c2:	90                   	nop
  4011c3:	90                   	nop
  4011c4:	90                   	nop
  4011c5:	90                   	nop
  4011c6:	90                   	nop
  4011c7:	90                   	nop
  4011c8:	90                   	nop
  4011c9:	90                   	nop
  4011ca:	90                   	nop
  4011cb:	90                   	nop
  4011cc:	90                   	nop
  4011cd:	90                   	nop
  4011ce:	90                   	nop
  4011cf:	90                   	nop

004011d0 <_cygwin_premain0>:
  4011d0:	55                   	push   %ebp
  4011d1:	89 e5                	mov    %esp,%ebp
  4011d3:	5d                   	pop    %ebp
  4011d4:	c3                   	ret
  4011d5:	90                   	nop
  4011d6:	90                   	nop
  4011d7:	90                   	nop
  4011d8:	90                   	nop
  4011d9:	90                   	nop
  4011da:	90                   	nop
  4011db:	90                   	nop
  4011dc:	90                   	nop
  4011dd:	90                   	nop
  4011de:	90                   	nop
  4011df:	90                   	nop

004011e0 <_cygwin_premain1>:
  4011e0:	55                   	push   %ebp
  4011e1:	89 e5                	mov    %esp,%ebp
  4011e3:	5d                   	pop    %ebp
  4011e4:	c3                   	ret
  4011e5:	90                   	nop
  4011e6:	90                   	nop
  4011e7:	90                   	nop
  4011e8:	90                   	nop
  4011e9:	90                   	nop
  4011ea:	90                   	nop
  4011eb:	90                   	nop
  4011ec:	90                   	nop
  4011ed:	90                   	nop
  4011ee:	90                   	nop
  4011ef:	90                   	nop

004011f0 <_cygwin_premain2>:
  4011f0:	55                   	push   %ebp
  4011f1:	89 e5                	mov    %esp,%ebp
  4011f3:	5d                   	pop    %ebp
  4011f4:	c3                   	ret
  4011f5:	90                   	nop
  4011f6:	90                   	nop
  4011f7:	90                   	nop
  4011f8:	90                   	nop
  4011f9:	90                   	nop
  4011fa:	90                   	nop
  4011fb:	90                   	nop
  4011fc:	90                   	nop
  4011fd:	90                   	nop
  4011fe:	90                   	nop
  4011ff:	90                   	nop

00401200 <_cygwin_premain3>:
  401200:	55                   	push   %ebp
  401201:	89 e5                	mov    %esp,%ebp
  401203:	5d                   	pop    %ebp
  401204:	c3                   	ret
  401205:	90                   	nop
  401206:	90                   	nop
  401207:	90                   	nop
  401208:	90                   	nop
  401209:	90                   	nop
  40120a:	90                   	nop
  40120b:	90                   	nop
  40120c:	90                   	nop
  40120d:	90                   	nop
  40120e:	90                   	nop
  40120f:	90                   	nop

00401210 <___main>:
  401210:	ff 25 78 50 40 00    	jmp    *0x405078
  401216:	90                   	nop
  401217:	90                   	nop

00401218 <_puts>:
  401218:	ff 25 9c 50 40 00    	jmp    *0x40509c
  40121e:	90                   	nop
  40121f:	90                   	nop

00401220 <__cygwin_crt0_common@8>:
  401220:	55                   	push   %ebp
  401221:	89 e5                	mov    %esp,%ebp
  401223:	56                   	push   %esi
  401224:	53                   	push   %ebx
  401225:	83 ec 10             	sub    $0x10,%esp
  401228:	8b 5d 0c             	mov    0xc(%ebp),%ebx
  40122b:	8b 75 08             	mov    0x8(%ebp),%esi
  40122e:	c7 04 24 08 00 00 00 	movl   $0x8,(%esp)
  401235:	e8 36 04 00 00       	call   401670 <_cygwin_internal>
  40123a:	85 db                	test   %ebx,%ebx
  40123c:	0f 84 be 01 00 00    	je     401400 <__cygwin_crt0_common@8+0x1e0>
  401242:	8b 15 80 50 40 00    	mov    0x405080,%edx
  401248:	85 c0                	test   %eax,%eax
  40124a:	c7 43 04 a8 00 00 00 	movl   $0xa8,0x4(%ebx)
  401251:	c7 43 08 ef 03 00 00 	movl   $0x3ef,0x8(%ebx)
  401258:	c7 43 0c 0f 00 00 00 	movl   $0xf,0xc(%ebx)
  40125f:	89 53 10             	mov    %edx,0x10(%ebx)
  401262:	8b 55 00             	mov    0x0(%ebp),%edx
  401265:	c7 83 80 00 00 00 00 	movl   $0x0,0x80(%ebx)
  40126c:	00 00 00
  40126f:	c7 83 84 00 00 00 04 	movl   $0x104,0x84(%ebx)
  401276:	01 00 00
  401279:	c7 43 2c 30 17 40 00 	movl   $0x401730,0x2c(%ebx)
  401280:	c7 43 30 3c 17 40 00 	movl   $0x40173c,0x30(%ebx)
  401287:	c7 43 14 18 40 40 00 	movl   $0x404018,0x14(%ebx)
  40128e:	89 73 28             	mov    %esi,0x28(%ebx)
  401291:	c7 43 48 d0 11 40 00 	movl   $0x4011d0,0x48(%ebx)
  401298:	c7 43 4c e0 11 40 00 	movl   $0x4011e0,0x4c(%ebx)
  40129f:	c7 43 50 f0 11 40 00 	movl   $0x4011f0,0x50(%ebx)
  4012a6:	c7 43 54 00 12 40 00 	movl   $0x401200,0x54(%ebx)
  4012ad:	c7 43 24 1c 40 40 00 	movl   $0x40401c,0x24(%ebx)
  4012b4:	89 13                	mov    %edx,(%ebx)
  4012b6:	c7 43 18 50 16 40 00 	movl   $0x401650,0x18(%ebx)
  4012bd:	c7 43 1c 58 16 40 00 	movl   $0x401658,0x1c(%ebx)
  4012c4:	c7 43 20 60 16 40 00 	movl   $0x401660,0x20(%ebx)
  4012cb:	c7 43 44 68 16 40 00 	movl   $0x401668,0x44(%ebx)
  4012d2:	0f 84 c5 00 00 00    	je     40139d <__cygwin_crt0_common@8+0x17d>
  4012d8:	8b 50 78             	mov    0x78(%eax),%edx
  4012db:	85 d2                	test   %edx,%edx
  4012dd:	0f 84 ba 00 00 00    	je     40139d <__cygwin_crt0_common@8+0x17d>
  4012e3:	8b 35 20 40 40 00    	mov    0x404020,%esi
  4012e9:	85 f6                	test   %esi,%esi
  4012eb:	0f 85 ac 00 00 00    	jne    40139d <__cygwin_crt0_common@8+0x17d>
  4012f1:	8b 0d 00 20 40 00    	mov    0x402000,%ecx
  4012f7:	85 c9                	test   %ecx,%ecx
  4012f9:	0f 84 21 02 00 00    	je     401520 <__cygwin_crt0_common@8+0x300>
  4012ff:	a1 04 20 40 00       	mov    0x402004,%eax
  401304:	85 c0                	test   %eax,%eax
  401306:	0f 84 04 02 00 00    	je     401510 <__cygwin_crt0_common@8+0x2f0>
  40130c:	8b 35 08 20 40 00    	mov    0x402008,%esi
  401312:	85 f6                	test   %esi,%esi
  401314:	0f 84 e6 01 00 00    	je     401500 <__cygwin_crt0_common@8+0x2e0>
  40131a:	8b 0d 0c 20 40 00    	mov    0x40200c,%ecx
  401320:	85 c9                	test   %ecx,%ecx
  401322:	0f 84 c8 01 00 00    	je     4014f0 <__cygwin_crt0_common@8+0x2d0>
  401328:	a1 10 20 40 00       	mov    0x402010,%eax
  40132d:	85 c0                	test   %eax,%eax
  40132f:	0f 84 ab 01 00 00    	je     4014e0 <__cygwin_crt0_common@8+0x2c0>
  401335:	8b 35 14 20 40 00    	mov    0x402014,%esi
  40133b:	85 f6                	test   %esi,%esi
  40133d:	0f 84 8d 01 00 00    	je     4014d0 <__cygwin_crt0_common@8+0x2b0>
  401343:	8b 0d 18 20 40 00    	mov    0x402018,%ecx
  401349:	85 c9                	test   %ecx,%ecx
  40134b:	0f 84 6f 01 00 00    	je     4014c0 <__cygwin_crt0_common@8+0x2a0>
  401351:	a1 1c 20 40 00       	mov    0x40201c,%eax
  401356:	85 c0                	test   %eax,%eax
  401358:	0f 84 52 01 00 00    	je     4014b0 <__cygwin_crt0_common@8+0x290>
  40135e:	a1 00 20 40 00       	mov    0x402000,%eax
  401363:	89 02                	mov    %eax,(%edx)
  401365:	a1 04 20 40 00       	mov    0x402004,%eax
  40136a:	89 42 04             	mov    %eax,0x4(%edx)
  40136d:	a1 08 20 40 00       	mov    0x402008,%eax
  401372:	89 42 08             	mov    %eax,0x8(%edx)
  401375:	a1 0c 20 40 00       	mov    0x40200c,%eax
  40137a:	89 42 0c             	mov    %eax,0xc(%edx)
  40137d:	a1 10 20 40 00       	mov    0x402010,%eax
  401382:	89 42 10             	mov    %eax,0x10(%edx)
  401385:	a1 14 20 40 00       	mov    0x402014,%eax
  40138a:	89 42 14             	mov    %eax,0x14(%edx)
  40138d:	a1 18 20 40 00       	mov    0x402018,%eax
  401392:	89 42 18             	mov    %eax,0x18(%edx)
  401395:	a1 1c 20 40 00       	mov    0x40201c,%eax
  40139a:	89 42 1c             	mov    %eax,0x1c(%edx)
  40139d:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
  4013a4:	e8 4f 03 00 00       	call   4016f8 <_GetModuleHandleA@4>
  4013a9:	c7 43 34 00 20 40 00 	movl   $0x402000,0x34(%ebx)
  4013b0:	c7 43 38 b4 20 40 00 	movl   $0x4020b4,0x38(%ebx)
  4013b7:	c7 43 3c 00 40 40 00 	movl   $0x404000,0x3c(%ebx)
  4013be:	c7 43 40 10 41 40 00 	movl   $0x404110,0x40(%ebx)
  4013c5:	c7 83 94 00 00 00 00 	movl   $0x403000,0x94(%ebx)
  4013cc:	30 40 00
  4013cf:	89 43 7c             	mov    %eax,0x7c(%ebx)
  4013d2:	83 ec 04             	sub    $0x4,%esp
  4013d5:	c7 83 98 00 00 00 00 	movl   $0x403000,0x98(%ebx)
  4013dc:	30 40 00
  4013df:	c7 83 9c 00 00 00 00 	movl   $0x400000,0x9c(%ebx)
  4013e6:	00 40 00
  4013e9:	e8 92 02 00 00       	call   401680 <__pei386_runtime_relocator>
  4013ee:	8d 65 f8             	lea    -0x8(%ebp),%esp
  4013f1:	b8 01 00 00 00       	mov    $0x1,%eax
  4013f6:	5b                   	pop    %ebx
  4013f7:	5e                   	pop    %esi
  4013f8:	5d                   	pop    %ebp
  4013f9:	c2 08 00             	ret    $0x8
  4013fc:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  401400:	8b 15 80 50 40 00    	mov    0x405080,%edx
  401406:	85 c0                	test   %eax,%eax
  401408:	8b 88 a4 00 00 00    	mov    0xa4(%eax),%ecx
  40140e:	c7 40 04 a8 00 00 00 	movl   $0xa8,0x4(%eax)
  401415:	c7 40 08 ef 03 00 00 	movl   $0x3ef,0x8(%eax)
  40141c:	c7 40 0c 0f 00 00 00 	movl   $0xf,0xc(%eax)
  401423:	89 0a                	mov    %ecx,(%edx)
  401425:	8b 55 00             	mov    0x0(%ebp),%edx
  401428:	c7 80 80 00 00 00 00 	movl   $0x0,0x80(%eax)
  40142f:	00 00 00
  401432:	c7 80 84 00 00 00 04 	movl   $0x104,0x84(%eax)
  401439:	01 00 00
  40143c:	c7 40 2c 30 17 40 00 	movl   $0x401730,0x2c(%eax)
  401443:	c7 40 30 3c 17 40 00 	movl   $0x40173c,0x30(%eax)
  40144a:	c7 40 14 18 40 40 00 	movl   $0x404018,0x14(%eax)
  401451:	89 70 28             	mov    %esi,0x28(%eax)
  401454:	c7 40 48 d0 11 40 00 	movl   $0x4011d0,0x48(%eax)
  40145b:	c7 40 4c e0 11 40 00 	movl   $0x4011e0,0x4c(%eax)
  401462:	c7 40 50 f0 11 40 00 	movl   $0x4011f0,0x50(%eax)
  401469:	c7 40 54 00 12 40 00 	movl   $0x401200,0x54(%eax)
  401470:	c7 40 24 1c 40 40 00 	movl   $0x40401c,0x24(%eax)
  401477:	89 10                	mov    %edx,(%eax)
  401479:	c7 40 18 50 16 40 00 	movl   $0x401650,0x18(%eax)
  401480:	c7 40 1c 58 16 40 00 	movl   $0x401658,0x1c(%eax)
  401487:	c7 40 20 60 16 40 00 	movl   $0x401660,0x20(%eax)
  40148e:	c7 40 44 68 16 40 00 	movl   $0x401668,0x44(%eax)
  401495:	0f 84 02 ff ff ff    	je     40139d <__cygwin_crt0_common@8+0x17d>
  40149b:	8b 50 78             	mov    0x78(%eax),%edx
  40149e:	89 c3                	mov    %eax,%ebx
  4014a0:	85 d2                	test   %edx,%edx
  4014a2:	0f 85 3b fe ff ff    	jne    4012e3 <__cygwin_crt0_common@8+0xc3>
  4014a8:	e9 f0 fe ff ff       	jmp    40139d <__cygwin_crt0_common@8+0x17d>
  4014ad:	8d 76 00             	lea    0x0(%esi),%esi
  4014b0:	8b 42 1c             	mov    0x1c(%edx),%eax
  4014b3:	a3 1c 20 40 00       	mov    %eax,0x40201c
  4014b8:	e9 a1 fe ff ff       	jmp    40135e <__cygwin_crt0_common@8+0x13e>
  4014bd:	8d 76 00             	lea    0x0(%esi),%esi
  4014c0:	8b 42 18             	mov    0x18(%edx),%eax
  4014c3:	a3 18 20 40 00       	mov    %eax,0x402018
  4014c8:	e9 84 fe ff ff       	jmp    401351 <__cygwin_crt0_common@8+0x131>
  4014cd:	8d 76 00             	lea    0x0(%esi),%esi
  4014d0:	8b 42 14             	mov    0x14(%edx),%eax
  4014d3:	a3 14 20 40 00       	mov    %eax,0x402014
  4014d8:	e9 66 fe ff ff       	jmp    401343 <__cygwin_crt0_common@8+0x123>
  4014dd:	8d 76 00             	lea    0x0(%esi),%esi
  4014e0:	8b 42 10             	mov    0x10(%edx),%eax
  4014e3:	a3 10 20 40 00       	mov    %eax,0x402010
  4014e8:	e9 48 fe ff ff       	jmp    401335 <__cygwin_crt0_common@8+0x115>
  4014ed:	8d 76 00             	lea    0x0(%esi),%esi
  4014f0:	8b 42 0c             	mov    0xc(%edx),%eax
  4014f3:	a3 0c 20 40 00       	mov    %eax,0x40200c
  4014f8:	e9 2b fe ff ff       	jmp    401328 <__cygwin_crt0_common@8+0x108>
  4014fd:	8d 76 00             	lea    0x0(%esi),%esi
  401500:	8b 42 08             	mov    0x8(%edx),%eax
  401503:	a3 08 20 40 00       	mov    %eax,0x402008
  401508:	e9 0d fe ff ff       	jmp    40131a <__cygwin_crt0_common@8+0xfa>
  40150d:	8d 76 00             	lea    0x0(%esi),%esi
  401510:	8b 42 04             	mov    0x4(%edx),%eax
  401513:	a3 04 20 40 00       	mov    %eax,0x402004
  401518:	e9 ef fd ff ff       	jmp    40130c <__cygwin_crt0_common@8+0xec>
  40151d:	8d 76 00             	lea    0x0(%esi),%esi
  401520:	8b 02                	mov    (%edx),%eax
  401522:	a3 00 20 40 00       	mov    %eax,0x402000
  401527:	e9 d3 fd ff ff       	jmp    4012ff <__cygwin_crt0_common@8+0xdf>
  40152c:	90                   	nop
  40152d:	90                   	nop
  40152e:	90                   	nop
  40152f:	90                   	nop

00401530 <___dllMain>:
  401530:	55                   	push   %ebp
  401531:	89 e5                	mov    %esp,%ebp
  401533:	83 ec 18             	sub    $0x18,%esp
  401536:	a1 2c 40 40 00       	mov    0x40402c,%eax
  40153b:	89 44 24 08          	mov    %eax,0x8(%esp)
  40153f:	a1 28 40 40 00       	mov    0x404028,%eax
  401544:	89 44 24 04          	mov    %eax,0x4(%esp)
  401548:	a1 24 40 40 00       	mov    0x404024,%eax
  40154d:	89 04 24             	mov    %eax,(%esp)
  401550:	e8 3b 01 00 00       	call   401690 <_DllMain@12>
  401555:	83 ec 0c             	sub    $0xc,%esp
  401558:	c9                   	leave
  401559:	c3                   	ret
  40155a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

00401560 <__cygwin_dll_entry@12>:
  401560:	55                   	push   %ebp
  401561:	89 e5                	mov    %esp,%ebp
  401563:	83 ec 28             	sub    $0x28,%esp
  401566:	8b 45 0c             	mov    0xc(%ebp),%eax
  401569:	8b 55 08             	mov    0x8(%ebp),%edx
  40156c:	8b 4d 10             	mov    0x10(%ebp),%ecx
  40156f:	83 f8 01             	cmp    $0x1,%eax
  401572:	74 6f                	je     4015e3 <__cygwin_dll_entry@12+0x83>
  401574:	72 1a                	jb     401590 <__cygwin_dll_entry@12+0x30>
  401576:	83 f8 02             	cmp    $0x2,%eax
  401579:	0f 84 a8 00 00 00    	je     401627 <__cygwin_dll_entry@12+0xc7>
  40157f:	83 f8 03             	cmp    $0x3,%eax
  401582:	74 4c                	je     4015d0 <__cygwin_dll_entry@12+0x70>
  401584:	b8 01 00 00 00       	mov    $0x1,%eax
  401589:	c9                   	leave
  40158a:	c2 0c 00             	ret    $0xc
  40158d:	8d 76 00             	lea    0x0(%esi),%esi
  401590:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  401594:	c7 44 24 04 00 00 00 	movl   $0x0,0x4(%esp)
  40159b:	00
  40159c:	89 14 24             	mov    %edx,(%esp)
  40159f:	e8 ec 00 00 00       	call   401690 <_DllMain@12>
  4015a4:	83 ec 0c             	sub    $0xc,%esp
  4015a7:	85 c0                	test   %eax,%eax
  4015a9:	74 de                	je     401589 <__cygwin_dll_entry@12+0x29>
  4015ab:	8b 15 30 40 40 00    	mov    0x404030,%edx
  4015b1:	89 45 f4             	mov    %eax,-0xc(%ebp)
  4015b4:	89 14 24             	mov    %edx,(%esp)
  4015b7:	e8 e4 00 00 00       	call   4016a0 <_cygwin_detach_dll>
  4015bc:	8b 45 f4             	mov    -0xc(%ebp),%eax
  4015bf:	c7 05 30 40 40 00 ff 	movl   $0xffffffff,0x404030
  4015c6:	ff ff ff
  4015c9:	eb be                	jmp    401589 <__cygwin_dll_entry@12+0x29>
  4015cb:	90                   	nop
  4015cc:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi
  4015d0:	89 4d 10             	mov    %ecx,0x10(%ebp)
  4015d3:	c7 45 0c 03 00 00 00 	movl   $0x3,0xc(%ebp)
  4015da:	89 55 08             	mov    %edx,0x8(%ebp)
  4015dd:	c9                   	leave
  4015de:	e9 ad 00 00 00       	jmp    401690 <_DllMain@12>
  4015e3:	31 c0                	xor    %eax,%eax
  4015e5:	85 c9                	test   %ecx,%ecx
  4015e7:	0f 94 c0             	sete   %al
  4015ea:	c7 44 24 04 30 15 40 	movl   $0x401530,0x4(%esp)
  4015f1:	00
  4015f2:	89 14 24             	mov    %edx,(%esp)
  4015f5:	89 15 24 40 40 00    	mov    %edx,0x404024
  4015fb:	c7 05 28 40 40 00 01 	movl   $0x1,0x404028
  401602:	00 00 00
  401605:	89 0d 2c 40 40 00    	mov    %ecx,0x40402c
  40160b:	a3 20 40 40 00       	mov    %eax,0x404020
  401610:	e8 9b 00 00 00       	call   4016b0 <_cygwin_attach_dll>
  401615:	83 f8 ff             	cmp    $0xffffffff,%eax
  401618:	a3 30 40 40 00       	mov    %eax,0x404030
  40161d:	0f 95 c0             	setne  %al
  401620:	0f b6 c0             	movzbl %al,%eax
  401623:	c9                   	leave
  401624:	c2 0c 00             	ret    $0xc
  401627:	89 4d 10             	mov    %ecx,0x10(%ebp)
  40162a:	c7 45 0c 02 00 00 00 	movl   $0x2,0xc(%ebp)
  401631:	89 55 08             	mov    %edx,0x8(%ebp)
  401634:	c9                   	leave
  401635:	e9 56 00 00 00       	jmp    401690 <_DllMain@12>
  40163a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

00401640 <__cygwin_noncygwin_dll_entry@12>:
  401640:	55                   	push   %ebp
  401641:	89 e5                	mov    %esp,%ebp
  401643:	83 ec 08             	sub    $0x8,%esp
  401646:	c9                   	leave
  401647:	e9 14 ff ff ff       	jmp    401560 <__cygwin_dll_entry@12>
  40164c:	90                   	nop
  40164d:	90                   	nop
  40164e:	90                   	nop
  40164f:	90                   	nop

00401650 <_malloc>:
  401650:	ff 25 98 50 40 00    	jmp    *0x405098
  401656:	90                   	nop
  401657:	90                   	nop

00401658 <_free>:
  401658:	ff 25 94 50 40 00    	jmp    *0x405094
  40165e:	90                   	nop
  40165f:	90                   	nop

00401660 <_realloc>:
  401660:	ff 25 a0 50 40 00    	jmp    *0x4050a0
  401666:	90                   	nop
  401667:	90                   	nop

00401668 <_calloc>:
  401668:	ff 25 84 50 40 00    	jmp    *0x405084
  40166e:	90                   	nop
  40166f:	90                   	nop

00401670 <_cygwin_internal>:
  401670:	ff 25 8c 50 40 00    	jmp    *0x40508c
  401676:	90                   	nop
  401677:	90                   	nop
  401678:	66 90                	xchg   %ax,%ax
  40167a:	66 90                	xchg   %ax,%ax
  40167c:	66 90                	xchg   %ax,%ax
  40167e:	66 90                	xchg   %ax,%ax

00401680 <__pei386_runtime_relocator>:
  401680:	55                   	push   %ebp
  401681:	89 e5                	mov    %esp,%ebp
  401683:	5d                   	pop    %ebp
  401684:	c3                   	ret
  401685:	90                   	nop
  401686:	90                   	nop
  401687:	90                   	nop
  401688:	90                   	nop
  401689:	90                   	nop
  40168a:	90                   	nop
  40168b:	90                   	nop
  40168c:	90                   	nop
  40168d:	90                   	nop
  40168e:	90                   	nop
  40168f:	90                   	nop

00401690 <_DllMain@12>:
  401690:	55                   	push   %ebp
  401691:	b8 01 00 00 00       	mov    $0x1,%eax
  401696:	89 e5                	mov    %esp,%ebp
  401698:	5d                   	pop    %ebp
  401699:	c2 0c 00             	ret    $0xc
  40169c:	90                   	nop
  40169d:	90                   	nop
  40169e:	90                   	nop
  40169f:	90                   	nop

004016a0 <_cygwin_detach_dll>:
  4016a0:	ff 25 88 50 40 00    	jmp    *0x405088
  4016a6:	90                   	nop
  4016a7:	90                   	nop
  4016a8:	66 90                	xchg   %ax,%ax
  4016aa:	66 90                	xchg   %ax,%ax
  4016ac:	66 90                	xchg   %ax,%ax
  4016ae:	66 90                	xchg   %ax,%ax

004016b0 <_cygwin_attach_dll>:
  4016b0:	55                   	push   %ebp
  4016b1:	89 e5                	mov    %esp,%ebp
  4016b3:	53                   	push   %ebx
  4016b4:	83 ec 14             	sub    $0x14,%esp
  4016b7:	8b 45 0c             	mov    0xc(%ebp),%eax
  4016ba:	8b 5d 08             	mov    0x8(%ebp),%ebx
  4016bd:	c7 44 24 04 40 40 40 	movl   $0x404040,0x4(%esp)
  4016c4:	00
  4016c5:	89 04 24             	mov    %eax,(%esp)
  4016c8:	e8 53 fb ff ff       	call   401220 <__cygwin_crt0_common@8>
  4016cd:	89 5d 08             	mov    %ebx,0x8(%ebp)
  4016d0:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  4016d3:	c7 45 0c 40 40 40 00 	movl   $0x404040,0xc(%ebp)
  4016da:	83 ec 08             	sub    $0x8,%esp
  4016dd:	c9                   	leave
  4016de:	e9 0d 00 00 00       	jmp    4016f0 <_dll_dllcrt0>
  4016e3:	90                   	nop
  4016e4:	90                   	nop
  4016e5:	90                   	nop
  4016e6:	90                   	nop
  4016e7:	90                   	nop
  4016e8:	90                   	nop
  4016e9:	90                   	nop
  4016ea:	90                   	nop
  4016eb:	90                   	nop
  4016ec:	90                   	nop
  4016ed:	90                   	nop
  4016ee:	90                   	nop
  4016ef:	90                   	nop

004016f0 <_dll_dllcrt0>:
  4016f0:	ff 25 90 50 40 00    	jmp    *0x405090
  4016f6:	90                   	nop
  4016f7:	90                   	nop

004016f8 <_GetModuleHandleA@4>:
  4016f8:	ff 25 a8 50 40 00    	jmp    *0x4050a8
  4016fe:	90                   	nop
  4016ff:	90                   	nop

00401700 <_GetProcAddress@8>:
  401700:	ff 25 ac 50 40 00    	jmp    *0x4050ac
  401706:	90                   	nop
  401707:	90                   	nop

00401708 <.text>:
  401708:	66 90                	xchg   %ax,%ax
  40170a:	66 90                	xchg   %ax,%ax
  40170c:	66 90                	xchg   %ax,%ax
  40170e:	66 90                	xchg   %ax,%ax

00401710 <_register_frame_ctor>:
  401710:	55                   	push   %ebp
  401711:	89 e5                	mov    %esp,%ebp
  401713:	83 ec 08             	sub    $0x8,%esp
  401716:	c9                   	leave
  401717:	e9 74 f9 ff ff       	jmp    401090 <___gcc_register_frame>
  40171c:	8d 74 26 00          	lea    0x0(%esi,%eiz,1),%esi

00401720 <_deregister_frame_dtor>:
  401720:	55                   	push   %ebp
  401721:	89 e5                	mov    %esp,%ebp
  401723:	83 ec 08             	sub    $0x8,%esp
  401726:	c9                   	leave
  401727:	e9 f4 f9 ff ff       	jmp    401120 <___gcc_deregister_frame>
  40172c:	90                   	nop
  40172d:	90                   	nop
  40172e:	90                   	nop
  40172f:	90                   	nop

00401730 <__CTOR_LIST__>:
  401730:	ff                   	(bad)
  401731:	ff                   	(bad)
  401732:	ff                   	(bad)
  401733:	ff 10                	call   *(%eax)

00401734 <.ctors.65535>:
  401734:	10 17                	adc    %dl,(%edi)
  401736:	40                   	inc    %eax
  401737:	00 00                	add    %al,(%eax)
  401739:	00 00                	add    %al,(%eax)
	...

0040173c <__DTOR_LIST__>:
  40173c:	ff                   	(bad)
  40173d:	ff                   	(bad)
  40173e:	ff                   	(bad)
  40173f:	ff 20                	jmp    *(%eax)

00401740 <.dtors.65535>:
  401740:	20 17                	and    %dl,(%edi)
  401742:	40                   	inc    %eax
  401743:	00 00                	add    %al,(%eax)
  401745:	00 00                	add    %al,(%eax)
	...

('A`)


2012-06-13 :-(

_ 午前

0520 起床

0830 出勤

0900 検討

_ 午後

1300 検討

1700 退勤

_

1730 飯

_ 送別会

仕事場のひとが派遣終ry

薩摩郷土料理 ぢどり亭 川崎西口店

IMG_0001.jpg

IMG_0002.jpg

IMG_0004.jpg

IMG_0006.jpg

IMG_0007.jpg

IMG_0008.jpg

IMG_0010.jpg

IMG_0011.jpg

IMG_0013.jpg

_ 送別会(2)

ぢどり亭の正面の店

IMG_0022.jpg

IMG_0023.jpg

IMG_0025.jpg

IMG_0026.jpg

IMG_0029.jpg

IMG_0030.jpg

IMG_0032.jpg


2012-06-14 :-(

_ 午前

0520 起床

0830 出勤

0900 検討

_ 午後

1300 検討

1740 退勤

_

1900 アルゴリズムほげ

2100 飯

_ [アルゴリズム辞典][パトリシア]アルゴリズム辞典 - パトリシア(C実装)

/* -------------------------------------------------------------------------
 *  アルゴリズム辞典
 *  島内剛一 野下浩平 伏見正則 有沢誠 浜田穂積
 *
 *  パトリシア pp. 624-625
 * ---------------------------------------------------------------------- */


#include <stdio.h>
#include <stdlib.h>

typedef struct node
{
  char key;
  char chckbit;
  struct node* right;
  struct node* left;
} node;

static node head = { 0x0, 0x0, &head, &head };
static char mask[9] = { 0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 };

// 探索
node* search ( char key, node* x )
{
    node* p;
    do
    {
      p = x;
      x = ( key & mask[ x->chckbit ] ) ? x->right : x->left;
    } while ( p->chckbit < x->chckbit );

    return x;
}


// 挿入
void insert( char key, node* x )
{
  node* t, *p;
  int i;

  // キーの探索
  t = search( key, x );
  if( key == t->key )
  {
    printf( "%c exists\n", key );
    return;
  }

  // 挿入するキーと衝突するキーとの間で最初に
  // 異なるビットの位置を求める
  for( i = 1; ( key & mask[ i ] ) == ( t->key & mask[ i ] ); i++ )
    ;

  // キーを置く位置( x )を求める
  do
  {
    p = x;
    x = ( key & mask[ x->chckbit ] ) ? x->right : x->left;
  } while( ( x->chckbit < i ) && ( p->chckbit < x->chckbit ) );

  // 挿入する節点を生成し
  // キーと検査ビットの位置を設定する

  t = calloc( 1, sizeof( node ) );
  t->key = key;
  t->chckbit = i;

  // 子節と親節を設定する
  if( key & mask[ t->chckbit ] )
  {
    t->right = t;
    t->left =x;
  }
  else
  {
    t->left = t;
    t->right = x;
  }

  if( key & mask[ p->chckbit ] )
    p->right = t;
  else
    p->left = t;

  return;
}

int main( int ac, char** av )
{
  node *np;
  insert( 'a', &head );
  insert( 'b', &head );
  insert( 'c', &head );

  np = search( 'a', &head );
  if( np != NULL )
    printf( "key: %c\n", np->key );

  np = search( 'b', &head );
  if( np != NULL )
    printf( "key: %c\n", np->key );

  np = search( 'c', &head );
  if( np != NULL )
    printf( "key: %c\n", np->key );

  return;
}
% ./a.exe
key: a
key: b
key: c

4320027094

_ [アルゴリズム辞典][パトリシア]アルゴリズム辞典 - パトリシア(ruby実装)

#!/usr/bin/ruby

# -*- encoding: utf-8 -*-

#
# アルゴリズム辞典
# 島内剛一 野下浩平 伏見正則 有沢誠 浜田穂積
#
# パトリシア pp. 624-625


require 'pp'

class Node
  attr_accessor :key, :chckbit, :left, :right

  def initialize(key = 0, chckbit = 0, left = nil, right = nil)
    @key = key
    @chckbit = chckbit
    @left = left
    @right = right
  end
end


class Patricia
  def initialize()
    @head = Node.new()
    @head.key = 0
    @head.chckbit = 0
    @head.left = @head
    @head.right = @head
    @mask = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80]
  end


  # 探索
  def search(key)
    x = @head
    p = nil

    begin
      p = x
      x = (key[0] & @mask[x.chckbit] != 0) ? x.right : x.left
    end while (p.chckbit < x.chckbit)

    return x
  end

  # 挿入
  def insert(key)
    x = @head
    t = nil
    p = nil
    i = 0

    # キーの探索
    t = self.search(key)
    if key == t.key
      puts "#{key} exists"
      return
    end

    # 挿入するキーと衝突するキーとの間で最初に
    # 異なるビットの位置を求める
    i = 1
    while (key[0] & @mask[i]) == (t.key[0] & @mask[i])
      i += 1
    end

    # キーを置く位置( x )を求める
    begin
      p = x
      x = (key[0] & @mask[x.chckbit] != 0) ? x.right : x.left
    end while ((x.chckbit < i) && (p.chckbit < x.chckbit))

    # 挿入する節点を生成し
    # キーと検査ビットの位置を設定する
    t = Node.new()
    t.key = key
    t.chckbit = i

    # 子節と親節を設定する
    if key[0] & @mask[t.chckbit] != 0
      t.right = t
      t.left =x
    else
      t.left = t
      t.right = x
    end

    if key[0] & @mask[p.chckbit] != 0
      p.right = t
    else
      p.left = t
    end

  end

end  # end of Patricia

def main(argv)
  pat = Patricia.new()
  pat.insert('a')
  pat.insert('b')
  pat.insert('c')

  np = pat.search('a')
  if np != nil
    puts "key: #{np.key}"
  end

  np = pat.search('b')
  if np != nil
    puts "key: #{np.key}"
  end

  np = pat.search('c')
  if np != nil
    puts "key: #{np.key}"
  end

end

main(ARGV)
% ruby patricia.rb
key: a
key: b
key: c

4320027094


2012-06-15 :-(

_ 午前

0520 起床

0830 出勤

0900 検討

_ 午後

1300 検討

1700 退勤

_

1800 飯

_ 送別会

仕事場のひとが派遣終了ry

馬肉料理 一心

IMG_0001.jpg

IMG_0002.jpg

IMG_0003.jpg

IMG_0004.jpg

IMG_0005.jpg

IMG_0006.jpg

IMG_0007.jpg

IMG_0010.jpg

_ 遺書.txt

ハードディスクに眠る違法データと遺書:日経ビジネスオンライン

「オレのパソコンのデスクトップには、『遺書.txt』という名前のテキストファイルに偽装した実行型ファイルが置いてある。そいつをダブルクリックすると、ハードディスクの中身が全消去される。どうだ? ほしいか?」

Windows ならば

format c:

というのはよく言われるけど Windows が起動しているときに C: をフォーマットできない(と思う)ので消去したいデータは C: 以外に置くと楽ちん。たぶん。

他にも

/bin/rm -rf /

というのもあるけど「全消去」というわけにはいかない[ 20110413#p04 ] けど /home/*/* は削除できるようだから用途としてはじゅうぶんかしら。


2012-06-16 :-)

_ 午前

0800 起床 || 部屋掃除

_ 午後

1200 あじさいの里

1600 買い物

_

1700 お茶飲むなど

1900 IronRubyほげ

_ [開成あじさい祭][あじさい]開成あじさい祭

行ってきた。

IMG_0253

会場に入ってすぐのところの出店(?)で野菜を物色しはじめるなど。

IMG_0239

あじさいの里とはたぶん関係ない一般のひとが庭を解放していたのでお邪魔してきた。菖蒲など

IMG_0273

_ IronRubyほげ

IronRuby.net / が March 13, 2011 だし古いし

じゃあ github からソース取得して Building · IronLanguages/main Wiki msi をビルドしようとしたらエラーになるし(どうのこうの) 、とりあえずバイナリはビルドできたから適当に使ってみる。

でもこのようにして外部に出したスクリプトはデバッグがものすごく面倒くさいんだけど皆どうやってるんだろう。


2012-06-17 :-)

_ 午前

0930 起床

1030 おひる。アーリオ・オーリオ・ペペロンチーノ

_ 午後

1200 アニメ消化

1600 SoftwareDesign読む

_

2100 飯。ブリの照り焼き


2012-06-18 :-(

_ 午前

0520 起床

0830 出勤

0900 検討

_ 午後

1300 検討

1700 残業アワー

_

1930 退勤

2130 飯。鮭のムニエル

2200 ジャンプ読む

2230 本探し

_ 何度でも甦る 花を咲かせよう

多年草?

ラブひな見たことない。


2012-06-19 :-(

_ 午前

0520 起床

0830 出勤

0900 検討

_ 午後

1300 検討

1700 残業アワー

_

1740 退勤

1800 川崎BE

1900 awesomeほげ || マジbuild通んね、CMakeLists.txt に /usr/pkg/include が設定してある変数が書いてあるから execinfo.h への include path 通ってるはずになのに

2100 飯


2012-06-20 :-(

_ 午前

0520 起床

0830 出勤

0900 検討

_ 午後

1300 検討

1500 外出 || 自社業務

1700 退勤

_

1900 rubyほげ

2000 飯

_ ,

  • さんかれあ: 恋人をゾンビに奪われるアニメ
  • おねがいティーチャー: 恋人を宇宙人に奪われるアニメ
  • あの夏で待ってる: 恋人を宇宙人に奪われるアニメ
  • 機動戦士Vガンダム: : 恋人を敵将校に奪われるアニメ
  • バハムートラグーン: 恋人を敵将校に奪われるゲーム

_ [リーダブルコード][献本]【単著もないくせに】リーダブルコード【2冊目】

献本頂きました。

IMG_0299

角征典さん による翻訳です。レビュワーとして参加しました。前回「ウェブオペレーション」でレビュワーとして参加したので、その勢いで声をかけてもらったのでせっかくだから参加しました。

今回は、github のリポジトリに置かれた訳文をレビュワーが読み、ツッコミがあれば github の issue に登録する、という作業手順でした。github 便利。

4873115655

4873114934

_ facebook

細江慎治さんとか崎元仁さんとかゲーム音楽作曲者の方々と「友達」になってるけどまったくゲーム業界関係者じゃないんですよスイマセン。


2012-06-21 :-(

_ 午前

0520 起床

0830 出勤

0900 検討

_ 午後

1300 検討

1700 残業アワー

_

1900 退勤

2130 飯

_ 買い物

@amazon

「C言語による画像処理入門」が評判いいらしく、2011 年に書かれた「C言語による画像処理プログラミング入門」も割りとアレしてる( アメブロFace向け顔認識システムの開発|サイバーエージェント 公式エンジニアブログ ) らしいのでせっかくだから

4785631791


2012-06-22 :-(

_ 午前

0520 起床

0830 出勤

0900 検討

_ 午後

1300 検討

1700 退勤 || いっぽうロシアは鉛筆を使った。的な

_

1900 Cほげ

2100 飯

_ [backtrace][c][バックトレース][execinfo]普通のやつらの下を行け: C でバックトレース表示 - bkブログ

#include <stdlib.h>
#include <execinfo.h>
#include <signal.h>

void stacktrace(int signal) {
    void *trace[128];
    int n = backtrace(trace, sizeof(trace) / sizeof(trace[0]));
    backtrace_symbols_fd(trace, n, 1);
}

int foo() {
    return 1 /0;
}

void bar() {
    foo();
}

int main() {
    struct sigaction sa;
    memset(&sa, 0, sizeof(sa));
    sa.sa_handler = stacktrace;
    sa.sa_flags = SA_ONESHOT;
    sigaction(SIGFPE, &sa, NULL);
    bar();
    return 0;
}

ビルド

% gcc execinfo.c
execinfo.c: In function 'foo':
execinfo.c:12: warning: division by zero
execinfo.c: In function 'main':
execinfo.c:21: warning: incompatible implicit declaration of built-in function 'memset'
execinfo.c:23: error: 'SA_ONESHOT' undeclared (first use in this function)
execinfo.c:23: error: (Each undeclared identifier is reported only once
execinfo.c:23: error: for each function it appears in.)

('A`)

Man page of SIGACTION

SA_RESETHAND
シグナルハンドラが呼ばれる度に、シグナルの動作をデフォルトに戻す。 このフラグはシグナルハンドラを設定する際にのみ意味を持つ。 SA_ONESHOT はこのフラグと同じ意味だが、廃止されており、非標準である。

修正

#include <stdlib.h>
#include <execinfo.h>
#include <signal.h>

void stacktrace(int signal) {
    void *trace[128];
    int n = backtrace(trace, sizeof(trace) / sizeof(trace[0]));
    backtrace_symbols_fd(trace, n, 1);
}

int foo() {
    return 1 /0;
}

void bar() {
    foo();
}

int main() {
    struct sigaction sa;
    memset(&sa, 0, sizeof(sa));
    sa.sa_handler = stacktrace;
    sa.sa_flags = SA_RESETHAND;    ←←←←
    sigaction(SIGFPE, &sa, NULL);
    bar();
    return 0;
}

ビルド。-L 要るんだっけ

% gcc -L/usr/pkg/lib -lexecinfo -I/usr/pkg/include execinfo.c

共有ライブラリのための環境変数

% export LD_LIBRARY_PATH=/usr/pkg/lib

実行

% ./a.out
0xbbb5eab0 <__sigtramp_siginfo_2+0> at /usr/lib/libc.so.12
0x80487d0 <_init+832> at ./a.out
0x804881b <_init+907> at ./a.out
0x80485e4 <_init+340> at ./a.out
zsh: floating point exception (core dumped)  LD_LIBRARY_PATH=/usr/pkg/lib ./a.out

-rdynamic をつけるとシンボルを表示するらしい。

% gcc -rdynamic -L/usr/pkg/lib -lexecinfo -I/usr/pkg/include execinfo.c
% ./a.out
0xbbb5eab0 <__sigtramp_siginfo_2+0> at /usr/lib/libc.so.12
0x80488a0 <bar+8> at ./a.out
0x80488eb <main+73> at ./a.out
0x80486b4 <___start+156> at ./a.out
zsh: floating point exception (core dumped)  LD_LIBRARY_PATH=/usr/pkg/lib ./a.out

execinfo.h 使えてるよなあ


2012-06-23 :-)

_ 午前

1030 起床 || 部屋掃除

_ 午後

1200 おひる。カルボナーラ

1330 お台場

_

1700 買い物

1800 庭仕事

2130 飯

_ [ガンダムフロント][ガンダム]ガンダムフロント東京

行ってきた。

有料ゾーンに入ってすぐの DOME-G で歴代ガンダムを池田秀一が紹介している、という映像だけで泣けてきた。一瞬見えたアレってもしかして G-SAVIOUR ....

ストライクフリーダムらしいんだが SEED は見てない。

IMG_0326

1 年戦争の決戦地ア・バオア・クー。ホワイトベースが居た。

IMG_0322

ダイバーシティの外に等身大ガンダムがある。

IMG_0349

ガンプラなんて 20 数年前に 1 度チャレンジしたものの挫折して以来触ってなかったのに買ってみたり。

IMG_0363

B007XNRI7A

_ [NetBSD][awesome]wip/awesome

awesome の 3 系が wip にしかないので wip/awesome (v3.4.10) をどうのこうのしていたアレ( SourceForge.net: work-in-progress pkgsrc packages: pkgsrc-wip-review )

v 3.4.10 で「libexecinfo を使わなくてもビルドできるようにしたよ」とあったんだがlibexecinfo をインストールしていたのを忘れていて、libexecinfo をアンインストールしたうえで wip/awesome をインストールできた。

% cd /usr/pkgsrc/wip/libexecinfo/
% sudo make deinstall
% cd /usr/pkgsrc/wip/awesome
% sudo make install

2012-06-24 :-)

_ 午前

0700 起床 || 走る

0800 ニチアサ

1000 おひる。うどん

_ 午後

1200 アニメ消化

1300 下水道洗浄立ち会い

1600 散歩

_

1700 読書

2130 飯


2012-06-25 :-(

_ 午前

0520 起床

0830 出勤

0900 検討

_ 午後

1300 検討

1740 退勤

_

1900 画像ほげ

2100 飯。ホイコーロー 辛い

_ C言語による画像処理プログラミング入門 の入門

環境

  • Microsoft Windows 7 64bit
  • cygwin
  • gcc 4.5.3

lenna

書籍内で使用している lenna の画像は レナ (画像データ) - Wikipedia から貰う。wikipedia のレナが TIFF ( Tagged Image File Format - Wikipedia )なのだが書籍では PGM ( PNM (画像フォーマット) - Wikipedia )を前提としているのでテキトーな手段で PGM に変換しておく。

サンプルソース

書籍の サンプルソース があるのでダウンロードしておく。書籍内で使っている画像ライブラリ pgmlib.h も入っている。

nkf

作業を開始する前に、サンプルソースの文字コードが Shift_JIS なので都合により UTF-8 に変換するんだがさらにその前に NKF を入れる。

% tar xzf nkf-2.1.2.tar.gz
% make
% make install

サンプルソースのディレクトリへ移動などして

% find . -type f -name "*.[c|h]" | while read f; do nkf -W --overwrite $f; done

ビルド

% cd chap01
% gcc copyimage.c
% ./a.exe
入力ファイル名 (*.pgm) : ../../lena.pgm
横の画素数 = 512, 縦の画素数 = 512
最大階調値 = 255
画像は正常に読み込まれました.
出力ファイル名 (*.pgm) : out.pgm
画像は正常に出力されました.

have fun!

_ [NetBSD][/bin/rm]/bin/rm

Big Sky :: 最近の rm は rm -rf / する時 --no-preserve-root 付けないと / は消せない

NetBSD の /bin/rm CVS log for src/bin/rm/rm.c にはそういうオプションが無かった。無差別に虐殺できるらしい。

ところで /bin/rm の rm_overwrite() というのを初めて知った。

* rm_overwrite --
 *	Overwrite the file 3 times with varying bit patterns.

rm_overwrite() の前のコメントにあるコレ。

U.S. DoD 5220.22-M "National Industrial Security Program Operating Manual"

データの完全消去 - Wikipedia

米国政府が定めたNational Industrial Security Program(NISP)の1995年版のオペレーティングマニュアルDoD 5220.22-Mでは、データの完全消去処理について「全てのマッピング可能なセクタに何らかの文字で上書きを行った後、その補数の文字で上書きを行い、さらにランダムな文字コードで上書き処理を行う」という手法を認めていたが、2001年にはトップ・シークレット情報を扱った記憶媒体の消去手法としては認定しない旨、決定された。現在、多くの民生市販のソフトウエアは、この手法を維持している。

ということらしい。

/bin/rm では -P オプションに該当する。へー

 if (Pflag) {
   if (rm_overwrite(p->fts_accpath, NULL))

rm - NetBSD Manual Pages

-P    Overwrite regular files before deleting them.  Files are overwrit-
          ten three times, first with the byte pattern 0xff, then 0x00, and
          then with random data, before they are deleted.  Some care is taken
          to ensure that the data are actually written to disk, but this can-
          not be guaranteed, even on traditional filesystems; on log-struc-
          tured filesystems or if any block-journaling scheme is in use, this
          option is completely useless.  If the file cannot be overwritten,
          it will not be removed.
本日のツッコミ(全2件) [ツッコミを入れる]

_ さぁぶ [lenna、懐かしいですなぁ。 学生時代、画像処理の研究やってたころ、よくテストデータに 使ってました。髪の毛の部分..]

_ みわ [画像処理の研究なう。なのよ 画像処理の本によく使われる画像なんだけど、もともとはヌードだったのね (*´Д`)]


2012-06-26 :-(

_ 午前

0520 起床

0830 出勤

0900 検討

_ 午後

1300 検討

1700 残業アワー

_

1915 退勤

2100 飯。鮭の味噌焼き


2012-06-27 :-(

_ 午前

0520 起床

0830 出勤

0900 検討

_ 午後

1300 検討

1730 退勤

_

1830 画像ほげ

1930 ぐったり

2030 飯

2100 坂の上の雲

2200 画像ほげ

_ ,

FreeBSD を使ってるひとが割りと多いから NetBSD を選択し

iPhone を使ってるひとが割りと多いから Android を選択し

あでも Windows Phone もいいよね、と思い始める杏子のごろ。


2012-06-28 :-(

_ 午前

0520 起床

0830 出勤

0900 検討

_ 午後

1300 検討

1700 残業アワー

_

1900 退勤

2130 飯


2012-06-29 :-(

_ 午前

0520 起床

0830 出勤

0900 検討

_ 午後

1300 検討

1700 退勤

_

1800 飯

_ 睡眠重要

ここんとこ何日か睡眠時間が 4, 5 時間で割りと寝不足だったときに頭がボーっとするし仕事のほうも失敗が多くて(仕事の内容が「○○が出来るのか出来ないのか検討する」というものなのでもともと失敗もなにも無いんだがまあ非効率なことをしていたことなどもあってかなり凹んでいる) そういったことが重なり仕事場に着くたびに頭痛がしたり南武線の電車を待っているときに「市場へ向かって走る あの列車に飛び込んでみよう スーツのままで飛び出してあの列車に飛び込んでみよう♪」あの電車に飛び込んだら楽になるだろうかなどと考えていたんだが

ちゃんと 6 時間睡眠してみたら頭がだいぶすっきりした。

鬱々とした気分もなくなった。

輝く為には必要なものがある
それは自然を愛する心
バランスのとれた食生活
十分な睡眠時間
日に焼けた肌

と松崎しげるが歌っているように健康的な生活は重要である。

_ 1時間しか寝てないからなー

「睡眠時間 4, 5 時間で少ないとかwww」ということを言ってるんではない。1 日 34 時間勤務とかしてた時期もあるのでそこは問題ではないんである。

20090807_1383278.gif

すなお(27) - 地獄のミサワの「女に惚れさす名言集」

_ [VMWare][NetBSD][H8/3069F]VMWare のゲスト NetBSD から H8/3069F へ接続する

こういうことがやりたい。

v01.png

環境

手順

VMWare のシリアル接続設定して cu するだけ。

という簡単なことのやり方が分からなかったんだが仕事場で後輩から「そういう設定ありますよ。ggrks」と言われたのでググった。

VMWare Player のメニューから設定できるらしいんだが、こんなことを言われてしまう。パワーオフってなに。

v00.png

もう少しググると .vmx に書けとあった。

PCルネサンス - 第5回 VMware Playerの仮想マシン環境をカスタマイズ~その2:ITpro

VMware Player 1.x 系統だとメニューじゃなくて .vmx ファイルでしか設定できなかったような記憶があるんだが、いま使ってる VMware Player 3 でもまあ使えるだろう。ということで NetBSD.vmx に 2 行追加。ホストの Windows にUSB・シリアル変換ケーブルをつなげると COM3 として認識されるので COM3 と書いておく。

serial0.present = "TRUE"
serial0.fileName = "COM3"

VMware Player を再起動。

さらに、メニュー - Player - 取り外し可能デバイス - シリアルポート - 接続 しておく。

ゲストの NetBSD にログインして /dev/tty00 につなげる。デフォルトでボーレートは 9600 らしい。

% sudo cu -l /dev/tty00
Connected

H8/3069F へテキトーに kzload をインストールした状態で H8/3069F のリセットボタンを押すとコンソールに入る。

kzload (kozos boot loader) started.
kzload>

わあい VMWare あかり VMWare 大好き

ref. 12ステップで作る 組込みOS自作入門


2012-06-30 :-)

_ 午前

0830 起床 || 部屋掃除

1030 おひる。うどん

_ 午後

1300 アニメ消化

_

1700 RR7

2000 飯

2100 RR7

_ ,

咲は千里山が主役でいいよもう

_ [RR7][リッジレーサー7]ARC 2012 水無月GP

今年も(今年度も) やります。リッジレーサー7 のオンラインサービスが生きている限り、リッジレーサー8 が発売されない限り走り続けるのが我々リッジレーサーです。グランツーリスモもやります。

去年度 ARC 2011 のチャンピオン STARGOLD さんの勝利を阻止すべく集まった精鋭たち。チャンピオン阻止にもっとも近いと思われるのは(私ん中で) emotion さん。彼の躍進を期待しつつ ARC 2012 最初のレースが開催されました。

  1. STARGOLD 161
  2. GREENOGRE 153
  3. ANSΩemotion21 140
  4. SOLARE 120
  5. ANSΩFLOW 101
  6. ANSΩmiwarin 61
  7. ANSΩ三嶋出雲 52
  8. ガンマ 50
  9. かず 50
  10. agumon 50
  11. REDOGRE 19
  12. ANSΩファブリーズ 16
  13. megu.Girls 14
  14. majestajovial 11
  15. knhtymh 10

しかし勝てなかった (>'A`)>

私も壁に突っ込むなどかなりミスが多かった。やはり普段サボってるから (>'A`)>

そして knhtymh さんがチョー久しぶり。最後の 1 レースだけだけど相変わらず意味不明な強さでした。途中で大事故が起きたみたいだけど。

本日のツッコミ(全2件) [ツッコミを入れる]

_ エモエモ [ちょwおれですか?w でもみわさんが応援してくれるなら...(#/ω\#)ポッ]

_ みわ [邪魔しない程度に背中を押しまくります ( ゜皿゜)]