<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: Hello's Code Snippets</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Fri, 25 Jul 2008 07:45:13 GMT</pubDate>
    <description>DZone Snippets: Hello's Code Snippets</description>
    <item>
      <title>Calculate Eigenvalues of a given matrix m.</title>
      <link>http://snippets.dzone.com/posts/show/340</link>
      <description>&lt;code&gt;&lt;br /&gt;&gt; sm &lt;- eigen(m, sym=TRUE)&lt;br /&gt;&gt; V &lt;- sm$vectors&lt;br /&gt;&gt; t(V) %*% V&lt;br /&gt;&gt; V %*% diag(sm$values) %*% t(V)&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Fri, 27 May 2005 01:19:52 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/340</guid>
      <author>hello (hello)</author>
    </item>
    <item>
      <title>Delete particular rows from matrix.</title>
      <link>http://snippets.dzone.com/posts/show/339</link>
      <description>&lt;code&gt;&lt;br /&gt;&gt; x &lt;- matrix(1:10,,2)&lt;br /&gt;&gt; x[x[,1]%in%c(2,3),]&lt;br /&gt;&gt; x[!x[,1]%in%c(2,3),]&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;from Peter Malewski or from Peter Dalgaard:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&gt; mat[!(mat$first %in% 713:715),]&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Fri, 27 May 2005 01:16:32 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/339</guid>
      <author>hello (hello)</author>
    </item>
    <item>
      <title>Create a multidimensional matrix.</title>
      <link>http://snippets.dzone.com/posts/show/338</link>
      <description>Brian Ripley said:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&gt; my.array&lt;-array(0,dim=c(10,5,6,8))&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;will give you a 4-dimensional 10 x 5 x 6 x 8 array.&lt;br /&gt;&lt;br /&gt;Or&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&gt; array.test &lt;- array(1:64,c(4,4,4))&lt;br /&gt;&gt; array.test[1,1,1]&lt;br /&gt;&gt; 1&lt;br /&gt;&gt; array.test[4,4,4]&lt;br /&gt;&gt; 64&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;</description>
      <pubDate>Fri, 27 May 2005 01:04:30 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/338</guid>
      <author>hello (hello)</author>
    </item>
    <item>
      <title>Create an identity matrix.</title>
      <link>http://snippets.dzone.com/posts/show/337</link>
      <description>&lt;code&gt;&lt;br /&gt;&gt; diag(n)&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Or the long way:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&gt; n&lt;-c(5)&lt;br /&gt;&gt; I &lt;- matrix(0,nrow=n,ncol=n)&lt;br /&gt;&gt; I[row(I)==col(I)] &lt;- 1&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;</description>
      <pubDate>Fri, 27 May 2005 01:02:41 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/337</guid>
      <author>hello (hello)</author>
    </item>
    <item>
      <title>Create a vector, append values.</title>
      <link>http://snippets.dzone.com/posts/show/336</link>
      <description>To create a mathematical vector, you can just initialize a column of numbers with c(). As long as all of your input is of the same type, you don't hit any snags. Note the is.vector() function will say this is a vector:&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&gt; v &lt;- c(1, 2, 3) &lt;br /&gt;&gt; is.vector(v) &lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Fri, 27 May 2005 00:59:35 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/336</guid>
      <author>hello (hello)</author>
    </item>
    <item>
      <title>Remove a trailing pathname component, leaving the head</title>
      <link>http://snippets.dzone.com/posts/show/335</link>
      <description>&lt;code&gt;&lt;br /&gt;  $ echo =ls(:h)&lt;br /&gt;  /bin&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Fri, 27 May 2005 00:57:15 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/335</guid>
      <author>hello (hello)</author>
    </item>
    <item>
      <title>Hello World - C</title>
      <link>http://snippets.dzone.com/posts/show/334</link>
      <description>&lt;code&gt;&lt;br /&gt;#include &lt;stdio.h&gt;&lt;br /&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;  for(;;)&lt;br /&gt;      { &lt;br /&gt;          printf ("Hello World!\n");&lt;br /&gt;      }&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Fri, 27 May 2005 00:44:45 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/334</guid>
      <author>hello (hello)</author>
    </item>
  </channel>
</rss>
