﻿<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:series="http://unfoldingneurons.com/"
	>

<channel>
	<title>f(Program,Poet)=Programet &#187; 彩蛋</title>
	<atom:link href="http://blog.programet.org/tag/%e5%bd%a9%e8%9b%8b/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.programet.org</link>
	<description>f(诗,程序)=诗序=思绪 &#124; 记载我们自己的生活</description>
	<lastBuildDate>Tue, 07 Feb 2012 16:00:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>问问matlab:WHY?</title>
		<link>http://blog.programet.org/2009/05/matlabwhy.html</link>
		<comments>http://blog.programet.org/2009/05/matlabwhy.html#comments</comments>
		<pubDate>Fri, 01 May 2009 21:34:00 +0000</pubDate>
		<dc:creator>严酷的魔王</dc:creator>
				<category><![CDATA[原创博文]]></category>
		<category><![CDATA[恶搞]]></category>
		<category><![CDATA[程序]]></category>
		<category><![CDATA[计算机]]></category>
		<category><![CDATA[非严肃]]></category>
		<category><![CDATA[matlab]]></category>
		<category><![CDATA[人工智能]]></category>
		<category><![CDATA[彩蛋]]></category>

		<guid isPermaLink="false">http://test.programet.cn/2009/05/%e9%97%ae%e9%97%aematlabwhy.html</guid>
		<description><![CDATA[这个惊爆的matlab后门转自豆瓣。有点长，我就只是做了部分的摘录，原文请到来源或者讨论组内参观。！在来源处的下方还有一个matlab 的 “why函数” 的代码——看那像模像样的注释，可能是源码。 &#62;&#62; 1+1 ans = 2 &#62;&#62; why Pete wanted it that way. &#62;&#62; why I told me to. &#62;&#62; why A young kid told me to. &#62;&#62; why Bill insisted on it. &#62;&#62; why For the love of Jack. &#62;&#62; why The computer did it. &#62;&#62; why Some not very bald [...]
相关文章：<ol>
<li><a href='http://blog.programet.org/2009/04/zeta.html' rel='bookmark' title='黎曼假设之歌：Zeta函数的零点在哪里？'>黎曼假设之歌：Zeta函数的零点在哪里？</a></li>
<li><a href='http://blog.programet.org/2009/08/noip%e4%bd%bf%e7%94%a8%e7%ae%97%e6%b3%95-7-%e5%88%86%e6%b2%bb.html' rel='bookmark' title='NOIP实用算法 7.分治'>NOIP实用算法 7.分治</a></li>
<li><a href='http://blog.programet.org/2011/04/keep-blanks.html' rel='bookmark' title='让WordPress保留段首空格的插件'>让WordPress保留段首空格的插件</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>这个惊爆的matlab后门转自<a href="http://www.douban.com/group/topic/6238938/">豆瓣</a>。有点长，我就只是做了部分的摘录，原文请到来源或者<a href="http://groups.google.com/group/programet?hl=en">讨论组</a>内参观。！在来源处的下方还有一个matlab 的 “why函数” 的代码——看那像模像样的注释，可能是源码。</p>
<p><span id="more-9"></span></p>
<p>&gt;&gt; 1+1<br />
ans =<br />
2<br />
&gt;&gt; why<br />
Pete wanted it that way.<br />
&gt;&gt; why<br />
I told me to.<br />
&gt;&gt; why<br />
A young kid told me to.<br />
&gt;&gt; why<br />
Bill insisted on it.<br />
&gt;&gt; why<br />
For the love of Jack.<br />
&gt;&gt; why<br />
The computer did it.<br />
&gt;&gt; why<br />
Some not very bald very rich system manager wanted it.<br />
&gt;&gt; why<br />
You told the rich system manager.<br />
&gt;&gt; why<br />
Some not excessively rich young and smart hamster obeyed some rich and not very good and good and bald kid.<br />
&gt;&gt; why<br />
Cleve suggested it.<br />
&gt;&gt; why<br />
The engineer told me to.<br />
&gt;&gt; why<br />
I helped all.<br />
&gt;&gt; why<br />
Cleve wanted it.<br />
&gt;&gt; why<br />
Why not?<br />
&gt;&gt; why<br />
To fool some smart and young mathematician.<br />
&gt;&gt; why<br />
A smart and very bald and very terrified bald mathematician obeyed a programmer.<br />
&gt;&gt; why<br />
You helped some mathematician.<br />
&gt;&gt; why<br />
I knew it was a good idea.<br />
&gt;&gt; why<br />
A good and smart and not very rich and rich and young and not very young and bald and not excessively rich and tall and tall and not excessively tall and smart and rich and smart and not excessively terrified and rich and good and not very bald and not very terrified very smart not very rich system manager told me to.<br />
&gt;&gt; why<br />
The bald and tall and young and good and smart and terrified and not very tall and young and bald and not very good and good and rich and not very bald and bald system manager told me to.<br />
&gt;&gt; why<br />
Bill suggested it.<br />
&gt;&gt; why<br />
Pete told me to.<br />
&gt;&gt; why<br />
Some young smart tall system manager insisted on it.<br />
&gt;&gt; why<br />
The not very good and terrified and young and smart and smart and young and not excessively good rich hamster suggested it.<br />
&gt;&gt; why<br />
A smart programmer told me to.<br />
&gt;&gt; why<br />
The customer is always right.<br />
&gt;&gt; why<br />
You insisted on it.<br />
&gt;&gt; why<br />
A system manager obeyed the not very tall mathematician.<br />
&gt;&gt; why<br />
Pete obeyed a engineer.<br />
&gt;&gt; why<br />
They threatened a programmer.<br />
&gt;&gt; why<br />
Joe obeyed a tall mathematician.<br />
&gt;&gt; why<br />
Because the terrified and terrified and rich and rich and smart and very young and good and tall and bald and rich and bald and bald and rich and not very good and very terrified and very tall hamster wanted it.</p>
<p><span style="font-weight: bold;">下面是给出的源码，一个简单的教matlab说话的东西：</span><br />
function why(n)<br />
%WHY    Provides succinct answers to almost any question.<br />
%   WHY, by itself, provides a random answer.<br />
%   WHY(N) provides the N-th answer.<br />
%   Please embellish or modify this function to suit your own tastes.</p>
<p>%   Copyright 1984-2002 The MathWorks, Inc.<br />
%   $Revision: 5.15 $  $Date: 2002/06/17 13:20:59 $</p>
<p>if nargin &gt; 0, rand(&#8216;state&#8217;,n); end<br />
switch fix(10*rand)<br />
case 0,        a = special_case;<br />
case {1 2 3},  a = phrase;<br />
otherwise,     a = sentence;<br />
end<br />
a(1) = upper(a(1));<br />
disp(a);</p>
<p>%&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>function a = special_case<br />
switch fix(12*rand)<br />
case 0,   a = &#8216;why not?&#8217;;<br />
case 1,   a = &#8216;don&#8221;t ask!&#8217;;<br />
case 2,   a = &#8216;it&#8221;s your karma.&#8217;;<br />
case 3,   a = &#8216;stupid question!&#8217;;<br />
case 4,   a = &#8216;how should I know?&#8217;;<br />
case 5,   a = &#8216;can you rephrase that?&#8217;;<br />
case 6,   a = &#8216;it should be obvious.&#8217;;<br />
case 7,   a = &#8216;the devil made me do it.&#8217;;<br />
case 8,   a = &#8216;the computer did it.&#8217;;<br />
case 9,   a = &#8216;the customer is always right.&#8217;;<br />
case 10,  a = &#8216;in the beginning, God created the heavens and the earth&#8230;&#8217;;<br />
otherwise,a = &#8216;don&#8221;t you have something better to do?&#8217;;<br />
end</p>
<p>function a = phrase<br />
switch fix(3*rand)<br />
case 0,    a = ['for the ' nouned_verb ' ' prepositional_phrase '.'];<br />
case 1,    a = ['to ' present_verb ' ' object '.'];<br />
otherwise, a = ['because ' sentence];<br />
end</p>
<p>function a = preposition<br />
switch fix(2*rand)<br />
case 0,    a = &#8216;of&#8217;;<br />
otherwise, a = &#8216;from&#8217;;<br />
end</p>
<p>function a = prepositional_phrase<br />
switch fix(3*rand)<br />
case 0,    a = [preposition ' ' article ' ' noun_phrase];<br />
case 1,    a = [preposition ' ' proper_noun];<br />
otherwise, a = [preposition ' ' accusative_pronoun];<br />
end</p>
<p>function a = sentence<br />
switch fix(0)<br />
case 0,    a = [subject ' ' predicate '.'];<br />
end</p>
<p>function a = subject<br />
switch fix(4*rand)<br />
case 0,    a = proper_noun;<br />
case 1,    a = nominative_pronoun;<br />
otherwise, a = [article ' ' noun_phrase];<br />
end</p>
<p>function a = proper_noun<br />
switch fix(8*rand)<br />
case 0,    a = &#8216;Cleve&#8217;;<br />
case 1,    a = &#8216;Jack&#8217;;<br />
case 2,    a = &#8216;Bill&#8217;;<br />
case 3,    a = &#8216;Joe&#8217;;<br />
case 4,    a = &#8216;Pete&#8217;;<br />
case 5,    a = &#8216;Loren&#8217;;<br />
case 6,    a = &#8216;Damian&#8217;;<br />
case 7,    a = &#8216;Barney&#8217;;<br />
end</p>
<p>function a = noun_phrase<br />
switch fix(4*rand)<br />
case 0,    a = noun;<br />
case 1,    a = [adjective_phrase ' ' noun_phrase];<br />
otherwise, a = [adjective_phrase ' ' noun];<br />
end</p>
<p>function a = noun<br />
switch fix(6*rand)<br />
case 0,    a = &#8216;mathematician&#8217;;<br />
case 1,    a = &#8216;programmer&#8217;;<br />
case 2,    a = &#8216;system manager&#8217;;<br />
case 3,    a = &#8216;engineer&#8217;;<br />
case 4,    a = &#8216;hamster&#8217;;<br />
case 5,    a = &#8216;kid&#8217;;<br />
end</p>
<p>function a = nominative_pronoun<br />
switch fix(5*rand)<br />
case 0,    a = &#8216;I&#8217;;<br />
case 1,    a = &#8216;you&#8217;;<br />
case 2,    a = &#8216;he&#8217;;<br />
case 3,    a = &#8216;she&#8217;;<br />
case 4,    a = &#8216;they&#8217;;<br />
end</p>
<p>function a = accusative_pronoun<br />
switch fix(4*rand)<br />
case 0,    a = &#8216;me&#8217;;<br />
case 1,    a = &#8216;all&#8217;;<br />
case 2,    a = &#8216;her&#8217;;<br />
case 3,    a = &#8216;him&#8217;;<br />
end</p>
<p>function a = nouned_verb<br />
switch fix(2*rand)<br />
case 0,    a = &#8216;love&#8217;;<br />
case 1,    a = &#8216;approval&#8217;;<br />
end</p>
<p>function a = adjective_phrase<br />
switch fix(6*rand)<br />
case {0 1 2},a = adjective;<br />
case {3 4},  a = [adjective_phrase ' and ' adjective_phrase];<br />
otherwise,   a = [adverb ' ' adjective];<br />
end</p>
<p>function a = adverb<br />
switch fix(3*rand)<br />
case 0,    a = &#8216;very&#8217;;<br />
case 1,    a = &#8216;not very&#8217;;<br />
otherwise, a = &#8216;not excessively&#8217;;<br />
end</p>
<p>function a = adjective<br />
switch fix(7*rand)<br />
case 0,    a = &#8216;tall&#8217;;<br />
case 1,    a = &#8216;bald&#8217;;<br />
case 2,    a = &#8216;young&#8217;;<br />
case 3,    a = &#8216;smart&#8217;;<br />
case 4,    a = &#8216;rich&#8217;;<br />
case 5,    a = &#8216;terrified&#8217;;<br />
otherwise, a = &#8216;good&#8217;;<br />
end</p>
<p>function a = article<br />
switch fix(3*rand)<br />
case 0,    a = &#8216;the&#8217;;<br />
case 1,    a = &#8216;some&#8217;;<br />
otherwise, a = &#8216;a&#8217;;<br />
end</p>
<p>function a = predicate<br />
switch fix(3*rand)<br />
case 0,    a = [transitive_verb ' ' object];<br />
otherwise, a = intransitive_verb;<br />
end</p>
<p>function a = present_verb<br />
switch fix(3*rand)<br />
case 0,    a = &#8216;fool&#8217;;<br />
case 1,    a = &#8216;please&#8217;;<br />
otherwise, a = &#8216;satisfy&#8217;;<br />
end</p>
<p>function a = transitive_verb<br />
switch fix(10*rand)<br />
case 0,    a = &#8216;threatened&#8217;;<br />
case 1,    a = &#8216;told&#8217;;<br />
case 2,    a = &#8216;asked&#8217;;<br />
case 3,    a = &#8216;helped&#8217;;<br />
otherwise, a = &#8216;obeyed&#8217;;<br />
end</p>
<p>function a = intransitive_verb<br />
switch fix(6*rand)<br />
case 0,    a = &#8216;insisted on it&#8217;;<br />
case 1,    a = &#8216;suggested it&#8217;;<br />
case 2,    a = &#8216;told me to&#8217;;<br />
case 3,    a = &#8216;wanted it&#8217;;<br />
case 4,    a = &#8216;knew it was a good idea&#8217;;<br />
otherwise, a = &#8216;wanted it that way&#8217;;<br />
end</p>
<p>function a = object<br />
switch fix(10*rand)<br />
case 0,    a = accusative_pronoun;<br />
otherwise, a = [article ' ' noun_phrase];<br />
end</p>
<p><small>本文由 严酷的魔王 创作，转载或引用前请<a href="mailto:programet.org@gmail.com">联系我们</a>。</small></p><p>相关文章：<ol>
<li><a href='http://blog.programet.org/2009/04/zeta.html' rel='bookmark' title='黎曼假设之歌：Zeta函数的零点在哪里？'>黎曼假设之歌：Zeta函数的零点在哪里？</a></li>
<li><a href='http://blog.programet.org/2009/08/noip%e4%bd%bf%e7%94%a8%e7%ae%97%e6%b3%95-7-%e5%88%86%e6%b2%bb.html' rel='bookmark' title='NOIP实用算法 7.分治'>NOIP实用算法 7.分治</a></li>
<li><a href='http://blog.programet.org/2011/04/keep-blanks.html' rel='bookmark' title='让WordPress保留段首空格的插件'>让WordPress保留段首空格的插件</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.programet.org/2009/05/matlabwhy.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

