<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>david mccuskey.com &#187; How-To</title>
	<atom:link href="http://davidmccuskey.com/category/how-to/feed/" rel="self" type="application/rss+xml" />
	<link>http://davidmccuskey.com</link>
	<description>my slice of the Internet</description>
	<lastBuildDate>Thu, 22 Jul 2010 16:58:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>How to do custom chart annotations in Flex</title>
		<link>http://davidmccuskey.com/2009/03/how-to-do-custom-chart-annotations-in-flex/</link>
		<comments>http://davidmccuskey.com/2009/03/how-to-do-custom-chart-annotations-in-flex/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 18:16:14 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[Code Sample]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[How-To]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[annotationElements]]></category>
		<category><![CDATA[backgroundElements]]></category>

		<guid isPermaLink="false">http://www.davidmccuskey.com/?p=150</guid>
		<description><![CDATA[Hunting around the &#8216;Net, I found a few good examples of creating chart annotations in Flex. One example app which helped me greatly was from a blog posting by Ely Greenfield. If you&#8217;re interested, you can view it on his website: chart annotation demo. Unfortunately, the code you can download from his site is a [...]]]></description>
			<content:encoded><![CDATA[<p>Hunting around the &#8216;Net, I found a few good examples of creating chart annotations in Flex.</p>

<p>One example app which helped me greatly was from a <a href="http://www.quietlyscheming.com/blog/2006/04/03/custom-chart-annotations/">blog posting by Ely Greenfield</a>. If you&#8217;re interested, you can view it on his website: <a href="http://demo.quietlyscheming.com/overlayDemo/index.html">chart annotation demo</a>.</p>

<p>Unfortunately, the code you can download from his site is a little old so it has problems compiling in Flex Builder 2+. I have updated the code, fixed some bugs in it and have it available here: <a href="http://davidmccuskey.com/wp-content/uploads/2010/07/OverlayDemo-fixed.zip" title="OverlayDemo-fixed.zip">download OverlayDemo-fixed.zip</a>.</p>

<p>Ely has other interesting demos on his site which are worth checking out. Some of my favorites are: the <a href="http://www.quietlyscheming.com/blog/charts/variable-radius-pie-chart/">variable radius pie chart demo</a>, the <a href="http://www.quietlyscheming.com/blog/charts/variable-radius-pie-chart/">interactive bubble chart demo</a>, and the <a href="http://www.quietlyscheming.com/blog/charts/dashed-lines/">dashed lines demo</a>.</p>

<h3>Resources</h3>

<p><em>annotation example by Ely Greenfield</em></p>


<ul>
<li><a href="http://www.quietlyscheming.com/blog/2006/04/03/custom-chart-annotations/">http://www.quietlyscheming.com/blog/2006/04/03/custom-chart-annotations/</a></li>
<li>demo: <a href="http://demo.quietlyscheming.com/overlayDemo/index.html">http://demo.quietlyscheming.com/overlayDemo/index.html</a></li>
</ul>



<p><em>annotation example by Brendan Meutzner</em></p>


<ul>
<li><a href="http://www.stretchmedia.ca/blog/index.cfm/2007/3/28/Chart-Milestones-using-annotationElements">http://www.stretchmedia.ca/blog/index.cfm/2007/3/28/Chart-Milestones-using-annotationElements</a></li>
<li>demo: <a href="http://www.stretchmedia.ca/code_examples/chart_milestone/main.html">http://www.stretchmedia.ca/code_examples/chart_milestone/main.html</a></li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://davidmccuskey.com/2009/03/how-to-do-custom-chart-annotations-in-flex/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to build and install the Metakit DB for Python on MacOSX</title>
		<link>http://davidmccuskey.com/2009/02/how-to-build-and-install-the-metakit-db-for-python-on-macosx/</link>
		<comments>http://davidmccuskey.com/2009/02/how-to-build-and-install-the-metakit-db-for-python-on-macosx/#comments</comments>
		<pubDate>Wed, 11 Feb 2009 02:39:38 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[Code Sample]]></category>
		<category><![CDATA[Geek]]></category>
		<category><![CDATA[How-To]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[macosx]]></category>
		<category><![CDATA[metakit]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.davidmccuskey.com/?p=237</guid>
		<description><![CDATA[Ever since I used it years ago on a geek-project for my Zaurus, the Metakit DB has always been a favorite of mine. I had the chance to use it again on another personal project and this time on MacOSX. Unfortunately, the prebuilt binaries on the Metakit site are for older versions of MacOSX, so [...]]]></description>
			<content:encoded><![CDATA[<p>Ever since I used it years ago on a geek-project for my Zaurus, the Metakit DB has always been a favorite of mine. I had the chance to use it again on another personal project and this time on MacOSX. Unfortunately, the prebuilt binaries on the Metakit site are for older versions of MacOSX, so I had to build it myself.</p>

<p>Normally one would simply follow the <a href="http://www.equi4.com/pub/mk/">Metakit installation instructions</a>, but they are old and didn&#8217;t work correctly with 10.5 Leopard. I scraped enough information together from the Internet to get it working, but I had to do a lot of research. To save others the same hassle, I have put together all of the changes and put them here in their entirety:</p>

<p><strong>Building Metakit</strong></p>

<p>Make sure you have Xcode installed on your system before starting.</p>

<p>Get the latest source from the <a href="http://www.equi4.com/pub/mk/">Metakit downloads page</a>. At this time the latest version is <code>metakit-2.4.9.7.tar.gz</code>.</p>

<p>Uncompress the archive in a work directory and run the following commands:</p>



<pre>
&amp;gt; cd builds
&amp;gt; ../unix/configure --with-python=/System/Library/Frameworks/Python.framework/Versions/2.5
</pre>



<p>Note: Your Python install might be in a different location. If so, give the  <code>--with-python</code> arg the proper value.</p>

<p><em>&#8220;Fat&#8221; binary setup</em></p>

<p>If you need this to run on the <span class="caps">PPC </span>architecture you will need to make a couple of modifications to <code>./builds/Makefile</code> <em>after</em> running <code>configure</code>, otherwise you can skip this step and build the binaries with <code>make</code>.</p>

<p>Find <code>CXXFLAGS = $(CXX_FLAGS)</code> and change to the following:</p>



<pre>
CXXFLAGS = $(CXX_FLAGS) -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk
</pre>



<p>Find <code>SHLIB_LD = g++ -dynamiclib -flat_namespace -undefined suppress</code> and change to the following:</p>



<pre>
SHLIB_LD = g++ -dynamiclib -flat_namespace -undefined suppress -arch ppc -arch i386
</pre>



<p><em>Build the binaries</em></p>

<p>Run your typical <code>Makefile</code> commands:</p>



<pre>
&amp;gt; make
&amp;gt; make test
</pre>



<p><strong>Installing Metakit</strong></p>

<p>Rename the shared library which is now in the <code>./builds</code> directory:</p>



<pre>
&amp;gt; mv Mk4py.dylib Mk4py.so
</pre>



<p>And copy the following files to <code>/System/Library/Frameworks/Python.framework/Versions/2.5/Extras/lib/python</code> (be sure to adjust the path name for your version of Python):</p>



<pre>
../python/metakit.py
./Mk4py.so
</pre>



<p><strong>Testing Metakit</strong></p>

<p>At this point you should have a working system and ought to be able to run the following command in a Python shell without issue:</p>



<pre>
&amp;gt;&amp;gt;&amp;gt;from metakit import *
</pre>



<p>Enjoy !</p>

<h3>Resources</h3>


<ul>
<li><a href="http://www.equi4.com/metakit/python.html">Metakit for Python website</a></li>
</ul>




<ul>
<li><a href="http://www.ospace.net/wiki/index.php/ServerHowTo">helpful instructions from www.ospace.net</a></li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://davidmccuskey.com/2009/02/how-to-build-and-install-the-metakit-db-for-python-on-macosx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hacking the front page to display my blog entries</title>
		<link>http://davidmccuskey.com/2006/03/hacking-the-front-page-to-display-my-blog-entries/</link>
		<comments>http://davidmccuskey.com/2006/03/hacking-the-front-page-to-display-my-blog-entries/#comments</comments>
		<pubDate>Mon, 13 Mar 2006 01:53:28 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[How-To]]></category>
		<category><![CDATA[main template]]></category>
		<category><![CDATA[plone]]></category>

		<guid isPermaLink="false">http://www.davidmccuskey.com/files/hacking-the-front-page-to-display-my-blog-entries.html#unique-entry-id-6</guid>
		<description><![CDATA[The problem I wanted the home page of my web site to show my blog entries and also be a little more dynamic by displaying other related content. The default index_html page for my blog software, Quills, does display the current entries, but from what I read online there was no great solution to get [...]]]></description>
			<content:encoded><![CDATA[<h3>The problem</h3>

<p>I wanted the home page of my web site to show my blog entries and also be a little more dynamic by displaying other related content.</p>

<p>The default <code>index_html</code> page for my blog software, Quills, does display the current entries, but from what I read online there was no great solution to get its default page to show at the root.</p>

<p>Plan B was to replace my generic <code>index_html</code> page with one which would query the Quills weblog object for all of its entries and then display them one at a time. I wanted to use one of Plone&#8217;s built-in user-addable types for the script but as far as I can tell they are only used to display formatted text and won&#8217;t execute any code. I finally used the Zope Management Interface (ZMI) to add a single Zope Page Template (ZPT) called <code>index_html</code>.</p>

<h3>Understanding how Plone draws a page</h3>

<p>I read several chapters in the book <em>The Definitive Guide to Plone</em> to figure out how to proceed, but the one which gave the most pertinent information was <strong>Chapter 7 &#8211; Customizing the Main Template</strong>.</p>

<p>In short, Plone has a special Zope Page Template (ZPT)  at <code>/your_plone_site_folder/portal_skins/plone_templates/main_template</code> which contains the <span class="caps">HTML </span>and special markup used to render the basic structure of each page in the site. Among other things, the markup defines regions within the page called <code>define-slots</code>. These slots are <strong>filled in</strong> by an object as it is being rendered for view in the browser. Using a master template like this assures that the site has a consistent page layout.</p>

<p>Within this master template there are slots defined for different sections of the <span class="caps">HTML </span>like <code>head_slot</code>, <code>css_slot</code>, <code>column_one_slot</code>, and <code>content</code>. Some examples of these slot definitions follow. Notice that they can be within different types of tags.</p>



<pre><code>
  This content will be replaced.

&lt;td&gt;...&lt;/td&gt;
</code></pre>



<p>When you are rendering <em>your</em> <span class="caps">ZPT, </span>you define the areas which will &#8220;fill&#8221; these slots and place the pertinent content within them. These areas are appropriately called <code>fill-slots</code>. Here are some examples:</p>



<pre><code>
  your stuff here


&lt;div&gt;
  your stuff here
&lt;/div&gt;
</code></pre>



<p>There are other things to know about how a page gets rendered, but this is the basic idea.</p>

<h3>Creating the page</h3>

<p>With <code>define-slots</code>  and <code>fill-slots</code> in mind, I created my <span class="caps">ZPT </span>at the root of my Plone site called <code>index_html</code> so I could start hacking. For my purposes I was only interested in changing the fill-slot <code>main</code> so I defined my fill-slot like above and put some bogus content in it to make sure I was on the right track. I filled out the rest of the code with guidance from examples in the book, other code in the Plone <code>portal_skins</code> area as well as in the Quills product directory.</p>

<h3>Getting the entries</h3>

<p>The Quills file <code>/Zope/Products/Quills/WeblogArchive.py</code> had two methods defined which return a list of blog entries &#8211; <code>getEntries()</code> and <code>getLazyEntries()</code>. The difference being that the latter only returns the catalog search objects, so it&#8217;s fast but the data which can be displayed is limited to the metadata definitions in the <code>portal_catalog</code>. I was hoping to get the full text of the entry so initially used <code>getEntries()</code>, but it turned out to be too slow.</p>

<h3>Keeping with the site look</h3>

<p>Next I wanted to use as much of the site style sheet as possible too keep the look consistent. Most of the important entries are in the main style sheet which is found at <code>/your_plone_site_folder/portal_skins/plone_styles/plone.css</code>.</p>

<h3>Extras</h3>

<p>I added this page to the site <span class="caps">RAM</span> Cache since this is the front page and the entries don&#8217;t change very often. <span class="caps">ZMI </span>&gt; Cache Tab &gt; Cache Object Using <span class="caps">RAM</span> Cache &gt; Save Changes. Easy.</p>

<p>I also hacked together an <span class="caps">RSS </span>icon and feed in the h1 title.</p>

<h3>Things to update</h3>

<p>My page works, but I should tidy up some of the <span class="caps">CSS </span>and change the design to be a little more interesting. I also have hard-coded the name of my weblog object instead of using the <code>portal_catalog</code> to find it for me.</p>

<p>You can <a href="/wp-content/uploads/2010/07/blog-entry-code.txt" title="blog-entry-code.txt" alt="blog-entry-code.txt"> click here to download the template</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://davidmccuskey.com/2006/03/hacking-the-front-page-to-display-my-blog-entries/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setup MarsEdit with Quills 0.9 Final</title>
		<link>http://davidmccuskey.com/2006/02/setup-marsedit-with-quills-09-final/</link>
		<comments>http://davidmccuskey.com/2006/02/setup-marsedit-with-quills-09-final/#comments</comments>
		<pubDate>Sun, 26 Feb 2006 02:30:08 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[How-To]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[plone]]></category>
		<category><![CDATA[zope]]></category>

		<guid isPermaLink="false">http://www.davidmccuskey.com/files/setup-marsedit-with-quills-0.9-final.html#unique-entry-id-3</guid>
		<description><![CDATA[I have been wanting to find a better way to write blogs rather than using the Plone interface. I was happy to find that MarsEdit and Quills both implement several blog APIs. Though it would appear that the implementation for both the BloggerAPI and the MetaWeblogAPI are not complete, MarsEdit can still be used to [...]]]></description>
			<content:encoded><![CDATA[<p>I have been wanting to find a better way to write blogs rather than using the Plone interface. I was happy to find that MarsEdit and Quills both implement several blog <span class="caps">API</span>s. Though it would appear that the implementation for both the BloggerAPI and the MetaWeblogAPI are not complete, MarsEdit can still be used to post articles using the BloggerAPI.</p>

<p>Here are examples of necessary configuration:</p>



<pre><code>Name: MyBlog
Home URL: http://www.davidmccuskey.com/weblog
Software: Other Blogger-compatible
RPC URL: http://www.davidmccuskey.com/weblog
Blog ID: weblog.2006-01-10.2395214781</code></pre>



<p>The tricky part is obtaining the Blog <span class="caps">ID.</span> Plone uses an immutable identifier for all objects so that they can be found even after renaming them. Quills in turn uses this ID to get at your weblog object.</p>

<p>In order get this ID you&#8217;ll need to login to your Zope Management Interface (ZMI) and go digging through the <strong>uid_catalog</strong> in Plone. When you have clicked on the catalog object, click on the <em>tab</em> labeled Catalog. Find your blog object in the list of results and click on its link.</p>

<p>Search on the resulting popup page for the key named <strong><span class="caps">UID</span></strong>. The value of this key is what you will need to use for the Blog <span class="caps">ID.</span></p>

<p>Note: Because of errors in the implementation of the MetaWeblog <span class="caps">API, </span>you will see a Zope error after posting, however the post will be correctly saved.</p>]]></content:encoded>
			<wfw:commentRss>http://davidmccuskey.com/2006/02/setup-marsedit-with-quills-09-final/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Added AdSense by Google</title>
		<link>http://davidmccuskey.com/2006/02/added-adsense-by-google/</link>
		<comments>http://davidmccuskey.com/2006/02/added-adsense-by-google/#comments</comments>
		<pubDate>Tue, 14 Feb 2006 16:20:58 +0000</pubDate>
		<dc:creator>david</dc:creator>
				<category><![CDATA[How-To]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.davidmccuskey.com/files/added-adsense-by-google.html#unique-entry-id-1</guid>
		<description><![CDATA[One thing that I like about Google is that they make things easy. One thing that I like about Plone and Zope is that they make things easy. In about an hour or two, I managed to put AdSense ads on my web site. Go to Google.com/adsense and sign up for your account. Click on [...]]]></description>
			<content:encoded><![CDATA[<p>One thing that I like about Google is that they make things easy.</p>

<p>One thing that I like about Plone and Zope is that they make things easy.</p>

<p>In about an hour or two, I managed to put AdSense ads on my web site.</p>


<ol>
<li>Go to Google.com/adsense and sign up for your account. Click on all of the emails to activate your account. Log in and grab your AdSense code.</li>
<li>Add a portlet to your custom area in Plone. Paste Google&#8217;s AdSense code in the body of your portlet.</li>
<li>Add portlet to your root Plone <code>right_slots</code> property. Refresh your browser to see your Google ads.</li>
</ol>



<h3>Resources</h3>


<ul>
<li><a href="http://www.agmweb.ca/plone/book/scripts.html">Plone book errata</a><br />
This webpage has an Google AdSense portlet example in <span class="caps">ZPT.</span> Search for <em>&#8220;Page Template: google_ad_portlet&#8221;</em></li>
<li><a href="http://plone.org/documentation/how-to/create-static-slot">Plone.org : A webpage with an example Page Template used to create a portlet</a></li>
<li><a href="http://plone.org/documentation/how-to/control-portlets">Plone.org &#8211; how to control portlets</a><br />
A website which has instructions on properties which control portlet activation.</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://davidmccuskey.com/2006/02/added-adsense-by-google/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

