Technology https://yyhh.org/opinion/technology en 函数式编程的两种路线 https://yyhh.org/blog/2018/08/%E5%87%BD%E6%95%B0%E5%BC%8F%E7%BC%96%E7%A8%8B%E7%9A%84%E4%B8%A4%E7%A7%8D%E8%B7%AF%E7%BA%BF <span>函数式编程的两种路线</span> <span><a title="View user profile." href="/user/huahai" lang="" about="/user/huahai" typeof="schema:Person" property="schema:name" datatype="">Huahai</a></span> <span>Sun, 08/26/2018 - 07:30</span> <div class="field field--name-field-notebook field--type-entity-reference field--label-hidden field__items"> <div class="field__item"><div about="/notebook/clojure" id="taxonomy-term-35" class="taxonomy-term vocabulary-notebook"> <a href="/notebook/clojure"> <div class="field field--name-name field--type-string field--label-hidden field__item">Clojure</div> </a> <div class="content"> </div> </div> </div> </div> <div class="field field--name-field-opinion field--type-entity-reference field--label-hidden field__items"> <div class="field__item"><div about="/opinion/technology" id="taxonomy-term-22" class="taxonomy-term vocabulary-opinion"> <a href="/opinion/technology"> <div class="field field--name-name field--type-string field--label-hidden field__item">Technology</div> </a> <div class="content"> </div> </div> </div> </div> <div class="field field--name-body field--type-text-with-summary field--label-hidden field__item"><div class="tex2jax_process"><p>可能很多人没有意识到,函数式编程(FP)有两种非常不同的路线。</p> <p>一条路线,为类型疯狂。这条路线的语言以Haskell为代表。这种FP,一切以类型为<br /> 中心,编程的主要任务,是要把类型搞对了,让编译器高兴,号称是“如果程序编译通<br /> 过了,程序就是对的”。这条线来自学术界,有很长的历史,是FP的主流路线,有很多<br /> 其他FP语言以此为模版。科班出身的同学们说到FP,说的就是这条路线的FP。可能他们<br /> 上学的时候学过Haskell,甚至可能还给Haskell课当过助教,但是他们恨死了Haskell<br /> 。所以这些同学们,是打死不信FP能实用的。</p> <p>科班出身的同学们不知道的是,FP还有另一条路线,与Haskell完全不同,它为数据疯<br /> 狂。这条路线的语言目前只有一个样本,就是Clojure。这条路线是野路子,来自一个<br /> 没有CS背景的学音乐的程序员,名字叫Rich Hickey。他发明Clojure是让自己还可以继<br /> 续编程下去。他当时主要用C++编程接活,还在NYU教过C++。但2007年的时候他觉得自<br /> 己身心俱疲,被并行编程快搞疯了,觉得非FP不可。他还用过Common Lisp,觉得Lisp<br /> 很好,所以就想搞个FP的Lisp。于是他用了2年时间写了Clojure,发在Common Lisp的<br /> 邮件组里面。目前Clojure是Redmonk排名21的编程语言。</p> <p>刚开始的时候,Clojure主要被当成一个并发语言来宣传的,主要宣传它的software&nbsp;<br /> transactional memory的机制,比如atom, ref, agent这些有控制的mutation。</p> <p>在十年以后的今天,几乎没有人提这些了。人们在使用中发现,其实大部分的代码,不<br /> 需要mutation。Clojure的真正优势,在于它面向数据的编程模式。</p> <p>面向数据的编程(DOP)有哪些特征?我个人总结一下,有这几点:</p> <p>1. 数据是第一位的。</p> <p>Lisp说“代码也是数据”。Clojure是一种Lisp,当然代码也是数据,这似乎不算有啥<br /> 新意。但当Lisp说代码是数据的时候,主要是说Lisp可以用宏来操作代码,而Clojure<br /> 并不鼓励用宏。那啥意思呢?原来在Clojure里面,有这样一个说头,“能用数据干的<br /> 事,不要用函数干,能用函数干的事,不要用宏干”。连函数都不是第一位的!</p> <p>为什么?因为按照其能被组合的能力排序:数据》函数》宏。宏的可组合性最差,有的<br /> 宏完全不能被组合。函数的组合方式也很有限,就两种,一个是函数组合(f (h (g x)<br /> )),另外就是函数本身可以被传来传去。而数据的可组合方式是无限的。所以在<br /> Clojure里面,数据是第一位的。</p> <p>2. 数据是显式的。</p> <p>既然数据是第一位的,那么它在程序中是裸露的,不用封装隐藏起来,也不需要转换,<br /> 数据能在代码里面看见,所见即所得,数据在代码中有字面的表示。</p> <p>3. 数据是普通的。</p> <p>不需要类型,不需要特别的结构,不需要DSL, 只需要用几种普通的不变数据结构就足<br /> 够了。Clojure程序一般就用映射{},列表(),矢量[],集合#{}这四种不变数据结构来<br /> 代表一切。</p> <p>为啥这四种就够了,因为他们分别表示了所有计算需要表示的抽象概念:映射当然很重<br /> 要,根据范畴论的数学基础理论,有了映射就有了一切数学;列表表示了计算机特有的<br /> 执行的概念,列表的第一个元素是特殊的,表示执行何种功能,这就是Lisp的强大之处<br /> ;矢量是Clojure特有的,与列表区分开,是突出不具备执行功能的纯数据,只用来表<br /> 示顺序的概念;集合也被分出来,用来表示纯数据中没有顺序概念的东西,这也是数学<br /> 的传统基础。</p> <p>不需要类型,这是Clojure与Haskell最大的分歧。类型能保证的东西很有限,比如不能<br /> 保证程序的语义是正确的,而它带来了过多的对程序员限制,算是得不偿失。</p> <p>没有类型,那如何保证程序是对的?完全靠测试么?Clojure的回答是,靠spec。 spec<br /> 是对程序行为的一种描述,用来描述数据应该是什么样子的,比如一个map应该含有什<br /> 么key,等等,还可以用来描述函数的输入输出应该是什么样的,比如输入应该是奇数<br /> ,输出是符合某个等式的,等等。这比目前所有类型系统都要更强,因为这个描述语言<br /> 可以用一般的Clojure代码,所以是图灵完备的。有了spec,可以在编译时报错,可以<br /> 自动产生成千上万个测试,可以在运行时检测输入输出,等等。spec是可选的,而不是<br /> 编译器强加的一个负担。</p> <p>我觉得未来属于面向数据的编程,你也试试看?</p> </div></div> <section> <h2>Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=188&amp;2=comment_node_blog&amp;3=comment_node_blog" token="2VdRs548VE63vl2RtPhAAFN3Q09xqNm47lWqIgWKiHY"></drupal-render-placeholder> </section> <strong class="node_view"></strong> Sun, 26 Aug 2018 06:30:35 +0000 Huahai 188 at https://yyhh.org Data-Oriented Programming (DOP) https://yyhh.org/blog/2016/12/data-oriented-programming-dop <span>Data-Oriented Programming (DOP)</span> <span><a title="View user profile." href="/user/huahai" lang="" about="/user/huahai" typeof="schema:Person" property="schema:name" datatype="">Huahai</a></span> <span>Sat, 12/03/2016 - 23:33</span> <div class="field field--name-field-notebook field--type-entity-reference field--label-hidden field__items"> <div class="field__item"><div about="/notebook/clojure" id="taxonomy-term-35" class="taxonomy-term vocabulary-notebook"> <a href="/notebook/clojure"> <div class="field field--name-name field--type-string field--label-hidden field__item">Clojure</div> </a> <div class="content"> </div> </div> </div> </div> <div class="field field--name-field-opinion field--type-entity-reference field--label-hidden field__items"> <div class="field__item"><div about="/opinion/technology" id="taxonomy-term-22" class="taxonomy-term vocabulary-opinion"> <a href="/opinion/technology"> <div class="field field--name-name field--type-string field--label-hidden field__item">Technology</div> </a> <div class="content"> </div> </div> </div> </div> <div class="field field--name-body field--type-text-with-summary field--label-hidden field__item"><div class="tex2jax_process"><p>JSON is arguably the world's most popular human readable data format today.&nbsp; It has largely replaced XML as the data exchange format on the Internet. One of the key reasons for the proliferation of JSON is its simplicity.&nbsp; The data structure are very limited: only arrays, enclosed with []; and objects, enclosed with {}. That's it. It cannot be simpler.</p> <p>Apparently, this dead simple data format is enough to represent the vast landscape of data that JSON becomes the de-facto data format for Web services. Most Web APIs we use today speaks JSON. However, JSON is not native for most programming languages. It becomes a pain to convert to and back from JSON in programming languages.</p> <p>What if we develop a Data-Oriented Programming (DOP) language, that can speak something similar to JSON natively?</p> <p>Luckily, this language already exists. It is called Clojure!</p> <p>In Clojure, [] means the same thing as in JSON, {} means essentially the same thing as well: a key value map. The only thing added, which makes it a programming language instead of a purely data format, is a pair of (). What () enables is the abilities to define and call functions. With this additon, we get a fully general purpose programming language.</p> <p>As you may have suspected, using () to define and call functions is what Lisp do. So you are right, in this sense, Clojure is a Lisp. But with the ability to handle data like in JSON, it is a Data-Oriented Programming language.</p> <p>So, there you have it, Clojure is the first DOP language, a DOP Lisp.</p> </div></div> <section> <h2>Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=179&amp;2=comment_node_blog&amp;3=comment_node_blog" token="p6f-yHhiXNlpSBYvxl7UyaOgwPZoiCd6HBcxaQBOd_g"></drupal-render-placeholder> </section> <strong class="node_view"></strong> Sat, 03 Dec 2016 23:33:44 +0000 Huahai 179 at https://yyhh.org Switching to Spacemacs from Vim for Clojure/ClojureScript Development https://yyhh.org/blog/2015/08/switching-spacemacs-vim-clojure-clojurescript-development <span>Switching to Spacemacs from Vim for Clojure/ClojureScript Development</span> <span><a title="View user profile." href="/user/huahai" lang="" about="/user/huahai" typeof="schema:Person" property="schema:name" datatype="">Huahai</a></span> <span>Thu, 08/13/2015 - 07:00</span> <div class="field field--name-field-notebook field--type-entity-reference field--label-hidden field__items"> <div class="field__item"><div about="/notebook/clojure" id="taxonomy-term-35" class="taxonomy-term vocabulary-notebook"> <a href="/notebook/clojure"> <div class="field field--name-name field--type-string field--label-hidden field__item">Clojure</div> </a> <div class="content"> </div> </div> </div> <div class="field__item"><div about="/notebook/spacemacs" id="taxonomy-term-39" class="taxonomy-term vocabulary-notebook"> <a href="/notebook/spacemacs"> <div class="field field--name-name field--type-string field--label-hidden field__item">Spacemacs</div> </a> <div class="content"> </div> </div> </div> </div> <div class="field field--name-field-opinion field--type-entity-reference field--label-hidden field__items"> <div class="field__item"><div about="/opinion/technology" id="taxonomy-term-22" class="taxonomy-term vocabulary-opinion"> <a href="/opinion/technology"> <div class="field field--name-name field--type-string field--label-hidden field__item">Technology</div> </a> <div class="content"> </div> </div> </div> </div> <div class="field field--name-body field--type-text-with-summary field--label-hidden field__item"><div class="tex2jax_process"><p>Clojure has been my primary programming language for a couple of years now. During this period, I have relied on my trusty Vim text editor as the development environment. Coding Clojure in Vim had been an enjoyable experience with these excellent Vim plugins:</p> <ol><li><a href="https://github.com/guns/vim-clojure-static">vim-clojure-static</a></li> <li><a href="https://github.com/tpope/vim-fireplace">fireplace.vim</a></li> <li><a href="http://www.vim.org/scripts/script.php?script_id=3998">paredit.vim</a></li> <li><a href="https://github.com/luochen1990/rainbow">Rainbow Parentheses Improved</a></li> <li><a href="https://github.com/guns/vim-clojure-highlight">vim-clojure-highlight</a></li> <li><a href="https:://github.com/venantius/vim-cljfmt">vim-cljfmt</a></li> </ol><p>So, why am I switching? Well, Clojure is, after all, a LISP. The tooling coverage for Clojure in the LISP's natural habitat, Emacs, is simply more complete than in Vim. I did not realize the extent of the discrepancy until last week, when some guys in the Clojure meetup demonstrated impressive refactoring features of their Emacs Clojure development environment.</p> <p>To be fair, fireplace is doing an adequate job of supporting the most of dynamic features necessary for Clojure programming: code evaluation, documents lookup, tests and so on. I have been productive with it in the last couple of years. On the other hand, as my projects grow bigger and more complex, better support for debugging and refactoring seems to become desirable. These capabilities exist in Emacs.</p> <p>Of course, I am not about to give up the Vim style text editing. As a HCI researcher in my previous life, I know that theoretically, Vim style text editing is simply better than text editing with GUI and a mouse, because Fitts' Law is real and it hurts. In addition, the superiority of modal editor vi over non-modal editor emacs for text editing has been empirically established as far back as 1983<a class="see-footnote" id="footnoteref1_rmmu6ug" title="Poller, M.F., Garter, S.K. A Comparative Study of Moded and Modeless Text Editing by Experienced Editor Users. In Proceedings of CHI '83, pp 166-170" href="#footnote1_rmmu6ug">1</a>.</p> <p>For my case, an ideal situation would be to keep the text editing style of Vim, but use it in Emacs to get the benefit of extensive Clojure support. Not surprisingly, plenty of people have worked towards such solutions. The latest effort is in the form of <a href="https://github.com/syl20bnr/spacemacs">spacemacs</a>, a fantastic open source project that is enjoying an outpouring enthusiasm from the community, earning more than 3000 github stars in a very short time.</p> <p>I had to try it. Try as I did. And I can say that I am not disappointed.</p> <p>To be honest, the on-boarding process left a lot to be desired. First, on OSX, there's already a default installation of emacs, which would not work with spacemacs. The recommended homebrew installation of emacs is simple enough, but one needs to rename the default emacs and make the homebrew one the default. This is not mentioned in the guide.</p> <p>I found configuring the editor to be surprisingly easy, considering I knew nothing about emacs before (other than the key combination to quit from one). The majority of the Vim key bindings I tried work as desired. The ones that did not work are not hard to change. Within a couple of hours, I have managed to create a configuration that replicates most of the key bindings of paredit.vim, which I need to be productive coding Clojure. Here are my <code>dotspacemacs/config</code> to achieve these and more.</p> <div><font face="monospace"><font color="#9a7200">(</font><font color="#719899"><strong>defun</strong></font> remove-background-color <font color="#9a7200">()</font><br />   <font color="#009799">"Useful for transparent terminal."</font><br />   <font color="#9a7200">(</font><font color="#719899"><strong>unless</strong></font> <font color="#9a7200">(</font>display-graphic-p <font color="#9a7200">(</font>selected-frame<font color="#9a7200">))</font><br />     <font color="#9a7200">(</font>set-face-background <font color="#9a7200">'</font><font color="#9a7599">default</font> <font color="#009799">"unspecified-bg"</font> <font color="#9a7200">(</font>selected-frame<font color="#9a7200">))))</font><br /><font color="#9a7200">(</font><font color="#719899"><strong>defun</strong></font> dotspacemacs/config <font color="#9a7200">()</font><br />   <font color="#009799">"Configuration function.</font><br /><font color="#009799"> This function is called at the very end of Spacemacs initialization after</font><br /><font color="#009799">layers configuration."</font><br />   <font color="#719872">;; Make evil-mode up/down operate in screen lines instead of logical lines</font><br />   <font color="#9a7200">(</font>define-key evil-motion-state-map <font color="#009799">"j"</font> <font color="#9a7200">'</font><font color="#9a7599">evil-next-visual-line</font><font color="#9a7200">)</font><br />   <font color="#9a7200">(</font>define-key evil-motion-state-map <font color="#009799">"k"</font> <font color="#9a7200">'</font><font color="#9a7599">evil-previous-visual-line</font><font color="#9a7200">)</font><br />   <font color="#719872">;; Also in visual mode</font><br />   <font color="#9a7200">(</font>define-key evil-visual-state-map <font color="#009799">"j"</font> <font color="#9a7200">'</font><font color="#9a7599">evil-next-visual-line</font><font color="#9a7200">)</font><br />   <font color="#9a7200">(</font>define-key evil-visual-state-map <font color="#009799">"k"</font> <font color="#9a7200">'</font><font color="#9a7599">evil-previous-visual-line</font><font color="#9a7200">)</font><br />   <font color="#719872">;; clojure mode config</font><br />   <font color="#9a7200">(</font><font color="#719899"><strong>require</strong></font> <font color="#9a7200">'</font><font color="#9a7599">clojure-mode-extra-font-locking</font><font color="#9a7200">)</font><br />   <font color="#9a7200">(</font>add-hook <font color="#9a7200">'</font><font color="#9a7599">clojure-mode-hook</font> <font color="#9a7200"><strong>#'smartparens-strict-mode</strong></font><font color="#9a7200">)</font><br />   <font color="#9a7200">(</font>add-hook <font color="#9a7200">'</font><font color="#9a7599">clojure-mode-hook</font> <font color="#9a7200"><strong>#'evil-smartparens-mode</strong></font><font color="#9a7200">)</font><br />   <font color="#9a7200">(</font>add-hook <font color="#9a7200">'</font><font color="#9a7599">clojure-mode-hook</font> <font color="#9a7200"><strong>#'rainbow-delimiters-mode</strong></font><font color="#9a7200">)</font><br />   <font color="#719872">;; start a light theme when launched as GUI</font><br />   <font color="#9a7200">(</font><font color="#719899"><strong>when</strong></font> <font color="#9a7200">(</font>display-graphic-p<font color="#9a7200">)</font><br />       <font color="#9a7200">(</font><font color="#719899"><strong>progn</strong></font><br />         <font color="#9a7200">(</font>disable-theme <font color="#9a7200">'</font><font color="#9a7599">darkburn</font><font color="#9a7200">)</font><br />         <font color="#9a7200">(</font>load-theme <font color="#9a7200">'</font><font color="#9a7599">leuven</font> <font color="#719899"><strong>t</strong></font><font color="#9a7200">)</font><br />         <font color="#9a7200">(</font>enable-theme <font color="#9a7200">'</font><font color="#9a7599">leuven</font><font color="#9a7200">)))</font><br />   <font color="#719872">;; remove background color for both server and client</font><br />   <font color="#9a7200">(</font>add-hook <font color="#9a7200">'</font><font color="#9a7599">window-setup-hook</font> <font color="#9a7200">'</font><font color="#9a7599">remove-background-color</font><font color="#9a7200">)</font><br />   <font color="#9a7200">(</font>add-hook <font color="#9a7200">'</font><font color="#9a7599">server-visit-hook</font> <font color="#9a7200">'</font><font color="#9a7599">remove-background-color</font><font color="#9a7200">)</font><br />   <font color="#719872">;; remove trailing whitespace when saving</font><br />   <font color="#9a7200">(</font>add-hook <font color="#9a7200">'</font><font color="#9a7599">before-save-hook</font> <font color="#9a7200">'</font><font color="#9a7599">delete-trailing-whitespace</font><font color="#9a7200">)</font><br />   <font color="#719872">;; toggle comments</font><br />   <font color="#9a7200">(</font>define-key evil-normal-state-map <font color="#009799">",c "</font> <font color="#009799">" cl"</font><font color="#9a7200">)</font><br />   <font color="#719872">;; match paredit.vim key-binding</font><br />   <font color="#9a7200">(</font>define-key evil-normal-state-map <font color="#009799">",W"</font> <font color="#009799">" kw"</font><font color="#9a7200">)</font>  <font color="#719872">; wrap with ()</font><br />   <font color="#9a7200">(</font>define-key evil-normal-state-map <font color="#009799">",w["</font>        <font color="#719872">; wrap with []</font><br />     <font color="#9a7200">(</font><font color="#719899"><strong>lambda</strong></font> <font color="#9a7200">(</font><font color="#9a7200"><strong>&amp;optional</strong></font> arg<font color="#9a7200">)</font> <font color="#9a7200">(</font>interactive <font color="#009799">"P"</font><font color="#9a7200">)</font> <font color="#9a7200">(</font>sp-wrap-with-pair <font color="#009799">"["</font><font color="#9a7200">)))</font><br />   <font color="#9a7200">(</font>define-key evil-normal-state-map <font color="#009799">",w{"</font>        <font color="#719872">; wrap with {}</font><br />     <font color="#9a7200">(</font><font color="#719899"><strong>lambda</strong></font> <font color="#9a7200">(</font><font color="#9a7200"><strong>&amp;optional</strong></font> arg<font color="#9a7200">)</font> <font color="#9a7200">(</font>interactive <font color="#009799">"P"</font><font color="#9a7200">)</font> <font color="#9a7200">(</font>sp-wrap-with-pair <font color="#009799">"{"</font><font color="#9a7200">)))</font><br />   <font color="#9a7200">(</font>define-key evil-normal-state-map <font color="#009799">",S"</font> <font color="#009799">" kW"</font><font color="#9a7200">)</font>  <font color="#719872">; splice, i.e unwrap an sexp</font><br />   <font color="#9a7200">(</font>define-key evil-normal-state-map <font color="#009799">",J"</font> <font color="#009799">" kJ"</font><font color="#9a7200">)</font>  <font color="#719872">; join two sexps</font><br />   <font color="#9a7200">(</font>define-key evil-normal-state-map <font color="#009799">",O"</font> <font color="#9a7200">'</font><font color="#9a7599">sp-split-sexp</font><font color="#9a7200">)</font> <font color="#719872">; split an sexp</font><br />   <font color="#9a7200">(</font>define-key evil-normal-state-map <font color="#009799">",I"</font> <font color="#009799">" kr"</font><font color="#9a7200">)</font>  <font color="#719872">; raise current symbol</font><br />   <font color="#9a7200">(</font>define-key evil-normal-state-map <font color="#9a7200">(</font>kbd <font color="#009799">", &lt;up&gt;"</font><font color="#9a7200">)</font> <font color="#009799">" kE"</font><font color="#9a7200">)</font> <font color="#719872">; splice kill backward</font><br />   <font color="#9a7200">(</font>define-key evil-normal-state-map <font color="#9a7200">(</font>kbd <font color="#009799">", &lt;down&gt;"</font><font color="#9a7200">)</font> <font color="#009799">" ke"</font><font color="#9a7200">)</font> <font color="#719872">; forward</font><br />   <font color="#719872">;; These are different from vim, here cursor should NOT be on delimits</font><br />   <font color="#9a7200">(</font>define-key evil-normal-state-map <font color="#009799">",&gt;"</font> <font color="#009799">" ks"</font><font color="#9a7200">)</font>  <font color="#719872">; forward slurp</font><br />   <font color="#9a7200">(</font>define-key evil-normal-state-map <font color="#009799">",&lt;"</font> <font color="#009799">" kS"</font><font color="#9a7200">)</font>  <font color="#719872">; backward slurp</font><br /><font color="#9a7200">)</font></font></div> <div> </div> <p>As can be seen, all these functionality of Vim have already been coded up by someone and included in spacemacs as functions, all I did was changing their key-bindings. That was easy <img alt="smiley" height="23" src="/libraries/smiley/images/regular_smile.png" width="23" />. I am looking forward to the journey ahead with spacemacs.</p> <ul class="footnotes"><li class="footnote" id="footnote1_rmmu6ug"><a class="footnote-label" href="#footnoteref1_rmmu6ug">1.</a> Poller, M.F., Garter, S.K. A Comparative Study of Moded and Modeless Text Editing by Experienced Editor Users. In Proceedings of CHI '83, pp 166-170</li> </ul></div></div> <section> <h2>Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=178&amp;2=comment_node_blog&amp;3=comment_node_blog" token="UHxrIgav-Wt4wvomEc5xli2jD6WomvXCG-Os8YZvGLs"></drupal-render-placeholder> </section> <strong class="node_view"></strong> Thu, 13 Aug 2015 06:00:47 +0000 Huahai 178 at https://yyhh.org Free Airport Wi-Fi? ---- Don't Count on It in Europe (Update on 08/25/2013) https://yyhh.org/blog/2012/10/free-airport-wi-fi-dont-count-it-europe-update-08-25-2013 <span>Free Airport Wi-Fi? ---- Don&#039;t Count on It in Europe (Update on 08/25/2013)</span> <div class="field field--name-field-experience field--type-entity-reference field--label-hidden field__items"> <div class="field__item"><div about="/experience/travel" id="taxonomy-term-12" class="taxonomy-term vocabulary-experience"> <a href="/experience/travel"> <div class="field field--name-name field--type-string field--label-hidden field__item">Travel</div> </a> <div class="content"> </div> </div> </div> </div> <span><a title="View user profile." href="/user/yunyao" lang="" about="/user/yunyao" typeof="schema:Person" property="schema:name" datatype="">yunyao</a></span> <span>Fri, 10/26/2012 - 19:28</span> <div class="field field--name-field-opinion field--type-entity-reference field--label-hidden field__items"> <div class="field__item"><div about="/opinion/technology" id="taxonomy-term-22" class="taxonomy-term vocabulary-opinion"> <a href="/opinion/technology"> <div class="field field--name-name field--type-string field--label-hidden field__item">Technology</div> </a> <div class="content"> </div> </div> </div> </div> <div class="field field--name-body field--type-text-with-summary field--label-hidden field__item"><div class="tex2jax_process"><p><span style="font-size: small;">I was traveling in Europe last week. While I enjoyed the history, culture and food very much, I was not a big fan of the airports. Like many people, I would like to stay connected most of the time, at least be able to access my emails and the Web from time to time (say every 2-3 hours). Unfortunately, passing through the following three airports in Europe is almost like returning back to stone age, in &nbsp;terms of connectivities.</span></p> <div> <div><span style="border-collapse: separate; color: #000000; font-family: Tahoma; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: small;"><br></span></div> <div><span style="border-collapse: separate; color: #000000; font-family: Tahoma; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: small;">Initially, I thought that CDG was pretty bad --- it does have free Wifi, but only for 15 minutes. Then I have to buy Wifi Access. However, at least I was able to browse the airport website for free.&nbsp;</span></div> <div><span style="border-collapse: separate; color: #000000; font-family: Tahoma; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: small;"><br></span></div> <div><span style="border-collapse: separate; color: #000000; font-family: Tahoma; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: small;">Then MAD really made me a bit mad ---- no any sort of Wifi whatsoever available, free or not!</span></div> <div><span style="border-collapse: separate; color: #000000; font-family: Tahoma; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: small;"><br></span></div> <div><span style="border-collapse: separate; color: #000000; font-family: Tahoma; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: small;">Now, FRA does provide 30 minutes free Wi-Fi. That's better, right? However, then you need to be able to receive text on your cell phone to get the pin. &nbsp;Some&nbsp;genius&nbsp;obviously believes that everyone visiting FRA has a cell phone and every cell phone has service in FRA. Unfortunately, my cell phone does not work here; so no luck for me. :( &nbsp;</span></div> <div><span style="border-collapse: separate; color: #000000; font-family: Tahoma; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: small;"><br></span></div> <div><span style="font-size: small;"><span style="border-collapse: separate; color: #000000; font-family: Tahoma; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span style="border-collapse: separate; color: #000000; font-family: Tahoma; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">Of course, I can always spend a few Euro to buy </span></span><span style="border-collapse: separate; color: #000000; font-family: Tahoma; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span style="border-collapse: separate; color: #000000; font-family: Tahoma; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span style="border-collapse: separate; color: #000000; font-family: Tahoma; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">Wi-Fi</span> access. &nbsp;However, free </span></span><span style="border-collapse: separate; color: #000000; font-family: Tahoma; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span style="border-collapse: separate; color: #000000; font-family: Tahoma; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span style="border-collapse: separate; color: #000000; font-family: Tahoma; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">Wi-Fi </span>in airports is almost a norm in today's world, isn't it? Even in developing countries such as El Salvador has free </span></span><span style="border-collapse: separate; color: #000000; font-family: Tahoma; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span style="border-collapse: separate; color: #000000; font-family: Tahoma; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"><span style="border-collapse: separate; color: #000000; font-family: Tahoma; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">Wi-Fi </span>in its airports.&nbsp; </span>Unfortunately, I don't really see the situation will likely to improve in the near future. This note is just a reminder to myself to load up my laptop and iPhone with things that I can work/read while in the airports off the grid.</span></span></div> <div><span style="border-collapse: separate; color: #000000; font-family: Tahoma; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: small;"></span><br><span style="font-size: small;">Update on 08/25/2013:------------------------------------------------</span></div> <div><span style="font-size: small;">It turns out that not all European airports are that bad. During my recent trips to Europe, I have discovered that SOF (Sofia airport in Bulgaria) provides unlimited free <span style="border-collapse: separate; color: #000000; font-family: Tahoma; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">Wi-Fi</span>. MUC (Munich airport) provides 30 minutes free <span style="border-collapse: separate; color: #000000; font-family: Tahoma; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">Wi-Fi </span>and requires only an email address. Even FRA seems to have updated their genious approach of providing free <span style="border-collapse: separate; color: #000000; font-family: Tahoma; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;">Wi-Fi </span>as well and requires only an email address now. Things are looking up!</span><br><span style="border-collapse: separate; color: #000000; font-family: Tahoma; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: small;"></span></div> </div> </div></div> <section> <h2>Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=163&amp;2=comment_node_blog&amp;3=comment_node_blog" token="VquigEOO3mDeATBhzi0sibCqTqQyrCcelCC2WJ7OkRI"></drupal-render-placeholder> </section> <strong class="node_view"></strong> Fri, 26 Oct 2012 18:28:54 +0000 yunyao 163 at https://yyhh.org Fixing Problems after Upgrading from Snow Leopard to Mountain Lion https://yyhh.org/blog/2012/09/fixing-problems-after-upgrading-snow-leopard-mountain-lion <span>Fixing Problems after Upgrading from Snow Leopard to Mountain Lion</span> <span><a title="View user profile." href="/user/huahai" lang="" about="/user/huahai" typeof="schema:Person" property="schema:name" datatype="">Huahai</a></span> <span>Mon, 09/24/2012 - 01:28</span> <div class="field field--name-field-notebook field--type-entity-reference field--label-hidden field__items"> <div class="field__item"><div about="/notebook/osx" id="taxonomy-term-37" class="taxonomy-term vocabulary-notebook"> <a href="/notebook/osx"> <div class="field field--name-name field--type-string field--label-hidden field__item">OSX</div> </a> <div class="content"> </div> </div> </div> </div> <div class="field field--name-field-opinion field--type-entity-reference field--label-hidden field__items"> <div class="field__item"><div about="/opinion/technology" id="taxonomy-term-22" class="taxonomy-term vocabulary-opinion"> <a href="/opinion/technology"> <div class="field field--name-name field--type-string field--label-hidden field__item">Technology</div> </a> <div class="content"> </div> </div> </div> </div> <div class="field field--name-body field--type-text-with-summary field--label-hidden field__item"><div class="tex2jax_process"><p>The IT department of my company has been urging us Mac users to upgrade OSX to Lion a long time ago. After getting a few papers submitted last week, I finally got around to upgrade the Snow Leopard for my Macbook Pro work machine. Since I couldn't find Lion on Apple Store any more, I decided to go straight to Mountain Lion. The download and installation went smoothly, and most things seemed to work after the upgrade. Here are a few things that broke and the fixes I found.</p> <h3>SSH with public key</h3> <p>Mountain Lion changed a few things that broke password-free SSH access to and from OSX using public/private key pairs.</p> <p><i>SSH from Mountain Lion to older SSH severs:</i></p> <p>Mountain Lion upgraded openssh client to version 5.9p1. SSH to some older version of ssh server would not work ("Connection reset by peer") due to ciphers being too long. We can use a shorter one by adding to file "~/.ssh/config". </p> <div class="codeblock"> Host address_of_your_ssh_server<br /> Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour </div> <p>This problem is a known issue of openssh. I remember did this fix for my Linux machines.</p> <p><i>SSH to Mountain Lion:</i></p> <p>This one took me a lot of googling to find the <a href="http://www.hkwebentrepreneurs.com/2012/08/password-free-ssh-on-os-x-mountain-lion.html">cause</a>. Basically, Mountain Lion changed /etc/sshd_config file, so that openssh server only checks "~/.ssh/authorized_keys" now, instead of checking both that and "~/.ssh/authorized_keys2". To fix this, all we need to do is to rename the later to the former.</p> <div class="codeblock"> $ mv ~/.ssh/authorized_keys2 ~/.ssh/authorized_keys </div> <p>I find this change rather annoying, as it adds little benefit but creates a lot of troubles. For example, it broke my backup solution. I am using <a href="http://backuppc.sourceforge.net/">backuppc</a> to backup this Macbook to a central backup server through password-less SSH. It took me a while to debug when backuppc reported the problem. </p> <h3>Homebrew</h3> <p>Running "brew doctor" would show the information needed to fix homebrew. Basically, one had to install xcode 4.5, install command line tools, install X, and so on. A lot of downloads and wait time. </p> <h3>Latex</h3> <p>All the latex programs were not in path any more. Since my latex distribution was pretty old anyway. I chose to download the latest version of MacTex to install. It took a long time to download though.</p> <h3>Lotus Notes</h3> <p>Mountain Lion has its own Notes.app now, which conflicts with Lotus Notes. During upgrading, Lotus Notes will be moved to be under a directory "/Application/Lotus Notes Local" or something similar. All you need to do is to find Notes.app in there, and rename it something else, e.g. "LNotes.app", and move it back to be under "/Application".</p> <h3>Java</h3> <p>Java is not installed by default. When using applications require it, you will be prompted to install.</p> <p>In conclusion, the upgrade from Snow Leopard to Mountain Lion works reasonablly OK, but be prepared to fix some problems. I think the upgrade experience of OSX is not better than Linux, as both require a similar amount of tweakings and searching solutions. However, upgrading in OSX costs money. If this was not on company tab and by their urging, I would not have bothered.</p> </div></div> <section> <h2>Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=162&amp;2=comment_node_blog&amp;3=comment_node_blog" token="arBwYz1afMski90mIpzYelLaiAUSrsENAShLbl_MFkY"></drupal-render-placeholder> </section> <strong class="node_view"></strong> Mon, 24 Sep 2012 00:28:31 +0000 Huahai 162 at https://yyhh.org Machine Learning That Matters https://yyhh.org/blog/2012/07/machine-learning-matters <span>Machine Learning That Matters</span> <span><a title="View user profile." href="/user/yunyao" lang="" about="/user/yunyao" typeof="schema:Person" property="schema:name" datatype="">yunyao</a></span> <span>Thu, 07/26/2012 - 22:20</span> <div class="field field--name-field-opinion field--type-entity-reference field--label-hidden field__items"> <div class="field__item"><div about="/opinion/technology" id="taxonomy-term-22" class="taxonomy-term vocabulary-opinion"> <a href="/opinion/technology"> <div class="field field--name-name field--type-string field--label-hidden field__item">Technology</div> </a> <div class="content"> </div> </div> </div> </div> <div class="field field--name-body field--type-text-with-summary field--label-hidden field__item"><div class="tex2jax_process"><p>I happen to come across this excellent article from this year's ICML on <a href="http://www.wkiri.com/research/papers/wagstaff-MLmatters-12.pdf" target="_blank">Machine Learning that Matters</a>. I encourage everyone, especially computer science Ph.D students, to read it.</p> <p>As an industrial researcher who draws a lot of job satisfaction by making both scientific and practical impact, I completely agree with the author on that we need to work on research "that matters",&nbsp; not just for machine learning. Many of the challenges outlined by the author are applicable to many other areas in computer science as well.&nbsp;</p> <p>If you have ever encounter questions from reviewers on the motivation of your work, reading this article can help you think about why your research does (or does not) matter.</p> <p>I would also strongly encourage all computer science Ph.D students to do at least one summer internship (especially in an industrial research lab). You will make new friends and get to work on cool projects. Most importantly, it can truly broaden your herizon and allow you to understand what kind of research matters.</p> </div></div> <ul class="links inline"><li class="comment-add"><a href="/blog/2012/07/machine-learning-matters#comment-form" title="Share your thoughts and opinions." hreflang="und">Add new comment</a></li></ul><section> <a id="comment-58"></a> <article data-comment-user-id="0" class="js-comment comment"> <mark class="hidden" data-comment-timestamp="1343406359"></mark> <footer class="attribution"> <article typeof="schema:Person" about="/user/0"> <div class="field field--name-user-picture field--type-image field--label-hidden field__item"> <img src="/sites/default/files/styles/thumbnail/public/default_images/default-user-image.png?itok=hWWOuuKw" width="100" height="100" alt="Profile picture for user Johnebyne" title="Anonymous user" typeof="foaf:Image" /> </div> </article> <div class="comment-submitted"> <p class="commenter-name"> <a rel="nofollow" href="http://www.wkiri.com/" lang="" typeof="schema:Person" property="schema:name" datatype="">Kiri</a> </p> <p class="comment-time"> Fri, 07/27/2012 - 17:25 </p> </div> </footer> <div class="comment-text"> <div class="comment-arrow"></div> <h3><a href="/comment/58#comment-58" class="permalink" rel="bookmark" hreflang="en">Thanks for your comments on</a></h3> <div class="content"> <div class="field field--name-comment-body field--type-text-long field--label-hidden field__item"><div class="tex2jax_process"><p>Thanks for your comments on this paper. I entirely agree with your advice to students to do internships. In addition to connecting students with important motivation problems, it also helps them find out if the way research is done in a different (non-academic) environment is a good fit.</p> </div></div> <drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=58&amp;1=default&amp;2=en&amp;3=" token="1XJ0DWK56YlZ__6zCeU6M3K1jr60PWmSNkzkl4SjXrw"></drupal-render-placeholder> </div> </div> </article> <div class="indented"><a id="comment-59"></a> <article data-comment-user-id="2" class="js-comment comment"> <mark class="hidden" data-comment-timestamp="1343441446"></mark> <footer class="attribution"> <article typeof="schema:Person" about="/user/yunyao"> <div class="field field--name-user-picture field--type-image field--label-hidden field__item"> <img src="/sites/default/files/styles/thumbnail/public/pictures/2017-11/yunyao_0.jpg?itok=G32xMAqO" width="100" height="100" alt="Profile picture for user yunyao" typeof="foaf:Image" /> </div> </article> <div class="comment-submitted"> <p class="commenter-name"> <a title="View user profile." href="/user/yunyao" lang="" about="/user/yunyao" typeof="schema:Person" property="schema:name" datatype="">yunyao</a> </p> <p class="comment-time"> Sat, 07/28/2012 - 03:10 </p> </div> <p class="visually-hidden">In reply to <a href="/comment/58#comment-58" class="permalink" rel="bookmark" hreflang="en">Thanks for your comments on</a> by <a rel="nofollow" href="http://www.wkiri.com/" lang="" typeof="schema:Person" property="schema:name" datatype="">Kiri</a></p> </footer> <div class="comment-text"> <div class="comment-arrow"></div> <h3><a href="/comment/59#comment-59" class="permalink" rel="bookmark" hreflang="en">Thanks!</a></h3> <div class="content"> <div class="field field--name-comment-body field--type-text-long field--label-hidden field__item"><div class="tex2jax_process"><p>Dear Kiri,<br><br>Thanks for dropping by my blog. :) If you happen to be around San Jose, I would love to have you to give a talk here in Almaden. <br><br>Thanks!<br><br>-<a href="http://www.almaden.ibm.com/cs/people/yunyaoli/index.html">Yunyao</a></p> </div></div> <drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=59&amp;1=default&amp;2=en&amp;3=" token="i2V59LhAwBCCKtV6XLNpFjcBefEbgbr6fzCE4KQCX1g"></drupal-render-placeholder> </div> </div> </article> </div> <h2>Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=157&amp;2=comment_node_blog&amp;3=comment_node_blog" token="6Az2If1jk4EP0ZzRASBUAUanwh-1SYOHuoM9UlRrAiQ"></drupal-render-placeholder> </section> <strong class="node_view"></strong> Thu, 26 Jul 2012 21:20:26 +0000 yunyao 157 at https://yyhh.org Cat Photography with iPhone 4s https://yyhh.org/blog/2012/05/cat-photography-iphone-4s <span>Cat Photography with iPhone 4s </span> <div class="field field--name-field-experience field--type-entity-reference field--label-hidden field__items"> <div class="field__item"><div about="/experience/pets" id="taxonomy-term-14" class="taxonomy-term vocabulary-experience"> <a href="/experience/pets"> <div class="field field--name-name field--type-string field--label-hidden field__item">Pets</div> </a> <div class="content"> </div> </div> </div> <div class="field__item"><div about="/experience/shopping" id="taxonomy-term-13" class="taxonomy-term vocabulary-experience"> <a href="/experience/shopping"> <div class="field field--name-name field--type-string field--label-hidden field__item">Shopping</div> </a> <div class="content"> </div> </div> </div> </div> <span><a title="View user profile." href="/user/yunyao" lang="" about="/user/yunyao" typeof="schema:Person" property="schema:name" datatype="">yunyao</a></span> <span>Sat, 05/19/2012 - 02:19</span> <div class="field field--name-field-opinion field--type-entity-reference field--label-hidden field__items"> <div class="field__item"><div about="/opinion/technology" id="taxonomy-term-22" class="taxonomy-term vocabulary-opinion"> <a href="/opinion/technology"> <div class="field field--name-name field--type-string field--label-hidden field__item">Technology</div> </a> <div class="content"> </div> </div> </div> </div> <div class="field field--name-body field--type-text-with-summary field--label-hidden field__item"><div class="tex2jax_process"><p>It has been a while since Yunyao got her iPhone 4s, which is known for its "superb" camera --- "<span class="st">8MP camera with all-new optics also shoots 1080p HD video"</span>. 8MP on a cell phone sounds really impressive, does it? Maybe she finally can leave her big heavy Pentax for a while?</p> <p>So she tested its performance with her favoriate model: Mayori.</p> <p>First, let's test it under natural light setting:</p> <p>"What's up?"</p> <p><img src="http://farm8.staticflickr.com/7194/7034156259_2dee7491ac.jpg" alt="Mayori" width="375" height="500"></p> </p> <p>"I am sad ..."</p> <p><img src="http://farm8.staticflickr.com/7192/6888062654_23740aaa02.jpg" width="375" height="500"></p> <p>"I am really really sad"</p> <p><img src="http://farm8.staticflickr.com/7110/7034157111_513bc8882b.jpg" width="375" height="500"></p> <p>Dark setting</p> <p>"My good buddy won't ever talk to me... "</p> <p><img src="http://farm8.staticflickr.com/7005/6598726949_3e189493c2.jpg" width="500" height="334"></p> <p>with Pentax</p> <p><img src="http://farm8.staticflickr.com/7170/6598717413_4598a71567.jpg" width="334" height="500"></p> </p> <p>Obviously, Yunyao cannot abondon her Pentax DSLR yet, probably not ever. But iPhone 4s is not bad for natural light setting, especially if you only plan to watch your photos on it. :)</p> </div></div> <ul class="links inline"><li class="comment-add"><a href="/blog/2012/05/cat-photography-iphone-4s#comment-form" title="Share your thoughts and opinions." hreflang="und">Add new comment</a></li></ul><section> <a id="comment-80"></a> <article data-comment-user-id="0" class="js-comment comment"> <mark class="hidden" data-comment-timestamp="1511394865"></mark> <footer class="attribution"> <article typeof="schema:Person" about="/user/0"> <div class="field field--name-user-picture field--type-image field--label-hidden field__item"> <img src="/sites/default/files/styles/thumbnail/public/default_images/default-user-image.png?itok=hWWOuuKw" width="100" height="100" alt="Profile picture for user Johnebyne" title="Anonymous user" typeof="foaf:Image" /> </div> </article> <div class="comment-submitted"> <p class="commenter-name"> <a rel="nofollow" href="http://www.bareprice.com" lang="" typeof="schema:Person" property="schema:name" datatype="">bareprice.com</a> </p> <p class="comment-time"> Fri, 03/01/2013 - 15:35 </p> </div> </footer> <div class="comment-text"> <div class="comment-arrow"></div> <h3><a href="/comment/80#comment-80" class="permalink" rel="bookmark" hreflang="en">Lovely kitty!</a></h3> <div class="content"> <div class="field field--name-comment-body field--type-text-long field--label-hidden field__item"><div class="tex2jax_process"><p>Lovely kitty!</p> </div></div> <drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=80&amp;1=default&amp;2=en&amp;3=" token="2v68fLSD0DXSi4Zqnq5y1yYWZzsIsLbz4Xzv7-_QUpg"></drupal-render-placeholder> </div> </div> </article> <h2>Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=154&amp;2=comment_node_blog&amp;3=comment_node_blog" token="PpXjcGXy8uYejyE60jAyT3Nxprlw61OLnfbB2V0REYg"></drupal-render-placeholder> </section> <strong class="node_view"></strong> Sat, 19 May 2012 01:19:16 +0000 yunyao 154 at https://yyhh.org Review for "Virtual Cat Toys HD Catnip Collection" https://yyhh.org/blog/2011/11/review-virtual-cat-toys-hd-catnip-collection <span>Review for &quot;Virtual Cat Toys HD Catnip Collection&quot;</span> <div class="field field--name-field-experience field--type-entity-reference field--label-hidden field__items"> <div class="field__item"><div about="/experience/pets" id="taxonomy-term-14" class="taxonomy-term vocabulary-experience"> <a href="/experience/pets"> <div class="field field--name-name field--type-string field--label-hidden field__item">Pets</div> </a> <div class="content"> </div> </div> </div> <div class="field__item"><div about="/experience/shopping" id="taxonomy-term-13" class="taxonomy-term vocabulary-experience"> <a href="/experience/shopping"> <div class="field field--name-name field--type-string field--label-hidden field__item">Shopping</div> </a> <div class="content"> </div> </div> </div> </div> <span><a title="View user profile." href="/user/yunyao" lang="" about="/user/yunyao" typeof="schema:Person" property="schema:name" datatype="">yunyao</a></span> <span>Sun, 11/06/2011 - 19:46</span> <div class="field field--name-field-opinion field--type-entity-reference field--label-hidden field__items"> <div class="field__item"><div about="/opinion/technology" id="taxonomy-term-22" class="taxonomy-term vocabulary-opinion"> <a href="/opinion/technology"> <div class="field field--name-name field--type-string field--label-hidden field__item">Technology</div> </a> <div class="content"> </div> </div> </div> </div> <div class="field field--name-body field--type-text-with-summary field--label-hidden field__item"><div class="tex2jax_process"><p>As many of friends, I recently acquired a HP Touchpad largely due to its low price. I don't really need a tablet, as I am sitting in front of computes almost all the time. My original plan was to turn it into an interactive cat toy, at least sometimes, so I can keep the two cats entertained while I am working.</p> <p>Unfortunately, I could only find one game designed for the cats "The Catnip Collection". According to its website, it "is a variety of toys that will amuse and challenge your cat and its human".</p> <p>The reviews seem pretty decent (4 out 5).</p> <p><a href="https://developer.palm.com/appredirect/?packageid=com.wtflolomgbbq.haxe.vct">https://developer.palm.com/appredirect/?packageid=com.wtflolomgbbq.haxe…</a></p> <p>Even though it is not free anymore, I bited the bullet and bought the app. Unfortunately, the cats are not even remotely interested! I think that the problem is the objects (insects, balls, etc) are constantly moving instead of stopping and moving randomly. So the cats get bored after 5 seconds.</p> <p>Hopefully the app developer will see my post and consider improve the game further. For the smart cats who play with human all the time, we need something that is really challenging!</p> </div></div> <ul class="links inline"><li class="comment-add"><a href="/blog/2011/11/review-virtual-cat-toys-hd-catnip-collection#comment-form" title="Share your thoughts and opinions." hreflang="und">Add new comment</a></li></ul><section> <a id="comment-68"></a> <article data-comment-user-id="0" class="js-comment comment"> <mark class="hidden" data-comment-timestamp="1356452443"></mark> <footer class="attribution"> <article typeof="schema:Person" about="/user/0"> <div class="field field--name-user-picture field--type-image field--label-hidden field__item"> <img src="/sites/default/files/styles/thumbnail/public/default_images/default-user-image.png?itok=hWWOuuKw" width="100" height="100" alt="Profile picture for user Johnebyne" title="Anonymous user" typeof="foaf:Image" /> </div> </article> <div class="comment-submitted"> <p class="commenter-name"> <a rel="nofollow" href="http://wtflolomgbbq.com" lang="" typeof="schema:Person" property="schema:name" datatype="">Lee Lorenz</a> </p> <p class="comment-time"> Tue, 12/25/2012 - 16:20 </p> </div> </footer> <div class="comment-text"> <div class="comment-arrow"></div> <h3><a href="/comment/68#comment-68" class="permalink" rel="bookmark" hreflang="en">Enhancements</a></h3> <div class="content"> <div class="field field--name-comment-body field--type-text-long field--label-hidden field__item"><div class="tex2jax_process"><p>I've released the game for the Android platform with some key enhancements... including stopping and starting (some critters get nervous while sitting there, too)</p> <p>If you've updated your Touchpad to CyanogenMod Android, you might want to check it out. I'd like to give out copies, but Google isn't very well suited for promotion, so they haven;t given us any tools to give out redeem codes or anything.</p> <p>I have also added more toys and floors.</p> <p>Thanks for the feedback, if you do have the opportunity to try out the Android version, please feel free to give me any other suggestions. The Android (and soon, iOS) version is much easier to maintain and update.</p> </div></div> <drupal-render-placeholder callback="comment.lazy_builders:renderLinks" arguments="0=68&amp;1=default&amp;2=en&amp;3=" token="EZBb8pDPktd4uDbY4LlN16FcjZREYzrwLhCUnR4ntfo"></drupal-render-placeholder> </div> </div> </article> <h2>Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=144&amp;2=comment_node_blog&amp;3=comment_node_blog" token="jmCVdJQXPcHJ0UUPkPmd7TWZnoT2JMqHTExJVNgx1E8"></drupal-render-placeholder> </section> <strong class="node_view"></strong> Sun, 06 Nov 2011 19:46:34 +0000 yunyao 144 at https://yyhh.org NetFlix Is Splitting Into Two!? https://yyhh.org/blog/2011/09/netflix-splitting-two <span>NetFlix Is Splitting Into Two!?</span> <span><a title="View user profile." href="/user/yunyao" lang="" about="/user/yunyao" typeof="schema:Person" property="schema:name" datatype="">yunyao</a></span> <span>Tue, 09/20/2011 - 00:20</span> <div class="field field--name-field-opinion field--type-entity-reference field--label-hidden field__items"> <div class="field__item"><div about="/opinion/technology" id="taxonomy-term-22" class="taxonomy-term vocabulary-opinion"> <a href="/opinion/technology"> <div class="field field--name-name field--type-string field--label-hidden field__item">Technology</div> </a> <div class="content"> </div> </div> </div> </div> <div class="field field--name-body field--type-text-with-summary field--label-hidden field__item"><div class="tex2jax_process"><p><P>It has turned out that Netflix has abandoned the plan, finally.</P><br /> <P>-------------------------------------------------------------------------------------------</P><br /> <P>When Huahai told me the news late last night that NetFlix is splitting into two, my first reaction was that he must be reading from Onion! After all, based all what have learned from the business school classes and information economics classes, it makes perfect sense to provide bundled services, especially when it comes to information product.</P><br /> <P>However, the news is definitely true, as further confirmed by the following letter that I received this morning.</P><br /> <P><IMG alt="netflix letter" src="http://farm7.static.flickr.com/6166/6163911899_2c0010dbc8_b.jpg" width=484 height=755></P><br /> <P>I don't know about you. But like many other loyal NetFlix subscribers, I love the convenience of their streaming service and almost use it exclusively even when I have bundled unlimited DVD service. In fact, I don't even watch cabled TV anymore except for the morning news. However, when I was informed that I have to pay 60% to get both services, I dumped the DVD service without hesitation. After all, I was only watching at most one DVD per week. However, this price hack does have hurt my feeling --- it seems that they don't care about their customizes anymore when they now dominate the market.</P><br /> <P>Nevertheless, the above news has shocked me. Frankly, I don't think that this move makes much sense --- why lose the establish name and give away the convenience to the customizes to be able to combine both services and maintain one single account? It also goes again the economic of scale. It all seems to me to be a very costly move.</P><br /> <P>However, I am very excited at the news. It looks like a big move that will be written into business school text books in the near future. I am really looking forward to seeing the outcome a couple of years from now on.</P><br /> <P>More on the move can be found on their <A href="http://blog.netflix.com/2011/09/explanation-and-some-reflections.html?lnktrk=EMP&amp;g=935BBD64D88F21C24044EB3702C7EF2A0AC0315E&amp;lkid=netflixBlog">blog</A>.</P></p> </div></div> <section> <h2>Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=140&amp;2=comment_node_blog&amp;3=comment_node_blog" token="h4RJAtMH1oKJydDuZvPazD11QWXj7-SX5laU3zQ6Q6s"></drupal-render-placeholder> </section> <strong class="node_view"></strong> Mon, 19 Sep 2011 23:20:12 +0000 yunyao 140 at https://yyhh.org 中国的技术引爆文艺复兴? https://yyhh.org/blog/2011/02/%E4%B8%AD%E5%9B%BD%E7%9A%84%E6%8A%80%E6%9C%AF%E5%BC%95%E7%88%86%E6%96%87%E8%89%BA%E5%A4%8D%E5%85%B4%EF%BC%9F <span>中国的技术引爆文艺复兴?</span> <span><a title="View user profile." href="/user/huahai" lang="" about="/user/huahai" typeof="schema:Person" property="schema:name" datatype="">Huahai</a></span> <span>Wed, 02/02/2011 - 06:33</span> <div class="field field--name-field-opinion field--type-entity-reference field--label-hidden field__items"> <div class="field__item"><div about="/opinion/technology" id="taxonomy-term-22" class="taxonomy-term vocabulary-opinion"> <a href="/opinion/technology"> <div class="field field--name-name field--type-string field--label-hidden field__item">Technology</div> </a> <div class="content"> </div> </div> </div> <div class="field__item"><div about="/opinion/science" id="taxonomy-term-23" class="taxonomy-term vocabulary-opinion"> <a href="/opinion/science"> <div class="field field--name-name field--type-string field--label-hidden field__item">Science</div> </a> <div class="content"> </div> </div> </div> <div class="field__item"><div about="/opinion/china" id="taxonomy-term-27" class="taxonomy-term vocabulary-opinion"> <a href="/opinion/china"> <div class="field field--name-name field--type-string field--label-hidden field__item">China</div> </a> <div class="content"> </div> </div> </div> </div> <div class="field field--name-body field--type-text-with-summary field--label-hidden field__item"><div class="tex2jax_process"><p>《1434》是一个英国退役的潜艇舰长Gavin Menzies写的书,是他的《1421》的后续。《1421》主要是说是中国<br /> 人,具体的说,就是郑和舰队的一支,发现了美洲。自然,有很多人质疑。其中一个观点就是如果中国人发现了美洲,咋没到更近的欧洲?《1434》就主要讲郑和的舰队的一支,在最后一次出航的时候的确到了意大利,并且带去了技术引爆了文艺复兴。 这本书也花很大篇幅介绍了中国舰队使用的星相航行技术的细节,弥补了上一本书的一些缺陷。</p> <p>这本书的前两页我翻译了一下:</p> <p>-------------------------<br /> 我(Gaviin Menzies)在写《1421》的时候,有一件事让我百思不得其解,这就是为什么很多职业历史学家如此缺乏好奇心。毕竟,哥伦布被认为是在1492年发现了美洲,但在他出航的18年前,他就已经有了一份美洲地图,并在他后来的航行日志中承认了。事实上,在他第一次出发前,哥伦布与西班牙国王和王后就签了合同,聘他为美洲总督。在1492与他同行的一个船的船长,Martin Alonso Pinzon,也在教皇的藏书室里见过一份美洲地图。你如何可以发现一个你已经有了地图的地方?</p> <p>同样的问题可以问麦哲伦,连接大西洋和太平洋的海峡被以他这个伟大的葡萄牙探险家来命名。当他在1520年到达那个海峡的时候,他已经断粮了,他的船员们在吃老鼠活命,更糟的是,他们都认为他迷航了。Esteban Gomez领导了哗变,控制了San Antonio号,打算把部分探险队带回西班牙。麦哲仑坚持他没有迷航,这才镇压了哗变。一个船员写道:“我们都觉得这是个死胡同,但船长知道他需要穿过一个隐蔽得很好的海峡,因为他在存于葡萄牙国王的宝藏里的一张海图里见过,这图是Marin of Bohemia制作的,是个很有信誉的人。“</p> <p>为何这个在麦哲仑出发前就在海图上见过的海峡被以他命名? 这不可理喻。如果这个海峡或者是太平洋的海图并不存在,或者像有些人说的麦哲仑在虚张声势的话,那这个悖论也许很好解释。但这些图的确是存在的。Marin Waldseemuller在1507年发表了他的美洲和太平洋地图,比麦哲仑启航早12年。在他启航前四年,在1515,JohnnesSchoner发表了一张地图,上面就有被认为是麦哲仑发现的海峡。</p> <p>如果我们考虑这两个制图员,Waldseemuller和Schoner,事情就更奇怪了。这两人是比麦哲仑更早横跨太平洋的勇敢的航海家么?我们是不是应该给海峡以Schoner命名?不需要。Schoner从来就没到过海上。他在Erfurt大学没考好,没拿学位就走人了,在1515年成了个牧师学徒,但也没搞好,被发配到一个小村落主持早祷告。那么,一个没<br /> 有航海传统的德国乡下的一个年轻人怎么会在麦哲仑发现太平洋以前制作出它的地图来呢?</p> <p>和Schoner一样,Waldseemuller也没见过大海。在1475年出生于Freiberg附近的Wlfenweiler,此人在法国东部的Sant-Die当教士度过一生,那个地区以出李子闻名,没有任何航海传统。他也是没在大学拿到学位的。他的美洲地图显示了墨西哥的Sierra Madre和北美的Siera Nevada,这是在麦哲仑到达太平洋或者Balboa到达太平洋海岸之前。</p> <p>这两个制图者并不是唯一的对没见过的土地有很深认识的欧洲人。在1419,在欧洲大航海开始以前,Albertin di Virga发表了一个东半球的地图,其中显示了澳洲北部。要在350年之后,库克船长才会“发现”那片大陆。类似的,在第一批葡萄牙人,Cabral和Dia,启航去找巴西的时候,巴西就已经出现在葡萄牙的地图上。在欧洲人到南极洲的400多年前,South Shetlan岛就已经出现在Piri Reis地图上了。</p> <p>伟大的欧洲的探险家们是些勇敢和坚定的人,但他们没发现任何东西。麦哲仑不是第一个环游地球的人,哥仑布也不是第一个发现美洲的人。那么,我们就要问了,为何历史学家还要坚持散布这样的幻想?为何讲述欧探险家发现的The Times Atlas of World Exploration,还在学校里教授?为什么要坚持误导小朋友们?</p> <p>---------------------</p> <p>地图是引子,这本书主要是讲技术。比如说达芬奇的所谓”发明“几乎都是中国的书上已有的,还有日历,观天象,航海的方法等等,欧洲在15世纪突然就都用上了和中国一样的技术。从科学技术发展积累的角度来说, 我个人觉得“山寨中国说”比较靠谱,另外就是根据有关人员的作案动机和心理,和事件本身以及后来发生的事都很一致。</p> <p>在15世纪,中国人一次性(也可以是很少的几次)海量并且直接地传播技术到意大利,这一件事如果是真的,中国人这么干的动机是什么? 这个对于熟悉中国历史的人来说,很好解释。在1434的书中也明确说了,宣德皇帝要让天下的人都知道中土现在一切恢复正常,一片大好,现在要宣示大德,大家都要来臣服进贡(年号宣德可能就有这个意思),这个信息再远的地方的人都要送到。那人家不知道怎么来这么办?我们管教航海技术啊。为了显示中土的高明,得带高明的技术去啊?不光要带去,还得教会人家,让他们领受现代文明,大德嘛。呵呵。这个对现代人来说比较傻,但当时是make perfect sense的。后来自己家出了问题,这种面子光没实利的事自然就不作了。</p> <p>当时欧洲人也不是傻子,和穆斯林打的过程中也领教了一些现代文明的厉害。而且穆斯林自然要对欧洲人搞技术封锁。好了,现在天上掉馅饼,高等文明(马可波罗已经事先给高等文明作了广告了)直接派人来教了,可不得派最聪敏的人去可劲学么。更奇了,高等文明来了一次就再也不来了,这几个得了真传的人可不得说这都是偶们自己琢磨出<br /> 来的么?就是他们自己脸皮薄不肯自己take credit,也会“被take”的,这样大家都顺便沾光啊。这很符合西方文化的自大心态。这同时解释了即使是真相出来,西方人也打死不承认的现象。</p> <p>解释这个15世纪意大利技术井喷现象,也就这个“山寨中国说”比较考谱。其他的“天才说”及其搞笑版本也就是”穿越说”显然是不靠谱的。“希腊说”解释不了井喷现象,因为在黑暗的中世纪,教士们一直就在研究希腊书,研究了上千年了,并不是突然发现了很多希腊书。如果说是研究着突然开悟了,其实这又回到了“天才說”,而且这些“天才们”都不是研究希腊书的,反而是些工匠技术人员,要派人去学高等技术,不派这些人派谁呢?</p> <p>达芬奇是个很好的描图员,他作的插图比原图更好,更精细。但插图毕竟是插图,credit还是要给想出idea的人的。达芬奇其实已经是第n手的copy了,n&gt;=3。作者顺藤摸瓜, 发现copy的一个可能的具体路线是:<br /> 《农书》,《武经总要》--&gt; Taccola --&gt; di Giorgio --&gt; Da Vinci. 这三个意大利工匠都没有给自己的source应有的credit,大概当时没有citation的概念吧。有的东西,比如一种泵,他们自己还没有整明白到底是怎么work的,按他们画的不可能work。 这个比较搞。</p> <p>知识产权法律的出现,也和"山寨说"是一致的。原来欧洲是没有知识产权的法律的。在大量抄袭中国的技术投入生产获利后,很快就产生了这个法律。为什么?从心理的角度很容易理解,因为他们发现了抄袭技术是多么容易,利润是多么的巨大,很怕别人也照此办理,所以当时意大利的统治者们就搞出了历史上最早的一部专利法律,时间是在1474年。</p> </div></div> <section> <h2>Add new comment</h2> <drupal-render-placeholder callback="comment.lazy_builders:renderForm" arguments="0=node&amp;1=110&amp;2=comment_node_blog&amp;3=comment_node_blog" token="sDiGecPirEGB65FejgytCl8GgCxJ2xop9mRCygyoXXM"></drupal-render-placeholder> </section> <strong class="node_view"></strong> Wed, 02 Feb 2011 06:33:10 +0000 Huahai 110 at https://yyhh.org