<?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>Ray Acayan</title>
	<atom:link href="http://www.RayAcayan.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.RayAcayan.com</link>
	<description>A Geek of All Trades</description>
	<lastBuildDate>Tue, 03 Nov 2009 20:07:06 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>The Mobile Cloud Project, Part 1.2: AWS Data</title>
		<link>http://www.RayAcayan.com/projects/the-mobile-cloud-project-part-1-2-aws-data/</link>
		<comments>http://www.RayAcayan.com/projects/the-mobile-cloud-project-part-1-2-aws-data/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 19:04:35 +0000</pubDate>
		<dc:creator>Ray Acayan</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Amazon EBS]]></category>
		<category><![CDATA[Amazon RDS]]></category>
		<category><![CDATA[Amazon S3]]></category>
		<category><![CDATA[Amazon SimpleDB]]></category>
		<category><![CDATA[Consulting]]></category>
		<category><![CDATA[Jungle Disk]]></category>
		<category><![CDATA[S3Fox]]></category>

		<guid isPermaLink="false">http://www.RayAcayan.com/?p=1122</guid>
		<description><![CDATA[
I. Overview
The Mobile Cloud Project is my proof-of-concept for developing and hosting a scalable mobile application platform on the Amazon Web Services cloud.
Part 1.2 of this project explores the use of Amazon S3 and EBS for cloud-based storage and Amazon SimpleDB and RDS for database applications.
This project builds on the environment created in my previous [...]]]></description>
			<content:encoded><![CDATA[<p></br></p>
<h2 style="color:darkblue">I. Overview</h2>
<p>The <a href="/projects/the-mobile-cloud-project/"><strong>Mobile Cloud Project</strong></a> is my proof-of-concept for developing and hosting a scalable mobile application platform on the Amazon Web Services cloud.</p>
<p><a href="/projects/the-mobile-cloud-project-part-1-2-aws-data"><strong>Part 1.2</strong></a> of this project explores the use of Amazon S3 and EBS for cloud-based storage and Amazon SimpleDB and RDS for database applications.</p>
<p>This project builds on the environment created in my previous blog post, <a href="http://www.RayAcayan.com/projects/the-mobile-cloud-project-part-1-1-basic-aws/"><strong>“The Mobile Cloud Project, Part 1.1: Basic AWS”</strong></a>, where I presented an overview of Amazon Web Services and a procedure for creating virtual servers (Reserved and On-Demand instances) on Amazon EC2.</p>
<p>Please see the <a href="/projects/the-mobile-cloud-project/"><strong>main project page</strong></a> for more information on the other parts of this project.<br />
<br /></br></p>
<h2 style="color:darkblue">II. Consulting</h2>
<p>I do my best to explain the concepts and techniques behind my projects.  If you like my work and can use my expertise in your projects, I am available for <span id="consulting_page" onmouseover="consulting_mouseOver()" onmousemove="consulting_mouseMove()" onmouseout="consulting_mouseOut()"><a href="http://www.RayAcayan.com/consulting/"><strong>consulting</strong></a></span> at a competitive rate.<br />
<br /></br></p>
<h2 style="color:darkblue">III.  Amazon S3</h2>
<p>Amazon Simple Storage Service (S3) is an unlimited virtual data storage area hosted on the Amazon Web Services (AWS) cloud.  You can create as much storage as you need in S3, and pricing is based on storage used ($0.15/GB/month) and amount of data transferred.  You can mount an Amazon S3 bucket as a local filesystem on your computer using third-party applications such as Jungle Disk and S3Fox.</p>
<p>The following procedures assume that you have already created an Amazon AWS account, which includes access to Amazon EC2 and S3.</p>
<h3 style="color:darkgreen">1.  Using Jungle Disk to store files securely on Amazon S3</h3>
<ul>
<li>
Jungle Disk is a popular service for integrated online storage and backup that also allows you to synchronize Amazon S3 files and folders between your Windows, Mac, and Linux machines.  Jungle Disk adds a layer of file encryption on top of Amazon S3 security, so you need to install and configure the Jungle Disk client software on every computer that requires access to these encrypted files.  Pricing is only $2/month in addition to regular Amazon S3 storage fees and data transfer fees.
</li>
</ul>
<ol type="i">
<li>Go to <a href="http://www.jungledisk.com">http://www.jungledisk.com</a> and create a new Jungle Disk Desktop Account.</li>
<li>Go to <a href="http://www.jungledisk.com/desktop/download.aspx">http://www.jungledisk.com/desktop/download.aspx</a> and download the Jungle Disk Desktop Edition for your operating system.</li>
<li>Start the “Jungle Disk Desktop” application and create an online disk with standard or high security.</li>
<li>Select &#8220;Jungle Disk for both Automatic Backup and as a Network Drive&#8221; and select a drive letter (Windows) or name.</li>
<li>Start using your Jungle Disk drive and configure online backup as required.</li>
</ol>
<h3 style="color:darkgreen">2.  Using S3Fox to share files on Amazon S3</h3>
<ul>
<li>
S3Fox Organizer (S3Fox) is a free add-on for Firefox which enables you to transfer files between your local hard disk and Amazon S3 and share them on the web.  S3Fox does not perform native encryption, so it is more suitable for sharing files rather than storing confidential data.<br />
</il>
</ul>
<ol type="i">
<li> Go to: <a href="https://aws-portal.amazon.com/gp/aws/developer/account/index.html?ie=UTF8&amp;action=access-key">https://aws-portal.amazon.com/gp/aws/developer/account/index.html?ie=UTF8&amp;action=access-key</a> and make a note of your &#8220;Access Key ID&#8221; and &#8220;Secret Access Key&#8221; (click “Show).  You will need these in the next step.</li>
<li>Install Firefox from <a href="http://www.firefox.com">http://www.firefox.com</a> if you don’t have it already.</li>
<li>Install the Firefox add-in &#8220;Amazon S3 FireFox Organizer (S3Fox)&#8221; at <a href=" https://addons.mozilla.org/en-US/firefox/addon/3247">https://addons.mozilla.org/en-US/firefox/addon/3247</a></li>
<li>In Firefox, select &#8220;Tools&#8221;, then &#8220;S3 Organizer&#8221; to launch S3Fox.</li>
<li>In the &#8220;S3 Account Manager&#8221; window, enter a description in the &#8220;Account Name&#8221; text box, then enter your Access Key ID and Secret Access Key.</li>
<li>Y ou can now create an S3 bucket by right-clicking on the right pane and selecting &#8220;Create Directory&#8221;.  Note that the directory name should be globally unique across all Amazon S3 buckets, such as a domain name.</li>
<li>You can also transfer files between your local filesystem (left pane) and S3 (right pane) by clicking the arrows, similar to FTP.</li>
<li>You can share a file or folder by right-clicking on it in S3 (right pane), selecting &#8220;Edit ACL&#8221;, and changing Read/Write/FullControl permissions.</li>
<li>Right-click again on the file or folder, select &#8220;Copy URL to Clipboard&#8221;, and paste it on an email message or text editor.  The file/folder can now be accessed over the web via that URL, e.g. http://&lt;filename&gt;.s3.amazonaws.com</li>
</ol>
<h3 style="color:darkgreen">3. Bundling an AMI</h3>
<ul>
<li>
&#8220;Bundling an AMI&#8221; essentially creates an image snapshot of the current EC2 instance.  When an EC2 instance is terminated, all the files and directories in the root folder are deleted, including the operating system, installed software, and all data.  Bundling the currently running instance into an AMI allows you to restore it later or run multiple instances with the same AMI configuration.
</li>
<li>
The following procedure assumes that you have already installed PuTTY and FileZilla on your Windows client and configured them to connect to the EC2 instance, as described in Steps IV.9 and IV.10 in my previous <a href="http://www.RayAcayan.com/projects/the-mobile-cloud-project-part-1-1-basic-aws/"><strong>blog post</strong></a>.
</li>
</ul>
<ol type="i">
<li>
The Amazon EC2 and AMI tools first need to be installed on the EC2 instance.  Then, the private key and cert must be copied to the instance before the AMI tools can be executed on that instance.</p>
<p>Connect to the EC2 instance using PuTTY and enter the following commands at the Linux prompt:</li>
<div class="code">
$ sudo mkdir /.aws<br />
$ sudo mkdir /.aws/.ec2
</div>
<li>On your Windows client, use FileZilla to copy your private key and cert files, &#8220;C:\aws\ec2\ec2-pk.pem&#8221; and &#8220;C:\aws\ec2\ec2-cert.pem&#8221; to the &#8220;/.aws/.ec2&#8243; directory on the EC2 instance.</li>
<li>Connect to the EC2 instance using PuTTY.</li>
<li>Enter the following at the Linux prompt to add the &#8220;multiverse&#8221; to your apt sources.list:</li>
<div class="code">
$ sudo nano /etc/apt/sources.list
</div>
<li>Add the text &#8220;multiverse&#8221; as in the line below, then save the file:</li>
<div class="code">
deb http://us.ec2.archive.ubuntu.com/ubuntu/ karmic main universe <b>multiverse</b>
</div>
<li>Enter the following commands to install the Amazon EC2 and AMI tools:</li>
<div class="code">
$ sudo apt-get update<br />
$ sudo apt-get install ec2-api-tools<br />
$ sudo apt-get install ec2-ami-tools
</div>
<li>You can now execute EC2 AMI commands from the Linux command line.</li>
<li>Enter the following commands to bundle an AMI for this instance using the &#8220;ec2-bundle-vol&#8221; command, then store the AMI in the EBS volume created previously.</li>
<div class="code">
$ sudo rm -Rf /mnt/ami_snapshot<br />
$ sudo mkdir /mnt/ami_snapshot<br />
$ ec2-bundle-vol -d /mnt/ami_snapshot -k /.aws/.ec2/ec2-pk.pem -c /.aws/.ec2/ec2-cert.pem -u &lt;username&gt; -r i386 -p ami_snapshot<br />
(Note that &lt;username&gt; is your 12-digit AWS Account ID without the hyphens.)
</div>
<p>(Note: You may want to put these commands into a script as part of a regular backup procedure.)</p>
<li>Wait a few minutes while the AMI image is being created.</li>
<li>Run the following command to upload your AMI to an S3 bucket.  This will allow you to later attach this AMI to a new or existing EC2 instance.</li>
<div class="code">
$ ec2-upload-bundle -b &lt;s3_bucket_name&gt; -m /mnt/ami_snapshot/&lt;ami_filename&gt;.manifest.xml -a &lt;access_key_id&gt;  -s &lt;secret_access_key&gt;<br />
$ ec2-register &lt;s3_bucket_name&gt;/ami_snapshot.manifest.xml -K /ebs/.aws/.ec2/ec2-pk.pem -C /ebs/.aws/.ec2/ec2-cert.pem
</div>
<p>The &lt;s3_bucket_name&gt; is a unique name you create to identify the S3 bucket where this AMI will be stored. You can find the &lt;access_key_id&gt; and &lt;secret_access_key&gt; from your AWS credentials:<br />
<a href="https://aws-portal.amazon.com/gp/aws/developer/account/index.html?ie=UTF8&#038;action=access-key"><b>https://aws-portal.amazon.com/gp/aws/developer/account/index.html?ie=UTF8&#038;action=access-key</b></a></p>
</ol>
<p>&nbsp;</p>
<h2 style="color:darkblue">IV.  Amazon EBS</h2>
<p>Amazon Elastic Block Storage (EBS) is a type of storage that acts like an unformatted external hard disk that can be mounted on an Amazon EC2 instance and formatted with a filesystems such as ext3 (Linux) or NTFS (Windows).  EBS costs 10 cents per GB <strong>provisioned</strong>, while S3 costs 15 cents per GB <strong>used</strong>.</p>
<p>The procedures below assume an Amazon EC2 instance running Ubuntu Linux, an Elastic IP address associated with this instance, a local Windows client with Putty and Filezilla configured to connect to it, and the EC2 API tools installed on the EC2 instance.  These were all configured in my previous blog post <a href="http://www.RayAcayan.com/projects/the-mobile-cloud-project-part-1-1-basic-aws/">&#8220;The Mobile Cloud Project, Part 1.1: Basic AWS&#8221;</a>.</p>
<h3 style="color:darkgreen">1.  Creating an Amazon EBS Volume</h3>
<ol type="i">
<li>Sign in to the AWS Console at http://console.aws.amazon.com</li>
<li>Go to “Volumes” on the left menu.</li>
<li>Click &#8220;Create Volume&#8221;.</li>
<li>Enter &#8220;10&#8243; GiB, select the same Availability Zone as your instance, and select &#8220;No Snapshot&#8221; then click &#8220;Create&#8221;.</li>
<li>Wait a few minutes until the Status changes from &#8220;creating&#8221; to &#8220;available&#8221;.</li>
<li>Right-click on the volume and click “Attach Volume”.</li>
<li>Select the Instance ID of the EC2 instance you want to attach this volume to, select a Device name from the listbox (e.g. /dev/sdf), then click &#8220;Attach&#8221;.</li>
<li>Connect to the EC2 instance via Putty.</li>
<li>Enable Cryptsetup-LUKS encryption on the EBS volume (e.g. /dev/sdf) you just created by entering the following commands in the instance prompt:</li>
<div class="code">
        $ sudo apt-get install cryptsetup<br />
        $ sudo modprobe dm-crypt<br />
        $ sudo modprobe sha256<br />
        $ sudo modprobe aes<br />
        $ sudo cryptsetup &#8211;verify-passphrase luksFormat /dev/sdf -c aes -s 256 -h sha256
        </div>
<p>        (Type uppercase &#8220;YES&#8221; to continue. Enter and Verify your LUKS passphrase.)</p>
<li>Create an ext3 filesystem on the EBS volume (e.g. /dev/sdf) you just created by entering the following commands in the instance prompt:</li>
<div class="code">
        $ sudo mke2fs -j /dev/sdf<br />
        $ sudo mkdir /ebs<br />
        $ sudo mount /dev/sdf /ebs<br />
        $ sudo chown ubuntu:ubuntu /ebs
        </div>
<li>You can now access this EBS volume through /ebs</li>
</ol>
<p>&nbsp;</p>
<h2 style="color:darkblue">V.  Amazon SimpleDB</h2>
<p>Amazon SimpleDB is essentially a cloud-based non-relational database cluster for your applications running on EC2 and S3.  SimpleDB uses REST requests and responses over HTTP, unlike relational databases which require a persistent connection.  Pricing is based on storage size and data transferred, and Amazon currently offers a popular “free tier” for low-usage applications.</p>
<p>SimpleDB has its own terminology: domain (database or table), items (rows), attributes (columns), and value (similar to a cell on a spreadsheet).  Queries use “Intersection” instead of “OR” and “Union” instead of “AND”. All data in SimpleDB are treated as strings.</p>
<h3 style="color:darkgreen">1. Using SimpleDB with Ruby on Rails</h3>
<ul>
<li>
There are several programming interfaces available between SimpleDB and the major programming languages.  The example below shows how to perform simple CRUD (Create, Read, Update, Delete) operations on SimpleDB using Ruby on Rails and the AWS-SDB interface.
</li>
</ul>
<div class="code">
$ export AMAZON_ACCESS_KEY_ID=&#8217;<access_key_id>&#8216;<br />
$ export AMAZON_SECRET_ACCESS_KEY=&#8217;<secret_access_key>&#8216;<br />
$ sudo gem install aws-sdb<br />
$ irb &#8211;simple-prompt<br />
&gt;&gt; require &#8216;rubygems&#8217;<br />
&gt;&gt; require &#8216;aws_sdb&#8217;<br />
&gt;&gt; require &#8216;pp&#8217;<br />
&gt;&gt; require &#8216;yaml&#8217;<br />
&gt;&gt; sdb = AwsSdb::Service.new<br />
&gt;&gt; sdb.create_domain(&#8217;db_test&#8217;)   # Create a domain called &#8220;db_test&#8221;<br />
&gt;&gt; sdb.list_domains   # List all domains<br />
&gt;&gt; sdb.put_attributes(&#8217;db_test&#8217;, &#8221;)  # Insert a new record<br />
&gt;&gt; sdb.get_attributes(&#8217;db_test&#8217;, &#8221;)  # Retrieve record with this ID<br />
&gt;&gt; sdb.delete_attributes(&#8217;db_test&#8217;, &#8221;)  # Delete record with this ID<br />
&gt;&gt; sdb.query(domain, <span> </span>) # Query the domain<br />
&gt;&gt; sdb.delete_domain(&#8217;db_test&#8217;)   # Delete the “db_test” domain</div>
<p>More details on this example can be found in this <a href="http://www.craic.com/tutorials/aws/aws_sdb/aws_sdb_tutorial.html"><strong>tutorial by Craic Computing</strong></a>.  The article <a href="http://developer.amazonwebservices.com/connect/entry.jspa?externalID=846&#038;categoryID=176"><b>&#8220;Introduction to AWS for Ruby Developers&#8221;</b></a> is also a great resource.</p>
<p>&nbsp;</p>
<h2 style="color:darkblue">VI.  Amazon RDS</h2>
<p>Amazon Relational Database Service (RDS) is essentially a dedicated special-purpose EC2 instance with a fully-managed MySQL (5.1) database accessible via API calls over the web.  RDS currently runs on a single DB Instance but will support database replication in the future.</p>
<p>The following commands are used to create, list, and delete DB Instances in RDS using the API command line tools.</p>
<div class="code">
$ rds-create-db-instance &lt;db_instance_name&gt; -s 50 -c db.m1.small -e MySQL5.1 &#8211; u sa -p  &#8211;backup-retention-period 3<br />
$ rds-describe-db-instances<br />
$ rds-delete-db-instance &lt;db_instance_name&gt; &#8211;final-snapshot-identifier myfinaldbsnapshot
</div>
<p>From the point of view of an application, a DB Instance appears just like any other MySQL server.  Applications require no modification aside from pointing to the name or Elastic IP address of RDS DB Instance, instead of referring to a physical MySQL server.<br />
<br /></br></p>
<h2 style="color:darkblue">VII. Next Steps</h2>
<ul>
<li>In <a href="/the-mobile-cloud-project-part-1-3-aws-fault-tolerance"><b>Part 1.3: AWS Fault Tolerance</b></a>, I will explore the AutoScaling and Elastic Load Balancing features of Amazon Web Services.</li>
<li>Please see <a href="/projects/the-mobile-cloud-project/"><b>The Mobile Cloud Project</b></a> page for more info on the other parts of this project.</li>
</ul>
<p>&nbsp;</p>
<h2 style="color:darkblue">VIII.  References</h2>
<p><strong>1. Amazon Web Services Technical Documentation</strong><br />
<a href="http://aws.amazon.com/documentation">http://aws.amazon.com/documentation</a></p>
<p><strong>2. Jungle Disk</strong><br />
<a href="http://www.jungledisk.com">http://www.jungledisk.com</a></p>
<p><strong>3. S3Fox Organizer</strong><br />
<a href="http://www.s3fox.net/">http://www.s3fox.net/</a></p>
<p><strong>4. A Tutorial on aws-sdb: A Ruby Interface to AWS SimpleDB</strong><br />
<a href="http://www.craic.com/tutorials/aws/aws_sdb/aws_sdb_tutorial.html">http://www.craic.com/tutorials/aws/aws_sdb/aws_sdb_tutorial.html</a></p>
<p><strong>5. Introduction to AWS for Ruby Developers</strong><br />
<a href="http://developer.amazonwebservices.com/connect/entry.jspa?externalID=846&#038;categoryID=176">http://developer.amazonwebservices.com/connect/entry.jspa?externalID=846&#038;categoryID=176</a></p>
<p></br><br /></br></p>
]]></content:encoded>
			<wfw:commentRss>http://www.RayAcayan.com/projects/the-mobile-cloud-project-part-1-2-aws-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Amazon EC2 Blog Migration Project</title>
		<link>http://www.RayAcayan.com/projects/the-amazon-ec2-blog-migration-project/</link>
		<comments>http://www.RayAcayan.com/projects/the-amazon-ec2-blog-migration-project/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 16:46:29 +0000</pubDate>
		<dc:creator>Ray Acayan</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Amazon EC2]]></category>
		<category><![CDATA[Amazon Web Services]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[AWS]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[Consulting]]></category>
		<category><![CDATA[cPanel]]></category>
		<category><![CDATA[FileZilla]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mod_security]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[OWASP]]></category>
		<category><![CDATA[PuTTY]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Webalizer]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://174.129.34.151/blog/?p=1080</guid>
		<description><![CDATA[
I. Overview
This side project presents my procedure for migrating my WordPress blog from a web hosting provider running cPanel to an Amazon EC2 instance.
This project builds on the environment created in my previous blog post, “The Mobile Cloud Project, Part 1.1: Basic AWS”, where I presented an overview of Amazon Web Services and a procedure [...]]]></description>
			<content:encoded><![CDATA[<p></br></p>
<h2 style="color:darkblue">I. Overview</h2>
<p>This side project presents my procedure for migrating my WordPress blog from a web hosting provider running cPanel to an Amazon EC2 instance.</p>
<p>This project builds on the environment created in my previous blog post, <a href="http://www.RayAcayan.com/projects/the-mobile-cloud-project-part-1-1-basic-aws/"><b>“The Mobile Cloud Project, Part 1.1: Basic AWS”</b></a>, where I presented an overview of Amazon Web Services and a procedure for creating virtual servers (Reserved and On-Demand instances) on Amazon EC2.<br />
<br /></br></p>
<h2 style="color:darkblue">II. Consulting</h2>
<p>I do my best to explain the concepts and techniques behind my projects.  If you like my work and can use my expertise in your projects, I am available for <span id="consulting_page" onmouseover="consulting_mouseOver()" onmousemove="consulting_mouseMove()" onmouseout="consulting_mouseOut()"><a href="http://www.RayAcayan.com/consulting/"><strong>consulting</strong></a></span> at a competitive rate.<br />
<br /></br></p>
<h2 style="color:darkblue">III. Procedure</h2>
<p>Once the Amazon EC2 instance was created and configured in my previous <a href="http://www.RayAcayan.com/projects/the-mobile-cloud-project-part-1-1-basic-aws/"><b>blog post</b></a>, this migration procedure is actually fairly straightforward.  From the point of view of a terminal console, an Amazon EC2 instance running Ubuntu Linux is very similar to any other Ubuntu server.  The only difference is that certain tasks that were simplified behind a web hosting provider’s cPanel now need to be done explicitly on an EC2 instance.</p>
<p>This procedure assumes an existing WordPress blog at <a href="http://www.RayAcayan.com/blog">http://www.RayAcayan.com/blog</a> (i.e. this blog), an existing EC2 instance running Ubuntu 9.10 (Karmic), an Elastic IP address associated with that instance, and a local Windows client with Putty and FileZilla configured to connect to both the old blog&#8217;s web hosting provider and the new blog&#8217;s EC2 instance.  These were all configured in my previous blog post <a href="http://www.RayAcayan.com/projects/the-mobile-cloud-project-part-1-1-basic-aws/"><b>&#8220;The Mobile Cloud Project, Part 1.1: Basic AWS&#8221;</b></a>. </p>
<h3 style="color:darkgreen">1.  Install packages on EC2 instance</h3>
<ol type="i">
<li>Connect to the EC2 instance using Putty.</li>
<li> Install Apache2, MySQL, PHP, Ruby on Rails, Python, and Django packages with the following commands.</li>
<div class="code">
$ sudo apt-get update<br />
$ sudo apt-get install apache2 mysql-server libapache2-mod-auth-mysql<br />
$ sudo apt-get install php5-mysql phpmyadmin<br />
$ sudo apt-get install build-essential libssl-dev libreadline5-dev zlib1g-dev<br />
$ sudo apt-get install libmysqlclient15-dev<br />
<br />
$ sudo apt-get install ruby-full rubygems1.9.1 rails libmysql-ruby<br />
<br />
$ sudo apt-get install python2.6 python3 python-django<br />
$ sudo apt-get install libapache2-mod-python python-mysqldb
</div>
</ol>
<h3 style="color:darkgreen">2.  Enable mod_rewrite on Apache</h3>
<ol type="i">
<li>The mod_rewrite module allows WordPress to use pretty permalinks on your blog, such as /category/postname/</li>
<div class="code">
$ sudo a2enmod rewrite<br />
$ sudo nano /etc/apache2/sites-enabled/000-default
</div>
<li>Modify this file to show the following changes (i.e. change &#8220;None&#8221; to &#8220;All&#8221; to allow pretty permalinks, and add # comments to disable directory listing) then save this file.</li>
<div class="code">
DocumentRoot /var/www/<br />
[...]<br />
Options FollowSymLinks<br />
AllowOverride <b>All</b><br />
[...]<br />
<b>#</b> Options Indexes FollowSymLinks MultiViews<br />
<b>#</b> AllowOverride None<br />
<b>#</b> Order allow,deny<br />
<b>#</b> allow from all
</div>
<li>Restart Apache:</li>
<div class="code">
$ sudo /etc/init.d/apache2 restart
</div>
</ol>
<h3 style="color:darkgreen">3.  Install WordPress on the EC2 instance</h3>
<ol type="i">
<li>Connect to the EC2 instance using Putty.</li>
<li>Create the WordPress username and database on MySQL by entering the following commands:</li>
<div class="code">
$ sudo mysql -u root -p &lt;password&gt;<br />
mysql> create database wordpress;<br />
mysql> create user &lt;wp_username&gt;;<br />
mysql> set password for &lt;wp_username&gt; = password(&#8221;&lt;password&gt;&#8221;);<br />
mysql> grant all on wordpress.* to &lt;wp_username&gt;@localhost identified by `&lt;password&gt;’;<br />
mysql> quit
</div>
<li>Enter the following commands at the Linux prompt to download and install WordPress:</li>
<div class="code">
$ cd /var/www/blog<br />
$ sudo wget http://wordpress.org/latest.tar.gz<br />
$ sudo tar -xzvf latest.tar.gz<br />
$ sudo mv wordpress blog
</div>
<li>Go to http://&lt;elastic ip&gt;/blog/wp-admin/install.php to execute the WordPress install script.</li>
<li>Download and install the WordPress themes and plugins that were in the previous blog (cPanel).</li>
</ol>
<p></p>
<h3 style="color:darkgreen">4.  Copy WordPress files and database from the old blog to the new blog</h3>
<ol type="i">
<li>Open FileZilla client and connect to the web hosting provider&#8217;s server that is hosting the old blog.  (See the provider&#8217;s instructions on how to do this.)</li>
<li>Download all files in the old blog:  ~/public_html/blog or /var/www/blog</li>
<li>Open a second FileZilla client to connect to the new blog (EC2). </li>
<li>Upload your custom files and directories to the /var/www/blog directory of the new blog.</li>
<li>Make sure that you have also copied any hidden files (.htaccess) from the old blog to the new blog.</li>
<li>Open the WordPress Dashboard on the old blog (cPanel), click “Export” in the &#8220;Tools&#8221; menu on the left, and save the .xml file.</li>
<li>Open the WordPress Dashboard on the new blog (EC2), click “Import” in the &#8220;Tools&#8221; menu on the left, and upload the .xml file from the previous step. </li>
<li>Install the &#8220;WP-DB-Backup&#8221; plugin on both the old and new blogs.</li>
<li>On the old blog&#8217;s WordPress admin, click &#8220;Backup&#8221; on the &#8220;Tools&#8221; menu on the left and save the file as &#8220;oldwordpress.sql&#8221;.</li>
<li>Connect to the EC2 instance via FileZilla and upload the &#8220;oldwordpress.sql&#8221; file.
<li>Connect to the EC2 instance via Putty.</li>
<li>At the Linux prompt, enter &#8220;mysql wordpress &lt; oldwordpress.sql –u root -p&#8221; to import the old WordPress database to the new one.</li>
<li>Verify that the new blog is working at http://&lt;elastic ip&gt;/blog including links and styles. </li>
</ol>
<p></p>
<h3 style="color:darkgreen">5. Remap DNS to the new blog IP address on EC2</h3>
<ul>
<li>DNS needs to be configured to remap the blog&#8217;s domain name to the Elastic IP address of the new blog on EC2.</li>
</ul>
<ol type="i">
<li>Before proceeding, add an entry &#8220;&lt;elastic ip&gt; www.RayAcayan.com&#8221; to the local hosts file at C:\windows\system32\drivers\etc</li>
<li>Verify that the blog is working properly using the normal URL <a href="http://www.RayAcayan.com">http://www.RayAcayan.com</a></li>
<p>  At this point, only the local computer can access the new blog via URL because of the hosts file entry.  The new IP address will need to be propagated to the rest of the Internet via an external DNS provider so that everyone else can access it.</a></li>
<li>Select an external DNS provider such as <a href="http://www.easyDNS.com">http://www.easyDNS.com</a> and purchase a DNS-only service for about $20/year.</li>
<li>Add a DNS entry to map the hostname to the Elastic IP address of the new blog.</li>
<li>Go to the domain registrar&#8217;s website where the old blog domain is currently registered.</li>
<li>Change the name servers of the domain to point to the name servers of the  external DNS provider.</li>
<li>Wait several hours for the new DNS settings to propagate on the Internet.  Enter &#8220;nslookup&#8221; at the command prompt. If the response is the elastic IP address of the EC2 instance, then the DNS propagation has completed.</li>
<li>Remove the hosts file entry created in step 5.i. and run &#8220;ipconfig /dnsflush&#8221; at the command prompt. Verify that the blog is still reachable via the normal URL: <a href="http://www.RayAcayan.com/blog">http://www.RayAcayan.com/blog</a></li>
</ol>
<h3 style="color:darkgreen">6.  Install Additional Applications</h3>
<ol type="A">
<strong>
<li>Install Webalizer</li>
<p></strong><br />
Webalizer is a web stats application offered by your web hosting provider&#8217;s cPanel.  You will need to install it manually on your EC2 instance if you want to continue using it.</p>
<ol type="i">
<li>Connect to the EC2 instance using Putty.</li>
<li>Enter the following command to install and configure Webalizer on the EC2 instance:</li>
<div class="code">
$ sudo apt-get install webalizer<br />
$ sudo nano /etc/webalizer/webalizer.conf<br />
Change the text &#8220;LogFile /var/log/apache2/access.log.1&#8243; to &#8220;LogFile /var/log/apache2/access.log&#8221; then save the webalizer config file.
</div>
<li>Create a cron job to run webalizer every 30 minutes:</li>
<div class="code">
$ sudo crontab -e<br />
(Add the following line to the crontab:)<br />
30 * * * *      /usr/bin/webalizer
</div>
</ol>
</ol>
<h3 style="color:darkgreen">7.  Configure Basic Security</h3>
<ol type="A">
<strong>
<li>Secure the Apache web server with mod_security and Core Rule Set</li>
<p></strong></p>
<p>The &#8220;mod_security&#8221; Apache module is an open source intrusion detection and prevention engine for web applications.  It protects the Apache web server from common attacks such as SQL injection, cross-site scripting, etc.</p>
<ol type="i">
<li>Connect to the EC2 instance using Putty.</li>
<li>Enter the following commands at the Linux prompt:</li>
<div class="code">
$ sudo mkdir ~/install<br />
$ cd ~/install<br />
$ sudo wget http://www.modsecurity.org/download/modsecurity-apache_2.5.10.tar.gz<br />
$ sudo tar –xzvf modsecurity-apache_2.5.10.tar.gz<br />
$ cd modsecurity-apache_2.5.10/rules<br />
$ sudo cp *.conf /etc/apache2/conf.d<br />
$ sudo cp base_rules /etc/apache2/conf.d/modsecurity<br />
$ sudo cp optional_rules /etc/apache2/conf.d<br />
$ sudo mkdir /etc/apache2/logs<br />
$ sudo apt-get install libapache-mod-security<br />
$ sudo a2enmod mod-security
</div>
<li>Restart Apache:</li>
<div class="code">
$ sudo /etc/init.d/apache2 restart
</div>
</ol>
<p><strong>
<li>Configure password-protection on the PHPMyAdmin directory</li>
<p></strong></p>
<ol type="i">
<li>Connect to the EC2 instance using Putty.</li>
<li>Enter the following commands at the Linux prompt:</li>
<div class="code">
$ sudo mkdir /usr/local/apache2<br />
$ sudo htdigest -c /usr/local/apache2/.htpasswd_phpmyadmin &#8220;PHPMyAdmin&#8221; phpmyadmin<br />
(Enter password)<br />
$ sudo cp /etc/apache2/mods-available/auth_digest.load /etc/apache2/mods-enabled<br />
$ sudo nano /etc/apache2/apache2.conf
</div>
</li>
<li>Add the following text to the end of the apache2.conf file then save it:</li>
<div class="code">
&lt;Directory /usr/share/phpmyadmin/&gt;<br />
&nbsp;&nbsp;Authtype digest<br />
&nbsp;&nbsp;AuthName &#8220;PHPMyAdmin&#8221;<br />
&nbsp;&nbsp;AuthUserFile /usr/local/apache2/.htpasswd_phpmyadmin<br />
&nbsp;&nbsp;require user phpmyadmin<br />
&lt;/Directory&gt;
</div>
<li>For added security, insert the following lines inside the &lt;Directory&gt; tag above to only allow connections from certain IP addresses:</li>
<div class="code">
&nbsp;&nbsp;Order deny,allow<br />
&nbsp;&nbsp;Deny from all<br />
&nbsp;&nbsp;Allow from &lt;static IP address&gt;
</div>
<li>Restart Apache:</li>
<div class="code">
$ sudo /etc/init.d/apache2 restart
</div>
</ol>
<p><strong>
<li>Configure password-protection on the WordPress Admin directory</li>
<p></strong></p>
<ol type="i">
<li>Connect to the EC2 instance using Putty.</li>
<li>Enter the following commands at the Linux prompt:</li>
<div class="code">
$ sudo mkdir /usr/local/apache2<br />
$ sudo htdigest -c /usr/local/apache2/.htpasswd_wp-admin &#8220;WordPress Admin&#8221; wp-admin<br />
(Enter password)<br />
$ sudo cp /etc/apache2/mods-available/auth_digest.load /etc/apache2/mods-enabled<br />
$ sudo nano /etc/apache2/apache2.conf
</div>
</li>
<li>Add the following text to the end of the apache2.conf file then save it:</li>
<div class="code">
&lt;Directory /var/www/blog/wp-admin/&gt;<br />
&nbsp;&nbsp;Authtype digest<br />
&nbsp;&nbsp;AuthName &#8220;WordPress Admin&#8221;<br />
&nbsp;&nbsp;AuthUserFile /usr/local/apache2/.htpasswd_wp-admin<br />
&nbsp;&nbsp;require user wp-admin<br />
&lt;/Directory&gt;
</div>
<li>For added security, insert the following lines inside the &lt;Directory&gt; tag above to only allow connections from certain IP addresses:</li>
<div class="code">
&nbsp;&nbsp;Order deny,allow<br />
&nbsp;&nbsp;Deny from all<br />
&nbsp;&nbsp;Allow from &lt;static IP address&gt;
</div>
<li>Restart Apache:</li>
<div class="code">
$ sudo /etc/init.d/apache2 restart
</div>
</ol>
<p><strong>
<li>Configure password-protection on the Webalizer directory</li>
<p></strong></p>
<ol type="i">
<li>Connect to the EC2 instance using Putty.</li>
<li>Enter the following commands at the Linux prompt:</li>
<div class="code">
$ sudo mkdir /usr/local/apache2<br />
$ sudo htdigest -c /usr/local/apache2/.htpasswd_webalizer &#8220;Webalizer Stats&#8221; webalizer<br />
(Enter password)<br />
$ sudo cp /etc/apache2/mods-available/auth_digest.load /etc/apache2/mods-enabled<br />
$ sudo nano /etc/apache2/apache2.conf
</div>
</li>
<li>Add the following text to the end of the apache2.conf file then save it:</li>
<div class="code">
&lt;Directory /var/www/webalizer/&gt;<br />
&nbsp;&nbsp;Authtype digest<br />
&nbsp;&nbsp;AuthName &#8220;Webalizer Stats&#8221;<br />
&nbsp;&nbsp;AuthUserFile /usr/local/apache2/.htpasswd_webalizer<br />
&nbsp;&nbsp;require user webalizer<br />
&lt;/Directory&gt;
</div>
<li>For added security, insert the following lines inside the &lt;Directory&gt; tag above to only allow connections from certain IP addresses:</li>
<div class="code">
&nbsp;&nbsp;Order deny,allow<br />
&nbsp;&nbsp;Deny from all<br />
&nbsp;&nbsp;Allow from &lt;static IP address&gt;
</div>
<li>Restart Apache:</li>
<div class="code">
$ sudo /etc/init.d/apache2 restart
</div>
</ol>
</ol>
<p>&nbsp;</p>
<h2 style="color:darkblue">IV. References</h2>
<p><strong>1. Amazon Web Services Technical Documentation</strong><br />
<a href="http://aws.amazon.com/documentation">http://aws.amazon.com/documentation</a></p>
<p><strong>2. Official Ubuntu Documentation</strong><br />
<a href="https://help.ubuntu.com">https://help.ubuntu.com</a></p>
<p><strong>3. RubyOnRails.org</strong><br />
<a href="http://rubyonrails.org/download/">http://rubyonrails.org/download/</a></p>
<p><strong>4. Python Programming Language &#8212; Official Website</strong><br />
<a href="http://www.python.org">http://www.python.org</a></p>
<p><strong>5. The Django Project</strong><br />
<a href="http://www.djangoproject.com/">http://www.djangoproject.com/</a></p>
<p><strong>6. Moving WordPress</strong><br />
<a href="http://codex.wordpress.org/Moving_WordPress">http://codex.wordpress.org/Moving_WordPress</a></p>
<p><strong>7. easyDNS</strong><br />
<a href="http://www.easydns.com">http://www.easydns.com</a></p>
<p><strong>8. OWASP ModSecurity Core Rule Set Project</strong><br />
<a href="http://www.owasp.org/index.php/Category:OWASP_ModSecurity_Core_Rule_Set_Project">http://www.owasp.org/index.php/Category:OWASP_ModSecurity_Core_Rule_Set_Project</a></p>
<p></br><br /></br></p>
]]></content:encoded>
			<wfw:commentRss>http://www.RayAcayan.com/projects/the-amazon-ec2-blog-migration-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Mobile Cloud Project, Part 1.1: Basic AWS</title>
		<link>http://www.RayAcayan.com/projects/the-mobile-cloud-project-part-1-1-basic-aws/</link>
		<comments>http://www.RayAcayan.com/projects/the-mobile-cloud-project-part-1-1-basic-aws/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 17:14:03 +0000</pubDate>
		<dc:creator>Ray Acayan</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Amazon EC2]]></category>
		<category><![CDATA[Amazon S3]]></category>
		<category><![CDATA[Amazon Web Services]]></category>
		<category><![CDATA[AWS]]></category>
		<category><![CDATA[Canonical]]></category>
		<category><![CDATA[Cloud Security Alliance]]></category>
		<category><![CDATA[Consulting]]></category>
		<category><![CDATA[Elastic IP]]></category>
		<category><![CDATA[FileZilla]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[On-Demand Instance]]></category>
		<category><![CDATA[PuTTY]]></category>
		<category><![CDATA[Reserved Instance]]></category>
		<category><![CDATA[SFTP]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.RayAcayan.com/?p=940</guid>
		<description><![CDATA[
I. Overview
The Mobile Cloud Project is my proof-of-concept for developing and hosting a scalable mobile application platform on the Amazon Web Services cloud..
Part 1.1 of this project provides a basic overview of Amazon Web Services and describes my procedure for building Ubuntu Linux virtual servers (Reserved and On-Demand instances) on Amazon EC2.
Please see the main [...]]]></description>
			<content:encoded><![CDATA[<p></br></p>
<h2 style="color:darkblue">I. Overview</h2>
<p>The <a href="/projects/the-mobile-cloud-project/"><b>Mobile Cloud Project</b></a> is my proof-of-concept for developing and hosting a scalable mobile application platform on the Amazon Web Services cloud..</p>
<p><a href="/projects/the-mobile-cloud-project-part-1-1-basic-aws"><b>Part 1.1</b></a> of this project provides a basic overview of Amazon Web Services and describes my procedure for building Ubuntu Linux virtual servers (Reserved and On-Demand instances) on Amazon EC2.</p>
<p>Please see the <a href="/projects/the-mobile-cloud-project/"><b>main project page</b></a> for more information on the other parts of this project.<br />
<br /></br></p>
<h2 style="color:darkblue">II. Consulting</h2>
<p>I do my best to explain the concepts and techniques behind my projects.  If you like my work and can use my expertise in your projects, I am available for <span id="consulting_page" onmouseover="consulting_mouseOver()" onmousemove="consulting_mouseMove()" onmouseout="consulting_mouseOut()"><a href="http://www.RayAcayan.com/consulting/"><strong>consulting</strong></a></span> at a competitive rate.<br />
<br /></br></p>
<h2 style="color:darkblue">III.  Overview of Amazon Web Services</h2>
<p>Amazon Web Services (AWS) is a collection of technologies that enable us to host our applications on Amazon’s server and network infrastructure (the “cloud”).  AWS can provide an individual or startup with the potential computing power of thousands of networked servers, petabytes of storage space, and fault-tolerant capabilities, which rival the infrastructure of large corporations that possess multiple data centres and IT departments.  You require no physical hardware, network infrastructure, electricity, nor legions of IT staff, in order to run your powerful virtual enterprise in the cloud.  The scalability of AWS makes it an ideal solution for hosting the back-end platform for popular mobile apps used by millions of users.</p>
<h3 style="color:darkgreen">1. Amazon EC2</h3>
<p>An “instance”, or virtual server, is the basic unit of computing resource in the Amazon Elastic Compute Cloud (EC2).   You can create as many instances as you need, and pricing is based on instance type, “size”, and hourly usage.  A Reserved Instance is a dedicated virtual server which is often kept running all the time, while an On-Demand instance is usually turned on only as required.</p>
<h3 style="color:darkgreen">2. Amazon S3</h3>
<p>Amazon Simple Storage Service (S3) is a virtual data storage area.   A “bucket” is analogous to a filesystem that can store objects or files.  You can create as much data storage as you need in S3, and pricing is based on storage size and amount of data transferred.</p>
<h3 style="color:darkgreen">3. Elastic IP Addresses</h3>
<p>An Elastic IP address is an Internet-routable static IP address that is allocated to your AWS EC2 account.  You can map an Elastic IP address to any running instance (which has a private IP address), and quickly remap to a different instance if the other instance fails.  Network address translation is enabled automatically via 1:1 NAT.  There is no charge for elastic IP addresses while in use.<br />
<br /></br></p>
<h2 style="color:darkblue">IV. Procedure</h2>
<p>In this procedure, I will demonstrate how to create two EC2 instances: a Reserved Instance called &#8220;Galactica&#8221; (which will eventually host this blog and related web apps) and an On-Demand instance called &#8220;Pegasus&#8221; for future use.</p>
<h3 style="color:darkgreen">1. Sign up for a free AWS account</h3>
<ol type="i">
<li>Go to <a href="http://aws.amazon.com"><b>http://aws.amazon.com</b></a> and click “Sign Up Now”.</li>
<li>Fill out the requested information.</li>
</ol>
<h3 style="color:darkgreen">2.  Sign up for Amazon EC2 and S3</h3>
<ol type="i">
<li>Go to <a href="http://aws.amazon.com/ec2"><b>http://aws.amazon.com/ec2</b></a> and click “Sign Up for Amazon EC2”.</li>
<li>Review the pricing details and enter your credit card and billing information.</li>
<li>Complete the identity verification by telephone.</li>
<li>You are now signed up for both EC2 and S3.</li>
</ol>
<h3 style="color:darkgreen">3. Sign in to the AWS Management Console</h3>
<ol type="i">
<li>Go to <a href="http://aws.amazon.com/console"><b>http://aws.amazon.com/console</b></a> and click “Sign in to the AWS Console” (EC2).</li>
</ol>
<h3 style="color:darkgreen">4. Create Key Pairs</h3>
<p>You will need to create a key pair for each instance you plan to launch.  This allows you to access your instance securely via SSH (Linux) or RDP (Windows).</p>
<ol type="i">
<li>In Windows Explorer, create the folders &#8220;C:\aws&#8221; and &#8220;C:\aws\ec2&#8243;</li>
<li>Click “Key Pairs” in the left menu, click “Create Key Pair”, and enter a name for this key pair (e.g. “Galactica”).</li>
<li>Save the &#8220;Galactica.pem&#8221; private key file in the C:\aws\ec2 folder.</li>
<li>Create another key pair for the second instance (e.g. “Pegasus”).</li>
</ol>
<h3 style="color:darkgreen">5. Create a Security Group</h3>
<p>A Security Group is essentially a set of firewall rules that can be applied to your instances.  A cloud-based virtual server is still vulnerable to hackers just like any other server connected to the Internet.  You need to remain vigilant and follow cloud security best practices.  (See the Cloud Security Alliance <a href="http://www.cloudsecurityalliance.org"><b>website</b></a> for more information.)</p>
<ol type="i">
<li>Click “Security Groups” from the left menu, then click “Create Security Group”.</li>
<li>Enter a name for this security group (e.g. “Stargate”) then click “Create”.</li>
<li>In the “Allowed Connections” section, select “SSH” then click “Save”.</li>
<li>In the same section, select “HTTP” then click “Save”.</li>
<li>Add more firewall rules as required.  All other network traffic will be blocked.</li>
</ol>
<h3 style="color:darkgreen">6.  Purchase a Reserved Instance</h3>
<p>A Reserved Instance is a prepaid instance that offers “significantly” discounted usage fees compared to an On-Demand instance.  In this example, a “Small” Linux/Unix reserved instance will cost $350 for a 3-yr term and $0.03/hr (roughly $22/month) usage fees, while the same On-Demand instance will cost $0.085/hr in usage fees (as of Nov 1, 2009), or about $62/month if used 24/7.  Usage fees and discounts are calculated automatically.  For example, if you have X reserved instances, then the first X instances currently running will be charged at the discounted usage fee, while the remaining instances are charged at the on-demand usage fee.</p>
<ol type="i">
<li>Click “Instances” on the left menu.</li>
<li>Click on the “Reserved Instances” dropdown list and select “Purchase Reserved Instances”.</li>
<li>Select “Linux/UNIX” platform, “m1.small” instance type, “Best Available” zone, a term of “3 years”, and “1” instance.</li>
<li>Click “Continue” then click “Place Order” to confirm.</li>
<li>You may need to wait a few minutes until the payment is processed and the reserved instance is activated. Click “Close”.</li>
</ol>
<h3 style="color:darkgreen">7.  Launch AMI Instances</h3>
<p>An Amazon Machine Image (AMI) is essentially a disk image containing a pre-configured operating system and software.  You have the ability to create your own AMI disk image from an existing server or select a pre-built AMI from Amazon’s list.</p>
<ol type="i">
<li>Click “Instances” on the left menu, then click “Launch Instance”.</li>
<li>Click “Community AMIs” tab.</li>
<li>In the textbox to the right of “All Images” and “All Platforms”, enter “ubuntu-images-us” for a list of official Ubuntu releases (currently Ubuntu 9.10 Karmic as of Oct 29, 2009).</li>
<li>Select an AMI from the list. Amazon charges less for 32-bit instances, so select the cheaper 32-bit “i386” AMI rather than the 64-bit “amd64” AMI.  In this example, select the &#8220;ami-1515f67c&#8221; AMI ID and click “Select”.</li>
<li>On the next page, enter “1” instance, &#8220;Small&#8221; (m1.small) instance type, “Galactica” key pair, and “Stargate” security group, then click “Launch”.</li>
<li>Repeat these steps to launch another instance for the “Pegasus” key pair.</li>
</ol>
<h3 style="color:darkgreen">8.  Create Elastic IP address</h3>
<p>As mentioned previously, an Elastic IP address is simply an Internet-routable static IP address that is allocated to your AWS EC2 account and can be mapped (associated) with any running instance.</p>
<ol type="i">
<li>Click “Elastic IPs” on the left menu.</li>
<li>Click “Allocate New Address”, then click “Yes, Allocate” to confirm.</li>
<li>Check the box next to the IP address, then click “Associate”.</li>
<li>Select the appropriate Instance ID, then click “Associate”.</li>
<li>You can now configure your DNS to map your existing domain name to this Elastic IP address and access this instance over the Internet.</li>
</ol>
<h3 style="color:darkgreen">9.  Install and configure PuTTY</h3>
<p>PuTTY is a free SSH client that enables you to configure and install packages on your Amazon EC2 instance from Windows.</p>
<ol type="i">
<li>Download  PuTTY, PuTTYgen, and PSCP from:<a href="http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html"><b>http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html</b></a>
</li>
<li>Create a folder &#8220;C:\putty&#8221; and move these files to that folder.</li>
<li>Go to Control Panel, System, Advanced system settings, Environment Variables, Add &#8220;C:\putty&#8221; to the PATH system variable.</li>
<li>Run the &#8220;puttygen.exe&#8221; application from Windows.</li>
<li>Click the &#8220;File&#8221; menu, select &#8220;Load private key&#8221;, then select C:\aws\ec2\Galactica.pem (from Step 4.iii.)</li>
<li>The application will prompt you to save the file in PuTTY&#8217;s own format and click &#8220;OK&#8221;.
<li>
<li>Click the &#8220;File&#8221; menu, click &#8220;Save private key&#8221;. Click &#8220;Yes&#8221; to save this key without a passphrase to protect it.</li>
<li>Save the &#8220;Galactica.ppk&#8221; file in the C:\aws\ec2 folder.</li>
<li>Run the &#8220;putty.exe&#8221; application from Windows.</li>
<li>Enter the Elastic IP address in both the &#8220;Host Name&#8221; and &#8220;Saved Sessions&#8221; text boxes.</li>
<li>On the left pane, click &#8220;SSH&#8221; then click &#8220;Auth&#8221;.</li>
<li>Click &#8220;Browse&#8221; then select the file C:\aws\ec2\Galactica.ppk.</li>
<li>On the left pane, click &#8220;Connection&#8221; then click &#8220;Data&#8221;.</li>
<li>Enter &#8220;ubuntu&#8221; in the &#8220;Auto-login username&#8221; text box.</li>
<li>Click &#8220;Session&#8221; at the top of the left pane, then click &#8220;Save&#8221;.</li>
<li>Click &#8220;Open&#8221; to verify that you can connect to this EC2 instance. Click &#8220;Yes&#8221; if the PuTTY Security Alert pops up.</li>
<li>You are authenticated via username and private key, so you do not need to enter a login password.</li>
</ol>
<h3 style="color:darkgreen">10.  Install and configure FileZilla</h3>
<p>FileZilla is a free SFTP client that allows you to transfer files to/from your Amazon EC2 instance.</p>
<ol type="i">
<li>Download and install FileZilla Client from <a href="http://filezilla-project.org/"><b>http://filezilla-project.org/</b></a></li>
<li>Run the FileZilla application in Windows.</li>
<li>Select Edit, Settings from the menu.</li>
<li>On the left pane, click &#8220;SFTP&#8221; then click the &#8220;Add keyfile&#8221; button.</li>
<li>Select the C:\aws\ec2\Galactica.ppk private key file then click &#8220;Open&#8221;.</li>
<li>Select File, Site Manager from the menu.</li>
<li>Click &#8220;New Site&#8221; and enter your elastic IP address in the &#8220;Host&#8221; text box.</li>
<li>In Servertype, select &#8220;SFTP &#8211; SSH File Transfer Protocol&#8221;.</li>
<li>Leave the Logontype as &#8220;Normal&#8221; and enter &#8220;root&#8221; in the User text box.</li>
<li>Click &#8220;Connect&#8221; to verify SFTP connectivity to your EC2 instance.</li>
</ol>
<h3 style="color:darkgreen">11. Install the Amazon EC2 API tools on your Windows client</h3>
<p>You will need to download your Amazon private key and cert in order to install the Amazon EC2 API tools, which are used to access additional EC2 functions (via command line or programmaticaly via the EC2 API) that are not available on the AWS Management Console web interface.</p>
<ol type="i">
<li>On your Windows machine, create the folders &#8220;C:\aws&#8221; and &#8220;C:\aws\ec2&#8243;.</li>
<li>Go to <a href="https://aws-portal.amazon.com/gp/aws/developer/account/index.html?ie=UTF8&#038;action=access-key"><b>https://aws-portal.amazon.com/gp/aws/developer/account/index.html?ie=UTF8&#038;action=access-key</b></a></li>
<li>Click the “X.509 Certificates” tab.</li>
<li>Click “Create a New Certificate”.</li>
<li>Click “Download Private Key File” and save the pk*.pem file to C:\aws\ec2.</li>
<li>Click “Download X.509 Certificate” and save the cert*.pem file to C:\aws\ec2.</li>
<li>In Windows Explorer, make a copy of the pk*.pem file and name it &#8220;ec2-pk.pem&#8221;.</li>
<li>Also make a copy of the cert*.pem file and name it &#8220;ec2-cert.pem&#8221;.</li>
<li>Download the EC2 API Tools from <a href="http://developer.amazonwebservices.com/connect/entry.jspa?externalID=351&#038;categoryID=88"><b>http://developer.amazonwebservices.com/connect/entry.jspa?externalID=351&#038;categoryID=88</b></a></li>
<li>Unzip the files into the &#8220;C:\aws\ec2&#8243; folder.</li>
<li>In Windows, click the “Start” menu, “Settings”, &#8220;Control Panel&#8221;, &#8220;System&#8221;, click &#8220;Advanced system settings&#8221;, then click &#8220;Environment Variables&#8230;&#8221;.</li>
<li>In the bottom window called &#8220;System variables&#8221;, click &#8220;New&#8230;&#8221;.</li>
<li>Enter &#8220;EC2_PRIVATE_KEY&#8221; as the Variable name, enter &#8220;c:\aws\ec2\ec2-pk.pem&#8221; as the Variable value, then click &#8220;OK&#8221;.</li>
<li>Click &#8220;New&#8230;&#8221; again in the bottom window called &#8220;System variables&#8221;.</li>
<li>Enter &#8220;EC2_CERT&#8221; as the Variable name, enter &#8220;c:\aws\ec2\ec2-cert.pem&#8221; as the Variable value, then click &#8220;OK&#8221;.
<li>
<li>In the bottom window “System variables”, find and select the variable named “Path”.<br />
Click “Edit&#8230;”, insert “%EC2_HOME%\bin;” at the beginning of the Variable value, and click &#8220;OK&#8221;.</li>
<li>In Windows, click the “Start” menu, click “Run”, enter “cmd”, and click &#8220;OK&#8221; to open a command prompt.</li>
<li>Enter the following command to verify that the EC2 API command-line tools are working properly:</li>
<div class="code">
C:\ec2-describe-regions
</div>
</ol>
<h3 style="color:darkgreen">12. Install software on your Amazon EC2 instance</h3>
<ul>
<li>You can now install software packages on your Amazon EC2 instance.  Keep in mind that although this is a virtual server, you still need to follow the license agreements that come with your software.</li>
</ul>
<h3 style="color:darkgreen">Optional:  Terminate the Instances</h3>
<ul>
<li>If you are just following along and no longer need these instances, you can terminate them to avoid further usage charges.  However, note that all your changes will be lost if you have not yet bundled an AMI snapshot of this instance (described in <a href="/projects/the-mobile-cloud-project-part-1-2-aws-data/"><b>Part 1.2: AWS Data</b></a>).</li>
</ul>
<ol type="i">
<li>Click “Instances” on the left menu.</li>
<li>Click the checkbox of the instance you want to terminate.</li>
<li>Click “Instance Actions” dropdown list and select “Terminate” to shutdown this instance.</li>
</ol>
<p>&nbsp;</p>
<h2 style="color:darkblue">V. Next Steps</h2>
<ul>
<li>In <a href="/projects/the-mobile-cloud-project-part-1-2-aws-data"><b>Part 1.2: AWS Data</b></a>, I will explore the use of Amazon S3 and EBS for cloud-based storage and Amazon SimpleDB and RDS for database applications.</li>
<li>In <a href="/the-mobile-cloud-project-part-1-3-aws-fault-tolerance"><b>Part 1.3: AWS Fault Tolerance</b></a>, I will explore the AutoScaling and Elastic Load Balancing features of Amazon Web Services.</li>
<li>Please see <a href="/projects/the-mobile-cloud-project/"><b>The Mobile Cloud Project</b></a> page for more info on the other parts of this project.</li>
</ul>
<p>&nbsp;</p>
<h2 style="color:darkblue">VI.  References</h2>
<p><strong>1. Amazon Web Services Technical Documentation</strong><br />
<a href="http://aws.amazon.com/documentation">http://aws.amazon.com/documentation</a></p>
<p><strong>2. Cloud Security Alliance</strong><br />
<a href="http://www.cloudsecurityalliance.org">http://www.cloudsecurityalliance.org</a></p>
<p><strong>3. Ubuntu Server Edition on Amazon EC2</strong><br />
<a href="http://www.ubuntu.com/products/whatisubuntu/serveredition/features/ec2">http://www.ubuntu.com/products/whatisubuntu/serveredition/features/ec2</a></p>
<p></br><br /></br></p>
]]></content:encoded>
			<wfw:commentRss>http://www.RayAcayan.com/projects/the-mobile-cloud-project-part-1-1-basic-aws/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The Mobile Cloud Project</title>
		<link>http://www.RayAcayan.com/projects/the-mobile-cloud-project/</link>
		<comments>http://www.RayAcayan.com/projects/the-mobile-cloud-project/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 19:23:58 +0000</pubDate>
		<dc:creator>Ray Acayan</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Amazon EC2]]></category>
		<category><![CDATA[Amazon S3]]></category>
		<category><![CDATA[Amazon SimpleDB]]></category>
		<category><![CDATA[Amazon Web Services]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[AutoScaling]]></category>
		<category><![CDATA[AWS]]></category>
		<category><![CDATA[BlackBerry]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[Consulting]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[Elastic Load Balancing]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Windows Mobile]]></category>

		<guid isPermaLink="false">http://www.RayAcayan.com/?p=898</guid>
		<description><![CDATA[
The Mobile Cloud Project is my proof-of-concept for developing and hosting a scalable mobile application platform on the Amazon Web Services cloud.
Part 1:  Amazon Web Services


Part 1.1: Basic AWS provides a basic overview of Amazon Web Services and describes my procedure for building Ubuntu Linux virtual servers (Reserved and On-Demand instances) on Amazon EC2.


Part [...]]]></description>
			<content:encoded><![CDATA[<p></br></p>
<p>The Mobile Cloud Project is my proof-of-concept for developing and hosting a scalable mobile application platform on the Amazon Web Services cloud.</p>
<h2 style="color:darkblue">Part 1:  Amazon Web Services</h2>
<ul>
<li>
<a href="/projects/the-mobile-cloud-project-part-1-1-basic-aws"><b>Part 1.1: Basic AWS</b></a> provides a basic overview of Amazon Web Services and describes my procedure for building Ubuntu Linux virtual servers (Reserved and On-Demand instances) on Amazon EC2.
</li>
<li>
<a href="/projects/the-mobile-cloud-project-part-1-2-aws-data/"><b>Part 1.2 AWS Data</b></a> explores the use of Amazon S3 and EBS for cloud-based storage and Amazon SimpleDB and RDS for database applications.
</li>
<li>
<b>Part 1.3: AWS Fault Tolerance</b> explores the AutoScaling and Elastic Load Balancing features of Amazon Web Services.
</li>
</ul>
<h2 style="color:darkblue">Part 2:  Back-End Platform</h2>
<ul>
<li>
<b>Part 2.1: Ruby on Rails Platform</b> describes my development of a simplified Ruby on Rails platform for processing a JSON or RSS/XML input data stream and storing the contents in Amazon SimpleDB.
</li>
<li>
<b>Part 2.2: Python-Django Platform</b> explores the development of the same simplified platform using Python and the Django web framework.
</li>
</ul>
<h2 style="color:darkblue">Part 3:  Mobile Apps</h2>
<ul>
<li>
<b>Part 3.1: iPhone Mobile App</b> describes my development of a simple iPhone 3.0 mobile app for retrieving and displaying the JSON or RSS/XML data stream using push notification.
</li>
<li>
<b>Part 3.2: Android Mobile App</b> explores the development of the same mobile app for the Android open source platform.
</li>
<li>
<b>Part 3.3: BlackBerry Mobile App</b> explores the development of the same mobile app for the BlackBerry platform.
</li>
<li>
<b>Part 3.4 Windows Mobile App</b> explores the development of the same mobile app for the Windows Mobile platform.
</li>
</ul>
<p><br/><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.RayAcayan.com/projects/the-mobile-cloud-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Basic Trade Analysis</title>
		<link>http://www.RayAcayan.com/trading/basic-trade-analysis/</link>
		<comments>http://www.RayAcayan.com/trading/basic-trade-analysis/#comments</comments>
		<pubDate>Mon, 27 Apr 2009 19:39:18 +0000</pubDate>
		<dc:creator>Ray Acayan</dc:creator>
				<category><![CDATA[Trading]]></category>
		<category><![CDATA[Alexander Elder]]></category>
		<category><![CDATA[CFA]]></category>
		<category><![CDATA[continuation]]></category>
		<category><![CDATA[discipline]]></category>
		<category><![CDATA[divergence]]></category>
		<category><![CDATA[diversification]]></category>
		<category><![CDATA[Elliott wave]]></category>
		<category><![CDATA[ETF]]></category>
		<category><![CDATA[Fibonacci]]></category>
		<category><![CDATA[fundamental analysis]]></category>
		<category><![CDATA[GLD]]></category>
		<category><![CDATA[gold]]></category>
		<category><![CDATA[indicators]]></category>
		<category><![CDATA[MACD histogram]]></category>
		<category><![CDATA[momentum]]></category>
		<category><![CDATA[moving average]]></category>
		<category><![CDATA[reversal]]></category>
		<category><![CDATA[risk management]]></category>
		<category><![CDATA[Schweser]]></category>
		<category><![CDATA[StockCharts]]></category>
		<category><![CDATA[technical analysis]]></category>
		<category><![CDATA[trend]]></category>

		<guid isPermaLink="false">http://www.RayAcayan.com/?p=816</guid>
		<description><![CDATA[
I. Overview
This article illustrates my general approach toward generating and analyzing trade ideas.  I use the GLD gold ETF daily chart as an example, but this analysis can be applied to any security in any timeframe.
Many investors follow a passive long-term investing style by placing their money in mutual funds or index funds for [...]]]></description>
			<content:encoded><![CDATA[<p></br></p>
<h2 style="color:darkblue">I. Overview</h2>
<p>This article illustrates my general approach toward generating and analyzing trade ideas.  I use the GLD gold ETF daily chart as an example, but this analysis can be applied to any security in any timeframe.</p>
<p>Many investors follow a passive long-term investing style by placing their money in mutual funds or index funds for diversification.  Needless to say, these investors suffered some losses last year as stock markets plunged across North America: TSX: -40%, DJIA: -38%, S&#038;P500: -42%.</p>
<p>A basic knowledge of technical analysis gives investors another tool to protect their portfolio from extreme market volatility and to take advantage of investment opportunities.  The ideas of technical analysis are not difficult to learn, although their implementation is more of an art than an exact science.  It does not require much time, and long-term investors can analyze charts on a daily or even weekly basis depending on their risk tolerance and time horizon.  Chart analysis does not have to be expensive either; the basic daily GLD chart below was obtained for free at <a href="http://www.stockcharts.com">http://www.stockcharts.com</a>.</p>
<p>In my experience, there are only three basic requirements that are essential to become successful in trading and investing: discipline, discipline, and discipline.</p>
<p>Finally, I am only presenting a part of my trade analysis methodology, not a comprehensive market analysis, and I am certainly not making any stock recommendations.  There is a wealth of investment books, blogs, newspapers, and research journals that you can learn from, and it is up to you to apply this knowledge to your own investment portfolio.</p>
<h2 style="color:darkblue">II. Technical Analysis</h2>
<p>There are many reasons why technical analysis works.  Market psychology and the human emotions of fear and greed are the basic elements that drive all markets.  The collective opinions and perspectives of market participants are reflected in stock charts, and well-known chart patterns have a tendency to repeat themselves in a self-fulfilling prophecy.</p>
<p><img src="http://www.RayAcayan.com/img/gld.jpg"></img></p>
<p>This daily chart of the GLD gold ETF was obtained for free at <a href="http://www.stockcharts.com">http://www.stockcharts.com</a> using the default parameters.  The following numbered points below correspond to the numbers on the chart above.  Although this analysis pertains to a single chart, I usually look at several charts simultaneously, such as the index futures and currency charts, in order to determine relative strength or weakness.</p>
<h3>1. Trend</h3>
<p>As the saying goes, &#8220;The trend is your friend&#8230; until the end.&#8221;  Trading with the trend gives you a higher probability of profitable trades than trading against the trend.  In this chart, I look at the price and the 50 day moving average (50dma) and their relation to the 200 day moving average (200dma).  Here, both the price and 50dma are above the 200dma, so the stock is in a general uptrend.  However, this does not mean that I should buy now.  This just means that I only look for potential buy trades and ignore any potential short trades.</p>
<p>I also prefer the moving averages to be pointing up in an uptrend.  In this case, both the 50dma and 200dma are flat, suggesting a pause in the uptrend, a neutral outlook, or a possible reversal in the future.</p>
<p>If either the price or the 50dma fall below the 200dma, then I would consider this the end of the uptrend and the possible start of a new downtrend or a neutral sideways trend.</p>
<p>Elliott wave counts can also be useful in identifying trends and counter-trends.  In my opinion, we may have just completed the end of a wave C correction, which suggests that a new bull market primary trend could resume shortly.</p>
<h3>2. Support and Resistance</h3>
<p>Next, I look for areas of support and resistance on the chart.  When a support level gets broken, it tends to become a new resistance level.  Similarly, a broken resistance becomes a new support level.</p>
<p>The 50dma and 200dma are very important, and I also draw trend lines between major peaks and major troughs in the chart.  For intraday trades, I also look at the previous day&#8217;s high, low, and close.  Fibonacci ratios are other useful levels to watch.</p>
<p>At point #2 on the chart, the price bounced off the 200dma in a double-bottom pattern, which is a bullish signal.</p>
<p>The stock price also recently broke up through the down trendline near point #4, which a bullish signal as well.  This previous resistance line becomes a new support line for GLD.</p>
<h3>3. Divergence (Trend Reversal)</h3>
<p>Momentum indicators normally follow price movements, so the indicator should go up when the price goes up, and go down when the price goes down.</p>
<p>Divergence occurs when there is a conflict in direction between price versus momentum indicators.  Positive divergence occurs when the stock price is falling while the momentum indicator is trending upward.  This suggests that the downward price move is unsustainable due to the upward momentum, resulting in a bullish signal.  Negative divergence is a bearish signal that occurs when the stock price is rising while the momentum indicator is in a downtrend.</p>
<p>The MACD histogram is a good momentum indicator to watch.  In fact, in his book &#8220;Come into My Trading Room&#8221;, Dr. Alexander Elder regards MACD histogram divergence as the strongest signal in technical analysis.</p>
<p>Point #3 on the chart shows a positive divergence due to a rising trendline on the MACD histogram, while the price made a new low at Point #2.  This was another bullish signal for GLD.</p>
<h3>4. Trend Continuation</h3>
<p>Given the signals above, Point #2 was a good buying opportunity for GLD on Apr 19.  If you missed it, you can still look for other support and resistance levels to confirm the uptrend or to signal a possible trend reversal.</p>
<p>Point #4 shows a previous resistance line that is now a support line.  If this support holds, then GLD should continue on its uptrend; if it breaks, then GLD may head back down again toward the 200dma.</p>
<p>Point #4 also shows a 50dma resistance level.  If GLD can break though the 50dma on large volume, then it will likely head upward toward the next resistance level.  If not, then GLD may head into a sideways pattern between the 50dma and 200dma range.</p>
<p>In this case, I would place a buy order just above the 50dma in order to participate in the trend continuation, if the price can break through the 50dma.</p>
<h3>5. Uncertainty</h3>
<p>If GLD can continue its uptrend, the next hurdle (Point #5) is a major psychological resistance level at $100, which corresponds to a gold price of $1,000 per ounce.  GLD came very close to the $100 barrier on Jul 15, 2008 and again on Feb 29, 2009, but was unable to surpass it.  If GLD can break though this resistance level, then it will achieve an all-time high with no more resistance levels above.  Otherwise, GLD could bounce off the $100 resistance again and head back down.</p>
<p>At these points of uncertainty, it is often a good idea to take some profits or cut your losses by closing out some or all of your position.  In this case, I would think about selling GLD just below $100 and buying it back after it finally breaks decisively above the $100 resistance.</p>
<h2 style="color:darkblue">III. Fundamental Analysis</h2>
<p>Fundamental analysis is always important regardless of your trading methods or time horizon.  Sharp fundamental analysts can anticipate the direction of a stock&#8217;s price before it happens (i.e. before it appears on a chart for technical analysts to analyze).  You simply cannot trade in a vacuum and ignore the market and industry context surrounding your investments.</p>
<p>In gold&#8217;s case, there are many macroeconomic reasons to own gold: diversification, rising demand, falling supply, as a hedge against rising inflation (after the current deflationary environment), as a hard-asset hedge against financial (i.e. paper) instruments, as a hedge against falling currencies, etc.  For similar reasons, China has reportedly been hoarding gold at a fast pace (<a href="http://uk.reuters.com/article/businessNews/idUKTRE53N47O20090424">&#8220;China bolsters its gold reserves&#8221; &#8211; Reuters</a>) which suggests rising gold demand in the future.</p>
<p>In the case of equities, fundamental analysis includes industry analysis, financial statement analysis, ratio analysis, due diligence, etc, and is a wide-ranging subject that is clearly outside the scope of this blog.  The <a href="http://www.cfainstitute.org">CFA Institute</a> and the <a href="http://www.schweser.com">Schweser CFA study guides</a> present a comprehensive and concentrated amount of material that should be valuable to all investors.</p>
<h2 style="color:darkblue">IV. Risk Management and Discipline</h2>
<p>Institutions use a variety of risk management tools for analyzing portfolio risk, pricing derivatives, and hedging risk.  On the other hand, individual traders and investors can benefit from a few simple rules of thumb such as setting a maximum loss limit of 2% per trade, immediately closing a trade if the market proves that your analysis was wrong, setting stop losses, and diversification by limiting each trade to no more than 5% of your total investment capital.  Although trading rules are important, having the discipline to follow them is vital to success in both trading and investing.</p>
<p>Finally, risks are unpredictable and they are everywhere in black swan formation.  A flu pandemic, bank failure, or nuclear crisis can easily destroy the trade ideas you derived from technical and fundamental analysis.  Having the proper risk management controls in place should protect your investment portfolio over the long term.</p>
<h2 style="color:darkblue">V. Conclusion</h2>
<p>You can be the best developer / doctor / lawyer / accountant / etc in your field and still lose 40% of your hard-earned money after investing it in a reputable equity mutual fund last year.  You could spend 6 months developing an excellent iPhone app that doesn&#8217;t sell because it is too complex and doesn&#8217;t generate enough popularity among the general public.  You can share your awesome ideas with thousands of followers on social networks and not make a dime in online advertising.  You can develop insanely great software that never sees the light of day due to economic circumstances beyond your control.</p>
<p>Trading and investing are some of the very few activities where people can make money directly from their ideas.  Trade analysis is not difficult, time-consuming, or expensive, but it requires complete discipline when implementing your trading plan.</p>
<p>A basic knowledge of trade analysis techniques, which span the range of technical analysis, fundamental analysis, and risk management, is essential to everyone who earns an income and/or has money to invest.  I encourage you to continue learning about these subjects to help improve your investment performance and recover any losses you may have suffered from last year&#8217;s disaster.<br />
<br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.RayAcayan.com/trading/basic-trade-analysis/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The Web Mail Migration Project</title>
		<link>http://www.RayAcayan.com/projects/the-web-mail-migration-project/</link>
		<comments>http://www.RayAcayan.com/projects/the-web-mail-migration-project/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 13:00:53 +0000</pubDate>
		<dc:creator>Ray Acayan</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Amazon]]></category>
		<category><![CDATA[Citizen Lab]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[Consulting]]></category>
		<category><![CDATA[EC2]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[Enigmail]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[GhostNet]]></category>
		<category><![CDATA[Gmail]]></category>
		<category><![CDATA[GnuPG]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[GPG]]></category>
		<category><![CDATA[IMAP]]></category>
		<category><![CDATA[LDAP]]></category>
		<category><![CDATA[Lightning]]></category>
		<category><![CDATA[LinkedIn]]></category>
		<category><![CDATA[malware]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[Outlook]]></category>
		<category><![CDATA[PGP]]></category>
		<category><![CDATA[POP3]]></category>
		<category><![CDATA[PST]]></category>
		<category><![CDATA[SkyDrive]]></category>
		<category><![CDATA[SSL]]></category>
		<category><![CDATA[Thunderbird]]></category>
		<category><![CDATA[TLS]]></category>

		<guid isPermaLink="false">http://www.RayAcayan.com/?p=554</guid>
		<description><![CDATA[
I. Overview
This project presents a procedure for migrating my email from a local Microsoft Outlook PST/POP3 configuration to a web-based IMAP solution using Mozilla Thunderbird and Enigmail for PGP encryption.  Although this is my personal project, it can be extended to companies interested in reducing their IT costs by outsourcing their enterprise email administration [...]]]></description>
			<content:encoded><![CDATA[<p></br></p>
<h2 style="color:darkblue">I. Overview</h2>
<p>This project presents a procedure for migrating my email from a local Microsoft Outlook PST/POP3 configuration to a web-based IMAP solution using Mozilla Thunderbird and Enigmail for PGP encryption.  Although this is my personal project, it can be extended to companies interested in reducing their IT costs by outsourcing their enterprise email administration and spam / malware protection to a cloud-based provider like Google Gmail.<br />
I hope that you will benefit from this resource in your own projects.</p>
<p><strong>Security</strong></p>
<p>Email security has always been an important concern of mine.  Over the past several years, I have stored my email locally in password-protected Outlook PST files, which are then encrypted within a PGPdisk on top of an encrypting file system in a portable USB key.  I found this to be a reasonable precaution short of stopping all email use altogether (<a href="http://www-cs-faculty.stanford.edu/~knuth/email.html">&#8220;Knuth versus Email&#8221; &#8211; Don Knuth</a>).</p>
<p>Like most web mail providers, Gmail provides security in terms of TLS/SSL, which encrypts network communication between my computer and Gmail&#8217;s servers.  However, the email messages themselves are not encrypted, so anyone who can crack my password can simply log into gmail.com and view all my mail.  To prevent this, I configured Gmail to allow POP3 access so that my local Outlook could retrieve my email, store it in a local password-protected PST file, and delete Gmailâ€™s copy from the server.  This approach is far from foolproof, since my computer itself can be hacked by malware, botnets, and GhostNet crackers recently discovered by UofT&#8217;s Citizen Lab (<a href="http://www.nytimes.com/2009/03/29/technology/29spy.html?_r=3&#038;pagewanted=1&#038;hp">&#8220;Vast Spy System Loots Computers in 103 Countries&#8221; &#8211; The New York Times</a>).</p>
<p>Security is also a top concern for businesses and individuals considering cloud-based services such as Amazon EC2 or web-based storage like Microsoft SkyDrive.  The network traffic may be encrypted, but the data itself is usually not, or is easily accessible after getting past a single username and password.  It is often a good idea to encrypt all private data using PGP before storing it anywhere on the web.  PGP adds another layer of security so that a cracker who obtains your username and password will not be able to read your encrypted data without your private key, or other employees&#8217; encrypted data without their private keys, even when they are stored together in a common WebDAV disk.  In my case, I am comfortable storing my PGP-encrypted email on Google&#8217;s Gmail servers.</p>
<p><strong>Multi-Access Capability</strong></p>
<p>The proliferation of netbooks and wireless devices also complicates access to locally secure email.  My three servers (Vista x64, Mac OS X, Ubuntu Linux), laptop (XP), Blackberry, and iPhone cannot all access my local PST file at the same time.  Even worse, each device had its own email storage containing unsecure copies of my email.  A recent USB-related data corruption event also highlighted the vulnerability of my PST file itself as a single point of failure.  Therefore, the Outlook PST/POP3 solution was no longer viable with regard to security and multi-access capability.</p>
<p>Several technologies are ideal replacements for Microsoft Outlook and POP3.  Internet Message Access Protocol, or IMAP, allows synchronized access to a web mailbox from multiple devices simultaneously.  Mozilla Thunderbird and Lightning are excellent open-source email and calendars clients for Windows, Mac OS X, and Linux.  GnuPG is a free implementation of the OpenPGP encryption standard, and Enigmail is an OpenPGP extension for Thunderbird.</p>
<p><img src="/blog/img/webmail.jpg"></img><br />
<br /></br></p>
<h2 style="color:darkblue">II. Consulting</h2>
<p>I do my best to explain the concepts and techniques behind my projects.  If you like my work and can use my expertise in your projects, I am available for <span id="consulting_page" onmouseover="consulting_mouseOver()" onmousemove="consulting_mouseMove()" onmouseout="consulting_mouseOut()"><a href="http://www.RayAcayan.com/consulting/"><strong>consulting</strong></a></span> at a competitive rate.<br />
<br /></br></p>
<h2 style="color:darkblue">III. Procedure</h2>
<p><strong><a href="http://www.RayAcayan.com/the-web-mail-migration-project-procedure/">&lt; Click here to view the detailed procedure for this project &gt;</a></strong><br />
<br /></br></p>
<h2 style="color:darkblue">IV. Future Enhancements</h2>
<p><strong>1. PGP Encryption in Social Networks</strong></p>
<p>Social networking sites are increasingly used as alternatives to traditional email, but are notorious for lax or non-existent security measures.  If a cracker gets into your Facebook or LinkedIn account, they will have full access to all of your private messages.  With PGP encryption, the messages in those Inbox and InMail accounts will appear as gibberish to crackers since only you possess the private key/s to decrypt them.</p>
<p><strong>2. PGP Encryption in the Enterprise</strong></p>
<p>Some firms have corporate policies against the use of email encryption, with the rationale that managers and executives need access to their employees&#8217; email in certain situations.  However, this policy also leaves employees&#8217; email vulnerable to malicious administrators or crackers with the ability to intercept these messages.  A better approach would be to enforce encryption on all intercompany email, with the employees&#8217; private keys accessible to managers and executives who are authorized to decrypt and read their email under strict corporate guidelines.</p>
<p><strong>3. Gmail in the Enterprise</strong></p>
<p>Due to Google&#8217;s high-performance cloud network, Gmail can provide a more robust and reliable email service than many in-house corporate environments.  However, Gmail still lacks some features required by enterprise users, such as LDAP authentication, private global address lists, auto-encryption via GPG/PGP keys, DNS redirection, and cloud-based antivirus.  Google can consider providing its own LDAP servers or integrate into a firm&#8217;s existing LDAP servers in order to securely process email authentication for corporate users.  Gmail could also partition corporate email from general-public email to create global address lists that are private to each company.  Auto-encryption is a highly desirable feature because it ensures email encryption not only between intercompany users within Gmail, but also between all Gmail users.  DNS redirection will enable Gmail to process incoming and outgoing messages transparently as if they were from/to user@mycompany.com instead of user@gmail.com.  Finally, Google can consider bundling a cloud-based antivirus solution such as Symantec to provide enhanced virus and malware protection for email attachments at all endpoints of the Gmail cloud network.<br />
<br /></br></p>
<h2 style="color:darkblue">V. References</h2>
<p><strong>1. PGP &#8211; Pretty Good Privacy</strong><br />
<a href="http://en.wikipedia.org/wiki/Pretty_Good_Privacy">http://en.wikipedia.org/wiki/Pretty_Good_Privacy</a></p>
<p><strong>2. TLS/SSL &#8211; Transport Layer Security / Secure Sockets Layer</strong><br />
<a href="http://en.wikipedia.org/wiki/Secure_Sockets_Layer">http://en.wikipedia.org/wiki/Secure_Sockets_Layer</a></p>
<p><strong>3. POP3 &#8211; Post Office Protocol</strong><br />
<a href="http://en.wikipedia.org/wiki/Post_Office_Protocol">http://en.wikipedia.org/wiki/Post_Office_Protocol</a></p>
<p><strong>4. IMAP &#8211; Internet Message Access Protocol</strong><br />
<a href="http://en.wikipedia.org/wiki/Internet_Message_Access_Protocol">http://en.wikipedia.org/wiki/Internet_Message_Access_Protocol</a></p>
<p><strong>5. Mozilla Thunderbird</strong><br />
<a href="http://www.mozillamessaging.com/en-US/thunderbird/">http://www.mozillamessaging.com/en-US/thunderbird/</a></p>
<p><strong>6. Lightning</strong><br />
<a href="https://addons.mozilla.org/en-US/thunderbird/addon/2313">https://addons.mozilla.org/en-US/thunderbird/addon/2313</a></p>
<p><strong>7. Provider for Google Calendar</strong><br />
<a href="https://addons.mozilla.org/en-US/thunderbird/addon/4631">https://addons.mozilla.org/en-US/thunderbird/addon/4631</a></p>
<p><strong>8. GPG &#8211; GNU Privacy Guard</strong><br />
<a href="http://www.gnupg.org/">http://www.gnupg.org/</a></p>
<p><strong>9. Enigmail</strong><br />
<a href="http://enigmail.mozdev.org/home/index.php">http://enigmail.mozdev.org/home/index.php</a></p>
<p><strong>10. Gmail Help</strong><br />
<a href="http://mail.google.com/support/">http://mail.google.com/support/</a></p>
<p><strong>11. Microsoft SkyDrive</strong><br />
<a href="http://en.wikipedia.org/wiki/Windows_Live_SkyDrive">http://en.wikipedia.org/wiki/Windows_Live_SkyDrive</a></p>
<p><strong>12. Amazon EC2</strong><br />
<a href="http://aws.amazon.com/ec2/">http://aws.amazon.com/ec2/</a></p>
<p><strong>13. Microsoft Windows Live SkyDrive</strong><br />
<a href="http://skydrive.live.com/">http://skydrive.live.com/</a></p>
<p><strong>14. Google App Engine</strong><br />
<a href="http://code.google.com/appengine/">http://code.google.com/appengine/</a></p>
<p><strong>15. Gmail Labs</strong><br />
<a href="http://gmailblog.blogspot.com/2008/06/introducing-gmail-labs.html">http://gmailblog.blogspot.com/2008/06/introducing-gmail-labs.html</a></p>
<p></br></p>
]]></content:encoded>
			<wfw:commentRss>http://www.RayAcayan.com/projects/the-web-mail-migration-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Genius And Experimentation</title>
		<link>http://www.RayAcayan.com/personal/genius-and-experimentation/</link>
		<comments>http://www.RayAcayan.com/personal/genius-and-experimentation/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 17:55:27 +0000</pubDate>
		<dc:creator>Ray Acayan</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[financial engineering]]></category>
		<category><![CDATA[gaussian copula]]></category>
		<category><![CDATA[genius]]></category>
		<category><![CDATA[hacklab.to]]></category>
		<category><![CDATA[Leonardo da Vinci]]></category>
		<category><![CDATA[Malcolm Gladwell]]></category>
		<category><![CDATA[Mark Twain]]></category>
		<category><![CDATA[Mozard]]></category>
		<category><![CDATA[Nikola Tesla]]></category>
		<category><![CDATA[Pete Forde]]></category>
		<category><![CDATA[Picasso]]></category>
		<category><![CDATA[Richard Feynman]]></category>
		<category><![CDATA[The New Yorker]]></category>
		<category><![CDATA[Thomas Edison]]></category>
		<category><![CDATA[Unspace]]></category>
		<category><![CDATA[Wired]]></category>

		<guid isPermaLink="false">http://www.RayAcayan.com/?p=514</guid>
		<description><![CDATA[

Over the years, I have had the privilege of meeting and working with many smart and creative individuals.   From tech startups to community open-source projects to member-driven projects at HackLab.TO, it appears to me that the common thread of genius is cultivated by providing an open environment for tinkering and experimentation.
Although pure research [...]]]></description>
			<content:encoded><![CDATA[<p></br></p>
<p><img src="/blog/img/Vitruvian-Man.jpg"></img></p>
<p>Over the years, I have had the privilege of meeting and working with many smart and creative individuals.   From tech startups to community open-source projects to member-driven projects at <a href="http://hacklab.to/">HackLab.TO</a>, it appears to me that the common thread of genius is cultivated by providing an open environment for tinkering and experimentation.</p>
<p>Although pure research certainly has its place in academia and R&#038;D, it sometimes creates an air of universal legitimacy where none was intended.  The Gaussian copula is an example of a financial theory from academia which was quickly adopted by risk managers due to its simplicity and research credentials, but is now claimed to be responsible for the greatest financial crisis in recent history (<a href="http://www.wired.com/techbiz/it/magazine/17-03/wp_quant?currentPage=all">Wired &#8211; &#8220;The Formula That Killed Wall Street&#8221;</a>).</p>
<p><img src="/blog/img/Gaussian_Copula.jpg"></img></p>
<p>On the other hand, experimentation makes no pretense of viability or legitimacy, and thus provides tinkerers with the freedom to start small, fail quickly, learn from their mistakes, and create better ideas without causing a financial disaster.  Leonardo da Vinci, Nikola Tesla, Thomas Edison, Mark Twain, Mozart, Picasso, and Richard Feynman are some of the more famous genius experimentalists of our age.  </p>
<p>Author and journalist Malcom Gladwell provides some fascinating observations about youthful prodigies versus late-blooming genius (<a href="http://www.newyorker.com/reporting/2008/10/20/081020fa_fact_gladwell?currentPage=all">The New Yorker &#8211; &#8220;Late Bloomers&#8221;</a>).  I would argue that this is not necessarily a function of a person&#8217;s age, but rather the number of failures, or learning experiences, they have made before finally making tremendous progress.  Young prodigies found their niche early, failed quickly, and achieved early success.  Late bloomers, on the other hand, experimented with different fields or careers before eventually finding their niche, then continued to fail and learn quickly in that niche before achieving success.  Failure, experimentation, focus, and discipline are vital to uncovering our hidden genius.</p>
<p><img src="/blog/img/NewYorker_LateBloomers.jpg"></img></p>
<p>The role of organizations in cultivating or destroying genius is not, in my opinion, the result of the organizations themselves or their bureaucracy.  Rather, it is a function of how much freedom their employees are given to experiment with their ideas.  In the current recessionary environment, the cost-cutting mandates and tight project-management schedules are highly detrimental to the creative employee&#8217;s ability to try new ideas that are not included in the budget or project schedule.</p>
<p>I conclude with the following comment I had recently written in response to a blog post (<a href="http://rethink.unspace.ca/2009/3/20/the-best-of-intentions">&#8220;The best of intentions&#8221;</a>) by Unspace founder Pete Forde:<br />
_____________________________________________________________________</p>
<p>Pete,</p>
<p>Great advice!  A web startup is an excellent environment for cultivating rock star talents and nurturing genius in all of its forms.</p>
<p>Unfortunately, there are many smart individuals who do not have the connections, business knowledge, or financial capacity to leave a full-time job in order to start a new web development company.  Instead, they continue to languish in heavily bureaucratic organizations, many of which are controlled by head offices in other countries.  The opposing business and technical agendas at these firms can be highly restrictive and quite damaging to the natural talents and creativity of young prodigies.  At some point, the light of genius inevitably dims and dies out completely.</p>
<p>I shudder to think what might have happened if one of your partners (mef) had continued working for me at one of these bureaucratic financial firms.  Nevertheless, not everyone can work for a startup, and large organizations continue to hire bright people and turn them into mindless droids.  What you have accomplished at Unspace should be a shining example not only for startups, but for these larger firms as well.  In my opinion, if companies can provide an open environment for tinkering and experimentation by their creative employees, and the proper channels to hear and implement their ideas, we will find that geniuses are truly everywhere.</p>
<p>Regards,<br />
Ray Acayan</p>
<p>_____________________________________________________________________</p>
<p><br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.RayAcayan.com/personal/genius-and-experimentation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The QuantLib Ruby Project, Part 2</title>
		<link>http://www.RayAcayan.com/projects/the-quantlib-ruby-project-part-2/</link>
		<comments>http://www.RayAcayan.com/projects/the-quantlib-ruby-project-part-2/#comments</comments>
		<pubDate>Tue, 10 Mar 2009 12:32:45 +0000</pubDate>
		<dc:creator>Ray Acayan</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Consulting]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[QuantLib]]></category>
		<category><![CDATA[QuantLib-SWIG]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://www.RayAcayan.com/?p=382</guid>
		<description><![CDATA[
I. Overview
Part 2 of this project presents a Ruby on Rails implementation of a QuantLib web application for pricing American options.  This builds on the QuantLib Ruby server created in Part 1.  Click anywhere on the image below to view the web application.


II. Consulting
I do my best to explain the concepts and techniques [...]]]></description>
			<content:encoded><![CDATA[<p></br></p>
<h2 style="color:darkblue">I. Overview</h2>
<p><a href="the-quantlib-ruby-project-part-2"><b>Part 2</b></a> of this project presents a Ruby on Rails implementation of a QuantLib web application for pricing American options.  This builds on the QuantLib Ruby server created in <a href="projects/the-quantlib-ruby-project-part-1"><b>Part 1</b></a>.  Click anywhere on the <a href="http://www.RayAcayan.com:3250/"><b>image</b></a> below to view the web application.</p>
<p><a href="http://www.RayAcayan.com:3250/"><img src="/blog/img/RayQuantLib.jpg" alt="Ray's QuantLib Ruby Project"  /></a><br />
<br /></br></p>
<h2 style="color:darkblue">II. Consulting</h2>
<p>I do my best to explain the concepts and techniques behind my projects.  If you like my work and can use my expertise in your projects, I am available for <span id="consulting_page" onmouseover="consulting_mouseOver()" onmousemove="consulting_mouseMove()" onmouseout="consulting_mouseOut()"><a href="http://www.RayAcayan.com/consulting/"><strong>consulting</strong></a></span> at a competitive rate.<br />
<br /></br></p>
<h2 style="color:darkblue">III. Procedure</h2>
<p><strong>1. Create the Rails Project and MVC</strong></p>
<p><strong>a.) Create the Rails Project</strong><br />
Using a terminal window on the QuantLib Ruby server, create the Rails project as follows:</p>
<div class="code">
$ rails RayQuantLib<br />
$ cd RayQuantLib
</div>
<p>A Rails application uses the Model-View-Controller (MVC) framework, which separates an application&#8217;s data (model), user interface (view), and business/control logic (controller) into three distinct components.</p>
<p><strong>b.) Create the MySQL Database</strong></p>
<p>Create a new username and 3 databases for development, test, and production, as required by the Rails framework.</p>
<div class="code">
$ mysql -u root -p &lt;password&gt;<br />
mysql> create user &lt;username&gt;;<br />
mysql> set password for &lt;username&gt; = password(&#8221;&lt;password&gt;&#8221;);<br />
mysql> create database RayQuantLib_dev;<br />
mysql> grant all on RayQuantLib_dev.* to &lt;username&gt;@localhost identified by &#8216;&lt;password&gt;&#8217;;<br />
mysql> create database RayQuantLib_test;<br />
mysql> grant all on RayQuantLib_test.* to &lt;username&gt;@localhost identified by &#8216;&lt;password&gt;&#8217;;<br />
mysql> create database RayQuantLib_prod;<br />
mysql> grant all on RayQuantLib_prod.* to &lt;username&gt;@localhost identified by &#8216;&lt;password&gt;&#8217;;
</div>
<p>Modify the database.yml file to use the following database configuration for development: test: and production:<br />
&nbsp;&nbsp;<strong>RayQuantLib/config/database.yml</strong></p>
<div class="code">
development:<br />
&nbsp;&nbsp;  adapter: mysql<br />
&nbsp;&nbsp;  database: RayQuantLib_dev<br />
&nbsp;&nbsp;  username: &lt;username&gt;<br />
&nbsp;&nbsp;  password: &lt;password&gt;<br />
<br />
test:<br />
&nbsp;&nbsp;  adapter: mysql<br />
&nbsp;&nbsp;  database: RayQuantLib_test<br />
&nbsp;&nbsp;  username: &lt;username&gt;<br />
&nbsp;&nbsp;  password: &lt;password&gt;<br />
<br />
production:<br />
&nbsp;&nbsp;  adapter: mysql<br />
&nbsp;&nbsp;  database: RayQuantLib_prod<br />
&nbsp;&nbsp;  username: &lt;username&gt;<br />
&nbsp;&nbsp;  password: &lt;password&gt;
</div>
<p><strong>c.) Create the Model</strong></p>
<p>Create a Model named &#8220;AmericanOption&#8221; and perform the initial database migration as follows:</p>
<div class="code">
$ ruby script/generate model AmericanOption<br />
$ rake db:migrate
</div>
<p><strong>d.) Create the Controller and View</strong></p>
<p>Create a Controller and View named &#8220;AmericanOption&#8221; as follows: </p>
<div class="code">
$ ruby script/generate controller AmericanOption index
</div>
<p>Declare this resource by adding the following line to:<br />
&nbsp;&nbsp;<strong>RayQuantLib/config/routes.rb</strong></p>
<div class="code">
map.resources :AmericanOption
</div>
<p></br><br />
<strong>2. Create the Application Layout View</strong></p>
<p>Create the following file for the XHTML application layout.  This layout is displayed at the beginning of every web page in the application, and the &#8220;yield&#8221; function passes control to the appropriate Controller.</p>
<p>&nbsp;&nbsp;<strong>RayQuantLib/app/views/layouts/application.html.erb</strong></p>
<div class="code">
&lt;!DOCTYPE html PUBLIC &#8220;-//W3C//DTD XHTML 1.0 Strict//EN&#8221;<br />
&#8220;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&#8221;&gt;<br />
&lt;html xmlns=&#8221;http://www.w3.org/1999/xhtml&#8221; xml:lang=&#8221;en&#8221; lang=&#8221;en&#8221;&gt;<br />
&nbsp;&nbsp;  &lt;head&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;    &lt;meta http-equiv=&#8221;Content-type&#8221; content=&#8221;text/html; charset=utf-8&#8243; /&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;    &lt;title&gt;Ray&#8217;s QuantLib Ruby Project&lt;/title&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;    &lt;%= stylesheet_link_tag &#8217;style&#8217; %&gt;<br />
&nbsp;&nbsp;  &lt;/head&gt;<br />
&nbsp;&nbsp;  &lt;body&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;    &lt;div id=&#8221;content&#8221;&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;    &lt;h2&gt;Ray&#8217;s QuantLib Ruby Project&lt;/h2&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;    &lt;%= yield %&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;    &lt;/div&gt;<br />
&nbsp;&nbsp;  &lt;/body&gt;<br />
&lt;/html&gt;
</div>
<p>Create the CSS file referenced in application layout:<br />
&nbsp;&nbsp;<strong>RayQuantLib/public/stylesheets/style.css</strong></p>
<p><strong>3. Create the Input Form View</strong></p>
<p>Create the input form for &#8220;Pricing American Options&#8221; in the following file.  The sample code below shows some design patterns for creating a form, listbox, date, and textbox in Ruby on Rails:</p>
<p>&nbsp;&nbsp;<strong>RayQuantLib/app/views/american_option/index.html.erb</strong></p>
<div class="code">
&lt;% form_tag(&#8217;/american_option&#8217;) do -%&gt;<br />
&nbsp;&nbsp;  &lt;% field_set_tag nil, :class => &#8216;form_fieldset&#8217; do %&gt;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;  &lt;p&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;  &lt;span class=&#8221;form_label&#8221;&gt;Option Type:&lt;/span&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;  &lt;%= select_tag :optionType, options_for_select([["Call Option","0"],<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;["Put Option","1"]], @optionType.to_s) %&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;  &lt;/p&gt;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;  &lt;p&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;  &lt;span class=&#8221;form_label&#8221;&gt;Exercise Date:&lt;/span&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;  &lt;%= date_select(&#8217;range&#8217;, &#8216;exerciseDate&#8217;,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :order =&gt; [:month, :day, :year], :use_short_month =&gt; true,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :default =&gt; @exerciseDate) %&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;  &lt;span class=&#8221;form_error&#8221;&gt;&lt;%= @exerciseDate_error %&gt;&lt;/span&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;  &lt;/p&gt;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;  &lt;p&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;  &lt;span class=&#8221;form_label&#8221;&gt;Volatility (%):&lt;/span&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;  &lt;span>&lt;%= text_field_tag &#8216;volatility&#8217;, @volatility.to_s,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:size =&gt; 4, :maxlength =&gt; 4 %&#038;gt&lt;/span&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;  &lt;span class=&#8221;form_error&#8221;&gt;&lt;%= @volatility_error %&gt;&lt;/span&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;  &lt;/p&gt;</p>
<p>&nbsp;&nbsp;  &lt;% end %&gt;<br />
&lt;% end -%&gt;
</p></div>
<p>Rather than building the form directly with XHTML tags, the Rails form_tag helper is used here to defend against Cross-Site Request Forgery (CSRF) attacks via the unique authenticity_token which Rails generates for each form session.</p>
<p><strong>4. Process Form Input in the Controller</strong></p>
<p>In a Rails application, the Controller is responsible for handling business logic and passing variables between the Model and the View.  The sample Ruby code below, which is entered within the index function (def index), shows some design patterns for retrieving the values entered in the Input Form.</p>
<p>&nbsp;&nbsp;<strong>RayQuantLib/app/controllers/american_option_controller.rb</strong></p>
<div class="code">
if( params[:optionType].nil? )<br />
&nbsp;&nbsp;  @optionType = 0   # default to &#8220;Call Option&#8221;<br />
else<br />
&nbsp;&nbsp;  @optionType = params[:optionType].to_i<br />
end</p>
<p>if( params[:range].nil? )<br />
&nbsp;&nbsp;  # initialize form parameters<br />
&nbsp;&nbsp;  @exerciseDate = Date.today.next_year()   &nbsp;&nbsp;&nbsp;&nbsp;# set date in Ruby<br />
&nbsp;&nbsp;  ex_daysfromtoday = (@exerciseDate &#8211; Date.today).to_i<br />
&nbsp;&nbsp;  exerciseDate = QuantLib::Date.todaysDate() + ex_daysfromtoday  &nbsp;&nbsp;&nbsp;&nbsp;# set date in QuantLib<br />
else<br />
&nbsp;&nbsp;  # process form fields<br />
&nbsp;&nbsp;  @exerciseDate = Date.civil(params[:range][:"exerciseDate(1i)"].to_i,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    params[:range][:"exerciseDate(2i)"].to_i,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;    params[:range][:"exerciseDate(3i)"].to_i)<br />
end
</p></div>
<p>The sample Ruby code below is used for input form validation:</p>
<div class="code">
if( @exerciseDate < @settlementDate )<br />
&nbsp;&nbsp;  @exerciseDate_error = '* Exercise Date must be greater or equal to Settlement Date'<br />
&nbsp;&nbsp;  form_error = true<br />
else<br />
&nbsp;&nbsp;  @exerciseDate_error = ''<br />
end</p>
<p>if( @volatility < 0 or @volatility > 100 )<br />
&nbsp;&nbsp;  @volatility_error = &#8216;* Volatility must be between 0 and 100&#8242;<br />
&nbsp;&nbsp;  form_error = true<br />
else<br />
&nbsp;&nbsp;  @volatility_error = &#8221;<br />
end</p>
<p>if( form_error )<br />
&nbsp;&nbsp;  return<br />
end
</p></div>
<p></br><br />
<strong>5. Process QuantLib Calculations in the Controller</strong></p>
<p>To enable QuantLib, the following lines must be entered at the top of the Controller file:<br />
&nbsp;&nbsp;<strong>RayQuantLib/app/controllers/american_option_controller.rb</strong></p>
<div class="code">
require &#8216;QuantLib&#8217;<br />
include QuantLib
</div>
<p>The sample code below shows how to call QuantLib functions within Ruby on Rails.  The QuantLib-SWIG interface library (installed in Part 1) allows us to call QuantLib C++ functions as if they were Ruby functions.</p>
<div class="code">
riskFreeRate = FlatForward.new(settlementDate, (@riskFreeRate/100.0), Actual365Fixed.new)<br />
exercise = AmericanExercise.new(settlementDate, exerciseDate)<br />
if( @optionType == 0 )<br />
&nbsp;&nbsp;  payoff = PlainVanillaPayoff.new(Option::Call, @strikePrice)<br />
else<br />
&nbsp;&nbsp;  payoff = PlainVanillaPayoff.new(Option::Put, @strikePrice)<br />
end<br />
underlying = SimpleQuote.new(@underlyingPrice)<br />
volatility = BlackConstantVol.new(valuationDate, TARGET.new,<br />
&nbsp;&nbsp;&nbsp;&nbsp;(@volatility/100.0), Actual365Fixed.new)<br />
dividendYield = FlatForward.new(settlementDate, (@dividendYield/100.0), Actual365Fixed.new)<br />
process = BlackScholesMertonProcess.new(<br />
&nbsp;&nbsp;&nbsp;&nbsp;            QuoteHandle.new(underlying),<br />
&nbsp;&nbsp;&nbsp;&nbsp;            YieldTermStructureHandle.new(dividendYield),<br />
&nbsp;&nbsp;&nbsp;&nbsp;            YieldTermStructureHandle.new(riskFreeRate),<br />
&nbsp;&nbsp;&nbsp;&nbsp;            BlackVolTermStructureHandle.new(volatility))<br />
option = VanillaOption.new(payoff, exercise)
</div>
<p></br><br />
<strong>6. Display Controller Output to the View</strong></p>
<p>The sample Ruby code below displays the output by populating the @output variable, which is passed back to the View.</p>
<div class="code">
# method: analytic<br />
option.pricingEngine = BaroneAdesiWhaleyEngine.new(process)<br />
report(&#8217;Barone-Adesi-Whaley&#8217;, option.NPV)<br />
option.pricingEngine = BjerksundStenslandEngine.new(process)<br />
report(&#8217;Bjerksund-Stensland&#8217;,option.NPV)<br />
<br />
# method: finite differences<br />
timeSteps = 801<br />
gridPoints = 800<br />
option.pricingEngine = FDAmericanEngine.new(process,timeSteps,gridPoints)<br />
report(&#8217;finite differences&#8217;,option.NPV)<br />
<br />
# method: binomial<br />
timeSteps = 801<br />
option.pricingEngine = BinomialVanillaEngine.new(process,&#8217;jr&#8217;,timeSteps)<br />
report(&#8217;binomial (JR)&#8217;,option.NPV)<br />
option.pricingEngine = BinomialVanillaEngine.new(process,&#8217;crr&#8217;,timeSteps)<br />
report(&#8217;binomial (CRR)&#8217;,option.NPV)
</div>
<p>The output code above makes use of the following helper function in the Controller:<br />
&nbsp;&nbsp;<strong>RayQuantLib/app/controllers/american_option_controller.rb</strong></p>
<div class="code">
def report(method, npv)<br />
&nbsp;&nbsp;  npv = sprintf(&#8217;%.5f&#8217;, npv)<br />
&nbsp;&nbsp;  @output = @output + &#8216;&lt;div&gt;&#8217;<br />
&nbsp;&nbsp;  @output = @output + &#8216;&lt;span class=&#8221;output_method&#8221;&gt;&#8217; + method + &#8216;&lt;/span&gt;&#8217;<br />
&nbsp;&nbsp;  @output = @output + &#8216;&lt;span class=&#8221;output_npv&#8221;&gt;&#8217; + npv + &#8216;&lt;/span&gt;&#8217;<br />
&nbsp;&nbsp;  @output = @output + &#8216;&lt;/div&gt;&#8217;<br />
end
</div>
<p>Finally, the following code displays the output in our View:</p>
<p>&nbsp;&nbsp;<strong>RayQuantLib/app/views/american_option/index.html.erb</strong></p>
<div class="code">
&lt;%= @output %&gt;
</div>
<p></br><br /></br></p>
<h2 style="color:darkblue">IV. Future Enhancements</h2>
<p><strong>1. QuantLib Functionality</strong></p>
<p>Additional QuantLib features can be developed in the future, including dynamic hedging, swap valuation, bond pricing, and Monte Carlo simulation.</p>
<p><strong>2. QuantLib Documentation</strong></p>
<p>A more detailed explanation of the QuantLib functions and design patterns used in this project can be added in the future.  In the meantime, the official QuantLib documentation can be found in the references below.<br />
<br /></br></p>
<h2 style="color:darkblue">V. References</h2>
<p><strong>1. QuantLib Reference Manual</strong><br />
<a href="http://quantlib.org/reference/modules.html">http://quantlib.org/reference/modules.html</a></p>
<p><strong>2. Rails Framework Documentation</strong><br />
<a href="http://api.rubyonrails.org/">http://api.rubyonrails.org/</a></p>
<p></br><br /></br></p>
]]></content:encoded>
			<wfw:commentRss>http://www.RayAcayan.com/projects/the-quantlib-ruby-project-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The QuantLib Ruby Project, Part 1</title>
		<link>http://www.RayAcayan.com/projects/the-quantlib-ruby-project-part-1/</link>
		<comments>http://www.RayAcayan.com/projects/the-quantlib-ruby-project-part-1/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 06:25:13 +0000</pubDate>
		<dc:creator>Ray Acayan</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Boost]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[Consulting]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[QuantLib]]></category>
		<category><![CDATA[QuantLib-SWIG]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[SWIG]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.RayAcayan.com/?p=253</guid>
		<description><![CDATA[
I. Overview
Part 1 of this project describes my procedure for installing a dedicated QuantLib web application server based on Linux and Ruby on Rails.

QuantLib is a free open-source software library for quantitative finance, financial modeling, trading, and risk management.  Written in C++, this library is typically used in standalone applications at financial institutions.  [...]]]></description>
			<content:encoded><![CDATA[<p></br></p>
<h2 style="color:darkblue">I. Overview</h2>
<p><a href="the-quantlib-ruby-project-part-1">Part 1</a> of this project describes my procedure for installing a dedicated QuantLib web application server based on Linux and Ruby on Rails.</p>
<p><img src="/blog/img/QuantLib.png"></img></p>
<p>QuantLib is a free open-source software library for quantitative finance, financial modeling, trading, and risk management.  Written in C++, this library is typically used in standalone applications at financial institutions.  This project shows how the powerful features of QuantLib can be implemented in web applications.  This capability allows firms to outsource their internal financial software development in favor of modern QuantLib web applications hosted by external application service providers (ASPs).</p>
<p>Ruby on Rails is a popular open source framework for developing web applications, and Linux is a robust and secure platform for hosting them.<br />
<br /></br></p>
<h2 style="color:darkblue">II. Consulting</h2>
<p>I do my best to explain the concepts and techniques behind my projects.  If you like my work and can use my expertise in your projects, I am available for <span id="consulting_page" onmouseover="consulting_mouseOver()" onmousemove="consulting_mouseMove()" onmouseout="consulting_mouseOut()"><a href="http://www.RayAcayan.com/consulting/"><strong>consulting</strong></a></span> at a competitive rate.<br />
<br /></br></p>
<h2 style="color:darkblue">III. Procedure</h2>
<p><strong>1. Install LAMP Server</strong></p>
<p>A basic LAMP (Linux, Apache, MySQL, PHP) server can be installed as follows:<br />
a.) Download the latest version of Ubuntu Server (currently 9.10 Karmic as of Oct 29, 2009) from <a href="http://www.ubuntu.com">ubuntu.com</a>.<br />
b.) Burn the iso image onto a CD and boot the server with that CD.  Install with default options.<br />
c.) Install packages with the following commands:</p>
<div class="code">
$ sudo apt-get update<br />
$ sudo apt-get install apache2 mysql-server libapache2-mod-auth-mysql<br />
$ sudo apt-get install php5-mysql phpmyadmin<br />
$ sudo apt-get install build-essential libssl-dev libreadline5-dev zlib1g-dev<br />
$ sudo apt-get install libmysqlclient15-dev<br />
$ sudo /etc/init.d/apache2 restart</p>
<p>// install ssh, sftp, and Firestarter firewall<br />
$ sudo apt-get install vsftpd ssh sysv-rc-conf firestarter
</p></div>
<p><strong>2. Install Ruby on Rails</strong></p>
<div class="code">
$ sudo apt-get install ruby-full rubygems1.9.1 rails libmysql-ruby
</div>
<p><strong>3. Install QuantLib</strong></p>
<p>a.) The Boost C++ libraries must be downloaded and installed first:</p>
<div class="code">
$ sudo apt-get install libboost-dev libboost-doc
</div>
<p>b.) Download and install the latest version of QuantLib:</p>
<div class="code">
$ sudo apt-get install libquantlib-0.9.7 libquantlib0-dev<br />
$ sudo apt-get install quantlib-ruby quantlib-python quantlib-examples
</div>
<p></br></p>
<h2 style="color:darkblue">IV. Future Enhancements</h2>
<p>In <a href="/blog/projects/the-quantlib-ruby-project-part-2/"><b>Part 2</b></a> of this project, I will use this QuantLib Ruby platform to explore some simple design patterns used in developing QuantLib web applications for quantitative finance.<br />
<br /></br></p>
<h2 style="color:darkblue">V. References</h2>
<p><strong>1. Ubuntu.com</strong><br />
<a href="http://www.ubuntu.com/">http://www.ubuntu.com/</a></p>
<p><strong>2. RubyOnRails.org</strong><br />
<a href="http://rubyonrails.org/download/">http://rubyonrails.org/download/</a></p>
<p><strong>3. QuantLib.org</strong><br />
<a href="http://quantlib.org/extensions.shtml">http://quantlib.org/extensions.shtml</a></p>
<p><strong>4. SWIG</strong><br />
<a href="http://swig.sourceforge.net/">http://swig.sourceforge.net/</a></p>
<p></br><br /></br></p>
]]></content:encoded>
			<wfw:commentRss>http://www.RayAcayan.com/projects/the-quantlib-ruby-project-part-1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The Streetcar GPS Simulation Project</title>
		<link>http://www.RayAcayan.com/projects/the-streetcar-gps-simulation-project/</link>
		<comments>http://www.RayAcayan.com/projects/the-streetcar-gps-simulation-project/#comments</comments>
		<pubDate>Tue, 24 Feb 2009 17:37:56 +0000</pubDate>
		<dc:creator>Ray Acayan</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Consulting]]></category>
		<category><![CDATA[Google Maps]]></category>
		<category><![CDATA[GPS]]></category>
		<category><![CDATA[Ian Stevens]]></category>
		<category><![CDATA[Mike Williams]]></category>
		<category><![CDATA[Streetcar]]></category>
		<category><![CDATA[Transit Map]]></category>
		<category><![CDATA[TTC]]></category>

		<guid isPermaLink="false">http://www.RayAcayan.com/?p=265</guid>
		<description><![CDATA[
I. Overview
This project simulates a real-time GPS map of several TTC streetcars in downtown Toronto.  I created this simulation to explore the Google Maps API, animation techniques, geocoding, and external custom maps.  It can be extended to other applications such as real-time mapping of certain GPS-enabled mobile devices.  Click anywhere on the [...]]]></description>
			<content:encoded><![CDATA[<p></br></p>
<h2 style="color:darkblue">I. Overview</h2>
<p>This project simulates a real-time GPS map of several TTC streetcars in downtown Toronto.  I created this simulation to explore the Google Maps API, animation techniques, geocoding, and external custom maps.  It can be extended to other applications such as real-time mapping of certain GPS-enabled mobile devices.  Click anywhere on the <a href="http://www.RayAcayan.com/RayMapTTC/"><b>map</b></a> to view the simulation.  Feel free to zoom in/out, drag the map, and select Hybrid mode.</p>
<style type="text/css">
img.ttcgps {
display: block;
    margin-left: auto;
    margin-right: auto }
</style>
<p><a href="http://www.RayAcayan.com/RayMapTTC/"><img class="ttcgps" src="/blog/img/Ray_TTC_GPS.jpg" alt="Ray's TTC Streetcar GPS Simulation" align="center"  /></a></p>
<h2 style="color:darkblue">II. Consulting</h2>
<p>I do my best to explain the concepts and techniques behind my projects.  If you like my work and can use my expertise in your projects, I am available for <span id="consulting_page" onmouseover="consulting_mouseOver()" onmousemove="consulting_mouseMove()" onmouseout="consulting_mouseOut()"><a href="http://www.RayAcayan.com/consulting/"><strong>consulting</strong></a></span> at a competitive rate.<br />
<br /></br></p>
<h2 style="color:darkblue">III. Components</h2>
<p><strong>1. The TTC Transit Map Component</strong></p>
<p>This external component is a cool custom map created by Ian Stevens which shows the entire TTC transit routes overlayed onto Google Maps.  The original version can be found <a href="http://crazedmonkey.com/toronto-transit-map/"><b>here</b></a>.  I use this map to display the routes taken by the animated TTC streetcars.</p>
<p><strong>2. Streetcar Initialization Component</strong></p>
<p>This component creates an array of streetcar objects for each streetcar route.  The number of streetcars currently in the route is a function of the frequency of arrival at each station.</p>
<div class="code">
// Queen St. W. Streetcar<br />
var start501w = &#8220;Queen St E and Broadview Ave, Toronto, ON&#8221;;<br />
var end501w = &#8220;Queen St W and Ossington Ave, Toronto, ON&#8221;;<br />
var total_bus501 = 6;  // assumption<br />
var bus501w_marker = new Array(total_bus501);
</div>
<p><strong>2. Route Initialization Component</strong></p>
<p>This component creates a route for each streetcar line.  The GDirections() function is used to calculate the route between the start and end points, and the resulting line is retrieved using the getPolyline() function.</p>
<div class="code">
var bus501w = new GDirections();<br />
bus501w.loadFromWaypoints([start501w,end501w],{getPolyline:true,getSteps:true});
</div>
<p>The loadFromWaypoints() function calls the &#8220;load&#8221; event which is handled by the following listener:</p>
<div class="code">
GEvent.addListener(bus501w, &#8220;load&#8221;, function()<br />
{<br />
&nbsp;&nbsp;  bus501w_poly = bus501w.getPolyline();<br />
&nbsp;&nbsp;  bus501w_eol = bus501w_poly.Distance();<br />
&nbsp;&nbsp;  for( var i = 0; i &lt; total_bus501; i++ )<br />
&nbsp;&nbsp;  {<br />
&nbsp;&nbsp;&nbsp;&nbsp;  	bus501w_marker[i] = new GMarker(bus501w_poly.getVertex(0),{icon:sc_west});<br />
&nbsp;&nbsp;&nbsp;&nbsp;        map.addOverlay(bus501w_marker[i]);<br />
&nbsp;&nbsp;&nbsp;&nbsp;        setTimeout(&#8221;bus501w_animate(&#8221; + i + &#8220;, &#8221; + i*(bus501w_eol/total_bus501) + &#8220;)&#8221;,2000);<br />
&nbsp;&nbsp;  }<br />
});
</div>
<p><strong>3. Position Update Component</strong></p>
<p>This component updates the current position of each streetcar and displays it on the map.  The animate() function is initially called from the &#8220;load&#8221; listener, then calls itself recursively using setTimeout() after each polling interval (tick).</p>
<div class="code">
function bus501w_animate(i, d)<br />
{<br />
&nbsp;&nbsp;    if (d &gt; bus501w_eol) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;     	d = 0;	// reset at starting point<br />
&nbsp;&nbsp;    }<br />
&nbsp;&nbsp;    var p = bus501w_poly.GetPointAtDistance(d);<br />
&nbsp;&nbsp;    bus501w_marker[i].setPoint(p);<br />
&nbsp;&nbsp;    setTimeout(&#8221;bus501w_animate(&#8221;+ i + &#8220;, &#8221; +(d+step501) +&#8221;)&#8221;, tick);<br />
}
</div>
<p>The GetPointAtDistance() function is provided by a Google Maps extension called &#8220;epoly.js&#8221; which was developed by Mike Williams.  More info can be found <a href="http://econym.googlepages.com/epoly.htm"><b>here</b></a>.  This function returns point &#8220;p&#8221; on the route which is a distance &#8220;d&#8221; meters away from the starting point.  This point is then used to update the streetcar&#8217;s current position (marker) using the setPoint() function.<br />
<br /></br></p>
<h2 style="color:darkblue">III. Future Enhancements</h2>
<p><strong>1. Real-time GPS Coordinates</strong></p>
<p>In this simulation, the streetcar&#8217;s position is updated by 2 meters every 500 milliseconds.  A real application would update the current position by retrieving real-time GPS coordinates and use a more infrequent polling interval such as 60 seconds.  At this time, it is unknown if the TTC will provide real-time GPS coordinates to the public.</p>
<p><strong>2. Mobile Devices</strong></p>
<p>It would be cool if someone could develop a real-time TTC streetcar map for the iPhone and other mobile devices.  Route schedules like <a href="http://torontoist.com/2008/10/red_rocket_ttc_iphone_application.php">Red Rocket</a> are nice, but a real-time map can reveal better routes based on current streetcar positions and can significantly reduce waiting times at the streetcar stop.</p>
<p><strong>3. Other Route Algorithms</strong></p>
<p>The GDirections route calculator provided by the Google Maps API is based on least-cost-routing using street maps.  A different algorithm could provide a complete polyLine specifying all the waypoints in the route.  For example, we could display a plane&#8217;s flight path, which does not follow the directions on a road map.  This enables new applications such as creating a real-time air traffic control map showing the GPS positions and routes of all planes in the sky.  The possibilities are endless.<br />
<br /></br></p>
<h2 style="color:darkblue">IV. References</h2>
<p><strong>1. Google Maps API Developer&#8217;s Guide</strong><br />
<a href="http://code.google.com/apis/maps/documentation/index.html">http://code.google.com/apis/maps/documentation/index.html</a></p>
<p><strong>2. Google Mapis API Reference</strong><br />
<a href="http://code.google.com/apis/maps/documentation/reference.html">http://code.google.com/apis/maps/documentation/reference.html</a></p>
<p></br><br /></br></p>
]]></content:encoded>
			<wfw:commentRss>http://www.RayAcayan.com/projects/the-streetcar-gps-simulation-project/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The Image Overlay Project</title>
		<link>http://www.RayAcayan.com/projects/the-image-overlay-project/</link>
		<comments>http://www.RayAcayan.com/projects/the-image-overlay-project/#comments</comments>
		<pubDate>Sun, 22 Feb 2009 18:15:51 +0000</pubDate>
		<dc:creator>Ray Acayan</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Consulting]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.RayAcayan.com/?p=212</guid>
		<description><![CDATA[
I. Overview
This is a simple project for displaying an image overlay whenever the user moves the mouse over an element on the web page.  This effect is demonstrated on my website in the menu items above, the scrolling stock ticker, and the icons to the right of my photo.
This feature is useful for displaying [...]]]></description>
			<content:encoded><![CDATA[<p></br></p>
<h2 style="color:darkblue">I. Overview</h2>
<p>This is a simple project for displaying an image overlay whenever the user moves the mouse over an element on the web page.  This effect is demonstrated on my website in the menu items above, the scrolling stock ticker, and the icons to the right of my photo.</p>
<p>This feature is useful for displaying value-added information quickly on the same web page without requiring the user to click the mouse, find the information on a different page, then click back to the original page.  It is also helpful for mobile devices with limited screen space, where small icons representing web sites can be enlarged as the user moves the mouse over them.<br />
<br /></br></p>
<h2 style="color:darkblue">II. Source Code</h2>
<p>I do my best to explain the concepts and techniques behind my projects, but I cannot provide the complete source code.  If you like my work and can use my expertise in your projects, I am available for <span id="consulting_page" onmouseover="consulting_mouseOver()" onmousemove="consulting_mouseMove()" onmouseout="consulting_mouseOut()"><a href="http://www.RayAcayan.com/consulting/"><strong>consulting</strong></a></span> at a very competitive rate.<br />
<br /></br></p>
<h2 style="color:darkblue">III. Components</h2>
<p><strong>1.  Mouse Position Component</strong></p>
<p>This component captures the mouse cursor&#8217;s current position, which is later used to determine the screen position for displaying the image overlay.  It uses &lt;div&lt; elements for the X and Y position of the mouse, then updates those variables as follows:</p>
<div class="code">
  if (window.Event) { document.captureEvents(Event.MOUSEMOVE); }<br />
  document.onmousemove = getCursorXY;
</div>
<p>The getCursorXY() function uses the value of document.body.scrollLeft and document.bodyscrollTop to determine the mouse cursor&#8217;s X and Y position on the web page.</p>
<p><strong>2. Event Assignment Component</strong></p>
<p>This component is a set of JavaScript functions for assigning events to trigger elements such as icons or text, which are assumed to be in basic form, such as an &lt;img&gt; or &lt;a&gt;.  It finds a trigger element and encapsulates it in a &lt;div&gt; or &lt;span&gt; tag containing mouseover, mousemove, and mouseout events pointing to the corresponding JavaScript functions.  For example:</p>
<div class="code">
var node = document.getElementById(&#8221;navigation&#8221;).getElementsByTagName(&#8221;a&#8221;)[i];<br />
if( node.innerHTML == &#8220;Resume&#8221; )<br />
&nbsp;&nbsp;  node.innerHTML = &#8216;&lt;span id=&#8221;resume_page&#8221; &#8216; + &#8230;<br />
&nbsp;&nbsp;  + onmouseover=&#8221;resume_mouseOver()&#8221;>&#8217;<br />
&nbsp;&nbsp;  + node.innerHTML + &#8216;&lt;/span&gt;&#8217;;
</div>
<p><strong>3. Image Display Component</strong></p>
<p>This component is a set of JavaScript functions which respond to the mouse events and display the image overlay.  The onmouseover() event calls a function which dynamically creates an &lt;img&gt; element from a file as follows:</p>
<div class="code">
var imgbox=document.getElementById(&#8221;resume_page&#8221;);<br />
imgbox.style.visibility=&#8221;visible&#8221;;<br />
var img = document.createElement(&#8221;img&#8221;);<br />
img.src=&#8221;RayResume.png&#8221;;<br />
imgbox.appendChild(img);
</div>
<p>The mousemove() function moves the chart based on the mouse cursor&#8217;s current position. The onmouseout() function hides the chart by setting the imgbox visibility to &#8220;hidden&#8221;<br />
<br /></br></p>
<h2 style="color:darkblue">IV. Future Enhancements</h2>
<p><strong>1. Dynamic Image Caching</strong></p>
<p>I do not currently implement caching on this website.  Consequently, there is an intermittent delay when retrieving images as you move the mouse over certain items such as the scrolling stock ticker.  A cache can be developed to automatically create image snapshots of this information and display the cached image instead.</p>
<p><strong>2.  Other Types of Overlay</strong></p>
<p>The overlay effect can enhanced to display dynamic content types such as dynamic stock charts, video surveillance cameras, and real-time GPS maps, rather than just static images.  The possibilities are endless.</p>
<p></br><br /></br></p>
]]></content:encoded>
			<wfw:commentRss>http://www.RayAcayan.com/projects/the-image-overlay-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Scrolling Stock Ticker Project</title>
		<link>http://www.RayAcayan.com/projects/the-scrolling-stock-ticker-project/</link>
		<comments>http://www.RayAcayan.com/projects/the-scrolling-stock-ticker-project/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 21:00:17 +0000</pubDate>
		<dc:creator>Ray Acayan</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Consulting]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Stocks]]></category>

		<guid isPermaLink="false">http://www.RayAcayan.com/?p=58</guid>
		<description><![CDATA[
I. Overview
The scrolling stock ticker above is a simple example of a lightweight component for retrieving real-time data and displaying it dynamically in a web browser. Many stock tickers today are based on heavy Java applets, which tend to slow down my computer considerably. Other tickers based on JavaScript and Ajax do not have a [...]]]></description>
			<content:encoded><![CDATA[<p></br></p>
<h2 style="color:darkblue">I. Overview</h2>
<p>The scrolling stock ticker above is a simple example of a lightweight component for retrieving real-time data and displaying it dynamically in a web browser. Many stock tickers today are based on heavy Java applets, which tend to slow down my computer considerably. Other tickers based on JavaScript and Ajax do not have a scrolling feature. The basic marquee scrollers do not retrieve real-time data. So, I decided to develop my own simple scrolling stock ticker which combines all of these functions.<br />
<br /></br></p>
<h2 style="color:darkblue">II. Consulting</h2>
<p>I do my best to explain the concepts and techniques behind my projects.  If you like my work and can use my expertise in your projects, I am available for <span id="consulting_page" onmouseover="consulting_mouseOver()" onmousemove="consulting_mouseMove()" onmouseout="consulting_mouseOut()"><a href="http://www.RayAcayan.com/consulting/"><strong>consulting</strong></a></span> at a competitive rate.<br />
<br /></br></p>
<h2 style="color:darkblue">III. Components</h2>
<p><strong>1. Stock Data Retrieval Component</strong></p>
<p>This component is a group of PHP functions for querying a web data source, retrieving the resulting data, and storing the result in a DOM document object. These functions are located in a standalone PHP file.</p>
<p>First, the stock quotes are retrieved using the @fopen() file pointer to the following url:</p>
<div class="code">&#8220;http://finance.yahoo.com/d/quotes.csv?s=$stock&amp;f=sn1l1c1p2&amp;e=.csv&#8221;
</div>
<p>The Yahoo Finance site will return a comma-delimited CSV file based on the query parameters. More info on Yahoo&#8217;s data protocol can be found <a href="http://www.gummy-stuff.org/Yahoo-data.htm">here</a>. Other web services return data in RSS, JSON, or XML formats, which will require different query and parsing methods.</p>
<p>Next, the CSV-formatted results are parsed by the @fgetcsv() function, which stores the comma-delimited values into an array.  The array values are then placed into &lt;span&gt; elements and returned in the following format:</p>
<div class="code">&lt;span class=&#8221;stock_up&#8221;&gt;GOLD 5,000.00 +4,000.00, +400.0%&lt;/span&gt;</div>
<p><strong>2. CSS Display Component</strong></p>
<p>Not exactly a &#8220;component&#8221;, this is simply a CSS file which contains formatting for the &lt;span&gt; data above. For example:</p>
<div class="code">
.stock_up<br />
{<br />
&nbsp;&nbsp;  color: green;<br />
&nbsp;&nbsp;  cursor: hand;<br />
&nbsp;&nbsp;  cursor: pointer;<br />
&nbsp;&nbsp;  padding-bottom: 2px;<br />
&nbsp;&nbsp;  padding-left: 1em;<br />
&nbsp;&nbsp;  padding-right: 1em;<br />
&nbsp;&nbsp;  margin: 0px;<br />
}
</div>
<p><strong>3. Ajax Stock Update Component</strong></p>
<p>This component is a group of JavaScript functions for dynamically updating the stock quotes using Ajax.  Ajax is a group of web techniques for updating a web page without the user having to press the Refresh button.</p>
<p>The function uses the http_request.onreadystatechange property to call the Stock Data Retrieval Component (i.e. the standalone PHP file) to retrieve a new set of &lt;span&gt; elements containing the newly-updated stock quotes.  The document object is then updated dynamically by replacing the &lt;span&gt; contents of the &lt;div id=&#8221;RayStockTickerID&#8221;&gt; node as follows:</p>
<div class="code">document.getElementById(&#8217;RayStockTickerID&#8217;).innerHTML = http_request.responseText;</div>
<p><strong>4. Scrolling Marquee Component</strong></p>
<p>This component is a group of JavaScript functions which retrieve the stock quotes from the DOM document object, display the css-formatted stock quotes in a line of text, then scroll the text from right to left one pixel at a time with the setTimeout() function.</p>
<p>As each stock quote falls off the left of the screen, its &lt;span&gt; node is removed and appended to the end of the chain to create a continuous loop.  At the end of each loop, the stock quotes are updated dynamically by the Ajax Stock Update Component.</p>
<p><strong>5. Chart Display Component</strong></p>
<p>When you move the mouse to a particular stock in the ticker, this component will display an overlay of the corresponding daily stock chart.  This is accomplished using onmouseover() event handlers within each stock&#8217;s &lt;span&gt; tag.  The onmouseover() event calls a function which dynamically creates an &lt;img&gt; element and retrieves the chart from Yahoo Finance as follows:</p>
<div class="code">
  var imgbox=document.getElementById(&#8221;stockchart&#8221;);<br />
  imgbox.style.visibility=&#8217;visible&#8217;;<br />
  var img = document.createElement(&#8221;img&#8221;);<br />
  img.src=&#8217;http://ichart.finance.yahoo.com/t?s=&#8217; + stock;<br />
  imgbox.appendChild(img);
</div>
<p>The mousemove() function moves the chart based on the mouse cursor&#8217;s current position.  The onmouseout() function hides the chart by setting the imgbox visibility to &#8216;hidden&#8217;.</p>
<p><strong>6. Main Component</strong></p>
<p>The main component is a a section of PHP code in the main website which creates all the components above and initiates the program.<br />
<br /></br></p>
<h2 style="color:darkblue">IV. Future Enhancements</h2>
<p><strong>A. Different Input Formats</strong></p>
<p>As mentioned above, the input data streams may be formatted in RSS, JSON, XML, etc.  Functions can be developed for parsing and querying these other data protocols.</p>
<p><strong>B. Caching</strong></p>
<p>This simple project does not implement caching since it does not use previous stock data.  A cache can be developed to store data into an external database or text file before displaying it on the screen.</p>
<p><strong>C. Data Processing</strong></p>
<p>The incoming data can be processed and enriched before displaying to the web page.  For example, the stock ticker could display only those stocks which have crossed their 50-day moving average, or those that have exceeded their daily VaR limits within a portfolio.</p>
<p><strong>D. Different Output Formats</strong></p>
<p>Instead of a simple scrolling ticker display, this app can be modified to create an output data stream in other formats like RSS, JSON, XML, database, e-mail, etc, or other platforms such as Facebook, Twitter, and mobile devices.</p>
<p></br><br /></br></p>
]]></content:encoded>
			<wfw:commentRss>http://www.RayAcayan.com/projects/the-scrolling-stock-ticker-project/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Networking in Toronto</title>
		<link>http://www.RayAcayan.com/events/networking-in-toronto/</link>
		<comments>http://www.RayAcayan.com/events/networking-in-toronto/#comments</comments>
		<pubDate>Mon, 16 Feb 2009 19:14:58 +0000</pubDate>
		<dc:creator>Ray Acayan</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[CAIA]]></category>
		<category><![CDATA[CFA]]></category>
		<category><![CDATA[ChangeCamp]]></category>
		<category><![CDATA[CloudCamp]]></category>
		<category><![CDATA[DemoCamp]]></category>
		<category><![CDATA[ECOT]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[FlexCamp]]></category>
		<category><![CDATA[FutureRuby]]></category>
		<category><![CDATA[GARP]]></category>
		<category><![CDATA[geeklunch]]></category>
		<category><![CDATA[hacklab.to]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JCI]]></category>
		<category><![CDATA[LifeCamp]]></category>
		<category><![CDATA[mesh]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[PMI]]></category>
		<category><![CDATA[PMI-SOC]]></category>
		<category><![CDATA[PodCamp]]></category>
		<category><![CDATA[PRMIA]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Rotman]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[RubyFringe]]></category>
		<category><![CDATA[StartupCamp]]></category>
		<category><![CDATA[TASK]]></category>
		<category><![CDATA[TOGeekEvents]]></category>
		<category><![CDATA[TorCamp]]></category>
		<category><![CDATA[Toronto]]></category>

		<guid isPermaLink="false">http://www.RayAcayan.com/?p=56</guid>
		<description><![CDATA[
Our network is our most valuable asset.  Unlike other assets such as stocks and real estate, which tend to grow at a constant rate over a very long period of time, the value of our network grows exponentially as its size increases.  Not only does it provide value to ourselves, but we in [...]]]></description>
			<content:encoded><![CDATA[<p></br></p>
<p>Our network is our most valuable asset.  Unlike other assets such as stocks and real estate, which tend to grow at a constant rate over a very long period of time, the value of our network grows exponentially as its size increases.  Not only does it provide value to ourselves, but we in turn create value for each individual in our network.  This value can be unlocked in monetary terms through business development, customer acquisition, or career development, as well as non-monetary terms through friendships, referrals, mentoring, and free advice.</p>
<p>To encourage myself and fellow Torontonians to participate in increasing the value of our networks, I have compiled the following list of technology and business networking events in Toronto.  It is by no means comprehensive, but let me know if you find other interesting events and I will add them to this list.</p>
<h2>Technology Networking Events</h2>
<p><b>Weekly/Monthly Events:</b></p>
<li><a href="http://hacklab.to/upcoming-events/">hacklab.to</a> &#8211; lots of events in Toronto&#8217;s first hackerspace</li>
<li><a href="http://www.facebook.com/group.php?gid=12861906603">Toronto Geek Lunch</a> &#8211; every Monday in downtown Toronto</li>
<li><a href="http://www.coffeeandcode.org">Toronto Coffee &#038; Code</a> &#8211; coffee shop get-togethers organized by Joey DeVilla
<li><a href="http://blogs.msdn.com/cdndevs/archive/2009/01/27/developer-lunch-at-sky-dragon-in-toronto-today.aspx">Toronto Software Developers Lunch</a> &#8211; monthly lunch organized by Kristan Uccello</li>
<li><a href="http://www.mobilemondaytoronto.com/">Mobile Monday Toronto</a> &#8211; first Monday of every month</li>
<li><a href="http://ajaxcamp.org/">Ajax Pub Nite</a> &#8211; 2nd Monday of every  month</li>
<li><a href="http://www.meetup.com/WiredWednesday/">Wired Wednesdays</a> &#8211; 2nd Wednesday of every month</li>
<li><a href="http://www.unspace.ca/innovation/pubnite/">Rails Pub Nite</a> &#8211; organized by Unspace, 3rd Monday of every month</li>
<li><a href="http://correlations.wordpress.com/">Rails Project Night</a> &#8211; monthly event hosted by Corina Newby</li>
<li><a href="http://www.refresh-events.ca/">Refresh Events</a> &#8211; Toronto Interactive Media Usergroup, 3rd Monday of every month</li>
<li><a href="http://www.torontoflex.org">Toronto Flex User Group</a> &#8211; monthly event organized by New Toronto Group</li>
<li><a href="http://www.torontojug.org">Toronto Java Users Group</a> &#8211; monthly event</li>
<li><a href="http://www.task.to/">TASK &#8211; Toronto Area Security Klatch</a> &#8211; last Wednesday of every month</li>
<li><a href="http://to.pm.org/">Toronto Perl Mongers</a> &#8211; last Thursday of every month</li>
<li><a href="http://www.facebook.com/group.php?gid=3585465493/">Third Tuesday</a> &#8211; Canada&#8217;s Social Media Meetup</li>
<li><a href="http://wiki.vizthink.com/toronto">VizThink</a> &#8211; visual thinking meetups organized by Ryan Coleman</li>
<li><a href="http://www.soc.pmi.on.ca/">PMI-SOC</a> &#8211; Project Management Institute &#8211; Southern Ontario Chapter</li>
<p><strong></strong><br />
<b>Ad-hoc Events:</b></p>
<li><a href="http://democamp.info/">DemoCamp</a> &#8211; un-conference meetings to demo tech projects</li>
<li><a href="http://www.torontocodecamp.net/">CodeCamp</a> &#8211; a .NET community sponsored event</li>
<li><a href="http://www.torontoflex.org">FlexCamp</a> &#8211; Adobe Flex event organized by New Toronto Group</li>
<li><a href="http://refreshpartners.com/facebookcamptoronto5">FacebookCamp</a> &#8211; Facebook platform development</li>
<li><a href="http://www.cloudcamp.com/">CloudCamp</a> &#8211; Cloud Computing technologies</li>
<li><a href="http://podcamptoronto.pbwiki.com/">PodCamp</a> &#8211; podcasting, blogging, and new media</li>
<li><a href="http://changecamp.ca/">ChangeCamp</a> &#8211; open government</li>
<li><a href="http://lifecampto.eventbrite.com/">LifeCamp</a> &#8211; a lifehacking event organized by Sacha Chua</li>
<li><a href="http://barcamp.org/StartupCampToronto2">StartupCamp</a> &#8211; present your startup to other entrepreneurs</li>
<li><a href="http://foundersandfunders.org/">Founders &#038; Funders</a> &#8211; invite-only event for tech entrepreneurs and funders</li>
<p><strong></strong><br />
<b>Annual Events:</b></p>
<li><a href="http://www.meshconference.com/">mesh</a> &#8211; Canada&#8217;s Web Conference</li>
<li><a href="http://www.futureruby.com/">FutureRuby / RubyFringe</a> &#8211; awesome Ruby conference organized by Unspace</li>
<li><a href="http://www.energizeit.com/">EnergizeIT</a> &#8211; Microsoft&#8217;s annual event for Toronto&#8217;s IT community</li>
<p><strong></strong><br />
<b>Other Event Calendars:</b></p>
<li><a href="http://www.google.com/calendar/embed?src=4qoq68mi70rfsgfi0c8h0k8gv4%40group.calendar.google.com&#038;ctz=America/Toronto">TorCamp Google Calendar</a></li>
<li><a href="http://www.google.com/calendar/embed?src=togeekevents%40gmail.com&#038;ctz=America/New_York">TOGeekEvents Calendar</a></li>
<li><a href="http://msdn.microsoft.com/en-ca/events/default.aspx">MSDN Canada</a></li>
<li><a href="http://www.marsdd.com/Events.html">MaRS</a></li>
<li><a href="http://www.startupnorth.ca/calendar/">StartupNorth</a></li>
<li><a href="http://upcoming.yahoo.com/">Upcoming</a></li>
<li><a href="http://linuxcaffe.ca/">Linux Caffe</a></li>
<p><strong></strong></p>
<h2>Business Networking Events</h2>
<li><a href="http://www.rotman.utoronto.ca/events/">Rotman School of Management</a> &#8211; a fusion of academic and business speakers</li>
<li><a href="http://www.ecot.ca">Economic Club of Toronto</a> &#8211; Canada&#8217;s platform for policy makers and business leaders</li>
<li><a href="http://www.empireclub.org">Empire Club of Canada</a> &#8211; one of Canada&#8217;s oldest and largest speakers&#8217; forums</li>
<li><a href="http://www.torontocfa.ca/source/Meetings/cMeetingProcessSearch2.cfm?section=Upcoming_Events&#038;task=1&#038;StartRow=1&#038;PageNum=1&#038;crit=fut">Toronto CFA Society</a> &#8211; lots of speaker events for members and non-members</li>
<li><a href="http://prmia.org/Chapter_Pages/Common_Files/events_3.php">PRMIA</a> &#8211; Professional Risk Managers International Association</li>
<li><a href="http://www.caia.org/events/caiaevents/">CAIA Association</a> &#8211; ad-hoc members-only events</li>
<li><a href="http://www.garp.com/events/chapters/meetings.aspx">GARP</a> &#8211; Global Association of Risk Professionals</li>
<li><a href="http://www.bot.com/Source/Meetings/cMeetingProcessSearch.cfm?Section=Upcoming_Events">Toronto Board of Trade</a> &#8211; engage with your peers and thought leaders</li>
<li><a href="http://www.torontotalks.org/">Toronto Talks</a> &#8211; speaker events organized by John Klotz</li>
<li><a href="http://www.jcitoronto.ca/">Junior Chamber International</a> &#8211; federation of young leaders and entrepreneurs</li>
<p><strong></strong></p>
<h2>Other Groups:</h2>
<li><a href="http://www.meetup.com/">Meetup.com</a></li>
<li><a href="http://www.facebook.com/">Facebook Groups</a></li>
<p><strong></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.RayAcayan.com/events/networking-in-toronto/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Social Networks and Employment</title>
		<link>http://www.RayAcayan.com/social-networks/social-networks-and-employment/</link>
		<comments>http://www.RayAcayan.com/social-networks/social-networks-and-employment/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 20:14:49 +0000</pubDate>
		<dc:creator>Ray Acayan</dc:creator>
				<category><![CDATA[Social Networks]]></category>
		<category><![CDATA[Employment]]></category>

		<guid isPermaLink="false">http://www.RayAcayan.com/?p=35</guid>
		<description><![CDATA[
Fixing the Resume
Setting aside my valid concerns about privacy, spam, and identity theft, I am posting my resume online for the whole world to see. It&#8217;s a social experiment to determine the value of social networks in improving the lives of its individual members.
Is it possible to create the perfect resume using the collective wisdom [...]]]></description>
			<content:encoded><![CDATA[<p></br></p>
<p><strong>Fixing the Resume</strong></p>
<p>Setting aside my valid concerns about privacy, spam, and identity theft, I am posting my resume online for the whole world to see. It&#8217;s a social experiment to determine the value of social networks in improving the lives of its individual members.</p>
<p>Is it possible to create the perfect resume using the collective wisdom of social networks? Can Twitterers (Tweeps) produce a more concise but slightly unreadable resume, FTW?<br />
Do Facebook friendships provide more networking potential than professional networks like LinkedIn? Is it really all about who you know, rather than what you know?</p>
<p>Feel free to post a (moderated) comment about my resume, and I&#8217;ll modify it according to your suggestions. You can find it here: <a href="http://www.RayAcayan.com/Resume">www.RayAcayan.com/blog/Resume</a></p>
<p><strong>Landing the Job</strong></p>
<p>Are social networks more effective at connecting employers and job-seekers through the hidden job market, than traditional sites like Monster and Workopolis? (More about my latest venture, Social Job Market Inc., in a future blog.) If you like my resume and know someone who needs a senior professional in technology management or quantitative finance in Toronto, please contact me at <a href="mailto://RayAcayan@gmail.com">RayAcayan@gmail.com</a>.</p>
<p></br><br /></br></p>
]]></content:encoded>
			<wfw:commentRss>http://www.RayAcayan.com/social-networks/social-networks-and-employment/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>And So It Begins&#8230;</title>
		<link>http://www.RayAcayan.com/personal/and-so-it-begins/</link>
		<comments>http://www.RayAcayan.com/personal/and-so-it-begins/#comments</comments>
		<pubDate>Thu, 12 Feb 2009 23:00:49 +0000</pubDate>
		<dc:creator>Ray Acayan</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[CFA]]></category>
		<category><![CDATA[MBA]]></category>
		<category><![CDATA[PMP]]></category>
		<category><![CDATA[Rotman]]></category>

		<guid isPermaLink="false">http://www.RayAcayan.com/?p=1</guid>
		<description><![CDATA[
This is my first blog.
After many grueling years of hard work and study, I finally have some free time to reflect on what has gone before and to prepare for what lies ahead. Actually, I&#8217;m just extremely bored.
First, a little bit about myself. I&#8217;m a recent Rotman MBA grad with a triple-major in Investment Banking, [...]]]></description>
			<content:encoded><![CDATA[<p></br></p>
<p>This is my first blog.</p>
<p>After many grueling years of hard work and study, I finally have some free time to reflect on what has gone before and to prepare for what lies ahead. Actually, I&#8217;m just extremely bored.</p>
<p>First, a little bit about myself. I&#8217;m a recent Rotman MBA grad with a triple-major in Investment Banking, Funds Management, and Risk Management &amp; Financial Engineering. I have worked in Information Technology for my entire career, and I dabble in hedge funds, proprietary trading, real estate, political analysis, web development, social media, private equity, and network security. Iâ€™m also studying for the CFA and PMP certifications. You could say that I am â€œA Geek of All Tradesâ€.</p>
<p>In June 2008, I was laid off from my full-time job after 11 years in the financial industry. Shortly afterward, I graduated with an MBA from the Rotman School of Management (University of Toronto) and proceeded straight to semi-retirement. There were no jobs available as the financial industry collapsed, and we are now headed toward the worst economic conditions since the Great Depression.</p>
<p>So what happens now?</p>
<p>I have started looking for a full-time job, preferably in technology management or quantitative finance. If you have any leads, please e-mail me at <a href="mailto:RayAcayan@gmail.com">RayAcayan@gmail.com</a>. Thanks in advance for all your help. In the meantime, I continue to support my wife and 3-year-old son with some gold investments, left-over severance pay, and limited government assistance.</p>
<p>The job-hunting experience can be extremely boring, and I would rather do something more productive and somewhat entertaining. Hence, the blog. I&#8217;ll write about some interesting news, events, and insights that I come across in my adventures as a geek of all trades.</p>
<p></br><br /></br></p>
]]></content:encoded>
			<wfw:commentRss>http://www.RayAcayan.com/personal/and-so-it-begins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
