<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Code.*</title>
    <link rel="alternate" type="text/html" href="http://www.codedotstar.com/" />
    <link rel="self" type="application/atom+xml" href="http://www.codedotstar.com/atom.xml" />
    <id>tag:www.codedotstar.com,2009-12-21://1</id>
    <updated>2010-03-15T12:54:32Z</updated>
    <subtitle>Code Hard, Play Hard!</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type 4.32-en</generator>

<entry>
    <title>change lines in file in place</title>
    <link rel="alternate" type="text/html" href="http://www.codedotstar.com/2010/03/change-lines-in-file-in-place.html" />
    <id>tag:www.codedotstar.com,2010://1.29</id>

    <published>2010-03-15T12:45:58Z</published>
    <updated>2010-03-15T12:54:32Z</updated>

    <summary>A simple problem encountered as how to change a specific line in place via Python. After some searches, I find there are two methods to use &apos;readlines()&apos; and &apos;writelines&apos;. So here&apos;s my simple abstracts:...</summary>
    <author>
        <name>Guanqun</name>
        
    </author>
    
        <category term="Development" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="python" label="python" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-US" xml:base="http://www.codedotstar.com/">
        <![CDATA[A simple problem encountered as how to change a specific line in place via Python. After some searches, I find there are two methods to use 'readlines()' and 'writelines'. So here's my simple abstracts:
<script src="http://gist.github.com/332803.js"></script>]]>
        
    </content>
</entry>

<entry>
    <title>Access MovableType via MacJournal</title>
    <link rel="alternate" type="text/html" href="http://www.codedotstar.com/2010/03/access-movabletype-via-macjournal.html" />
    <id>tag:www.codedotstar.com,2010://1.28</id>

    <published>2010-03-14T04:28:39Z</published>
    <updated>2010-03-14T23:56:33Z</updated>

    <summary>MacJournal enables you to access your blog by writing your entries locally. This is a useful feature for some people. However, the password of web service API is different with the one you use to login the web dashboard. To...</summary>
    <author>
        <name>Guanqun</name>
        
    </author>
    
        <category term="All about blog" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="macjournal" label="macjournal" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-US" xml:base="http://www.codedotstar.com/">
        <![CDATA[MacJournal enables you to access your blog by writing your entries locally. This is a useful feature for some people. However, the password of web service API is different with the one you use to login the web dashboard.

To see the password, login to your dashboard first and then click the profile of your user, see the "Web Services Password" below, click the "Reveal" button and here it is!<img alt="upload-edit-profile.jpg" src="http://www.codedotstar.com/upload-edit-profile.jpg" width="519" height="210" class="mt-image-center" style="text-align: center; display: block; margin: 0 auto 20px;" /><div>PS: don't know how to upload this picture to the post, I manually upload it...</div>]]>
        
    </content>
</entry>

<entry>
    <title>Write Your First vSphere Client Plugin</title>
    <link rel="alternate" type="text/html" href="http://www.codedotstar.com/2010/03/write-your-first-vsphere-client-plugin.html" />
    <id>tag:www.codedotstar.com,2010://1.27</id>

    <published>2010-03-08T09:57:28Z</published>
    <updated>2010-03-08T10:06:01Z</updated>

    <summary>vSphere Client Plugin framework provides a good opportunity to extend vSphere. Do you ever want to write a plugin for your own use? How to get started, you may ask, let&apos;s write a dumb plugin to show you what the...</summary>
    <author>
        <name>Guanqun</name>
        
    </author>
    
        <category term="Development" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="plugin" label="plugin" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="vmware" label="vmware" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-US" xml:base="http://www.codedotstar.com/">
        <![CDATA[vSphere Client Plugin framework provides a good opportunity to extend vSphere. Do you ever want to write a plugin for your own use? How to get started, you may ask, let's write a dumb plugin to show you what the basic step needed.<br /><br />This project needs Visual Studio, and requires vSphere Client installed.<br /><br /><ol><li>Step 1: create a new project. <img alt="3-8-2010 5-52-05 PM.png" src="http://www.codedotstar.com/3-8-2010%205-52-05%20PM.png" class="mt-image-center" style="text-align: center; display: block; margin: 0pt auto 20px;" width="683" height="412" /></li><li>Step 2: add a new reference named "VIPlugin" to this new project, this file is normally placed at "C:\Program Files\VMware\Infrastructure\Virtual Infrastructure Client\4.0".<img alt="3-8-2010 5-54-16 PM.jpg" src="http://www.codedotstar.com/3-8-2010%205-54-16%20PM.jpg" class="mt-image-center" style="text-align: center; display: block; margin: 0pt auto 20px;" width="467" height="383" /></li><li>Step 3: Code like this:<img alt="3-8-2010 5-55-24 PM.jpg" src="http://www.codedotstar.com/3-8-2010%205-55-24%20PM.jpg" class="mt-image-center" style="text-align: center; display: block; margin: 0pt auto 20px;" width="722" height="579" /></li><li>Step 4: Build the solution and put the output directory into "C:\Program Files\VMware\Infrastructure\Virtual Infrastructure Client\Plugins\"</li><li>Step 5: Start vSphere Client and you'll see your little cute plugin there.<br /></li></ol><br /> ]]>
        
    </content>
</entry>

<entry>
    <title>the order of network interface in mac osx</title>
    <link rel="alternate" type="text/html" href="http://www.codedotstar.com/2010/03/the-order-of-network-interface-in-mac-osx.html" />
    <id>tag:www.codedotstar.com,2010://1.26</id>

    <published>2010-03-07T09:27:04Z</published>
    <updated>2010-03-07T09:32:58Z</updated>

    <summary>The order of network interface in mac osx does matter. Especially when you&apos;re using an PPPoE interface, we intend to drive all our network flow over this interface instead of our original ethernet interface. To make it work the right...</summary>
    <author>
        <name>Guanqun</name>
        
    </author>
    
        <category term="Issues" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="network" label="network" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="pppoe" label="pppoe" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-US" xml:base="http://www.codedotstar.com/">
        <![CDATA[The order of network interface in mac osx does matter. Especially when you're using an PPPoE interface, we intend to drive all our network flow over this interface instead of our original ethernet interface. To make it work the right way, your network settings should be something like this: The PPPoE is on top of Ethernet interface.<div><img alt="network-setup-in-mac.jpg" src="http://www.codedotstar.com/network-setup-in-mac.jpg" width="579" height="506" class="mt-image-left" style="float: left; margin: 0 20px 20px 0;" /></div><div><br /></div>]]>
        
    </content>
</entry>

<entry>
    <title>write the code rather than read it on the book only</title>
    <link rel="alternate" type="text/html" href="http://www.codedotstar.com/2010/03/write-the-code-rather-than-read-it-on-the-book-only.html" />
    <id>tag:www.codedotstar.com,2010://1.25</id>

    <published>2010-03-06T13:50:14Z</published>
    <updated>2010-03-06T14:00:35Z</updated>

    <summary><![CDATA[Do it and you know what's really going on and you'll remember it by heart. &nbsp;The story is I read the fundamentals of Objective-C programming languages and then I thought I got the essences. Well technically speaking, there's not too...]]></summary>
    <author>
        <name>Guanqun</name>
        
    </author>
    
        <category term="Development" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="objc" label="objc" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-US" xml:base="http://www.codedotstar.com/">
        <![CDATA[Do it and you know what's really going on and you'll remember it by heart. &nbsp;The story is I read the fundamentals of Objective-C programming languages and then I thought I got the essences. Well technically speaking, there's not too much add-ons. &nbsp;However, I met with several errors when the project was building. Some errors are listed:<div><ol><li>property should have a specifier, e.g. int or float.</li><li>creating an array is different with your C-way initialization.<img alt="nsarray-error.jpg" src="http://www.codedotstar.com/nsarray-error.jpg" width="599" height="351" class="mt-image-center" style="text-align: center; display: block; margin: 0 auto 20px;" />the right way is:&nbsp;<img alt="nsarray-good.jpg" src="http://www.codedotstar.com/nsarray-good.jpg" width="391" height="384" class="mt-image-center" style="text-align: center; display: block; margin: 0 auto 20px;" />&nbsp;note that there must be an 'nil' at the last of list.</li></ol></div><div><br /></div><div>To mention, there are some differences with '[self name]' and 'self.name' and 'name'.</div><div><ol><li>'name': you must have the variable in the instance.</li><li>'self.name': it means you're invoking the property method.</li><li>'[self name]': it accesses the setName function.</li></ol></div>]]>
        
    </content>
</entry>

<entry>
    <title>system management in Heroku</title>
    <link rel="alternate" type="text/html" href="http://www.codedotstar.com/2010/02/system-management-in-heroku.html" />
    <id>tag:www.codedotstar.com,2010://1.24</id>

    <published>2010-02-25T06:05:32Z</published>
    <updated>2010-02-25T06:15:23Z</updated>

    <summary><![CDATA[This article investigates the capabilities exposed to the client user and the user experience.Image via CrunchBaseThe client user of Heroku is usually a developer focusing on Ruby on Rails.&nbsp; Due to its specific user case this platform is tuned with...]]></summary>
    <author>
        <name>Guanqun</name>
        
    </author>
    
        <category term="Misc" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="heroku" label="heroku" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ruby" label="ruby" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-US" xml:base="http://www.codedotstar.com/">
        <![CDATA[This article investigates the capabilities exposed to the client user and the user experience.<br /><div class="zemanta-img mt-image-right zemanta-action-dragged" style="margin: 1em; display: block; float: right; width: 172px;"><a href="http://www.crunchbase.com/company/heroku"><img src="http://www.crunchbase.com/assets/images/resized/0001/0749/10749v1-max-250x250.png" alt="Image representing Heroku as depicted in Crunc..." width="162" height="70" /></a><p class="zemanta-img-attribution" style="font-size: 0.8em;">Image via <a href="http://www.crunchbase.com/">CrunchBase</a></p></div><br />The client user of Heroku is usually a developer focusing on Ruby on Rails.&nbsp; Due to its specific user case this platform is tuned with great effort to ease the deployment and publishing of a web project.<br /><br />Heroku exposes two management systems for developers.&nbsp; One is the online account management; the other is the command line tool.<br /><font style="font-size: 1.25em;"><i><br />Online account management:</i></font><br />This is via web interface.&nbsp; The developer can see clearly how many sites he has created on behalf of his account.&nbsp; Besides, from this interface, the developer can do all the resource allocation - to upgrade the account, to add more workers/dynos etc.&nbsp; Add-ons are handled as well.&nbsp; There are lots of add-ons: full text search, cron jobs etc.&nbsp; Some of them are free; while some of the professional features have to be charged accordingly.<br /><br /><font style="font-size: 1.25em;"><i>Command line tool:<br /></i></font>The client of Heroku platform is enabled via Ruby Gems.&nbsp; And it is a command line tool.&nbsp; Therefore, the command line takes most of developers' time.&nbsp;&nbsp; For example, to create a Heroku application, one can invoke 'heroku create'.&nbsp; The command line tool is a superset of the web interface above.&nbsp; The developer can invoke the heroku command to change the workers/dynos as well.&nbsp; The detailed features include ('heroku help' shows every specific command used.):<br /><ul><li>Manage addons</li><li>Manage bundles</li><li>Manage database:</li><li>choose different database capabilities</li><li>shared DB or dedicated DB</li><li>pull the database into a local database</li><li>push a local database into app's remote database</li><li>reset the database for the app</li><li>Web service start/stop/restart</li><li>Manage scaling: add/remove dynos/workers</li><li>Manage domain names: add/remove a custom domain name</li></ul><br /><font style="font-size: 1.25em;"><i>Overall status:</i></font><br />Heroku shows an overall status of how the system goes.&nbsp; Take a look at this link: http://status.heroku.com<br /><br /><font style="font-size: 1.25em;"><i>Summary</i></font>:<br />Heroku is a terrific platform for developers with Ruby on Rails in mind.&nbsp; It provides 'Ruby on Rails as a Service'.&nbsp; Therefore, it frees developers from worrying the deployment of their web projects.&nbsp; The developers need only to focus on the code.&nbsp; The concepts presented by Heroku are minimal.&nbsp; It abstracts the infrastructure underneath to concepts like 'dyno' and 'worker'.&nbsp; And these two parameters can be changed on the go.&nbsp; In a word, Heroku is easy to use and really cool for Ruby on Rails developers!<br /><br />To take a look at my little '<a href="http://status.heroku.com/">hello world</a>' demo.<br />]]>
        
    </content>
</entry>

<entry>
    <title>problems with building ichm on xcode</title>
    <link rel="alternate" type="text/html" href="http://www.codedotstar.com/2010/02/problems-with-building-ichm-on-xcode.html" />
    <id>tag:www.codedotstar.com,2010://1.23</id>

    <published>2010-02-24T16:21:02Z</published>
    <updated>2010-02-24T16:45:08Z</updated>

    <summary><![CDATA[I'm trying to compile ichm on my Mac. It's a chm reader on Mac platform. The source code can be downloaded from here. This project takes advantage of three other frameworks, namely chm_lib.framework, PSMTabBarControl.framework and Sparkle.framework. &nbsp;However, these three frameworks...]]></summary>
    <author>
        <name>Guanqun</name>
        
    </author>
    
        <category term="Issues" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="framework" label="framework" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="xcode" label="xcode" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-US" xml:base="http://www.codedotstar.com/">
        <![CDATA[<p></p><p style="margin: 0.0px 0.0px 9.0px 0.0px; font: 13.0px Arial; color: #333233">I'm trying to compile ichm on my Mac. It's a chm reader on Mac platform. The source code can be downloaded from <a href="http://code.google.com/p/ichm/"><span style="text-decoration: underline ; color: #55208b">here</span></a>.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial; color: #333233">This project takes advantage of three other frameworks, namely chm_lib.framework, PSMTabBarControl.framework and Sparkle.framework. &nbsp;However, these three frameworks are not in the ichm repository, therefore you have to download it manually. The detaild URL and instructions can be found <a href="http://code.google.com/p/ichm/wiki/HowToBuildChm_libFramework"><span style="text-decoration: underline ; color: #55208b">here</span></a>. However, I would like to add some comments on how to build chm_lib framework:</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial; color: #333233; min-height: 15.0px"><br /></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial; color: #333233">The default SDK for ichm is 10.5. But when you're creating the framework for chm_lib, it will default to 10.6, and the default architecture is x86_64 and it's a debug version. Therefore, to make it right and make it be able to be linked against, it should be changed to "Release, i386". Otherwise, ichm will complain that the framework is not a right architecture.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial; color: #333233; min-height: 15.0px"><br /></p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial; color: #333233">At this phrase, I'm able to build the project successfully. Yes, you got that, there is always a 'but'. But it can't run. The loader can't find the Sparkle framework. To understand the whole story behind this, let's see how a typical Mac applications structures. Generally speaking, Mac application is a bundle of useful resources, it's just a directory containing all the stuff. Let me give you a rough idea.</p>
<p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 13.0px Arial; color: #333233; min-height: 15.0px"><br /></p><p></p><p></p>

<script src="http://gist.github.com/313589.js?file=ichm-file-directory"></script>You can see that the three lines that pointing to the framework from the output of otool. Otool on mac is similar with the 'ldd' command on Linux platform which lists all the dynamic libraries.<div><br /></div><div>The default ichm project doesn't include copying the files. So we have to manually add these files. Choose "Project" -&gt; "New Build Phrase" -&gt; "New Copy Files Build Phrase". Then you'll see there is one more directory showing on "Targets".&nbsp;</div><img alt="xcode-copy-files.jpg" src="http://www.codedotstar.com/xcode-copy-files.jpg" width="197" height="208" class="mt-image-center" style="text-align: center; display: block; margin: 0 auto 20px;" /><div>Then you can just drag the frameworks into this directory. And "Build". Hopefully it should work fine then.</div><div><br /></div>]]>
        

    </content>
</entry>

<entry>
    <title>the ubiquitous B-tree</title>
    <link rel="alternate" type="text/html" href="http://www.codedotstar.com/2010/02/the-ubiquitous-b-tree.html" />
    <id>tag:www.codedotstar.com,2010://1.22</id>

    <published>2010-02-24T05:23:27Z</published>
    <updated>2010-02-24T05:26:38Z</updated>

    <summary>Let&apos;s continue with B-tree discussion. Writing this name reminds of an interesting experience in my interview, one guy asked me what the differences between B minus tree and B plus tree. Lol. Well, literally speaking, there is no B minus...</summary>
    <author>
        <name>Guanqun</name>
        
    </author>
    
        <category term="Algorithms" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="btree" label="b-tree" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="funny" label="funny" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-US" xml:base="http://www.codedotstar.com/">
        <![CDATA[Let's continue with B-tree discussion. Writing this name reminds of an interesting experience in my interview, one guy asked me what the differences between B minus tree and B plus tree. Lol. Well, literally speaking, there is no B minus tree thing. The phrase of "B-tree" should be read as "B tree" instead of "B minus tree". The "-" is a hypen...<br /><div class="zemanta-img mt-image-right zemanta-action-dragged" style="margin: 1em; display: block; float: right; width: 310px;"><a href="http://commons.wikipedia.org/wiki/Image:Btree.svg"><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/f/fe/Btree.svg/300px-Btree.svg.png" alt="A simple B+ tree example linking the keys 1-7 ..." width="300" height="198" /></a><p class="zemanta-img-attribution" style="font-size: 0.8em;">Image via <a href="http://commons.wikipedia.org/wiki/Image:Btree.svg">Wikipedia</a></p></div><br />Today's paper is "The ubiquitous B-tree" by Douglas Comer. This article is cited for 455 times at this time of writing.<br /><br />This paper is mainly a summary for the de-facto widely used B-trees and shows lots of B-tree variants. It's a good introduction for whose are confused by the mysterious tree names behind them. In my view, the important variant is B+ tree. Now let me go back to my previous interview problem and try to give a shot. The main diff is B+ tree put all the keys on the leaf node, while the original B-tree puts keys on interior node as well. The advantage is B+ tree can provide really quick sequential access, since all the keys are on the leaf node and these leaf nodes can be linked together. <br /><br />

<div style="margin-top: 10px; height: 15px;" class="zemanta-pixie"><a class="zemanta-pixie-a" href="http://reblog.zemanta.com/zemified/3d1d648b-403d-460a-9f02-7f226a68dcdf/" title="Reblog this post [with Zemanta]"><img style="border: medium none; float: right;" class="zemanta-pixie-img" src="http://img.zemanta.com/reblog_e.png?x-id=3d1d648b-403d-460a-9f02-7f226a68dcdf" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related pretty-attribution"><script type="text/javascript" src="http://static.zemanta.com/readside/loader.js" defer="defer"></script></span></div>]]>
        
    </content>
</entry>

<entry>
    <title>B-tree originates from this paper</title>
    <link rel="alternate" type="text/html" href="http://www.codedotstar.com/2010/02/b-tree-originates-from-this-paper.html" />
    <id>tag:www.codedotstar.com,2010://1.21</id>

    <published>2010-02-21T14:47:12Z</published>
    <updated>2010-02-21T16:01:09Z</updated>

    <summary>This paper is &quot;Organization and Maintenance of Large Ordered Indexes&quot; by &quot;R.Bayer and E.McCreight&quot;. It was published in 1972, which is older even than my age. :-) Though, it was the root of B-tree related literature.The insert/deletion operations doesn&apos;t seem...</summary>
    <author>
        <name>Guanqun</name>
        
    </author>
    
        <category term="Algorithms" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="btree" label="b-tree" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="paper" label="paper" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-US" xml:base="http://www.codedotstar.com/">
        <![CDATA[This paper is "<b><font class="Apple-style-span" style="font-size: 1.25em; "><font class="Apple-style-span" style="font-size: 0.8em; ">Organization and Maintenance of Large Ordered Indexes</font></font></b>" by "R.Bayer and E.McCreight". It was published in 1972, which is older even than my age. :-) Though, it was the root of B-tree related literature.<div><br /></div><div>The insert/deletion operations doesn't seem to be very difficult from the current point of view. However, it was innovative to think beyond binary search tree and add more sons on a single node. The background of this is that scientists tried hard to reduce the disk access time involved in database system development. As we now all know, B-tree is a balanced, multi-way tree. It's widely used nowadays in file system, database indexing etc. Hence it's worth reading.</div><div><br /></div><div>Even it's simple to understand the idea, we should take a more deep look as how the detailed implementation should go, I list some questions below:</div><div><br /></div><div><b><font class="Apple-style-span" style="font-size: 1.25em; ">Insert:</font></b></div><div><i>Overflow?</i> If yes, then to the left sibling or right one? What's overflow, you may wonder. It's a trick to re-distribute between your siblings instead of splitting right now.</div><div><br /></div><div><b><font class="Apple-style-span" style="font-size: 1.25em; ">Delete:</font></b></div><div>If the number entries doesn't become &nbsp;less than k, then everything is fine. However, if it's not, then we should judge which sibling to peek into (left or right?) Then what strategy to take: if the total number is less than 2*k, then we should choose '<i>concatenation</i>', otherwise, we do '<i>underflow</i>'.</div><div><br /></div><div>I made a small pictures depicting the choices:</div><div><img alt="b-tree-operations-insert-delete-choices.jpg" src="http://www.codedotstar.com/b-tree-operations-insert-delete-choices.jpg" width="630" height="339" class="mt-image-center" style="text-align: center; display: block; margin: 0 auto 20px;" /></div><div>The later part of this paper details on the choice of k and shows the detailed performance report. But I doubt it still holds on today's modern machine, as its result was carried out on an ancient IBM machine.</div>]]>
        
    </content>
</entry>

<entry>
    <title>problems with macport</title>
    <link rel="alternate" type="text/html" href="http://www.codedotstar.com/2010/02/programs-with-macport.html" />
    <id>tag:www.codedotstar.com,2010://1.20</id>

    <published>2010-02-20T13:02:50Z</published>
    <updated>2010-02-20T13:10:44Z</updated>

    <summary>I was trying to build git-core on Mac using MacPort. But due to the update of port tree, the current port tree is old, therefore it results in an checksum error of the package file. To solve this problem, use...</summary>
    <author>
        <name>Guanqun</name>
        
    </author>
    
        <category term="Issues" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="port" label="port" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-US" xml:base="http://www.codedotstar.com/">
        <![CDATA[I was trying to build git-core on Mac using MacPort. But due to the update of port tree, the current port tree is old, therefore it results in an checksum error of the package file. To solve this problem, use '<b><i>sudo port selfupdate</i></b>' to make sure the port tree is the newest. Later, due to the corrupted file 'curl' distfiles, I was not able to proceed, thanks to this <a href="http://blas.phemo.us/articles/2008/05/13/macports-breaks-after-trying-to-remove-corrupt-archive">post</a>, '<i><b>sudo port clean --all curl curl-ba-bundle</b></i>' saved me.<div><br /></div><div>I learned these two tricks. Hope it may be useful to you.</div>]]>
        
    </content>
</entry>

<entry>
    <title>change the default behavior for controls in Interface Builder</title>
    <link rel="alternate" type="text/html" href="http://www.codedotstar.com/2010/02/change-the-default-behavior-for-controls-in-interface-builder.html" />
    <id>tag:www.codedotstar.com,2010://1.19</id>

    <published>2010-02-20T07:56:56Z</published>
    <updated>2010-02-20T08:17:18Z</updated>

    <summary>You&apos;ve created a button, take it as an example, later you want to change it to &apos;Disabled&apos; by default.The easy way to do it is to modify the properties displayed in &quot;Interface Builder&quot; directly. And hopefully everything will be fine....</summary>
    <author>
        <name>Guanqun</name>
        
    </author>
    
        <category term="Development" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="xcode" label="xcode" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-US" xml:base="http://www.codedotstar.com/">
        <![CDATA[<p>You've created a button, take it as an example, later you want to change it to 'Disabled' by default.</p><p>The easy way to do it is to modify the properties displayed in "Interface Builder" directly. And hopefully everything will be fine. However, what if you want to do it by lines of code?</p><p>Yes, there is also a way to accomplish this trivial task. You can add your actions or codes your "<b><i>- awakeFromNib</i></b>" method of the controller class.</p><p>The tentative trial would be to add your code in the "- init" method which is wrong. Because at the time of initialization of the controller class, there is no indication showing that the buttons are already done with its own initialization. Hence, the only safe and correct way to do is to utilize the "awakeFromNib" method.</p>
]]>
        

    </content>
</entry>

<entry>
    <title>the driver support for Huawei CDMA is good.</title>
    <link rel="alternate" type="text/html" href="http://www.codedotstar.com/2010/02/the-driver-support-for-huawei-cdma-is-good.html" />
    <id>tag:www.codedotstar.com,2010://1.18</id>

    <published>2010-02-12T08:12:26Z</published>
    <updated>2010-02-12T08:19:28Z</updated>

    <summary>I&apos;m surprised by the fact that Huawei CDMA card supports my Mac OSX really well. In my own view, I thought these products lack the support for other operating systems other than Windows.I can&apos;t help take a picture of it.Its...</summary>
    <author>
        <name>Guanqun</name>
        
    </author>
    
        <category term="Mac Related" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Misc" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="wireless" label="wireless" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-US" xml:base="http://www.codedotstar.com/">
        <![CDATA[I'm surprised by the fact that Huawei CDMA card supports my Mac OSX really well. In my own view, I thought these products lack the support for other operating systems other than Windows.<div><br /></div><div>I can't help take a picture of it.<div><img alt="cdma-card.jpg" src="http://www.codedotstar.com/cdma-card.jpg" width="462" height="448" class="mt-image-center" style="text-align: center; display: block; margin: 0 auto 20px;" /><div>Its application name is called "MobilePartner". At the first setup, we have to create a new configuration. Click 'New' in 'Connection Management' section, and press 'OK' button afterwards. Everything should be fine.</div><div><br /></div><div>This card is for my nephew, I'm thinking buying one for my own use. If you ask how much it costs, well, it's 1300 RMB in total (the hardware and the service price).</div></div></div>]]>
        
    </content>
</entry>

<entry>
    <title>access method</title>
    <link rel="alternate" type="text/html" href="http://www.codedotstar.com/2010/02/access-method.html" />
    <id>tag:www.codedotstar.com,2010://1.17</id>

    <published>2010-02-04T14:05:18Z</published>
    <updated>2010-02-04T14:15:10Z</updated>

    <summary>In Stonebraker&apos;s &quot;The Implementation of Postgres&quot; paper, he et al mentioned that they designed the access method TOO HARD. Because there were two many connections for this sub-system to work well. You have to know:lock managerbuffer managerknow the states between...</summary>
    <author>
        <name>Guanqun</name>
        
    </author>
    
        <category term="Database" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="postgresql" label="postgresql" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-US" xml:base="http://www.codedotstar.com/">
        <![CDATA[In Stonebraker's "The Implementation of Postgres" paper, he et al mentioned that they designed the access method TOO HARD. Because there were two many connections for this sub-system to work well. You have to know:<div><ol><li>lock manager</li><li>buffer manager</li><li>know the states between the query engine</li><li>write 13 non-trival routines</li></ol></div><div>So it seems it's a good start to get hands dirty on this part, hopefully it will get myself quicker to be familiar with this database system.</div>]]>
        
    </content>
</entry>

<entry>
    <title>connect to postgresql on another machine</title>
    <link rel="alternate" type="text/html" href="http://www.codedotstar.com/2010/02/connect-to-postgresql-on-another-machine.html" />
    <id>tag:www.codedotstar.com,2010://1.16</id>

    <published>2010-02-04T02:23:35Z</published>
    <updated>2010-02-04T02:31:14Z</updated>

    <summary>If the postgresql is setup on a server, but you want to connect to it on another machine, say on your windows machine. We have to modify the pg_hba.conf file in DATADIR directory, add one line to it: host all...</summary>
    <author>
        <name>Guanqun</name>
        
    </author>
    
        <category term="Database" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="postgresql" label="postgresql" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-US" xml:base="http://www.codedotstar.com/">
        <![CDATA[If the postgresql is setup on a server, but you want to connect to it on another machine, say on your windows machine.
We have to modify the pg_hba.conf file in DATADIR directory, add one line to it:
<pre class="brush:cpp">
host    all     all             10.0.0.0/8              trust
</pre>
if the postgresql server is running, you can invoke
<pre class="brush:cpp">
pg_ctl reload -D DATADIR
</pre>
to reload the configurations.

HTH


]]>
        

    </content>
</entry>

<entry>
    <title>&apos;busy loop&apos; vs &apos;sleep&apos; related functions</title>
    <link rel="alternate" type="text/html" href="http://www.codedotstar.com/2010/01/busy-loop-vs-sleep-related-functions.html" />
    <id>tag:www.codedotstar.com,2010://1.15</id>

    <published>2010-01-29T10:30:15Z</published>
    <updated>2010-01-29T10:37:02Z</updated>

    <summary>If you&apos;re using usleep() or such of sleep functions in your program in order to mimic the latency, then you should be aware of the fact that it is VERY inaccurate. The smaller it sleeps, the more it becomes inaccurate....</summary>
    <author>
        <name>Guanqun</name>
        
    </author>
    
        <category term="Development" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="loop" label="loop" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en-US" xml:base="http://www.codedotstar.com/">
        <![CDATA[If you're using usleep() or such of sleep functions in your program in order to mimic the latency, then you should be aware of the fact that it is VERY inaccurate. The smaller it sleeps, the more it becomes inaccurate. Why? Because with sleep, it will introduce more context switches.To accommodate this program, we can take advantage of 'busy loop'. This technique is widely used in embedded system. It's simple, ugly? or effective? As long as it works, it's good!<br />]]>
        
    </content>
</entry>

</feed>
