<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1269606243168807310</id><updated>2026-04-24T23:27:58.093-07:00</updated><category term="work"/><category term="Mac OS X"/><category term="howto"/><category term="Ruby"/><category term="Windows"/><category term="scripting"/><category term="Linux"/><category term="NumPy"/><category term="Python"/><category term="testing"/><category term="Testlink"/><category term="Unix"/><category term="VirtualBox"/><category term="books"/><category term="git"/><category term="pandas"/><category term="Cygwin"/><category term="DOS"/><category term="Kindle"/><category term="Perl"/><category term="STAF"/><category term="STAF STAX scripting"/><category term="Solaris"/><category term="Twitter"/><category term="XP"/><category term="agile"/><category term="howto blogging"/><category term="humor"/><category term="svn"/><category term="virtualization"/><title type='text'>Geeky Thought Bubbles</title><subtitle type='html'>Geeky things. Like computers, data, and stuff</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://geekythoughtbubbles.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://geekythoughtbubbles.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Cynthia Sadler</name><uri>http://www.blogger.com/profile/06002305775627177465</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF5ySKaREXNbnCrrIOQQ9uf8TOmIv1Qzqpsh8PExkNNOcHDqpVJi1-8OClnjjwQSGLxRuFlfwHj6Qzt839ZvNR_cQgi2yP2xEUsn_cGLtLtNJ4US7rFmkCoXXA_vIxzZw/s113/barisax.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>49</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1269606243168807310.post-2189193433597098538</id><published>2019-02-09T09:37:00.000-08:00</published><updated>2019-02-09T09:39:54.632-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="scripting"/><category scheme="http://www.blogger.com/atom/ns#" term="Unix"/><title type='text'>Quick and dirty histogram with Unix commands: cut, sort, uniq</title><content type='html'>&lt;h2&gt;
Introduction&lt;/h2&gt;
&lt;div&gt;
There are many occasions, usually daily, when I need to know a distribution of a field in a CSV. I can calculate this with many tools, such as Excel, R, or Python. One such way that you might not readily think of is doing this with Unix command line tools. This is useful because sometimes I don&#39;t need to write a script, I just want a quick and dirty way to look at the distribution. In this article, I&#39;ll show you how to do this.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h2&gt;
Cut command&lt;/h2&gt;
&lt;div&gt;
The first step in this task is to isolate the field we are interested in. Let&#39;s look at an example CSV file, with three fields:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;style type=&quot;text/css&quot;&gt;
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Menlo; color: #ffffff; background-color: #2b66c9}
span.s1 {font-variant-ligatures: no-common-ligatures}
&lt;/style&gt;


&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;$ cat example.csv&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;ID,fruit,yes_no&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;1,apple,yes&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;2,apple,yes&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;3,banana,yes&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;4,apple,yes&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;5,banana,no&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;6,orange,no&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;7,apple,no&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;8,orange,no&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;9,apple,no&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;10,apple,no&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;11,apple,yes&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;12,apple,no&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;13,banana,no&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;14,orange,no&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;15,apple,no&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
The field I&#39;m interested in examining is the fruit field. Let&#39;s first isolate that with the &lt;b&gt;cut&lt;/b&gt;&amp;nbsp;command. The &lt;b&gt;-f&lt;/b&gt; option is the field number, and in this case we use 2 for the second (1-based indexing of the columns). The &lt;b&gt;-d&lt;/b&gt; option is the delimiter, and since this is a CSV file, we use &#39;,&#39;.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;style type=&quot;text/css&quot;&gt;
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Menlo; color: #ffffff; background-color: #2b66c9}
span.s1 {font-variant-ligatures: no-common-ligatures}
&lt;/style&gt;


&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;$ cut -f 2 -d &#39;,&#39; example.csv&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;fruit&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;apple&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;apple&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;banana&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;apple&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;banana&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;orange&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;apple&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;orange&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;apple&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;apple&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;apple&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;apple&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;banana&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;orange&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;apple&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;h2&gt;
Tail command&amp;nbsp;&lt;/h2&gt;
&lt;/div&gt;
&lt;div&gt;
This has one problem: we don&#39;t need the column header, so let&#39;s skip that with the &lt;b&gt;tail&lt;/b&gt;&amp;nbsp;command. Tail gets us the end of the file, and we want to start on line 2, so we pass in &lt;b&gt;-n +2&lt;/b&gt;. Then we pass those results from tail to cut using the pipe (&#39;|&#39;). Now we have the values in the fruit column, but without the fruit header.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;style type=&quot;text/css&quot;&gt;
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Menlo; color: #ffffff; background-color: #2b66c9}
span.s1 {font-variant-ligatures: no-common-ligatures}
&lt;/style&gt;


&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;$ tail -n +2 example.csv | cut -f 2 -d &#39;,&#39;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;apple&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;apple&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;banana&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;apple&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;banana&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;orange&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;apple&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;orange&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;apple&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;apple&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;apple&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;apple&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;banana&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;orange&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;apple&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;h2&gt;
Sort command&lt;/h2&gt;
&lt;/div&gt;
&lt;div&gt;
Now let&#39;s sort the values with the &lt;b&gt;sort&lt;/b&gt;&amp;nbsp;command:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;style type=&quot;text/css&quot;&gt;
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Menlo; color: #ffffff; background-color: #2b66c9}
span.s1 {font-variant-ligatures: no-common-ligatures}
&lt;/style&gt;


&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;$ tail -n +2 example.csv | cut -f 2 -d &#39;,&#39; | sort&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;apple&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;apple&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;apple&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;apple&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;apple&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;apple&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;apple&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;apple&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;apple&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;banana&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;banana&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;banana&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;orange&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;orange&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;orange&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;h2&gt;
Uniq command&lt;/h2&gt;
&lt;/div&gt;
&lt;div&gt;
Then we can use the &lt;b&gt;uniq&lt;/b&gt;&amp;nbsp;command with the &lt;b&gt;-c&lt;/b&gt;&amp;nbsp;option to count the unique instances:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;style type=&quot;text/css&quot;&gt;
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Menlo; color: #ffffff; background-color: #2b66c9}
span.s1 {font-variant-ligatures: no-common-ligatures}
&lt;/style&gt;


&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;$ tail -n +2 example.csv | cut -f 2 -d &#39;,&#39; | sort | uniq -c&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;9 apple&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;3 banana&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;3 orange&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://geekythoughtbubbles.blogspot.com/feeds/2189193433597098538/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1269606243168807310/2189193433597098538' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/2189193433597098538'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/2189193433597098538'/><link rel='alternate' type='text/html' href='http://geekythoughtbubbles.blogspot.com/2019/02/quick-and-dirty-histogram-with-unix.html' title='Quick and dirty histogram with Unix commands: cut, sort, uniq'/><author><name>Cynthia Sadler</name><uri>http://www.blogger.com/profile/06002305775627177465</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF5ySKaREXNbnCrrIOQQ9uf8TOmIv1Qzqpsh8PExkNNOcHDqpVJi1-8OClnjjwQSGLxRuFlfwHj6Qzt839ZvNR_cQgi2yP2xEUsn_cGLtLtNJ4US7rFmkCoXXA_vIxzZw/s113/barisax.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1269606243168807310.post-5108732985413796336</id><published>2019-02-02T19:07:00.001-08:00</published><updated>2019-02-02T19:07:56.331-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="NumPy"/><category scheme="http://www.blogger.com/atom/ns#" term="pandas"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><title type='text'>Using cut to bin data in pandas dataframe</title><content type='html'>&lt;style type=&quot;text/css&quot;&gt;
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 16.0px Monaco; color: #000000}
span.s1 {font-variant-ligatures: no-common-ligatures}
&lt;/style&gt;


&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;In this tutorial, we will explore how to bin data in a pandas DataFrame using the &lt;b&gt;cut&lt;/b&gt; function.&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;span class=&quot;s1&quot;&gt;What is binning?&lt;/span&gt;&lt;/h3&gt;
&lt;div&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
Binning is a way to group data into smaller containers called bins. For example, in surveys, an age question might collect data into ranges. An example of age bins might be: 0 - 25, 25 - 34, 35 - 49, 50 - 70, 70+.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
Tutorial&lt;/h3&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
Let&#39;s see how we can bin data using the pandas &lt;b&gt;cut&lt;/b&gt; function.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
First we import the &lt;b&gt;pandas&lt;/b&gt; and &lt;b&gt;numpy&lt;/b&gt; libraries. We&#39;ll use numpy to generate some sample data.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;script src=&quot;https://gist.github.com/spicasax/124970eefdad1c56a6fdfc2b38464fab.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Now let&#39;s generate 1000 random samples using the &lt;b&gt;random.normal&lt;/b&gt; function. This will be the data that we plan to bin. In the normal function, we pass in three arguments:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;loc&lt;/b&gt; - the mean of the normal distribution&lt;/li&gt;
&lt;li&gt;&lt;b&gt;scale&lt;/b&gt; - standard deviation&lt;/li&gt;
&lt;li&gt;&lt;b&gt;size&lt;/b&gt; - numer of samples in the returned numpy array&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
In our case, we want 1000 samples, but we&#39;ll only print out the first 10 samples as a sanity check of the data.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;script src=&quot;https://gist.github.com/spicasax/909a703864ffc655dad2fe6de6243ffc.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;
&lt;div&gt;
&lt;script src=&quot;https://gist.github.com/spicasax/00472a85e3e103ca7e83b68c142b9e82.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Next we generate some fake labels to pretend we have a binary classification. We will not be binning this data, but it is just for example. Again, we&#39;ll print out the first 10 samples only to sanity check it.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;script src=&quot;https://gist.github.com/spicasax/d1d6717892a9c014c81258ea932c90fd.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;
&lt;div&gt;
&lt;script src=&quot;https://gist.github.com/spicasax/c2beb036761b4aad087a9483020d3a46.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Let&#39;s put these two arrays together to form a pandas DataFrame:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;script src=&quot;https://gist.github.com/spicasax/37b4b6bea9ede7f5cf598e13cb5722e8.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;
&lt;div&gt;
&lt;script src=&quot;https://gist.github.com/spicasax/6a7da783b8b980314e3c6492fea1faee.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
To create our bins, we use the &lt;b&gt;linspace&lt;/b&gt; function in numpy to generate an array of evenly spaced numbers. The arguments for linspace are:&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;start - first number in our array&lt;/li&gt;
&lt;li&gt;stop - last number in our array&lt;/li&gt;
&lt;li&gt;num - how many numbers in our array&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;script src=&quot;https://gist.github.com/spicasax/15f5c7953163ee7d1534e753d2e74ee3.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;script src=&quot;https://gist.github.com/spicasax/d660bb3831e1dcdc287e879cb869a76a.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Now we can indicate which sample is in which bin with the &lt;b&gt;cut&lt;/b&gt; function in pandas. We will bin the samples column, using the hist_bins values to indicate the actual bin boundaries. Note that I am also passing in &lt;b&gt;right=False&lt;/b&gt; to indicate that the right boundary of each bin is open. If you want the right side to be closed and the left side to be open, pass in &lt;b&gt;True&lt;/b&gt;.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;script src=&quot;https://gist.github.com/spicasax/f1865b5e5172539267e89f8984193ee0.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;
&lt;div&gt;
&lt;script src=&quot;https://gist.github.com/spicasax/395bd97c2c3957d8c21c3b8f93f038a8.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
Where binning becomes useful is when we want to apply some operation on it. For our example, let&#39;s do a &lt;b&gt;groupby&lt;/b&gt; operation on the bins and then aggregate the labels data by performing a &lt;b&gt;count&lt;/b&gt; operation it. Then we can do a &lt;b&gt;cumsum&lt;/b&gt;&amp;nbsp;(cumulative sum) on the labels count.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
This is all a contrived example, of course, to give you ideas for your specific use case.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;script src=&quot;https://gist.github.com/spicasax/d3a75f7894cfc680c95547f5a27c1e57.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;
&lt;div&gt;
&lt;script src=&quot;https://gist.github.com/spicasax/476fa8ae5fd90c79e55a18e6045c8740.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;
&lt;h3&gt;
Summary&lt;/h3&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
In this article, we learned how to bin our data using the pandas &lt;b&gt;cut&lt;/b&gt;&amp;nbsp;function, so that we could later perform some aggregate operations on the data. I hope you found this tutorial useful.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://geekythoughtbubbles.blogspot.com/feeds/5108732985413796336/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1269606243168807310/5108732985413796336' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/5108732985413796336'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/5108732985413796336'/><link rel='alternate' type='text/html' href='http://geekythoughtbubbles.blogspot.com/2019/02/using-cut-to-bin-data-in-pandas_2.html' title='Using cut to bin data in pandas dataframe'/><author><name>Cynthia Sadler</name><uri>http://www.blogger.com/profile/06002305775627177465</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF5ySKaREXNbnCrrIOQQ9uf8TOmIv1Qzqpsh8PExkNNOcHDqpVJi1-8OClnjjwQSGLxRuFlfwHj6Qzt839ZvNR_cQgi2yP2xEUsn_cGLtLtNJ4US7rFmkCoXXA_vIxzZw/s113/barisax.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1269606243168807310.post-9203816094395230542</id><published>2019-02-01T19:16:00.001-08:00</published><updated>2019-02-02T19:07:42.115-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="NumPy"/><category scheme="http://www.blogger.com/atom/ns#" term="pandas"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><title type='text'>Applying functions to a groupby of a pandas dataframe</title><content type='html'>&lt;div style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin-top: 1em;&quot;&gt;
In this article, I&#39;m giving a few examples on applying functions as part of the &quot;groupby&quot; in pandas.&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin-top: 1em;&quot;&gt;
To start, think of the groupby function as the equivalent to a Pivot in Excel. In the Excel, a pivot allows you to summarize data, usually with a&amp;nbsp;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;COUNT, SUM&lt;/strong&gt;&amp;nbsp;or&amp;nbsp;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;MEAN&lt;/strong&gt;&amp;nbsp;function.&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin-top: 1em;&quot;&gt;
In pandas, the&amp;nbsp;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;groupby&lt;/strong&gt;&amp;nbsp;function also allows you to perform some sort of aggregation function on segments or groups in your data.&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin-top: 1em;&quot;&gt;
So, let&#39;s first begin by importing the usual necessary libraries:&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin-top: 1em;&quot;&gt;
&lt;script src=&quot;https://gist.github.com/spicasax/599a7f89e4d0b7e2bd4f08ec0f0fb210.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin-top: 1em;&quot;&gt;
Next, for demonstration purposes, we will import a dataset about cars. The&amp;nbsp;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;mpg&lt;/strong&gt;&amp;nbsp;dataset is a well-known dataset used for exploration and learning purposes. We can find a description of the dataset at the UCI Machine Learning repository:&amp;nbsp;&lt;em style=&quot;box-sizing: border-box;&quot;&gt;&lt;a href=&quot;https://archive.ics.uci.edu/ml/datasets/auto+mpg&quot; style=&quot;background-color: transparent; box-sizing: border-box; color: #337ab7;&quot; target=&quot;_blank&quot;&gt;https://archive.ics.uci.edu/ml/datasets/auto+mpg&lt;/a&gt;&lt;/em&gt;. Note that we can download the set from the UCI site, but the dataset does not include headers. We would have to utilize a separate file that has the column names.&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin-top: 1em;&quot;&gt;
So, for ease, we will import this dataset from the seaborn library. You can browse the datasets included in the seaborn package here:&amp;nbsp;&lt;em style=&quot;box-sizing: border-box;&quot;&gt;&lt;a href=&quot;https://github.com/mwaskom/seaborn-data&quot; style=&quot;background-color: transparent; box-sizing: border-box; color: #337ab7;&quot; target=&quot;_blank&quot;&gt;https://github.com/mwaskom/seaborn-data&lt;/a&gt;&lt;/em&gt;. But since we don&#39;t actually need the seaborn library in this notebook, we will import directly from their github repo&#39;s data folder.&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin-top: 1em;&quot;&gt;
&lt;script src=&quot;https://gist.github.com/spicasax/dd121d22b0050480b9b143fbb11410ea.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin-top: 1em;&quot;&gt;
Let&#39;s take a peek at the first few rows to get a feel for what this data set looks like.&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin-top: 1em;&quot;&gt;
&lt;script src=&quot;https://gist.github.com/spicasax/faec015d19993b5d886fd79e4f1bc533.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin-top: 1em;&quot;&gt;
&lt;script src=&quot;https://gist.github.com/spicasax/72526a0b5c197b595a13e9ddb9d1778a.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin-top: 1em;&quot;&gt;
The&amp;nbsp;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;model_year&lt;/strong&gt;&amp;nbsp;is a numeric field, but could also be used as a categoric field. Let&#39;s see what the distribution of value counts look like:&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin-top: 1em;&quot;&gt;
&lt;script src=&quot;https://gist.github.com/spicasax/41ddd9912dfcedb2c46b36056b07599d.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin-top: 1em;&quot;&gt;
&lt;script src=&quot;https://gist.github.com/spicasax/d3079ad6614be910141051334a971bb2.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin-top: 1em;&quot;&gt;
Likewise, we see that the&amp;nbsp;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;cylinders&lt;/strong&gt;&amp;nbsp;field is also a discrete numeric field. Let&#39;s check that field:&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin-top: 1em;&quot;&gt;
&lt;script src=&quot;https://gist.github.com/spicasax/e2b7111d87747a356824ecfdbe23bff2.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin-top: 1em;&quot;&gt;
&lt;script src=&quot;https://gist.github.com/spicasax/8af355e3bb9f017930f8aa10e162613f.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin-top: 1em;&quot;&gt;
The&amp;nbsp;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;origin&lt;/strong&gt;&amp;nbsp;field is our last categoric field:&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin-top: 1em;&quot;&gt;
&lt;script src=&quot;https://gist.github.com/spicasax/74a89ca5a6cf43c24f7785f26a057279.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin-top: 1em;&quot;&gt;
&lt;script src=&quot;https://gist.github.com/spicasax/9643c068b592ad9cdbc9d4b63db042a1.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin-top: 1em;&quot;&gt;
For our first&amp;nbsp;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;groupby&lt;/strong&gt;&amp;nbsp;example, we group by&amp;nbsp;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;origin&lt;/strong&gt;,&amp;nbsp;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;model_year&lt;/strong&gt;, and&amp;nbsp;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;cylinders&lt;/strong&gt;, and summarize the&amp;nbsp;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;weight&lt;/strong&gt;&amp;nbsp;of each group with the&amp;nbsp;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;mean&lt;/strong&gt;&amp;nbsp;function.&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin-top: 1em;&quot;&gt;
&lt;script src=&quot;https://gist.github.com/spicasax/d3f290bad9b58056a1def675e135afc9.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin-top: 1em;&quot;&gt;
&lt;script src=&quot;https://gist.github.com/spicasax/3c70f2a0f5b0cc13bec09a1eac1f0597.js&quot;&gt;&lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px;&quot;&gt;
Sometimes we need to apply more than one function to the groups. This can be accomplished with the&amp;nbsp;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;agg&lt;/strong&gt;&amp;nbsp;function.&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin-top: 1em;&quot;&gt;
This example looks complicated, so let&#39;s break it down.&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin-top: 1em;&quot;&gt;
First we specify the columns in the&amp;nbsp;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;groupby&lt;/strong&gt;&amp;nbsp;function, as we did in the last example:&amp;nbsp;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;mpg[&#39;origin&#39;]&lt;/strong&gt;,&amp;nbsp;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;mpg[&#39;model_year&#39;]&lt;/strong&gt;,&amp;nbsp;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;mpg[&#39;cylinders&#39;]&lt;/strong&gt;.&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin-top: 1em;&quot;&gt;
Then in the&amp;nbsp;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;agg&lt;/strong&gt;&amp;nbsp;function, we pass in a dictionary with the field names as the keys, and the functions that we will apply as the values.&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin-top: 1em;&quot;&gt;
Finally, for clarity, we use the&amp;nbsp;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;rename&lt;/strong&gt;&amp;nbsp;function to give meaningful names to our aggregated columns. Since we have performed different operations on the various columns, we append the function name to the column name. This is just a convention I like to use, so feel free to omit or modify as you like.&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin-top: 1em;&quot;&gt;
&lt;script src=&quot;https://gist.github.com/spicasax/d8c3737fe32750841a2a2cb1c2cd7b90.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin-top: 1em;&quot;&gt;
&lt;script src=&quot;https://gist.github.com/spicasax/80c74d2d628739e8d55bc68f10c7cf64.js&quot;&gt;&lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px;&quot;&gt;
On some occasions, we want to use our own custom function, and the&amp;nbsp;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;apply&lt;/strong&gt;&amp;nbsp;function allows us to do just that.&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin-top: 1em;&quot;&gt;
First, let&#39;s create a custom function, called reverse_cumsum. This is a rather contrived example, so just go along with it for the example.&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin-top: 1em;&quot;&gt;
&lt;script src=&quot;https://gist.github.com/spicasax/cb8b96120b01cfca90b31834f7a59345.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin-top: 1em;&quot;&gt;
Next I&#39;m going to subset the dataset to only 4 cylinder cars from USA.&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin-top: 1em;&quot;&gt;
&lt;script src=&quot;https://gist.github.com/spicasax/ef2311105f4c360b66a54305b71465bc.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin-top: 1em;&quot;&gt;
&lt;script src=&quot;https://gist.github.com/spicasax/a741776ebe24d5231a5c7237e058a1ed.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin-top: 1em;&quot;&gt;
Now we can apply the custom&amp;nbsp;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;reverse_cumsum&lt;/strong&gt;&amp;nbsp;function to our dataset with the&amp;nbsp;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;apply&lt;/strong&gt;&amp;nbsp;function. Note that I&#39;m applying this function to the&amp;nbsp;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;mpg&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;weight&lt;/strong&gt;fields in the dataset.&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin-top: 1em;&quot;&gt;
&lt;script src=&quot;https://gist.github.com/spicasax/82c4f1f502dcfb18a76fba65fe7c4448.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; margin-top: 1em;&quot;&gt;
&lt;script src=&quot;https://gist.github.com/spicasax/1729c7051e88b690d60594ebd4777e79.js&quot;&gt;&lt;/script&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px;&quot;&gt;
In this article, we demonstrated:&lt;/div&gt;
&lt;ol style=&quot;background-color: white; box-sizing: border-box; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 14px; list-style-image: initial; list-style-position: initial; margin-bottom: 9px; margin-top: 1em; padding-left: 2em;&quot;&gt;
&lt;li style=&quot;box-sizing: border-box;&quot;&gt;how to use the&amp;nbsp;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;groupby&lt;/strong&gt;&amp;nbsp;function to apply standard functions,&lt;/li&gt;
&lt;li style=&quot;box-sizing: border-box;&quot;&gt;how to use the&amp;nbsp;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;agg&lt;/strong&gt;&amp;nbsp;function to apply multiple functions to different fields, and&lt;/li&gt;
&lt;li style=&quot;box-sizing: border-box;&quot;&gt;how to use the&amp;nbsp;&lt;strong style=&quot;box-sizing: border-box;&quot;&gt;apply&lt;/strong&gt;&amp;nbsp;function to apply a custom function.&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &amp;quot;helvetica neue&amp;quot; , &amp;quot;helvetica&amp;quot; , &amp;quot;arial&amp;quot; , sans-serif;&quot;&gt;&lt;span style=&quot;font-size: 14px;&quot;&gt;You can also take a look at the &lt;a href=&quot;https://github.com/spicasax/analysis_tutorials/blob/master/pandas_apply_functions.ipynb&quot;&gt;notebook&lt;/a&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://geekythoughtbubbles.blogspot.com/feeds/9203816094395230542/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1269606243168807310/9203816094395230542' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/9203816094395230542'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/9203816094395230542'/><link rel='alternate' type='text/html' href='http://geekythoughtbubbles.blogspot.com/2019/02/applying-functions-to-groupby-of-pandas.html' title='Applying functions to a groupby of a pandas dataframe'/><author><name>Cynthia Sadler</name><uri>http://www.blogger.com/profile/06002305775627177465</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF5ySKaREXNbnCrrIOQQ9uf8TOmIv1Qzqpsh8PExkNNOcHDqpVJi1-8OClnjjwQSGLxRuFlfwHj6Qzt839ZvNR_cQgi2yP2xEUsn_cGLtLtNJ4US7rFmkCoXXA_vIxzZw/s113/barisax.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1269606243168807310.post-1861649893384926402</id><published>2018-02-05T12:05:00.000-08:00</published><updated>2018-02-05T12:05:55.049-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="git"/><category scheme="http://www.blogger.com/atom/ns#" term="howto"/><category scheme="http://www.blogger.com/atom/ns#" term="Mac OS X"/><title type='text'>Updating Mac OS X messed up my git ssh settings</title><content type='html'>I recently updated to Mac OS High Sierra (10.13). Yeah, I know, it&#39;s been out since last year. But I finally got around to updating my laptop.&lt;br /&gt;
&lt;br /&gt;
And then when I tried to git push, I got an error:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;style type=&quot;text/css&quot;&gt;
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 17.0px; font: 15.0px Arial; color: #242729; -webkit-text-stroke: #242729; background-color: #000000; background-color: rgba(0, 0, 0, 0)}
span.s1 {font-kerning: none}
&lt;/style&gt;


&lt;br /&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;git@github.com: Permission denied (publickey).&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;fatal: Could not read from remote repository.&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p2&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;Please make sure you have the correct access rights&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;style type=&quot;text/css&quot;&gt;
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000; background-color: #ffffff}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000; background-color: #ffffff; min-height: 13.0px}
span.s1 {font-variant-ligatures: no-common-ligatures}
&lt;/style&gt;






&lt;/div&gt;
&lt;div class=&quot;p1&quot;&gt;
&lt;span class=&quot;s1&quot;&gt;and the repository exists.&lt;/span&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&amp;nbsp;Which was weird because I was able to create the remote repo. I just couldn&#39;t push to it.&lt;br /&gt;
&lt;br /&gt;
I investigated my ssh key situation, and it appears the Mac OS upgrade removed my github key. Luckily, I had the key still in my ~/.ssh directory and was able to rectify the situation with:&lt;br /&gt;
&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
ssh-add ~/.ssh/github_user-GitHub&lt;/blockquote&gt;
Then all was good again. Whew!</content><link rel='replies' type='application/atom+xml' href='http://geekythoughtbubbles.blogspot.com/feeds/1861649893384926402/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1269606243168807310/1861649893384926402' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/1861649893384926402'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/1861649893384926402'/><link rel='alternate' type='text/html' href='http://geekythoughtbubbles.blogspot.com/2018/02/updating-mac-os-x-messed-up-my-git-ssh.html' title='Updating Mac OS X messed up my git ssh settings'/><author><name>Cynthia Sadler</name><uri>http://www.blogger.com/profile/06002305775627177465</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF5ySKaREXNbnCrrIOQQ9uf8TOmIv1Qzqpsh8PExkNNOcHDqpVJi1-8OClnjjwQSGLxRuFlfwHj6Qzt839ZvNR_cQgi2yP2xEUsn_cGLtLtNJ4US7rFmkCoXXA_vIxzZw/s113/barisax.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1269606243168807310.post-7388816308327833422</id><published>2011-01-16T11:21:00.000-08:00</published><updated>2011-01-16T11:21:45.615-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="testing"/><title type='text'>Beta testing with Android on AT&amp;T? Not!</title><content type='html'>&lt;span id=&quot;internal-source-marker_0.09589641721554554&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;a href=&quot;http://www.amazon.com/HTC-Aria-Android-Phone-AT/dp/B003RCJA6S?ie=UTF8&amp;amp;tag=geekthoububb-20&amp;amp;link_code=bil&amp;amp;camp=213689&amp;amp;creative=392969&quot; imageanchor=&quot;1&quot; target=&quot;_blank&quot;&gt;&lt;img alt=&quot;HTC Aria Android Phone (AT&amp;amp;T)&quot; src=&quot;http://ws.amazon.com/widgets/q?MarketPlace=US&amp;amp;ServiceVersion=20070822&amp;amp;ID=AsinImage&amp;amp;WS=1&amp;amp;Format=_SL160_&amp;amp;ASIN=B003RCJA6S&amp;amp;tag=geekthoububb-20&quot; /&gt;&lt;/a&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;1&quot; src=&quot;http://www.assoc-amazon.com/e/ir?t=geekthoububb-20&amp;amp;l=bil&amp;amp;camp=213689&amp;amp;creative=392969&amp;amp;o=1&amp;amp;a=B003RCJA6S&quot; style=&quot;border: medium none ! important; margin: 0px ! important; padding: 0px ! important;&quot; width=&quot;1&quot; /&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span id=&quot;internal-source-marker_0.09589641721554554&quot; style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;I recently was asked to  do some beta testing of an Android application. I had never done mobile  testing before, so I eagerly accepted the assignment. However I did not  know that AT&amp;amp;T had blocked loading applications that were not from  the Android Marketplace onto my &lt;a href=&quot;http://www.amazon.com/HTC-Aria-Android-Phone-AT/dp/B003RCJA6S?ie=UTF8&amp;amp;tag=geekthoububb-20&amp;amp;link_code=btl&amp;amp;camp=213689&amp;amp;creative=392969&quot; target=&quot;_blank&quot;&gt;HTC Aria&lt;/a&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;1&quot; src=&quot;http://www.assoc-amazon.com/e/ir?t=geekthoububb-20&amp;amp;l=btl&amp;amp;camp=213689&amp;amp;creative=392969&amp;amp;o=1&amp;amp;a=B003RCJA6S&quot; style=&quot;border: medium none ! important; margin: 0px ! important; padding: 0px ! important;&quot; width=&quot;1&quot; /&gt; (affiliate link). This &lt;a href=&quot;http://blogs.computerworld.com/16341/at_t_android_htc_aria&quot;&gt;article from  Computerworld&lt;/a&gt; describes this in more detail. After two hours of trying  to load the beta application (which was an APK file) and researching why  I couldn’t, I concluded that the only way I could do this would be to  root my phone. Since this voids the warranty, and I’ve only had the  phone for about 6 months, I decided against this. So, sadly, I had to  decline the beta testing.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: Arial; font-size: 11pt; font-style: normal; font-weight: normal; text-decoration: none; vertical-align: baseline;&quot;&gt;Other than this problem, I’ve been pretty  happy with my HTC Aria. I like the integration with my Google mail and  calendar, which is how I manage my day-to-day life. I’m just  disappointed to not get any mobile testing experience with it.&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekythoughtbubbles.blogspot.com/feeds/7388816308327833422/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1269606243168807310/7388816308327833422' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/7388816308327833422'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/7388816308327833422'/><link rel='alternate' type='text/html' href='http://geekythoughtbubbles.blogspot.com/2011/01/beta-testing-with-android-on-at-not.html' title='Beta testing with Android on AT&amp;T? Not!'/><author><name>Cynthia Sadler</name><uri>http://www.blogger.com/profile/06002305775627177465</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF5ySKaREXNbnCrrIOQQ9uf8TOmIv1Qzqpsh8PExkNNOcHDqpVJi1-8OClnjjwQSGLxRuFlfwHj6Qzt839ZvNR_cQgi2yP2xEUsn_cGLtLtNJ4US7rFmkCoXXA_vIxzZw/s113/barisax.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1269606243168807310.post-8680597254065462955</id><published>2010-12-26T11:56:00.000-08:00</published><updated>2010-12-26T11:56:50.109-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Kindle"/><title type='text'>Review of the Kindle 3G + Wi-Fi Wireless Reading Device</title><content type='html'>&lt;a href=&quot;http://www.amazon.com/Kindle-Wireless-Reader-3G-Wifi-Graphite/dp/B002FQJT3Q?ie=UTF8&amp;amp;tag=geekthoububb-20&amp;amp;link_code=bil&amp;amp;camp=213689&amp;amp;creative=392969&quot; imageanchor=&quot;1&quot; target=&quot;_blank&quot;&gt;&lt;img alt=&quot;Kindle 3G Wireless Reading Device, Free 3G + Wi-Fi, 3G Works Globally, Graphite, 6&amp;quot; Display with New E Ink Pearl Technology&quot; src=&quot;http://ws.amazon.com/widgets/q?MarketPlace=US&amp;amp;ServiceVersion=20070822&amp;amp;ID=AsinImage&amp;amp;WS=1&amp;amp;Format=_SL160_&amp;amp;ASIN=B002FQJT3Q&amp;amp;tag=geekthoububb-20&quot; /&gt;&lt;/a&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;1&quot; src=&quot;http://www.assoc-amazon.com/e/ir?t=geekthoububb-20&amp;amp;l=bil&amp;amp;camp=213689&amp;amp;creative=392969&amp;amp;o=1&amp;amp;a=B002FQJT3Q&quot; style=&quot;border: medium none ! important; margin: 0px ! important; padding: 0px ! important;&quot; width=&quot;1&quot; /&gt; &lt;br /&gt;
&lt;br /&gt;
I’ve always favored reading actual books versus reading books on a computer. I have resisted e-readers in general, because I don’t buy very many books, but rather trade them, usually on &lt;a href=&quot;http://paperbackswap.com/&quot;&gt;paperbackswap.com&lt;/a&gt;. But in my current quest to reduce clutter, I thought I would try reading books in Kindle format.&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Kindle software for non-Kindle devices&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
To test if I would even like reading digital books, I first installed the Kindle readers on my Mac and on my Android phone. I bought one book via the web, and tested out reading on each platform.&lt;br /&gt;
&lt;br /&gt;
Despite the small size, reading Kindle on the Android is not that bad for short amounts of time. If I have a few minutes to wait for something, I’ll often take my phone out and read a few pages from my phone. It was very convenient for me to capture small slices of time I would normally be doing nothing.&lt;br /&gt;
&lt;br /&gt;
When you close the book, Kindle will save your place to synchronize with other devices with the same book. Amazon calls this WhisperSync. This feature is really nice, in that, later in the day, I can read the same book on a different device, and it will synchronize and ask if I want to continue in the new location.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;The actual Kindle reader&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Being thrilled with this new way of reading books, I decided to bite the bullet and buy the latest Kindle. I went with the &lt;a href=&quot;http://www.amazon.com/Kindle-Wireless-Reader-3G-Wifi-Graphite/dp/B002FQJT3Q?ie=UTF8&amp;amp;tag=geekthoububb-20&amp;amp;link_code=btl&amp;amp;camp=213689&amp;amp;creative=392969&quot; target=&quot;_blank&quot;&gt;3G + Wifi version of the Kindle&lt;/a&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;1&quot; src=&quot;http://www.assoc-amazon.com/e/ir?t=geekthoububb-20&amp;amp;l=btl&amp;amp;camp=213689&amp;amp;creative=392969&amp;amp;o=1&amp;amp;a=B002FQJT3Q&quot; style=&quot;border: medium none ! important; margin: 0px ! important; padding: 0px ! important;&quot; width=&quot;1&quot; /&gt; (affiliate link). For $50 more than the WiFi-only version, I get free 3G access anywhere and anytime. I thought that this was a good bargain.&lt;br /&gt;
&lt;br /&gt;
When the Kindle arrived, I was amazed at the e-Ink technology. It doesn’t really look like the device is on because the display does not have any glare or glow. The screen really does resemble a printed page more than a computer display. Since there is no backlight or glow, you do need to have a light source to read the Kindle.&lt;br /&gt;
&lt;br /&gt;
The page turning on the Kindle reader seemed a little slow, and the placement of the buttons is a little awkward at first. In the beginning, I would accidentally turn the page while just shifting the reader in my hands. I’m getting better at holding the Kindle so as not to accidentally turn the page. And I’ve ordered a book-like cover for it, which I imagine will help with this awkwardness.&lt;br /&gt;
&lt;br /&gt;
After downloading a few more books (mostly free), I noticed that I could categorize my books into folders within the Kindle. After I get more books loaded onto it, I think this will be more helpful in locating a particular book. It would be nice, however, to create sub-folders, but I can live with only one level of folders for now.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;The web browser&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
I checked out the Kindle’s experimental web browser. It is also a bit awkward at first to move the cursor with the arrow keys. I was able to view Google, as well as my Google Mail account, though. I think if you needed to check your mail quickly without having to wait to boot up a computer, this method would suffice quite well.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Importing PDFs&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Recently, I’ve purchased a few e-books that are only in PDF. The Kindle uses it’s own format, though. Books you purchase from the Kindle Store are in AWZ format. The Kindle can also read MOBI format as well.&lt;br /&gt;
&lt;br /&gt;
One way to convert PDF to MOBI is to use Amazon’s conversion service. You email the PDF document to a Kindle email account you set up on Amazon.com. I’ve tried this out on a few documents myself with mixed results. Usually the PDFs that I have downloaded are formatted with text and graphics meant to be read in landscape mode. The books that I converted and sent to my Kindle lost the formatting (of course) with some books even containing blank pages. But the content was still there, and for me, this was acceptable. Of the 4 PDF books I tried to convert, I had one book that did not convert well. There were sentences or paragraphs missing. This is not acceptable to me.&lt;br /&gt;
&lt;br /&gt;
The conversion method I have yet to try is outlined by Benny Lewis in his article &lt;a href=&quot;http://www.fluentin3months.com/convert-pdfs/&quot;&gt;How to convert PDFs/daily news/anything to ePUB/mobi for your eReader/Kindle&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;Summary&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Overall, I’ve been thrilled with the Kindle. I find that I am actually reading a lot more now, and am reading several books at a time. It is nice to flip back and forth between various books to suit my mood. And it is great to be able to save a few trees. Even though I’m a bit late to the party, I’m now finding that reading regular books is so last century and the Kindle is the way to go.</content><link rel='replies' type='application/atom+xml' href='http://geekythoughtbubbles.blogspot.com/feeds/8680597254065462955/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1269606243168807310/8680597254065462955' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/8680597254065462955'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/8680597254065462955'/><link rel='alternate' type='text/html' href='http://geekythoughtbubbles.blogspot.com/2010/12/review-of-kindle-3g-wi-fi-wireless.html' title='Review of the Kindle 3G + Wi-Fi Wireless Reading Device'/><author><name>Cynthia Sadler</name><uri>http://www.blogger.com/profile/06002305775627177465</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF5ySKaREXNbnCrrIOQQ9uf8TOmIv1Qzqpsh8PExkNNOcHDqpVJi1-8OClnjjwQSGLxRuFlfwHj6Qzt839ZvNR_cQgi2yP2xEUsn_cGLtLtNJ4US7rFmkCoXXA_vIxzZw/s113/barisax.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1269606243168807310.post-8985965057390190358</id><published>2010-12-17T19:43:00.000-08:00</published><updated>2010-12-17T19:43:00.129-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="howto blogging"/><title type='text'>How to configure your blogspot blog to use a custom domain from Namecheap</title><content type='html'>I recently noticed that the geekythoughtbubbles.com domain name was available. It was a similar tech blog to this. So, I decided to buy the domain with &lt;a href=&quot;http://www.namecheap.com/?aff=14410&quot;&gt;Namecheap&lt;/a&gt; (affiliate link).&lt;br /&gt;
&lt;br /&gt;
Reading the Blogger documentation, there are no specific instructions for configuring your Namecheap domain so that Blogger can use your new custom domain. Here is how to do it.&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Log into your Namecheap account.&lt;/li&gt;
&lt;li&gt;Go to My Account &amp;gt; Manage Domains&lt;/li&gt;
&lt;li&gt;Select your new domain.&lt;/li&gt;
&lt;li&gt;Under Host Management, select URL Forwarding&lt;/li&gt;
&lt;li&gt;Change the row with www by changing the text field to contain &lt;i&gt;ghs.google.com&lt;/i&gt; (leave Record Type as CNAME)&lt;/li&gt;
&lt;li&gt;Click Save Changes&lt;/li&gt;
&lt;li&gt;Follow the rest of the instructions under Update Your Blogger Settings: &lt;a href=&quot;http://www.google.com/support/blogger/bin/answer.py?hl=en&amp;amp;answer=55373&quot;&gt;How do I use a custom domain name on my blog?&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekythoughtbubbles.blogspot.com/feeds/8985965057390190358/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1269606243168807310/8985965057390190358' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/8985965057390190358'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/8985965057390190358'/><link rel='alternate' type='text/html' href='http://geekythoughtbubbles.blogspot.com/2010/12/how-to-configure-your-blogspot-blog-to.html' title='How to configure your blogspot blog to use a custom domain from Namecheap'/><author><name>Cynthia Sadler</name><uri>http://www.blogger.com/profile/06002305775627177465</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF5ySKaREXNbnCrrIOQQ9uf8TOmIv1Qzqpsh8PExkNNOcHDqpVJi1-8OClnjjwQSGLxRuFlfwHj6Qzt839ZvNR_cQgi2yP2xEUsn_cGLtLtNJ4US7rFmkCoXXA_vIxzZw/s113/barisax.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1269606243168807310.post-2092571811877153331</id><published>2010-12-07T16:08:00.000-08:00</published><updated>2010-12-07T16:08:22.332-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="VirtualBox"/><category scheme="http://www.blogger.com/atom/ns#" term="virtualization"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows"/><title type='text'>Enabling virtualization support for Dell Latitude E6400</title><content type='html'>At work, I have a Dell Latitude E6400 laptop running Windows XP (32-bit). In order to run 64-bit VirtualBox machines, I needed to enable virtualization support. Here’s how to do this:&lt;br /&gt;
&lt;br /&gt;
1. When booting up, select F12&lt;br /&gt;
2. Select BIOS setup&lt;br /&gt;
3. In the Virtualization Support tree:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; - Virtualization, select Enable, Apply&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; - VT for Direct I/O Access, select Enable, Apply&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; - Trusted Execution, do not select Enable&lt;br /&gt;
4. Select Exit to continue booting into Windows.</content><link rel='replies' type='application/atom+xml' href='http://geekythoughtbubbles.blogspot.com/feeds/2092571811877153331/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1269606243168807310/2092571811877153331' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/2092571811877153331'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/2092571811877153331'/><link rel='alternate' type='text/html' href='http://geekythoughtbubbles.blogspot.com/2010/12/enabling-virtualization-support-for.html' title='Enabling virtualization support for Dell Latitude E6400'/><author><name>Cynthia Sadler</name><uri>http://www.blogger.com/profile/06002305775627177465</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF5ySKaREXNbnCrrIOQQ9uf8TOmIv1Qzqpsh8PExkNNOcHDqpVJi1-8OClnjjwQSGLxRuFlfwHj6Qzt839ZvNR_cQgi2yP2xEUsn_cGLtLtNJ4US7rFmkCoXXA_vIxzZw/s113/barisax.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1269606243168807310.post-7935291318669346854</id><published>2010-12-03T19:18:00.000-08:00</published><updated>2010-12-03T19:18:53.442-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="VirtualBox"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows"/><title type='text'>How to share a folder from host to guest in VirtualBox</title><content type='html'>This is documented quite well in the VirtualBox documentation. But I’ve made my own notes here since it’s a task I do often enough, but sometimes still forget.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;With the guest machine turned off, open the Settings dialog.&lt;/li&gt;
&lt;li&gt;Go to the Shared Folders tab.&lt;/li&gt;
&lt;li&gt;Click on the Add Shared Folders button.&lt;/li&gt;
&lt;li&gt;Browse for the directory you want to share, and give it a name. In my case, I called the share work and I selected c:\work on my host’s filesystem. Click OK.&lt;/li&gt;
&lt;li&gt;Restart your guest machine.&lt;/li&gt;
&lt;li&gt;Now you need to mount this shared folder in the guest OS.&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;br /&gt;
In Windows, the share is always named \\vboxsrv\sharename. You can navigate to this via My Network Places. You could also use the net command:&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;net use q: \\vboxsrv\sharename&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
In Linux, you use the mount command:&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;mount -t vboxsf sharename mountpoint&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
e.g.,&lt;br /&gt;
&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;mount -t vboxsf work /mnt/work&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekythoughtbubbles.blogspot.com/feeds/7935291318669346854/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1269606243168807310/7935291318669346854' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/7935291318669346854'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/7935291318669346854'/><link rel='alternate' type='text/html' href='http://geekythoughtbubbles.blogspot.com/2010/12/how-to-share-folder-from-host-to-guest.html' title='How to share a folder from host to guest in VirtualBox'/><author><name>Cynthia Sadler</name><uri>http://www.blogger.com/profile/06002305775627177465</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF5ySKaREXNbnCrrIOQQ9uf8TOmIv1Qzqpsh8PExkNNOcHDqpVJi1-8OClnjjwQSGLxRuFlfwHj6Qzt839ZvNR_cQgi2yP2xEUsn_cGLtLtNJ4US7rFmkCoXXA_vIxzZw/s113/barisax.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1269606243168807310.post-1261606799836317315</id><published>2010-02-12T06:40:00.000-08:00</published><updated>2010-02-12T07:02:08.418-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="howto"/><category scheme="http://www.blogger.com/atom/ns#" term="NumPy"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><category scheme="http://www.blogger.com/atom/ns#" term="Solaris"/><title type='text'>How to install NumPy on Solaris</title><content type='html'>I&#39;ve been working with NumPy (Numerical Python module) on Solaris, and now have a set of steps to install this and get this working. Note that this is the very basic installation of NumPy and doesn&#39;t contain additional libraries like BLAS or LAPACH. You can read more about installing these at the &lt;a href=&quot;http://www.scipy.org/Installing_SciPy/BuildingGeneral&quot;&gt;NumPy building instructions page&lt;/a&gt;. These instructions are to help you get all of the prerequisites installed and a basic build of NumPy going.&lt;br /&gt;&lt;br /&gt;First you will need to install a Fortran compiler. You can download the &lt;a href=&quot;http://developers.sun.com/sunstudio/downloads/index.jsp&quot;&gt;Sun Studio 12u1&lt;/a&gt; and put it in &lt;code&gt;/tmp&lt;/code&gt;. Then:&lt;br /&gt;&lt;br /&gt;&lt;pre style=&quot;border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 90%;&quot;&gt;&lt;code&gt;cd /tmp&lt;br /&gt;bzcat SunStudio12u1-SunOS-x86-tar-ML.tar.bz2 | /bin/tar -xf -&lt;br /&gt;cd SunStudio12u1-SunOS-x86-tar-ML&lt;br /&gt;./SunStudio12u1-SunOS-x86-tar.sh --accept-license&lt;br /&gt;mv sunstudio12.1/ /opt&lt;br /&gt;export PATH=/usr/ccs/bin:/opt/sunstudio12.1/bin:$PATH&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;From &lt;a href=&quot;http://sunfreeware.com&quot;&gt;sunfreeware.com&lt;/a&gt;, download and install &lt;code&gt;python-2.6.2-sol10-x86-local.gz&lt;/code&gt; to &lt;code&gt;/tmp&lt;/code&gt; as well. Unpack and install:&lt;br /&gt;&lt;br /&gt;&lt;pre style=&quot;border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 90%;&quot;&gt;&lt;code&gt;gunzip python-2.6.2-sol10-x86-local.gz&lt;br /&gt;pkgadd -d python-2.6.2-sol10-x86-local&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Also, similarly install &lt;code&gt;libiconv-1.13.1-sol10-x86-local.gz, gcc-3.4.6-sol10-x86-local.gz, libgcc-3.4.6&lt;/code&gt; and &lt;code&gt;openssl-0.9.8l&lt;/code&gt;. When you get to installing libgcc, you get warnings about overwriting existing libraries. This is okay, so, just say yes to overwrite them.&lt;br /&gt;&lt;br /&gt;Add the following to &lt;code&gt;/root/.bashrc&lt;/code&gt; as well as your current shell:&lt;br /&gt;&lt;br /&gt;&lt;pre style=&quot;border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 90%;&quot;&gt;&lt;code&gt;export PATH=/usr/local/bin:$PATH&lt;br /&gt;export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Then with these new settings:&lt;br /&gt;&lt;br /&gt;&lt;pre style=&quot;border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 90%;&quot;&gt;&lt;code&gt;cd /tmp&lt;br /&gt;svn co http://svn.scipy.org/svn/numpy/trunk numpy # (if svn is not installed, then svn co on another machine and scp -r to copy it to /tmp)&lt;br /&gt;cd numpy&lt;br /&gt;python setup.py build --fcompiler=sun&lt;br /&gt;python setup.py install&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;To test the installation, create a file called /tmp/test.py with:&lt;br /&gt;&lt;br /&gt;&lt;pre style=&quot;border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 90%;&quot;&gt;&lt;code&gt;import numpy&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Then test that it works. You should get no import errors:&lt;br /&gt;&lt;br /&gt;&lt;pre style=&quot;border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 90%;&quot;&gt;&lt;code&gt;python test.py&lt;/code&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekythoughtbubbles.blogspot.com/feeds/1261606799836317315/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1269606243168807310/1261606799836317315' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/1261606799836317315'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/1261606799836317315'/><link rel='alternate' type='text/html' href='http://geekythoughtbubbles.blogspot.com/2010/02/how-to-install-numpy-on-solaris.html' title='How to install NumPy on Solaris'/><author><name>Cynthia Sadler</name><uri>http://www.blogger.com/profile/06002305775627177465</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF5ySKaREXNbnCrrIOQQ9uf8TOmIv1Qzqpsh8PExkNNOcHDqpVJi1-8OClnjjwQSGLxRuFlfwHj6Qzt839ZvNR_cQgi2yP2xEUsn_cGLtLtNJ4US7rFmkCoXXA_vIxzZw/s113/barisax.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1269606243168807310.post-7078861906802103630</id><published>2010-01-11T09:31:00.000-08:00</published><updated>2010-01-11T09:31:00.258-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Mac OS X"/><title type='text'>I&#39;ve switched to iTerm</title><content type='html'>I was using GNU screen for a while. I liked having only one window open for multiple sessions in Mac OS X. However, setting up the configuration is not an easy feat. In recent months, however, I&#39;ve switched to iTerm. I was against a tabbed command line environment because I didn&#39;t want to use the mouse to change tabs. But in iTerm you can cycle through the tabs with Command-arrow. You can get iTerm from their &lt;a href=&quot;http://iterm.sourceforge.net/&quot;&gt;sourceforge page&lt;/a&gt;. I know that screen can do much more than iTerm, but I&#39;m not really using those features, so for now iTerm will suffice.</content><link rel='replies' type='application/atom+xml' href='http://geekythoughtbubbles.blogspot.com/feeds/7078861906802103630/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1269606243168807310/7078861906802103630' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/7078861906802103630'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/7078861906802103630'/><link rel='alternate' type='text/html' href='http://geekythoughtbubbles.blogspot.com/2010/01/ive-switched-to-iterm.html' title='I&#39;ve switched to iTerm'/><author><name>Cynthia Sadler</name><uri>http://www.blogger.com/profile/06002305775627177465</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF5ySKaREXNbnCrrIOQQ9uf8TOmIv1Qzqpsh8PExkNNOcHDqpVJi1-8OClnjjwQSGLxRuFlfwHj6Qzt839ZvNR_cQgi2yP2xEUsn_cGLtLtNJ4US7rFmkCoXXA_vIxzZw/s113/barisax.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1269606243168807310.post-7942400681149336801</id><published>2010-01-04T13:58:00.000-08:00</published><updated>2010-01-04T14:20:25.174-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Mac OS X"/><category scheme="http://www.blogger.com/atom/ns#" term="NumPy"/><category scheme="http://www.blogger.com/atom/ns#" term="Python"/><category scheme="http://www.blogger.com/atom/ns#" term="STAF"/><title type='text'>Install numpy 2.6 on Snow Leopard (Mac OS X 10.6) from source</title><content type='html'>Here are the problems I was facing with using NumPy with Python 2.6.1 on Mac OS X 10.6.2 (Snow Leopard). This might be a bit convoluted, but bear with me.&lt;br /&gt;&lt;br /&gt;First, in order to call STAF from a Python script, I built PYSTAF.so from source. However, the only way to get it to work is to run Python in 32-bit mode:&lt;br /&gt;&lt;br /&gt;&lt;pre style=&quot;border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 90%;&quot;&gt;&lt;code&gt;export VERSIONER_PYTHON_PREFER_32_BIT=yes&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;This then caused problems with NumPy:&lt;br /&gt;&lt;br /&gt;&lt;pre style=&quot;border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 90%;&quot;&gt;&lt;code&gt;Python 2.6.1 (r261:67515, Jul  7 2009, 23:51:51)&lt;br /&gt;[GCC 4.2.1 (Apple Inc. build 5646)] on darwin&lt;br /&gt;Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;license&quot; for more information.&lt;br /&gt;&gt;&gt;&gt; import numpy&lt;br /&gt;Traceback (most recent call last):&lt;br /&gt; File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;&lt;br /&gt; File &quot;/Library/Python/2.6/site-packages/numpy-1.4.0.dev7542-py2.6-macosx-10.6-universal.egg/numpy/__init__.py&quot;, line 130, in &lt;module&gt;&lt;br /&gt;   import add_newdocs&lt;br /&gt; File &quot;/Library/Python/2.6/site-packages/numpy-1.4.0.dev7542-py2.6-macosx-10.6-universal.egg/numpy/add_newdocs.py&quot;, line 9, in &lt;module&gt;&lt;br /&gt;   from lib import add_newdoc&lt;br /&gt; File &quot;/Library/Python/2.6/site-packages/numpy-1.4.0.dev7542-py2.6-macosx-10.6-universal.egg/numpy/lib/__init__.py&quot;, line 4, in &lt;module&gt;&lt;br /&gt;   from type_check import *&lt;br /&gt; File &quot;/Library/Python/2.6/site-packages/numpy-1.4.0.dev7542-py2.6-macosx-10.6-universal.egg/numpy/lib/type_check.py&quot;, line 8, in &lt;module&gt;&lt;br /&gt; File &quot;/Library/Python/2.6/site-packages/numpy-1.4.0.dev7542-py2.6-macosx-10.6-universal.egg/numpy/core/__init__.py&quot;, line 8, in &lt;module&gt;&lt;br /&gt;   import numerictypes as nt&lt;br /&gt; File &quot;/Library/Python/2.6/site-packages/numpy-1.4.0.dev7542-py2.6-macosx-10.6-universal.egg/numpy/core/numerictypes.py&quot;, line 737, in &lt;module&gt;&lt;br /&gt;   _typestr[key] = empty((1,),key).dtype.str[1:]&lt;br /&gt;ValueError: array is too big.&lt;/module&gt;&lt;/module&gt;&lt;/module&gt;&lt;/module&gt;&lt;/module&gt;&lt;/module&gt;&lt;/module&gt;&lt;/stdin&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;According to Numpy Ticket #1221 (&lt;a href=&quot;http://projects.scipy.org/numpy/ticket/1221&quot;&gt;http://projects.scipy.org/numpy/ticket/1221&lt;/a&gt;) this is fixed in revision 7793. However, I was trying to use r7542 as was installed by the SciPy SuperPack installer (&lt;a href=&quot;http://macinscience.org/?page_id=6&quot;&gt;http://macinscience.org/?page_id=6&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;Still following along? Okay, so here&#39;s how I think I resolved my issues. I built and installed NumPy using the instructions on HyperJeff&#39;s blog: &lt;a href=&quot;http://blog.hyperjeff.net/?p=160&quot;&gt;http://blog.hyperjeff.net/?p=160&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;First we need to move old versions of Numpy. In my case:&lt;br /&gt;&lt;br /&gt;&lt;pre style=&quot;border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 90%;&quot;&gt;&lt;code&gt;sudo mv /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/numpy \&lt;br /&gt;/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/numpy_APPLE_DEFAULT&lt;br /&gt;sudo mv /Library/Python/2.6/site-packages/numpy-1.4.0.dev7542-py2.6-macosx-10.6-universal.egg \&lt;br /&gt;/Library/Python/2.6/site-packages/numpy-1.4.0.dev7542-py2.6-macosx-10.6-universal.egg-OLD&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;Then set the environment, build and install.&lt;br /&gt;&lt;br /&gt;&lt;pre style=&quot;border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 90%;&quot;&gt;&lt;code&gt;export MACOSX_DEPLOYMENT_TARGET=10.6&lt;br /&gt;export CFLAGS=&quot;-arch i386 -arch x86_64&quot;&lt;br /&gt;export FFLAGS=&quot;-arch i386 -arch x86_64&quot;&lt;br /&gt;export LDFLAGS=&quot;-Wall -undefined dynamic_lookup -bundle -arch i386 -arch x86_64&quot;&lt;br /&gt;cd ~/tmp&lt;br /&gt;svn co http://svn.scipy.org/svn/numpy/trunk numpy&lt;br /&gt;cd numpy&lt;br /&gt;python setup.py build --fcompiler=gnu95&lt;br /&gt;sudo python setup.py install&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;If this doesn&#39;t work for you, you might want to run through all of the steps in HyperJeff&#39;s page above. I probably had much of the prerequisites from previously running the SciPy SuperPack installer.</content><link rel='replies' type='application/atom+xml' href='http://geekythoughtbubbles.blogspot.com/feeds/7942400681149336801/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1269606243168807310/7942400681149336801' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/7942400681149336801'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/7942400681149336801'/><link rel='alternate' type='text/html' href='http://geekythoughtbubbles.blogspot.com/2010/01/install-numpy-26-on-snow-leopard-mac-os.html' title='Install numpy 2.6 on Snow Leopard (Mac OS X 10.6) from source'/><author><name>Cynthia Sadler</name><uri>http://www.blogger.com/profile/06002305775627177465</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF5ySKaREXNbnCrrIOQQ9uf8TOmIv1Qzqpsh8PExkNNOcHDqpVJi1-8OClnjjwQSGLxRuFlfwHj6Qzt839ZvNR_cQgi2yP2xEUsn_cGLtLtNJ4US7rFmkCoXXA_vIxzZw/s113/barisax.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1269606243168807310.post-5637880203512793535</id><published>2009-10-14T18:02:00.000-07:00</published><updated>2009-10-14T18:24:28.474-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Perl"/><category scheme="http://www.blogger.com/atom/ns#" term="scripting"/><title type='text'>Simple flashcard perl script</title><content type='html'>I think my friend Dan gave me a perl script a long time ago that was for Spanish flashcards. I have no idea where that is nowadays, but I decided to whip out a simple script. I think it is way simpler than Dan&#39;s version. There is no &quot;grading&quot; in this script. That is, there is no comparison with the answer you provide and the answer in the file. All you need to do to use this is to create a flashcard file. Each row contains the question and answer separated by a pipe.&lt;br /&gt;&lt;br /&gt;&lt;script src=&quot;http://gist.github.com/210318.js&quot;&gt;&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekythoughtbubbles.blogspot.com/feeds/5637880203512793535/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1269606243168807310/5637880203512793535' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/5637880203512793535'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/5637880203512793535'/><link rel='alternate' type='text/html' href='http://geekythoughtbubbles.blogspot.com/2009/10/simple-flashcard-perl-script.html' title='Simple flashcard perl script'/><author><name>Cynthia Sadler</name><uri>http://www.blogger.com/profile/06002305775627177465</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF5ySKaREXNbnCrrIOQQ9uf8TOmIv1Qzqpsh8PExkNNOcHDqpVJi1-8OClnjjwQSGLxRuFlfwHj6Qzt839ZvNR_cQgi2yP2xEUsn_cGLtLtNJ4US7rFmkCoXXA_vIxzZw/s113/barisax.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1269606243168807310.post-6037535169468780583</id><published>2009-09-16T08:19:00.000-07:00</published><updated>2009-09-16T08:26:14.562-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Mac OS X"/><title type='text'>Upgrading to Snow Leopard means upgrading ClamXav to 2.0 Beta</title><content type='html'>I upgraded to Mac OS X 10.6.1 yesterday. This morning my clamXav log said that &quot;This version of the ClamAV engine is outdated.&quot; Not only that, I was unable to launch the ClamXav UI. Further investigation found this problem in my Console:&lt;br /&gt;&lt;br /&gt;&lt;pre style=&quot;border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 90%;&quot;&gt;&lt;code&gt;[Deprecated] CocoaJava: com.apple.cocoa.foundation.NSRuntime&lt;br /&gt;-[NSJavaVirtualMachine initWithClassPath:] FATAL: cannot initialize ObjCJava. Exit&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;So, it appears that ClamXav 1.x will not run on Snow Leopard. Upgrading to ClamXav 2.0 beta fixes this. The new 2.0 interface also allows for version checking and will automatically guide you to update your clamav scanning engine quite painlessly.</content><link rel='replies' type='application/atom+xml' href='http://geekythoughtbubbles.blogspot.com/feeds/6037535169468780583/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1269606243168807310/6037535169468780583' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/6037535169468780583'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/6037535169468780583'/><link rel='alternate' type='text/html' href='http://geekythoughtbubbles.blogspot.com/2009/09/upgrading-to-snow-leopard-means.html' title='Upgrading to Snow Leopard means upgrading ClamXav to 2.0 Beta'/><author><name>Cynthia Sadler</name><uri>http://www.blogger.com/profile/06002305775627177465</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF5ySKaREXNbnCrrIOQQ9uf8TOmIv1Qzqpsh8PExkNNOcHDqpVJi1-8OClnjjwQSGLxRuFlfwHj6Qzt839ZvNR_cQgi2yP2xEUsn_cGLtLtNJ4US7rFmkCoXXA_vIxzZw/s113/barisax.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1269606243168807310.post-4425850430384110716</id><published>2009-06-30T22:26:00.000-07:00</published><updated>2009-07-01T07:35:42.320-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><title type='text'>Fixing RHL up2date InvalidRedirectionError</title><content type='html'>I wanted to install pstack on Red Hat Linux and decided to use up2date for the first time. I kept getting an InvalidRedirectionError when it tried to update pstack&#39;s gdb dependency. Looking in the /var/log/up2date file I had:&lt;br /&gt;&lt;br /&gt;&lt;pre style=&quot;border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 90%;&quot;&gt;&lt;code&gt;[Fri Jun 26 14:05:22 2009] up2date   File &quot;/usr/sbin/up2date&quot;, line 1312, in ?&lt;br /&gt;    sys.exit(main() or 0)&lt;br /&gt;   File &quot;/usr/sbin/up2date&quot;, line 813, in main&lt;br /&gt;    fullUpdate, dryRun=options.dry_run))&lt;br /&gt;   File &quot;/usr/sbin/up2date&quot;, line 1160, in batchRun&lt;br /&gt;    batch.run()&lt;br /&gt;   File &quot;/usr/share/rhn/up2date_client/up2dateBatch.py&quot;, line 93, in run&lt;br /&gt;    self.__getPackages()&lt;br /&gt;   File &quot;/usr/share/rhn/up2date_client/up2dateBatch.py&quot;, line 225, in __getPackages&lt;br /&gt;    up2date.getPackage(pkg, wrapperUtils.printPkg, wrapperUtils.printRetrieveHash)&lt;br /&gt;   File &quot;/usr/share/rhn/up2date_client/up2date.py&quot;, line 180, in getPackage&lt;br /&gt;    buf = rpcServer.doCall(repos.getPackage, pkg, msgCallback, progressCallback)&lt;br /&gt;   File &quot;/usr/share/rhn/up2date_client/rpcServer.py&quot;, line 238, in doCall&lt;br /&gt;    ret = apply(method, args, kwargs)&lt;br /&gt;   File &quot;/usr/share/rhn/up2date_client/repoDirector.py&quot;, line 37, in getPackage&lt;br /&gt;    return self.handlers[channel[&#39;type&#39;]].getPackage(pkg, msgCallback, progressCallback)&lt;br /&gt;   File &quot;/usr/share/rhn/up2date_client/rpmSource.py&quot;, line 186, in getPackage&lt;br /&gt;    package = source.getPackage(pkg, MsgCallback, progressCallback)&lt;br /&gt;   File &quot;/usr/share/rhn/up2date_client/repoBackends/up2dateRepo.py&quot;, line 201, in getPackage&lt;br /&gt;    fd = self.s.getPackage(channel, filename, offset=startpoint)&lt;br /&gt;   File &quot;/usr/lib/python2.3/site-packages/rhn/rpclib.py&quot;, line 622, in __call__&lt;br /&gt;    result = self._send(self._name, args)&lt;br /&gt;   File &quot;/usr/lib/python2.3/site-packages/rhn/rpclib.py&quot;, line 290, in _request&lt;br /&gt;    raise InvalidRedirectionError(&quot;Too many redirects&quot;)&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I&#39;m not sure what had happened previously on this particular lab machine, but it looks like a previous attempt to update gdb was corrupt, or perhaps interrupted. When I deleted /var/spool/up2date/gdb-6.3.0.0-1.162.el4.x86_64.rpm, then the up2date command worked like a charm.</content><link rel='replies' type='application/atom+xml' href='http://geekythoughtbubbles.blogspot.com/feeds/4425850430384110716/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1269606243168807310/4425850430384110716' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/4425850430384110716'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/4425850430384110716'/><link rel='alternate' type='text/html' href='http://geekythoughtbubbles.blogspot.com/2009/06/fixing-rhl-up2date-invalidredirectioner.html' title='Fixing RHL up2date InvalidRedirectionError'/><author><name>Cynthia Sadler</name><uri>http://www.blogger.com/profile/06002305775627177465</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF5ySKaREXNbnCrrIOQQ9uf8TOmIv1Qzqpsh8PExkNNOcHDqpVJi1-8OClnjjwQSGLxRuFlfwHj6Qzt839ZvNR_cQgi2yP2xEUsn_cGLtLtNJ4US7rFmkCoXXA_vIxzZw/s113/barisax.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1269606243168807310.post-7907840995067914891</id><published>2009-06-30T11:58:00.000-07:00</published><updated>2009-06-30T12:24:01.059-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Mac OS X"/><category scheme="http://www.blogger.com/atom/ns#" term="svn"/><title type='text'>How to uninstall Subversion on Mac OS X</title><content type='html'>I ran into this problem today where I was trying to uninstall Subversion 1.6 so I could install 1.5 instead. So, according to the instructions, you only need to delete the /opt/subversion directory and all of the sym links in /usr/local/bin that point to /opt/subversion. After doing this I tried to run the Subversion 1.5 installer and kept getting this message:&lt;br /&gt;&lt;br /&gt;You cannot install Subversion 1.5.4 on this volume&lt;br /&gt;&lt;br /&gt;The way to solve this problem is to delete Subversion-1.6.1.pkg from /Library/Receipts. Then I was able to run the Subversion 1.5 installer.</content><link rel='replies' type='application/atom+xml' href='http://geekythoughtbubbles.blogspot.com/feeds/7907840995067914891/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1269606243168807310/7907840995067914891' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/7907840995067914891'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/7907840995067914891'/><link rel='alternate' type='text/html' href='http://geekythoughtbubbles.blogspot.com/2009/06/how-to-uninstall-subversion-on-mac-os-x.html' title='How to uninstall Subversion on Mac OS X'/><author><name>Cynthia Sadler</name><uri>http://www.blogger.com/profile/06002305775627177465</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF5ySKaREXNbnCrrIOQQ9uf8TOmIv1Qzqpsh8PExkNNOcHDqpVJi1-8OClnjjwQSGLxRuFlfwHj6Qzt839ZvNR_cQgi2yP2xEUsn_cGLtLtNJ4US7rFmkCoXXA_vIxzZw/s113/barisax.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1269606243168807310.post-8135700047416329076</id><published>2009-06-04T09:48:00.000-07:00</published><updated>2009-06-04T10:05:59.655-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="howto"/><category scheme="http://www.blogger.com/atom/ns#" term="Mac OS X"/><category scheme="http://www.blogger.com/atom/ns#" term="work"/><title type='text'>How I work in a Mac OS X environment</title><content type='html'>I&#39;ve been using a Mac as my exclusive desktop at work for the last few months. I&#39;ve learned a few tricks to keep my hands on the keyboard and away from the mouse as much as possible. This is to prevent any repetitive use injuries like Carpal Tunnel Syndrome. Here are a few things that I&#39;ve started doing to make things easier for me.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Hide, don&#39;t minimize!&lt;/span&gt; Coming from Windows OS, I used to minimize windows frequently and keep them down in the task bar. In Mac OS X, you can easily minimize a window to the Dock with Command-M. However, you cannot easily restore the window with a simple keystroke. While Command-Tab allows you to cycle through your open applications, it doesn&#39;t really let you cycle through your windows. So, if you select an application via Command-Tab, you may or may not get the minimized window to restore. If you are using Command-Tab, as you select your application, keep holding down the Command button and then also select the Option key as you release. This will allow you restore a window. However, it is extremely awkward to me. So, instead of minimizing windows, now I just hide them. Using Command-H will hide the application, and cycling through Command-Tab will bring it back.&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Quicksilver is a fast and easy tool to launch applications.&lt;/span&gt; I highly recommend this free utility. I don&#39;t navigate to the Applications folder anymore to start a program. With Quicksilver, I just type Control-Space to open a window where I can type in the first few letters of the application I want. I know that using Command-Space will open Spotlight and you can achieve the same thing. It&#39;s just a matter of preference.&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Gnu screen instead of multiple terminals.&lt;/span&gt; I have recently started using screen. I usually need a lot of ssh sessions open to various machines here at work. Instead of having half a dozen terminal windows, I only have one terminal running screen. There are a few getting started type tutorials out there on the internet, and I suggest that if you find your desktop cluttered with terminal screens you should spend a little time learning screen.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekythoughtbubbles.blogspot.com/feeds/8135700047416329076/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1269606243168807310/8135700047416329076' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/8135700047416329076'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/8135700047416329076'/><link rel='alternate' type='text/html' href='http://geekythoughtbubbles.blogspot.com/2009/06/how-i-work-in-mac-os-x-environment.html' title='How I work in a Mac OS X environment'/><author><name>Cynthia Sadler</name><uri>http://www.blogger.com/profile/06002305775627177465</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF5ySKaREXNbnCrrIOQQ9uf8TOmIv1Qzqpsh8PExkNNOcHDqpVJi1-8OClnjjwQSGLxRuFlfwHj6Qzt839ZvNR_cQgi2yP2xEUsn_cGLtLtNJ4US7rFmkCoXXA_vIxzZw/s113/barisax.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1269606243168807310.post-8130859660151879558</id><published>2009-04-20T20:07:00.000-07:00</published><updated>2009-04-20T20:07:00.783-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Unix"/><title type='text'>All about the process</title><content type='html'>Oftentimes, when we are debugging a system, it is helpful to gather data on the various processes running on a system. One of the first commands that I learned in Unix was ps. Since most of my QA career has centered around testing java applications, I have typed the following command uncountable times: &lt;code&gt;ps -ef | grep java&lt;/code&gt;. This usually results in this type of information. Note that the second column is the PID, which is helpful in case you need to kill a process. Also note that the last column will get truncated if it&#39;s too long.&lt;br /&gt;&lt;br /&gt;&lt;pre style=&quot;border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 90%;&quot;&gt;&lt;code&gt;bash-3.00# ps -ef | grep java&lt;br /&gt;noaccess   709     1   0   Mar 31 ?          10:37 /usr/java/bin/java -server -Xmx128m -XX:+UseParallelGC -XX:ParallelGCThreads=4 &lt;br /&gt;    root 12309     1   0 15:26:21 ?          59:33 /usr/jdk/instances/jdk1.6.0_12/jre/bin/amd64/java -server -Xmx30g -Xms30g -XX:+&lt;br /&gt;    root 12549 12540   0 09:27:33 pts/1       0:00 grep java&lt;br /&gt;    root 12273     1   0 14:37:37 ?          59:22 /usr/jdk/instances/jdk1.6.0_12/jre/bin/amd64/java -server -Xmx30g -Xms30g -XX:+&lt;br /&gt;    root  6463     1   0   Apr 10 ?         113:57 /usr/jdk/instances/jdk1.6.0_12/bin/java -server -Xms512m -Xmx512m CommandLineRe&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Another useful command for java processes only is &lt;code&gt;jps&lt;/code&gt;. It will give you results with the PID as well.&lt;br /&gt;&lt;br /&gt;&lt;pre style=&quot;border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 90%;&quot;&gt;&lt;code&gt;bash-3.00# /usr/java/bin/jps&lt;br /&gt;12541 Jps&lt;br /&gt;12273 DirectoryServer&lt;br /&gt;12309 DirectoryServer&lt;br /&gt;709 Bootstrap&lt;br /&gt;6463 CommandLineResourceMonitorClient&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;You can also try &lt;code&gt;jps -Vv&lt;/code&gt; to get more information as well. See the jps man page. The last useful command that I have in my repertoire is &lt;code&gt;pargs&lt;/code&gt;. Say you know the PID, you can get all of the arguments that were used. E.g.,&lt;br /&gt;&lt;br /&gt;&lt;pre style=&quot;border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 90%;&quot;&gt;&lt;code&gt;bash-3.00# pargs 12273&lt;br /&gt;12273:  /usr/jdk/instances/jdk1.6.0_12/jre/bin/amd64/java -server -Xmx30g -Xms30g -XX:+&lt;br /&gt;argv[0]: /usr/jdk/instances/jdk1.6.0_12/jre/bin/amd64/java&lt;br /&gt;argv[1]: -server&lt;br /&gt;argv[2]: -Xmx30g&lt;br /&gt;argv[3]: -Xms30g&lt;br /&gt;argv[4]: -XX:+UseConcMarkSweepGC&lt;br /&gt;argv[5]: -XX:+CMSConcurrentMTEnabled&lt;br /&gt;argv[6]: -XX:+CMSParallelRemarkEnabled&lt;br /&gt;argv[7]: -XX:+CMSParallelSurvivorRemarkEnabled&lt;br /&gt;argv[8]: -XX:ParallelCMSThreads=8&lt;br /&gt;argv[9]: -XX:CMSMaxAbortablePrecleanTime=10&lt;br /&gt;argv[10]: -XX:CMSInitiatingOccupancyFraction=80&lt;br /&gt;argv[11]: -XX:+UseParNewGC&lt;br /&gt;argv[12]: -XX:+UseBiasedLocking&lt;br /&gt;argv[13]: -XX:+UseLargePages&lt;br /&gt;argv[14]: -XX:+HeapDumpOnOutOfMemoryError&lt;br /&gt;argv[15]: -Dcom.unboundid.directory.server.scriptName=start-ds&lt;br /&gt;argv[16]: com.unboundid.directory.server.core.DirectoryServer&lt;br /&gt;argv[17]: --configClass&lt;br /&gt;argv[18]: com.unboundid.directory.server.extensions.ConfigFileHandler&lt;br /&gt;argv[19]: --configFile&lt;br /&gt;argv[20]: /ds/cynthia/repl/1/config/config.ldif&lt;/code&gt;&lt;/pre&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekythoughtbubbles.blogspot.com/feeds/8130859660151879558/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1269606243168807310/8130859660151879558' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/8130859660151879558'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/8130859660151879558'/><link rel='alternate' type='text/html' href='http://geekythoughtbubbles.blogspot.com/2009/04/all-about-process.html' title='All about the process'/><author><name>Cynthia Sadler</name><uri>http://www.blogger.com/profile/06002305775627177465</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF5ySKaREXNbnCrrIOQQ9uf8TOmIv1Qzqpsh8PExkNNOcHDqpVJi1-8OClnjjwQSGLxRuFlfwHj6Qzt839ZvNR_cQgi2yP2xEUsn_cGLtLtNJ4US7rFmkCoXXA_vIxzZw/s113/barisax.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1269606243168807310.post-8310452972351042210</id><published>2009-03-30T20:22:00.000-07:00</published><updated>2009-03-30T20:22:00.425-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="STAF STAX scripting"/><title type='text'>STAF and STAX</title><content type='html'>With my new position at UnboundID, I have been in learning mode for the last couple of weeks. And I haven&#39;t posted anything too geeky here lately. But one thing that I have been trying to acquaint myself with is STAX, which is a plugin to STAF.&lt;br /&gt;&lt;br /&gt;I have used &lt;a href=&quot;http://staf.sourceforge.net/&quot;&gt;STAF (Software Testing Automation Framework)&lt;/a&gt; a little before when I was at Phurnace. I never really thought of it as a real testing framework though. It&#39;s more like a very useful library, especially if you are doing distributed testing. It very capably allows you to move files around different machines and execute commands remotely. But a framework it is not.&lt;br /&gt;&lt;br /&gt;I don&#39;t know why I have never really looked into STAX (STAf eXecution engine) before. It is actually more like a testing framework. It is a STAF service plugin that allows you to define define testcases in XML with some embedded Python scripts (Jython, actually).&lt;br /&gt;&lt;br /&gt;If you don&#39;t currently have a test framework in-house, the STAF/STAX solution is one you should consider. I personally think that test scripting in XML is a bit unnatural, but I&#39;m starting to get the hang of it. Using Eclipse as a development environment helps a lot. I still don&#39;t really know Python yet, but the fact that I have inherited existing tests helps a lot, in addition to some good reference websites that I have found.&lt;br /&gt;&lt;br /&gt;My only problem right now with STAX is that, given our current test framework which downloads, installs and configures STAX automatically, I can&#39;t seem to get it to work on Mac OS X. It just doesn&#39;t start up the STAX service. I know that it should work, but perhaps I&#39;ve got an incompatibility somewhere with the Java version and STAX version. This inherited test framework on top of STAX is using older versions of STAF and STAX and related libraries. So, right now, I&#39;m running a Solaris VM on my Mac, until I can figure out the right combination of version numbers (if that, hopefully, is indeed the problem).</content><link rel='replies' type='application/atom+xml' href='http://geekythoughtbubbles.blogspot.com/feeds/8310452972351042210/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1269606243168807310/8310452972351042210' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/8310452972351042210'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/8310452972351042210'/><link rel='alternate' type='text/html' href='http://geekythoughtbubbles.blogspot.com/2009/03/staf-and-stax.html' title='STAF and STAX'/><author><name>Cynthia Sadler</name><uri>http://www.blogger.com/profile/06002305775627177465</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF5ySKaREXNbnCrrIOQQ9uf8TOmIv1Qzqpsh8PExkNNOcHDqpVJi1-8OClnjjwQSGLxRuFlfwHj6Qzt839ZvNR_cQgi2yP2xEUsn_cGLtLtNJ4US7rFmkCoXXA_vIxzZw/s113/barisax.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1269606243168807310.post-8072613549764006210</id><published>2009-02-24T08:33:00.000-08:00</published><updated>2009-02-24T08:55:54.891-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="git"/><category scheme="http://www.blogger.com/atom/ns#" term="howto"/><category scheme="http://www.blogger.com/atom/ns#" term="Mac OS X"/><title type='text'>How to install git on Mac OS X 10.4 (Tiger)</title><content type='html'>I&#39;m finding myself using my old iBook whilst my MacBook Pro is being repaired. Since I&#39;m taking a git class at RubyLearning.org, I need to install git again. The problem is that the git-osx-installer only works for Leopard (10.5), and my old iBook is running 10.4. This means I have to build and install it myself. There are a few similar articles out there on how to do this. Here are my notes.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;I first downloaded Xcode 2.5 Developer Tools from &lt;a href=&quot;http://connect.apple.com/&quot;&gt;http://connect.apple.com&lt;/a&gt;. It&#39;s free to join Apple Developer Connection, though it is a limited account. However, you will be able to download Xcode. Be sure to get version 2.5 as it is for OS X 10.4 (Tiger).&lt;/li&gt;&lt;li&gt;Next we need to install expat which is a dependency for git. I dowloaded expat-2.0.1.tar.gz from &lt;a href=&quot;http://sourceforge.net/projects/expat/&quot;&gt;SourceForge&lt;/a&gt;. Building and installing expat with the C compiler tools is done in three steps: configure, make, make install. I downloaded all of the source tarballs to my /usr/local/src directory. Adjust as necessary if you use a different directory. Also, use sudo where necessary.&lt;br /&gt;&lt;pre style=&quot;border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 90%;&quot;&gt;&lt;code&gt;cd /usr/local/src&lt;br /&gt;tar xvzf expat-2.0.1.tar.gz&lt;br /&gt;cd expat-2.0.1&lt;br /&gt;./configure --prefix=/usr/local&lt;br /&gt;make&lt;br /&gt;sudo make install&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Now we can install git. I downloaded &lt;span&gt;git-1.5.6.tar.gz &lt;/span&gt;and &lt;span&gt;git-manpages-1.5.6.tar.bz2&lt;/span&gt; from &lt;a href=&quot;http://kernel.org/pub/software/scm/git/&quot;&gt;kernel.org&lt;/a&gt;&lt;span&gt;. I originally tried version 1.6.1 but it gave specific incompatibility errors for darwin ppc. So, I went back to version 1.5.6 and had better success. Again, building and installing git is done with configure, make, make install.&lt;/span&gt;&lt;br /&gt;&lt;pre style=&quot;border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 90%;&quot;&gt;&lt;code&gt;cd /usr/local/src&lt;br /&gt;tar xvzf git-1.5.6.tar.gz&lt;br /&gt;cd git-1.5.6&lt;br /&gt;./configure --prefix=/usr/local&lt;br /&gt;make&lt;br /&gt;sudo make install&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;The last, optional step, is installing the man pages for git.&lt;br /&gt;&lt;pre style=&quot;border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 90%;&quot;&gt;&lt;code&gt;cd /usr/local/src&lt;br /&gt;tar xjv -C /usr/local/man -f git-manpages-1.5.6.tar.bz2&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;Then add the following to your profile (e.g., ~/.bash_profile):&lt;/span&gt;&lt;span style=&quot;font-family:monospace;&quot;&gt; &lt;/span&gt;&lt;code&gt;export MANPATH=&quot;/usr/local/man:$MANPATH&quot;&lt;/code&gt;&lt;span style=&quot;font-family:monospace;&quot;&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-family:monospace;&quot;&gt;&lt;/span&gt;Also make sure you have &lt;code&gt;/usr/local/bin&lt;/code&gt;. in your PATH.&lt;/li&gt;&lt;li&gt;&lt;span&gt;Open a new terminal shell and test the man pages: &lt;code&gt;man git&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span&gt;Also test you have git installed and it is found in your PATH: &lt;code&gt;git --version&lt;/code&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekythoughtbubbles.blogspot.com/feeds/8072613549764006210/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1269606243168807310/8072613549764006210' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/8072613549764006210'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/8072613549764006210'/><link rel='alternate' type='text/html' href='http://geekythoughtbubbles.blogspot.com/2009/02/how-to-install-git-on-mac-os-x-104.html' title='How to install git on Mac OS X 10.4 (Tiger)'/><author><name>Cynthia Sadler</name><uri>http://www.blogger.com/profile/06002305775627177465</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF5ySKaREXNbnCrrIOQQ9uf8TOmIv1Qzqpsh8PExkNNOcHDqpVJi1-8OClnjjwQSGLxRuFlfwHj6Qzt839ZvNR_cQgi2yP2xEUsn_cGLtLtNJ4US7rFmkCoXXA_vIxzZw/s113/barisax.jpg'/></author><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1269606243168807310.post-8256501652152821489</id><published>2009-02-10T06:25:00.000-08:00</published><updated>2009-02-10T06:51:02.349-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="testing"/><title type='text'>Cloud computing is for suckers? Not for training and testing!</title><content type='html'>&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjapXeJKjXk6li_WJSzTHLKezR5SIF2Y4v3R5zdNXd0YsM7Yed8KJzYu1UAu5IVUfCZ3IhSSALbDrsyBSvH5Rla2FyVmIaEXYWuWWFKZjg_MuFNWtGgnbfbzvtxwcuhXNO9bYrDLTpVNTo/s1600-h/cloudgatechicago.jpg&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjapXeJKjXk6li_WJSzTHLKezR5SIF2Y4v3R5zdNXd0YsM7Yed8KJzYu1UAu5IVUfCZ3IhSSALbDrsyBSvH5Rla2FyVmIaEXYWuWWFKZjg_MuFNWtGgnbfbzvtxwcuhXNO9bYrDLTpVNTo/s400/cloudgatechicago.jpg&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5301180295237004578&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Perhaps you&#39;ve read John Dvorak&#39;s article from last year, &lt;a href=&quot;http://www.pcmag.com/article2/0,2817,2328299,00.asp&quot;&gt;Stormy Weather for Cloud Computing&lt;/a&gt;, where he proclaims that cloud computing is for suckers. Now, while I wouldn&#39;t bank my entire enterprise on computing in the cloud, I can think of a few useful ways cloud computing can be a great solution.&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Testing.&lt;/span&gt; This could be testing in a development or QA environment. More and more development teams are feeling the crunch economically, and are considering hosted solutions. Why not have a virtual lab? When you test away and get your system into a bad state, it is so easy to reset things back to a baseline state. But an even more clever use would be for off-site customer or usability testing. I have been in situations where we were doing customer testing and demos at a trade show, and getting the VPN connection to our SAP servers working was painful or inconvenient. Cloud computing would have made this easier, in my opinion.&lt;/li&gt;&lt;li&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Training.&lt;/span&gt; If your software environment is complicated (say, a NetWeaver or WebSphere environment), trying to arrange off-site customer training can be tricky. Instead of worrying about arriving to a customer&#39;s site with laptops fully loaded (and bogged down), why not use something like &lt;a href=&quot;http://aws.amazon.com/ec2/&quot;&gt;Amazon&#39;s Elastic Compute Cloud&lt;/a&gt;? You can have all of your images preloaded with whatever applications or server software you need, ready to go when you get to the customer&#39;s site.  This training setup was actually used at &lt;a href=&quot;http://www.phurnace.com/&quot;&gt;Phurnace Software&lt;/a&gt; with much success.&lt;/li&gt;&lt;/ol&gt;What are some other uses? Please add your ideas to the comments section.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;Photo by Flickr user &lt;/span&gt;&lt;a style=&quot;font-style: italic;&quot; href=&quot;http://flickr.com/photos/ancawonka/&quot;&gt;ancawonka&lt;/a&gt;&lt;span style=&quot;font-style: italic;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekythoughtbubbles.blogspot.com/feeds/8256501652152821489/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1269606243168807310/8256501652152821489' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/8256501652152821489'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/8256501652152821489'/><link rel='alternate' type='text/html' href='http://geekythoughtbubbles.blogspot.com/2009/02/cloud-computing-is-for-suckers-not-for.html' title='Cloud computing is for suckers? Not for training and testing!'/><author><name>Cynthia Sadler</name><uri>http://www.blogger.com/profile/06002305775627177465</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF5ySKaREXNbnCrrIOQQ9uf8TOmIv1Qzqpsh8PExkNNOcHDqpVJi1-8OClnjjwQSGLxRuFlfwHj6Qzt839ZvNR_cQgi2yP2xEUsn_cGLtLtNJ4US7rFmkCoXXA_vIxzZw/s113/barisax.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjapXeJKjXk6li_WJSzTHLKezR5SIF2Y4v3R5zdNXd0YsM7Yed8KJzYu1UAu5IVUfCZ3IhSSALbDrsyBSvH5Rla2FyVmIaEXYWuWWFKZjg_MuFNWtGgnbfbzvtxwcuhXNO9bYrDLTpVNTo/s72-c/cloudgatechicago.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1269606243168807310.post-5782576499776486154</id><published>2009-01-21T12:42:00.000-08:00</published><updated>2009-02-24T08:33:53.260-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="howto"/><category scheme="http://www.blogger.com/atom/ns#" term="scripting"/><title type='text'>How to embed code snippets in your blog</title><content type='html'>Embedding code snippets in your blog can be tricky. Most blogs are set up with WYSIWYG editors, but when you paste your code snippet, the results may not be what you expected. In my case, I use Blogger.com, and I&#39;m still using a default template. So, I&#39;ve noticed that I don&#39;t have much real estate horizontally in the blog posting.&lt;br /&gt;&lt;br /&gt;One of the first techniques I have tried is to simply wrap my code snippet with &amp;lt;blockquote&gt; and &amp;lt;pre&gt; tags. But since I have a set width on my blog, what can happen is this:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris molestie eros. Nullam at justo quis eros feugiat blandit. Nulla sed nunc. Sed quis purus. Suspendisse potenti. Phasellus in ante. Cras ut nibh. Nulla ut odio. Phasellus mauris. In eu lectus eu dolor egestas tempus. Integer aliquam. Phasellus accumsan. Sed iaculis lacus in lacus. Aliquam erat volutpat. Vestibulum nulla enim, pharetra sit amet, tincidunt et, bibendum id, magna. Aenean elit. Vivamus nunc. &lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;The code disappearing off to the right (in Firefox) was not desirable. So I got fancy. I decided wrapping the code snippet with &amp;lt;pre&gt; and &amp;lt;code&gt; tags looked better. Especially if I added some special magic to the &amp;lt;pre&gt; tag:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&amp;lt;pre style=&quot;border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 90%;&quot;&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;So, my previous example will now look like this:&lt;br /&gt;&lt;br /&gt;&lt;pre style=&quot;border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 90%;&quot;&gt;&lt;code&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris molestie eros. Nullam at justo quis eros feugiat blandit. Nulla sed nunc. Sed quis purus. Suspendisse potenti. Phasellus in ante. Cras ut nibh. Nulla ut odio. Phasellus mauris. In eu lectus eu dolor egestas tempus. Integer aliquam. Phasellus accumsan. Sed iaculis lacus in lacus. Aliquam erat volutpat. Vestibulum nulla enim, pharetra sit amet, tincidunt et, bibendum id, magna. Aenean elit. Vivamus nunc.&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;I still use this technique sometimes for smaller snippets of text, usually one-liners. But now my favorite way of embedding text is to use GitHub&#39;s Gist site. You just paste in your code at gist.github.com and then get the javascript to embed your code snippet. Now my example looks like this:&lt;br /&gt;&lt;br /&gt;&lt;script src=&quot;http://gist.github.com/50176.js&quot;&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;I like using GitHub because they have syntactical highlighters for many different languages. For example, here is a snippet in Ruby:&lt;br /&gt;&lt;br /&gt;&lt;script src=&quot;http://gist.github.com/19669.js&quot;&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;Note that there are other websites that do similarly, and GitHub is not unique. It just happens to be the one I prefer.</content><link rel='replies' type='application/atom+xml' href='http://geekythoughtbubbles.blogspot.com/feeds/5782576499776486154/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1269606243168807310/5782576499776486154' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/5782576499776486154'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/5782576499776486154'/><link rel='alternate' type='text/html' href='http://geekythoughtbubbles.blogspot.com/2009/01/how-to-embed-code-snippets-in-your-blog.html' title='How to embed code snippets in your blog'/><author><name>Cynthia Sadler</name><uri>http://www.blogger.com/profile/06002305775627177465</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF5ySKaREXNbnCrrIOQQ9uf8TOmIv1Qzqpsh8PExkNNOcHDqpVJi1-8OClnjjwQSGLxRuFlfwHj6Qzt839ZvNR_cQgi2yP2xEUsn_cGLtLtNJ4US7rFmkCoXXA_vIxzZw/s113/barisax.jpg'/></author><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1269606243168807310.post-5559686544503588023</id><published>2009-01-09T10:56:00.000-08:00</published><updated>2009-01-09T10:59:11.001-08:00</updated><title type='text'>Twitter timeline now working again on my blogs</title><content type='html'>No more annoying authentication pop up windows. Please let me know if they come back. &lt;br /&gt;&lt;br /&gt; &lt;a href=&quot;http://getsatisfaction.com/twitter/topics/twitter_log_in_pop_ups_on_my_blog?utm_content=topic_link&amp;utm_medium=email&amp;utm_source=reply_notification&quot;&gt;Link&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://geekythoughtbubbles.blogspot.com/feeds/5559686544503588023/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1269606243168807310/5559686544503588023' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/5559686544503588023'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/5559686544503588023'/><link rel='alternate' type='text/html' href='http://geekythoughtbubbles.blogspot.com/2009/01/twitter-timeline-now-working-again-on.html' title='Twitter timeline now working again on my blogs'/><author><name>Cynthia Sadler</name><uri>http://www.blogger.com/profile/06002305775627177465</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF5ySKaREXNbnCrrIOQQ9uf8TOmIv1Qzqpsh8PExkNNOcHDqpVJi1-8OClnjjwQSGLxRuFlfwHj6Qzt839ZvNR_cQgi2yP2xEUsn_cGLtLtNJ4US7rFmkCoXXA_vIxzZw/s113/barisax.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1269606243168807310.post-3903092225940558232</id><published>2009-01-08T18:54:00.000-08:00</published><updated>2009-01-08T18:58:32.099-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Twitter"/><title type='text'>Disabled Twitter timeline on my blogs</title><content type='html'>There is currently a problem with the Twitter badge on my blogs and many other blogs out there (not just WordPress or Blogger), so I&#39;ve commented out the javascript until it gets fixed by Twitter. Every time the page is loaded the end user is prompted for a Twitter username and password. With everyone nervous about phishing, I decided to disable it for now until it is resolved.</content><link rel='replies' type='application/atom+xml' href='http://geekythoughtbubbles.blogspot.com/feeds/3903092225940558232/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1269606243168807310/3903092225940558232' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/3903092225940558232'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/3903092225940558232'/><link rel='alternate' type='text/html' href='http://geekythoughtbubbles.blogspot.com/2009/01/disabled-twitter-timeline-on-my-blogs.html' title='Disabled Twitter timeline on my blogs'/><author><name>Cynthia Sadler</name><uri>http://www.blogger.com/profile/06002305775627177465</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF5ySKaREXNbnCrrIOQQ9uf8TOmIv1Qzqpsh8PExkNNOcHDqpVJi1-8OClnjjwQSGLxRuFlfwHj6Qzt839ZvNR_cQgi2yP2xEUsn_cGLtLtNJ4US7rFmkCoXXA_vIxzZw/s113/barisax.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1269606243168807310.post-2717207773971106479</id><published>2009-01-05T10:17:00.000-08:00</published><updated>2009-01-05T10:27:02.072-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="humor"/><category scheme="http://www.blogger.com/atom/ns#" term="work"/><title type='text'>Hudson versus Cruise search yields unexpected results</title><content type='html'>I just ran the following &lt;a href=&quot;http://www.google.com/search?q=hudson+versus+cruise&quot;&gt;Google search&lt;/a&gt; to find articles comparing the continuous integration tools Hudson and CruiseControl:&lt;br /&gt;&lt;pre&gt;hudson versus cruise&lt;/pre&gt;&lt;br /&gt;And I got this funny and unexpected result, &lt;a href=&quot;http://www.babble.com/CS/blogs/famecrawler/archive/2008/10/13/kate-hudson-vs-suri-cruise-who-wore-it-best.aspx&quot;&gt;Kate Hudson Vs Suri Cruise - Who Wore It Best?&lt;/a&gt;.</content><link rel='replies' type='application/atom+xml' href='http://geekythoughtbubbles.blogspot.com/feeds/2717207773971106479/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/1269606243168807310/2717207773971106479' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/2717207773971106479'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1269606243168807310/posts/default/2717207773971106479'/><link rel='alternate' type='text/html' href='http://geekythoughtbubbles.blogspot.com/2009/01/hudson-versus-cruise-search-yields.html' title='Hudson versus Cruise search yields unexpected results'/><author><name>Cynthia Sadler</name><uri>http://www.blogger.com/profile/06002305775627177465</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF5ySKaREXNbnCrrIOQQ9uf8TOmIv1Qzqpsh8PExkNNOcHDqpVJi1-8OClnjjwQSGLxRuFlfwHj6Qzt839ZvNR_cQgi2yP2xEUsn_cGLtLtNJ4US7rFmkCoXXA_vIxzZw/s113/barisax.jpg'/></author><thr:total>2</thr:total></entry></feed>