<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="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" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-7260213576531512885</atom:id><lastBuildDate>Wed, 28 Aug 2024 05:48:40 +0000</lastBuildDate><category>freebsd</category><category>c++</category><category>latex</category><category>cuda</category><category>programming</category><category>algorithm</category><category>linux</category><category>firefox</category><category>haskell</category><category>pdf</category><category>vim</category><category>xpdf</category><category>ampl</category><category>cplex</category><category>fedora</category><category>icpc</category><category>ruby</category><category>windows</category><title>Floating on the lake</title><description>研究とかLinuxとかプログラミングの話をダラダラ書いてます。&#xa;昔はFreeBSDのことも書いていましたが、最近Linuxに変えてしまいました。</description><link>http://fonlake.blogspot.com/</link><managingEditor>noreply@blogger.com (ztw)</managingEditor><generator>Blogger</generator><openSearch:totalResults>83</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7260213576531512885.post-8407818273086925769</guid><pubDate>Mon, 21 Dec 2009 16:06:00 +0000</pubDate><atom:updated>2009-12-22T01:06:50.457+09:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">programming</category><title>ボトルネック</title><description>最近8coreのワークステーションを使う機会があったのですが、そのCPUのパワーを引き出すことの難しさを身をもって経験しました。大量のデータを処理したかったのですが、HDDがボトルネックになって、全然CPUが活躍させられないのです。&lt;br /&gt;
&lt;br /&gt;
これからの時代、より大量のデータを処理する局面が増えてくると思うのですが、いかにデータをCPUに流してやるかが重要なんですね。SSDとかだともっとましになるだろうし、または分散ファイルシステムにしてMapReduce的なことをするのも向いてるのかなあという印象です。&lt;br /&gt;
&lt;br /&gt;
以前までのやってた研究だと、データはほんの少しでほとんどがいかに計算を速くするかを問題にしていたので、新鮮な経験でした。</description><link>http://fonlake.blogspot.com/2009/12/blog-post_22.html</link><author>noreply@blogger.com (ztw)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7260213576531512885.post-1525610521203932805</guid><pubDate>Thu, 17 Dec 2009 17:37:00 +0000</pubDate><atom:updated>2009-12-18T02:38:31.036+09:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">fedora</category><category domain="http://www.blogger.com/atom/ns#">latex</category><category domain="http://www.blogger.com/atom/ns#">linux</category><title>Fedora12のevinceで日本語表示</title><description>最近UbuntuだけでなくFedoraも使うようになったが、FedoraはUbuntuに比べると日本語対応が弱いようで結構苦労する。標準では日本語のPDFも見られないし、日本語のLaTeXもレポジトリにないし。&lt;br /&gt;
&lt;br /&gt;
今日はFedora 12上のevinceで日本語を表示する方法が判明したのでメモとして書いておく。&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;evinceのインストール: 多分標準で入る&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://poppler.freedesktop.org/&quot;&gt;poppler&lt;/a&gt;のサイトからpoppler-data-x.y.z.tar.gzの最新版をダウンロード&lt;/li&gt;
&lt;li&gt;poppler-dataを展開&lt;/li&gt;
&lt;li&gt;Makefileのprefixを/usrに変更&lt;/li&gt;

&lt;pre&gt;&quot;prefix = /usr/local&quot; =&amp;gt; &quot;prefix = /usr&quot;&lt;/pre&gt;
&lt;li&gt;&amp;nbsp;(rootで) make install&lt;br /&gt;
&lt;/li&gt;
&lt;/ol&gt;これで日本語フォントの埋め込まれたPDFは読めるようになった。ただ埋め込まれていないPDFに対応するにはさらに設定が必要な気がする。手元にそんなPDFファイルがなかったので確認していないけど。</description><link>http://fonlake.blogspot.com/2009/12/fedora12evince.html</link><author>noreply@blogger.com (ztw)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7260213576531512885.post-8888012428308420938</guid><pubDate>Sun, 13 Dec 2009 17:02:00 +0000</pubDate><atom:updated>2009-12-14T02:02:59.309+09:00</atom:updated><title>ひさしぶりに</title><description>前回の投稿から結構経ってしまいました。この間に就職活動でさんざん苦労したものの、無職確定寸前でなんとか就職が決まって、その後関東に引越したりしました。&lt;br /&gt;
&lt;br /&gt;
すっかりブログのことは忘れていましたが、先日研究室の後輩と飲んだときに、なぜか教えていなかったこのブログのことを知っているという話になって驚きました。そんなこんなで、読者がいるならまたボチボチ再開しようかなあという気がしてきました。&lt;br /&gt;
&lt;br /&gt;
ただ、ネタをどうしようかなあという感じです。</description><link>http://fonlake.blogspot.com/2009/12/blog-post.html</link><author>noreply@blogger.com (ztw)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7260213576531512885.post-711112616531477085</guid><pubDate>Wed, 08 Jul 2009 15:59:00 +0000</pubDate><atom:updated>2009-12-20T00:47:07.130+09:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">c++</category><category domain="http://www.blogger.com/atom/ns#">ruby</category><title>C++によるrubyの拡張</title><description>現在研究中のプログラムをライブラリ化して簡単に使えるように ruby の binding がうまくいくかを試してみようと思った。README.EXT.ja や &lt;a href=&quot;http://www.ruby-doc.org/docs/ProgrammingRuby/html/ext_ruby.html&quot;&gt;Programming Ruby&lt;/a&gt;を参考に簡単なものを作ってみたが予想外に苦労するはめになった。それは、クラスにメソッドを登録するところで、以下のようなコードでもエラーが出るのだ。&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;VALUE initialize(VALUE self){&lt;br /&gt;
    return Qnil;&lt;br /&gt;
}&lt;br /&gt;
...&lt;br /&gt;
void Init_something(void){&lt;br /&gt;
....&lt;br /&gt;
rb_define_method(klass, &quot;initialize&quot;, initialize, 0);&lt;br /&gt;
....&lt;br /&gt;
}&lt;br /&gt;
&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
エラーメッセージ&lt;br /&gt;
&lt;blockquote&gt;error: invalid conversion from ‘VALUE (*)(VALUE)’ to ‘VALUE (*)(...)’&lt;br /&gt;
&lt;/blockquote&gt;&lt;br /&gt;
&lt;br /&gt;
これは rb_define_method の引数の型が合わないことが原因で、reinterpret_cast を使って対処することにした。この方法が分かるまで本当に面倒だった。&lt;br /&gt;
&lt;blockquote&gt;#define RB_FUNC(f) reinterpret_cast&amp;lt;VALUE (*)(...)&amp;gt;(f)&lt;br /&gt;
&lt;br /&gt;
void Init_something(void){&lt;br /&gt;
....&lt;br /&gt;
rb_define_method(klass, &quot;initialize&quot;, RB_FUNC(initialize), 0);&lt;br /&gt;
....&lt;br /&gt;
}&lt;br /&gt;
&lt;/blockquote&gt;</description><link>http://fonlake.blogspot.com/2009/07/cruby.html</link><author>noreply@blogger.com (ztw)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7260213576531512885.post-6030208389165888236</guid><pubDate>Sun, 24 May 2009 16:30:00 +0000</pubDate><atom:updated>2009-05-25T01:45:58.238+09:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">c++</category><title>C++の前方宣言</title><description>C++には前方宣言というのがあって、うまく使うとヘッダファイルのインクルード関係を整理できる。なんとなく使っていたが、今日一つはまった点をメモ。&lt;br /&gt;&lt;br /&gt;下に例を載せているが、クラス定義の中で前方宣言したクラスの変数を定義する際は、ポインタやテンプレート変数ならばいいけれども、そのまま使うことはできない。vectorのテンプレート変数にする分には問題ない。&lt;br /&gt;&lt;br /&gt;ここらへんはごまかして勉強したのでダメですね。&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;// case1: OK&lt;br /&gt;&lt;br /&gt;class A; // 前方宣言&lt;br /&gt;&lt;br /&gt;class B{&lt;br /&gt;    A *a;&lt;br /&gt;};&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;// case2: OK&lt;br /&gt;&lt;br /&gt;class A;&lt;br /&gt;&lt;br /&gt;class B{&lt;br /&gt;    std::vector&amp;lt;A&amp;gt; a;&lt;br /&gt;};&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;// case3: OK&lt;br /&gt;&lt;br /&gt;class A;&lt;br /&gt;&lt;br /&gt;template&amp;lt;class T=A&amp;gt;&lt;br /&gt;class B{&lt;br /&gt;    T a;&lt;br /&gt;};&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;// case4: NG&lt;br /&gt;&lt;br /&gt;class A;&lt;br /&gt;&lt;br /&gt;class B{&lt;br /&gt;    A a;&lt;br /&gt;};&lt;br /&gt;&lt;/pre&gt;</description><link>http://fonlake.blogspot.com/2009/05/c.html</link><author>noreply@blogger.com (ztw)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7260213576531512885.post-3283654008301692986</guid><pubDate>Mon, 06 Oct 2008 15:18:00 +0000</pubDate><atom:updated>2008-10-07T00:22:19.528+09:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">freebsd</category><title>FreeBSDでsincos</title><description>glibcではsincosを使うことができるが, FreeBSD上ではlibcに入っていないので使うことができない. 以下のようなインクルードファイルを作ってやれば一応使える. 以前どこかのページで見て使っていたのだが, どこのページだったかは失念してしまった.&lt;br /&gt;&lt;pre&gt;inline void sincos(double t, double *s, double *c){&lt;br /&gt;        asm(&quot;fsincos;&quot; : &quot;=t&quot; (*c), &quot;=u&quot; (*s) : &quot;0&quot; (t) : &quot;st(7)&quot;);&lt;br /&gt;        // *s = sin(t); *c = cos(t)&lt;br /&gt;}&lt;/pre&gt;</description><link>http://fonlake.blogspot.com/2008/10/sincos.html</link><author>noreply@blogger.com (ztw)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7260213576531512885.post-8982773000478450775</guid><pubDate>Sat, 07 Jun 2008 15:05:00 +0000</pubDate><atom:updated>2008-06-08T12:45:12.658+09:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">freebsd</category><title>FreeBSD上でのCPUの使用率の計測方法</title><description>FreeBSDでCPUの使用率をチェックするために, fluxboxのドック用の自作アプリを使っているのだが, 最近 7-stable のソースの更新をしたところ, そのアプリが動かなくなった. 元々, xosview のソースを流用していて, それでは kvm を使って使用率を取得していたが, どうも仕様が変更になったらしい. 試しに, xosview を入れてみるとやはり動かなかった.&lt;br /&gt;&lt;br /&gt;そこで, powerd.c のソースを参考にして, sysctl を使ってCPUの使用率を取るように変更した. 簡単に解説すると, まず, 前処理として, Management Information Base (MIB) を取得しておき, 使用率を取る際はその MIB を使って sysctl(3) を使う. プログラムの一部だけだが, 以下のようになった.&lt;pre&gt;&lt;br /&gt;#include &amp;lt;sys/resource.h&amp;gt;&lt;br /&gt;#include &amp;lt;sys/types.h&amp;gt;&lt;br /&gt;#include &amp;lt;sys/sysctl.h&amp;gt;&lt;br /&gt;&lt;br /&gt;static int cp_time_mib[2];&lt;br /&gt;&lt;br /&gt;/* 前処理. 1回だけ行う. */&lt;br /&gt;void preprocess(void){&lt;br /&gt;    int len = 2;&lt;br /&gt;    if (sysctlnametomib(&quot;kern.cp_time&quot;, cp_time_mib, &amp;len))&lt;br /&gt;    {&lt;br /&gt;        perror(&quot;lookup kern.cp_time&quot;);&lt;br /&gt;        exit(1);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;/* CPUの使用率を百分率で返す */&lt;br /&gt;double cpu_getusage(void) &lt;br /&gt;{&lt;br /&gt;    long cpu, nice, system, idle, used, total;&lt;br /&gt;    long cpu_time[CPUSTATES];&lt;br /&gt;    size_t cpu_time_len;&lt;br /&gt;&lt;br /&gt;    cpu_time_len = sizeof(cpu_time);&lt;br /&gt;    if (sysctl(cp_time_mib, 2, cpu_time, &amp;cpu_time_len, NULL, 0))&lt;br /&gt;    {&lt;br /&gt;        perror(&quot;sysctl error&quot;);&lt;br /&gt;        exit(1);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    cpu = cpu_time[CP_USER];&lt;br /&gt;    nice = cpu_time[CP_NICE];&lt;br /&gt;    system = cpu_time[CP_SYS];&lt;br /&gt;    idle = cpu_time[CP_IDLE];&lt;br /&gt;&lt;br /&gt;    used = cpu + nice + system;&lt;br /&gt;    total = used + idle;&lt;br /&gt;    return 100.0 * used / (double) total;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;</description><link>http://fonlake.blogspot.com/2008/06/freebsdcpu.html</link><author>noreply@blogger.com (ztw)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7260213576531512885.post-3276887472001555973</guid><pubDate>Thu, 22 May 2008 16:27:00 +0000</pubDate><atom:updated>2008-05-23T01:33:34.096+09:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">latex</category><title>tabular の列間の調節</title><description>今 LaTeX で論文を書いていて, ある表の横幅が長くなりすぎて困っていた. その表は列間の空白が比較的多くて, ここをうまく縮めればいいのになあと思ったので, 対処法を調べてみた.&lt;br /&gt;&lt;br /&gt;tabular の代わりに tabular* を使って,&lt;blockquote&gt;\begin{tabular*}{??pt}{@{\extracolsep{\fill}}c|rr}&lt;br /&gt;...&lt;br /&gt;\end{tabular*}&lt;/blockquote&gt;&lt;br /&gt;のようにしてやればよいことが分かった. \fill のところは好きなサイズを入れることも可能. 特に列間を縮めたければ, -5pt とか入れるとかなり縮まる.&lt;br /&gt;&lt;br /&gt;参考:&lt;br /&gt;&lt;a href=&quot;http://www.comb.kokushikan.ac.jp/inlab/LaTeX/node26.html&quot;&gt;http://www.comb.kokushikan.ac.jp/inlab/LaTeX/node26.html&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://www.tex.ac.uk/cgi-bin/texfaq2html?label=fixwidtab&quot;&gt;http://www.tex.ac.uk/cgi-bin/texfaq2html?label=fixwidtab&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://www-h.eng.cam.ac.uk/help/tpl/textprocessing/teTeX/latex/latex2e-html/ltx-68.html&quot;&gt;http://www-h.eng.cam.ac.uk/help/tpl/textprocessing/teTeX/latex/latex2e-html/ltx-68.html&lt;/a&gt;</description><link>http://fonlake.blogspot.com/2008/05/tabular.html</link><author>noreply@blogger.com (ztw)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7260213576531512885.post-605218800847262614</guid><pubDate>Wed, 21 May 2008 10:30:00 +0000</pubDate><atom:updated>2008-05-21T19:37:19.788+09:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">freebsd</category><title>xvidcap のコンパイル</title><description>ここ最近 FreeBSD 7-stable で sysutils/xvidcap をコンパイルしようとすると, 最後のリンクで失敗する状況が続いていた. 特にすぐ xvidcap を使うことはなかったので, そのうち直るだろうと放っておいたが, portupgrade -a するたびにエラーが報告されるのがだんだん気になってきたので, ちょっと調べてみた.&lt;br /&gt;&lt;br /&gt;libtheora と libx264 がリンクするファイルのリストに載っていなかったのが原因だと分かった. ports/sysutils/xvidcap/work/xvidcap-1.1.4p1/src/Makefile の PACKAGE_LIBS の部分を赤字のように変更すると無事コンパイルできるようになった.&lt;blockquote&gt;PACKAGE_LIBS = -pthread -L/usr/local/lib -lglade-2.0 -lgtk-x11-2.0 -lxml2 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lXext -lXrender -lXinerama -lXi -lXrandr -lXcursor -lXcomposite -lXdamage -lcairo -lpangoft2-1.0 -lpango-1.0 -lm -lfreetype -lz -lfontconfig -lX11 -lXfixes -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lglib-2.0 -liconv &lt;span style=&quot;color: rgb(255, 0, 0);&quot;&gt;-ltheora -lx264&lt;/span&gt;&lt;/blockquote&gt;</description><link>http://fonlake.blogspot.com/2008/05/xvidcap.html</link><author>noreply@blogger.com (ztw)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7260213576531512885.post-2850999176357626930</guid><pubDate>Mon, 19 May 2008 15:29:00 +0000</pubDate><atom:updated>2008-05-20T00:36:41.620+09:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">firefox</category><title>マウスの真ん中のボタンとFirefox</title><description>Firefox でマウスの真ん中のボタンをリンクの上で押すと, そのリンクを新しいタブにロードしてくれて便利に使っている. しかし, ボタンを押したときにリンクからはずれていると, そのときにコピーしていた文字列を URL にしてアクセスして少し困っていた. ただ, どうしたらその機能を停止できるかは分からなかったので, 今まで我慢して使っていた.&lt;br /&gt;&lt;br /&gt;そして, 今日なんとなく about:config を何となく見ていたら, その解消法が分かった.&lt;blockquote&gt;middlemouse.contentLoadURL&lt;/blockquote&gt;を false にすればいいようだ. これでますます快適になる.&lt;br /&gt;&lt;br /&gt;そろそろ Firefox 3 も試したいなあ.</description><link>http://fonlake.blogspot.com/2008/05/firefox.html</link><author>noreply@blogger.com (ztw)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7260213576531512885.post-6692489231606610653</guid><pubDate>Sun, 18 May 2008 16:40:00 +0000</pubDate><atom:updated>2008-05-19T01:45:37.279+09:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">c++</category><category domain="http://www.blogger.com/atom/ns#">programming</category><title>vector にはまる</title><description>STL の vector を使っていて, vector の要素へのポインタを使っていた所, そのポインタの指す先が勝手に破壊される自体に遭遇して悩んだ. 結果的には vector に push_back した際に vector が自動的に resize して, ポインタの指す先が解放されていたのが原因だと判明. とりあえずは, vector::reserve で自動的な resize を抑制することで解決した. 根本的な問題の解決のためにデザインを考え直さなければ. vector のもっとも便利な自動 resize でつまづくことになるとは...</description><link>http://fonlake.blogspot.com/2008/05/vector.html</link><author>noreply@blogger.com (ztw)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7260213576531512885.post-6837314406819030461</guid><pubDate>Thu, 15 May 2008 01:22:00 +0000</pubDate><atom:updated>2008-05-15T10:45:18.919+09:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">freebsd</category><title>zsh と FDclone</title><description>zsh を使うようになってから, なぜか FDclone が使えなくなった. &quot;malloc(): Cannot allocate memory&quot; というメッセージが出て FDclone が死んでしまったのだ. その原因を調べてみたところ, zshrc に HISTFILE と HISTSIZE というのを書いていて, ここで zsh の履歴の設定をしているのだが, この環境変数が FDclone も使っていることが原因だったと分かった.&lt;br /&gt;&lt;br /&gt;zsh のために &quot;export HISTSIZE = 100000&quot; と設定していたが, これを FDclone も読み込み, しかも, FDclone 内部では HISTSIZE を short型で取っていたため, 100000 があふれて -31072 になってしまっていた. そのせいで, malloc(-31072) というのを実行して死んだのだ.&lt;br /&gt;&lt;br /&gt;解決法としては, FD_HISTFILE と FD_HISTSIZE という環境変数を設定してやればOK.</description><link>http://fonlake.blogspot.com/2008/05/zsh-fdclone.html</link><author>noreply@blogger.com (ztw)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7260213576531512885.post-6277449048123747871</guid><pubDate>Mon, 12 May 2008 03:33:00 +0000</pubDate><atom:updated>2008-05-12T12:39:25.300+09:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">c++</category><title>valarrayのconstructorとresize</title><description>valarrayの各要素に同じ値を入れる方法として constructor を使う方法と resize を使う方法があるが, そのインターフェースの違いに戸惑ったのでメモ.&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt; valarray(const T&amp; v, size_t num)&lt;br /&gt;&lt;li&gt; valarray.resize(size_t num, const T v = T())&lt;br /&gt;&lt;/ul&gt;このように, 引数の順番が逆になっているのに気づいていなかった. T と size_t が異なればコンパイル時にエラーが出るが, そうでない場合はそのままバグになるので気をつけないと.&lt;br /&gt;&lt;br /&gt;例:&lt;br /&gt;&lt;!-- Generator: GNU source-highlight 2.7&lt;br /&gt;by Lorenzo Bettini&lt;br /&gt;http://www.lorenzobettini.it&lt;br /&gt;http://www.gnu.org/software/src-highlite --&gt;&lt;br /&gt;&lt;pre&gt;&lt;tt&gt;&lt;font color=&quot;#000000&quot;&gt;01:&lt;/font&gt; &lt;b&gt;&lt;font color=&quot;#000080&quot;&gt;#include&lt;/font&gt;&lt;/b&gt;&lt;font color=&quot;#FF0000&quot;&gt;&amp;lt;valarray&amp;gt;&lt;/font&gt;&lt;br /&gt;&lt;font color=&quot;#000000&quot;&gt;02:&lt;/font&gt; &lt;b&gt;&lt;font color=&quot;#000080&quot;&gt;#include&lt;/font&gt;&lt;/b&gt;&lt;font color=&quot;#FF0000&quot;&gt;&amp;lt;iostream&amp;gt;&lt;/font&gt;&lt;br /&gt;&lt;font color=&quot;#000000&quot;&gt;03:&lt;/font&gt;&lt;br /&gt;&lt;font color=&quot;#000000&quot;&gt;04:&lt;/font&gt; &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;using&lt;/font&gt;&lt;/b&gt; &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;namespace&lt;/font&gt;&lt;/b&gt; std&lt;font color=&quot;#990000&quot;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&quot;#000000&quot;&gt;05:&lt;/font&gt;&lt;br /&gt;&lt;font color=&quot;#000000&quot;&gt;06:&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;int&lt;/font&gt; &lt;b&gt;&lt;font color=&quot;#000000&quot;&gt;main&lt;/font&gt;&lt;/b&gt;&lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;void&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt;&lt;font color=&quot;#FF0000&quot;&gt;{&lt;/font&gt;&lt;br /&gt;&lt;font color=&quot;#000000&quot;&gt;07:&lt;/font&gt;     valarray&lt;font color=&quot;#990000&quot;&gt;&amp;lt;&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;char&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;&amp;gt;&lt;/font&gt; &lt;b&gt;&lt;font color=&quot;#000000&quot;&gt;v&lt;/font&gt;&lt;/b&gt;&lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#FF0000&quot;&gt;&#39;a&#39;&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;,&lt;/font&gt; &lt;font color=&quot;#993399&quot;&gt;5&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;);&lt;/font&gt;&lt;br /&gt;&lt;font color=&quot;#000000&quot;&gt;08:&lt;/font&gt;     &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;for&lt;/font&gt;&lt;/b&gt;&lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;int&lt;/font&gt; i &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; &lt;font color=&quot;#993399&quot;&gt;0&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;;&lt;/font&gt; i &lt;font color=&quot;#990000&quot;&gt;&amp;lt;&lt;/font&gt; v&lt;font color=&quot;#990000&quot;&gt;.&lt;/font&gt;&lt;b&gt;&lt;font color=&quot;#000000&quot;&gt;size&lt;/font&gt;&lt;/b&gt;&lt;font color=&quot;#990000&quot;&gt;();&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;++&lt;/font&gt;i&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; cout &lt;font color=&quot;#990000&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt; v&lt;font color=&quot;#990000&quot;&gt;[&lt;/font&gt;i&lt;font color=&quot;#990000&quot;&gt;];&lt;/font&gt; cout &lt;font color=&quot;#990000&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt; endl&lt;font color=&quot;#990000&quot;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&quot;#000000&quot;&gt;09:&lt;/font&gt;&lt;br /&gt;&lt;font color=&quot;#000000&quot;&gt;10:&lt;/font&gt;     v&lt;font color=&quot;#990000&quot;&gt;.&lt;/font&gt;&lt;b&gt;&lt;font color=&quot;#000000&quot;&gt;resize&lt;/font&gt;&lt;/b&gt;&lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#993399&quot;&gt;5&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;,&lt;/font&gt;&lt;font color=&quot;#FF0000&quot;&gt;&#39;b&#39;&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;);&lt;/font&gt;&lt;br /&gt;&lt;font color=&quot;#000000&quot;&gt;11:&lt;/font&gt;     &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;for&lt;/font&gt;&lt;/b&gt;&lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;int&lt;/font&gt; i &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; &lt;font color=&quot;#993399&quot;&gt;0&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;;&lt;/font&gt; i &lt;font color=&quot;#990000&quot;&gt;&amp;lt;&lt;/font&gt; v&lt;font color=&quot;#990000&quot;&gt;.&lt;/font&gt;&lt;b&gt;&lt;font color=&quot;#000000&quot;&gt;size&lt;/font&gt;&lt;/b&gt;&lt;font color=&quot;#990000&quot;&gt;();&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;++&lt;/font&gt;i&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; cout &lt;font color=&quot;#990000&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt; v&lt;font color=&quot;#990000&quot;&gt;[&lt;/font&gt;i&lt;font color=&quot;#990000&quot;&gt;];&lt;/font&gt; cout &lt;font color=&quot;#990000&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt; endl&lt;font color=&quot;#990000&quot;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&quot;#000000&quot;&gt;12:&lt;/font&gt;&lt;br /&gt;&lt;font color=&quot;#000000&quot;&gt;13:&lt;/font&gt;     &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;return&lt;/font&gt;&lt;/b&gt; &lt;font color=&quot;#993399&quot;&gt;0&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&quot;#000000&quot;&gt;14:&lt;/font&gt; &lt;font color=&quot;#FF0000&quot;&gt;}&lt;/font&gt;&lt;br /&gt;&lt;/tt&gt;&lt;/pre&gt;</description><link>http://fonlake.blogspot.com/2008/05/valarrayconstructorresize.html</link><author>noreply@blogger.com (ztw)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7260213576531512885.post-8162856329271202955</guid><pubDate>Sat, 10 May 2008 16:07:00 +0000</pubDate><atom:updated>2008-05-11T01:14:09.415+09:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">c++</category><category domain="http://www.blogger.com/atom/ns#">programming</category><title>C++のテンプレートに悩む</title><description>C++のテンプレートにはまった. 下のようにテンプレートの片方のパラメータの特殊化しようとしたが, コンパイルが通らない... C++難しいなあ.&lt;br /&gt;&lt;br /&gt;&lt;!-- Generator: GNU source-highlight 2.7&lt;br /&gt;by Lorenzo Bettini&lt;br /&gt;http://www.lorenzobettini.it&lt;br /&gt;http://www.gnu.org/software/src-highlite --&gt;&lt;br /&gt;(a.cpp)&lt;pre&gt;&lt;tt&gt;&lt;font color=&quot;#000000&quot;&gt;01:&lt;/font&gt; &lt;b&gt;&lt;font color=&quot;#000080&quot;&gt;#include&lt;/font&gt;&lt;/b&gt; &lt;font color=&quot;#FF0000&quot;&gt;&amp;lt;iostream&amp;gt;&lt;/font&gt;&lt;br /&gt;&lt;font color=&quot;#000000&quot;&gt;02:&lt;/font&gt;&lt;br /&gt;&lt;font color=&quot;#000000&quot;&gt;03:&lt;/font&gt; &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;using&lt;/font&gt;&lt;/b&gt; &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;namespace&lt;/font&gt;&lt;/b&gt; std&lt;font color=&quot;#990000&quot;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&quot;#000000&quot;&gt;04:&lt;/font&gt;&lt;br /&gt;&lt;font color=&quot;#000000&quot;&gt;05:&lt;/font&gt; &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;template&lt;/font&gt;&lt;/b&gt;&lt;font color=&quot;#990000&quot;&gt;&amp;lt;&lt;/font&gt;&lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;typename&lt;/font&gt;&lt;/b&gt; &lt;font color=&quot;#009900&quot;&gt;T&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;,&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;int&lt;/font&gt; N&lt;font color=&quot;#990000&quot;&gt;&amp;gt;&lt;/font&gt;&lt;br /&gt;&lt;font color=&quot;#000000&quot;&gt;06:&lt;/font&gt; &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;struct&lt;/font&gt;&lt;/b&gt; &lt;font color=&quot;#009900&quot;&gt;A&lt;/font&gt;&lt;font color=&quot;#FF0000&quot;&gt;{&lt;/font&gt;&lt;br /&gt;&lt;font color=&quot;#000000&quot;&gt;07:&lt;/font&gt;     &lt;font color=&quot;#009900&quot;&gt;int&lt;/font&gt; &lt;b&gt;&lt;font color=&quot;#000000&quot;&gt;val&lt;/font&gt;&lt;/b&gt;&lt;font color=&quot;#990000&quot;&gt;()&lt;/font&gt; &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;const&lt;/font&gt;&lt;/b&gt;&lt;font color=&quot;#990000&quot;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&quot;#000000&quot;&gt;08:&lt;/font&gt; &lt;font color=&quot;#FF0000&quot;&gt;}&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&quot;#000000&quot;&gt;09:&lt;/font&gt;&lt;br /&gt;&lt;font color=&quot;#000000&quot;&gt;10:&lt;/font&gt; &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;template&lt;/font&gt;&lt;/b&gt;&lt;font color=&quot;#990000&quot;&gt;&amp;lt;&amp;gt;&lt;/font&gt;&lt;br /&gt;&lt;font color=&quot;#000000&quot;&gt;11:&lt;/font&gt; &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;template&lt;/font&gt;&lt;/b&gt;&lt;font color=&quot;#990000&quot;&gt;&amp;lt;&lt;/font&gt;&lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;typename&lt;/font&gt;&lt;/b&gt; &lt;font color=&quot;#009900&quot;&gt;T&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;&amp;gt;&lt;/font&gt;&lt;br /&gt;&lt;font color=&quot;#000000&quot;&gt;12:&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;int&lt;/font&gt; A&lt;font color=&quot;#990000&quot;&gt;&amp;lt;&lt;/font&gt;T&lt;font color=&quot;#990000&quot;&gt;,&lt;/font&gt;&lt;font color=&quot;#993399&quot;&gt;1&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;&amp;gt;::&lt;/font&gt;&lt;b&gt;&lt;font color=&quot;#000000&quot;&gt;val&lt;/font&gt;&lt;/b&gt;&lt;font color=&quot;#990000&quot;&gt;()&lt;/font&gt; &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;const&lt;/font&gt;&lt;/b&gt;&lt;font color=&quot;#FF0000&quot;&gt;{&lt;/font&gt;&lt;br /&gt;&lt;font color=&quot;#000000&quot;&gt;13:&lt;/font&gt;     &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;return&lt;/font&gt;&lt;/b&gt; &lt;font color=&quot;#993399&quot;&gt;1&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&quot;#000000&quot;&gt;14:&lt;/font&gt; &lt;font color=&quot;#FF0000&quot;&gt;}&lt;/font&gt;&lt;br /&gt;&lt;font color=&quot;#000000&quot;&gt;15:&lt;/font&gt;&lt;br /&gt;&lt;font color=&quot;#000000&quot;&gt;16:&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;int&lt;/font&gt; &lt;b&gt;&lt;font color=&quot;#000000&quot;&gt;main&lt;/font&gt;&lt;/b&gt;&lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;void&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt;&lt;font color=&quot;#FF0000&quot;&gt;{&lt;/font&gt;&lt;br /&gt;&lt;font color=&quot;#000000&quot;&gt;17:&lt;/font&gt;     A&lt;font color=&quot;#990000&quot;&gt;&amp;lt;&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;int&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;,&lt;/font&gt;&lt;font color=&quot;#993399&quot;&gt;1&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;&amp;gt;&lt;/font&gt; a&lt;font color=&quot;#990000&quot;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&quot;#000000&quot;&gt;18:&lt;/font&gt;     cout &lt;font color=&quot;#990000&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt; a&lt;font color=&quot;#990000&quot;&gt;.&lt;/font&gt;&lt;b&gt;&lt;font color=&quot;#000000&quot;&gt;val&lt;/font&gt;&lt;/b&gt;&lt;font color=&quot;#990000&quot;&gt;()&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt; endl&lt;font color=&quot;#990000&quot;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&quot;#000000&quot;&gt;19:&lt;/font&gt;     &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;return&lt;/font&gt;&lt;/b&gt; &lt;font color=&quot;#993399&quot;&gt;0&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;;&lt;/font&gt;&lt;br /&gt;&lt;font color=&quot;#000000&quot;&gt;20:&lt;/font&gt; &lt;font color=&quot;#FF0000&quot;&gt;}&lt;/font&gt;&lt;br /&gt;&lt;/tt&gt;&lt;/pre&gt;&lt;br /&gt;環境: gcc version 4.2.1 20070719  [FreeBSD]&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;a.cpp:12: error: invalid use of incomplete type &#39;struct A&lt;T, 1&gt;&#39;&lt;br /&gt;a.cpp:6: error: declaration of &#39;struct A&lt;T, 1&gt;&#39;&lt;br /&gt;*** Error code 1&lt;br /&gt;&lt;/pre&gt;</description><link>http://fonlake.blogspot.com/2008/05/c.html</link><author>noreply@blogger.com (ztw)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7260213576531512885.post-6960074348206874014</guid><pubDate>Sat, 10 May 2008 06:12:00 +0000</pubDate><atom:updated>2008-05-12T00:25:03.916+09:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">windows</category><title>Windows XP SP3</title><description>Windows XP SP3 を入れようとしたが, インストールの途中でブルースクリーンが出て失敗. うーん, どうしたものか. 情報を集めないと.&lt;br /&gt;&lt;br /&gt;追記(5/11):&lt;br /&gt;PCは ThinkPad X40 なのだが, SP3 を入れる前に&lt;a href=&quot;http://www-06.ibm.com/jp/domino05/pc/download/download.nsf/jtechinfo/TPAD-SWINST&quot;&gt;ソフトウェア導入支援&lt;/a&gt;を起動してみたら, Windows のパッチが「重要」として挙がっていたので, それをまず入れてみた. すると SP3 が無事にインストールできた. 普通のWindowsのパッチは「KB???」の形式の名前がついているが, 今回のパッチはThinkPad専用とのことで「Q???」の形式の名前だった. これが効いたのだろうか?</description><link>http://fonlake.blogspot.com/2008/05/windows-xp-sp3.html</link><author>noreply@blogger.com (ztw)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7260213576531512885.post-8630019804080924617</guid><pubDate>Mon, 28 Apr 2008 16:49:00 +0000</pubDate><atom:updated>2008-04-29T01:59:32.678+09:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">algorithm</category><category domain="http://www.blogger.com/atom/ns#">haskell</category><title>Left-Leaning Red-Black Tree part2</title><description>&lt;a href=&quot;http://fonlake.blogspot.com/2008/04/left-leaning-red-black-tree.html&quot;&gt;前回&lt;/a&gt;の Left-Leaning Red-Black (LLRB) Tree の Haskell のコードがきちんと動くことを大体確認した. HaskellのData.Setと比べた特徴は以下の通り.&lt;ul&gt;&lt;br /&gt;&lt;li&gt; insert と member は LLRB の方が早い.&lt;br /&gt;&lt;li&gt; delete は Data.Set の方が早い.&lt;br /&gt;&lt;/ul&gt;今後の課題としては, Data.Set にある集合演算を LLRB で実装するのも面白いかも.&lt;br /&gt;&lt;br /&gt;LLRB の delete を Data.Set よりも早くしようと試行錯誤したがうまくいかなかった. Haskell のチューニングの難しさを実感した. なかなか直感通りにいかなくて大変だ.</description><link>http://fonlake.blogspot.com/2008/04/left-leaning-red-black-tree-part2.html</link><author>noreply@blogger.com (ztw)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7260213576531512885.post-1460823591211193090</guid><pubDate>Sun, 27 Apr 2008 17:07:00 +0000</pubDate><atom:updated>2008-04-28T02:19:14.954+09:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">algorithm</category><category domain="http://www.blogger.com/atom/ns#">haskell</category><title>Left-Leaning Red-Black Tree</title><description>&lt;a href=&quot;http://www.cs.princeton.edu/~rs/talks/LLRB/RedBlack.pdf&quot;&gt;Left-Leaning Red-Black Tree [PDF]&lt;/a&gt; というのを見つけて, 実装が簡単だと書いてあったので, 最近練習中のHaskellで書いてみた. PDF に所々ミスがあるし, Haskell に慣れてないのもあって, あんまり簡単ではなかった. まだきちんと検証もしていないがさらしてみる. とりあえず, delete が member でない要素を与えられたときにエラーを返すのは仕様. deleteはPDFに載っているのとは少し変える必要があった上に, 書き直しにかなり悩んだので間違っているかも.&lt;br /&gt;&lt;!-- Generator: GNU source-highlight 2.7&lt;br /&gt;by Lorenzo Bettini&lt;br /&gt;http://www.lorenzobettini.it&lt;br /&gt;http://www.gnu.org/software/src-highlite --&gt;&lt;br /&gt;&lt;pre&gt;&lt;tt&gt;&lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;module&lt;/font&gt;&lt;/b&gt; &lt;font color=&quot;#009900&quot;&gt;Main&lt;/font&gt; where&lt;br /&gt;&lt;br /&gt;data &lt;font color=&quot;#009900&quot;&gt;Color&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Red&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;|&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Black&lt;/font&gt; deriving &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Show&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;,&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Eq&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt;&lt;br /&gt;data &lt;font color=&quot;#009900&quot;&gt;LLRB&lt;/font&gt; a &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Null&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;|&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;!&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Color&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;!(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;LLRB&lt;/font&gt; a&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; a &lt;font color=&quot;#990000&quot;&gt;!(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;LLRB&lt;/font&gt; a&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; deriving &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Show&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;member &lt;font color=&quot;#990000&quot;&gt;::&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Ord&lt;/font&gt; a &lt;font color=&quot;#990000&quot;&gt;=&amp;gt;&lt;/font&gt; a &lt;font color=&quot;#990000&quot;&gt;-&amp;gt;&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;LLRB&lt;/font&gt; a &lt;font color=&quot;#990000&quot;&gt;-&amp;gt;&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Bool&lt;/font&gt;&lt;br /&gt;member _ &lt;font color=&quot;#009900&quot;&gt;Null&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;False&lt;/font&gt;&lt;br /&gt;member x &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; c l y r&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt;&lt;br /&gt;    case compare x y &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;of&lt;/font&gt;&lt;/b&gt;&lt;br /&gt; &lt;font color=&quot;#009900&quot;&gt;LT&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;-&amp;gt;&lt;/font&gt; member x l&lt;br /&gt; &lt;font color=&quot;#009900&quot;&gt;GT&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;-&amp;gt;&lt;/font&gt; member x r&lt;br /&gt; &lt;font color=&quot;#009900&quot;&gt;EQ&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;-&amp;gt;&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;True&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;null &lt;font color=&quot;#990000&quot;&gt;::&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;LLRB&lt;/font&gt; a &lt;font color=&quot;#990000&quot;&gt;-&amp;gt;&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Bool&lt;/font&gt;&lt;br /&gt;null &lt;font color=&quot;#009900&quot;&gt;Null&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;True&lt;/font&gt;&lt;br /&gt;null _   &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;False&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;empty &lt;font color=&quot;#990000&quot;&gt;::&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;LLRB&lt;/font&gt; a&lt;br /&gt;empty &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Null&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;singleton &lt;font color=&quot;#990000&quot;&gt;::&lt;/font&gt; a &lt;font color=&quot;#990000&quot;&gt;-&amp;gt;&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;LLRB&lt;/font&gt; a&lt;br /&gt;singleton x &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Red&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Null&lt;/font&gt; x &lt;font color=&quot;#009900&quot;&gt;Null&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;insert &lt;font color=&quot;#990000&quot;&gt;::&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Ord&lt;/font&gt; a &lt;font color=&quot;#990000&quot;&gt;=&amp;gt;&lt;/font&gt; a &lt;font color=&quot;#990000&quot;&gt;-&amp;gt;&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;LLRB&lt;/font&gt; a &lt;font color=&quot;#990000&quot;&gt;-&amp;gt;&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;LLRB&lt;/font&gt; a&lt;br /&gt;insert x root &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; make_black $ insert&#39; x root&lt;br /&gt;&lt;br /&gt;insert&#39; &lt;font color=&quot;#990000&quot;&gt;::&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Ord&lt;/font&gt; a &lt;font color=&quot;#990000&quot;&gt;=&amp;gt;&lt;/font&gt; a &lt;font color=&quot;#990000&quot;&gt;-&amp;gt;&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;LLRB&lt;/font&gt; a &lt;font color=&quot;#990000&quot;&gt;-&amp;gt;&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;LLRB&lt;/font&gt; a&lt;br /&gt;insert&#39; x &lt;font color=&quot;#009900&quot;&gt;Null&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; singleton x&lt;br /&gt;insert&#39; x h@&lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; _ &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Red&lt;/font&gt; _ _ _&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; _ &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Red&lt;/font&gt; _ _ _&lt;font color=&quot;#990000&quot;&gt;))&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; insert&#39; x $ colorFlip h&lt;br /&gt;insert&#39; x h@&lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; c l y r&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt;&lt;br /&gt;    f2 $ f1 $ case compare x y &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;of&lt;/font&gt;&lt;/b&gt;&lt;br /&gt; &lt;font color=&quot;#009900&quot;&gt;LT&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;-&amp;gt;&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; c &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;insert&#39; x l&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; y r&lt;br /&gt; &lt;font color=&quot;#009900&quot;&gt;GT&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;-&amp;gt;&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; c l y &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;insert&#39; x r&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt;&lt;br /&gt; &lt;font color=&quot;#009900&quot;&gt;EQ&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;-&amp;gt;&lt;/font&gt; h&lt;br /&gt;    where &lt;br /&gt;    f1 t@&lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; _ _ _ &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Red&lt;/font&gt; _ _ _&lt;font color=&quot;#990000&quot;&gt;))&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; rotateL t&lt;br /&gt;    f1 t &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; t&lt;br /&gt;    f2 t@&lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; _ &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Red&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Red&lt;/font&gt; _ _ _&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; _ _&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; _ _&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; rotateR t&lt;br /&gt;    f2 t &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; t&lt;br /&gt;&lt;br /&gt;findMin &lt;font color=&quot;#990000&quot;&gt;::&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;LLRB&lt;/font&gt; a &lt;font color=&quot;#990000&quot;&gt;-&amp;gt;&lt;/font&gt; a&lt;br /&gt;findMin &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; _ &lt;font color=&quot;#009900&quot;&gt;Null&lt;/font&gt; x r&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; x&lt;br /&gt;findMin &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; _ l x r&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; findMin l&lt;br /&gt;findMin &lt;font color=&quot;#009900&quot;&gt;Null&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; error &lt;font color=&quot;#FF0000&quot;&gt;&quot;LLRB.findMin: empty tree has no minimal element&quot;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;findMax &lt;font color=&quot;#990000&quot;&gt;::&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;LLRB&lt;/font&gt; a &lt;font color=&quot;#990000&quot;&gt;-&amp;gt;&lt;/font&gt; a&lt;br /&gt;findMax &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; _ l x &lt;font color=&quot;#009900&quot;&gt;Null&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; x&lt;br /&gt;findMax &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; _ l x r&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; findMax r&lt;br /&gt;findMax &lt;font color=&quot;#009900&quot;&gt;Null&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; error &lt;font color=&quot;#FF0000&quot;&gt;&quot;LLRB.findMax: empty tree has no minimal element&quot;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;deleteMax &lt;font color=&quot;#990000&quot;&gt;::&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;LLRB&lt;/font&gt; a &lt;font color=&quot;#990000&quot;&gt;-&amp;gt;&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;LLRB&lt;/font&gt; a&lt;br /&gt;deleteMax root &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; make_black $ deleteMax&#39; root where&lt;br /&gt;&lt;br /&gt;deleteMax&#39; &lt;font color=&quot;#990000&quot;&gt;::&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;LLRB&lt;/font&gt; a &lt;font color=&quot;#990000&quot;&gt;-&amp;gt;&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;LLRB&lt;/font&gt; a&lt;br /&gt;deleteMax&#39; h &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;let&lt;/font&gt;&lt;/b&gt; t&#39; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; apply_rotR h &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;in&lt;/font&gt;&lt;/b&gt;&lt;br /&gt;    &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;if&lt;/font&gt;&lt;/b&gt; isRightNull t&#39; &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;then&lt;/font&gt;&lt;/b&gt; &lt;font color=&quot;#009900&quot;&gt;Null&lt;/font&gt; &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;else&lt;/font&gt;&lt;/b&gt; &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;fixUp &lt;font color=&quot;#990000&quot;&gt;.&lt;/font&gt; f &lt;font color=&quot;#990000&quot;&gt;.&lt;/font&gt; apply_mRR&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; t&#39; where&lt;br /&gt;    f &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; c l x r&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; c l x &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;deleteMax&#39; r&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;deleteMin &lt;font color=&quot;#990000&quot;&gt;::&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;LLRB&lt;/font&gt; a &lt;font color=&quot;#990000&quot;&gt;-&amp;gt;&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;LLRB&lt;/font&gt; a&lt;br /&gt;deleteMin root &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; make_black $ deleteMin&#39; root where&lt;br /&gt;&lt;br /&gt;deleteMin&#39; &lt;font color=&quot;#990000&quot;&gt;::&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;LLRB&lt;/font&gt; a &lt;font color=&quot;#990000&quot;&gt;-&amp;gt;&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;LLRB&lt;/font&gt; a&lt;br /&gt;deleteMin&#39; &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; _ &lt;font color=&quot;#009900&quot;&gt;Null&lt;/font&gt; _ _&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Null&lt;/font&gt;&lt;br /&gt;deleteMin&#39; h &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;fixUp &lt;font color=&quot;#990000&quot;&gt;.&lt;/font&gt; f &lt;font color=&quot;#990000&quot;&gt;.&lt;/font&gt; apply_mRL&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; h&lt;br /&gt;    where&lt;br /&gt;    f &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; c l x r&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; c &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;deleteMin&#39; l&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; x r&lt;br /&gt;&lt;br /&gt;delete &lt;font color=&quot;#990000&quot;&gt;::&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Ord&lt;/font&gt; a &lt;font color=&quot;#990000&quot;&gt;=&amp;gt;&lt;/font&gt; a &lt;font color=&quot;#990000&quot;&gt;-&amp;gt;&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;LLRB&lt;/font&gt; a &lt;font color=&quot;#990000&quot;&gt;-&amp;gt;&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;LLRB&lt;/font&gt; a&lt;br /&gt;delete x root &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; make_black $ delete&#39; x root&lt;br /&gt;&lt;br /&gt;data &lt;font color=&quot;#009900&quot;&gt;NodeCond&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;NLeft&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;|&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;NRight&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;|&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;NBottom&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;delete&#39; &lt;font color=&quot;#990000&quot;&gt;::&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Ord&lt;/font&gt; a &lt;font color=&quot;#990000&quot;&gt;=&amp;gt;&lt;/font&gt; a &lt;font color=&quot;#990000&quot;&gt;-&amp;gt;&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;LLRB&lt;/font&gt; a &lt;font color=&quot;#990000&quot;&gt;-&amp;gt;&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;LLRB&lt;/font&gt; a&lt;br /&gt;delete&#39; _ &lt;font color=&quot;#009900&quot;&gt;Null&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; error &lt;font color=&quot;#FF0000&quot;&gt;&quot;LLRB.delete: element is not the member&quot;&lt;/font&gt;&lt;br /&gt;delete&#39; x h@&lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; c l y r&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt;&lt;br /&gt;    fixUp $ case compare x y &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;of&lt;/font&gt;&lt;/b&gt;&lt;br /&gt; &lt;font color=&quot;#009900&quot;&gt;LT&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;-&amp;gt;&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;f &lt;font color=&quot;#990000&quot;&gt;.&lt;/font&gt; apply_mRL&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; h&lt;br /&gt;     where&lt;br /&gt;     f &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; c l y r&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; c &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;delete&#39; x l&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; y r&lt;br /&gt; &lt;font color=&quot;#009900&quot;&gt;GT&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;-&amp;gt;&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;f &lt;font color=&quot;#990000&quot;&gt;.&lt;/font&gt; apply_mRR &lt;font color=&quot;#990000&quot;&gt;.&lt;/font&gt; apply_rotR&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; h&lt;br /&gt;     where&lt;br /&gt;     f &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; c l y r&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; c l y &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;delete&#39; x r&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt;&lt;br /&gt; &lt;font color=&quot;#009900&quot;&gt;EQ&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;-&amp;gt;&lt;/font&gt; case nodecond h &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;of&lt;/font&gt;&lt;/b&gt;&lt;br /&gt;     &lt;font color=&quot;#009900&quot;&gt;NBottom&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;-&amp;gt;&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Null&lt;/font&gt;&lt;br /&gt;     &lt;font color=&quot;#009900&quot;&gt;NLeft&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;-&amp;gt;&lt;/font&gt; &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;let&lt;/font&gt;&lt;/b&gt; z &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; apply_mRL h &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;in&lt;/font&gt;&lt;/b&gt;&lt;br /&gt;  &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;if&lt;/font&gt;&lt;/b&gt; eq x z &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;then&lt;/font&gt;&lt;/b&gt; delleft z &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;else&lt;/font&gt;&lt;/b&gt; delete&#39; x z&lt;br /&gt;     &lt;font color=&quot;#009900&quot;&gt;NRight&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;-&amp;gt;&lt;/font&gt; &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;let&lt;/font&gt;&lt;/b&gt; z &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;apply_mRR &lt;font color=&quot;#990000&quot;&gt;.&lt;/font&gt; apply_rotR&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; h &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;in&lt;/font&gt;&lt;/b&gt;&lt;br /&gt;  &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;if&lt;/font&gt;&lt;/b&gt; eq x z &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;then&lt;/font&gt;&lt;/b&gt; delright z &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;else&lt;/font&gt;&lt;/b&gt; delete&#39; x z&lt;br /&gt;     where&lt;br /&gt;     eq a &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; _ _ b _&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; a &lt;font color=&quot;#990000&quot;&gt;==&lt;/font&gt; b&lt;br /&gt;     nodecond &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; _ &lt;font color=&quot;#009900&quot;&gt;Null&lt;/font&gt; _ &lt;font color=&quot;#009900&quot;&gt;Null&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;NBottom&lt;/font&gt;&lt;br /&gt;     nodecond &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; _ &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; _ _ _ _&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; _ _&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;NLeft&lt;/font&gt;&lt;br /&gt;     nodecond &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; _ _ _ &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; _ _ _ _&lt;font color=&quot;#990000&quot;&gt;))&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;NRight&lt;/font&gt;&lt;br /&gt;     delleft  &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; c&#39; l&#39; x&#39; r&#39;&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; c&#39; &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;deleteMax&#39; l&#39;&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;findMax l&#39;&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; r&#39;&lt;br /&gt;     delright &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; c&#39; l&#39; x&#39; r&#39;&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; c&#39; l&#39; &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;findMin r&#39;&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;deleteMin&#39; r&#39;&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;font color=&quot;#990000&quot;&gt;--&lt;/font&gt;&lt;br /&gt;&lt;font color=&quot;#990000&quot;&gt;--&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Helper&lt;/font&gt;&lt;br /&gt;&lt;font color=&quot;#990000&quot;&gt;--&lt;/font&gt;&lt;br /&gt;apply_mRL t@&lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; _ &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Red&lt;/font&gt; _ _ _&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; _ _&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; t&lt;br /&gt;apply_mRL t@&lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; _ &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; _ &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Red&lt;/font&gt; _ _ _&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; _ _&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; _ _&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; t&lt;br /&gt;apply_mRL t &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; moveRedLeft t&lt;br /&gt;&lt;br /&gt;apply_mRR t@&lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; _ _ _ &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Red&lt;/font&gt; _ _ _&lt;font color=&quot;#990000&quot;&gt;))&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; t&lt;br /&gt;apply_mRR t@&lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; _ _ _ &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; _ &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Red&lt;/font&gt; _ _ _&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; _ _&lt;font color=&quot;#990000&quot;&gt;))&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; t&lt;br /&gt;apply_mRR t &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; moveRedRight t&lt;br /&gt;&lt;br /&gt;apply_rotR t@&lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; _ &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Red&lt;/font&gt; _ _ _&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; _ _&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; rotateR t&lt;br /&gt;apply_rotR t &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; t&lt;br /&gt;&lt;br /&gt;isRightNull t@&lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; _ _ _ &lt;font color=&quot;#009900&quot;&gt;Null&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;True&lt;/font&gt;&lt;br /&gt;isRightNull t &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;False&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;make_black &lt;font color=&quot;#990000&quot;&gt;::&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;LLRB&lt;/font&gt; a &lt;font color=&quot;#990000&quot;&gt;-&amp;gt;&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;LLRB&lt;/font&gt; a&lt;br /&gt;make_black &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; _ l x r&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Black&lt;/font&gt; l x r&lt;br /&gt;make_black &lt;font color=&quot;#009900&quot;&gt;Null&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Null&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;fixUp &lt;font color=&quot;#990000&quot;&gt;::&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;LLRB&lt;/font&gt; a &lt;font color=&quot;#990000&quot;&gt;-&amp;gt;&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;LLRB&lt;/font&gt; a&lt;br /&gt;fixUp &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; f3 &lt;font color=&quot;#990000&quot;&gt;.&lt;/font&gt; f2 &lt;font color=&quot;#990000&quot;&gt;.&lt;/font&gt; f1 where&lt;br /&gt;    f1 t@&lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; _ _ _ &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Red&lt;/font&gt; _ _ _&lt;font color=&quot;#990000&quot;&gt;))&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; rotateL t&lt;br /&gt;    f1 t &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; t&lt;br /&gt;    f2 t@&lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; _ &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Red&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Red&lt;/font&gt; _ _ _&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; _ _&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; _ _&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; rotateR t&lt;br /&gt;    f2 t &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; t&lt;br /&gt;    f3 t@&lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; _ &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Red&lt;/font&gt; _ _ _&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; _ &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Red&lt;/font&gt; _ _ _&lt;font color=&quot;#990000&quot;&gt;))&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; colorFlip t&lt;br /&gt;    f3 t &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; t&lt;br /&gt;&lt;br /&gt;moveRedRight &lt;font color=&quot;#990000&quot;&gt;::&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;LLRB&lt;/font&gt; a &lt;font color=&quot;#990000&quot;&gt;-&amp;gt;&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;LLRB&lt;/font&gt; a&lt;br /&gt;moveRedRight h &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; f $ colorFlip h where&lt;br /&gt;    f t@&lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; _ &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; _ &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Red&lt;/font&gt; _ _ _&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; _ _&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; _ _&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; colorFlip $ rotateR t&lt;br /&gt;    f t &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; t&lt;br /&gt;&lt;br /&gt;moveRedLeft &lt;font color=&quot;#990000&quot;&gt;::&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;LLRB&lt;/font&gt; a &lt;font color=&quot;#990000&quot;&gt;-&amp;gt;&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;LLRB&lt;/font&gt; a&lt;br /&gt;moveRedLeft h &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; f $ colorFlip h where&lt;br /&gt;    f &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; c l x r@&lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; _ &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Red&lt;/font&gt; _ _ _&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; _ _&lt;font color=&quot;#990000&quot;&gt;))&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; colorFlip $ rotateL $ &lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; c l x &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;rotateR r&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt;&lt;br /&gt;    f t &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; t&lt;br /&gt;&lt;br /&gt;colorFlip &lt;font color=&quot;#990000&quot;&gt;::&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;LLRB&lt;/font&gt; a &lt;font color=&quot;#990000&quot;&gt;-&amp;gt;&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;LLRB&lt;/font&gt; a&lt;br /&gt;colorFlip &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; c &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; c1 l1 x1 r1&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; x &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; c2 l2 x2 r2&lt;font color=&quot;#990000&quot;&gt;))&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt;&lt;br /&gt;    &lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;fl c&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;fl c1&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; l1 x1 r1&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; x &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;fl c2&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; l2 x2 r2&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt;&lt;br /&gt;    where&lt;br /&gt;    fl &lt;font color=&quot;#009900&quot;&gt;Red&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Black&lt;/font&gt;&lt;br /&gt;    fl &lt;font color=&quot;#009900&quot;&gt;Black&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Red&lt;/font&gt;&lt;br /&gt;colorFlip _ &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; error &lt;font color=&quot;#FF0000&quot;&gt;&quot;LLRB.colorFlip: tree must have 3 nodes at least&quot;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;rotateL &lt;font color=&quot;#990000&quot;&gt;::&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;LLRB&lt;/font&gt; a &lt;font color=&quot;#990000&quot;&gt;-&amp;gt;&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;LLRB&lt;/font&gt; a&lt;br /&gt;rotateL &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; c l x &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; c&#39; l&#39; x&#39; r&#39;&lt;font color=&quot;#990000&quot;&gt;))&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt;&lt;br /&gt;    &lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; c &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Red&lt;/font&gt; l x l&#39;&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; x&#39; r&#39;&lt;br /&gt;rotateL _ &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; error &lt;font color=&quot;#FF0000&quot;&gt;&quot;LLRB.rotateL: tree must have 2 nodes at least&quot;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;rotateR &lt;font color=&quot;#990000&quot;&gt;::&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;LLRB&lt;/font&gt; a &lt;font color=&quot;#990000&quot;&gt;-&amp;gt;&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;LLRB&lt;/font&gt; a&lt;br /&gt;rotateR &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; c &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; c&#39; l&#39; x&#39; r&#39;&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; x r&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt;&lt;br /&gt;    &lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; c l&#39; x&#39; &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;&lt;font color=&quot;#009900&quot;&gt;Branch&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Red&lt;/font&gt; r&#39; x r&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt;&lt;br /&gt;rotateR _ &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; error &lt;font color=&quot;#FF0000&quot;&gt;&quot;LLRB.rotateR: tree must have 2 nodes at least&quot;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;     &lt;br /&gt;&lt;font color=&quot;#990000&quot;&gt;--&lt;/font&gt; &lt;br /&gt;&lt;font color=&quot;#990000&quot;&gt;--&lt;/font&gt; test &lt;br /&gt;&lt;font color=&quot;#990000&quot;&gt;--&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;tree &lt;font color=&quot;#990000&quot;&gt;::&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Int&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;-&amp;gt;&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;LLRB&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;Int&lt;/font&gt;&lt;br /&gt;tree &lt;font color=&quot;#993399&quot;&gt;0&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; empty&lt;br /&gt;tree &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;n&lt;font color=&quot;#990000&quot;&gt;+&lt;/font&gt;&lt;font color=&quot;#993399&quot;&gt;1&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; insert &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;n&lt;font color=&quot;#990000&quot;&gt;+&lt;/font&gt;&lt;font color=&quot;#993399&quot;&gt;1&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;tree n&lt;font color=&quot;#990000&quot;&gt;)&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;main &lt;font color=&quot;#990000&quot;&gt;::&lt;/font&gt; &lt;font color=&quot;#009900&quot;&gt;IO&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;()&lt;/font&gt;&lt;br /&gt;main &lt;font color=&quot;#990000&quot;&gt;=&lt;/font&gt; &lt;b&gt;&lt;font color=&quot;#0000FF&quot;&gt;do&lt;/font&gt;&lt;/b&gt;&lt;br /&gt;    print $ member &lt;font color=&quot;#993399&quot;&gt;1&lt;/font&gt; $ &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;iterate deleteMax &lt;font color=&quot;#990000&quot;&gt;(&lt;/font&gt;tree &lt;font color=&quot;#993399&quot;&gt;100000&lt;/font&gt;&lt;font color=&quot;#990000&quot;&gt;))&lt;/font&gt; &lt;font color=&quot;#990000&quot;&gt;!!&lt;/font&gt; &lt;font color=&quot;#993399&quot;&gt;100000&lt;/font&gt;&lt;br /&gt;&lt;/tt&gt;&lt;/pre&gt;</description><link>http://fonlake.blogspot.com/2008/04/left-leaning-red-black-tree.html</link><author>noreply@blogger.com (ztw)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7260213576531512885.post-4749509409494421839</guid><pubDate>Fri, 25 Apr 2008 16:11:00 +0000</pubDate><atom:updated>2008-04-26T01:17:49.925+09:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">firefox</category><category domain="http://www.blogger.com/atom/ns#">freebsd</category><title>Firefoxの反応が遅い</title><description>最近, 研究室用のマシンの FreeBSD 7-stable 上の linux-firefox の反応が遅くなった. Ctrl-T で新しいタブを作成しようとしても, キーを押してからタブができるまでに数秒のタイムラグが発生するのだ. ちょっとしたら, どこかで修正されるかなと思って我慢していたけど, 改善されないので, 諦めて 6-stable に戻った. 6-stable 上ならキビキビ動く. ちなみに, 後輩の Debian 上の Firefox でも同様の現象が起きていた. Linux用の Firefox 特有の問題なのだろうか.&lt;br /&gt;&lt;br /&gt;あと, 後輩にC言語のコールグラフを生成する方法を聞かれたので, 調べてみたら &lt;a href=&quot;http://code.google.com/p/jrfonseca/wiki/Gprof2Dot&quot;&gt;gprof2dot&lt;/a&gt; というのを見つけた. なかなか便利そうだ.</description><link>http://fonlake.blogspot.com/2008/04/firefox.html</link><author>noreply@blogger.com (ztw)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7260213576531512885.post-4925831169255210529</guid><pubDate>Sat, 22 Mar 2008 05:17:00 +0000</pubDate><atom:updated>2008-03-22T14:26:40.743+09:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">freebsd</category><title>Graphvizのフォント</title><description>プログラムのプロファイリングに最近 &lt;a href=&quot;http://code.google.com/p/google-perftools/wiki/GooglePerformanceTools&quot;&gt;Google CPU Profiler&lt;/a&gt;を使うようになった. 特にコンパイルしなおさなくても, LD_PRELOAD で libprofiler.so を渡すだけでなので楽だ.&lt;br /&gt;&lt;br /&gt;また, pprof --pdf とかで出力されるコールグラフも見やすくていい. ただ,&lt;blockquote&gt;Error: Could not find/open font&lt;/blockquote&gt;というのが無数に出力されるのが気になったので調べてみた. pprof の問題ではなく, 内部で使っている Graphviz の問題のようだ. &quot;times.ttf&quot; というファイルを /usr/local/lib/X11/fonts/ で探すのだが, それが見つからないために出力されていた.&lt;blockquote&gt;# cd /usr/local/X11/fonts/&lt;br /&gt;# ln -fs TTF/luxisr.ttf times.ttf&lt;/blockquote&gt;とかで適当にリンクを張ってごまかしたら, エラーメッセージが消えた.</description><link>http://fonlake.blogspot.com/2008/03/graphviz.html</link><author>noreply@blogger.com (ztw)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7260213576531512885.post-2839107992714474843</guid><pubDate>Thu, 20 Mar 2008 02:45:00 +0000</pubDate><atom:updated>2008-03-20T12:15:55.766+09:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">freebsd</category><title>VPython を FreeBSD にインストール</title><description>研究でデータの可視化に利用している &lt;a href=&quot;http://www.vpython.org/&quot;&gt;VPython&lt;/a&gt; を FreeBSD にインストールしなおしたのでメモ. ports/graphics/py-visual はバージョンが古いので, 自分で visual-4.beta26.tar.bz2 を入れた.&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt; VPython が依存するパッケージのインストール&lt;br /&gt;&lt;blockquote&gt;# portinstall -RP boost-python py25-numpy libglademm24 gtkglextmm&lt;/blockquote&gt;&lt;br /&gt;&lt;li&gt; ソースの修正&lt;br /&gt;src/python/cvisualmodule.cpp, src/python/vector_array.cpp の一行目に&lt;blockquote&gt;#include &amp;lt;iostream&amp;gt;&lt;/blockquote&gt;を追加する&lt;br /&gt;&lt;li&gt; configure &amp; make &lt;br /&gt;&lt;/ol&gt;</description><link>http://fonlake.blogspot.com/2008/03/vpython-freebsd.html</link><author>noreply@blogger.com (ztw)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7260213576531512885.post-2143313307563277536</guid><pubDate>Tue, 18 Mar 2008 15:24:00 +0000</pubDate><atom:updated>2008-03-19T01:24:14.235+09:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">freebsd</category><title>FreeBSD 7.0-Release をインストール part2</title><description>自宅のPCも FreeBSD 7-stable にした. 多分, 普通に入れる人にはほとんど参考にならないだろうけど, 手順を公開してみる. メジャーバージョンアップの際はクリーンインストールをするようにしていて, そのため FreeBSD のために二つのパーティションを切っている. 普段使っていない方のパーティションに 7.0-release を入れて stable を追いかける.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt; FreeBSD 7.0-release の CD1 を焼く&lt;br /&gt;&lt;li&gt; CDブートして Expert モードで Minimum インストール&lt;br /&gt;&lt;li&gt; リブート&lt;br /&gt;&lt;li&gt; 最低限の設定をする&lt;br /&gt;&lt;blockquote&gt;/boot/loader.conf /etc/{resolv.conf, rc.conf, ntp.conf, hosts, fstab, aliases, sysctl.conf}&lt;/blockquote&gt;&lt;br /&gt;&lt;li&gt; (必要な人だけ) 以降のコンパイルのオプションを変更する&lt;br /&gt;&lt;blockquote&gt; # cp /usr/share/example/etc/make.conf /etc&lt;br /&gt;# vi /etc/make.conf&lt;/blockquote&gt;&lt;br /&gt;ちなみに僕は tmpfs を mtmp にマウントして ports の一時ファイル置き場にしている. &lt;blockquote&gt;(/etc/make.conf)&lt;br /&gt;WRKDIRPREFIX=/mtmp/ports&lt;/blockquote&gt;&lt;br /&gt;&lt;li&gt; /usr/share/example/cvsup/stable-supfile をコピーして, cvsup のホスト名を変更しソースツリーをダウンロード.&lt;blockquote&gt;# csup stable-supfile&lt;/blockquote&gt;&lt;br /&gt;&lt;li&gt; OSのコンパイル&lt;blockquote&gt;# cd /usr/src&lt;br /&gt;# make buildworld&lt;br /&gt;# make buildkernel KERNCONF=GENERIC&lt;br /&gt;# make installkernel KERNCONF=GENERIC&lt;/blockquote&gt;&lt;br /&gt;(必要なら, /usr/src/sys/i386/conf/GENERIC をコピーして編集する. しかし, すでに stable ではデフォルトスケジューラがULEになっていたので, GENERICのまま作業した)&lt;br /&gt;&lt;li&gt; リブート&lt;br /&gt;&lt;li&gt; single user mode で起動&lt;br /&gt;&lt;li&gt; インストール&lt;blockquote&gt;# /sbin/mount -a&lt;br /&gt;# set HOME=/root&lt;br /&gt;# source ~/.cshrc&lt;br /&gt;# cd /usr/src&lt;br /&gt;# mergemaster -p&lt;br /&gt;# make installworld&lt;br /&gt;# mergemaster&lt;br /&gt;# exit&lt;/blockquote&gt;(ここまでで所要時間1時間半ぐらい)&lt;br /&gt;&lt;li&gt; ports ツリーのダウンロード. &lt;blockquote&gt;# portsnap fetch extract&lt;/blockquote&gt;&lt;br /&gt;&lt;li&gt; portupgrade のインストール &lt;blockquote&gt; # cd /usr/ports/ports-mgmt/portupgrade&lt;br /&gt;# make install&lt;/blockquote&gt;&lt;br /&gt;&lt;li&gt; いろんなアプリケーションのインストール&lt;br /&gt;&lt;blockquote&gt;# portinstall -RPwW --batch `cat pkg.list`&lt;/blockquote&gt;&lt;br /&gt;前もって, &quot;pkg.list&quot; に必要なパッケージ名の一覧をコピーしておく. もともと使っているシステムがあるなら,&lt;br /&gt;&lt;blockquote&gt;# ls /var/db/pkg &gt; pkg.list&lt;/blockquote&gt;してから調整するのもあり.&lt;br /&gt;&lt;li&gt; あとは無事インストールが終わるのを待つ. それなりにアプリを入れるとかなり時間がかかる. 僕の場合で3-4時間.&lt;br /&gt;&lt;li&gt; アプリの設定をする. (今回は普段使っているホームディレクトリをそのまま使ったので省略)&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;おまけ1: linux-firefox について&lt;br /&gt;今回インストールした 7-stable では linux-firefox が不安定になって困った. 理由は分からないが linux エミュレーションのバージョンを変えたら安定した.&lt;blockquote&gt;(/etc/sysctl.conf)&lt;br /&gt;compat.linux.osrelease=2.6.16&lt;/blockquote&gt;&lt;br /&gt;おまけ2: インストールしたパッケージのリスト &lt;br /&gt;これだけ見るとパッケージ数はあまり多くないが, 実際には依存するパッケージも入れるので, 最終的にパッケージの数は580個ぐらいになった. xorg が細かく分割されてからパッケージ数がインフレだ.&lt;br /&gt;&lt;blockquote&gt;(pkg.list)&lt;br /&gt;aspell&lt;br /&gt;autotools&lt;br /&gt;bash&lt;br /&gt;bitstream-vera&lt;br /&gt;blas&lt;br /&gt;boehm-gc&lt;br /&gt;boost-python&lt;br /&gt;bsfilter&lt;br /&gt;cdrtools&lt;br /&gt;compat5x-i386&lt;br /&gt;db46&lt;br /&gt;dnsmasq&lt;br /&gt;dvipdfmx&lt;br /&gt;fd&lt;br /&gt;feh&lt;br /&gt;ffmpeg&lt;br /&gt;fluxbox&lt;br /&gt;gcc42&lt;br /&gt;gdk-pixbuf&lt;br /&gt;ghostscript-gpl&lt;br /&gt;gimp&lt;br /&gt;global&lt;br /&gt;glpk&lt;br /&gt;gmake&lt;br /&gt;gnuplot&lt;br /&gt;google-perftools&lt;br /&gt;graphviz&lt;br /&gt;gsl&lt;br /&gt;gv&lt;br /&gt;hugs98&lt;br /&gt;inkscape&lt;br /&gt;ja-a2ps&lt;br /&gt;ja-acroread7&lt;br /&gt;ja-anthy-9100e&lt;br /&gt;ja-dvipsk-tetex&lt;br /&gt;ja-ipa-ttfonts&lt;br /&gt;ja-kasumi&lt;br /&gt;ja-mplusfonts&lt;br /&gt;ja-nkf&lt;br /&gt;ja-platex-jsclasses&lt;br /&gt;ja-ptex-tetex&lt;br /&gt;ja-qkc&lt;br /&gt;ja-sazanami-ttf&lt;br /&gt;ja-vlgothic-20071015&lt;br /&gt;ja-w3m&lt;br /&gt;ja-xdvik-tetex&lt;br /&gt;ja-xpdf&lt;br /&gt;kmovisto&lt;br /&gt;lame&lt;br /&gt;lapack&lt;br /&gt;lftp&lt;br /&gt;lha&lt;br /&gt;linux-firefox&lt;br /&gt;linux-flashplugin&lt;br /&gt;linux-xorg-libs&lt;br /&gt;linux_base-fc-4&lt;br /&gt;lv&lt;br /&gt;maxima&lt;br /&gt;mbmon&lt;br /&gt;mencoder&lt;br /&gt;mercurial&lt;br /&gt;mesa-demos&lt;br /&gt;mlterm&lt;br /&gt;mmsrip&lt;br /&gt;mplayer&lt;br /&gt;naturaldocs&lt;br /&gt;octave&lt;br /&gt;opengl-man&lt;br /&gt;pkg_cleanup&lt;br /&gt;pkg_remove&lt;br /&gt;pkg_rmleaves&lt;br /&gt;pngcrush&lt;br /&gt;portupgrade&lt;br /&gt;povray&lt;br /&gt;pstoedit&lt;br /&gt;psutils-a4&lt;br /&gt;python25&lt;br /&gt;qhull&lt;br /&gt;queequeg&lt;br /&gt;rlwrap&lt;br /&gt;rpm&lt;br /&gt;rsync&lt;br /&gt;ruby&lt;br /&gt;screen&lt;br /&gt;smartmontools&lt;br /&gt;source-highlight&lt;br /&gt;subversion&lt;br /&gt;sudo&lt;br /&gt;sylpheed&lt;br /&gt;transfig&lt;br /&gt;unzip&lt;br /&gt;valgrind&lt;br /&gt;vim&lt;br /&gt;wget&lt;br /&gt;wine&lt;br /&gt;wmmemfree&lt;br /&gt;wmweather&lt;br /&gt;wxMaxima&lt;br /&gt;xfig&lt;br /&gt;xmms&lt;br /&gt;xorg&lt;br /&gt;xvidcap&lt;br /&gt;zip&lt;br /&gt;zsh&lt;br /&gt;&lt;/blockquote&gt;</description><link>http://fonlake.blogspot.com/2008/03/freebsd-70-release-part2.html</link><author>noreply@blogger.com (ztw)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7260213576531512885.post-8868112584619787069</guid><pubDate>Mon, 10 Mar 2008 16:11:00 +0000</pubDate><atom:updated>2008-03-11T01:23:58.840+09:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">c++</category><title>異なるサイズのvalarrayの代入</title><description>C++でプログラムを書いていたときに valarray にハマった. それは, サイズの異なる valarray を代入しようとした際に起こった. 始め, 下のソースの(1)みたいにただ単に代入しただけだったのだが, そうすると, GNU C++ 3.4で試したところ, 実行結果が代入前と後で変わらなかった. &lt;!-- Generator: GNU source-highlight 2.7&lt;br /&gt;by Lorenzo Bettini&lt;br /&gt;http://www.lorenzobettini.it&lt;br /&gt;http://www.gnu.org/software/src-highlite --&gt;&lt;br /&gt;&lt;pre&gt;&lt;tt&gt;&lt;span style=&quot;color: #000000&quot;&gt;01:&lt;/span&gt; &lt;span style=&quot;font-weight: bold&quot;&gt;&lt;span style=&quot;color: #000080&quot;&gt;#include&lt;/span&gt;&lt;/span&gt; &lt;span style=&quot;color: #FF0000&quot;&gt;&amp;lt;valarray&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000&quot;&gt;02:&lt;/span&gt; &lt;span style=&quot;font-weight: bold&quot;&gt;&lt;span style=&quot;color: #000080&quot;&gt;#include&lt;/span&gt;&lt;/span&gt; &lt;span style=&quot;color: #FF0000&quot;&gt;&amp;lt;iostream&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000&quot;&gt;03:&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;color: #000000&quot;&gt;04:&lt;/span&gt; &lt;span style=&quot;font-weight: bold&quot;&gt;&lt;span style=&quot;color: #0000FF&quot;&gt;using&lt;/span&gt;&lt;/span&gt; &lt;span style=&quot;font-weight: bold&quot;&gt;&lt;span style=&quot;color: #0000FF&quot;&gt;namespace&lt;/span&gt;&lt;/span&gt; std&lt;span style=&quot;color: #990000&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000&quot;&gt;05:&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;color: #000000&quot;&gt;06:&lt;/span&gt; &lt;span style=&quot;color: #009900&quot;&gt;int&lt;/span&gt; &lt;span style=&quot;font-weight: bold&quot;&gt;&lt;span style=&quot;color: #000000&quot;&gt;main&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #990000&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #009900&quot;&gt;void&lt;/span&gt;&lt;span style=&quot;color: #990000&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #FF0000&quot;&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000&quot;&gt;07:&lt;/span&gt;         &lt;span style=&quot;font-style: italic&quot;&gt;&lt;span style=&quot;color: #9A1900&quot;&gt;// 初期化&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000&quot;&gt;08:&lt;/span&gt;         valarray&lt;span style=&quot;color: #990000&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #009900&quot;&gt;int&lt;/span&gt;&lt;span style=&quot;color: #990000&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;font-weight: bold&quot;&gt;&lt;span style=&quot;color: #000000&quot;&gt;a&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #990000&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #993399&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #990000&quot;&gt;),&lt;/span&gt; &lt;span style=&quot;font-weight: bold&quot;&gt;&lt;span style=&quot;color: #000000&quot;&gt;b&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #990000&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #993399&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #990000&quot;&gt;);&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000&quot;&gt;09:&lt;/span&gt;         cout &lt;span style=&quot;color: #990000&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #FF0000&quot;&gt;&quot;before: &quot;&lt;/span&gt; &lt;span style=&quot;color: #990000&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; a&lt;span style=&quot;color: #990000&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;font-weight: bold&quot;&gt;&lt;span style=&quot;color: #000000&quot;&gt;size&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #990000&quot;&gt;()&lt;/span&gt; &lt;span style=&quot;color: #990000&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; endl&lt;span style=&quot;color: #990000&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000&quot;&gt;10:&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;color: #000000&quot;&gt;11:&lt;/span&gt;         &lt;span style=&quot;font-style: italic&quot;&gt;&lt;span style=&quot;color: #9A1900&quot;&gt;// (1) 間違い&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000&quot;&gt;12:&lt;/span&gt;         a &lt;span style=&quot;color: #990000&quot;&gt;=&lt;/span&gt; b&lt;span style=&quot;color: #990000&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000&quot;&gt;13:&lt;/span&gt;         cout &lt;span style=&quot;color: #990000&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #FF0000&quot;&gt;&quot;after1: &quot;&lt;/span&gt; &lt;span style=&quot;color: #990000&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; a&lt;span style=&quot;color: #990000&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;font-weight: bold&quot;&gt;&lt;span style=&quot;color: #000000&quot;&gt;size&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #990000&quot;&gt;()&lt;/span&gt; &lt;span style=&quot;color: #990000&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; endl&lt;span style=&quot;color: #990000&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000&quot;&gt;14:&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;color: #000000&quot;&gt;15:&lt;/span&gt;         &lt;span style=&quot;font-style: italic&quot;&gt;&lt;span style=&quot;color: #9A1900&quot;&gt;// (2) 正解&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000&quot;&gt;16:&lt;/span&gt;         a&lt;span style=&quot;color: #990000&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;font-weight: bold&quot;&gt;&lt;span style=&quot;color: #000000&quot;&gt;resize&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #990000&quot;&gt;(&lt;/span&gt;b&lt;span style=&quot;color: #990000&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;font-weight: bold&quot;&gt;&lt;span style=&quot;color: #000000&quot;&gt;size&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #990000&quot;&gt;());&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000&quot;&gt;17:&lt;/span&gt;         a &lt;span style=&quot;color: #990000&quot;&gt;=&lt;/span&gt; b&lt;span style=&quot;color: #990000&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000&quot;&gt;18:&lt;/span&gt;         cout &lt;span style=&quot;color: #990000&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span style=&quot;color: #FF0000&quot;&gt;&quot;after2: &quot;&lt;/span&gt; &lt;span style=&quot;color: #990000&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; a&lt;span style=&quot;color: #990000&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;font-weight: bold&quot;&gt;&lt;span style=&quot;color: #000000&quot;&gt;size&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #990000&quot;&gt;()&lt;/span&gt; &lt;span style=&quot;color: #990000&quot;&gt;&amp;lt;&amp;lt;&lt;/span&gt; endl&lt;span style=&quot;color: #990000&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000&quot;&gt;19:&lt;/span&gt; &lt;br /&gt;&lt;span style=&quot;color: #000000&quot;&gt;20:&lt;/span&gt;         &lt;span style=&quot;font-weight: bold&quot;&gt;&lt;span style=&quot;color: #0000FF&quot;&gt;return&lt;/span&gt;&lt;/span&gt; &lt;span style=&quot;color: #993399&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #990000&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #000000&quot;&gt;21:&lt;/span&gt; &lt;span style=&quot;color: #FF0000&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/tt&gt;&lt;/pre&gt; インクルードファイルを見てみると, サイズの異なる valarray の代入は動作未定義とあって凹む. 今回の場合は(2)のように, 代入する前に valarray のサイズを揃える必要があるらしい. 思い込みとは恐ろしいものだ.</description><link>http://fonlake.blogspot.com/2008/03/valarray.html</link><author>noreply@blogger.com (ztw)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7260213576531512885.post-6882157561690921773</guid><pubDate>Sat, 08 Mar 2008 14:10:00 +0000</pubDate><atom:updated>2008-03-08T23:26:33.943+09:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">freebsd</category><title>FreeBSDで無線LAN</title><description>先週は大学の近所で行われていた学会に参加していた. 普段のテーマとは少し違う分野だったので非常に新鮮だった. すごい発想の違いを見て感動もした. 朝早くから通ってよかった.&lt;br /&gt;&lt;br /&gt;そんな会場では無線LANが使えた. しかも, WEP. 家では WPA  を使っていて, WEP の設定法は分からなかったので, man ifconfig を読みながら試行錯誤した. 今日はそのメモ. 無線LANのインターフェース ath0 は適当に置き換えてください.&lt;br /&gt;&lt;br /&gt;1. アクセスポイントの検索&lt;br /&gt;&lt;blockquote&gt;# ifconfig ath0 list scan&lt;/blockquote&gt;&lt;br /&gt;これは一発でうまくいかなかったりもした. 何度かやってると見えた. 接続したい SSID をチェック.&lt;br /&gt;2. アクセスポイントへの接続&lt;br /&gt;&lt;blockquote&gt;# ifconfig ath0 ssid [SSID] wepmode on wepkey [キー] weptxkey 1&lt;br /&gt;# dhclient ath0&lt;/blockquote&gt;&lt;br /&gt;&quot;weptxkey 1&quot;がポイントで, &quot;wepkey hogehoge&quot; でキーを設定しただけではダメだった. これはかなり悩んだ.&lt;br /&gt;&lt;br /&gt;おまけ: WPAの簡易設定法&lt;br /&gt;1. WPAの設定ファイルを書く (sample.conf)&lt;br /&gt;&lt;blockquote&gt;network={&lt;br /&gt;    ssid=[SSID]&lt;br /&gt;    psk=[キー]&lt;br /&gt;}&lt;/blockquote&gt;&lt;br /&gt;2. 接続&lt;br /&gt;&lt;blockquote&gt;# wpa_supplicant -i ath0 -c sample.conf&lt;br /&gt;# dhclient ath0&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;詳細は man wpa_supplicant と man wpa_supplicant.conf を読んでください.</description><link>http://fonlake.blogspot.com/2008/03/freebsdlan.html</link><author>noreply@blogger.com (ztw)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7260213576531512885.post-8472196432118888410</guid><pubDate>Wed, 05 Mar 2008 14:29:00 +0000</pubDate><atom:updated>2008-03-05T23:41:36.360+09:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">firefox</category><title>Firefoxの高速化?</title><description>最近 &lt;a href=&quot;http://www.pps.jussieu.fr/~jch/software/polipo/&quot;&gt;polipo&lt;/a&gt; が話題になっていたので FreeBSD と Windows にインストールしてみる. それほど劇的には変化していない. polipo のインストールしたときに, ついでに, もうちょっと Firefox が速くならないかなあと思っていろいろいじっていたらあることに気づいた. それは, 「アドオン入れすぎかも」ということ. 試しにセーフモードで起動してみたらめちゃくちゃ速い. Firefox ってこんなに速く動けたのかあ〜, と驚いた. その後, どのアドオンが Firefox を遅くしているのか調べてみたら, どれも少しずつ影響があるみたいだったので, &lt;a href=&quot;https://addons.mozilla.org/en-US/firefox/addon/1865&quot;&gt;adblock plus&lt;/a&gt;だけにする. Firefox の機能は前よりも減って少し不便になったけど, 格段にサクサクと動くようになったので満足.</description><link>http://fonlake.blogspot.com/2008/03/firefox.html</link><author>noreply@blogger.com (ztw)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-7260213576531512885.post-6854348232463442155</guid><pubDate>Tue, 04 Mar 2008 14:57:00 +0000</pubDate><atom:updated>2008-05-12T00:32:09.123+09:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">freebsd</category><title>FreeBSD 7.0-Release をインストール</title><description>2月半ばからスタートした花粉症が徐々にひどくなってきて憂鬱な今日この頃. 知り合いの先生に会いに行ったら, 巷で噂の Mac Book Air があった! 思わず興奮してしまいましたよ. でも, 自分の研究費はもうないので指をくわえて見るだけ.&lt;br /&gt;&lt;br /&gt;FreeBSD 7.0-Release が出たので研究室のPCに入れてみた. インストーラも変わってなくて, いつも通りだけど, 少しだけ手間取ったところをメモ.&lt;br /&gt;&lt;br /&gt;1. re0でDHCPが取れず, bootonly の CD ではインストールできなかった. 仕方なく disk1 だけを焼いて最小限インストール. パーティションを切るところで謎のメッセージが出たが, 特に問題なさそうだったので無視. ちょっと気になる.&lt;br /&gt;&lt;br /&gt;2. GENERIC カーネルが SMP に対応していた. 今まで SMP 用のカーネルをあとでコンパイルしていたので, 少しだけ楽になったかなと思ったけど, ULE スケジューラを使うためにカーネルをコンパイルしたので変わらず. &lt;br /&gt;(ちなみに, SCHED_4BSD を SCHED_ULE に変更するだけ)&lt;br /&gt;&lt;br /&gt;3. nvidia-driver をインストールしたときに, ビデオカードをすぐに認識するもんだと思い込んでいたら違ったので苦労した. 6-stable では kldload nvidia.ko するだけで認識したが, 7-Release では /boot/loader.conf に nvidia_load=&quot;YES&quot; を書く方法しか使えないらしい. make install 時のメッセージにそう書いてあったが, 気づいていなかったのが残念だ. 油断大敵.&lt;br /&gt;&lt;br /&gt;さて, 一通りアプリケーションをインストールしたら CUDA が使えるかどうかチェックするか.&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://fonlake.blogspot.com/2008/03/freebsd-70-release-part2.html&quot;&gt;(続く)&lt;/a&gt;</description><link>http://fonlake.blogspot.com/2008/03/freebsd-70-release.html</link><author>noreply@blogger.com (ztw)</author><thr:total>0</thr:total></item></channel></rss>