<?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>Webmasterwords</title>
	<atom:link href="http://www.webmasterwords.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.webmasterwords.com</link>
	<description>Useful snippets for Webmasters</description>
	<lastBuildDate>Wed, 21 Sep 2011 15:55:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Python UCM Client</title>
		<link>http://www.webmasterwords.com/python-ucm-client?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=python-ucm-client</link>
		<comments>http://www.webmasterwords.com/python-ucm-client#comments</comments>
		<pubDate>Fri, 16 Sep 2011 17:03:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.webmasterwords.com/?p=60</guid>
		<description><![CDATA[This package provides a simple client for calling the services on Oracle Content Server 11g via the standard web interface. It can be used in conjunction with any of the services provided by Content Server defined <a href="http://download.oracle.com/docs/cd/E14571_01/doc.1111/e11011/toc.htm">here</a>

<h2>Installation</h2>

easy_install ucmclient

<h2>Examples</h2>

<h3>Uploading a file to Content Server</h3>


from ucmclient import UcmClient, ServiceFailed

#connect to ucm with specified hostname and content server port
ucmClient = UcmClient('ucmserver.example.com','16200')
ucmClient.login('weblogic','password')

#build a dictionary of service parameters.
ucmServiceData ={
 'dDocTitle':'New Article 1',
 'dDocName':'News_Article_01',
 'dDocType':'News']]></description>
			<content:encoded><![CDATA[<p>This package provides a simple client for calling the services on Oracle Content Server 11g via the standard web interface. It can be used in conjunction with any of the services provided by Content Server  defined <a href="http://download.oracle.com/docs/cd/E14571_01/doc.1111/e11011/toc.htm">here</a></p>
<h2>Installation</h2>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">easy_install ucmclient</pre></div></div>

<h2>Examples</h2>
<h3>Uploading a file to Content Server</h3>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> ucmclient <span style="color: #ff7700;font-weight:bold;">import</span> UcmClient, ServiceFailed
&nbsp;
<span style="color: #808080; font-style: italic;">#connect to ucm with specified hostname and content server port</span>
ucmClient = UcmClient<span style="color: black;">&#40;</span><span style="color: #483d8b;">'ucmserver.example.com'</span>,<span style="color: #483d8b;">'16200'</span><span style="color: black;">&#41;</span>
ucmClient.<span style="color: black;">login</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'weblogic'</span>,<span style="color: #483d8b;">'password'</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#build a dictionary of service parameters.</span>
ucmServiceData =<span style="color: black;">&#123;</span>
    <span style="color: #483d8b;">'dDocTitle'</span>:<span style="color: #483d8b;">'New Article 1'</span>,
    <span style="color: #483d8b;">'dDocName'</span>:<span style="color: #483d8b;">'News_Article_01'</span>,
    <span style="color: #483d8b;">'dDocType'</span>:<span style="color: #483d8b;">'News'</span>,
    <span style="color: #483d8b;">'dDocAuthor'</span>:<span style="color: #483d8b;">'weblogic'</span>,
    <span style="color: #483d8b;">'dDocAccount'</span>:<span style="color: #483d8b;">'weblogic'</span>,
    <span style="color: #483d8b;">'dSecurityGroup'</span>:<span style="color: #483d8b;">'Public'</span>,
    <span style="color: #808080; font-style: italic;">#files can be submitted using an open file object</span>
    <span style="color: #483d8b;">'primaryFile'</span>:<span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'news.txt'</span>,<span style="color: #483d8b;">'r'</span><span style="color: black;">&#41;</span>
<span style="color: black;">&#125;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">try</span>:
    ucmClient.<span style="color: black;">call_service</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'CHECKIN_UNIVERSAL'</span>,ucmServiceData<span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">except</span> ServiceFailed <span style="color: #ff7700;font-weight:bold;">as</span> e:
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">'checkin failed - %s'</span> <span style="color: #66cc66;">%</span> e</pre></div></div>

<h3>Searching for files on Content Server</h3>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> ucmclient <span style="color: #ff7700;font-weight:bold;">import</span> UcmClient, ServiceFailed
&nbsp;
ucmClient = UcmClient<span style="color: black;">&#40;</span><span style="color: #483d8b;">'ucmserver.example.com'</span>,<span style="color: #483d8b;">'16200'</span><span style="color: black;">&#41;</span>
ucmClient.<span style="color: black;">login</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'weblogic'</span>,<span style="color: #483d8b;">'password'</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#Search for files of type News</span>
ucmServiceData = <span style="color: black;">&#123;</span>
        <span style="color: #483d8b;">'QueryText'</span>:<span style="color: #483d8b;">'dDocType&lt;matches&gt;`News`'</span>,
        <span style="color: #483d8b;">'ResultCount'</span>:<span style="color: #ff4500;">10</span>
<span style="color: black;">&#125;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">try</span>:
    search = ucmClient.<span style="color: black;">call_service</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'GET_SEARCH_RESULTS'</span>,ucmServiceData<span style="color: black;">&#41;</span>
    <span style="color: #808080; font-style: italic;">#Access resultset by name and iterate through results</span>
    <span style="color: #ff7700;font-weight:bold;">for</span> doc <span style="color: #ff7700;font-weight:bold;">in</span> search.<span style="color: black;">fetch</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'SearchResults'</span><span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">print</span> doc<span style="color: black;">&#91;</span><span style="color: #483d8b;">'dDocName'</span><span style="color: black;">&#93;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">except</span> ServiceFailed <span style="color: #ff7700;font-weight:bold;">as</span> e:
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">'search failed - %s'</span> <span style="color: #66cc66;">%</span> e</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.webmasterwords.com/python-ucm-client/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The python &quot;with&quot; statement explained with examples.</title>
		<link>http://www.webmasterwords.com/python-with-statement?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=python-with-statement</link>
		<comments>http://www.webmasterwords.com/python-with-statement#comments</comments>
		<pubDate>Wed, 14 Sep 2011 18:21:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.webmasterwords.com/?p=54</guid>
		<description><![CDATA[Python's with statement was introduced into the language in version 2.5 and is defined in <a href="http://www.python.org/dev/peps/pep-0343/">PEP 343</a>. The python docs provide the following description "The with statement is used to wrap the execution of a block with methods defined by a context manager. This allows common try...except...finally usage patterns to be encapsulated for convenient reuse." but what does this actually mean?

Lets start with an example:

<h2>With File</h2>


with open("test.txt") as testfile]]></description>
			<content:encoded><![CDATA[<p>Python&#8217;s with statement was introduced into the language in version 2.5 and is defined in <a href="http://www.python.org/dev/peps/pep-0343/">PEP 343</a>. The python docs provide the following description &#8220;The with statement is used to wrap the execution of a block with methods defined by a context manager. This allows common try&#8230;except&#8230;finally usage patterns to be encapsulated for convenient reuse.&#8221; but what does this actually mean?</p>
<p>Lets start with an example:</p>
<h2>With File</h2>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">with</span> <span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;test.txt&quot;</span><span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">as</span> testfile:
    testcontents = testfile.<span style="color: black;">read</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">print</span> testcontents</pre></div></div>

<p>This example demonstrates opening and printing the contents of a file &#8220;test.txt&#8217; to the stdout. The first thing most people should (hopefully) notice is that when using the &#8220;with&#8221; statement it is not necessary to close the file after we&#8217;ve used it. Thats because the open function provides a context manager which closes the file after use.</p>
<p>In python a context manager in is an object that defines how a resource should be initially setup for use and cleared up after use. It implements two functions __enter__ which is called when the resource is setup and __exit__ when it is no longer needed. Its is the __exit__ method of the open file context manager that ensures the file is closed after use.</p>
<h2>Another Context Manager</h2>
<p>A very common application functionality is to access a database, add some records and finally commit those updates as a transaction. Using SQLAlchemy it would look something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> sqlalchemy <span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #66cc66;">*</span>
&nbsp;
db = create_engine<span style="color: black;">&#40;</span><span style="color: #483d8b;">'sqlite:///test.db'</span><span style="color: black;">&#41;</span>
dbcon =  db.<span style="color: black;">connect</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
transaction = dbcon.<span style="color: black;">begin</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
dbcon.<span style="color: black;">execute</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'insert into NameDB (FirstName, LastName,Age) values (&quot;john&quot;,&quot;smith&quot;,34)'</span><span style="color: black;">&#41;</span>
dbcon.<span style="color: black;">execute</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'insert into NameDB (FirstName, LastName,Age) values (&quot;dave&quot;,&quot;smith&quot;,37)'</span><span style="color: black;">&#41;</span>
transaction.<span style="color: black;">commit</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>You can see that here the resource in question is the database transaction, we set it up before the inserts and close it after the commit. However because the SQLAlchemy transaction object implement a context manager the above code could be written more succinctly as:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> sqlalchemy <span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #66cc66;">*</span>
&nbsp;
db = create_engine<span style="color: black;">&#40;</span><span style="color: #483d8b;">'sqlite:///test.db'</span><span style="color: black;">&#41;</span>
dbcon =  db.<span style="color: black;">connect</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">with</span> dbcon.<span style="color: black;">begin</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
    dbcon.<span style="color: black;">execute</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'insert into NameDB (FirstName, LastName,Age) values (&quot;john&quot;,&quot;smith&quot;,34)'</span><span style="color: black;">&#41;</span>
    dbcon.<span style="color: black;">execute</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'insert into NameDB (FirstName, LastName,Age) values (&quot;dave&quot;,&quot;smith&quot;,37)'</span><span style="color: black;">&#41;</span></pre></div></div>

<p>In the next post I will discuss creating your own context managers.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webmasterwords.com/python-with-statement/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python Split and Join Examples</title>
		<link>http://www.webmasterwords.com/python-split-and-join-examples?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=python-split-and-join-examples</link>
		<comments>http://www.webmasterwords.com/python-split-and-join-examples#comments</comments>
		<pubDate>Mon, 26 Jan 2009 12:39:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.webmasterwords.com/python-split-and-join-examples</guid>
		<description><![CDATA[Split and join in python are similar to the equivalent functions in most dynamic languages with a few minor differences:

<strong>Python Split</strong>

Split a sentence into separate words:

sentence = "the cat sat on the mat"
print sentence.split()
['the', 'cat', 'sat', 'on', 'the', 'mat']
Split words separated by a single character:

sentence = "the,cat,sat,on,the,mat"
print sentence.split(',')
['the', 'cat', 'sat', 'on', 'the', 'mat']
Split words separated by a string:

sentence = "theSPACEcatSPACEsatSPACEonSPACEtheSPACEmat"
print sentence.split('SPACE')
['the', 'cat', 'sat', 'on', 'the', 'mat']
Split only the first two]]></description>
			<content:encoded><![CDATA[<p>Split and join in python are similar to the equivalent functions in most dynamic languages with a few minor differences:</p>
<p><strong>Python Split</strong></p>
<p>Split a sentence into separate words:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">sentence = <span style="color: #483d8b;">&quot;the cat sat on the mat&quot;</span>
<span style="color: #ff7700;font-weight:bold;">print</span> sentence.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: black;">&#91;</span><span style="color: #483d8b;">'the'</span>, <span style="color: #483d8b;">'cat'</span>, <span style="color: #483d8b;">'sat'</span>, <span style="color: #483d8b;">'on'</span>, <span style="color: #483d8b;">'the'</span>, <span style="color: #483d8b;">'mat'</span><span style="color: black;">&#93;</span></pre></div></div>

<p>Split words separated by a single character:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">sentence = <span style="color: #483d8b;">&quot;the,cat,sat,on,the,mat&quot;</span>
<span style="color: #ff7700;font-weight:bold;">print</span> sentence.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">','</span><span style="color: black;">&#41;</span>
<span style="color: black;">&#91;</span><span style="color: #483d8b;">'the'</span>, <span style="color: #483d8b;">'cat'</span>, <span style="color: #483d8b;">'sat'</span>, <span style="color: #483d8b;">'on'</span>, <span style="color: #483d8b;">'the'</span>, <span style="color: #483d8b;">'mat'</span><span style="color: black;">&#93;</span></pre></div></div>

<p>Split words separated by a string:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">sentence = <span style="color: #483d8b;">&quot;theSPACEcatSPACEsatSPACEonSPACEtheSPACEmat&quot;</span>
<span style="color: #ff7700;font-weight:bold;">print</span> sentence.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'SPACE'</span><span style="color: black;">&#41;</span>
<span style="color: black;">&#91;</span><span style="color: #483d8b;">'the'</span>, <span style="color: #483d8b;">'cat'</span>, <span style="color: #483d8b;">'sat'</span>, <span style="color: #483d8b;">'on'</span>, <span style="color: #483d8b;">'the'</span>, <span style="color: #483d8b;">'mat'</span><span style="color: black;">&#93;</span></pre></div></div>

<p>Split only the first two words in a comma separated string</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">sentence = <span style="color: #483d8b;">&quot;the,cat,sat,on,the,mat&quot;</span>
<span style="color: #ff7700;font-weight:bold;">print</span> sentence.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">','</span>,<span style="color: #ff4500;">2</span><span style="color: black;">&#41;</span>
<span style="color: black;">&#91;</span><span style="color: #483d8b;">'the'</span>, <span style="color: #483d8b;">'cat'</span>, <span style="color: #483d8b;">'sat,on,the,mat'</span><span style="color: black;">&#93;</span></pre></div></div>

<p><strong>Python Join</strong></p>
<p>Join uses a sligthly difference implmentation to what you might be used to. The character that joins the elements is the one upon which the function is called</p>
<p>Joining an array with spaces</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #66cc66;">&gt;&gt;&gt;</span> <span style="color: #483d8b;">' '</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'the'</span>, <span style="color: #483d8b;">'cat'</span>, <span style="color: #483d8b;">'sat'</span>, <span style="color: #483d8b;">'on'</span>, <span style="color: #483d8b;">'the'</span>, <span style="color: #483d8b;">'mat'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
<span style="color: #483d8b;">'the cat sat on the mat'</span></pre></div></div>

<p>Joining an array with commas</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #66cc66;">&gt;&gt;&gt;</span> <span style="color: #483d8b;">','</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'the'</span>, <span style="color: #483d8b;">'cat'</span>, <span style="color: #483d8b;">'sat'</span>, <span style="color: #483d8b;">'on'</span>, <span style="color: #483d8b;">'the'</span>, <span style="color: #483d8b;">'mat'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
<span style="color: #483d8b;">'the,cat,sat,on,the,mat'</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.webmasterwords.com/python-split-and-join-examples/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Reset Mysql Root Password Script</title>
		<link>http://www.webmasterwords.com/mysql-root-password-reset-script?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mysql-root-password-reset-script</link>
		<comments>http://www.webmasterwords.com/mysql-root-password-reset-script#comments</comments>
		<pubDate>Fri, 23 Jan 2009 17:27:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Hosting]]></category>

		<guid isPermaLink="false">http://www.webmasterwords.com/mysql-root-password-reset-script</guid>
		<description><![CDATA[Lost (forgotten) your mysql root / admin password? Not to worry, it happens to the best of us.

This simple BASH password reset script will enable you to reset any mysql user password without knowing the current password

I would not recommend running it on a live production system as it requires shutting down the mysql server.

Heres the script:, it needs to be run as root.

# Kill any mysql processes currently running
echo]]></description>
			<content:encoded><![CDATA[<p>Lost (forgotten) your mysql root / admin password? Not to worry, it happens to the best of us.</p>
<p>This simple BASH password reset script will enable you to reset any mysql user password without knowing the current password</p>
<p>I would not recommend running it on a live production system as it requires shutting down the mysql server.</p>
<p>Heres the script:, it needs to be run as root.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Kill any mysql processes currently running</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'Shutting down any mysql processes...'</span>
<span style="color: #c20cb9; font-weight: bold;">killall</span> <span style="color: #660033;">-vw</span> mysqld
&nbsp;
<span style="color: #666666; font-style: italic;"># Start mysql without grant tables</span>
mysqld_safe <span style="color: #660033;">--skip-grant-tables</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt;res <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&amp;</span>gt;<span style="color: #000000; font-weight: bold;">&amp;</span>amp;<span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">&amp;</span>amp;
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'Resetting password...'</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#Sleep for 5 while the new mysql process loads (if get a connection error you might need to increase this.</span>
<span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #000000;">5</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#Update user with new password</span>
mysql mysql <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;UPDATE user SET Password=PASSWORD('$2') WHERE User='$1';FLUSH PRIVILEGES;&quot;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">'Cleaning up..'</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#Kill the insecure mysql process</span>
<span style="color: #c20cb9; font-weight: bold;">killall</span> <span style="color: #660033;">-v</span> mysqld</pre></div></div>

<p>First variable is the user you want to reset, second variable is the password.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sh</span> mysqlreset root newpassword</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.webmasterwords.com/mysql-root-password-reset-script/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flex on Linux &#8211; Hello World Example</title>
		<link>http://www.webmasterwords.com/flex-developement-on-linux-hello-world-example?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=flex-developement-on-linux-hello-world-example</link>
		<comments>http://www.webmasterwords.com/flex-developement-on-linux-hello-world-example#comments</comments>
		<pubDate>Sat, 20 Dec 2008 12:51:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.webmasterwords.com/flex-developement-on-linux-hello-world-example</guid>
		<description><![CDATA[Now that adobe have improved Linux support for the flash player (including 64-bit systems) and released the open source flex SDK, its now relatively easy to develop fully fledged flex applications on your Linux machine. This post is designed to be an introduction to get you up and running on flex, more posts will follow with examples from a flex + python + sqllite application that I'm current building using]]></description>
			<content:encoded><![CDATA[<p>Now that adobe have improved Linux support for the flash player (including 64-bit systems) and released the open source flex SDK, its now relatively easy to develop fully fledged flex applications on your Linux machine. This post is designed to be an introduction to get you up and running on flex, more posts will follow with examples from a flex + python + sqllite application that I&#8217;m current building using a Linux developement enviroment (Ubuntu / Fedora 64-bit).</p>
<p>First things first you&#8217;ll need to get the flex SDK from adobe.com. For some reason Abobe are keen to persuade everyone to do this via their flex builder free 60 day trial. You do not need flex builder to build flex apps, although I&#8217;ve played with it and it seems to be fairly well conceived tool i&#8217;m not a fan of developing in an application that&#8217;ll ill have to pay for after 60 days, thats not really the open source way. So just grab the Flex SDK from:</p>
<p><a href="http://www.adobe.com/products/flex/flexdownloads/index.html#sdk">Adobe Flex SDK (118MB)</a></p>
<p>You&#8217;ll also require the Sun Java Developement Kit (JDK). Please note &#8211; <strong>it will not work with the native GIJ compiler on Ubuntu.</strong> You can JDK 6 from</p>
<p><a href="https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/ViewProductDetail-Start?ProductRef=jdk-6u11-oth-JPR@CDS-CDS_Developer">Sun Java 6 JDK</a></p>
<p>You&#8217;ll need to extract each archive into a directory (in this example use /opt/) Once extacted the two SDKs needed to be added to the PATH. Because flex won&#8217;t work with the native GIJ the reference to the Sun JDK needs to occur before the location of GIJ in the PATH. On my system the following export shell/terminal command works fine:</p>
<p><strong>export PATH=&#8221;/opt/java/jdk1.6.0_10/bin:/opt/flex/bin:$PATH&#8221;</strong></p>
<p>To make sure its worked run java -v in the terminal. This should report the Sun Java version.</p>
<p>This command will need to be run once for each new shell session when you wish to develope in flex. To do this automatically you can added it to your users .profile file.</p>
<p>Test you setup by downloading my very simple <a href="http://www.webmasterwords.com/helloworld.mxml" title="hello world">hello world flex script</a></p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:Application</span> <span style="color: #000066;">xmlns:mx</span>=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span> <span style="color: #000066;">creationComplete</span>=<span style="color: #ff0000;">&quot;start();&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mx:Script<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #339933;">&lt;![CDATA[</span>
<span style="color: #339933;">        import mx.controls.Alert;</span>
&nbsp;
<span style="color: #339933;">        public function start():void {</span>
<span style="color: #339933;">            Alert.show('Hello World, this is flex on linux!');</span>
<span style="color: #339933;">        }</span>
<span style="color: #339933;">        ]]&gt;</span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mx:Script<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mx:Application<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Run the flex compiler at the command line:</p>
<p><strong>mxmlc helloworld.mxml</strong></p>
<p>Test the generated swf in firefox</p>
<p><strong>firefox helloworld.swf</strong></p>
<p>hopefully you should see something like this &#8211; <a href="http://www.webmasterwords.com/helloworld.swf">Hello World Demo</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.webmasterwords.com/flex-developement-on-linux-hello-world-example/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Squid Proxy On Solaris</title>
		<link>http://www.webmasterwords.com/squid-proxy-on-solaris?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=squid-proxy-on-solaris</link>
		<comments>http://www.webmasterwords.com/squid-proxy-on-solaris#comments</comments>
		<pubDate>Thu, 23 Aug 2007 17:17:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Hosting]]></category>

		<guid isPermaLink="false">http://www.webmasterwords.com/squid-proxy-on-solaris</guid>
		<description><![CDATA[<p>As part of a project I required a proxy which would allow remote users to access serveral internal servers sitting behind our firewall from a single access point. The easiest way of accomplishing this is via a proxy. My first choice of proxy is squid which supports HTTP, HTTPS, FTP and protocols. Used in reverse proxy mode it also alows you to reduce the load on webservers serving dynamic content</p>]]></description>
			<content:encoded><![CDATA[<p>As part of a project I required a proxy which would allow remote users to access serveral internal servers sitting behind our firewall from a single access point. The easiest way of accomplishing this is via a proxy.  My first choice of proxy is squid which supports HTTP, HTTPS, FTP and protocols.  Used in reverse proxy mode it also alows you to reduce the load on webservers serving dynamic content which is an added bonus. I&#8217;m used to building most of my stuff on Redhat Enterprise severs so i found it a bit of a steep learning curve when handed a Solaris 8 SPARC server without even a basic C-complier. I thought i&#8217;d document my steps here as a reference for others.</p>
<p>Squid is built in C so without a C compiler i was faced with two options. Build GCC on the solaris box or find a pre-complied Solaris binary for squid. Well i&#8217;ve built GCC before an its not a whole heep of fun so I chickened out and went for a squid binary. Here are the steps required.</p>
<p>Goto www.sunfreeware.com</p>
<p>Pick the OS and Processor from the left hand menu and then find the squid binary.</p>
<p>Download the squid binary package to /opt/temp. Note solaris 8 didn&#8217;t have the excellent wget by default so you might need to push it on to the server via ftp.</p>
<p>Use gunzip to extract the package.<br />
<strong>gunzip -xf squidfilename.gz</strong></p>
<p>Add the package using pkgadd and follow the instructions.<br />
<strong>pkgadd squidfilename </strong></p>
<p>Squid is installed in <strong>/usr/local/squid </strong></p>
<p>In order to run squid you need to give make the logs directory writeable<br />
<strong>chmod 665 /usr/local/squid/log</strong></p>
<p>You&#8217;ll also need to create a cache dir<br />
<strong>mkdir /usr/local/squid/cache</strong></p>
<p>Make the directory writeable<strong><br />
chmod 665 /usr/local/squid/cache</strong></p>
<p>Know you need to create the cache filestructure. To do this run squid with the <strong>-z</strong> option<br />
<strong>./usr/local/squid/bin/squid -z</strong></p>
<p>You can alter the squid settings by editing /usr/local/squid/etc/squid.conf When you&#8217;re happy you can know run squid.<br />
<strong>./usr/local/squid/bin/squid</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.webmasterwords.com/squid-proxy-on-solaris/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Elastic Web Hosting and Amazon ec2</title>
		<link>http://www.webmasterwords.com/elastic-web-hosting?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=elastic-web-hosting</link>
		<comments>http://www.webmasterwords.com/elastic-web-hosting#comments</comments>
		<pubDate>Tue, 24 Apr 2007 11:33:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Hosting]]></category>

		<guid isPermaLink="false">http://www.webmasterwords.com/elastic-web-hosting</guid>
		<description><![CDATA[<strong>What is elastic webhosting?</strong>

Elastic web hosting in its simplest terms is a hosting account where resources can be rapidly expanded to meet demand. Still very much a new technology its use is gradually beginning to pick up as more and more people discover the limitations of fixed resource hosting. On a typical fixed hosting account you're allocated a fixed amount of resources and the amount you pay is based on]]></description>
			<content:encoded><![CDATA[<p><strong>What is elastic webhosting?</strong></p>
<p>Elastic web hosting in its simplest terms is a hosting account where resources can be rapidly expanded to meet demand. Still very much a new technology its use is gradually beginning to pick up as more and more people discover the limitations of fixed resource hosting. On a typical fixed hosting account you&#8217;re allocated a fixed amount of resources and the amount you pay is based on the size of those resources. This model means that in order to keep your site running smoothly you need to be able to accurately predict the maximum amount of load that the server will be subjected to. This can be a nightmare for small startup companies who may find it hard to judge how quickly their service will grow. With fixed resource hosting there are two options:</p>
<p>1. Buy a huge amount of resources initially so that should your website take off or receive unusually traffic spikes you won&#8217;t have to worry about migrating to a new server. This is a very costly solution and is often not viable for small startups.<br />
2. Buy a limited amount of resources initially and hope that you will have time to migrate the site to a new server should the website traffic increase. More cost effective but what happens if you your traffic increases rapidly over a number of days. The server gets swamped, there is no time to migrate and you&#8217;re facing downtime.<br />
But now there is a third option &#8211; Elastic hosting</p>
<p>With elastic hosting you can allocate additional resources in minutes should you server recieve an exceptional amount of traffic. Take for example Digg. Many smaller sites that get on the first page fall over because they do not have the resources to handle the huge amount of traffic that arrives over a period of 3-4 hours. In such a short space of time there is no chance of migrating the site to a new server and updating the name severs accordingly. This results in a loss of vistors and possibly missing out on potential revenue. Elastic hosting solves this. Not only can you allocate additional resources very quickly but more importantly it is often possible to automate the process. This is how it works.</p>
<p>1. A background process monitors resources on your server, it checks free memory, bandwidth, processing speed and disk space. More complex setups may also detect the rate of visitors to the site.</p>
<p>2. A sudden spike of traffic to the site causes the available memory to drop below a suitable level. The background process detects this drop and spawns another identical server and manages traffic with a load balancer.</p>
<p>3. The spike of traffic dies and the free memory on the server rises to an acceptable level. The background process recognizes this and terminates the additional resource.</p>
<p>You only pay for the amount of resources used. So instead of paying for a large amount of resources all the time you only pay for the additional resources when they are required.</p>
<p><strong>Elastic Hosting Providers</strong></p>
<p>Currently the most advanced elastic hosting package appears to be from Amazon in the form of their Amazon EC2 (elastic computing cloud) service. This service works in conjunction with their S3 image hosting service and data transfer between the services is completely free. Which means your bandwidth costs will be considerably lower than on a standard webhost. The only bandwidth you pay for is for data transfered outside of the amazon network. I&#8217;m currently testing this service out and will report back with my findings within a month or two.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webmasterwords.com/elastic-web-hosting/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ruby Rails Mongrel Apache Easy</title>
		<link>http://www.webmasterwords.com/ruby-rails-mongrel-apache-easy?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ruby-rails-mongrel-apache-easy</link>
		<comments>http://www.webmasterwords.com/ruby-rails-mongrel-apache-easy#comments</comments>
		<pubDate>Tue, 31 Oct 2006 17:24:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Hosting]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://www.webmasterwords.com/ruby-rails-mongrel-apache-easy</guid>
		<description><![CDATA[<p>Having attempted to set ruby on rails up many times, this is by far my favourite soloution and it also happens to be the simplest. Why did i go the mongrel route? Well because FastCgi with Apache make me want to cry. Its buggy (especially on fedora and CentOS) and its a pain in the ass to setup. Where as mongrel on the other hand is a piece of cake.</p>]]></description>
			<content:encoded><![CDATA[<p>Having attempted to set ruby on rails up many times, this is by far my favourite soloution and it also happens to be the simplest. Why did i go the mongrel route? Well because FastCgi with Apache make me want to cry. Its buggy (especially on fedora and CentOS) and its a pain in the ass to setup. Where as mongrel on the other hand is a piece of cake.</p>
<p>In theory you could run mongrel, bind it to port 80 and do away with apache all together. There are a few reasons why i don&#8217;t wanna do this:</p>
<p>1. I like apache, although its a bit of a resource hog its a solid and secure webserver, has tons of great features and a large community behind it.</p>
<p>2. The other stuff I&#8217;ll be running on the server is made up of static pages and other CGI scripts for which I still believe apache is the best option.</p>
<p>In order to serve a rails application on the default port 80 we will use apaches mod_proxy to forward requests to the mongrel server sitting onÂ  custom ports. To improve the performance its best to run more than once instance of the mongrel server and make use of apaches mod_proxy_balancer.</p>
<p>In order for this to work you&#8217;ll require a server running apache 2.2 and yum (or apt-get if your running a debian flavour).</p>
<p><strong>Installing ruby</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">yum <span style="color: #c20cb9; font-weight: bold;">install</span> ruby ruby-devel
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>rubyforge.org<span style="color: #000000; font-weight: bold;">/</span>frs<span style="color: #000000; font-weight: bold;">/</span>download.php<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">11289</span><span style="color: #000000; font-weight: bold;">/</span>rubygems-0.9.0.tgz
<span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xzf</span> rubygems-0.9.0.tgz
<span style="color: #7a0874; font-weight: bold;">cd</span> rubygems-0.9.0
ruby setup.rb</pre></div></div>

<p><strong>Installing mongrel</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">gem <span style="color: #c20cb9; font-weight: bold;">install</span> mongrel</pre></div></div>

<p><strong>Building a test rails application</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>rails
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>www<span style="color: #000000; font-weight: bold;">/</span>rails
rails mytest</pre></div></div>

<p><strong>Starting mongrel</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">adduser mongrel
<span style="color: #7a0874; font-weight: bold;">cd</span> mytest
<span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> :mongrel <span style="color: #000000; font-weight: bold;">*</span>
<span style="color: #c20cb9; font-weight: bold;">su</span> mongrel
mongrel_rails start <span style="color: #660033;">-d</span> <span style="color: #660033;">-p</span> <span style="color: #000000;">3001</span> <span style="color: #660033;">-P</span> log<span style="color: #000000; font-weight: bold;">/</span>mongrel1.pid
mongrel_rails start <span style="color: #660033;">-d</span> <span style="color: #660033;">-p</span> <span style="color: #000000;">3002</span> <span style="color: #660033;">-P</span> log<span style="color: #000000; font-weight: bold;">/</span>mongrel2.pid
mongrel_rails start <span style="color: #660033;">-d</span> <span style="color: #660033;">-p</span> <span style="color: #000000;">3003</span> <span style="color: #660033;">-P</span> log<span style="color: #000000; font-weight: bold;">/</span>mongrel3.pid</pre></div></div>

<p>Make sure you start mongrel in the root directory of your rails project. If successful we now have three mongrel instances. To verify type ps -aux | grep mongrel</p>
<p><strong>Configuring Apache</strong></p>
<p>You&#8217;ll need to add the following code to your httpd.conf file</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">#define mongrel cluster
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;proxy</span> balancer://mongrelcluster<span style="color: #000000; font-weight: bold;">&gt;</span></span>
  BalancerMember http://127.0.0.1:3001
  BalancerMember http://127.0.0.1:3002
  BalancerMember http://127.0.0.1:3003
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/proxy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
#forward requests to mongrel cluster
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;virtualhost</span> *:80<span style="color: #000000; font-weight: bold;">&gt;</span></span>
  ServerName yourdomain.com
  ServerAlias www.yourdomain.com
  ProxyPass / balancer://mongrelcluster/
  ProxyPassReverse / balancer://mongrelcluster/
  ProxyPreserveHost on
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/virtualhost<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Finally navigate to yourdomain.com and you should see the &#8216;Welcome Aboard&#8217; default rails page.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webmasterwords.com/ruby-rails-mongrel-apache-easy/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Pagerank Checksum in Java</title>
		<link>http://www.webmasterwords.com/pagerank-checksum-in-java?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=pagerank-checksum-in-java</link>
		<comments>http://www.webmasterwords.com/pagerank-checksum-in-java#comments</comments>
		<pubDate>Wed, 11 Oct 2006 08:49:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.webmasterwords.com/pagerank-checksum-in-java</guid>
		<description><![CDATA[A quick java class to calculate a web pages Page Rank Checksum. It can be used to obtian the Google Page Rank for a given url.The code is reverse engineered from the javascript used to build the Firefox page rank plugin. It calculates a checksum using a encoding algorithm.

[java]

public class Pagerank
{

private String toHex8(int num)
{
if(num>>23&#124;key>(8&#038;255))+toHex8(key&#038;255);

}
}[/java]]]></description>
			<content:encoded><![CDATA[<p>A quick java class to calculate a web pages Page Rank Checksum. It can be used to obtian the Google Page Rank for a given url.The code is reverse engineered from the javascript used to build the Firefox page rank plugin. It calculates a checksum using a encoding algorithm.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Pagerank
<span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">String</span> toHex8<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> num<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>num<span style="color: #339933;">&lt;</span><span style="color: #cc66cc;">16</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #0000ff;">&quot;0&quot;</span><span style="color: #339933;">+</span><span style="color: #003399;">Integer</span>.<span style="color: #006633;">toHexString</span><span style="color: #009900;">&#40;</span>num<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #003399;">Integer</span>.<span style="color: #006633;">toHexString</span><span style="color: #009900;">&#40;</span>num<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399;">String</span> calculateChecksum<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> url<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #003399;">String</span> stupidGoogleHash <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Mining PageRank is AGAINST GOOGLEâ€™S TERMS OF SERVICE. Yes, Iâ€™m talking to you, scammer.&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">int</span> key <span style="color: #339933;">=</span> <span style="color: #cc66cc;">16909125</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> i<span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> url.<span style="color: #006633;">length</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
key <span style="color: #339933;">=</span> key <span style="color: #339933;">^</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>stupidGoogleHash.<span style="color: #006633;">charAt</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">%</span>stupidGoogleHash.<span style="color: #006633;">length</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">^</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>url.<span style="color: #006633;">charAt</span><span style="color: #009900;">&#40;</span>i<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
key <span style="color: #339933;">=</span> key<span style="color: #339933;">&gt;&gt;&gt;</span><span style="color: #cc66cc;">23</span><span style="color: #339933;">|</span>key<span style="color: #339933;">&lt;&lt;</span><span style="color: #cc66cc;">9</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #000000; font-weight: bold;">return</span> <span style="color: #0000ff;">&quot;8&quot;</span><span style="color: #339933;">+</span>toHex8<span style="color: #009900;">&#40;</span>key<span style="color: #339933;">&gt;&gt;&gt;</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">8</span><span style="color: #339933;">&amp;</span>#038<span style="color: #339933;">;</span><span style="color: #cc66cc;">255</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span>toHex8<span style="color: #009900;">&#40;</span>key<span style="color: #339933;">&amp;</span>#038<span style="color: #339933;">;</span><span style="color: #cc66cc;">255</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.webmasterwords.com/pagerank-checksum-in-java/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

