<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;DU8CQ3Y_eyp7ImA9WhRVEUs.&quot;"><id>tag:blogger.com,1999:blog-208437074950033830</id><updated>2012-01-09T22:57:42.843-05:00</updated><category term="Science Fiction" /><category term="Mathematica Cookbook" /><category term="Computer Science" /><category term="Linguistics" /><category term="Linear Algebra" /><category term="robotics" /><category term="Simulation" /><category term="God" /><category term="C" /><category term="Physics" /><category term="consciousness" /><category term="programming" /><category term="Jon Harrop" /><category term="Semantic Web" /><category term="F#" /><category term="philosophy" /><category term="sylogism" /><category term="Lisp" /><category term="Fuzzy" /><category term="fine-tuning" /><category term="Mathematica" /><category term="software development" /><category term="thermodynamics" /><category term="C++" /><category term="Canvas" /><category term="Object-Orieted" /><category term="Atheism" /><category term="Mathematics" /><category term="intelligence" /><category term="Agile" /><category term="Evolution" /><category term="AI" /><category term="functional programming" /><category term="Troll" /><category term="Rule-Based" /><category term="Principle" /><category term="WISDI" /><category term="JavaScript" /><category term="Victor J. Stenger" /><category term="Education" /><category term="amazon.co.uk" /><category term="whining" /><category term="HTML5" /><category term="science" /><category term=".NET" /><category term="humor" /><category term="Erlang" /><title>Cogitatio</title><subtitle type="html">Unpolished musings about consciousness, thought, information processing and computation.</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://semanticvector.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://semanticvector.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Sal Mangano</name><uri>http://www.blogger.com/profile/15017568083854549991</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://2.bp.blogspot.com/_hjRAumdIEoA/SLSwdjKB47I/AAAAAAAAACU/k8AdMap_Mns/S220/headshot.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>99</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/Cogitatio" /><feedburner:info uri="cogitatio" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;DU8CQ3Y-eCp7ImA9WhRVEUs.&quot;"><id>tag:blogger.com,1999:blog-208437074950033830.post-2719144582313040978</id><published>2012-01-09T22:54:00.003-05:00</published><updated>2012-01-09T22:57:42.850-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-09T22:57:42.850-05:00</app:edited><title>MathematicaCookbook.com</title><content type="html">My new blog related to work on Mathematica is finally up at &lt;a href="http://mathematicacookbook.com/"&gt;mathematicacookbook.com &lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href="http://semanticvector.blogspot.com/feeds/posts/default?alt=rss"&gt;RSS&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/208437074950033830-2719144582313040978?l=semanticvector.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Cogitatio/~4/eN8qd1z_6ek" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://semanticvector.blogspot.com/feeds/2719144582313040978/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=208437074950033830&amp;postID=2719144582313040978" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/2719144582313040978?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/2719144582313040978?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Cogitatio/~3/eN8qd1z_6ek/mathematicacookbookcom.html" title="MathematicaCookbook.com" /><author><name>Sal Mangano</name><uri>http://www.blogger.com/profile/15017568083854549991</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://2.bp.blogspot.com/_hjRAumdIEoA/SLSwdjKB47I/AAAAAAAAACU/k8AdMap_Mns/S220/headshot.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://semanticvector.blogspot.com/2012/01/mathematicacookbookcom.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0UGR3s_fSp7ImA9WhdXEkk.&quot;"><id>tag:blogger.com,1999:blog-208437074950033830.post-54982944119307333</id><published>2011-08-24T21:34:00.003-05:00</published><updated>2011-08-24T22:00:26.545-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-24T22:00:26.545-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="fine-tuning" /><category scheme="http://www.blogger.com/atom/ns#" term="Victor J. Stenger" /><category scheme="http://www.blogger.com/atom/ns#" term="sylogism" /><category scheme="http://www.blogger.com/atom/ns#" term="Atheism" /><category scheme="http://www.blogger.com/atom/ns#" term="God" /><category scheme="http://www.blogger.com/atom/ns#" term="Principle" /><category scheme="http://www.blogger.com/atom/ns#" term="Physics" /><title>The Creators</title><content type="html">Consider the following syllogism:
&lt;br /&gt;
&lt;br /&gt;Everything that exists has a creator.
&lt;br /&gt;God exists.
&lt;br /&gt;Therefore God has a creator.
&lt;br /&gt;
&lt;br /&gt;Now, this is clearly valid from a purely deductive point of view. But deduction is nothing more than the mechanical rearrangement of symbols, hence it prove nothing about the true state of affairs in our universe until one considers the premises.
&lt;br /&gt;
&lt;br /&gt;First consider "Everything that exists has a creator". If you accept this as a universal truth than we can move on. If you don't then you can entertain the thought that somethings exist and have no creator. Let's revisit the idea a bit later.
&lt;br /&gt;
&lt;br /&gt;No consider the premise "God exists". If you are a believer than you hold this premis as true, by definition.  But, if you also hold the first premise true, then you are logically bound to admit God was created by some prior God and so on ad infinitum. But clearly, this is not in line with the teachings of any mainstream religion. So as, say a Christian,  you are forced to deny that everything that exists has a creator. Indeed, Christians would argue that everything that exists has a creator EXCEPT God.
&lt;br /&gt;
&lt;br /&gt;So the rather than presupposing that "the universe always existed" or "some universe always existed", Christians belive in an all powerful, all knowing entity that exists and has no creator. I find that incredulous and any reasonable person should as well.
&lt;br /&gt;
&lt;br /&gt;Personally, it seems obvious that both premises above are false. There are many things that exist and have no creator (but God is not one of them).
&lt;br /&gt;
&lt;br /&gt;All this aside, if you are mathematically literate, enjoy physics and worry about matters of what can exist without having a creator I highly recommend &lt;a href="http://www.amazon.com/Fallacy-Fine-Tuning-Why-Universe-Designed/dp/1616144432/ref=sr_1_1?ie=UTF8&amp;amp;qid=1314240705&amp;amp;sr=8-1"&gt;The Fallacy of Fine-Tuning: Why the Universe Is Not Designed for Us&lt;/a&gt; by &lt;a href="http://www.amazon.com/Victor-J.-Stenger/e/B000APH2GA/ref=ntt_athr_dp_pel_pop_1"&gt;Victor J. Stenger&lt;/a&gt;.
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href="http://semanticvector.blogspot.com/feeds/posts/default?alt=rss"&gt;RSS&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/208437074950033830-54982944119307333?l=semanticvector.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Cogitatio/~4/ynfxaqia-LI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://semanticvector.blogspot.com/feeds/54982944119307333/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=208437074950033830&amp;postID=54982944119307333" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/54982944119307333?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/54982944119307333?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Cogitatio/~3/ynfxaqia-LI/creators.html" title="The Creators" /><author><name>Sal Mangano</name><uri>http://www.blogger.com/profile/15017568083854549991</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://2.bp.blogspot.com/_hjRAumdIEoA/SLSwdjKB47I/AAAAAAAAACU/k8AdMap_Mns/S220/headshot.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://semanticvector.blogspot.com/2011/08/creators.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkYBRns9cCp7ImA9WhdRFks.&quot;"><id>tag:blogger.com,1999:blog-208437074950033830.post-3150947260308083962</id><published>2011-08-06T12:19:00.007-05:00</published><updated>2011-08-06T14:49:17.568-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-08-06T14:49:17.568-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="JavaScript" /><category scheme="http://www.blogger.com/atom/ns#" term="HTML5" /><category scheme="http://www.blogger.com/atom/ns#" term="Canvas" /><title>Dashed Lines in HTML5 Canvas</title><content type="html">There is a lot of functionality missing from the Canvas API. One obvious facility is support for dashed lines.  Here is the start of some dashed line code I am working on as part of a larger project. It is not fully tested yet so &lt;i&gt;caveat emptor&lt;/i&gt;. I started with code I found &lt;a href="http://stackoverflow.com/questions/4576724/dotted-stroke-in-canvas"&gt;here&lt;/a&gt; and attempted to make it more efficient by taking most of the math out of the main loop.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;var initDashing = function(ctx) {&lt;br /&gt; if (!ctx.dashLine) {&lt;br /&gt;  ctx.dashStyle=[3,2] ;&lt;br /&gt;  ctx.dashedLine = function(x1,y1,x2,y2) {&lt;br /&gt;   var dashStyle = ctx.dashStyle,&lt;br /&gt;    dashCount = dashStyle.length,&lt;br /&gt;    sign = x2&amp;gt;=x1 ? 1 : -1,&lt;br /&gt;       dx = x2-x1,&lt;br /&gt;       dy = y2-y1,&lt;br /&gt;       m = dy/dx,&lt;br /&gt;       xsteps = dashStyle.map(function(len){return sign*Math.sqrt((len*len)/(1 + (m*m)));}),&lt;br /&gt;       dRem =  Math.sqrt( dx*dx + dy*dy ),&lt;br /&gt;       dIndex=0,&lt;br /&gt;       draw=true;&lt;br /&gt;   this.moveTo(x1,y1) ;&lt;br /&gt;   while (dRem&amp;gt;=0.1){&lt;br /&gt;         var dLen = dashStyle[dIndex],&lt;br /&gt;             xStep = xsteps[dIndex];&lt;br /&gt;         if (dLen &amp;gt; dRem) {&lt;br /&gt;          xStep =  Math.sqrt(dRem*dRem/(1+m*m));&lt;br /&gt;         }&lt;br /&gt;         x1 += xStep ;&lt;br /&gt;         y1 += m*xStep;&lt;br /&gt;         this[draw ? 'lineTo' : 'moveTo'](x1,y1);&lt;br /&gt;         dRem -= dLen;&lt;br /&gt;         draw = !draw;&lt;br /&gt;         dIndex = (dIndex+1) % dashCount ;&lt;br /&gt;   }&lt;br /&gt;  };&lt;br /&gt; };&lt;br /&gt;};&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Here are some examples of usage (here I am using the &lt;a href="http://pivotal.github.com/jasmine/"&gt;Jasmine&lt;/a&gt; unit testing framework)&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;describe("Dashing", function() {&lt;br /&gt; it("draws a 3-2 dashed line by default", function(){&lt;br /&gt;  var ctx = document.getElementById('test1').getContext("2d");&lt;br /&gt;  ctx.strokeStyle = "black" ;&lt;br /&gt;  initDashing(ctx) ;&lt;br /&gt;  ctx.beginPath() ;&lt;br /&gt;  ctx.dashedLine(0,0,100,100) ;&lt;br /&gt;  ctx.closePath();&lt;br /&gt;  ctx.stroke();&lt;br /&gt; });&lt;br /&gt; &lt;br /&gt; it("draws a 10-5 dashed line", function(){&lt;br /&gt;  var ctx = document.getElementById('test2').getContext("2d");&lt;br /&gt;  ctx.strokeStyle = "black" ;&lt;br /&gt;  initDashing(ctx) ;&lt;br /&gt;  ctx.dashStyle = [10,5] ;&lt;br /&gt;  ctx.beginPath() ;&lt;br /&gt;  ctx.dashedLine(0,0,100,100) ;&lt;br /&gt;  ctx.closePath();&lt;br /&gt;  ctx.stroke();&lt;br /&gt; });&lt;br /&gt; &lt;br /&gt; it("draws a 10-5-2-5 dashed line", function(){&lt;br /&gt;  var ctx = document.getElementById('test3').getContext("2d");&lt;br /&gt;  ctx.strokeStyle = "black" ;&lt;br /&gt;  initDashing(ctx) ;&lt;br /&gt;  ctx.dashStyle = [10,5,2,5] ;&lt;br /&gt;  ctx.beginPath() ;&lt;br /&gt;  ctx.dashedLine(0,0,100,100) ;&lt;br /&gt;  ctx.closePath();&lt;br /&gt;  ctx.stroke();&lt;br /&gt; });&lt;br /&gt; &lt;br /&gt; it("draws a 10-5-3-4 dashed line", function(){&lt;br /&gt;  var ctx = document.getElementById('test4').getContext("2d");&lt;br /&gt;  ctx.strokeStyle = "black" ;&lt;br /&gt;  initDashing(ctx) ;&lt;br /&gt;  ctx.dashStyle = [10,5,3,4] ;&lt;br /&gt;  ctx.beginPath() ;&lt;br /&gt;  ctx.dashedLine(100,13,0,80) ;&lt;br /&gt;  ctx.closePath();&lt;br /&gt;  ctx.stroke();&lt;br /&gt; });&lt;br /&gt;});&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/-MyxaMj4rzAs/Tj2QpzDIALI/AAAAAAAAAtc/u1nwa71Utpc/s1600/dashed.jpg"&gt;&lt;img src="http://3.bp.blogspot.com/-MyxaMj4rzAs/Tj2QpzDIALI/AAAAAAAAAtc/u1nwa71Utpc/s320/dashed.jpg" width="50%" height="50%" border="5" alt=""id="BLOGGER_PHOTO_ID_5637821356290080946" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt; &lt;br /&gt;I still have to implement a dashed version of arc, encapsulate better and test this code much more thoroughly. I'll upload to git hub when it is ready.&lt;div class="blogger-post-footer"&gt;&lt;a href="http://semanticvector.blogspot.com/feeds/posts/default?alt=rss"&gt;RSS&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/208437074950033830-3150947260308083962?l=semanticvector.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Cogitatio/~4/caUuheup3G8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://semanticvector.blogspot.com/feeds/3150947260308083962/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=208437074950033830&amp;postID=3150947260308083962" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/3150947260308083962?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/3150947260308083962?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Cogitatio/~3/caUuheup3G8/dashed-lines-in-html5-canvas.html" title="Dashed Lines in HTML5 Canvas" /><author><name>Sal Mangano</name><uri>http://www.blogger.com/profile/15017568083854549991</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://2.bp.blogspot.com/_hjRAumdIEoA/SLSwdjKB47I/AAAAAAAAACU/k8AdMap_Mns/S220/headshot.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/-MyxaMj4rzAs/Tj2QpzDIALI/AAAAAAAAAtc/u1nwa71Utpc/s72-c/dashed.jpg" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://semanticvector.blogspot.com/2011/08/dashed-lines-in-html5-canvas.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C08FRXw4cCp7ImA9WhZUE04.&quot;"><id>tag:blogger.com,1999:blog-208437074950033830.post-819585738663317364</id><published>2011-06-05T21:52:00.002-05:00</published><updated>2011-06-05T22:43:34.238-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-05T22:43:34.238-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="JavaScript" /><category scheme="http://www.blogger.com/atom/ns#" term="Lisp" /><category scheme="http://www.blogger.com/atom/ns#" term="programming" /><category scheme="http://www.blogger.com/atom/ns#" term="Computer Science" /><category scheme="http://www.blogger.com/atom/ns#" term="Mathematica" /><title>On the Goodness of Programming Languages</title><content type="html">Since my last post on C I have been thinking a lot about what makes a programming language good. This is also motivated by &lt;a href="http://semanticvector.blogspot.com/2011/05/end-to-end-javascript-with-node-and.html"&gt;my recent emersion into JavaScript&lt;/a&gt; that has me wondering how good of a language is JavaScript. I've had similar thoughts about C++, Java, Lisp and others in the past. &lt;div&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I think that the only sensible conclusion is there is no way to measure the goodness of a language in any objective way. I am certain that I can can come up with a metric that would declare C as the best language ever developed, and another that would make the winner Lisp, or Mathematica or JavaScript.  For example if, to simplify things a bit, I decide that the metric for a language's goodness is that:&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;It be functional (first class functions, closures, etc.)&lt;/li&gt;&lt;li&gt;It be ubiquitous (available on almost every computing device)&lt;/li&gt;&lt;/ol&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Then it is clear that JavaScript is the best language ever. I can also easily derive a metric that would declare &lt;a href="http://www.wolfram.com/mathematica/"&gt;Mathematica&lt;/a&gt; as the best language ever (and on some days I am convinced of the absolute truth of this!).&lt;/div&gt;&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div&gt;But the truth is that there can never be the best language ever. This is not because programming language technology is constantly (or at least in fits and starts) evolving. The reason there can never be a best programming language begins with the idea of &lt;a href="http://en.wikipedia.org/wiki/Turing_completeness"&gt;Turing Completeness&lt;/a&gt; but it does not end there. Any language worth learning is TC and by that metric is no better than any other. Yet, it is often argued that some languages are more expressive than others (e.g. &lt;a href="http://en.wikipedia.org/wiki/Lisp_(programming_language)"&gt;Lisp&lt;/a&gt; is more expressive than &lt;meta charset="utf-8"&gt;&lt;a href="http://en.wikipedia.org/wiki/Fortran"&gt;Fortran&lt;/a&gt;)  and therefore one can solve a wider class of problems faster in Lisp than &lt;meta charset="utf-8"&gt;Fortran. But that does not mean there are not valid metrics by which Fortran can be declared the world champion of programming languages. &lt;/div&gt;&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Humans spend a way too much time debating what the best is. What is the best car, best restaurant, best sport, best OS and best programming language? We do this because we want to be associated with the best. I drive an X, X is the best, therefore I have superior taste. For programming languages such arguments are silly not because we each have our own tastes. They are silly because if you are a programmer and don't sometimes see the superiority of Language A over Language B (and visa versa) then my guess is you are a rank amateur (or really boring person to sit next to at the office). So next time you find yourself in one of those "my language is better than yours" debates (and I've been there too) stop yourself, pick up &lt;a href="http://www.vim.org/"&gt;the best editor&lt;/a&gt; :-) and write some code instead!&lt;/div&gt;&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href="http://semanticvector.blogspot.com/feeds/posts/default?alt=rss"&gt;RSS&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/208437074950033830-819585738663317364?l=semanticvector.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Cogitatio/~4/zcrc9hqzJTQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://semanticvector.blogspot.com/feeds/819585738663317364/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=208437074950033830&amp;postID=819585738663317364" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/819585738663317364?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/819585738663317364?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Cogitatio/~3/zcrc9hqzJTQ/on-goodness-of-programming-languages.html" title="On the Goodness of Programming Languages" /><author><name>Sal Mangano</name><uri>http://www.blogger.com/profile/15017568083854549991</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://2.bp.blogspot.com/_hjRAumdIEoA/SLSwdjKB47I/AAAAAAAAACU/k8AdMap_Mns/S220/headshot.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://semanticvector.blogspot.com/2011/06/on-goodness-of-programming-languages.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0QESXoyfyp7ImA9WhZVEE8.&quot;"><id>tag:blogger.com,1999:blog-208437074950033830.post-5482640020528002923</id><published>2011-05-21T14:49:00.005-05:00</published><updated>2011-05-21T18:41:48.497-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-21T18:41:48.497-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="C" /><category scheme="http://www.blogger.com/atom/ns#" term="Object-Orieted" /><category scheme="http://www.blogger.com/atom/ns#" term="programming" /><category scheme="http://www.blogger.com/atom/ns#" term="C++" /><title>The Joy of C</title><content type="html">My latest assignment at work is to write a very fast message journal. Basically this is a way for writers  to stream &lt;a href="http://www.fixprotocol.org/"&gt;FIX&lt;/a&gt; messages (but could be anything) into a file while at the same time having one or more readers receive the messages.  There are numerous little details I am leaving out but they are not important to the point I wish to make.&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The programmers who wanted this journal  asked me to write it in C rather than C++. Although I usually prefer C++ there was no compelling reason that C++ was needed. To my surprise, I rather enjoyed writing it in straight C and in fact, I am pretty sure the end result is a lot less complex than it would have been in C++.&lt;/div&gt;&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Don't get me wrong. I am still a fan of OO but the attitude that anything OO is apriori better than pure procedural is a crock of poo. Programming in C forces you to be economical. There is no fancy data structures, templates or virtual functions. There is no &lt;a href="http://www.boost.org/"&gt;Boost&lt;/a&gt; or &lt;a href="http://en.wikipedia.org/wiki/Template_metaprogramming"&gt;meta-programming&lt;/a&gt;. You basically get arrays, macros and some straightforward libraries for threading, I/O and string manipulation. And for many more problems than you might expect, this is all you need.&lt;/div&gt;&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In C (well written C anyway), you can almost always look at a piece of code and see by inspection exactly what will happen. In OO languages, with virtual functions, this is rarely the case. When you see p-&amp;gt;f() in C++ you need to consider p's type and all classes derived from it to imagine everything that might happen. This often incurs a high cognitive load on maintainers of the code. Of course, with function pointers you can create equally obscure C, but you need to work harder in C so you only do that when there is a good reason. C forces you to keep your eye on the ball.&lt;/div&gt;&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now, in defense of C++, I have to say that programming in C++ has actually prepared me to be a better C programmer. For example, I treated all my structs as if they were private and wrote interfaces so users of my API never needed to know the internal workings of theses structs. In fact, most of my structs were hidden in private headers or in the .c  files themselves. Most of my implementation functions were statics and hence private. This gave me the flexibility to change the internals without breaking user code. OO taught me to think this way.  OO also taught me to think about writing code that can be unit tested and to write the tests right after the interfaces were specified but before the implementation. I brought this discipline to C as well.&lt;/div&gt;&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The one thing truly lacking in C is exceptions. I have to say that exception handling and &lt;a href="http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization"&gt;RAII&lt;/a&gt; are two of C++'s strengths. However, with discipline, you can do without these as well. &lt;/div&gt;&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So if you ever find yourself forced back into a ancient language like C, don't fret. Take the concepts you learned in more modern languages and think about how you can uses the spirit of those concepts to write better code. You just might enjoy going retro!&lt;/div&gt;&lt;meta equiv="Content-Type" content="text/html;charset=UTF-8"&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href="http://semanticvector.blogspot.com/feeds/posts/default?alt=rss"&gt;RSS&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/208437074950033830-5482640020528002923?l=semanticvector.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Cogitatio/~4/9DSCzf_2dBo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://semanticvector.blogspot.com/feeds/5482640020528002923/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=208437074950033830&amp;postID=5482640020528002923" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/5482640020528002923?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/5482640020528002923?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Cogitatio/~3/9DSCzf_2dBo/joy-of-c.html" title="The Joy of C" /><author><name>Sal Mangano</name><uri>http://www.blogger.com/profile/15017568083854549991</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://2.bp.blogspot.com/_hjRAumdIEoA/SLSwdjKB47I/AAAAAAAAACU/k8AdMap_Mns/S220/headshot.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://semanticvector.blogspot.com/2011/05/joy-of-c.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU8HSXk5eCp7ImA9WhZXGE8.&quot;"><id>tag:blogger.com,1999:blog-208437074950033830.post-3780850541869712211</id><published>2011-05-07T21:50:00.002-05:00</published><updated>2011-05-07T22:03:58.720-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-07T22:03:58.720-05:00</app:edited><title>End to End JavaScript with Node and HTML5</title><content type="html">This is my latest book project.  In this book I will build a online multi-player poker game application entirely in JavaScript using &lt;a href="http://nodejs.org"&gt;Node.js&lt;/a&gt; on the server and &lt;a href="http://jquery.com"&gt;JQuery&lt;/a&gt;+&lt;a href="http://en.wikipedia.org/wiki/Canvas_element"&gt;HTML5 Canvas&lt;/a&gt; on the client. The book will also feature &lt;a href="http://www.mongodb.org/"&gt;MongoDB&lt;/a&gt; and &lt;a href="http://pivotal.github.com/jasmine/"&gt;Jasmine&lt;/a&gt;.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The main emphasis of the book is to illustrate &lt;a href="http://en.wikipedia.org/wiki/Test-driven_development"&gt;test driven development&lt;/a&gt; of a non-trivial client-server JavaScript application. Although the book subject matter is a game, there will be lots of valuable take-aways for JavaScript, Node and Canvas developers.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href="http://semanticvector.blogspot.com/feeds/posts/default?alt=rss"&gt;RSS&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/208437074950033830-3780850541869712211?l=semanticvector.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Cogitatio/~4/wADFTiaS5T8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://semanticvector.blogspot.com/feeds/3780850541869712211/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=208437074950033830&amp;postID=3780850541869712211" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/3780850541869712211?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/3780850541869712211?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Cogitatio/~3/wADFTiaS5T8/end-to-end-javascript-with-node-and.html" title="End to End JavaScript with Node and HTML5" /><author><name>Sal Mangano</name><uri>http://www.blogger.com/profile/15017568083854549991</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://2.bp.blogspot.com/_hjRAumdIEoA/SLSwdjKB47I/AAAAAAAAACU/k8AdMap_Mns/S220/headshot.jpg" /></author><thr:total>3</thr:total><feedburner:origLink>http://semanticvector.blogspot.com/2011/05/end-to-end-javascript-with-node-and.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU8BRX4yfyp7ImA9WxFbGEw.&quot;"><id>tag:blogger.com,1999:blog-208437074950033830.post-4691663846008430844</id><published>2010-07-10T20:02:00.006-05:00</published><updated>2010-07-10T21:04:14.097-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-07-10T21:04:14.097-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="amazon.co.uk" /><category scheme="http://www.blogger.com/atom/ns#" term="Mathematica Cookbook" /><category scheme="http://www.blogger.com/atom/ns#" term="Troll" /><category scheme="http://www.blogger.com/atom/ns#" term="Jon Harrop" /><title>Mathematica Cookbook Attacked by a Troll: Jon Harrop</title><content type="html">Recently I have had a very unpleasant experience with a known internet troll who has been attacking Mathematica Cookbook on the amazon.co.uk site. I posted the following review on amazon.co.uk by way of defending myself and my work. They may or may not allow it but I wanted to share it with you.... &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I would like to direct UK customers who may be interested in my book to a few facts.&lt;br /&gt;&lt;br /&gt;1) Both of the previous reviewers (Edward and Jon Harrop) are actually the same person. I have very strong evidence this is the case. You may email me at mathematicacookbook@gmail.com if you want the details.&lt;br /&gt;&lt;br /&gt;2) Jon Harrop is author of "F# for scientists" and about 2 years ago I blogged unfavorably about Mr. Harrop's book. You can see my comments &lt;a href="http://bit.ly/ajGnZk"&gt;here&lt;/a&gt;: .&lt;br /&gt;&lt;br /&gt;3) Apparently I hurt Jon's feelings so badly that he could not wait to order my book just to give it a poor review. In fact, he has given it two!&lt;br /&gt; &lt;br /&gt;4) Since then he has been using my own book as inspiration for several of his own &lt;a href="http://fsharpnews.blogspot.com/"&gt;blog posts&lt;/a&gt; so apparently he does not find it totally useless.&lt;br /&gt;&lt;br /&gt;5) If you would like to see a more balanced treatment of my book please see these reviews: &lt;a href="http://amzn.to/cKxJVh"&gt;http://amzn.to/cKxJVh&lt;/a&gt;, &lt;a href="http://oreil.ly/9ypIlX"&gt;http://oreil.ly/9ypIlX&lt;/a&gt;, &lt;a href="http://bit.ly/b6HqFS"&gt;http://bit.ly/b6HqFS&lt;/a&gt; and &lt;a href="http://amzn.to/bQSr6Y"&gt;http://amzn.to/bQSr6Y&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;6) I won't comment further on Mr. Harrops character because I think his actions speak for themselves. The interested reader can google "Jon Harrop Troll" and draw their own conclusions.&lt;br /&gt;&lt;br /&gt;7) Finally, my book is not perfect. But I absolutely did not plagiarize anyone and link extensively to others work where they inspired my codes. I have been correcting issues as they are found and the O’Reilly site is where errata can be found. I think may readers in the UK who are fans of Mathematica can find a lot of value in my book and I don't want the bitter feelings of one individual to scare you away.&lt;div class="blogger-post-footer"&gt;&lt;a href="http://semanticvector.blogspot.com/feeds/posts/default?alt=rss"&gt;RSS&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/208437074950033830-4691663846008430844?l=semanticvector.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Cogitatio/~4/GEZA3qPsCII" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://semanticvector.blogspot.com/feeds/4691663846008430844/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=208437074950033830&amp;postID=4691663846008430844" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/4691663846008430844?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/4691663846008430844?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Cogitatio/~3/GEZA3qPsCII/mathematica-cookbook-attacked-by-troll.html" title="Mathematica Cookbook Attacked by a Troll: Jon Harrop" /><author><name>Sal Mangano</name><uri>http://www.blogger.com/profile/15017568083854549991</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://2.bp.blogspot.com/_hjRAumdIEoA/SLSwdjKB47I/AAAAAAAAACU/k8AdMap_Mns/S220/headshot.jpg" /></author><thr:total>3</thr:total><feedburner:origLink>http://semanticvector.blogspot.com/2010/07/mathematica-cookbook-attacked-by-troll.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0EERHc5cCp7ImA9WxFbFUw.&quot;"><id>tag:blogger.com,1999:blog-208437074950033830.post-5207474180738623428</id><published>2010-07-06T19:11:00.012-05:00</published><updated>2010-07-07T10:13:25.928-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-07-07T10:13:25.928-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Rule-Based" /><category scheme="http://www.blogger.com/atom/ns#" term="Simulation" /><category scheme="http://www.blogger.com/atom/ns#" term="Mathematica" /><title>The Elegance of Rule-Based Programming in Mathematica</title><content type="html">&lt;p&gt;&lt;br /&gt;Not too long ago I had to take a programming test as part of the application process for a development position at a hedge fund. The test had two problems - one easy and one not so easy. The solutions to both problems had to be implemented in your choice of Java, C or C++. You had two hours to finish.&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;I have never been good at presure cooker coding tests like this. I personally don't think these kind of tests bring out the best in most developers but there are some good devlopers who work well under these conditions. I just am not one of them.&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;In any case I recently thought of the hard problem on this test and how trivial it would be to solve in Mathematica. Indeed I whipped up and tested this solution on my train ride home which is only about 45 mins!&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;The solution is very short and I am guessing is much shorter than the average solution you can find in Java or C in the equivalent amount of time. The brevity come form exploiting mathematica's powerful rule-based approach. Most of the code is comments!&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p class="MsoPlainText"&gt;&lt;b&gt;Problem&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;A collection of particles is contained in a linear chamber. They all have the same speed, but some are headed toward the right and others are headed toward the left. These particles can pass through each other without disturbing the motion of the particles, so all the particles will leave the chamber relatively quickly.&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;You will be given the initial conditions by a string containing at each position an 'L' for a leftward moving particle, an 'R' for a rightward moving particle, or a '.' for an empty location. Initially, no location in the chamber contains two particles passing through each other.&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;Create an animation of the process. At each unit of time, you want a string showing occupied locations with an 'X' and unoccupied locations with a '.'. Create code  that for a function &lt;i&gt;animate&lt;/i&gt; that is given an integer speed and a string giving the initial conditions. The speed is the number of positions each particle moves in one time unit.&lt;br /&gt;&lt;br/&gt;&lt;br /&gt;The function will return a list of strings in which each successive element shows the occupied locations at the next time unit. The first element of the return should show the occupied locations at the initial instant (at time = 0) in the 'X', '.' format. The last element in the return should show the empty chamber at the first time that it becomes empty.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p class="MsoPlainText"&gt;&lt;b&gt;Solution&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;ClearAll[simulation, step, L, R, r, l, rule1, rule2, rule3, animation];&lt;br /&gt;&lt;br /&gt;(* &lt;br /&gt;This function does most of the work. It simulates a single step in the animation.&lt;br /&gt;It uses 3 rules which are initialized in the calling function and are visble&lt;br /&gt;here via the dynamic scoping of Block.&lt;br /&gt;&lt;br /&gt;There are 3 transformations performed within a Do. The Do's role is to run the&lt;br /&gt;transformations &lt;i&gt;velocity&lt;/i&gt; times as a means for making the particles move&lt;br /&gt;that many steps.&lt;br /&gt;&lt;br /&gt;The first transform takes the input and adds an empty cell to the start and end of the chamber.&lt;br /&gt;This is done to avoid having special rules to deal with the &lt;br /&gt;boundary conditions at the end of the chamber. &lt;br /&gt;&lt;br /&gt;The second transformation uses rules that are applied repeatedly using ReplaceAll (//.). &lt;br /&gt;I discuss the rules below. &lt;br /&gt;&lt;br /&gt;Delete is used to remove the dummy empty cells added in the first step and &lt;br /&gt;a third transformation maps lower case r and l back to upper case before the Do&lt;br /&gt;repeats.&lt;br /&gt;&lt;br /&gt;*)&lt;br /&gt;step[chamber_List, velocity_Integer] := Module[{work = chamber},&lt;br /&gt;  Do[&lt;br /&gt;   work = &lt;br /&gt;    Delete[work  /. {P__} :&amp;gt; {{}, P, {}} //. {rule1, rule2, &lt;br /&gt;        rule3}, {{-1}, {1}}] /. {r -&amp;gt; R, l -&amp;gt; L}, {velocity}];&lt;br /&gt;  work&lt;br /&gt;  ]&lt;br /&gt;&lt;br /&gt;(*&lt;br /&gt;The simulation sets up 3 rules. It is not necessary to define the rules here in a&lt;br /&gt;Block. The code is written this way largely because I incrementally developed the&lt;br /&gt;rules in the global scope and grafted them into a program later on.&lt;br /&gt;&lt;br /&gt;rule1 is responsible for moving a R partcle to the Right. NOTE: When a particle moves&lt;br /&gt;I change its case from upper to lower to make it invisble to subsequent rules.&lt;br /&gt;&lt;br /&gt;rule2 is responsible for handling an intermediate condition where a right moving&lt;br /&gt;particle lands in a cell of another right moving particle that has not moved yet.&lt;br /&gt;&lt;br /&gt;rule3 deals with left moving particles being careful to also handle the case where a&lt;br /&gt;previously moved partcle Z may be in the same cell as the L. &lt;br /&gt;&lt;br /&gt;The hardest aspect of this solution was distilling the transformations down to these&lt;br /&gt;three rules. It took some trial and error. It is possible I missed some corner case &lt;br /&gt;so let me know if you see a bug!!&lt;br /&gt;&lt;br /&gt;The idea here is that FixedPointList drives the simulation until it reaches a steady&lt;br /&gt;state and Most removes the repetitive last entry. &lt;br /&gt;&lt;br /&gt;A final transformation maps particles to "X" as dicated by the specifications.&lt;br /&gt;*)&lt;br /&gt;&lt;br /&gt;simulation[chamber_List, velocity_Integer] := &lt;br /&gt; Block[&lt;br /&gt;  {rule1 = {X___, {R}, {P___}, Y___} :&amp;gt; {X, {}, {P, r}, Y} ,&lt;br /&gt;   rule2 = {X___,  {R | r, r}, {P___}, Y___} :&amp;gt; {X, {r}, {P, r}, Y},&lt;br /&gt;   rule3 = {X___, {P___}, {L, Z___}, Y___} :&amp;gt; {X, {l, P}, {Z}, Y} },&lt;br /&gt;  Most[FixedPointList[&lt;br /&gt;     step[#, velocity] &amp;amp;, chamber]] //. {{(L | R) ..} -&amp;gt; "X", {} -&amp;gt; &lt;br /&gt;     "."}&lt;br /&gt;  ]&lt;br /&gt;&lt;br /&gt;(* &lt;br /&gt;The main function does little but convert from the string encoding specified by the problem to a more convenent symbolic form where each position in the chamber is one of {L}, {R} or {} for empty and the chamber itself is a list rather than a string.&lt;br /&gt;*)&lt;br /&gt;&lt;br /&gt;animation[chamber_String, velocity_Integer] := &lt;br /&gt; simulation[&lt;br /&gt;  (Characters[chamber] //. {"." -&amp;gt; {}, a_String :&amp;gt; {Symbol[a]}}), &lt;br /&gt;  velocity]&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;p class="MsoPlainText"&gt;&lt;b&gt;The Test Cases&lt;/b&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;1) The single particle starts at the 3rd position, moves to the 5th, then 7th, and then out of the chamber.&lt;br /&gt;&lt;pre&gt;In[360]:= animation["..R....",2]//Grid&lt;br /&gt;Out[360]=&lt;br /&gt;..X....&lt;br /&gt;....X..&lt;br /&gt;......X&lt;br /&gt;.......&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;2) At time 1, there are actually 4 particles in the  chamber, but two are passing through each other at the 4th position.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;In[361]:= animation["RR..LRL",3]//Grid&lt;br /&gt;Out[361]= &lt;br /&gt;XX..XXX&lt;br /&gt;.X.XX..&lt;br /&gt;X.....X&lt;br /&gt;.......&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;3) At time 0 there are 8 particles. At time 1, there are still 6 particles, but only 4 positions are occupied since particles are passing through each other.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;In[362]:= animation["LRLR.LRLR",2]//Grid&lt;br /&gt;Out[362]=&lt;br /&gt;XXXX.XXXX&lt;br /&gt;X..X.X..X&lt;br /&gt;.X.X.X.X.&lt;br /&gt;.X.....X.&lt;br /&gt;.........&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;4) These particles are moving so fast that they all exit the chamber by time 1. &lt;br /&gt;&lt;pre&gt;In[363]:= animation["RLRLRLRLRL",10]//Grid&lt;br /&gt;Out[363]= &lt;br /&gt;XXXXXXXXXX&lt;br /&gt;..........&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;5) The empty chamber test&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;In[364]:= animation["...",1]//Grid&lt;br /&gt;Out[364]=&lt;br /&gt;...&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;6) A complicated test&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;In[365]:= animation["LRRL.LR.LRR.R.LRRL.",1]//Grid&lt;br /&gt;Out[365]= &lt;br /&gt;XXXX.XX.XXX.X.XXXX.&lt;br /&gt;..XXX..X..XX.X..XX.&lt;br /&gt;.X.XX.X.X..XX.XX.XX&lt;br /&gt;X.X.XX...X.XXXXX..X&lt;br /&gt;.X..XXX...X..XX.X..&lt;br /&gt;X..X..XX.X.XX.XX.X.&lt;br /&gt;..X....XX..XX..XX.X&lt;br /&gt;.X.....XXXX..X..XX.&lt;br /&gt;X.....X..XX...X..XX&lt;br /&gt;.....X..X.XX...X..X&lt;br /&gt;....X..X...XX...X..&lt;br /&gt;...X..X.....XX...X.&lt;br /&gt;..X..X.......XX...X&lt;br /&gt;.X..X.........XX...&lt;br /&gt;X..X...........XX..&lt;br /&gt;..X.............XX.&lt;br /&gt;.X...............XX&lt;br /&gt;X.................X&lt;br /&gt;...................&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;I'll post the Mathematica Notebook on &lt;a href="http://www.mathematicacookbook.com/downloads"&gt;MathematicaCookbook.com&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href="http://semanticvector.blogspot.com/feeds/posts/default?alt=rss"&gt;RSS&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/208437074950033830-5207474180738623428?l=semanticvector.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Cogitatio/~4/uO-N5TH16D0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://semanticvector.blogspot.com/feeds/5207474180738623428/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=208437074950033830&amp;postID=5207474180738623428" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/5207474180738623428?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/5207474180738623428?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Cogitatio/~3/uO-N5TH16D0/elegance-of-rule-based-programming-in.html" title="The Elegance of Rule-Based Programming in Mathematica" /><author><name>Sal Mangano</name><uri>http://www.blogger.com/profile/15017568083854549991</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://2.bp.blogspot.com/_hjRAumdIEoA/SLSwdjKB47I/AAAAAAAAACU/k8AdMap_Mns/S220/headshot.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://semanticvector.blogspot.com/2010/07/elegance-of-rule-based-programming-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkIER3o9fip7ImA9WxFUGU8.&quot;"><id>tag:blogger.com,1999:blog-208437074950033830.post-5493938297085504508</id><published>2010-06-28T21:41:00.024-05:00</published><updated>2010-06-30T15:08:26.466-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-06-30T15:08:26.466-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Mathematica" /><title>Hold Everything!</title><content type="html">&lt;div&gt;In &lt;span&gt;&lt;a href="http://mathematicacookbook.com/book/"&gt;&lt;span class="HyperlinkInline"&gt;Mathematica Cookbook&lt;/span&gt;&lt;/a&gt;&lt;/span&gt; recipe 2.2 I discuss a "technique" for holding arbitrary arguments. Well truth be told, this recipe is pretty lame and was not supposed to make it into the final book. This post is intended to make of for that lameness and hopefully clarify some of the bewildering multitude of ways Mathematica offers for &lt;span&gt;Holding.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;h3&gt;The Hold Family of Attributes&lt;/h3&gt;&lt;br /&gt;Mathematica's default behavior is to evaluate every expression it sees. Here is an example.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;In[1]:= a=1;b=2;c=3; d= c; e:= d; f :=e;&lt;br /&gt;{a,b,c, d,e, f}&lt;br /&gt;Out[2]= {1,2,3,3,3,3}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Here we associate symbols &lt;i&gt;a&lt;/i&gt;, &lt;i&gt;b&lt;/i&gt;, &lt;i&gt;c&lt;/i&gt; with integers 1, 2,3. We then associate &lt;i&gt;d&lt;/i&gt; with the value of symbol &lt;i&gt;c&lt;/i&gt; and we associate &lt;i&gt;e&lt;/i&gt; with symbol &lt;i&gt;d&lt;/i&gt; telling Mathematica not to evaluate &lt;i&gt;d&lt;/i&gt; just yet by using SetDelayed (:=). We also associate &lt;i&gt;f&lt;/i&gt; with symbol &lt;i&gt;d&lt;/i&gt; likewise delaying evaluation. Later, when we evaluate the list containing these symbols Mathematica keeps evaluating until there is nothing left to do and we get the result as integers. By using &lt;i&gt;Trace&lt;/i&gt; we can see the steps Mathematica goes through.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;In[3]:= Trace[{a,b,c, d,e, f}]&lt;br /&gt;Out[3]= {{a,1},{b,2},{c,3},{d,3},{e,d,3},{f,e,d,3},{1,2,3,3,3,3}}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Okay, simple enough. However, occasionally you want to write functions that act on expressions before they are evaluated. In fact, even if you never had a reason for doing so, Mathematica itself needs this capability. For example, Mathematica could not implement the function &lt;i&gt;SetDelayed&lt;/i&gt; if it did not have a way of saying "don't evaluate". Rather then creating certain functions with special no-evaluating behavior, Mathematica takes a general approach via the concept of attributes. You can inspect the attributes of a symbol using the command &lt;i&gt;Attributes&lt;/i&gt;.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;In[4]:= Attributes[SetDelayed]&lt;br /&gt;Out[4]= {HoldAll,Protected,SequenceHold}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Here we see SetDelayed has two attributes in the hold-family: &lt;i&gt;HoldAll&lt;/i&gt; and &lt;i&gt;SequenceHold&lt;/i&gt;. Let's explore these using our own symbols and &lt;i&gt;SetAttributes&lt;/i&gt;. Here I use symbols f1, f2 and so on without associating them with values because that is not necessary to illustrate the behavior of the attributes.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;In[5]:= (* Make sure these symbols have no values or attributes*)&lt;br /&gt;ClearAll[f1,f2,f3,f4,f5,f6,f7] ;&lt;br /&gt;&lt;br /&gt;In[6]:= (* Here you can see that our list of symbols evalauates as before when we wrap f1 around it*)f1[{a,b,c,d,e,f}]&lt;br /&gt;Out[6]= f1[{1,2,3,3,3,3}]&lt;br /&gt;&lt;br /&gt;In[7]:= (*Here we use the HoldAll and associate it with f2. This says that no arguement of f2 should be evaluated*)&lt;br /&gt;SetAttributes[f2, HoldAll]&lt;br /&gt;In[8]:= f2[{a,b,c,d,e,f}]&lt;br /&gt;Out[8]= f2[{a,b,c,d,e,f}]&lt;br /&gt;&lt;br /&gt;In[9]:= (* It does not matter how many seperate arguments are passed, they are all held*)f2[a,b,c]&lt;br /&gt;Out[9]= f2[a,b,c]&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Notice the difference between evaluating &lt;i&gt;f1&lt;/i&gt; which has no attributes and &lt;i&gt;f2&lt;/i&gt; which has attribute &lt;i&gt;HoldAll&lt;/i&gt;. In essence, &lt;i&gt;f2&lt;/i&gt; acts the same as the built-in Mathematica command &lt;i&gt;Hold&lt;/i&gt;.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;In[10]:= Attributes[Hold]&lt;br /&gt;Out[10]= {HoldAll,Protected}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Sometimes you want only the first argument to a function to be held unevaluated. For that you use attribute &lt;i&gt;HoldFirst&lt;/i&gt;.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;In[11]:= SetAttributes[f3, HoldFirst]&lt;br /&gt;f3[a,b,c]&lt;br /&gt;Out[12]= f3[a,2,3]&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Alternatively you may want all arguments but the first to be held. Here you use &lt;i&gt;HoldRest&lt;/i&gt;.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;In[13]:= SetAttributes[f4, HoldRest]&lt;br /&gt;f4[a,b,c]&lt;br /&gt;Out[14]= f4[1,b,c]&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;So far I think the mechanics of &lt;i&gt;HoldAll&lt;/i&gt;, &lt;i&gt;HoldFirst&lt;/i&gt; and &lt;i&gt;HoldRest&lt;/i&gt; should be pretty clear. Don't worry yet if you don't get why you would want to use these in your own code, I'll get to that later. Just make sure you are comfortable with the idea of using attributes to suppress Mathematica's desire to evaluate before reading on.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Okay, now I want to point out some important exceptions. Well, not really exceptions but rather clarifications. &lt;i&gt;HoldAll&lt;/i&gt;, &lt;i&gt;HoldFirst&lt;/i&gt; and &lt;i&gt;HoldRest&lt;/i&gt; do not suppress every action that Mathematica takes when it sees an expression. To illustrate this, please recall that Mathematica has a long hand way of specifying a sequence of things.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;In[15]:= Sequence[1,2,3]&lt;br /&gt;Out[15]= Sequence[1,2,3]&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;A sequence is different form a list in that Mathematica will magically flatten out sequences and splice the result into any function call.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;In[16]:= f1[Sequence[1,2,3]]&lt;br /&gt;Out[16]= f1[1,2,3]&lt;br /&gt;In[17]:= f1[Sequence[1,2,Sequence[3,4,5]],7,8,9]&lt;br /&gt;Out[17]= f1[1,2,3,4,5,7,8,9]&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Now, recall that &lt;i&gt;f2&lt;/i&gt; has attributes &lt;i&gt;HoldAll&lt;/i&gt;. What do you think Mathematica does if we give &lt;i&gt;f2&lt;/i&gt; a sequence?&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;In[18]:= f2[Sequence[1,2,Sequence[3,4,5]],7,8,9]&lt;br /&gt;Out[18]= f2[1,2,3,4,5,7,8,9]&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Ah! The automatic flatting is not suppressed by &lt;i&gt;HoldAll&lt;/i&gt; nor is it suppressed by &lt;i&gt;HoldFirst&lt;/i&gt; or &lt;i&gt;HoldRest&lt;/i&gt;. The flattening out of sequences is something you usually don't want to suppress. This is why it is an exception to the rule for the standard hold family of attributes. However, you may recall that SetDelayed had another hold-like attribute called &lt;i&gt;SequenceHold&lt;/i&gt; and you can probably guess what it does!&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;In[19]:= SetAttributes[f5, SequenceHold]&lt;br /&gt;f5[Sequence[1,2,Sequence[3,4,5]],7,8,9]&lt;br /&gt;Out[20]= f5[Sequence[1,2,3,4,5],7,8,9]&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Notice how the outer sequence remains. Why did the inner sequence get flattened? Simply because it is evaluated within Sequence which naturally does not have the SequenceHold attribute.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Okay, lets review. HoldAll, HoldFirst and HoldRest are attributes that suppress evaluation of specific arguments but don't suppress sequence flattening. For that you use SequenceHold. You can use one of the hold attributes together with SequenceHold to get both behaviors.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;In[21]:= SetAttributes[f6, {HoldAll,SequenceHold}]&lt;br /&gt;f5[Sequence[a,b,c]]&lt;br /&gt;f6[Sequence[a,b,c]]&lt;br /&gt;Out[22]= f5[Sequence[1,2,3]]&lt;br /&gt;Out[23]= f6[Sequence[a,b,c]]&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;But we are not done yet! There is even a stronger form of holding that suppresses normal evaluation, sequence flattening and more! First, recall that sometimes you want to tell Mathematica that you want something to evaluate despite the presence of &lt;i&gt;HoldAll&lt;/i&gt; and friends.  To see how there can be a stronger form of holding we must first consider &lt;i&gt;Evaluate&lt;/i&gt;.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;In[24]:= f2[Evaluate[a,b,c]]&lt;br /&gt;Out[24]= f2[1,2,3]&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Evaluate is a way of saying to Mathematica that you know what you are doing and you want evaluation to take place despite the presence of HoldAll, etc.. This typically arises when you want to plot a function that you obtain by integration (or other function generating operations).&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;In[25]:= Attributes[Plot]&lt;br /&gt;Out[25]= {HoldAll,Protected}&lt;br /&gt;&lt;br /&gt;In[26]:= Plot[Evaluate[Integrate[Sin[x],x]], {x, 0, 2Pi}]&lt;br /&gt;Out[26]:=&lt;/pre&gt;&lt;img margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 320px; height: 193px;" src="http://4.bp.blogspot.com/_hjRAumdIEoA/TCloGu_mmMI/AAAAAAAAAEU/001humfqk1s/s320/HoldEverything1.gif" border="0" alt="" id="BLOGGER_PHOTO_ID_5488032085830965442" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The attribute &lt;i&gt;HoldAllComplete&lt;/i&gt; has super-powers because it can even shield evaluation by &lt;i&gt;Evaluate&lt;/i&gt;!&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;In[27]:= SetAttributes[f7,HoldAllComplete]&lt;br /&gt;In[28]:= f6[Evaluate[{a,b,c}]]&lt;br /&gt;f7[Evaluate[{a,b,c}]]&lt;br /&gt;Out[28]= f6[{1,2,3}]&lt;br /&gt;Out[29]= f7[Evaluate[{a,b,c}]]&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The built in command &lt;i&gt;HoldComplete&lt;/i&gt; is the counterpart to the &lt;i&gt;Hold&lt;/i&gt; command.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;In[30]:= Attributes[Hold]&lt;br /&gt;Attributes[HoldComplete]&lt;br /&gt;Out[30]= {HoldAll,Protected}&lt;br /&gt;Out[31]= {HoldAllComplete,Protected}&lt;br /&gt;In[32]:= HoldComplete[Evaluate[{a,b,c}]]&lt;br /&gt;Out[32]= HoldComplete[Evaluate[{a,b,c}]]&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Functions with attribute &lt;i&gt;HoldAllComplete&lt;/i&gt; also suppress upvalue evaluation. I am not going to discuss up upvalues here but you can refer to the Mathematica documentation or my cookbook.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;h3&gt;HoldForm, Unevaluated, Defer oh my!&lt;/h3&gt;&lt;br /&gt;At this point you might think we have exhausted all the ways you can suppress evaluation but no. Mathematica has some more subtle ways you can keep its evaluation engine in check. Perhaps the easiest to understand is &lt;i&gt;HoldForm&lt;/i&gt;. This command suppresses evaluation just like &lt;i&gt;Hold&lt;/i&gt; except the command gets hidden when display in output form. The following should make the difference clear.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;In[33]:= Hold[1+2]&lt;br /&gt;Out[33]= Hold[1+2]&lt;br /&gt;&lt;br /&gt;In[34]:= ReleaseHold[%]&lt;br /&gt;Out[34]= 3&lt;br /&gt;&lt;br /&gt;In[35]:= HoldForm[1+2]&lt;br /&gt;Out[35]= 1+2&lt;br /&gt;&lt;br /&gt;In[36]:= ReleaseHold[%]&lt;br /&gt;Out[36]= 3&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;i&gt;Unevaluated&lt;/i&gt; can be thought of as a temporary or one-shot &lt;i&gt;Hold&lt;/i&gt;. It suppresses evaluation the first time the Mathematica evaluator sees it but not subsequent times. The following examples are a good illustration of the difference.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;In[37]:= (*first I create a simple list *)&lt;br /&gt;list = {1,2,3}&lt;br /&gt;Out[37]= {1,2,3}&lt;br /&gt;&lt;br /&gt;In[38]:= (*Now lets see what happens if we try to make list  list self-referential*)&lt;br /&gt;list[[3]] = list; list&lt;br /&gt;Out[38]= {1,2,{1,2,3}}&lt;br /&gt;&lt;br /&gt;In[39]:= (* What happens if we doo this again using Hold? *)&lt;br /&gt;list = {1,2,3};&lt;br /&gt;list[[3]] = Hold[list];&lt;br /&gt;list&lt;br /&gt;&lt;br /&gt;Out[41]= {1,2,Hold[list]}&lt;br /&gt;&lt;br /&gt;In[42]:= ReleaseHold[%]&lt;br /&gt;Out[42]= {1,2,{1,2,Hold[list]}}&lt;br /&gt;&lt;br /&gt;In[43]:= ReleaseHold[%]&lt;br /&gt;Out[43]= {1,2,{1,2,{1,2,Hold[list]}}}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Okay, that is somewhat interesting. Each time we invoke &lt;i&gt;ReleaseHold&lt;/i&gt; the list expands unveiling another nested version of itself. What do you think happens if we do this experiment with &lt;i&gt;Unevaluated&lt;/i&gt; instead?&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;In[44]:= list = {1, 2, 3};&lt;br /&gt;list[[3]] = Unevaluated[list];&lt;br /&gt;list&lt;br /&gt;&lt;strong&gt;During evaluation of In[44]:= $RecursionLimit::reclim: Recursion depth of 256 exceeded. &amp;gt;&amp;gt;&lt;br /&gt;During evaluation of In[44]:= $RecursionLimit::reclim: Recursion depth of 256 exceeded. &amp;gt;&amp;gt;&lt;/strong&gt;&lt;br /&gt;Out[46]= {1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,{1,2,Hold[{1,2,list}]}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Oops! We created an never ending evaluation that eventually blows up. The only way for Mathematica to finally display the "result" is for it to force a Hold into the output to put the breaks on this runaway evaluation train! The reason for this behavior is that Unevaluated allowed us to suppress evaluation of list up until the point where it made the symbol &lt;i&gt;list&lt;/i&gt; the new third element of the &lt;i&gt;List&lt;/i&gt; associated with the symbol &lt;i&gt;list&lt;/i&gt; but after that step, evaluation is no longer suppressed. So we have a symbol which contains a reference to itself and the evaluator can never stop until recursion limit is reached.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Defer&lt;/i&gt; is another function that acts like &lt;i&gt;Hold&lt;/i&gt; but will allow evaluation each time it is presented to the front-end for evaluation via the user action of hitting &lt;strong&gt;Shift-Enter&lt;/strong&gt; or selection the expression and using &lt;strong&gt;Evaluation In Place&lt;/strong&gt;. We can use the self-referential example to see this. Here each step in the expansion was created by hitting &lt;strong&gt;Shift-Enter&lt;/strong&gt; on the prior output.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;In[47]:= list = {1, 2, 3}; &lt;br /&gt;list[[3]] = Defer[list]; &lt;br /&gt;list&lt;br /&gt;Out[49]= {1,2,list}&lt;br /&gt;&lt;br /&gt;In[50]:= {1,2,list}&lt;br /&gt;Out[50]= {1,2,{1,2,list}}&lt;br /&gt;&lt;br /&gt;In[51]:= {1,2,{1,2,list}}&lt;br /&gt;Out[51]= {1,2,{1,2,{1,2,list}}}&lt;br /&gt;&lt;br /&gt;In[52]:= {1,2,{1,2,{1,2,list}}}&lt;br /&gt;Out[52]= {1,2,{1,2,{1,2,{1,2,list}}}}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;So you can see Mathematica has quite a rich repertoire of functions and attributes whose sole purpose is to keep it for doing what it was designed to do - evaluate! The novice Mathematica user may be mystified by this but these features are essential to the functionality of Mathematica. In other words, the rich sets of features Mathematica provides would not be there if Mathematica did not contain mechanisms for controlling itself. Programming after all is the act where an individual exerts control over a (abstract) machine. But perhaps this explanation is a bit too metaphysical for your tastes. So lets get to some concrete examples. Consider the rich family of &lt;i&gt;Plot&lt;/i&gt; functions which take other functions as input. Notice that these all have &lt;i&gt;HoldAll&lt;/i&gt; as attributes. Think for a second why this is the case before reading on.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;In[53]:= Attributes[{Plot, ParametricPlot, Plot3D}]&lt;br /&gt;Out[53]= {{HoldAll,Protected},{HoldAll,Protected},{HoldAll,Protected}}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Functions that rely on delayed evaluation are typically those that are in essence little evaluation engines themselves. Think about plotting. It must take a function and evaluate it at various points so that it can map the values at those points to the graphics coordinates of points (ultimately pixels on the display device). These evaluations can not be interfered with by the normal evaluation process because in many cases that will change the input before the evaluator can do its thing. If this reasoning is correct than any function in Mathematica which repeatedly evaluates another function should utilize the Hold family of attributes. One of the simplest of these is &lt;i&gt;Table&lt;/i&gt; so let's see.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;In[54]:= Attributes[Table]&lt;br /&gt;Out[54]= {HoldAll,Protected}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Yep.  Various forms of control flow (&lt;i&gt;If&lt;/i&gt;, &lt;i&gt;Do&lt;/i&gt;, &lt;i&gt;Switch&lt;/i&gt;) also must use held arguments for similar reasons. Another class of functions that hold arguments unevaluated are those that must act on symbolic values themselves. Examples are &lt;i&gt;Clear&lt;/i&gt; and &lt;i&gt;AddTo&lt;/i&gt; (+=).  The following little program lists all such symbols in the System` context that have an attribute in the &lt;i&gt;Hold&lt;/i&gt; family.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;In[55]:= Select[Names["System`*"],Length[Intersection[Attributes[#],{HoldAll,HoldFirst,HoldRest,HoldAllComplete}]]&gt;0&amp;]&lt;br /&gt;Out[55]= {AbortProtect,AbsoluteTiming,AddTo,And,Animate,AppendTo,Arrow3DBox,ArrowBox,Assuming,Attributes,BezierCurve3DBox,BezierCurveBox,Block,BlockRandom,BSplineCurve3DBox,BSplineCurveBox,BSplineSurface3DBox,Button,CancelButton,Catch,Check,CheckAbort,CheckAll,ChoiceButtons,CircleBox,Clear,ClearAll,ClearAttributes,Compile,CompiledFunction,CompoundExpression,Condition,ConeBox,ConsoleMessage,Context,ContinuedFractionK,ContourPlot,ContourPlot3D,Control,ControlActive,ControllerManipulate,CuboidBox,CylinderBox,Debug,DebugTag,Decrement,DefaultButton,DefaultValues,Defer,Definition,DensityPlot,Dialog,DialogInput,DialogReturn,DiskBox,DivideBy,Do,DownValues,DumpSave,Dynamic,DynamicBox,DynamicModule,DynamicModuleBox,DynamicWrapper,DynamicWrapperBox,Exists,FileName,FindArgMax,FindArgMin,FindMaximum,FindMaxValue,FindMinimum,FindMinValue,FindRoot,For,ForAll,FormatValues,FullDefinition,Function,GeometricTransformation3DBox,GeometricTransformationBox,Graphics3DBox,GraphicsBox,GraphicsComplex3DBox,GraphicsComplexBox,GraphicsGroup3DBox,GraphicsGroupBox,Hold,HoldComplete,HoldForm,HoldPattern,If,Increment,Information,InsetBox,Interpretation,InterpretationBox,Line3DBox,LineBox,LineIntegralConvolutionPlot,Literal,MakeBoxes,Manipulate,MatchLocalNameQ,MemoryConstrained,MenuItem,Message,MessageName,MessagePacket,Messages,Module,Monitor,Nand,NCache,NIntegrate,Nor,NProduct,NSum,NValues,Off,On,Or,OwnValues,ParametricPlot,ParametricPlot3D,Parenthesize,Pattern,PatternTest,Piecewise,Play,Plot,Plot3D,Point3DBox,PointBox,Polygon3DBox,PolygonBox,PreDecrement,PreemptProtect,PreIncrement,PrependTo,Product,Protect,Quiet,RasterBox,Reap,RectangleBox,Refresh,RegionPlot,RegionPlot3D,Remove,RuleCondition,RuleDelayed,SampledSoundFunction,Save,Set,SetAttributes,SetDelayed,SphereBox,Stack,StackBegin,StackComplete,StackInhibit,StreamDensityPlot,StreamPlot,SubtractFrom,SubValues,Sum,Switch,SystemException,Table,TagSet,TagSetDelayed,TagUnset,Text3DBox,TextBox,TimeConstrained,TimesBy,Timing,Trace,TraceDialog,TracePrint,TraceScan,TubeBezierCurveBox,TubeBox,TubeBSplineCurveBox,Unevaluated,Unprotect,Unset,UpSet,UpSetDelayed,UpValues,ValueQ,VectorDensityPlot,VectorPlot,VectorPlot3D,WaitUntil,Which,While,With,$ConditionHold,$Failed}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Here you can see that the ultimate form of holding, &lt;i&gt;HoldAllComplete&lt;/i&gt;, is more rarely used and when it is it is for rather low-level functions. &lt;br /&gt;&lt;pre&gt;&lt;br /&gt;In[56]:= Select[Names["System`*"],Length[Intersection[Attributes[#],{HoldAllComplete}]]&gt;0&amp;]&lt;br /&gt;Out[56]= {DebugTag,HoldComplete,InterpretationBox,MakeBoxes,Parenthesize,PreemptProtect,SystemException,Unevaluated}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;h3&gt;Recipe 2.2 Reconsidered&lt;/h3&gt;&lt;br /&gt;In recipe 2.2 of &lt;span&gt;&lt;a href="http://mathematicacookbook.com/book/"&gt;&lt;span class="HyperlinkInline"&gt;Mathematica Cookbook&lt;/span&gt;&lt;/a&gt;&lt;/span&gt; I consider if it was possible to create functions that Hold other combinations of arguments than provided by &lt;i&gt;HoldAll&lt;/i&gt;, &lt;i&gt;HoldFirst&lt;/i&gt; and &lt;i&gt;HoldRest&lt;/i&gt;. The solution proposed using Hold as a pattern within the function itself. This awkward construct thus required you to use &lt;i&gt;Hold&lt;/i&gt; when you invoked the function. To further un-motivate this I presented a rather lame example in the solution. &lt;br /&gt;&lt;pre&gt;&lt;br /&gt;In[57]:= array1 = Table[0, {10}]; array2 = Table[1, {10}];&lt;br /&gt;&lt;br /&gt;arrayAssign[Hold[a_Symbol],aIndex_,Hold[b_Symbol],bIndex_]:= &lt;br /&gt;Module[{},&lt;br /&gt;a[[aIndex]] = b[[bIndex]];&lt;br /&gt;a[[aIndex]]]&lt;br /&gt;&lt;br /&gt;(*Assign elements 2 through 3 in array 2 to array1 *)&lt;br /&gt;arrayAssign[Hold[array1],2;;3,Hold[array2],1];&lt;br /&gt;array1&lt;br /&gt;&lt;br /&gt;Out[60]= {0,1,1,0,0,0,0,0,0,0}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;There are several reasons this solution is lame. First off, the example is not at all practical. There is little reason to create a function to do this when you can do the same in a one line expression. But that could be forgiven by virtue of being a purely pedagogical example. The real flaw is that this technique requires you to use Hold at the call site which is nothing at all like the behavior of functions with attributes HoldFirst, HoldRest or HoldAll. A more sensibly way to achieve the same effect is to simply use HoldAll and force evaluation where required. So to use this somewhat useless example again...&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;In[61]:= array1 = Table[0, {10}]; array2 = Table[1, {10}];&lt;br /&gt;&lt;br /&gt;SetAttributes[arrayAssign2,HoldAll];arrayAssign2[a_Symbol,aIndex_,b_Symbol,bIndex_]:= &lt;br /&gt;Module[{aIndex2,bIndex2},&lt;br /&gt;{aIndex2,bIndex2} = Evaluate[{aIndex,bIndex}];&lt;br /&gt;a[[aIndex2]] = b[[bIndex2]];&lt;br /&gt;a[[aIndex2]]]&lt;br /&gt;&lt;br /&gt;(*Assign elements 2 through 3 in array 2 to array1 *)&lt;br /&gt;arrayAssign2[array1,2;;3,array2,1];&lt;br /&gt;array1&lt;br /&gt;&lt;br /&gt;Out[64]= {0,1,1,0,0,0,0,0,0,0}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href="http://semanticvector.blogspot.com/feeds/posts/default?alt=rss"&gt;RSS&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/208437074950033830-5493938297085504508?l=semanticvector.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Cogitatio/~4/qE3bukgRx2A" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://semanticvector.blogspot.com/feeds/5493938297085504508/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=208437074950033830&amp;postID=5493938297085504508" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/5493938297085504508?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/5493938297085504508?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Cogitatio/~3/qE3bukgRx2A/hold-everything.html" title="Hold Everything!" /><author><name>Sal Mangano</name><uri>http://www.blogger.com/profile/15017568083854549991</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://2.bp.blogspot.com/_hjRAumdIEoA/SLSwdjKB47I/AAAAAAAAACU/k8AdMap_Mns/S220/headshot.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_hjRAumdIEoA/TCloGu_mmMI/AAAAAAAAAEU/001humfqk1s/s72-c/HoldEverything1.gif" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://semanticvector.blogspot.com/2010/06/hold-everything.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUIDRng5eCp7ImA9WxJaEUU.&quot;"><id>tag:blogger.com,1999:blog-208437074950033830.post-1626090339910333467</id><published>2009-08-01T22:11:00.005-05:00</published><updated>2009-08-01T22:26:17.620-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-08-01T22:26:17.620-05:00</app:edited><title>No Sleep `Till Book Done</title><content type="html">&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;A rap about my experience writing Mathematica Cookbook...&lt;/span&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;(Sing to the tune of "No Sleep `Till Brooklyn by The Beastie Boys)&lt;/p&gt;&lt;p class="MsoNormal"&gt;(chorus) No sleep 'til - Book Done&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Editing unsettled - but I got mettle&lt;br /&gt;Laptop running hotter than a boiling kettle&lt;/p&gt;  &lt;p class="MsoNormal"&gt;My job's ain't a job - it's a damn hard time&lt;br /&gt;Ideas to code - runnin' overtime&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Some frustration - but it’s my vocation&lt;br /&gt;Sal and the boy's skippin' vacation&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Itchy index finger but a stable work table&lt;br /&gt;I do what I do best because I'm willing and able&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Ain't no faking - not money I'm making&lt;br /&gt;Going page to page - so there's no mistaking&lt;/p&gt;  &lt;p class="MsoNormal"&gt;I'm still at the job working nine to five&lt;br /&gt;So it takes more time for this to go live&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;(bridge) No sleep 'til –&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Another chapter - another train&lt;br /&gt;Mathematica code flyin out my brain&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Another edit - gotta make it right&lt;br /&gt;This proof-reading may go all night&lt;/p&gt;  &lt;p class="MsoNormal"&gt;My editor's cool - he continues to trust&lt;br /&gt;That it'll get done, it must, it must!&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Writing and typing - I code around the clock&lt;br /&gt;Can't publish this book til I gen clean Doc&lt;/p&gt;  &lt;p class="MsoNormal"&gt;I'm thrashing 8 cores and making a giant file&lt;br /&gt;Getting parallel code to work can take a while&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Map, Apply, ListConvolve and Position&lt;br /&gt;If a pattern don't match, I first Partition&lt;/p&gt;  &lt;p class="MsoNormal"&gt;I got a recursive func that blew the stack&lt;br /&gt;So I used Fold – it’s less a hack&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;(repeat bridge)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;(repeat chorus)&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Making Sparse Arrays, so I'm using Band&lt;br /&gt;To see all the powers, I use Expand&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Schooled and work in Brooklyn - U.S.A.&lt;br /&gt;Alpha did not know, so I showed it the way&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Write Function with  Slot - match expression with pattern&lt;br /&gt;If I use AstronomicalData, I can find Saturn&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Got Greeks, Graphics, Reaps and Sows&lt;br /&gt;Blanks, and Slots, Plots and Shows&lt;/p&gt;  &lt;p class="MsoNormal"&gt;I got Mathematica so get out of my way&lt;br /&gt;Filtering some data, I use Fourier&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Learning a lot but I get no sleep&lt;br /&gt;Cause I'm writing this Cookbook eight days a week&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;(repeat chorus) &lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href="http://semanticvector.blogspot.com/feeds/posts/default?alt=rss"&gt;RSS&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/208437074950033830-1626090339910333467?l=semanticvector.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Cogitatio/~4/YaO6UBQPTIQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://semanticvector.blogspot.com/feeds/1626090339910333467/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=208437074950033830&amp;postID=1626090339910333467" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/1626090339910333467?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/1626090339910333467?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Cogitatio/~3/YaO6UBQPTIQ/no-sleep-till-book-done.html" title="No Sleep `Till Book Done" /><author><name>Sal Mangano</name><uri>http://www.blogger.com/profile/15017568083854549991</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://2.bp.blogspot.com/_hjRAumdIEoA/SLSwdjKB47I/AAAAAAAAACU/k8AdMap_Mns/S220/headshot.jpg" /></author><thr:total>3</thr:total><feedburner:origLink>http://semanticvector.blogspot.com/2009/08/no-sleep-till-book-done.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0YHRH4zeCp7ImA9WxJaEEo.&quot;"><id>tag:blogger.com,1999:blog-208437074950033830.post-6794280484260490951</id><published>2009-07-31T15:01:00.003-05:00</published><updated>2009-07-31T15:12:15.080-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-07-31T15:12:15.080-05:00</app:edited><title>Mapping game play into work</title><content type="html">About 15-16 years ago I had a conversation with a colleague where I thought it would be possible to create a video game where the game play mapped into useful work. So, in other words, players would think they are just being entertained but in reality they were solving some difficult problem that someone could profit from.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style=" ;font-size:medium;"&gt;Well, this has come to pass:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;a href="http://bit.ly/eWhGV"&gt;http://bit.ly/eWhGV &lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;and&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style=" white-space: pre-wrap; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; font-family:arial, helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;a href="http://bit.ly/9F98q"&gt;http://bit.ly/9F98q&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial, helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="white-space: pre-wrap; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; "&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial, helvetica, sans-serif;"&gt;&lt;span class="Apple-style-span" style="white-space: pre-wrap; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; "&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;Should of patented that idea! &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="font-family:arial, helvetica, sans-serif;font-size:130%;"&gt;&lt;span class="Apple-style-span"  style=" white-space: pre-wrap; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;font-size:14px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style="font-family:arial, helvetica, sans-serif;font-size:130%;"&gt;&lt;span class="Apple-style-span"  style=" white-space: pre-wrap; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;font-size:14px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href="http://semanticvector.blogspot.com/feeds/posts/default?alt=rss"&gt;RSS&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/208437074950033830-6794280484260490951?l=semanticvector.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Cogitatio/~4/atG7-Ag7AQk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://semanticvector.blogspot.com/feeds/6794280484260490951/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=208437074950033830&amp;postID=6794280484260490951" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/6794280484260490951?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/6794280484260490951?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Cogitatio/~3/atG7-Ag7AQk/mapping-game-play-into-work.html" title="Mapping game play into work" /><author><name>Sal Mangano</name><uri>http://www.blogger.com/profile/15017568083854549991</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://2.bp.blogspot.com/_hjRAumdIEoA/SLSwdjKB47I/AAAAAAAAACU/k8AdMap_Mns/S220/headshot.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://semanticvector.blogspot.com/2009/07/mapping-game-play-into-work.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUAESXo4eSp7ImA9WxVaEU4.&quot;"><id>tag:blogger.com,1999:blog-208437074950033830.post-240312311448870509</id><published>2009-04-07T15:36:00.003-05:00</published><updated>2009-04-07T15:55:08.431-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-04-07T15:55:08.431-05:00</app:edited><title>Mathematica Cookbook Status</title><content type="html">I have really neglected this blog due to the overwhelming amount of attention I had to devote to my forthcoming  Mathematica Cookbook. I can see the light at the end of the tunnel and hope to blog more regularly soon.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;While working on the cookbook, I came across some really great books that I highly recommend to fans of Mathematics:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.math.upenn.edu/~wilf/DownldGF.html"&gt;Generatingfunctionology  &lt;/a&gt;by &lt;span class="Apple-style-span" style="font-family: arial; font-size: 13px; "&gt;Herbert S. Wilf. This book begins with an awesome quote, "A generating function is a clothesline on which we hang up a sequence of numbers for display."&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: arial; font-size: 13px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: arial; font-size: 13px;"&gt;&lt;a href="http://www.amazon.com/Fundamental-Finite-Element-Analysis-Applications/dp/0471648086"&gt;Fundamental Finite Element Analysis and Applications with Mathematica and Matlab Computations&lt;/a&gt;  by M. Asghar Bhatti. This book really helped me wrap my mind around the ideas of FEM. Expensive book, but worth it.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: arial; font-size: 13px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: arial; font-size: 13px;"&gt;&lt;a href="http://www4.wittenberg.edu/maxwell/"&gt;A Student's Guide to Maxwell's Equations&lt;/a&gt;  by D&lt;span class="Apple-style-span" style="font-family: Verdana; font-size: 12px; line-height: 18px; "&gt;an Fleisch is really helpful in taking the mystery out of these equations. It decomposes them symbol by symbol in a way I never seen done before in a mathematics or physics text.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana; font-size: 12px; line-height: 18px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Verdana; font-size: 12px; line-height: 18px;"&gt;There are a few others but I'll save them for a future post.&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href="http://semanticvector.blogspot.com/feeds/posts/default?alt=rss"&gt;RSS&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/208437074950033830-240312311448870509?l=semanticvector.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Cogitatio/~4/o0OYtP7dzwE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://semanticvector.blogspot.com/feeds/240312311448870509/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=208437074950033830&amp;postID=240312311448870509" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/240312311448870509?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/240312311448870509?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Cogitatio/~3/o0OYtP7dzwE/mathematica-cookbook-status.html" title="Mathematica Cookbook Status" /><author><name>Sal Mangano</name><uri>http://www.blogger.com/profile/15017568083854549991</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://2.bp.blogspot.com/_hjRAumdIEoA/SLSwdjKB47I/AAAAAAAAACU/k8AdMap_Mns/S220/headshot.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://semanticvector.blogspot.com/2009/04/mathematica-cookbook-status.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkUHSH44fSp7ImA9WxRWFEw.&quot;"><id>tag:blogger.com,1999:blog-208437074950033830.post-678848890136938204</id><published>2008-10-30T16:48:00.004-05:00</published><updated>2008-10-30T18:43:59.035-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-10-30T18:43:59.035-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="whining" /><title>Geeks just wanna have fun</title><content type="html">A computer is truly the greatest geek toy ever invented. It is like an erector set to the googleplex power. Being "forced" to earn a living making  virtual toys for others to use rather than spending ones days exploring this toy's &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_0"&gt;possibilities&lt;/span&gt; for my own edification can be truly depressing sometimes. Maybe not as depressing as having to sell used cars or life insurance to feed one's family but close. I probably should be grateful I have a job that involves these toys especially in this economy.&lt;br /&gt;&lt;br /&gt;I guess I just feel like being a &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_1"&gt;whiner&lt;/span&gt; today in &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_2"&gt;lieu&lt;/span&gt; of a useful blog post.  Go ahead and slam me in the comments.&lt;div class="blogger-post-footer"&gt;&lt;a href="http://semanticvector.blogspot.com/feeds/posts/default?alt=rss"&gt;RSS&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/208437074950033830-678848890136938204?l=semanticvector.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Cogitatio/~4/0zOzCTErU2s" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://semanticvector.blogspot.com/feeds/678848890136938204/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=208437074950033830&amp;postID=678848890136938204" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/678848890136938204?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/678848890136938204?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Cogitatio/~3/0zOzCTErU2s/geeks-just-wanna-have-fun.html" title="Geeks just wanna have fun" /><author><name>Sal Mangano</name><uri>http://www.blogger.com/profile/15017568083854549991</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://2.bp.blogspot.com/_hjRAumdIEoA/SLSwdjKB47I/AAAAAAAAACU/k8AdMap_Mns/S220/headshot.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://semanticvector.blogspot.com/2008/10/geeks-just-wanna-have-fun.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUADSHsyfip7ImA9WxRQE0Q.&quot;"><id>tag:blogger.com,1999:blog-208437074950033830.post-5491331953430139174</id><published>2008-10-07T10:08:00.003-05:00</published><updated>2008-10-07T10:36:19.596-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-10-07T10:36:19.596-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="software development" /><title>More Programmers = More Code</title><content type="html">What do you get when you throw lots of programmers at a problem? You get lots of code! That's what programmers do, duh. It does not matter how simple or complex the problem is. For any given size problem, more programmers will mean more code. That is more code to debug, more code to test, more to maintain. More, more, more. Eventually this will require even more programmers and the cycle continues until the project collapses.&lt;br /&gt;&lt;br /&gt;And it is even worse if you only hire the best and brightest programmers (don't we all!!). They write code faster! And it will be more complex than a dullard programmer because &lt;em&gt;good&lt;/em&gt; programmers like to write &lt;em&gt;general&lt;/em&gt; solutions.&lt;br /&gt;&lt;br /&gt;Rich companies like Microsoft can keep this going for some time. However, you see the result in Vista and Office. Bloat, bloat, bloat.&lt;br /&gt;&lt;br /&gt;What do you do if you have a problem that would take 12 months for 2 programmers but you want it done in 6. Hire 2 more programmers? Hire 4 more programmers? Big mistake! First off, it ain't gonna happen in 6 months no matter what you do if it is really a 12 month problem. If you must cover your ass as a manager and claim you used all your resources to make it happen in 6 months, I suggest the following.&lt;br /&gt;&lt;br /&gt;Put 2 of the best programmers you have on the project. Make sure they like each other and think alike about software design. They are the leads. Only the leads will write code that will go into production.&lt;br /&gt;&lt;br /&gt;Use all your remaining dollars to hire programmers who will support the leads but NOT write production code unless it is a piece of boiler plate delegated to them by one of the leads. What these junior developers do is write and execute unit tests for the leads. They write test tools when appropriate. They participate in code reviews. They are not slaves but future leads in training. Or maybe they are not future leads in training. Maybe they are salves. That's okay, mediocre programmer's need to eat to.&lt;br /&gt;&lt;br /&gt;Some bigger projects may need 4 leads or even 6. If you have more than that your project is DOA and you better convince someone to spilt it up. If they won't, I'd find another place to work. That's better than being canned or losing all you hair/sleep/health over a doomed project. And trust me, it is doomed.&lt;div class="blogger-post-footer"&gt;&lt;a href="http://semanticvector.blogspot.com/feeds/posts/default?alt=rss"&gt;RSS&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/208437074950033830-5491331953430139174?l=semanticvector.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Cogitatio/~4/VHGQtGPDZdA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://semanticvector.blogspot.com/feeds/5491331953430139174/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=208437074950033830&amp;postID=5491331953430139174" title="7 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/5491331953430139174?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/5491331953430139174?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Cogitatio/~3/VHGQtGPDZdA/more-programmers-more-code.html" title="More Programmers = More Code" /><author><name>Sal Mangano</name><uri>http://www.blogger.com/profile/15017568083854549991</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://2.bp.blogspot.com/_hjRAumdIEoA/SLSwdjKB47I/AAAAAAAAACU/k8AdMap_Mns/S220/headshot.jpg" /></author><thr:total>7</thr:total><feedburner:origLink>http://semanticvector.blogspot.com/2008/10/more-programmers-more-code.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0YMSXg6eyp7ImA9WxRRGUw.&quot;"><id>tag:blogger.com,1999:blog-208437074950033830.post-1431673790876260911</id><published>2008-10-01T19:48:00.002-05:00</published><updated>2008-10-01T20:33:08.613-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-10-01T20:33:08.613-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Mathematics" /><category scheme="http://www.blogger.com/atom/ns#" term="Mathematica" /><title>Let's Make a Deal - Let Monty Rest!</title><content type="html">Some "solved" problems just never go away. Perpetual Motion machines is one example. Another example is the &lt;a href="http://en.wikipedia.org/wiki/Monty_Hall_problem"&gt;Monty Hall Problem&lt;/a&gt;. There is presently a mini-debate in the discussion area of Scientific &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;American's&lt;/span&gt; &lt;a href="http://www.sciam.com/article.cfm?id=how-randomness-rules-our-world"&gt;How Randomness Rules Our World and Why We Cannot See It &lt;/a&gt;with a significant number of adamant doubters of the standard result that states it is better to switch if Monty shows you a goat.&lt;br /&gt;&lt;br /&gt;This problem is amazingly obvious to understand once you analyze it correctly and remove certain ambiguities from the problem statement. Here's my analysis and some &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;Mathematica&lt;/span&gt; simulations to add some weight (as if any is needed).&lt;br /&gt;&lt;br /&gt;Okay, we all can agree that the probability of NOT picking the DREAM VACATION is 2/3, right? There are two GOATS and one DREAM VACATION.&lt;br /&gt;&lt;br /&gt;Now, when Monty shows you the remaining door with a GOAT he just beamed you some very significant information. &lt;em&gt;He's told you that if you picked a GOAT then the &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_2"&gt;probability&lt;/span&gt; of getting a DREAM VACATION is 1 if you switch!  &lt;/em&gt;We already know the probability you picked a GOAT is 2/3 so after he gives you this new info your &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_3"&gt;probability&lt;/span&gt; of winning is now 2/3. So switch for &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;GOAT's&lt;/span&gt; sake!! If you don't switch, your &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_5"&gt;probability&lt;/span&gt; is just 1/3.&lt;br /&gt;&lt;br /&gt;Here is a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;Mathematica&lt;/span&gt; program for the non-believers.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;p&gt;GOAT = 0; (* Goat worth zero *)&lt;br /&gt;VACATION = 1; (* Vacation worth one*)&lt;br /&gt;&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;makePrizes&lt;/span&gt;[] := Module[{},Switch[&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_8"&gt;RandomInteger&lt;/span&gt;[{1,3}],&lt;br /&gt;1,{GOAT,GOAT,VACATION},&lt;br /&gt;2,{GOAT,VACATION,GOAT},&lt;br /&gt;3,{VACATION,GOAT,GOAT}]]&lt;br /&gt;&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_9"&gt;randomPick&lt;/span&gt;[doors_List] := Module[{},&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_10"&gt;RandomInteger&lt;/span&gt;[{1,Length[doors]}]]&lt;br /&gt;&lt;br /&gt;strategy1VS2[trials_Integer] :=&lt;br /&gt;Module[{winnings1=0, winnings2=0, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_11"&gt;firstPick&lt;/span&gt;, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_12"&gt;secondPick&lt;/span&gt;, doors, doors2},&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_13"&gt;SeedRandom&lt;/span&gt;[];&lt;br /&gt;Do[doors = &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_14"&gt;makePrizes&lt;/span&gt;[];&lt;br /&gt;  &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_15"&gt;firstPick&lt;/span&gt; = &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_16"&gt;randomPick&lt;/span&gt;[doors];&lt;br /&gt;  (*winnings of person who keeps first pick*)&lt;br /&gt;  winnings1+= doors[[&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_17"&gt;firstPick&lt;/span&gt;]];&lt;br /&gt;  (*delete first pick from choices*)&lt;br /&gt;  doors2 = Drop[doors,{&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_18"&gt;firstPick&lt;/span&gt;}];&lt;br /&gt;  (*delete goat from remaining*)&lt;br /&gt;  doors2 = Drop[doors2,Position[doors2,GOAT][[1]]];&lt;br /&gt;  (*Always pick remaining prize *)&lt;br /&gt;  &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_19"&gt;secondPick&lt;/span&gt; =doors2[[1]];&lt;br /&gt;  (*winnings of person who switches*)&lt;br /&gt;  winnings2+= &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_20"&gt;secondPick&lt;/span&gt;,{trials}];&lt;br /&gt; {winnings1,winnings2}]&lt;/p&gt;&lt;p&gt;(*Run simulation 10000 times. *)&lt;br /&gt;strategy1VS2[10000]&lt;br /&gt;{3356,6644}&lt;br /&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;The result {3356,6644} means keeping first choice only paid 3356 over 10000 runs but switching paid 6644!&lt;br /&gt;&lt;br /&gt;Now, there are ASSUMPTIONS here (there always are). One assumption is that on each run the position of the prize changes. It turns out that keeping the prize always in any particular door for the entire simulation does not matter (as long as the contestant does not have the information, obviously!)&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;p&gt;strategy1VS2A[trials_Integer,&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_21"&gt;init&lt;/span&gt;_List] :=&lt;br /&gt;Module[{winnings1=0,winnings2=0,&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_22"&gt;firstPick&lt;/span&gt;,&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_23"&gt;secondPick&lt;/span&gt;,doors,doors2},&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_24"&gt;SeedRandom&lt;/span&gt;[];&lt;br /&gt;Do[doors = &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_25"&gt;init&lt;/span&gt;;&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_26"&gt;firstPick&lt;/span&gt; = &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_27"&gt;randomPick&lt;/span&gt;[doors];&lt;br /&gt;(*winnings of person who keeps&lt;br /&gt;first pick*)&lt;br /&gt;winnings1+= doors[[&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_28"&gt;firstPick&lt;/span&gt;]];&lt;br /&gt;(*delete first pick from choices*)&lt;br /&gt;doors2 = Drop[doors,{&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_29"&gt;firstPick&lt;/span&gt;}];&lt;br /&gt;(*delete goat from remaining*)&lt;br /&gt;doors2 = Drop[doors2,Position[doors2,GOAT][[1]]];&lt;br /&gt;(*Always pick remaining prize *)&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_30"&gt;secondPick&lt;/span&gt; =doors2[[1]];&lt;br /&gt;(*winnings of person who switches*)&lt;br /&gt;winnings2+= &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_31"&gt;secondPick&lt;/span&gt;;,{trials}];&lt;br /&gt;{winnings1,winnings2}]&lt;/p&gt;&lt;p&gt;&lt;br /&gt;strategy1VS2A[10000,{GOAT,GOAT,VACATION}]&lt;br /&gt;{3316,6684}&lt;br /&gt;&lt;/p&gt;&lt;p&gt;strategy1VS2A[10000,{GOAT,VACATION,GOAT}]&lt;br /&gt;{3267,6733}&lt;/p&gt;&lt;p&gt;&lt;br /&gt;strategy1VS2A[10000,{GOAT,GOAT,VACATION}]&lt;br /&gt;{3382,6618}&lt;br /&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;br /&gt;The other assumption is that your not forced to switch before seeing the goat. This IS important!!&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;p&gt;strategy1VS2B[trials_Integer] :=&lt;br /&gt;Module[{&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_32"&gt;goatPositions&lt;/span&gt;,&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_33"&gt;pos&lt;/span&gt;,winnings1=0,winnings2=0,&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_34"&gt;firstPick&lt;/span&gt;,&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_35"&gt;secondPick&lt;/span&gt;,doors,doors2},&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_36"&gt;SeedRandom&lt;/span&gt;[];&lt;br /&gt;Do[doors = &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_37"&gt;makePrizes&lt;/span&gt;[];&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_38"&gt;firstPick&lt;/span&gt; = &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_39"&gt;randomPick&lt;/span&gt;[doors];&lt;br /&gt;(*winnings of person who keeps first pick*)&lt;br /&gt;winnings1+= doors[[&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_40"&gt;firstPick&lt;/span&gt;]];&lt;br /&gt;(*delete first pick from choices*)&lt;br /&gt;doors2 = Drop[doors,{&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_41"&gt;firstPick&lt;/span&gt;}];&lt;br /&gt;(*Randomly choose from &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_42"&gt;remaing&lt;/span&gt;*)&lt;br /&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_43"&gt;secondPick&lt;/span&gt; =&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_44"&gt;randomPick&lt;/span&gt;[doors2];&lt;br /&gt;(*winnings of person who switches*)&lt;br /&gt;winnings2+= doors2[[&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_45"&gt;secondPick&lt;/span&gt;]];,{trials}];&lt;br /&gt;{winnings1,winnings2}]&lt;/p&gt;&lt;p&gt;&lt;br /&gt;strategy1VS2B[10000]&lt;br /&gt;{3373,3295}&lt;/p&gt;&lt;/blockquote&gt;&lt;br /&gt;So information has value, Duh!&lt;br /&gt;&lt;br /&gt;So now that you have this information, become a &lt;span class="blsp-spelling-corrected" id="SPELLING_ERROR_46"&gt;believer&lt;/span&gt;, make the switch!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href="http://semanticvector.blogspot.com/feeds/posts/default?alt=rss"&gt;RSS&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/208437074950033830-1431673790876260911?l=semanticvector.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Cogitatio/~4/fuBvsvF5Ias" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://semanticvector.blogspot.com/feeds/1431673790876260911/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=208437074950033830&amp;postID=1431673790876260911" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/1431673790876260911?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/1431673790876260911?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Cogitatio/~3/fuBvsvF5Ias/lets-make-deal-let-monty-rest.html" title="Let's Make a Deal - Let Monty Rest!" /><author><name>Sal Mangano</name><uri>http://www.blogger.com/profile/15017568083854549991</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://2.bp.blogspot.com/_hjRAumdIEoA/SLSwdjKB47I/AAAAAAAAACU/k8AdMap_Mns/S220/headshot.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://semanticvector.blogspot.com/2008/10/lets-make-deal-let-monty-rest.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0IMRH89eCp7ImA9WxRTFkk.&quot;"><id>tag:blogger.com,1999:blog-208437074950033830.post-4770730669050172316</id><published>2008-09-05T15:08:00.002-05:00</published><updated>2008-09-05T15:13:05.160-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-09-05T15:13:05.160-05:00</app:edited><title>Scratched Chrome</title><content type="html">Call me impatient and unreasonable but don't you think the features of &lt;a href="http://www.google.com/tools/firefox/toolbar/FT3/intl/en/index.html"&gt;Google Toolbar&lt;/a&gt; would be available in &lt;a href="http://www.google.com/chrome"&gt;Google Chrome&lt;/a&gt;??? &lt;div class="blogger-post-footer"&gt;&lt;a href="http://semanticvector.blogspot.com/feeds/posts/default?alt=rss"&gt;RSS&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/208437074950033830-4770730669050172316?l=semanticvector.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Cogitatio/~4/RtDm6tGA-xY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://semanticvector.blogspot.com/feeds/4770730669050172316/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=208437074950033830&amp;postID=4770730669050172316" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/4770730669050172316?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/4770730669050172316?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Cogitatio/~3/RtDm6tGA-xY/scratched-chrome.html" title="Scratched Chrome" /><author><name>Sal Mangano</name><uri>http://www.blogger.com/profile/15017568083854549991</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://2.bp.blogspot.com/_hjRAumdIEoA/SLSwdjKB47I/AAAAAAAAACU/k8AdMap_Mns/S220/headshot.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://semanticvector.blogspot.com/2008/09/scratched-chrome.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUUMR3gyeSp7ImA9WxRTEE8.&quot;"><id>tag:blogger.com,1999:blog-208437074950033830.post-361246587251697204</id><published>2008-08-29T10:29:00.003-05:00</published><updated>2008-08-29T11:28:06.691-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-08-29T11:28:06.691-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="humor" /><category scheme="http://www.blogger.com/atom/ns#" term="Mathematica" /><title>Tan of the Kitchen Sink</title><content type="html">In a post on &lt;a href="http://mathforum.org/kb/forum.jspa?forumID=79"&gt;MathForum&lt;/a&gt; I made the mistake of doubting Mathematica could compute the Tan of the Kitchen Sink. It is always a mistake to doubt Mathematica's prowess as &lt;a href="http://www.linkedin.com/pub/4/698/133"&gt;Daniel Lichtblau &lt;/a&gt;of Wolfram pointed out to me:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In[1]:= Tan[Khinchin//Sinc] // N&lt;br /&gt;Out[1]= 0.165514&lt;br /&gt;&lt;br /&gt;I stand corrected!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;p.s.&lt;br /&gt;&lt;br /&gt;It sort of spoils the joke/pun to explain but to non-Mathematca users...&lt;br /&gt;&lt;br /&gt;&lt;a href="http://mathworld.wolfram.com/KhinchinsConstant.html"&gt;Khinchin's constant &lt;/a&gt;is aprox. 2.68545&lt;br /&gt;Sinc[x] = Sin[x]/x&lt;br /&gt;N means "give numeric value"&lt;br /&gt;and // means "use postix" so&lt;br /&gt;this computes N[Tan[Sin[Khinchin]/Khinchin]]&lt;div class="blogger-post-footer"&gt;&lt;a href="http://semanticvector.blogspot.com/feeds/posts/default?alt=rss"&gt;RSS&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/208437074950033830-361246587251697204?l=semanticvector.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Cogitatio/~4/X9hM3xehagI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://semanticvector.blogspot.com/feeds/361246587251697204/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=208437074950033830&amp;postID=361246587251697204" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/361246587251697204?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/361246587251697204?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Cogitatio/~3/X9hM3xehagI/tan-of-kichen-sink.html" title="Tan of the Kitchen Sink" /><author><name>Sal Mangano</name><uri>http://www.blogger.com/profile/15017568083854549991</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://2.bp.blogspot.com/_hjRAumdIEoA/SLSwdjKB47I/AAAAAAAAACU/k8AdMap_Mns/S220/headshot.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://semanticvector.blogspot.com/2008/08/tan-of-kichen-sink.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEEDQHc4cSp7ImA9WxdaGU4.&quot;"><id>tag:blogger.com,1999:blog-208437074950033830.post-8802780727454247374</id><published>2008-08-28T10:14:00.002-05:00</published><updated>2008-08-28T10:17:51.939-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-08-28T10:17:51.939-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="humor" /><category scheme="http://www.blogger.com/atom/ns#" term="Computer Science" /><title>How to mess with Comp Sci Students</title><content type="html">Assignment: Write a compiler that compiles all programs that can't compile themselves.&lt;br /&gt;Extra Credit: Use the compiler to compile assignment.&lt;div class="blogger-post-footer"&gt;&lt;a href="http://semanticvector.blogspot.com/feeds/posts/default?alt=rss"&gt;RSS&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/208437074950033830-8802780727454247374?l=semanticvector.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Cogitatio/~4/Dn2Mkdat5A0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://semanticvector.blogspot.com/feeds/8802780727454247374/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=208437074950033830&amp;postID=8802780727454247374" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/8802780727454247374?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/8802780727454247374?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Cogitatio/~3/Dn2Mkdat5A0/how-to-mess-with-comp-sci-students.html" title="How to mess with Comp Sci Students" /><author><name>Sal Mangano</name><uri>http://www.blogger.com/profile/15017568083854549991</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://2.bp.blogspot.com/_hjRAumdIEoA/SLSwdjKB47I/AAAAAAAAACU/k8AdMap_Mns/S220/headshot.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://semanticvector.blogspot.com/2008/08/how-to-mess-with-comp-sci-students.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D08DRX4_fip7ImA9WxdaGE0.&quot;"><id>tag:blogger.com,1999:blog-208437074950033830.post-1899117474148239255</id><published>2008-08-26T20:40:00.009-05:00</published><updated>2008-08-26T21:57:54.046-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-08-26T21:57:54.046-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term=".NET" /><category scheme="http://www.blogger.com/atom/ns#" term="F#" /><category scheme="http://www.blogger.com/atom/ns#" term="Mathematica" /><title>F# For Scientists Misses the Boat On Mathematica Performance</title><content type="html">I recently purchased &lt;a href="http://www.ffconsultancy.com/products/fsharp_for_scientists/index.html"&gt;F# For Scientists &lt;/a&gt;by Dr. Jon Harrop after the author mentioned it on the &lt;a href="http://mathforum.org/kb/message.jspa?messageID=6346420"&gt;Mathematica Mailing List&lt;/a&gt;. According to Dr. Harrop,&lt;br /&gt;&lt;blockquote&gt;&lt;p&gt;Mathematica's .NET-Link technology allows Mathematica and .NET programs to interoperate seamlessly. Moreover, Microsoft's new functional programming language F# provides many familiar benefits to Mathematica programmers:&lt;br /&gt;The marriage of Mathematica with F# can greatly improve productivity for a wide variety of tasks.&lt;/p&gt;&lt;/blockquote&gt;I am a big fan of Mathematica and functional programming and have been wanting to check out F# for some time so I decided to give the book a shot. It just arrived today so I can't post a full review but I did jump directly to the &lt;em&gt;small&lt;/em&gt; section (&lt;strong&gt;5 pages&lt;/strong&gt;) on using F# with Mathematica.&lt;br /&gt;&lt;br /&gt;What did I learn? Well this section rightly claims that Mathematica has awesome symbolic math capabilities (it does). But then it goes on to claim that F# can beat the pants off of Mathematica on raw calculation. Thus it suggested F# programmers should call out to Mathematica for symbolic integration but then evaluate the result in F# for speed (to the tune of 3.4 times Mathematica's speed). &lt;strong&gt;I was naturally dubious.&lt;/strong&gt; The explanation of this speed up is give as&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;blockquote&gt;The single most important reason for this speed boost is the specialization of the F# code compared to Mathematica's own general purpose term rewriter. ... Moreover, the F# programming language also excels at compiler writing and the JIT-compilation capabilities of the .NET platform make it ideally suited to the construction of custom evaluators that are compiled down to native code before being executed. This approach is typically &lt;strong&gt;orders of magnitude faster&lt;/strong&gt; than evaluation in a standalone generic term rewriting system like Mathematica.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Okay, hold the phone! First off, I did not know the F# language could write compilers. I'll forgive this as poetic use of language. I guess I sort of know what he meant to say. More interesting is that we have gone from 3.7 times to "orders of magnitude". Now, I don't take anything away from the brilliant folks at Microsoft, but the equally brilliant folks at Wolfram have been focusing exclusively on mathematics software for &lt;a href="http://www.wolfram.com/company/scrapbook/"&gt;20 years&lt;/a&gt; and you might think they learned a thing or two about computational speed!&lt;br /&gt;&lt;br /&gt;Here is the example from the book...&lt;br /&gt;&lt;br /&gt;First, he uses Mathematica to integrate a function.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Integrate[Sqrt[Tan[x]],x]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;(-2*ArcTan[1 - Sqrt[2]*Sqrt[Tan[x]]] +&lt;br /&gt;2*ArcTan[1 + Sqrt[2]*Sqrt[Tan[x]]] +&lt;br /&gt;Log[-1 + Sqrt[2]*Sqrt[Tan[x]] - Tan[x]] -&lt;br /&gt;Log[1 + Sqrt[2]*Sqrt[Tan[x]] + Tan[x]])/(2*Sqrt[2])&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;br /&gt;He then goes to show that Mathematica takes 26 secondsto evaluate this function in loop for 360,000 iterations.&lt;br /&gt;&lt;br /&gt;He then shows a translator that converts the Mathematica to F# and the F# code does the same work in 7.595 seconds.&lt;br /&gt;&lt;br /&gt;So far Dr. Harrop is correct but like some many others who are in a rush to show their new favorite language superior to another's, he forgets to read the manual! Particularly, the section on optimization! If he had he would have found a handy little Mathematica function called &lt;strong&gt;Compile. &lt;/strong&gt;Hmm, sounds promising. And in fact....&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;cf = Compile[{{x, _Complex}}, Evaluate[Integrate[Sqrt[Tan[x]],x]]]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Timing[Do[cf[x + y I],{x,-3.0,3.0,0.01},{y,-3.0,3.0,0.01}]]&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;{5.281,Null}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Courier New;"&gt;&lt;/span&gt;&lt;br /&gt;That's &lt;strong&gt;5.281 seconds&lt;/strong&gt; on my relatively underpowered laptop (Thinkpad X60) !&lt;br /&gt;&lt;br /&gt;Some might feel I'm being a bit harsh on Dr. Harrop but after all he made me layout bucks for a book that promised me "many familiar benefits" only to deliver 5 measly pages of half truth. F# programmers may benefit from Mathematica but the jury is still out as to whether the reverse is true.&lt;div class="blogger-post-footer"&gt;&lt;a href="http://semanticvector.blogspot.com/feeds/posts/default?alt=rss"&gt;RSS&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/208437074950033830-1899117474148239255?l=semanticvector.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Cogitatio/~4/Dt7HDo9bFZE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://semanticvector.blogspot.com/feeds/1899117474148239255/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=208437074950033830&amp;postID=1899117474148239255" title="17 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/1899117474148239255?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/1899117474148239255?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Cogitatio/~3/Dt7HDo9bFZE/f-for-scientists-misses-boat-on.html" title="F# For Scientists Misses the Boat On Mathematica Performance" /><author><name>Sal Mangano</name><uri>http://www.blogger.com/profile/15017568083854549991</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://2.bp.blogspot.com/_hjRAumdIEoA/SLSwdjKB47I/AAAAAAAAACU/k8AdMap_Mns/S220/headshot.jpg" /></author><thr:total>17</thr:total><feedburner:origLink>http://semanticvector.blogspot.com/2008/08/f-for-scientists-misses-boat-on.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEMHRH0-fSp7ImA9WxdaFkU.&quot;"><id>tag:blogger.com,1999:blog-208437074950033830.post-8493549247734684167</id><published>2008-08-25T12:37:00.005-05:00</published><updated>2008-08-25T12:47:15.355-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-08-25T12:47:15.355-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Mathematics" /><title>Drilling Square Holes</title><content type="html">One of the fringe benefits of working on a book is all the tidbits of knowledge you come across while doing research. While working on the graphics chapters I cam across a shape known as a &lt;a href="http://mathworld.wolfram.com/ReuleauxTriangle.html"&gt;Reuleaux triangle&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_hjRAumdIEoA/SLLvY3ue9RI/AAAAAAAAACI/35hxI6reUL8/s1600-h/ReuleauxTriangle.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5238512527140123922" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_hjRAumdIEoA/SLLvY3ue9RI/AAAAAAAAACI/35hxI6reUL8/s320/ReuleauxTriangle.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_hjRAumdIEoA/SLLvGwJL-VI/AAAAAAAAACA/FRlJTPRvJJU/s1600-h/ReuleauxTriangle.png"&gt;&lt;/a&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;It turns out that this shape is the key to doing what on the surface may seem impossible, &lt;a href="http://upper.us.edu/faculty/smith/reuleaux.htm"&gt;Drilling a nearly square hole&lt;/a&gt;.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href="http://semanticvector.blogspot.com/feeds/posts/default?alt=rss"&gt;RSS&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/208437074950033830-8493549247734684167?l=semanticvector.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Cogitatio/~4/55PPS6fKZzs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://semanticvector.blogspot.com/feeds/8493549247734684167/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=208437074950033830&amp;postID=8493549247734684167" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/8493549247734684167?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/8493549247734684167?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Cogitatio/~3/55PPS6fKZzs/drilling-square-holes.html" title="Drilling Square Holes" /><author><name>Sal Mangano</name><uri>http://www.blogger.com/profile/15017568083854549991</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://2.bp.blogspot.com/_hjRAumdIEoA/SLSwdjKB47I/AAAAAAAAACU/k8AdMap_Mns/S220/headshot.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_hjRAumdIEoA/SLLvY3ue9RI/AAAAAAAAACI/35hxI6reUL8/s72-c/ReuleauxTriangle.png" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://semanticvector.blogspot.com/2008/08/drilling-square-holes.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkIESXczfSp7ImA9WxdUEUw.&quot;"><id>tag:blogger.com,1999:blog-208437074950033830.post-4496753110459339119</id><published>2008-07-26T18:08:00.002-05:00</published><updated>2008-07-26T18:21:48.985-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-26T18:21:48.985-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Evolution" /><category scheme="http://www.blogger.com/atom/ns#" term="software development" /><category scheme="http://www.blogger.com/atom/ns#" term="Mathematica" /><title>A Biological Programming Language</title><content type="html">I've often said to friends that if I could start my career over again I would go into biology instead of computer science. Now, perhaps, there is a way to have a foot in both worlds.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.littleb.org/"&gt;Little b&lt;/a&gt; is a programming language for modeling biological systems. Quoting from the languages site...&lt;br /&gt;&lt;blockquote&gt;The little b project is an effort to provide an open source language which&lt;br /&gt;allows scientists to build mathematical models of complex systems. The&lt;br /&gt;initial focus is systems biology. The goal is to stimulate widespread sharing&lt;br /&gt;and reuse of models. The little b language to allow biologists to build&lt;br /&gt;models quickly and easily from shared parts, and to allow theorists to program&lt;br /&gt;new ways of describing complex systems.&lt;/blockquote&gt;&lt;blockquote&gt;&lt;p&gt;&lt;br /&gt;Currently, libraries have been developed for building ODE models of&lt;br /&gt;molecular networks in multi-compartment systems such as cellular epithelia.&lt;br /&gt;Aneil Mallavarapu is the author and inventor of little b, and runs the&lt;br /&gt;project. Little b is based in Common Lisp and contains mechanisms for rule-based&lt;br /&gt;reasoning, symbolic mathematics and object-oriented definitions. The syntax is&lt;br /&gt;designed to be terse and human-readable to facilitate communication. The&lt;br /&gt;environment is both interactive and compilable.&lt;/p&gt;&lt;/blockquote&gt;Makes me wonder if &lt;a href="http://www.wolfram.com/"&gt;Mathematica &lt;/a&gt;would be a good enviornment for similar exploration but with more sophisticated tools already built in.&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href="http://semanticvector.blogspot.com/feeds/posts/default?alt=rss"&gt;RSS&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/208437074950033830-4496753110459339119?l=semanticvector.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Cogitatio/~4/1mYsMC6znpE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://semanticvector.blogspot.com/feeds/4496753110459339119/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=208437074950033830&amp;postID=4496753110459339119" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/4496753110459339119?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/4496753110459339119?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Cogitatio/~3/1mYsMC6znpE/biological-programming-language.html" title="A Biological Programming Language" /><author><name>Sal Mangano</name><uri>http://www.blogger.com/profile/15017568083854549991</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://2.bp.blogspot.com/_hjRAumdIEoA/SLSwdjKB47I/AAAAAAAAACU/k8AdMap_Mns/S220/headshot.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://semanticvector.blogspot.com/2008/07/biological-programming-language.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C08CSHw4fip7ImA9WxdVF0k.&quot;"><id>tag:blogger.com,1999:blog-208437074950033830.post-8193507239030335897</id><published>2008-07-22T10:48:00.002-05:00</published><updated>2008-07-22T10:51:09.236-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-22T10:51:09.236-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="science" /><title>I was simply awed by this TED presentation</title><content type="html">You will never think the same about &lt;a href="http://www.ted.com/index.php/talks/paul_stamets_on_6_ways_mushrooms_can_save_the_world.html"&gt;mushrooms &lt;/a&gt;again.&lt;div class="blogger-post-footer"&gt;&lt;a href="http://semanticvector.blogspot.com/feeds/posts/default?alt=rss"&gt;RSS&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/208437074950033830-8193507239030335897?l=semanticvector.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Cogitatio/~4/wxMyKPNSMTk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://semanticvector.blogspot.com/feeds/8193507239030335897/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=208437074950033830&amp;postID=8193507239030335897" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/8193507239030335897?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/8193507239030335897?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Cogitatio/~3/wxMyKPNSMTk/i-was-simply-awed-by-this-ted.html" title="I was simply awed by this TED presentation" /><author><name>Sal Mangano</name><uri>http://www.blogger.com/profile/15017568083854549991</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://2.bp.blogspot.com/_hjRAumdIEoA/SLSwdjKB47I/AAAAAAAAACU/k8AdMap_Mns/S220/headshot.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://semanticvector.blogspot.com/2008/07/i-was-simply-awed-by-this-ted.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEIFRn49cSp7ImA9WxdVFE8.&quot;"><id>tag:blogger.com,1999:blog-208437074950033830.post-6423153238288601899</id><published>2008-07-18T14:41:00.008-05:00</published><updated>2008-07-18T19:15:17.069-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-18T19:15:17.069-05:00</app:edited><title>Find the next row. Win $25</title><content type="html">&lt;p&gt;Each row below is produced by a definite rule. What is the next row and what is the rule? $25 Prize to the first person who posts the answer in the comments or emails me at [s m a n g a n o [at] i n t o - t e c h n o l o g y [dot] c o m]. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;3&lt;br /&gt;4&lt;br /&gt;5&lt;br /&gt;5,3&lt;br /&gt;6,4&lt;br /&gt;7&lt;br /&gt;7,4,1&lt;br /&gt;7,5,1&lt;br /&gt;8,3&lt;br /&gt;8,6&lt;br /&gt;8,6,3&lt;br /&gt;9,4&lt;br /&gt;9,5,3&lt;br /&gt;9,6,1&lt;br /&gt;9,7&lt;br /&gt;9,7,5,1&lt;br /&gt;10,4,1&lt;br /&gt;10,5,1&lt;br /&gt;10,6,4,1&lt;br /&gt;10,7,4&lt;br /&gt;10,7,5&lt;br /&gt;10,8,4&lt;br /&gt;10,8,5,3&lt;br /&gt;11&lt;br /&gt;11,6&lt;br /&gt;11,6,4,1&lt;br /&gt;11,7,1&lt;br /&gt;11,7,5&lt;br /&gt;11,7,5,3&lt;br /&gt;11,8,4&lt;br /&gt;11,9,4,1&lt;br /&gt;11,9,6&lt;br /&gt;11,9,7,1&lt;br /&gt;11,9,7,4&lt;br /&gt;12,5&lt;br /&gt;12,5,3&lt;br /&gt;12,7&lt;br /&gt;12,7,5,1&lt;br /&gt;12,8,3&lt;br /&gt;12,8,6&lt;br /&gt;12,9,1&lt;br /&gt;12,9,4&lt;br /&gt;12,9,7&lt;br /&gt;12,9,7,3&lt;br /&gt;12,9,7,5,1&lt;br /&gt;12,10&lt;br /&gt;12,10,6,4,1&lt;br /&gt;12,10,8,4&lt;br /&gt;12,10,8,5,3&lt;br /&gt;12,10,8,6,1&lt;br /&gt;13&lt;br /&gt;13,5,1&lt;br /&gt;13,6&lt;br /&gt;13,7,5&lt;br /&gt;13,8,4&lt;br /&gt;13,8,6,1&lt;br /&gt;13,9,3&lt;br /&gt;13,9,4,1&lt;br /&gt;13,9,6,3&lt;br /&gt;13,9,7,1&lt;br /&gt;13,9,7,4&lt;br /&gt;13,10,5&lt;br /&gt;13,10,7,5,1&lt;br /&gt;13,10,8,3&lt;br /&gt;13,10,8,4,1&lt;br /&gt;13,10,8,6&lt;br /&gt;13,11,6,1&lt;br /&gt;13,11,7,3&lt;br /&gt;13,11,8,4,1&lt;br /&gt;13,11,8,5,1&lt;br /&gt;13,11,8,6,3&lt;br /&gt;13,11,9,4&lt;br /&gt;13,11,9,6,4&lt;br /&gt;13,11,9,7,4,1&lt;br /&gt;14,3&lt;br /&gt;14,5,1&lt;br /&gt;14,6,4,1&lt;br /&gt;14,7,5,3&lt;br /&gt;14,8,4&lt;br /&gt;14,8,6,4&lt;br /&gt;14,9,6&lt;br /&gt;14,9,6,3&lt;br /&gt;14,9,7,5,3&lt;br /&gt;14,10,1&lt;br /&gt;14,10,5,3&lt;br /&gt;14,10,6,4&lt;br /&gt;14,10,7,4,1&lt;br /&gt;14,10,8,4,1&lt;br /&gt;14,10,8,6&lt;br /&gt;14,10,8,6,3&lt;br /&gt;14,11,1&lt;br /&gt;14,11,7&lt;br /&gt;14,11,8&lt;br /&gt;14,11,8,4,1&lt;br /&gt;14,11,8,6,4,1&lt;br /&gt;14,11,9,4&lt;br /&gt;14,11,9,6,1&lt;br /&gt;14,12&lt;br /&gt;14,12,3&lt;br /&gt;14,12,7,5,3&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;a href="http://semanticvector.blogspot.com/feeds/posts/default?alt=rss"&gt;RSS&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/208437074950033830-6423153238288601899?l=semanticvector.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Cogitatio/~4/twviqy8leAk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://semanticvector.blogspot.com/feeds/6423153238288601899/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=208437074950033830&amp;postID=6423153238288601899" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/6423153238288601899?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/6423153238288601899?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Cogitatio/~3/twviqy8leAk/find-next-row-win-25.html" title="Find the next row. Win $25" /><author><name>Sal Mangano</name><uri>http://www.blogger.com/profile/15017568083854549991</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://2.bp.blogspot.com/_hjRAumdIEoA/SLSwdjKB47I/AAAAAAAAACU/k8AdMap_Mns/S220/headshot.jpg" /></author><thr:total>3</thr:total><feedburner:origLink>http://semanticvector.blogspot.com/2008/07/find-next-row-win-25.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C08MRHY5cSp7ImA9WxdVEk8.&quot;"><id>tag:blogger.com,1999:blog-208437074950033830.post-1025410042953300541</id><published>2008-07-16T10:21:00.002-05:00</published><updated>2008-07-16T10:24:45.829-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-07-16T10:24:45.829-05:00</app:edited><title>O'Reilly Books Now On Kindle</title><content type="html">O'Reilly just &lt;a href="http://toc.oreilly.com/2008/07/30-oreilly-titles-now-available-as-ebook-bundles.html"&gt;started making some book available for Kindle &lt;/a&gt;and other readers.&lt;br /&gt;&lt;br /&gt;This is greate news!&lt;div class="blogger-post-footer"&gt;&lt;a href="http://semanticvector.blogspot.com/feeds/posts/default?alt=rss"&gt;RSS&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/208437074950033830-1025410042953300541?l=semanticvector.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Cogitatio/~4/OotJ_7Nlk5U" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://semanticvector.blogspot.com/feeds/1025410042953300541/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=208437074950033830&amp;postID=1025410042953300541" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/1025410042953300541?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/1025410042953300541?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Cogitatio/~3/OotJ_7Nlk5U/oreilly-books-now-on-kindle.html" title="O'Reilly Books Now On Kindle" /><author><name>Sal Mangano</name><uri>http://www.blogger.com/profile/15017568083854549991</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://2.bp.blogspot.com/_hjRAumdIEoA/SLSwdjKB47I/AAAAAAAAACU/k8AdMap_Mns/S220/headshot.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://semanticvector.blogspot.com/2008/07/oreilly-books-now-on-kindle.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUANRnYzeip7ImA9WxdREks.&quot;"><id>tag:blogger.com,1999:blog-208437074950033830.post-2839075166211949905</id><published>2008-05-31T15:03:00.004-05:00</published><updated>2008-05-31T16:03:17.882-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-05-31T16:03:17.882-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="WISDI" /><category scheme="http://www.blogger.com/atom/ns#" term="AI" /><category scheme="http://www.blogger.com/atom/ns#" term="Semantic Web" /><category scheme="http://www.blogger.com/atom/ns#" term="Mathematica" /><title>Semantic Vectors Revisited (for 31 bucks!)</title><content type="html">Its been a while since I posted (been busy writing my new book) and even longer since I've posted any ideas related to my ideas on using concepts from linear algebra to model intelligence. But I thought I'd share an experience that makes me wonder how anything got done before the WWW!&lt;br /&gt;&lt;br /&gt;While doing research on &lt;a href="http://en.wikipedia.org/wiki/Tensor"&gt;tensors &lt;/a&gt;for my book I came across a book called &lt;a href="http://smc.vnet.net/MathTensorBook.html"&gt;&lt;em&gt;&lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;MathTensor&lt;/span&gt;:&lt;/em&gt; &lt;em&gt;A System for Doing Tensor Analysis by Computer&lt;/em&gt;&lt;/a&gt;. This book describes software for Tensor Math developed using &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;Mathematica&lt;/span&gt; so it instantly caught my interest. This lead me to one of the author's web sites which lead me to an article &lt;a href="http://matrixcognition.com/TENSOR01.HTM"&gt;&lt;em&gt;Tensor Analysis of Matrix Cognition during Medical Decision-Making.&lt;/em&gt;&lt;/a&gt; Now you can't put the words &lt;em&gt;matrix&lt;/em&gt; and &lt;em&gt;cognition&lt;/em&gt; next to each other without getting my immediate attention so I jumped to that essay which ultimately lead me to this gem: &lt;em&gt;A scaling method for priorities in hierarchical structures &lt;/em&gt;by&lt;br /&gt;Thomas L. &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;Sattay&lt;/span&gt; written in the Journal Mathematical Psychology 1977; 15:234-281 (there is no online version but you can buy a &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_3"&gt;PDF&lt;/span&gt; copy at &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_4"&gt;ScienceDirect&lt;/span&gt; if you are willing to part with $31.&lt;br /&gt;&lt;br /&gt;I found this research to be fascinating and gave me much food for thought that I'll try to share when I have more time. For now I'd only like to make the following rather obvious observation. If it was not for the web, there would be close to zero chance that I would have found this article and an even smaller chance I would be reading it within 15 &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_5"&gt;mins&lt;/span&gt; of finding it. The only sad part is that it is locked up in some obscure journal that I did not have immediate access to without parting with the cost of a nice dinner. I think publishers of journals need to catch up with the rest of the world and begin opening up their older content to free access. Clearly they can use advertising to subsidize this but perhaps advertisement driven business models have reached a point of saturation. Perhaps its time for a library based approach to become &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_6"&gt;virtualized&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;I am sure I could find a library within a reasonable vicinity of my home that had access to this journal but who has the time! Why not offer a version that rather than costing $31 to keep forever, costs me $1 to read for a day and $0.50 for each additional day. &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_7"&gt;DRM&lt;/span&gt; technology is certainly good enough to make this work. And I am guessing that the publishers would make more money than by waiting for someone like me who was motivated enough to part with $31. There is a vast amount of lost knowledge hiding in these journals. History has shown that the world benefits greatly when such knowledge is serendipitously rediscovered (think Gregor Mendel and his Bean Plants). Its time to unlock the vaults of knowledge so creativity and discovery can reach new unimagined heights!&lt;div class="blogger-post-footer"&gt;&lt;a href="http://semanticvector.blogspot.com/feeds/posts/default?alt=rss"&gt;RSS&lt;/a&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/208437074950033830-2839075166211949905?l=semanticvector.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/Cogitatio/~4/xTIYGNTm0Fk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://semanticvector.blogspot.com/feeds/2839075166211949905/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=208437074950033830&amp;postID=2839075166211949905" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/2839075166211949905?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/208437074950033830/posts/default/2839075166211949905?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Cogitatio/~3/xTIYGNTm0Fk/sematic-vectors-revisited.html" title="Semantic Vectors Revisited (for 31 bucks!)" /><author><name>Sal Mangano</name><uri>http://www.blogger.com/profile/15017568083854549991</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="http://2.bp.blogspot.com/_hjRAumdIEoA/SLSwdjKB47I/AAAAAAAAACU/k8AdMap_Mns/S220/headshot.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://semanticvector.blogspot.com/2008/05/sematic-vectors-revisited.html</feedburner:origLink></entry></feed>

