<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6758697817819098194</id><updated>2024-09-23T01:55:18.847+01:00</updated><category term="Ruby/ Ruby on Rails"/><category term="Git"/><category term="Linux"/><category term="Processing"/><category term="English"/><category term="Essays and Reports"/><category term="Links"/><category term="Box2D.js"/><category term="Mac"/><category term="MySQL"/><category term="Sass"/><title type='text'>Engineer Flies エンジニアは空を飛ぶ</title><subtitle type='html'>Ruby, The Processing Language　などについてのブログ</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://engineerflies.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://engineerflies.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01700091790800160715</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>70</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6758697817819098194.post-3326946423514639412</id><published>2015-09-20T10:40:00.001+01:00</published><updated>2015-09-20T10:40:49.557+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ruby/ Ruby on Rails"/><title type='text'>１行で複数の変数を設定するのは気をつけよう</title><content type='html'>&lt;div class=&quot;p1&quot;&gt;
`a, b = b, a`と`a = b; b = a;`って違うんですね。&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
```ruby&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;gt; a, b, c =&amp;nbsp;&lt;span class=&quot;s1&quot;&gt;&#39;a&#39;&lt;/span&gt;,&amp;nbsp;&lt;span class=&quot;s1&quot;&gt;&#39;b&#39;&lt;/span&gt;,&amp;nbsp;&lt;span class=&quot;s1&quot;&gt;&#39;c&#39;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;=&amp;gt; [&lt;/span&gt;&quot;a&quot;&lt;span class=&quot;s2&quot;&gt;,&amp;nbsp;&lt;/span&gt;&quot;b&quot;&lt;span class=&quot;s2&quot;&gt;,&amp;nbsp;&lt;/span&gt;&quot;c&quot;&lt;span class=&quot;s2&quot;&gt;]&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;gt; a = b; b = a;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;gt; [a, b, c]&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;=&amp;gt; [&lt;/span&gt;&quot;b&quot;&lt;span class=&quot;s1&quot;&gt;,&amp;nbsp;&lt;/span&gt;&quot;b&quot;&lt;span class=&quot;s1&quot;&gt;,&amp;nbsp;&lt;/span&gt;&quot;c&quot;&lt;span class=&quot;s1&quot;&gt;]&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
# リセット&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;gt; a, b, c =&amp;nbsp;&lt;span class=&quot;s1&quot;&gt;&#39;a&#39;&lt;/span&gt;,&amp;nbsp;&lt;span class=&quot;s1&quot;&gt;&#39;b&#39;&lt;/span&gt;,&amp;nbsp;&lt;span class=&quot;s1&quot;&gt;&#39;c&#39;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;=&amp;gt; [&lt;/span&gt;&quot;a&quot;&lt;span class=&quot;s2&quot;&gt;,&amp;nbsp;&lt;/span&gt;&quot;b&quot;&lt;span class=&quot;s2&quot;&gt;,&amp;nbsp;&lt;/span&gt;&quot;c&quot;&lt;span class=&quot;s2&quot;&gt;]&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;gt; a, b = b, a&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&amp;gt; [a, b, c]&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;=&amp;gt; [&lt;/span&gt;&quot;b&quot;&lt;span class=&quot;s1&quot;&gt;,&amp;nbsp;&lt;/span&gt;&quot;a&quot;&lt;span class=&quot;s1&quot;&gt;,&amp;nbsp;&lt;/span&gt;&quot;c&quot;&lt;span class=&quot;s1&quot;&gt;]&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s2&quot;&gt;```&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;s2&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;s2&quot;&gt;つまり１行の場合はそれ以前の行の変数の状態を保持した状態でそれぞれの変数へ同時に代入が行われる。&lt;/span&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/3326946423514639412'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/3326946423514639412'/><link rel='alternate' type='text/html' href='http://engineerflies.blogspot.com/2015/09/blog-post.html' title='１行で複数の変数を設定するのは気をつけよう'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01700091790800160715</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-6758697817819098194.post-1066438973626751229</id><published>2014-11-12T06:22:00.002+00:00</published><updated>2014-11-12T06:24:06.294+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Mac"/><title type='text'>Macのキーリマッピング</title><content type='html'>Macのキーリマッピングを再考しました。Rubyをよく書くことが多いので以下のセッティングが個人的に一番楽&lt;br /&gt;
&lt;br /&gt;
- `:`と`;`はシステムワイドでいつもスワップされる&lt;br /&gt;
- `-`と`_`はvimを使っているときだけスワップされる（日本語を書くときやコマンドラインでは`-`を多用するから）&lt;br /&gt;
&lt;br /&gt;
つまり&lt;br /&gt;
&lt;br /&gt;
1.&amp;nbsp;&amp;nbsp;`:` &amp;lt;=&amp;gt; `;`はKarabinerで設定する&lt;br /&gt;
2. `-` &amp;lt;=&amp;gt; `_`は.vimrcで設定する&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
## 1. `:` &amp;lt;=&amp;gt; `;`はKarabinerで設定する&lt;br /&gt;
&lt;br /&gt;
- [Karabiner](https://pqrs.org/osx/karabiner/)をインストールする&lt;br /&gt;
- Change Key tabを開く&lt;br /&gt;
- 検索フィールドにsemicolonと入力する&lt;br /&gt;
- Swap Semicolon and Minusにチェックする&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3KtQ0d-60M8cL8mjZAP03MRL_aQDXcAllhDpG8I-Bg8GpqjGw-wbPNqSFNd49gCMMk7A_qwdxeqVhyphenhyphenCZZTGTLbyn9iv24rsjQ9B_LcOA8sb3N4IEboHnTCEWbMVKQpPPrMeMY9xWpLubm/s1600/20141112152112_397a8f005d9464ae0046b7fa401403a069ffe930.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;306&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3KtQ0d-60M8cL8mjZAP03MRL_aQDXcAllhDpG8I-Bg8GpqjGw-wbPNqSFNd49gCMMk7A_qwdxeqVhyphenhyphenCZZTGTLbyn9iv24rsjQ9B_LcOA8sb3N4IEboHnTCEWbMVKQpPPrMeMY9xWpLubm/s320/20141112152112_397a8f005d9464ae0046b7fa401403a069ffe930.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
## 2. `-` &amp;lt;=&amp;gt; `_`は.vimrcで設定する&lt;br /&gt;
- .vimrcに以下を追記する&lt;br /&gt;
noremap - _&lt;br /&gt;
noremap! - _&lt;br /&gt;
noremap _ -&lt;br /&gt;
noremap! _ -&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/1066438973626751229'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/1066438973626751229'/><link rel='alternate' type='text/html' href='http://engineerflies.blogspot.com/2014/11/mac.html' title='Macのキーリマッピング'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01700091790800160715</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3KtQ0d-60M8cL8mjZAP03MRL_aQDXcAllhDpG8I-Bg8GpqjGw-wbPNqSFNd49gCMMk7A_qwdxeqVhyphenhyphenCZZTGTLbyn9iv24rsjQ9B_LcOA8sb3N4IEboHnTCEWbMVKQpPPrMeMY9xWpLubm/s72-c/20141112152112_397a8f005d9464ae0046b7fa401403a069ffe930.png" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-6758697817819098194.post-7578601298581462829</id><published>2014-09-27T05:19:00.001+01:00</published><updated>2014-09-27T05:19:16.364+01:00</updated><title type='text'>東京都内で白松が最中を買える場所</title><content type='html'>大好物の甘味、白松が最中が通販では送料が650円。都内で扱っているお店が無いかとホームページをみても見つからなかったので電話して聞いてみました。意外と何個もあったんですね&lt;br /&gt;
&lt;br /&gt;
# 白松がモナカ&lt;br /&gt;
&lt;br /&gt;
- 三越&lt;br /&gt;
本店 (日本橋)&lt;br /&gt;
恵比寿&lt;br /&gt;
銀座&lt;br /&gt;
&lt;br /&gt;
- リビン&lt;br /&gt;
錦糸町 ⚪︎ 品揃え豊富&lt;br /&gt;
&lt;br /&gt;
- 西武池袋&lt;br /&gt;
&lt;br /&gt;
- 東急&lt;br /&gt;
町田&lt;br /&gt;
吉祥寺&lt;br /&gt;
東横(渋谷)&lt;br /&gt;
&lt;br /&gt;
- 宮城アンテナショップ&lt;br /&gt;
東池袋1-2-2&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/7578601298581462829'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/7578601298581462829'/><link rel='alternate' type='text/html' href='http://engineerflies.blogspot.com/2014/09/blog-post.html' title='東京都内で白松が最中を買える場所'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01700091790800160715</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-6758697817819098194.post-4426431548996387060</id><published>2014-04-12T01:59:00.000+01:00</published><updated>2014-04-12T02:00:22.263+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="English"/><title type='text'>疑問系における単数形</title><content type='html'>”どんなものが広告表現では重要なのでしょう？”という文の日本語訳は以下のうちどちらが正しいでしょうか？複数の回答が予想されるような質問です。&lt;br /&gt;
&lt;br /&gt;
1. What are Important for Ad Representation?&lt;br /&gt;
&lt;br /&gt;
2. What is Important for Ad Representation?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
正解は２の単数形のほうです。質問する段階だと、複数の答えがあるとは限らないので、複数形で聞くのはちょっと不自然らしいです。&lt;br /&gt;
&lt;br /&gt;
ただし、&quot;What are your 3 favourite animals?&quot; なら3と聞いてるから複数形で質問するのは正しい。&quot;most&quot;が質問文に含まれている場合、複数形になのが不自然です。&quot;most&quot;はいつも&quot;the most&quot;なので一つなんですね&lt;br /&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/4426431548996387060'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/4426431548996387060'/><link rel='alternate' type='text/html' href='http://engineerflies.blogspot.com/2014/04/blog-post.html' title='疑問系における単数形'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01700091790800160715</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-6758697817819098194.post-8628116420618177518</id><published>2014-03-17T13:51:00.002+00:00</published><updated>2014-03-17T13:54:17.632+00:00</updated><title type='text'>引数の*</title><content type='html'>&lt;pre class=&#39;markdown&#39;&gt;引数の*がどういう役割をするのか時々分からなくなってしまうのでまとめてみた。

- メソッド内の引数に付ける&#39;*&#39; =&gt; 複数の引数をまとめる
- メソッドに渡す引数に付ける&#39;*&#39; =&gt; 配列を展開して複数の引数として渡す

```ruby
def caller(*args)
  squash(args)
end
def squash(args)
  puts args.inspect
end
 
caller(:index, :show)
# [:index, :show]
caller(:show)
# [:show]
caller(*[:show])
# [:show]
```

&lt;/pre&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/8628116420618177518'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/8628116420618177518'/><link rel='alternate' type='text/html' href='http://engineerflies.blogspot.com/2014/03/blog-post.html' title='引数の*'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01700091790800160715</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-6758697817819098194.post-6928825678490348007</id><published>2014-03-17T13:42:00.000+00:00</published><updated>2014-03-17T13:46:07.062+00:00</updated><title type='text'>Date.parse と DateTime.parse</title><content type='html'>&lt;pre class=&#39;markdown&#39;&gt;DateTime.parseの方はlocal timeになるらしい。to_iするとUTCとJPTの時差が数値で出る。

```ruby
[2] pry(main)&gt; Date.parse(&quot;2014-03-12&quot;).to_time.to_i
=&gt; 1394550000
[3] pry(main)&gt; DateTime.parse(&quot;2014-03-12&quot;).to_i
=&gt; 1394582400
```
&lt;/pre&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/6928825678490348007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/6928825678490348007'/><link rel='alternate' type='text/html' href='http://engineerflies.blogspot.com/2014/03/dateparse-datetimeparse.html' title='Date.parse と DateTime.parse'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01700091790800160715</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-6758697817819098194.post-3260064506408465790</id><published>2014-02-08T04:16:00.001+00:00</published><updated>2014-02-08T13:22:41.787+00:00</updated><title type='text'>test</title><content type='html'>&lt;pre class=&#39;markdown&#39;&gt;Dillinger
=========

Dillinger is a cloud-enabled HTML5 Markdown editor.

- Type some Markdown text in the left window
- See the HTML in the right
- Magic

Markdown is a lightweight markup language based on the formatting conventions that people naturally use in email.  As [John Gruber] writes on the [Markdown site] [1]:

&gt; The overriding design goal for Markdown&#39;s
&gt; formatting syntax is to make it as readable 
&gt; as possible. The idea is that a
&gt; Markdown-formatted document should be
&gt; publishable as-is, as plain text, without
&gt; looking like it&#39;s been marked up with tags
&gt; or formatting instructions.

This text you see here is *actually* written in Markdown! To get a feel for Markdown&#39;s syntax, type some text into the left window and watch the results in the right.  

Version
----

2.0

Tech
-----------

Dillinger uses a number of open source projects to work properly:

* [Ace Editor] - awesome web-based text editor
* [Marked] - a super fast port of Markdown to JavaScript
* [Twitter Bootstrap] - great UI boilerplate for modern web apps
* [node.js] - evented I/O for the backend
* [Express] - fast node.js network app framework [@tjholowaychuk]
* [keymaster.js] - awesome keyboard handler lib by [@thomasfuchs]
* [jQuery] - duh 

Installation
--------------

```sh
git clone [git-repo-url] dillinger
cd dillinger
npm i -d
mkdir -p public/files/{md,html,pdf}
export SOMETHING=&#39;something&#39;
echo $SOMETHING
```

```ruby
class A &lt; B; def self.create(object = User) object end end
class Zebra; def inspect; &quot;X#{2 + self.object_id}&quot; end end

module ABC::DEF
  include Comparable

  # @param test
  # @return [String] nothing
  def foo(test)
    Thread.new do |blockvar|
      ABC::DEF.reverse(:a_symbol, :&#39;a symbol&#39; + &#39;test&#39; + test)
    end.join
  end

  def [](index) self[index] end
  def ==(other) other == self end
end

anIdentifier = an_identifier
Constant = 1
```

##### Configure Plugins. Instructions in following README.md files

* plugins/dropbox/README.md
* plugins/github/README.md
* plugins/googledrive/README.md

```ruby
node app
```


License
----

MIT


**Free Software, Hell Yeah!**

[john gruber]:http://daringfireball.net/
[@thomasfuchs]:http://twitter.com/thomasfuchs
[1]:http://daringfireball.net/projects/markdown/
[marked]:https://github.com/chjj/marked
[Ace Editor]:http://ace.ajax.org
[node.js]:http://nodejs.org
[Twitter Bootstrap]:http://twitter.github.com/bootstrap/
[keymaster.js]:https://github.com/madrobby/keymaster
[jQuery]:http://jquery.com
[@tjholowaychuk]:http://twitter.com/tjholowaychuk
[express]:http://expressjs.com
&lt;/pre&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/3260064506408465790'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/3260064506408465790'/><link rel='alternate' type='text/html' href='http://engineerflies.blogspot.com/2014/02/test.html' title='test'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01700091790800160715</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-6758697817819098194.post-1022738379820743165</id><published>2014-01-18T09:27:00.000+00:00</published><updated>2014-02-03T14:11:36.847+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Box2D.js"/><title type='text'>Box2D.jsで円をゴムまりの様に衝撃で変形させるサンプル</title><content type='html'>Box2D.jsで円をゴムまりの様に衝撃で変形させるサンプルです。&lt;br /&gt;
&lt;br /&gt;
&lt;iframe width=&quot;100%&quot; height=&quot;570&quot; src=&quot;http://jsfiddle.net/suzuki/79yse/9/embedded/result/&quot; allowfullscreen=&quot;allowfullscreen&quot; frameborder=&quot;0&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;
ボールが伸びる長さは同じ時間に一定ではなくて一番大きい通常時の大きさの2０％ずつ大きくなります。&lt;br /&gt;
&lt;br /&gt;
var radius = this.circle.GetRadius() + (this.diffExpanding() * this.transformingSpeed);&lt;br /&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/1022738379820743165'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/1022738379820743165'/><link rel='alternate' type='text/html' href='http://engineerflies.blogspot.com/2014/01/box2djs.html' title='Box2D.jsで円をゴムまりの様に衝撃で変形させるサンプル'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01700091790800160715</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-6758697817819098194.post-2567599610439626650</id><published>2014-01-16T16:09:00.000+00:00</published><updated>2014-01-18T09:27:25.817+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Box2D.js"/><title type='text'>Box2Dのworldを壁で囲むサンプル</title><content type='html'>Box2Dでworldを壁で囲むクラス worldWallsのサンプルです。&lt;br /&gt;
&lt;iframe width=&quot;100%&quot; height=&quot;550&quot; src=&quot;http://jsfiddle.net/suzuki/Bqgh4/6/embedded/result&quot; allowfullscreen=&quot;allowfullscreen&quot; frameborder=&quot;0&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
箱を作ります&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;var box = new worldWalls(debugDraw.GetDrawScale(), canvas, &#39;1111&#39;);&lt;/blockquote&gt;worldBoxにscale(Box2D上の単位)とcanvas element(画面上の実寸を保持している)を渡しサイズを決定します。&lt;br /&gt;
&lt;br /&gt;
第3引数のtrblはtop right bottom leftの略でバイナリ形式の文字列でどの辺に壁が欲しいかを指定します。 例えば 底辺にだけ壁が欲しい時は&#39;0010&#39;、上以外に壁が欲しい場合は&#39;0111&#39;を指定してください。&lt;br /&gt;
&lt;br /&gt;
クラス外部からwallを参照したい場合は以下の様にプロパティにアクセスしてください&lt;br /&gt;
&lt;br /&gt;
var walls = new worldWalls(debugDraw.GetDrawScale(), canvas, &#39;0111&#39;);&lt;br /&gt;
walls.top.restition = 10; //右辺だけ強くバウンドするようにする。</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/2567599610439626650'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/2567599610439626650'/><link rel='alternate' type='text/html' href='http://engineerflies.blogspot.com/2014/01/box2dworld.html' title='Box2Dのworldを壁で囲むサンプル'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01700091790800160715</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-6758697817819098194.post-7949146972056335208</id><published>2014-01-05T05:27:00.000+00:00</published><updated>2014-01-05T05:38:35.221+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Processing"/><title type='text'>ProcessingでSocial Graphを作る</title><content type='html'>ProcessingでSocail Graphを作ってみました。自分とその友達同士の共通の友人の数を線の太さに表したソーシャルグラフです。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://www.diigo.com/item/p/qpeeeqszbsebdpdorzbcebboep&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://www.diigo.com/item/p/qpeeeqszbsebdpdorzbcebboep&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
世にいろんなソーシャルグラフのライブラリがあるのでそれらを使えば一瞬なんだろうけど幾何学的なことを理解したくて、本を読みながら部品から一個一個全部作りました。詳しくは書かないけれどこんな感じのテクニックを使っています。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;正N角形&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;三角関数 cos, sin&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
&lt;li&gt;ベジェ曲線&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
# コントロール的なロジックはSocialGraphというclassに集約されていて、引数はcsvファイルと、半径です。&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;span class=&quot;n&quot; style=&quot;background-color: white; color: #333333; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; font-size: 11.818181991577148px; line-height: 14.545454025268555px; white-space: pre;&quot;&gt;SocialGraph&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;background-color: white; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; font-size: 11.818181991577148px; font-weight: bold; line-height: 14.545454025268555px; white-space: pre;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;background-color: white; color: #333333; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; font-size: 11.818181991577148px; line-height: 14.545454025268555px; white-space: pre;&quot;&gt;SocialGraphCsv&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; font-size: 11.818181991577148px; line-height: 14.545454025268555px; white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;background-color: white; color: #333333; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; font-size: 11.818181991577148px; line-height: 14.545454025268555px; white-space: pre;&quot;&gt;csv&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;background-color: white; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; font-size: 11.818181991577148px; font-weight: bold; line-height: 14.545454025268555px; white-space: pre;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; font-size: 11.818181991577148px; line-height: 14.545454025268555px; white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kt&quot; style=&quot;background-color: white; color: #445588; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; font-size: 11.818181991577148px; font-weight: bold; line-height: 14.545454025268555px; white-space: pre;&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; font-size: 11.818181991577148px; line-height: 14.545454025268555px; white-space: pre;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;background-color: white; color: #333333; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; font-size: 11.818181991577148px; line-height: 14.545454025268555px; white-space: pre;&quot;&gt;radius&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;background-color: white; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; font-size: 11.818181991577148px; font-weight: bold; line-height: 14.545454025268555px; white-space: pre;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; font-size: 11.818181991577148px; line-height: 14.545454025268555px; white-space: pre;&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
こういうCSVを渡すとカラム数を拾って自動的に正N角形を描写して、人名や線を描写してくれます。&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;person a=&quot;&quot;&gt;&lt;another b=&quot;&quot; person=&quot;&quot;&gt;&lt;span style=&quot;background-color: white; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; font-size: 11.818181991577148px; line-height: 14.545454025268555px; white-space: pre;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/another&gt;&lt;/person&gt;&lt;person a=&quot;&quot;&gt;&lt;another b=&quot;&quot; person=&quot;&quot;&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;border: solid 1 #FFFFAA; width: 770px;&quot;&gt;&lt;!--StartFragment--&gt;  &lt;colgroup&gt;&lt;col span=&quot;10&quot; style=&quot;width: 77pt;&quot; width=&quot;77&quot;&gt;&lt;/col&gt;  &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr height=&quot;18&quot; style=&quot;height: 18.0pt;&quot;&gt;   &lt;td height=&quot;18&quot; style=&quot;height: 18.0pt; width: 77pt;&quot; width=&quot;77&quot;&gt;&lt;/td&gt;   &lt;td style=&quot;width: 77pt;&quot; width=&quot;77&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;Tatsuya Suzuki&lt;/span&gt;&lt;/td&gt;   &lt;td style=&quot;width: 77pt;&quot; width=&quot;77&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;Emi Ito&lt;/span&gt;&lt;/td&gt;   &lt;td style=&quot;width: 77pt;&quot; width=&quot;77&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;Bruno Barroso&lt;/span&gt;&lt;/td&gt;   &lt;td style=&quot;width: 77pt;&quot; width=&quot;77&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;Mattew Day&lt;/span&gt;&lt;/td&gt;   &lt;td style=&quot;width: 77pt;&quot; width=&quot;77&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;Maxim Dokhlov&lt;/span&gt;&lt;/td&gt;   &lt;td style=&quot;width: 77pt;&quot; width=&quot;77&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;Mehmet Bagbekleyen&lt;/span&gt;&lt;/td&gt;   &lt;td style=&quot;width: 77pt;&quot; width=&quot;77&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;Alex Yixnitsky&lt;/span&gt;&lt;/td&gt;   &lt;td style=&quot;width: 77pt;&quot; width=&quot;77&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;Stuart Gardner&lt;/span&gt;&lt;/td&gt;   &lt;td style=&quot;width: 77pt;&quot; width=&quot;77&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;Derrick May&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr height=&quot;18&quot; style=&quot;height: 18.0pt;&quot;&gt;   &lt;td height=&quot;18&quot; style=&quot;height: 18.0pt;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;Tatsuya Suzuki&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;50&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;19&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;10&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;9&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;11&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;15&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;2&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr height=&quot;18&quot; style=&quot;height: 18.0pt;&quot;&gt;   &lt;td height=&quot;18&quot; style=&quot;height: 18.0pt;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;Emi Ito&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;2&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;3&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;3&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;2&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;1&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;2&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;1&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr height=&quot;18&quot; style=&quot;height: 18.0pt;&quot;&gt;   &lt;td height=&quot;18&quot; style=&quot;height: 18.0pt;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;Bruno Barroso&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;4&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;3&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;17&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;1&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;2&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;1&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr height=&quot;18&quot; style=&quot;height: 18.0pt;&quot;&gt;   &lt;td height=&quot;18&quot; style=&quot;height: 18.0pt;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;Mattew Day&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;4&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;5&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;1&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;2&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;1&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr height=&quot;18&quot; style=&quot;height: 18.0pt;&quot;&gt;   &lt;td height=&quot;18&quot; style=&quot;height: 18.0pt;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;Maxim Dokhlov&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;4&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;1&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;2&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;1&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr height=&quot;18&quot; style=&quot;height: 18.0pt;&quot;&gt;   &lt;td height=&quot;18&quot; style=&quot;height: 18.0pt;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;Mehmet Bagbekleyen&amp;nbsp;&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;1&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;2&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;1&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr height=&quot;18&quot; style=&quot;height: 18.0pt;&quot;&gt;   &lt;td height=&quot;18&quot; style=&quot;height: 18.0pt;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;Alex Yixnitsky&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;1&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;1&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr height=&quot;18&quot; style=&quot;height: 18.0pt;&quot;&gt;   &lt;td height=&quot;18&quot; style=&quot;height: 18.0pt;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;Stuart Gardner&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;1&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;tr height=&quot;18&quot; style=&quot;height: 18.0pt;&quot;&gt;   &lt;td height=&quot;18&quot; style=&quot;height: 18.0pt;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;Derrick May&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;   &lt;td align=&quot;right&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;0&lt;/span&gt;&lt;/td&gt;  &lt;/tr&gt;
&lt;!--EndFragment--&gt; &lt;/tbody&gt;&lt;/table&gt;
&lt;/another&gt;&lt;/person&gt;&lt;person a=&quot;&quot;&gt;&lt;another b=&quot;&quot; person=&quot;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/another&gt;&lt;/person&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;person a=&quot;&quot;&gt;&lt;another b=&quot;&quot; person=&quot;&quot;&gt;&lt;span style=&quot;background-color: white; font-family: Consolas, &#39;Liberation Mono&#39;, Courier, monospace; font-size: 11.818181991577148px; line-height: 14.545454025268555px; white-space: pre;&quot;&gt;総当たり（隣接配列）のため下半分は上半分の繰り返しであるため全て０です。1は共通の友人が私しかいないことを意味しています。&lt;/span&gt;&lt;/another&gt;&lt;/person&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
共通の友人の数は以下のURLで取得できます&lt;br /&gt;
https://www.facebook.com/&amp;lt;person A&amp;gt;&lt;person a=&quot;&quot;&gt;?and=&amp;lt;person B&amp;gt;&lt;another b=&quot;&quot; person=&quot;&quot;&gt;&lt;br /&gt;&lt;/another&gt;&lt;/person&gt;&lt;br /&gt;
&lt;person a=&quot;&quot;&gt;&lt;another b=&quot;&quot; person=&quot;&quot;&gt;           &lt;/another&gt;&lt;/person&gt;&lt;person a=&quot;&quot;&gt;&lt;another b=&quot;&quot; person=&quot;&quot;&gt;&lt;br /&gt;&lt;/another&gt;&lt;/person&gt;&lt;br /&gt;
&lt;person a=&quot;&quot;&gt;&lt;another b=&quot;&quot; person=&quot;&quot;&gt;&lt;br /&gt;&lt;/another&gt;&lt;/person&gt;
&lt;person a=&quot;&quot;&gt;&lt;another b=&quot;&quot; person=&quot;&quot;&gt;# クラス構成&lt;/another&gt;&lt;/person&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;SocailGraph: 統括コントローラ&lt;/li&gt;
&lt;li&gt;Coordinate: 座標を保持する&lt;/li&gt;
&lt;li&gt;EquilateralPolygon: 等辺三角形を描写する&lt;/li&gt;
&lt;li&gt;nodeNames: ノード（Facebookの例だと）の名前&lt;/li&gt;
&lt;li&gt;FamiliarityAsLine: 親しさを線（の太さ）で表します&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
nodeNamesとFamiliarityAsLineはEquilateralPolygonに依存していますが、それぞれ独立した画像として再利用可能です。&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;person a=&quot;&quot;&gt;&lt;another b=&quot;&quot; person=&quot;&quot;&gt;&lt;br /&gt;&lt;/another&gt;&lt;/person&gt;
&lt;person a=&quot;&quot;&gt;&lt;another b=&quot;&quot; person=&quot;&quot;&gt;&lt;person a=&quot;&quot;&gt;&lt;another b=&quot;&quot; person=&quot;&quot;&gt;# ソースコード&lt;/another&gt;&lt;/person&gt;&lt;/another&gt;&lt;/person&gt;&lt;br /&gt;
&lt;person a=&quot;&quot;&gt;&lt;another b=&quot;&quot; person=&quot;&quot;&gt;&lt;person a=&quot;&quot;&gt;&lt;another b=&quot;&quot; person=&quot;&quot;&gt;&lt;br /&gt;&lt;/another&gt;&lt;/person&gt;&lt;/another&gt;&lt;/person&gt;
&lt;person a=&quot;&quot;&gt;&lt;another b=&quot;&quot; person=&quot;&quot;&gt;&lt;person a=&quot;&quot;&gt;&lt;another b=&quot;&quot; person=&quot;&quot;&gt;まだ整えられそう。ProcessingでOOPする難しさなんかも&lt;a href=&quot;http://engineerflies.blogspot.jp/2014/01/processing.html&quot;&gt;過去の記事&lt;/a&gt;にまとめました。&lt;/another&gt;&lt;/person&gt;&lt;/another&gt;&lt;/person&gt;&lt;br /&gt;
&lt;person a=&quot;&quot;&gt;&lt;another b=&quot;&quot; person=&quot;&quot;&gt;&lt;person a=&quot;&quot;&gt;&lt;another b=&quot;&quot; person=&quot;&quot;&gt;&lt;br /&gt;&lt;/another&gt;&lt;/person&gt;&amp;lt;script src=&quot;https://gist.github.com/suzukimilanpaak/8264451.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;/another&gt;&lt;/person&gt;&lt;br /&gt;
&lt;person a=&quot;&quot;&gt;&lt;another b=&quot;&quot; person=&quot;&quot;&gt;&lt;br /&gt;&lt;/another&gt;&lt;/person&gt;
&lt;person a=&quot;&quot;&gt;&lt;another b=&quot;&quot; person=&quot;&quot;&gt;&lt;br /&gt;&lt;/another&gt;&lt;/person&gt;
&lt;person a=&quot;&quot;&gt;&lt;another b=&quot;&quot; person=&quot;&quot;&gt;# 感想&lt;/another&gt;&lt;/person&gt;&lt;br /&gt;
&lt;person a=&quot;&quot;&gt;&lt;another b=&quot;&quot; person=&quot;&quot;&gt;&lt;br /&gt;&lt;/another&gt;&lt;/person&gt;
&lt;person a=&quot;&quot;&gt;&lt;another b=&quot;&quot; person=&quot;&quot;&gt;java(Processing Language)を久しぶりに書いたけど、今更OOPを気軽にやれない感じだった。ProcessingでOOPしようとするのが結構めんどくさい（不可能ではない）。ので再利用制のあるコードを書いて共有するのがProcessingの世界では手間。Javaの最近の文法を知らないけど、あの言語にあるこんなしようを使えばもっと奇麗になるかも。&lt;/another&gt;&lt;/person&gt;&lt;br /&gt;
&lt;person a=&quot;&quot;&gt;&lt;another b=&quot;&quot; person=&quot;&quot;&gt;&lt;br /&gt;&lt;/another&gt;&lt;/person&gt;
&lt;person a=&quot;&quot;&gt;&lt;another b=&quot;&quot; person=&quot;&quot;&gt;ソーシャルグラフは&lt;/another&gt;&lt;/person&gt;三角関数とπの組み合わせしか使わないので意外と簡単。&lt;br /&gt;
&lt;br /&gt;
&lt;person a=&quot;&quot;&gt;&lt;another b=&quot;&quot; person=&quot;&quot;&gt;&lt;br /&gt;&lt;/another&gt;&lt;/person&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/7949146972056335208'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/7949146972056335208'/><link rel='alternate' type='text/html' href='http://engineerflies.blogspot.com/2014/01/processingsocial-graph.html' title='ProcessingでSocial Graphを作る'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01700091790800160715</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-6758697817819098194.post-878492587399306101</id><published>2014-01-03T09:54:00.001+00:00</published><updated>2014-01-03T10:00:45.732+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Processing"/><title type='text'>Processingで正多角形を描く</title><content type='html'>&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJ9oJIMvfornguBMW7Fin8dzfSYcutrYsyeTnavXIVYfz97PIdnbz3BoBcCkwMUDi8Eyd0pnibvDTorz0mpqJF-I7Y1qdoh1AkSdOLWOZkQEciDCWZ-bccsOt-g44P02FaK8drhyPMQ2pz/s1600/result.jpg&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJ9oJIMvfornguBMW7Fin8dzfSYcutrYsyeTnavXIVYfz97PIdnbz3BoBcCkwMUDi8Eyd0pnibvDTorz0mpqJF-I7Y1qdoh1AkSdOLWOZkQEciDCWZ-bccsOt-g44P02FaK8drhyPMQ2pz/s320/result.jpg&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
最近Processingで久々に遊んでいます。以前はライブラリを組み合わせて”わーできたー”位のことをやっておりましたが、最近基礎力を身につけたいと思って幾何学的なことも軽く学んでいます。&lt;br /&gt;
さて、文化というかよく見かけるProcessingのサンプルは縦に長ーくて変数の値がなんだったのか途中から忘れてしまうようなものが多いです。&lt;br /&gt;
例えば折れ線グラフを書くようなケースの場合、&lt;br /&gt;
&lt;br /&gt;
統計情報をデータソースから取得する　＞　X軸、Y軸を描く　＞　X、Yの最大値を求めてスケールを決める　＞　ちょうどいい単位に目盛りを引く　＞　折れ線グラフを描く&lt;br /&gt;
&lt;br /&gt;
といったステップを分けて踏むとコードがすっきりするのですが、一方でX軸、Y軸のディスプレイ上の座標や、XやYの最大値やなどの変数はスケッチを通して保持したいもので、そのことが縦に長ーいプログラムだとコードを複雑にしがちです。Proceccingの世界だとおそらく一回使い切りのプロジェクトもしくは次回使うことがあってもコピペして修正すれば割とすんでしまうようなことが多いのかもしれません。&lt;br /&gt;
&lt;br /&gt;
でも、やっぱり再利用可能な部品を作りたいですね。コードを関数に区切ると変数のスコープが狭まるのでミニマムなことにフォーカスできます。&lt;br /&gt;
&lt;br /&gt;
下記のコードでは最初に以下の引数で図形を調整できるものという条件を固持するものとして書きました。&lt;br /&gt;
&lt;br /&gt;
- 正N角形のN&lt;br /&gt;
- 半径&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# どこから読めばいいのか？&lt;br /&gt;
まずはsetupとdrawを読んでください。特にdrawを読むことで大まかな流れがつかめるでしょう。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;java&quot; name=&quot;code&quot;&gt;// 半径２００pxの６角形を描く
  polygon = new EquilateralPolygon(6, 200);
  // 頂点を取得
  polygon.vertexes();
  // 頂点を描く
  polygon.drawVertexes();
  // 番号を描く
  polygon.drawIndexes();
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
肝になるところだけ軽く触れておきましょう。&lt;br /&gt;
&lt;br /&gt;
# #xVertex, #vertexes()&lt;br /&gt;
&lt;br /&gt;
vertexesは頂点の座標を集めています。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;java&quot; name=&quot;code&quot;&gt;public float xVertex(int i, int extra) {
    return cos(angles[i]) * (radius + extra);
  }

  public Coordinate[] vertexes() {
    vertexes = new Coordinate[numVertexes];
    float angleForSingleArc = 2 * PI / numVertexes;
  
    for(int i = 0; i &amp;lt; numVertexes; i++) {
      // Sum up angles
      angles[i] = HALF_PI - angleForSingleArc * i;
      
      float x = xVertex(i, 0);
      float y = - yVertex(i, 0);
      
      vertexes[i] = new Coordinate(x, y);
    }
    
    return vertexes;
  }
&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
ある頂点のX座標は三角関数を使って以下のように求められます。&lt;a href=&quot;http://www8.plala.or.jp/ap2/suugaku/sankakukansuunoshoho.html#sincoskoushiki&quot;&gt;sinとcosを使った辺の長さの求め方&lt;/a&gt;    &lt;br /&gt;
&lt;br /&gt;
# xVertex   &lt;br /&gt;
&lt;br /&gt;
cos(角度) * 半径  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
y座標はsinを使って以下のように求められます   &lt;br /&gt;
&lt;br /&gt;
# yVertex&lt;br /&gt;
sin(角度) * 半径  &lt;br /&gt;
&lt;br /&gt;
xVertex中では半径だけを使ってって計算しています。これは円の中心を起点の0,0としてその差分を座標として計算し描写しているからです。ただ描写する正確な座標ははプログラマが意識しないですむように&lt;a href=&quot;https://gist.github.com/suzukimilanpaak/8234344#file-draw_equilateral_polygon-pde-L94&quot;&gt;translate関数であらかじめずらしています&lt;/a&gt;。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
＃ 拡張点の座標の求め方&lt;br /&gt;
angles[i] = HALF_PI - angleForSingleArc * i;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
PIはπを意味するあらかじめProcessingに用意された定数です。上記のx, yの関数で角度が0の場合processingは右端になります。そこから始まって反時計回りに角度を表します。  &lt;br /&gt;
&lt;br /&gt;
0 =&amp;gt; QUARTER_PI（４５度） =&amp;gt; HALF_PI（９０度） =&amp;gt; PI(180度) =&amp;gt; 2 * PI(360度)   &lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgH-1ayYph2B1uSFaEQ3QndPDyc7b37C41G_7BfhnWms82Dm5aLbBZoAalQKWmtt_3E7APdJLV_fUBEz0VPgcCFJ7iTvPmmXNsnT8PnI6y0q641q7j3G9uy5ciptoL5AUOb-4uZhYI3RKJQ/s1600/PI+of+Processing++(2).png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgH-1ayYph2B1uSFaEQ3QndPDyc7b37C41G_7BfhnWms82Dm5aLbBZoAalQKWmtt_3E7APdJLV_fUBEz0VPgcCFJ7iTvPmmXNsnT8PnI6y0q641q7j3G9uy5ciptoL5AUOb-4uZhYI3RKJQ/s320/PI+of+Processing++(2).png&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
一つずつの頂点について図の一番上を起点としてそこからの角度をi毎に取得します。時計回りに点を配置することにしたので マイナスを付けて逆方向に回転させます。 &lt;br /&gt;
angles[i] = HALF_PI - angleForSingleArc * i;&lt;br /&gt;
&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/suzukimilanpaak/8234344.js&quot;&gt;&lt;/script&gt;   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
＃　なぜOOPを使ってシンプルに書くのが難しいのか？&lt;br /&gt;
&lt;br /&gt;
なぜProcessingではOOPをつかってシンプルに書くのがむずかしいのでしょうか？コードを書いていて思ったことがあります。&lt;br /&gt;
&lt;br /&gt;
- 文脈依存の関数が多い&lt;br /&gt;
&lt;br /&gt;
例えばこのコードに出てくる以下のようなコードは文脈依存です&lt;br /&gt;
&lt;br /&gt;
fill(BLACK);&lt;br /&gt;
text(i, vertexes[i].x, vertexes[i].y);&lt;br /&gt;
noFill();&lt;br /&gt;
&lt;br /&gt;
noLoop()&lt;br /&gt;
&lt;br /&gt;
translate(DISPLAY_WIDTH / 2, DISPLAY_HEIGHT / 2)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
全て後述の処理に影響します。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
- 一個のループに何でもまとめてしまう&lt;br /&gt;
&lt;br /&gt;
計算量が気になってしまい一個のループに何でもまとめてしまうのでそのループを含む関数がいろんなことをやってしまいがちです。lambdaを使ってループのある関数内で座標計算や描写などを遅延評価させてあげればいいんですかね。&lt;br /&gt;
http://www.oracle.com/webfolder/technetwork/tutorials/obe/java/Lambda-QuickStart/index.html?cid=7180&amp;ssid=3993398328344#section2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
以上、久々のJava勉強になりました。&lt;br /&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/878492587399306101'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/878492587399306101'/><link rel='alternate' type='text/html' href='http://engineerflies.blogspot.com/2014/01/processing.html' title='Processingで正多角形を描く'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01700091790800160715</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJ9oJIMvfornguBMW7Fin8dzfSYcutrYsyeTnavXIVYfz97PIdnbz3BoBcCkwMUDi8Eyd0pnibvDTorz0mpqJF-I7Y1qdoh1AkSdOLWOZkQEciDCWZ-bccsOt-g44P02FaK8drhyPMQ2pz/s72-c/result.jpg" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-6758697817819098194.post-7647687199834389133</id><published>2014-01-02T12:52:00.001+00:00</published><updated>2014-02-27T13:31:07.727+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Processing"/><title type='text'>データビジュアライゼイションに役立つかもしれないデータソースまとめ</title><content type='html'>データビジュアライゼイションに役立つかもしれないデータソースをまとめてみます。まだ少ないですが後からもちょいちょい足していきます。(*.最終更新日 2014.1.2)まとまってないだろっていう突っ込みは来年までお待ちください。&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;# 統計データ&lt;/span&gt;&lt;/h2&gt;
＜日本＞&lt;br /&gt;
# &lt;a href=&quot;http://www.e-stat.go.jp/SG1/estat/eStatTopPortal.do&quot;&gt;estat&lt;/a&gt;, &lt;a href=&quot;http://www.e-stat.go.jp/SG1/estat/statisticsLinkView.do?method=init&quot;&gt;省庁別&lt;/a&gt;&lt;br /&gt;
人口や産業、経済、エネルギーに関する政府の統計情報。国勢調査などのデータがある。&lt;br /&gt;
&lt;br /&gt;
# &lt;a href=&quot;http://datameti.go.jp/&quot;&gt;Data Meti&lt;/a&gt;&lt;br /&gt;
経済産業省がオープンデータを実践するために設置した試験サイト。予算、決算、技術、食品、地理、防災などの情報がある。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
＜世界＞&lt;br /&gt;
# &lt;a href=&quot;http://www.imf.org/external/data.htm&quot;&gt;IMF&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
# 地図&lt;/h2&gt;
&lt;div&gt;
地図のマッピングをするときはデータソースの緯度、経度を正確に地図に配置しなければなりません。そのためには背景にある地図のイメージの緯度、経度が正確でないとなりませんね。&lt;br /&gt;
&lt;br /&gt;
-&amp;nbsp;&lt;a href=&quot;http://www.openstreetmap.org/export#map=5/47.828/7.668&amp;amp;layers=H&quot;&gt;openStreetMap&lt;/a&gt;&lt;br /&gt;
　開かれたライセンスの&lt;a href=&quot;http://www.openstreetmap.org/export#map=5/47.828/7.668&amp;amp;layers=H&quot;&gt;openStreetMap&lt;/a&gt;では緯度経度の範囲によって地図を切り取ることが出来ます。&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://www.diigo.com/item/p/qpeeeqszbsdsdqerszbceabaor&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;172&quot; src=&quot;https://www.diigo.com/item/p/qpeeeqszbsdsdqerszbceabaor&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
緯度、経度はよく&lt;a href=&quot;http://www.gsi.go.jp/KOKUJYOHO/center.htm&quot;&gt;度、分、秒で表されます&lt;/a&gt;。度より小さい値は６０進数で表されます。分は６０で割り、秒は３６００で割りその値を足すことで小数点以下の値に変換することが出来ます。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-&amp;nbsp;&lt;a href=&quot;http://www.qgis.org/ja/site/index.html&quot;&gt;QGIS&lt;/a&gt;&lt;br /&gt;
QGISは地図上に必要なレイヤー(georeferrence？)を配置するOSSです。商業利用は有料です。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/7647687199834389133'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/7647687199834389133'/><link rel='alternate' type='text/html' href='http://engineerflies.blogspot.com/2014/01/blog-post.html' title='データビジュアライゼイションに役立つかもしれないデータソースまとめ'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01700091790800160715</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-6758697817819098194.post-7236712443752184579</id><published>2014-01-01T04:21:00.001+00:00</published><updated>2014-01-01T04:21:23.470+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ruby/ Ruby on Rails"/><title type='text'>has_and_belongs_to_many associationで counter_cacheを有効にする</title><content type='html'>has_and_belongs_to_many associationで counter_cacheを有効にするサンプル。&lt;br /&gt;
&lt;br /&gt;
以下は Category has_and_belongs_to_many Website な関係が成立しています。HABTMでcounter_cacheを実施するには has_and_belongs_to_manyに:after_add, :after_removeなどのオプションを渡してフックするメソッドをしてあげれば良いです。&lt;br /&gt;
&lt;br /&gt;
そうすることで website.categries = [category_foo, category_bar] としたときに以前のcategoriesとの差分についてcounter_cacheをincrement/decrementしてくれる。&lt;br /&gt;
&lt;br /&gt;
Website自身のフック :after_save, :after_create, :after_destroyは関連を更新したときにはトリガーされないです。&lt;br /&gt;
&lt;br /&gt;
*. #make!はmachinistからデータを作成しています&lt;br /&gt;
&lt;script src=&quot;https://gist.github.com/suzukimilanpaak/8204980.js&quot;&gt;&lt;/script&gt;&lt;br /&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/7236712443752184579'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/7236712443752184579'/><link rel='alternate' type='text/html' href='http://engineerflies.blogspot.com/2014/01/hasandbelongstomany-association.html' title='has_and_belongs_to_many associationで counter_cacheを有効にする'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01700091790800160715</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-6758697817819098194.post-5494054488261392409</id><published>2014-01-01T01:29:00.001+00:00</published><updated>2014-01-01T04:21:43.530+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ruby/ Ruby on Rails"/><title type='text'>Rails 4　エラーメッセージを完全に上書きする</title><content type='html'>メッセージを上書きしたいときはオプションで presence: { message: &#39;Select at least one category&#39; } の様にメッセージを渡してあげれば良いです。&lt;br /&gt;
だけど、それだと主語が先頭に来てしまい&quot;Category Select at least one category&quot;というエラーメッセージになってしまう。&lt;br /&gt;
&lt;br /&gt;
全てのメッセージを上書きしたいときはlambdaを渡してあげればよい。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&#39;ruby&#39; name=&#39;code&#39;&gt;validates :categories, presence: { message: -&gt; {|location, error| raise [location, error].inspect }  }

# =&gt; [:&quot;activerecord.errors.models.website.attributes.categories.blank&quot;, {:model=&gt;&quot;Website&quot;, :attribute=&gt;&quot;Categories&quot;, :value=&gt;#＜ActiveRecord::Associations::CollectionProxy []&gt; }]

&lt;/pre&gt;&lt;br /&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/5494054488261392409'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/5494054488261392409'/><link rel='alternate' type='text/html' href='http://engineerflies.blogspot.com/2014/01/rails-4.html' title='Rails 4　エラーメッセージを完全に上書きする'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01700091790800160715</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-6758697817819098194.post-5630810552056953183</id><published>2013-08-08T04:28:00.000+01:00</published><updated>2013-08-08T04:29:18.607+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Git"/><title type='text'>現在のGitのブランチをzshのプロンプトに表示する</title><content type='html'>現在のGitのブランチをzshのプロンプトに表示するのがいろんなスクリプトがあると思いますが、個人的に&lt;a href=&quot;https://github.com/olivierverdier/zsh-git-prompt&quot;&gt;zsh-git-prompt&lt;/a&gt;を半年くらい使っていて何の不満も無かったのでお勧めしたいです。&lt;br /&gt;
&lt;a href=&#39;https://github.com/olivierverdier/zsh-git-prompt&#39;&gt;&lt;br /&gt;
&lt;img src=&#39;https://raw.github.com/olivierverdier/zsh-git-prompt/master/screenshot.png&#39; /&gt;&lt;br /&gt;
&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
現在のブランチとremoteとの差分を記号を使って表示してくれます。&lt;br /&gt;
表示される記号の詳細は&lt;a href=&quot;https://github.com/olivierverdier/zsh-git-prompt#prompt-structure&quot;&gt;こちら&lt;/a&gt;に表記されています。&lt;br /&gt;
&lt;br /&gt;
PROMTを設定することで設定済みの変数のうち何を表示するか設定できるようです。&lt;br /&gt;
PROMPT=&#39;%B%m%~%b$(git_super_status) %# &#39;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/5630810552056953183'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/5630810552056953183'/><link rel='alternate' type='text/html' href='http://engineerflies.blogspot.com/2013/08/gitzsh.html' title='現在のGitのブランチをzshのプロンプトに表示する'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01700091790800160715</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-6758697817819098194.post-1361422717302304569</id><published>2013-03-06T02:01:00.000+00:00</published><updated>2013-03-06T02:01:04.782+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Links"/><category scheme="http://www.blogger.com/atom/ns#" term="Ruby/ Ruby on Rails"/><title type='text'>Railsはどうやってコネクションをプールしているの？</title><content type='html'>&lt;br /&gt;
- Rackがコネクションをプールしている&lt;br /&gt;
- 一個のスレッドは一個のコネクションしか持てない&lt;br /&gt;
http://stackoverflow.com/questions/5131772/how-does-the-rails-connection-pooling-work&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
- Rails2.2以前&lt;br /&gt;
&amp;nbsp; Rails2.2以前のスレッドとコネクションの関係であればこちらの記事が分かりやすいです。良記事！&lt;br /&gt;
&amp;nbsp; http://fmkt.blog65.fc2.com/blog-entry-138.html&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/1361422717302304569'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/1361422717302304569'/><link rel='alternate' type='text/html' href='http://engineerflies.blogspot.com/2013/03/rails.html' title='Railsはどうやってコネクションをプールしているの？'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01700091790800160715</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-6758697817819098194.post-1794042888620600968</id><published>2013-02-07T04:46:00.001+00:00</published><updated>2013-02-07T04:46:23.638+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Links"/><category scheme="http://www.blogger.com/atom/ns#" term="Ruby/ Ruby on Rails"/><title type='text'>Capistrano関係のリンク</title><content type='html'>- Wiki home&lt;br /&gt;
https://github.com/capistrano/capistrano/wiki&lt;br /&gt;
&lt;br /&gt;
- よく使う変数 &lt;br /&gt;
https://github.com/capistrano/capistrano/wiki/2.x-Significant-Configuration-Variables&lt;br /&gt;
&lt;br /&gt;
- CapistranoのTask一覧&lt;br /&gt;
https://github.com/capistrano/capistrano/wiki/Capistrano-Tasks&lt;br /&gt;
&lt;br /&gt;
- Capistranoの予約変数&lt;br /&gt;
http://theadmin.org/articles/capistrano-variables/&lt;br /&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/1794042888620600968'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/1794042888620600968'/><link rel='alternate' type='text/html' href='http://engineerflies.blogspot.com/2013/02/capistrano.html' title='Capistrano関係のリンク'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01700091790800160715</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-6758697817819098194.post-5916686986573255418</id><published>2013-01-24T03:04:00.001+00:00</published><updated>2013-01-24T03:04:01.262+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Links"/><category scheme="http://www.blogger.com/atom/ns#" term="Ruby/ Ruby on Rails"/><title type='text'>RSpecのベストプラクティス</title><content type='html'>オンライン上のRSpecのベストプラクティスって結構限られていますよね。Specの書き方の基本が分かると”ControllerのexampleでViewやModel出力のバリエイションを担保しない。”といったような一定のノウハウにそってスペックを書きつつコーディングもきれいに整頓していきたくなるところ。&lt;br /&gt;
&lt;br /&gt;
- &lt;a href=&#39;http://betterspecs.org/&#39;&gt;Better Specs&lt;/a&gt;&lt;br /&gt;
  Specそのものの書き方を学ぶならここ。Githubの議論付きで紹介しています。&lt;br /&gt;
&lt;br /&gt;
- &lt;a href=&#39;https://www.relishapp.com/rspec/rspec-rails/v/2-12-2/docs&#39;&gt;RSpec Rails in Relish&lt;/a&gt;&lt;br /&gt;
  ベストプラクティスと銘打っているわけではありませんがRailsのMVCHのスペックの書き方をここで学ぶことができます。</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/5916686986573255418'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/5916686986573255418'/><link rel='alternate' type='text/html' href='http://engineerflies.blogspot.com/2013/01/rspec.html' title='RSpecのベストプラクティス'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01700091790800160715</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-6758697817819098194.post-7070521224594752265</id><published>2013-01-08T16:01:00.001+00:00</published><updated>2013-01-08T16:09:18.853+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ruby/ Ruby on Rails"/><category scheme="http://www.blogger.com/atom/ns#" term="Sass"/><title type='text'>[Sass] @extendの覚えておくべき動作とplaceholder seloctorの使い道</title><content type='html'>以前から疑問に思っていたSassのplaceholder selectorの使い道がひとつ見つかりました。それは既存の継承の定義を汚さずに拡張を行うというものでした。といっても例をあげないことにはぱっと伝わらないと思います。以下のような順番でおさらいをしながら話を進めます。&lt;br /&gt;
&lt;br /&gt;
extend =&gt; placeholder selector =&gt; codeschoolの応用問題&lt;br /&gt;
&lt;br /&gt;
&lt;style type=&#39;text/css&#39;&gt;
.left {
  width: 250px; 
  float: left; 
  background-color: #eee; 
  padding: 10px;
}

.arrow {
  float: left;
  padding: 100px 20px;
}

.right {
  width: 250px; 
  float: left; 
  background-color: #dde; 
  padding: 10px;
}
&lt;/style&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h1&gt;@extendの基本的な使い方&lt;/h1&gt;&lt;br /&gt;
@extendの基本的な使い方はこのようにクラスを拡張して他の要素(この例だとborder-with)を付け足すことだ。&lt;br /&gt;
&lt;pre class=&#39;left&#39;&gt;.error {
  border: 1px #f00;
  background-color: #fdd;
}

.seriousError {
  @extend .error;
  border-width: 3px;
}
&lt;/pre&gt;&lt;br /&gt;
&lt;div class=&#39;arrow&#39;&gt;&gt;&gt; &lt;/div&gt;&lt;br /&gt;
&lt;pre class=&#39;right&#39;&gt;.error, .seriousError {
  border: 1px #f00;
  background-color: #fdd; }

.seriousError {
  border-width: 3px; }
&lt;/pre&gt;&lt;br /&gt;
&lt;div class=&#39;clear&#39;&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
出力結果はもともと定義されていたCSS上の.error{} にセレクタである.seriousErrorを追加して同じスタイルを適応している。さらに.seriousError{ border-width: 3px; } を単体で宣言することで拡張という概念を実現している。&lt;br /&gt;
&lt;br /&gt;
では、上記の例のように既に.errorsが拡張されている場合に、.errorsを別のところでも定義したらどうなるだろうか？&lt;br /&gt;
&lt;pre class=&#39;left&#39;&gt;.error {
  border: 1px #f00;
  background-color: #fdd;
}
.error.intrusion {
  background-image: url(&quot;/image/hacked.png&quot;);
}
.seriousError {
  @extend .error;
  border-width: 3px;
}
&lt;/pre&gt;&lt;br /&gt;
&lt;div class=&#39;arrow&#39;&gt;&gt;&gt; &lt;/div&gt;&lt;br /&gt;
&lt;pre class=&#39;right&#39;&gt;.error, .seriousError {
  border: 1px #f00;
  background-color: #fdd; }

.error.intrusion, .seriousError.intrusion {
  background-image: url(&quot;/image/hacked.png&quot;); }

.seriousError {
  border-width: 3px; }
&lt;/pre&gt;&lt;br /&gt;
&lt;div class=&#39;clear&#39;&gt;&lt;/div&gt;出力結果には.error.intrusion だけでなく.seriousError.intrusion もできるんですね。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
実はこれ&lt;a href=&#39;http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#how_it_works&#39;&gt;本家のリファレンス&lt;/a&gt;にある基本的なextendの例なんです。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h1&gt;placeholder selector&lt;/h1&gt;&lt;br /&gt;
&lt;a href=&#39;http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#placeholders&#39;&gt;Placeholder selector&lt;/a&gt;はそれそのものの定義は何も出力されませんが、それをextendするとextendした先の定義が出力されます&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&#39;left&#39;&gt;// This ruleset won&#39;t be rendered on its own.
#context a%extreme {
  color: blue;
  font-weight: bold;
  font-size: 2em;
}

//However, placeholder selectors can be extended, just like classes and ids. The extended selectors will be generated, but the base placeholder selector will not. For example:

.notice {
  @extend %extreme;
}
&lt;/pre&gt;&lt;br /&gt;
&lt;div class=&#39;arrow&#39;&gt;&gt;&gt; &lt;/div&gt;&lt;br /&gt;
&lt;pre class=&#39;right&#39;&gt;#context a.notice {
  color: blue;
  font-weight: bold;
  font-size: 2em; }
&lt;/pre&gt;&lt;br /&gt;
&lt;div class=&#39;clear&#39;&gt;&lt;/div&gt;僕はこれの使い道がいまいち分かりませんでした。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Codeschool&lt;/h2&gt;&lt;br /&gt;
以下は僕がCodeschoolで遭遇した問題です。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= 問題本文 = &lt;br /&gt;
Whoops - we&#39;ve discovered an alteration to .blueprint later in our stylesheet, and extending .blueprint with .surveyor is creating extra selectors in .factory that aren&#39;t needed. Create a placeholder selector called container to hold the shared properties and extend it with .blueprint and .surveyor to remove the extra .factory .surveyor selector.&lt;br /&gt;
&lt;br /&gt;
？？？なんじゃそりゃ。と初見だと文の意味すらよく理解できなかったです。&lt;br /&gt;
でも上記のコンテキストを踏んでいるのでもうお分かりじゃないかと思います。&lt;br /&gt;
&lt;br /&gt;
意訳するとこういうことですね。&lt;br /&gt;
&lt;br /&gt;
最初に .blueprint を定義して .factoryでextendした。&lt;br /&gt;
&lt;pre class=&#39;left&#39;&gt;.blueprint {
  background: blue;
  border-radius: 5px;
  margin-bottom: 15px;
  padding: 10px;
}
.factory {
  background: #fff;
  .blueprint {
    margin-bottom: 20px;
  }
}
&lt;/pre&gt;&lt;br /&gt;
&lt;div class=&#39;clear&#39;&gt;&lt;/div&gt;&lt;br /&gt;
だけど、変更が必要で .surveyor を作って extend した。&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&#39;left&#39;&gt;.blueprint {
  background: blue;
  border-radius: 5px;
  margin-bottom: 15px;
  padding: 10px;
}
.surveyor {
  @extend .blueprint;
  color: #fff;
}

.factory {
  background: #fff;
  .blueprint {
    margin-bottom: 20px;
  }
}
&lt;/pre&gt;&lt;div class=&#39;clear&#39;&gt;&lt;/div&gt;&lt;br /&gt;
そしたら、出力結果に予期せぬ余分な .factory .surveyor が入ったのでこれを取り除きたい。&lt;br /&gt;
&lt;pre class=&#39;left&#39;&gt;.blueprint, .surveyor {
  background: blue;
  border-radius: 5px;
  margin-bottom: 15px;
  padding: 10px;
}

.surveyor {
  color: #fff;
}

.factory {
  background: #fff;
}
.factory .blueprint, .factory .surveyor {
  margin-bottom: 20px;
}
&lt;/pre&gt;&lt;div class=&#39;clear&#39;&gt;&lt;/div&gt;&lt;br /&gt;
Placeholder selectorを作って余分な .factory .surveyorセレクタを削除してください。&lt;br /&gt;
&lt;br /&gt;
どうでしょう、make senseしましたか?すでに定義済みの継承関係.factory{ .blueprint{} }を汚さないように拡張をするのにplaceholder selector使ってくださいと言っています。こういうケースならplaceholder selectorが使えるのかもしれません。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
では以下が問題全文です。回答もありますので併せて参考にしてみてください。&lt;br /&gt;
&lt;br /&gt;
Whoops - we&#39;ve discovered an alteration to .blueprint later in our stylesheet, and extending .blueprint with .surveyor is creating extra selectors in .factory that aren&#39;t needed. Create a placeholder selector called container to hold the shared properties and extend it with .blueprint and .surveyor to remove the extra .factory .surveyor selector.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&#39;left&#39;&gt;.blueprint {
  background: blue;
  border-radius: 5px;
  margin-bottom: 15px;
  padding: 10px;
}
.surveyor {
  @extend .blueprint;
  color: #fff;
}

.factory {
  background: #fff;
  .blueprint {
    margin-bottom: 20px;
  }
}
&lt;/pre&gt;&lt;br /&gt;
&lt;div class=&#39;arrow&#39;&gt;&gt;&gt; &lt;/div&gt;&lt;br /&gt;
&lt;pre class=&#39;right&#39;&gt;.blueprint, .surveyor {
  background: blue;
  border-radius: 5px;
  margin-bottom: 15px;
  padding: 10px;
}

.surveyor {
  color: #fff;
}

.factory {
  background: #fff;
}
.factory .blueprint, .factory .surveyor {
  margin-bottom: 20px;
}
&lt;/pre&gt;&lt;br /&gt;
&lt;div class=&#39;clear&#39;&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
回答；&lt;br /&gt;
&lt;pre class=&#39;left&#39;&gt;%container {
  background: blue;
  border-radius: 5px;
  margin-bottom: 15px;
  padding: 10px;
}

.blueprint {
  @extend %container;
}
.surveyor {
  @extend %container;
  color: #fff;
}

.factory {
  background: #fff;
  .blueprint {
    margin-bottom: 20px;
  }
}
&lt;/pre&gt;&lt;br /&gt;
&lt;div class=&#39;arrow&#39;&gt;&gt;&gt; &lt;/div&gt;&lt;br /&gt;
&lt;pre class=&#39;right&#39;&gt;.blueprint, .surveyor {
  background: blue;
  border-radius: 5px;
  margin-bottom: 15px;
  padding: 10px; }

.surveyor {
  color: #fff; }

.factory {
  background: #fff; }

 .factory .blueprint {
   margin-bottom: 20px; }
&lt;/pre&gt;&lt;br /&gt;
&lt;div class=&#39;clear&#39;&gt;&lt;/div&gt;&lt;br /&gt;
まずは.blueprintに親になる %containerを定義して拡張することで出力結果の .blueprint{} と .factory .blueprint{} を実現します。.surveyor{} には color: #fff; という拡張を入れたいので別途 %containerをextendしています。そうすると、.factory { .blueprint{} } は .blueprint だけに適用されますから余分な .factory .surveyerは出力されません。&lt;br /&gt;
&lt;br /&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/7070521224594752265'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/7070521224594752265'/><link rel='alternate' type='text/html' href='http://engineerflies.blogspot.com/2013/01/sass-extendplaceholder-seloctor.html' title='[Sass] @extendの覚えておくべき動作とplaceholder seloctorの使い道'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01700091790800160715</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-6758697817819098194.post-7228019644124381756</id><published>2013-01-08T07:44:00.000+00:00</published><updated>2013-01-08T07:53:10.171+00:00</updated><title type='text'>覚えているようで覚えられない5通りのActiveRecordの属性を変更する方法</title><content type='html'>メモ；&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.davidverhasselt.com/2011/06/28/5-ways-to-set-attributes-in-activerecord/&quot;&gt;5 Ways to set Attributes in ActiveRecord&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;style type=&#39;text/css&#39;&gt;
table, th, td {
  border: 2px #793939 solid;
  padding: 0px;
  margin: 0px;
}
&lt;/style&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h1 class=&quot;entry-title&quot; style=&quot;background-color: white; border: 0px; clear: both; font-family: &#39;Helvetica Neue&#39;, Arial, Helvetica, &#39;Nimbus Sans L&#39;, sans-serif; font-size: 21px; line-height: 1.3em; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;5 Ways to set Attributes in ActiveRecord&lt;/h1&gt;&lt;br /&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt; &lt;th&gt;Method&lt;/th&gt; &lt;th&gt;Uses Default Accessor&lt;/th&gt; &lt;th&gt;Mass Assignment Protection&lt;/th&gt; &lt;th&gt;Saved to Database&lt;/th&gt; &lt;th&gt;Validations&lt;/th&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;a href=&quot;http://apidock.com/rails/ActiveRecord/AttributeMethods/Write/attribute%3D&quot;&gt;attribute=&lt;/a&gt;&lt;/td&gt; &lt;td&gt;Yes&lt;/td&gt; &lt;td&gt;No&lt;/td&gt; &lt;td&gt;No&lt;/td&gt; &lt;td&gt;&lt;span style=&quot;color: silver;&quot;&gt;n/a&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;a href=&quot;http://apidock.com/rails/ActiveRecord/AttributeMethods/Write/write_attribute&quot;&gt;write_attribute&lt;/a&gt;&lt;/td&gt; &lt;td&gt;No&lt;/td&gt; &lt;td&gt;No&lt;/td&gt; &lt;td&gt;No&lt;/td&gt; &lt;td&gt;&lt;span style=&quot;color: silver;&quot;&gt;n/a&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;a href=&quot;http://apidock.com/rails/ActiveRecord/Persistence/update_attribute&quot;&gt;update_attribute&lt;/a&gt;&lt;/td&gt; &lt;td&gt;Yes&lt;/td&gt; &lt;td&gt;No&lt;/td&gt; &lt;td&gt;Yes&lt;/td&gt; &lt;td&gt;No&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;a href=&quot;http://apidock.com/rails/ActiveRecord/Base/attributes%3D&quot;&gt;attributes=&lt;/a&gt;&lt;/td&gt; &lt;td&gt;Yes&lt;/td&gt; &lt;td&gt;Yes&lt;sup&gt;&lt;a class=&quot;footnote-link footnote-identifier-link&quot; href=&quot;http://draft.blogger.com/blogger.g?blogID=6758697817819098194#footnote_0_362&quot; id=&quot;identifier_0_362&quot; title=&quot;Mass Assignment Protection for attributes= is overridable.&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/td&gt; &lt;td&gt;No&lt;/td&gt; &lt;td&gt;&lt;span style=&quot;color: silver;&quot;&gt;n/a&lt;/span&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;a href=&quot;http://apidock.com/rails/v3.0.0/ActiveRecord/Persistence/update_attributes&quot;&gt;update_attributes&lt;/a&gt;&lt;/td&gt; &lt;td&gt;Yes&lt;/td&gt; &lt;td&gt;Yes&lt;/td&gt; &lt;td&gt;Yes&lt;/td&gt; &lt;td&gt;Yes&lt;/td&gt; &lt;/tr&gt;
&lt;/tbody&gt; &lt;/table&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/7228019644124381756'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/7228019644124381756'/><link rel='alternate' type='text/html' href='http://engineerflies.blogspot.com/2013/01/5activerecord.html' title='覚えているようで覚えられない5通りのActiveRecordの属性を変更する方法'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01700091790800160715</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-6758697817819098194.post-269805509768664483</id><published>2013-01-08T05:35:00.000+00:00</published><updated>2013-01-08T16:06:39.623+00:00</updated><title type='text'>TextMateでパス指定でファイルを開く</title><content type='html'>&lt;pre class=&#39;prettyprint&#39; &gt;# Create sym link to mate command
% ps aux|grep Mate
tatsuya-suzuki 36875   0.0  1.4   920560 121252   ??  R     2:07PM   0:13.67 /Applications/TextMate.app/Contents/MacOS/TextMate -psn_0_2155022

% sudo ln -s /Applications/TextMate.app/Contents/Resources/mate /usr/bin/mate

# Now you can open a file with the command
% mate config/database.yml

&lt;/pre&gt;&lt;br /&gt;
mate commandの前にTextMateでプロジェクトを開いていれば一個のプロジェクトに全てのファイルがそれぞれのタブとして開かれます。そうでない場合は一個のファイルにつき一個のプロジェクトが立ち上がるので注意してください。&lt;br /&gt;
&lt;br /&gt;
参考：&lt;br /&gt;
http://superuser.com/questions/201251/how-to-add-textmate-to-my-path-on-mac&lt;br /&gt;
https://github.com/textmate/textmate/issues/327</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/269805509768664483'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/269805509768664483'/><link rel='alternate' type='text/html' href='http://engineerflies.blogspot.com/2013/01/textmate.html' title='TextMateでパス指定でファイルを開く'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01700091790800160715</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-6758697817819098194.post-9066536181608494871</id><published>2013-01-07T05:43:00.001+00:00</published><updated>2013-01-07T05:46:06.048+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Git"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Ruby/ Ruby on Rails"/><title type='text'>CodeSchoolを試してみてる</title><content type='html'>最近いろいろなタイプのオンラインの学習サイトが乱立していることは皆さんもご存知のことと思います。&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&#39;http://jp.techcrunch.com/archives/201208215-ways-to-learn-code-from-the-comfort-of-your-own-browser/&#39;&gt;お手軽にプログラミングを学習したい人のための厳選5サイト&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
その中にはあまりにも一般化しすぎているものや、”やりたいことはあるけど使い勝手がいまいち。。”的なものなどあって、試してみるまでなかなかどれが良いか分かりません。そんな中周りの評判が良かったのと、自分で使った感じも良かったので&lt;a href=&#39;http://www.codeschool.com/&#39;&gt;CodeSchool&lt;/a&gt;を使い始めています。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;コードスクールの良さ&lt;/h2&gt;&lt;br /&gt;
コードスクールが良いのは、書きながら覚えていくことにラーニングのアプリケーションが特化しているので知識の吸収効率が良いこと、それから、&lt;a href=&#39;http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html&#39;&gt;ながーーいリファレンス&lt;/a&gt;から必要な情報を抽出する手間を省いてくれていることなどです。&lt;br /&gt;
&lt;br /&gt;
Webのエンジニアリングの世界って分量的にカバーしておくべきが多いですよね？CodeSchoolは月＄５０と割高な感じなんですが、全ての技術に分厚い本を買って望む暇は無いけれど体系化した知識を付けてないと業務上の実践では不安というケースには有効です。&lt;br /&gt;
&lt;br /&gt;
コースは&lt;a href=&#39;http://www.codeschool.com/courses&#39;&gt;こんな感じ&lt;/a&gt;のがあります。今のところRuby on Rails界隈のスタックが多いけど、徐々に汎用的なコースが増えてきている感じがします。&lt;br /&gt;
&lt;br /&gt;
Git, Sass, CSS, Mobile, HTML5, Coffeescript, jQuery, iOSなんかのコースがあるのもうれしいですね。&lt;br /&gt;
- &lt;a href=&#39;http://www.codeschool.com/courses/tag/javascript&#39;&gt;Javascript&lt;/a&gt;&lt;br /&gt;
- &lt;a href=&#39;http://www.codeschool.com/courses/tag/design&#39;&gt;デザイン&lt;/a&gt;&lt;br /&gt;
- &lt;a href=&#39;http://www.codeschool.com/courses/tag/webtools&#39;&gt;Web tools&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;始めた理由&lt;/h2&gt;&lt;br /&gt;
- 以前iKnowを毎日やって成果が出たので感覚的にこういう感じのタイプの公文式みたいに繰り返しやって覚えるオンラインラーニングに慣れている&lt;br /&gt;
- 毎日２時間の学習時間は取れないけど、３０分なら取れる。週に一日２時間よりも、毎日３０分x５日の方が頭に定着する&lt;br /&gt;
- ＄５０は高いけど本の料金やWeb上のドキュメントとそれにかける時間を考えるとまあ良いかなと思える。仕事への投資と思えば安い。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
迷っている人は全てのコースの１個目のチャレンジは無料なのでものの試しにやってみることをお勧めします。ユーザ登録しておくとたまにディスカウントのメールが来るので良いですよ。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
以上、また一ヶ月後に使った感想を書くかも！&lt;br /&gt;
&lt;br /&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/9066536181608494871'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/9066536181608494871'/><link rel='alternate' type='text/html' href='http://engineerflies.blogspot.com/2013/01/codeschool.html' title='CodeSchoolを試してみてる'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01700091790800160715</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-6758697817819098194.post-1911754263134932198</id><published>2013-01-06T10:06:00.000+00:00</published><updated>2014-11-12T01:24:56.590+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Essays and Reports"/><category scheme="http://www.blogger.com/atom/ns#" term="Mac"/><title type='text'>Macのキーリピートを”さらに”早くする</title><content type='html'>Macでキーリピート（キーボードの出力を繰り返し行うこと）の早さの設定は環境設定からの標準に設定できる範囲では非常に遅い。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj94P-jk8zQZA5IFYzCUc9IKOqZsU2guRlgvpUiULoobobbIhQF2TDcT3hus-ilxEaiKLNRZ3tTHnSq2-aXn4TDDyyiVpZDu809lq71aAu1BHo2ixrUq7xIRo1uFUgBuKYEbPS-o7XsJ3sL/s1600/22fig01.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj94P-jk8zQZA5IFYzCUc9IKOqZsU2guRlgvpUiULoobobbIhQF2TDcT3hus-ilxEaiKLNRZ3tTHnSq2-aXn4TDDyyiVpZDu809lq71aAu1BHo2ixrUq7xIRo1uFUgBuKYEbPS-o7XsJ3sL/s400/22fig01.jpg&quot; height=&quot;374&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;a href=&quot;http://hints.macworld.com/article.php?story=20090823193018149&quot;&gt;defaults write&lt;/a&gt;から直接編集してもまだ遅い&lt;br /&gt;
&lt;br /&gt;
それで見つけたのが&lt;a href=&quot;http://www.midwesternmac.com/blogs/jeff-geerling/supercharge-your-key-repeat&quot;&gt;この記事&lt;/a&gt;。 &lt;a href=&quot;http://pqrs.org/macosx/keyremap4macbook/&quot;&gt;KeyRemap4MacBook&lt;/a&gt; というアプリを使えばkeyの再配置だけでなく、リピートの早さも設定できる。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtwL5uK03_WocadHgoksHNtf5f50WmU0uhgiOHAw5j7GzYQRqGzMfIYB7bcH4ZHizRCmT5_Qeeg9ZmVlSoGSFeXJdRVClo9dt-CT8lB08ZlTKkiLRaqe9zn4pni56liHYdbZdL-11ZXgcZ/s1600/keyremap4macbook-change-how-your-mac-keyboard-functions-its-layout_2.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtwL5uK03_WocadHgoksHNtf5f50WmU0uhgiOHAw5j7GzYQRqGzMfIYB7bcH4ZHizRCmT5_Qeeg9ZmVlSoGSFeXJdRVClo9dt-CT8lB08ZlTKkiLRaqe9zn4pni56liHYdbZdL-11ZXgcZ/s400/keyremap4macbook-change-how-your-mac-keyboard-functions-its-layout_2.png&quot; height=&quot;392&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
- Initial wait で最初にキーを押してからリピートが始まるまでの時間&lt;br /&gt;
- Waitでリピートの間隔&lt;br /&gt;
をそれぞれ設定すれば完了だ。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Macを使うようになってからずーーーーーっとおざなりにしてしまっていたうざったい問題がこれで解決した。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/1911754263134932198'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/1911754263134932198'/><link rel='alternate' type='text/html' href='http://engineerflies.blogspot.com/2013/01/mac.html' title='Macのキーリピートを”さらに”早くする'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01700091790800160715</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj94P-jk8zQZA5IFYzCUc9IKOqZsU2guRlgvpUiULoobobbIhQF2TDcT3hus-ilxEaiKLNRZ3tTHnSq2-aXn4TDDyyiVpZDu809lq71aAu1BHo2ixrUq7xIRo1uFUgBuKYEbPS-o7XsJ3sL/s72-c/22fig01.jpg" height="72" width="72"/></entry><entry><id>tag:blogger.com,1999:blog-6758697817819098194.post-7498389159546171629</id><published>2012-12-25T03:23:00.000+00:00</published><updated>2012-12-25T03:23:41.567+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ruby/ Ruby on Rails"/><title type='text'>lightwindowのHTMLを:js =&gt; trueなexampleで試験するのはwithin_frameが良いけどissues #365に遭遇した</title><content type='html'>Integration testを書いていたらlight windowの中にIframeでレンダリングされるHTML pageがあって、testにはCapybaraのwithin_frameが良いことを発見した。within_frameはSeleniumにも&lt;a href=&#39;http://www.rubydoc.info/gems/capybara-webkit/0.12.1/Capybara/Driver/Webkit#within_frame-instance_method&#39;&gt;Webkit&lt;/a&gt;にもある。&lt;br /&gt;
&lt;br /&gt;
ただし、lightwindowに親のURLを変えるようなjavascriptがありこの&lt;a href=&#39;https://github.com/thoughtbot/capybara-webkit/issues/365&#39;&gt;issue #365&lt;/a&gt;に遭遇してしまった。&lt;br /&gt;
&lt;br /&gt;
そもそもAjaxでリクエストした結果をIframeに描写するという実装は複雑すぎるしあんまりテストフレンドリーじゃないからやめたい。ということで結局は実装を変えることにした</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/7498389159546171629'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/7498389159546171629'/><link rel='alternate' type='text/html' href='http://engineerflies.blogspot.com/2012/12/lightwindowhtmljs-trueexamplewithinfram.html' title='lightwindowのHTMLを:js =&gt; trueなexampleで試験するのはwithin_frameが良いけどissues #365に遭遇した'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01700091790800160715</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-6758697817819098194.post-8423997040047450371</id><published>2012-12-06T18:09:00.002+00:00</published><updated>2012-12-06T18:09:51.828+00:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="English"/><title type='text'>英語を学習する人に &quot;Metro&quot; を薦めたい○個の理由</title><content type='html'>&lt;br /&gt;
- Metroとは http://metro.co.uk/&lt;br /&gt;
&amp;nbsp; ロンドンで各駅で無料で配られているタブロイド紙の1つです。ここで話しているのはそのウェブ版です。&lt;br /&gt;
&lt;br /&gt;
- 単語が簡単&lt;br /&gt;
&amp;nbsp; 担当直入で比喩が少ないので単語一個一個の意味は分かるけど文の意味が分からないといったことがほとんど無い。これはきっと移民向けに設計されているんではないかというほど&lt;br /&gt;
&lt;br /&gt;
- 文が短い&lt;br /&gt;
&amp;nbsp; GuardianとかReutorsとか良質の新聞は専門用語が多い上に論文調で長い。質が良くても長すぎて結論がわからないまま記事を読み捨ててしまったりしていたらいろんな情報にリーチできないからきっとすぐに英語でニュースを追うことに飽きますよね。Metroは文が短いので興味駆動で長く新聞を読み続けるのにもってこい。毎朝読む習慣が１年以上続いています。英語学習は一定のレベル（文法を一通り把握してる）までいったら後は質より量&lt;br /&gt;
&lt;br /&gt;
- 他紙では取り上げないくだらないニュースも載ってる&lt;br /&gt;
&amp;nbsp; たとえばこれ- http://goo.gl/Hg8MS - 都会のきつねがカップルを攻撃。撃退され逃げた瞬間に車にひかれてペシャンコ&lt;br /&gt;
&amp;nbsp; こんなローカルネタを地球の反対側から読めるなんて素晴らしい。でも愚弄することなかれ。つまらないニュースにこそスラングや口語などの普段知れない生活観あふれる単語がつまっています。&lt;br /&gt;
&lt;br /&gt;
- UIがすばらしい&lt;br /&gt;
&amp;nbsp; 去年なにげに&#39;Newspaper App of the Year&#39;を受賞している http://goo.gl/pSJSH&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
みんなMetroおすすめですよ。僕はいつでもどこでも読めるようにBylineというオフラインRSSリーダにMetroを登録しておいて毎日記事を溜め込んで読んでいます。楽しくて毎日読みたくなりますよ&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/8423997040047450371'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6758697817819098194/posts/default/8423997040047450371'/><link rel='alternate' type='text/html' href='http://engineerflies.blogspot.com/2012/12/metro.html' title='英語を学習する人に &quot;Metro&quot; を薦めたい○個の理由'/><author><name>Anonymous</name><uri>http://www.blogger.com/profile/01700091790800160715</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author></entry></feed>