<?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: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-1636425380589022643</id><updated>2012-02-16T06:32:30.532-08:00</updated><category term='bash howto script'/><category term='python objc code'/><category term='docson unix linux fshs'/><category term='svn git trac'/><category term='oracle-oms oracle-rac oracle-grid oracle db linux'/><title type='text'>NiMA...</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://achaemenes.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1636425380589022643/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://achaemenes.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Nima</name><uri>http://www.blogger.com/profile/14392143720715335371</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://1.bp.blogspot.com/_2nTM0FJgbn4/SeioHfRtDAI/AAAAAAAAAAM/YQzOQepJRgU/S220/alpha-white-logo.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1636425380589022643.post-410376464729120627</id><published>2009-04-16T05:19:00.000-07:00</published><updated>2009-04-16T05:25:30.207-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='svn git trac'/><title type='text'>SVN to GIT Migration</title><content type='html'>I have so many projects that need migration from subversion over to git that I got sick of doing it manually each time (after the second time actually).&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So, I've written a little howto, along with a script that does all the work for you, the syntax is simply...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;  s2g &lt;span class="Apple-style-span" style="color: rgb(255, 153, 0); "&gt;-&lt;/span&gt;&lt;git-repo-to-be-created&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 153, 0); "&gt;s&lt;/span&gt; &lt;span class="Apple-style-span" style="font-style: italic; "&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 102, 0); "&gt;svn-co-uri &lt;span class="Apple-style-span" style="color: rgb(0, 0, 0); font-style: normal; "&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 153, 0);"&gt;-g&lt;/span&gt; &lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 102, 0); "&gt;local-git-repo-dir&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/git-repo-to-be-created&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The details are on the &lt;a href="http://docson.autonomy.net.au/wiki/Developer/GIT/svn2git"&gt;Autonomy Docson website&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;For Trac users, there's also a section in there which shows you how you can point your existing Trac project from subversion to git.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;If there's any missing information, let me know and I'll update the document.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1636425380589022643-410376464729120627?l=achaemenes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://achaemenes.blogspot.com/feeds/410376464729120627/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1636425380589022643&amp;postID=410376464729120627' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1636425380589022643/posts/default/410376464729120627'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1636425380589022643/posts/default/410376464729120627'/><link rel='alternate' type='text/html' href='http://achaemenes.blogspot.com/2009/04/svn-to-git-migration.html' title='SVN to GIT Migration'/><author><name>Nima</name><uri>http://www.blogger.com/profile/14392143720715335371</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://1.bp.blogspot.com/_2nTM0FJgbn4/SeioHfRtDAI/AAAAAAAAAAM/YQzOQepJRgU/S220/alpha-white-logo.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1636425380589022643.post-797803122815403926</id><published>2009-04-16T03:20:00.001-07:00</published><updated>2009-04-16T04:13:21.845-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='bash howto script'/><title type='text'>Variable-Variables in Bash</title><content type='html'>&lt;div&gt;Know the boring details already and just want the answer?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;    &lt;span class="Apple-style-span"  style=" font-weight: bold; font-family:'courier new';"&gt;EVAL=&lt;span class="Apple-style-span" style="color: rgb(204, 0, 0); "&gt;$(&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0); "&gt;eval echo -n \$${VAR}&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0); "&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Otherwise read on...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;This took me longer than it normally does to look something up in the man page, so I may as well share it in case others have the same need in writing a shell script...&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Variable-variables, for those that don't know, are variables that you'd like resolved not once, but twice.  For example...&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  foo=bar&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;  bar=zap&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The first resolution of &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;foo&lt;/span&gt; (i.e. &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;$foo&lt;/span&gt;), would give the value &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;bar&lt;/span&gt;.  The second resolution of &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;foo&lt;/span&gt; (i.e &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;$$foo&lt;/span&gt;) would give the first resolution of &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;bar&lt;/span&gt; (i.e. &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;$bar&lt;/span&gt;), which is &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;zap&lt;/span&gt;.  While this double-dollar syntax is exactly how you'd do this in a language like &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;PHP&lt;/span&gt;, it's a little more annoying in &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;Bash&lt;/span&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Here's an example where I need to check for a to see if all elements in a list have been set...&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;div style=""&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;EXIT=0&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 153, 0);"&gt;for&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt; VAR &lt;span class="Apple-style-span" style="color: rgb(255, 153, 0);"&gt;in&lt;/span&gt; GIT_BASE SVN_BASE; &lt;span class="Apple-style-span" style="color: rgb(255, 153, 0);"&gt;do&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;  EVAL=&lt;span class="Apple-style-span" style="color: rgb(204, 0, 0);"&gt;$(&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;eval echo -n \$${VAR}&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 0, 0);"&gt;) &lt;/span&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(204, 255, 255);"&gt;#. Double-resolve&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style=" ;font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;  &lt;span class="Apple-style-span" style="color: rgb(255, 153, 0);"&gt;if&lt;/span&gt; [ -z "${EVAL}" ]; &lt;span class="Apple-style-span" style="color: rgb(255, 153, 0); "&gt;then     &lt;/span&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(204, 255, 255);"&gt;#. $VAR not set?&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;    EXIT=$((${EXIT} + 1))       &lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="color: rgb(204, 255, 255);"&gt;#. Increment EXIT&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;  &lt;span class="Apple-style-span" style="color: rgb(255, 153, 0);"&gt;fi&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 153, 0);"&gt;done&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 153, 0);"&gt;exit&lt;/span&gt; ${EXIT}&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:Georgia;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style=" ;font-family:Georgia;"&gt;So if GIT_BASE and SVN_BASE are both set, EXIT will hold a value of 0, if none are set, it will hold 0, and so on.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 153, 0); font-weight: bold;"&gt;&lt;span class="Apple-style-span"  style="color: rgb(0, 0, 0);  font-weight: normal; font-family:Georgia;"&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1636425380589022643-797803122815403926?l=achaemenes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://achaemenes.blogspot.com/feeds/797803122815403926/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1636425380589022643&amp;postID=797803122815403926' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1636425380589022643/posts/default/797803122815403926'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1636425380589022643/posts/default/797803122815403926'/><link rel='alternate' type='text/html' href='http://achaemenes.blogspot.com/2009/04/variable-variables-in-bash.html' title='Variable-Variables in Bash'/><author><name>Nima</name><uri>http://www.blogger.com/profile/14392143720715335371</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://1.bp.blogspot.com/_2nTM0FJgbn4/SeioHfRtDAI/AAAAAAAAAAM/YQzOQepJRgU/S220/alpha-white-logo.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1636425380589022643.post-2215640450458763119</id><published>2009-04-14T18:47:00.001-07:00</published><updated>2009-04-14T19:00:48.484-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='docson unix linux fshs'/><title type='text'>The Recommended Unix/Linux Filesystem Layout (FSH) for Enterprise (Third-Party) Packages</title><content type='html'>&lt;div&gt;More often than not, a Unix/Linux system administrators are required to install 3rd party enterprise vendor software, and most of those times, they often have to go to the toilet and throw up.  Most of the time, the enterprise world puts in a seriously low dose of effort in writing the installer, and then the systems administrator has to watch it basically take a good dump all over their hard work, and contaminate their once-clean servers.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This document is a proposal for system administrators who are cautious, and care about standards and good practice.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It is a &lt;span class="Apple-style-span" style="font-style: italic;"&gt;recommended&lt;/span&gt; filesystem hierarchy standard based on that created by the &lt;a href="http://www.pathname.com/fhs/pub/fhs-2.3.html"&gt;FHS Group&lt;/a&gt;, and open (and welcoming) to public scrutiny - as that but the most important ingredient in writing quality - be it software, standards or protocols.&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;&lt;a href="http://docson.autonomy.net.au/wiki/OperatingSystem/UNIX/FSHS"&gt;http://docson.autonomy.net.au/wiki/OperatingSystem/UNIX/FSHS&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1636425380589022643-2215640450458763119?l=achaemenes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://achaemenes.blogspot.com/feeds/2215640450458763119/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1636425380589022643&amp;postID=2215640450458763119' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1636425380589022643/posts/default/2215640450458763119'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1636425380589022643/posts/default/2215640450458763119'/><link rel='alternate' type='text/html' href='http://achaemenes.blogspot.com/2009/04/recommended-unixlinux-filesystem-layout.html' title='The Recommended Unix/Linux Filesystem Layout (FSH) for Enterprise (Third-Party) Packages'/><author><name>Nima</name><uri>http://www.blogger.com/profile/14392143720715335371</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://1.bp.blogspot.com/_2nTM0FJgbn4/SeioHfRtDAI/AAAAAAAAAAM/YQzOQepJRgU/S220/alpha-white-logo.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1636425380589022643.post-8267898288744644879</id><published>2008-04-09T05:22:00.000-07:00</published><updated>2009-04-15T16:15:31.812-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='python objc code'/><title type='text'>Python Yield (Generator) Statement in a Nutshell</title><content type='html'>&lt;div&gt;&lt;div&gt;This will be the shortest bit of information you're likely to find, but it's great as a refresher.  If you are not familiar with Python &lt;span class="Apple-style-span" style="font-style: italic;"&gt;generators&lt;/span&gt; and &lt;span class="Apple-style-span" style="font-style: italic;"&gt;iterators&lt;/span&gt; you should read something comprehensive.  A great document I recommend is by Norman Matlof, that can be found &lt;a href="http://heather.cs.ucdavis.edu/~matloff/Python/PyIterGen.pdf"&gt;here&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 204, 0);"&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;def&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt; myIterFunction():&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;  i = 2;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;  &lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 204, 0);"&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;while&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt; True:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;    i *= i&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;    &lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 204, 0);"&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;yield&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt; i&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;myIterFn = myIterFunction()&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 204, 0);"&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;for&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt; i in &lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 204, 0);"&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;range&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;(0, 16):&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;  &lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 204, 0);"&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;print&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt; myIterFn.&lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(204, 0, 0);"&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;next&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style=""&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;()&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;What happens here is that we first create our iterator, &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;myIterFn&lt;/span&gt;, and then we iterate through it by calling the special iterator function called &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;next()&lt;/span&gt;.  Each time, we do it's like we awaken the &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;myIterFunction&lt;/span&gt; from where we last left it (at the point where yield returned control back to the calling function).  Each subsequent call will awaken the function and run until it next encounters the &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;yield&lt;/span&gt; operator.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The other advantage is that with this code, you could generate infinitely long sequences.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As a side-note, I should add that the simple example above can be done without using a generator, for example...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 204, 0); "&gt;&lt;span class="Apple-style-span" style="font-weight: bold; "&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 0); "&gt;i = 2&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 204, 0); "&gt;&lt;span class="Apple-style-span" style="font-weight: bold; "&gt;def&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-weight: bold; "&gt; myIterFunction():&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style=" ;font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-weight: bold; "&gt;  &lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 204, 0); "&gt;&lt;span class="Apple-style-span" style="font-weight: bold; "&gt;global&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-weight: bold; "&gt; i&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-weight: bold; "&gt;  i *= i&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;&lt;span class="Apple-style-span" style="font-weight: bold; "&gt;  &lt;/span&gt;&lt;span class="Apple-style-span" style="color: rgb(255, 204, 0); "&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span" style="font-weight: bold; "&gt;return&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-weight: bold; "&gt; i&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;...but as you can see, you either have to use a global variable, or write a class to accommodate this.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Now, can anyone point out how this can be done in Objective-C, please post =).&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1636425380589022643-8267898288744644879?l=achaemenes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://achaemenes.blogspot.com/feeds/8267898288744644879/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1636425380589022643&amp;postID=8267898288744644879' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1636425380589022643/posts/default/8267898288744644879'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1636425380589022643/posts/default/8267898288744644879'/><link rel='alternate' type='text/html' href='http://achaemenes.blogspot.com/2008/04/python-yield-generator-statement-in.html' title='Python Yield (Generator) Statement in a Nutshell'/><author><name>Nima</name><uri>http://www.blogger.com/profile/14392143720715335371</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://1.bp.blogspot.com/_2nTM0FJgbn4/SeioHfRtDAI/AAAAAAAAAAM/YQzOQepJRgU/S220/alpha-white-logo.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1636425380589022643.post-6170408796307790426</id><published>2008-04-08T18:39:00.000-07:00</published><updated>2009-04-15T02:43:55.548-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='oracle-oms oracle-rac oracle-grid oracle db linux'/><title type='text'>OMS (Oracle Management Server) &amp; RAC (Real Application Cluster)</title><content type='html'>Reconfiguring an existing &lt;span class="Apple-style-span" style="font-style: italic;"&gt;OMS&lt;/span&gt; (front-end), &lt;span class="Apple-style-span" style="font-style: italic;"&gt;Grid Control&lt;/span&gt;, to talk to RAC is simple.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Aim&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;To reconfigure OMS to point to you new RAC setup.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Assumptions&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;I will refer to all paths via the &lt;span class="Apple-style-span"  style=" ;font-family:'courier new';"&gt;ORACLE_HOME&lt;/span&gt; variable, which as far as this task is concerned is not even required. As an example, in my setup it is set to  &lt;span class="Apple-style-span"  style=" ;font-family:'courier new';"&gt;/u01/app/oracle/product/10.2.0/oms10g&lt;/span&gt;.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;That the database migration is already complete.&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Files&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span"  style=" ;font-family:'courier new';"&gt;${ORACLE_HOME}/bin/emctl&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span"  style=" ;font-family:'courier new';"&gt;${ORACLE_HOME}/sysman/config/emoms.properties&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span"  style=" ;font-family:'courier new';"&gt;${ORACLE_HOME}/network/admin/tnsnames.ora&lt;/span&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Tasks&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ol&gt;&lt;li&gt;Add a new &lt;span class="Apple-style-span" style="font-style: italic;"&gt;TNS&lt;/span&gt; entry to your &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;tnsnames.ora&lt;/span&gt;, give the alias a name of your choice, let's say &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;EMREP&lt;/span&gt;.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Start editing &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;emoms.properties&lt;/span&gt; and make the following changes adapter according to your environment.&lt;/li&gt;&lt;li&gt;Comment out &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;oracle.sysman.eml.mntr.emdRepServer=oms.mycompany.com&lt;/span&gt;.&lt;/li&gt;&lt;li&gt;Add &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;oracle.sysman.eml.mntr.emdRepRAC=TRUE&lt;/span&gt;.&lt;/li&gt;&lt;li&gt;Add &lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;oracle.sysman.eml.mntr.emdRepConnectDescriptor=EMREP&lt;/span&gt;.&lt;/li&gt;&lt;li&gt;Save and quit.&lt;/li&gt;&lt;li&gt;Restart &lt;span class="Apple-style-span" style="font-style: italic;"&gt;OMS&lt;/span&gt; (&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;emctl stop|start|statu&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;s oms&lt;/span&gt; etc.)&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1636425380589022643-6170408796307790426?l=achaemenes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://achaemenes.blogspot.com/feeds/6170408796307790426/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1636425380589022643&amp;postID=6170408796307790426' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1636425380589022643/posts/default/6170408796307790426'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1636425380589022643/posts/default/6170408796307790426'/><link rel='alternate' type='text/html' href='http://achaemenes.blogspot.com/2008/04/oms-oracle-management-server-rac-real.html' title='OMS (Oracle Management Server) &amp;amp; RAC (Real Application Cluster)'/><author><name>Nima</name><uri>http://www.blogger.com/profile/14392143720715335371</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://1.bp.blogspot.com/_2nTM0FJgbn4/SeioHfRtDAI/AAAAAAAAAAM/YQzOQepJRgU/S220/alpha-white-logo.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1636425380589022643.post-520493513445255285</id><published>2008-04-08T08:06:00.000-07:00</published><updated>2009-04-15T03:27:45.391-07:00</updated><title type='text'>All Blogged Up.</title><content type='html'>I've set up my first (ever) blog; pity I'm always short of words. Time to go to bed.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/1636425380589022643-520493513445255285?l=achaemenes.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://achaemenes.blogspot.com/feeds/520493513445255285/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=1636425380589022643&amp;postID=520493513445255285' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1636425380589022643/posts/default/520493513445255285'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1636425380589022643/posts/default/520493513445255285'/><link rel='alternate' type='text/html' href='http://achaemenes.blogspot.com/2008/04/ive-set-up-my-first-ever-blogpityim.html' title='All Blogged Up.'/><author><name>Nima</name><uri>http://www.blogger.com/profile/14392143720715335371</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='31' src='http://1.bp.blogspot.com/_2nTM0FJgbn4/SeioHfRtDAI/AAAAAAAAAAM/YQzOQepJRgU/S220/alpha-white-logo.png'/></author><thr:total>0</thr:total></entry></feed>
