<?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 &#187; Ajax</title>
	<atom:link href="http://www.RayAcayan.com/tag/ajax/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.RayAcayan.com</link>
	<description>A Geek of All Trades</description>
	<lastBuildDate>Wed, 18 Aug 2010 19:40:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<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/blog/?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 [...]]]></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/blog/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(&#8216;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(&#8220;stockchart&#8221;);<br />
  imgbox.style.visibility=&#8217;visible&#8217;;<br />
  var img = document.createElement(&#8220;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/blog/?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 turn create [...]]]></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>
	</channel>
</rss>

