<?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>technicoSolutions.developerBlog();</title>
	<atom:link href="http://www.technicosolutions.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.technicosolutions.com</link>
	<description>a blog by Brandon Johnson of Technico Solutions</description>
	<lastBuildDate>Wed, 23 Sep 2009 06:06:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Ping.fm Custom URL Functionality</title>
		<link>http://www.technicosolutions.com/2009/04/ping-fm-custom-url-functionality/</link>
		<comments>http://www.technicosolutions.com/2009/04/ping-fm-custom-url-functionality/#comments</comments>
		<pubDate>Fri, 17 Apr 2009 19:45:00 +0000</pubDate>
		<dc:creator>Brandon</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Services]]></category>

		<guid isPermaLink="false">tag:blogger.com,1999:blog-3343170865085826116.post-3308085772552474367</guid>
		<description><![CDATA[Ping.fm is a message posting service that allows you to post to several social networking sites very easily (i.e. Facebook, Twitter, MySpace, etc.).  It also allows you to post to several networks at the same time, and there are various desktop and mobile apps currently available that use this service.  Recently I discovered that it [...]]]></description>
			<content:encoded><![CDATA[<p><a style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;" href="http://www.technicosolutions.com/blog/uploaded_images/pingFmLogo-724428.png"><img src="http://www.technicosolutions.com/blog/uploaded_images/pingFmLogo-724426.png" border="0" alt="" /></a>Ping.fm is a <a href="http://ping.fm/">message posting service</a> that allows you to post to several social networking sites very easily (i.e. Facebook, Twitter, MySpace, etc.).  It also allows you to post to several networks at the same time, and there are various desktop and mobile apps currently available that use this service.  Recently I discovered that it also has <strong>custom URL</strong> functionality, which allows you to direct the messages to your personal website or a custom script.  After discovering this, I decided to use this very convenient way to post messages for a personal site of mine.  I created a PHP script and reused some code for posting status updates from a recent client (see previous post, <a href="http://www.technicosolutions.com/2008/08/status-updates-in-mysql/">Status Updates in MySQL</a>).</p>
<p>Below is the list of variables sent with a Ping.fm custom url post:</p>
<ul>
<li>method &#8211; The method of the message being sent (blog, microblog, status).</li>
<li>title &#8211; If method is &#8220;blog&#8221; then this contains the blog&#8217;s title.</li>
<li>message &#8211; The posted message content.</li>
<li>location &#8211; Any location updates posted with the message.  This is plaintext, verbatim from the posting interface.</li>
<li>media &#8211; If media is posted, this will contain a URL to the media file.</li>
<li>raw_message &#8211; If media is posted, this will contain the posted message WITHOUT the hosted media link (i.e. <a href="http://ping.fm/p/12345">http://ping.fm/p/12345</a>).</li>
<li>trigger &#8211; If you post a message with a custom trigger (<a rel="nofollow" href="http://ping.fm/triggers/">http://ping.fm/triggers/</a>), it will show here.</li>
</ul>
<p>All that was needed for my script was to use the $_POST[] array to get the variables from the posted messages and use those variables in my script to insert the data into a MySQL database for later use.  Now I can post news stories, status updates, and blog posts right to my website without having to log in to the administrative backend of my site.  The apps I use to post are <a href="http://www.bryanbartow.com/apps/meping/"><em>Meping</em></a> on the desktop and <a href="http://www.schwenkconsulting.com/?q=node/22"><em>Blackping</em></a> on my Blackberry (requires custom trigger to post to custom url).</p>
<p>I&#8217;ve also thought of several other possibilities with the custom URL ping.fm functionality, such as HTML email marketing, which would normally be difficult to accomplish from a mobile phone, for example.  All you would need to do to accomplish this is put the HTML template in your server-side script along with queries to your customer database and then include some key words in your pinged message that the script can parse (i.e. the location variable can contain which HTML template to use and some filter keywords for which customers to email).</p>
<p>All it takes is a little imagination, and the possibilities are almost endless with the ping.fm custom URL functionality.  For now, I&#8217;m just happy that I can post messages to my website&#8230;  Tomorrow, pinging NASA servers to send rockets into space.</p>
<div class="blogger-post-footer"><img src="https://blogger.googleusercontent.com/tracker/3343170865085826116-3308085772552474367?l=www.technicosolutions.com%2Fblog" alt="" width="1" height="1" /></div>
]]></content:encoded>
			<wfw:commentRss>http://www.technicosolutions.com/2009/04/ping-fm-custom-url-functionality/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Programming Comics</title>
		<link>http://www.technicosolutions.com/2009/04/programming-comics/</link>
		<comments>http://www.technicosolutions.com/2009/04/programming-comics/#comments</comments>
		<pubDate>Fri, 17 Apr 2009 15:20:00 +0000</pubDate>
		<dc:creator>Brandon</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">tag:blogger.com,1999:blog-3343170865085826116.post-8402233536806800266</guid>
		<description><![CDATA[The following are some funny viral comics that my Twitter friends posted.  I thought they were pretty good, so I thought I would share them here&#8230;
A Call to Code Superheroes



How a Programmer Reads Your Résumé




Lines of (Mis)Communication in Projects




Hope you enjoyed as much as I did!

]]></description>
			<content:encoded><![CDATA[<p>The following are some funny viral comics that my Twitter friends posted.  I thought they were pretty good, so I thought I would share them here&#8230;</p>
<div style="text-align: center;"><strong>A Call to Code Superheroes</strong></div>
<div class="separator" style="clear: both; text-align: center;"><a style="margin-left: 1em; margin-right: 1em;" href="http://www.technicosolutions.com/blog/uploaded_images/n596627863_467377_3640-736870.jpg"><img class="corner iradius4 ishade50 ishadow33" src="http://www.technicosolutions.com/blog/uploaded_images/n596627863_467377_3640-736868.jpg" border="0" alt="" /></a></div>
<div class="separator" style="clear: both; text-align: center;"></div>
<div class="separator" style="clear: both; text-align: center;"></div>
<div class="separator" style="clear: both; text-align: center;"><strong>How a Programmer Reads Your Résumé</strong></div>
<div class="separator" style="clear: both; text-align: center;"></div>
<div class="separator" style="clear: both; text-align: center;"><a style="margin-left: 1em; margin-right: 1em;" href="http://www.technicosolutions.com/blog/uploaded_images/resume_comic-752926.png"><img class="corner iradius4 ishade50 ishadow33" src="http://www.technicosolutions.com/blog/uploaded_images/resume_comic-752233.png" border="0" alt="" /></a></div>
<div class="separator" style="clear: both; text-align: center;"></div>
<div class="separator" style="clear: both; text-align: center;"></div>
<div class="separator" style="clear: both; text-align: center;"><strong>Lines of (<em>Mis</em>)Communication in Projects</strong></div>
<div class="separator" style="clear: both; text-align: center;"></div>
<div class="separator" style="clear: both; text-align: center;"><a style="margin-left: 1em; margin-right: 1em;" href="http://www.technicosolutions.com/blog/uploaded_images/pic_605913001182820927-794554.jpg"><img class="corner iradius4 ishade50 ishadow33" src="http://www.technicosolutions.com/blog/uploaded_images/pic_605913001182820927-794550.jpg" border="0" alt="" /></a></div>
<div class="separator" style="clear: both; text-align: center;"></div>
<div class="separator" style="clear: both; text-align: center;"></div>
<div class="separator" style="clear: both; text-align: left;">Hope you enjoyed as much as I did!</div>
<div class="blogger-post-footer"><img src="https://blogger.googleusercontent.com/tracker/3343170865085826116-8402233536806800266?l=www.technicosolutions.com%2Fblog" alt="" width="1" height="1" /></div>
]]></content:encoded>
			<wfw:commentRss>http://www.technicosolutions.com/2009/04/programming-comics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shipping Estimator in AIR</title>
		<link>http://www.technicosolutions.com/2009/03/shipping-estimator-in-air/</link>
		<comments>http://www.technicosolutions.com/2009/03/shipping-estimator-in-air/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 22:57:00 +0000</pubDate>
		<dc:creator>Brandon</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Actionscript 3]]></category>
		<category><![CDATA[All]]></category>
		<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">tag:blogger.com,1999:blog-3343170865085826116.post-3190981781149478907</guid>
		<description><![CDATA[The fire sales division at work asked me the other day if I could create a program for tracking the flow of fire truck sales.   It got me real excited, because I have started getting more into Adobe AIR and Flex recently, and this gives me the opportunity to do something major with [...]]]></description>
			<content:encoded><![CDATA[<p>The fire sales division at work asked me the other day if I could create a program for tracking the flow of fire truck sales.   It got me real excited, because I have started getting more into Adobe AIR and Flex recently, and this gives me the opportunity to do something major with Flex and AIR since that is probably what I would use for this project.  I have actually been using Flash for about three years now, but I have been stuck on using mostly Actionscript 2.0 whereas Flex uses only Actionscript 3.  I will need to really learn AS 3 for this project.</p>
<p>Although I have not yet done anything major with Flex and AIR, I have programmed a few small AIR applications, including a shipping cost estimator that is used by the Accounting department.</p>
<p><a href="http://www.technicosolutions.com/blog/uploaded_images/ross_shipping-746604.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img alt="" border="0" src="http://www.technicosolutions.com/blog/uploaded_images/ross_shipping-746601.png" style="cursor: pointer; float: right; height: 386px; margin: 0pt 0pt 10px 10px; width: 400px;" /></a>The application is very simple as you can see.  It contains a form that asks for three pieces of information: the origination zip code, the destination zip code, and the weight of the package.  When the form is submitted, it sends an RPC request to the company web server, where a PHP script queries a database that contains zip code information (including distance between zip codes) and gets back calculated shipping estimates for several different shipping services.</p>
<p>This application has come in handy when waiting for direct shipping charges from a manufacturer while the customer needs an invoice ASAP with the shipping charges included in the invoice.</p>
<p>This small application is nothing like the fire truck sales flow application I will be creating, but it is something I can build upon.  I am hoping that my foundation in Actionscript 2 and Flash will help me to learn AS 3 and Flex quickly.  I say BRING IT ON!!
<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3343170865085826116-3190981781149478907?l=www.technicosolutions.com%2Fblog'/></div>
]]></content:encoded>
			<wfw:commentRss>http://www.technicosolutions.com/2009/03/shipping-estimator-in-air/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Flash Image Slideshow with XML</title>
		<link>http://www.technicosolutions.com/2008/09/flash-image-slideshow-with-xml/</link>
		<comments>http://www.technicosolutions.com/2008/09/flash-image-slideshow-with-xml/#comments</comments>
		<pubDate>Mon, 22 Sep 2008 19:31:00 +0000</pubDate>
		<dc:creator>Brandon</dc:creator>
				<category><![CDATA[Actionscript 2]]></category>
		<category><![CDATA[All]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">tag:blogger.com,1999:blog-3343170865085826116.post-8998662131202653240</guid>
		<description><![CDATA[I finished a Flash image slideshow for a website and this post explains how I created it.  First, I created a PHP class with methods for uploading the images to the server.  When a file is uploaded by the user, the script creates a filename for the image and stores it in a [...]]]></description>
			<content:encoded><![CDATA[<p>I finished a Flash image slideshow for a website and this post explains how I created it.  First, I created a PHP class with methods for uploading the images to the server.  When a file is uploaded by the user, the script creates a filename for the image and stores it in a pre-built directory, and then inserts the filename and file location to a table in the MySQL database.  This way I am able to query the database for the filename and file location and then use the data dynamically in the Flash image slideshow.  Also, this would give full control to the users of the website and would allow them to change the images for the slideshow without any coding.</p>
<p>Next, I created a dynamic XML file using PHP to get the data for use in Flash.  The following code is the PHP code for the dynamic XML file:</p>
<div class="separator" style="clear: both; text-align: center;"></div>
<p><a href="http://draft.blogger.com/post-edit.g?blogID=3343170865085826116&amp;postID=8998662131202653240" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"></a><br />
<blockquote><code><span style="color: red;">&lt;?php<br /><span style="color: blue;">header(</span><span style="color: red;">'Content-Type: text/xml; charset=utf-8'</span><span style="color: blue;">)</span>;<br /><span style="color: blue;">echo </span><span style="color: red;">'</span></span></code><code><span style="color: red;">&lt;?xml version="1.0" encoding="iso-8859-1"?&gt;</span><span style="color: red;"></span><span style="color: red;">'</span>;<br /><span style="color: grey;"><br />/*<br />"TransTime"   = Seconds between each image transition<br />"SlideOrder"  = How images are displayed. Can be either "sequential" or "random"<br />"FadeTime"    = velocity of image crossfade. Larger number for faster fades<br />"Loop"        = Set to "yes" or "no" for looping in sequential mode<br />"Xpos"        = X position of all loaded clips set to 0<br />"Ypos"        = Y position of all loaded clips set to 0<br />*/<br /></span></p>
<p><span style="color: blue;">echo</span> <span style="color: red;">'</span><span style="color: red;"><gallery fadetime="3" loop="yes" slideorder="random" transtime="4" xpos="0" ypos="0"></gallery></span><span style="color: red;"><gallery fadetime="3" loop="yes" slideorder="random" transtime="4" xpos="0" ypos="0"></gallery></span><span style="color: red;">&lt;gallery TransTime="4" SlideOrder="random" FadeTime="3" Loop="yes" Xpos="0" Ypos="0"&gt;</span><span style="color: red;"><gallery fadetime="3" loop="yes" slideorder="random" transtime="4" xpos="0" ypos="0"><gallery fadetime="3" loop="yes" slideorder="random" transtime="4" xpos="0" ypos="0">'</gallery></gallery></span>;</p>
<p><span style="color: green;">require_once</span><span style="color: blue;">(</span> <span style="color: red;">'../../classes/FamilyPhotos.php'</span> <span style="color: blue;">)</span><span style="color: black;">;</span><br style="color: black;" /> <br style="color: black;" /> $mySlideShow <span style="color: blue;">=</span> <span style="color: green;">new</span> FamilyPhotos;<br style="color: black;" /> <br style="color: black;" /> $ssquery <span style="color: blue;">=</span> <span style="color: red;">"<br />&nbsp;&nbsp;     SELECT<br />&nbsp;&nbsp;       SsPic_ID,<br />&nbsp;&nbsp;       SsPic_Filename,<br />&nbsp;&nbsp;       SsPic_Desc<br />&nbsp;&nbsp;     FROM T_SlideshowPics<br />&nbsp;&nbsp;     ORDER BY SsPic_ID DESC;"</span><span style="color: black;">;</span><br style="color: black;" /> $ssrs <span style="color: blue;">= mysqli_query(</span><span style="color: black;">$mySlideShow</span><span style="color: blue;">-&gt;</span>mysqli, $ssquery <span style="color: blue;">)</span><span style="color: black;">;</span><br /><span style="color: #009900;">while</span><span style="color: blue;">(</span> $ssrow <span style="color: blue;">= mysqli_fetch_assoc(</span>$ssrs<span style="color: blue;">))</span> {</p>
<p><span style="color: blue;">echo</span><span style="color: red;">&lt;image path="' </span><span style="color: black;">. $ssrow[</span><span style="color: red;">"SsPic_Filename"</span>] . <span style="color: red;">'" /&gt;'</span>;  </p>
<p>}</p>
<p><span style="color: blue;">echo</span> <span style="color: red;">'</span><span style="color: red;">&lt;/gallery&gt;</span><span style="color: red;">'</span><span style="color: black;">;</span><br /><span style="color: red;">?&gt;</span><br /></code></p></blockquote>
<p><span style="color: black;">Next I created a Flash file that loads the XML from the previous PHP file and parses the XML to get the image data.  The Flash file then loads the images and adds transition effects to each image with the following Actionscript code:</span></p>
<blockquote><p><code><br /><span style="color: #3333ff;">function</span> parse(success)<br /><span style="color: black;">&nbsp;{</span><br />&nbsp;    <span style="color: #3333ff;">if</span> (success)<br />&nbsp;     <span style="color: black;">{</span><br />&nbsp;&nbsp;          imageArray <span style="color: black;">=</span> <span style="color: #3333ff;">new Array</span>();<br />&nbsp;&nbsp;          <span style="color: #3333ff;">var root</span> <span style="color: black;">=</span> <span style="color: #3333ff;">this.firstChild</span>;<br />&nbsp;&nbsp;          <span style="color: #3333ff;">_global</span>.numPause <span style="color: black;">=</span> <span style="color: #3333ff;">Number<span style="color: black;">(</span>this.firstChild.attributes</span>.TransTime <span style="color: #3333ff;">*</span> 1000);<br />&nbsp;&nbsp;          <span style="color: #3333ff;">_global</span>.SlideOrder = <span style="color: #3333ff;">this.firstChild.attributes</span>.SlideOrder;<br />&nbsp;&nbsp;          <span style="color: #3333ff;">_global</span>.Loop = <span style="color: #3333ff;">this.firstChild.attributes</span>.Loop;<br />&nbsp;&nbsp;          <span style="color: #3333ff;">_global</span>.FadeTime = <span style="color: #3333ff;">Number<span style="color: black;">(</span>this.firstChild.attributes</span>.FadeTime);<br />&nbsp;&nbsp;          <span style="color: #3333ff;">_global</span>.Xpos = <span style="color: #3333ff;">Number<span style="color: black;">(</span>this.firstChild.attributes</span>.Xpos);<br />&nbsp;&nbsp;          <span style="color: #3333ff;">_global</span>.Ypos = <span style="color: #3333ff;">Number</span>(<span style="color: #3333ff;">this.firstChild.attributes</span>.Ypos);<br />&nbsp;&nbsp;          <span style="color: #3333ff;">var</span> imageNode = <span style="color: #3333ff;">root.lastChild</span>;<br />&nbsp;&nbsp;          <span style="color: #3333ff;">var</span> s = 0;<br />&nbsp;&nbsp;          <span style="color: #3333ff;">while</span> (imageNode.<span style="color: #3333ff;">nodeName</span> != <span style="color: #3333ff;">null</span>)<br />&nbsp;&nbsp;           {<br />&nbsp;&nbsp;&nbsp;                imageData = <span style="color: #3333ff;">new Object</span>();<br />&nbsp;&nbsp;&nbsp;                imageData.path = imageNode.<span style="color: #3333ff;">attributes</span>.path;<br />&nbsp;&nbsp;&nbsp;                imageArray[s] = imageData;<br />&nbsp;&nbsp;&nbsp;                imageNode = imageNode.<span style="color: #3333ff;">previousSibling</span>;<br />&nbsp;&nbsp;&nbsp;                ++s;<br />&nbsp;&nbsp;           }<br />&nbsp;&nbsp;   container_mc.<span style="color: #3333ff;">_x</span> = <span style="color: #3333ff;">_global</span>.Xpos;<br />&nbsp;&nbsp;   container_mc.<span style="color: #3333ff;">_y</span> = <span style="color: #3333ff;">_global</span>.Ypos;<br />&nbsp;&nbsp;          imageArray.<span style="color: #3333ff;">reverse</span>();<br />&nbsp;&nbsp;          imageGen(imageArray);<br />&nbsp;&nbsp;          <span style="color: #3333ff;">return</span>;<br />&nbsp;  }<br />&nbsp;}<br /><span style="color: #3333ff;">  function</span> swapPlace(clip, num)<br />{<br />&nbsp;      <span style="color: #3333ff;">eval</span>(clip).<span style="color: #3333ff;">swapDepths</span>(<span style="color: #3333ff;">eval</span>(<span style="color: #009900;">"container_mc.loader"</span> + num + <span style="color: #009900;">"_mc"</span>));<br />}<br /><span style="color: #3333ff;">  function</span> loadImages(<span style="color: #3333ff;">data</span>, num)<br />{<br />&nbsp;     <span style="color: #3333ff;">if</span> (i == <span style="color: #3333ff;">undefined</span> || i == 2)<br />&nbsp;     {<br />&nbsp; &nbsp;         i = 2;<br />&nbsp;&nbsp;          createLoader(i, <span style="color: #3333ff;">data</span>, num);<br />&nbsp;&nbsp;          i = 1;<br />&nbsp;&nbsp;          <span style="color: #3333ff;">return</span>;<br />&nbsp;     }<br />&nbsp;     <span style="color: #3333ff;">if</span> (i == 1)<br />&nbsp;     {<br />&nbsp;&nbsp;          createLoader(i, <span style="color: #3333ff;">data</span>, num);<br />&nbsp;&nbsp;         i = 2;<br />&nbsp;     }<br />}<br /><span style="color: #3333ff;">function</span> createLoader(i, <span style="color: #3333ff;">data</span>, num)<br />{<br />&nbsp;    thisLoader = <span style="color: #3333ff;">eval</span>(<span style="color: #009900;">"container_mc.loader"</span> + i + <span style="color: #009900;">"_mc"</span>);<br />&nbsp;    thisLoader.<span style="color: #3333ff;">_alpha</span> = 0;<br />&nbsp;    thisLoader.<span style="color: #3333ff;">loadMovie</span>(<span style="color: #3333ff;">data</span>[num].path);<br />&nbsp;    watcher_mc.<span style="color: #3333ff;">onEnterFrame</span> = <span style="color: #3333ff;">function</span> ()<br />&nbsp; {<br />&nbsp;&nbsp;         <span style="color: #3333ff;">var</span> picLoaded = thisLoader.<span style="color: #3333ff;">getBytesLoaded</span>();<br />&nbsp;&nbsp;         <span style="color: #3333ff;">var</span> picBytes = thisLoader.<span style="color: #3333ff;">getBytesTotal</span>();<br />&nbsp;&nbsp;         <span style="color: #3333ff;">if</span> (<span style="color: #3333ff;">isNaN</span>(picBytes) || picBytes &lt; 4)<br />&nbsp;&nbsp;         {<br />&nbsp;&nbsp;&nbsp;              <span style="color: #3333ff;">return undefined</span>;<br />&nbsp;&nbsp;         }<br />&nbsp;&nbsp;         <span style="color: #3333ff;">if</span> (picLoaded / picBytes &gt;= 1)<br />&nbsp;&nbsp;         {<br />&nbsp;&nbsp;&nbsp;              swapPlace(<span style="color: #009900;">"container_mc.loader2_mc"</span>, 1);<br />&nbsp;&nbsp;&nbsp;              thisLoader.<span style="color: #3333ff;">alpha</span>(<span style="color: #3333ff;">_global</span>.FadeTime, 100);<br />&nbsp;&nbsp;&nbsp;              TransTimeInterval = <span style="color: #3333ff;">setInterval</span>(imageGen, <span style="color: #3333ff;">_global</span>.numPause, <span style="color: #3333ff;">data</span>);<br />&nbsp;&nbsp;&nbsp;              <span style="color: #3333ff;">delete this</span>.<span style="color: #3333ff;">onEnterFrame</span>;<br />&nbsp;&nbsp;  }<br />&nbsp;    };<br />}<br /><span style="color: #3333ff;">function</span> imageGen(<span style="color: #3333ff;">data</span>)<br />{<br />&nbsp;    <span style="color: #3333ff;">if</span> (<span style="color: #3333ff;">_global</span>.SlideOrder == <span style="color: #009900;">"random"</span>)<br />&nbsp;    {<br />&nbsp;&nbsp;         <span style="color: #3333ff;">while</span> (randomNum == randomNumLast)<br />&nbsp;&nbsp;        {<br />&nbsp;&nbsp;&nbsp;             randomNum = <span style="color: #3333ff;">Math.floor</span>(<span style="color: #3333ff;">Math.random</span>() <span style="color: #3333ff;">* data.length</span>);<br />&nbsp;&nbsp;        }<br />&nbsp;&nbsp;        loadImages(<span style="color: #3333ff;">data</span>, randomNum);<br />&nbsp;&nbsp;        randomNumLast = randomNum;<br />&nbsp;}<br />&nbsp;<span style="color: #3333ff;">else</span><br />&nbsp;{<br />&nbsp;&nbsp;        <span style="color: #3333ff;">if</span> (<span style="color: #3333ff;">_global</span>.SlideOrder == <span style="color: #009900;">"sequential"</span>)<br />&nbsp;&nbsp;        {<br />&nbsp;&nbsp;&nbsp;             <span style="color: #3333ff;">if</span> (p == <span style="color: #3333ff;">undefined</span> || p == <span style="color: #3333ff;">data.length</span> &amp;&amp; <span style="color: #3333ff;">_global</span>.Loop == <span style="color: #009900;">"yes"</span>)<br />&nbsp;&nbsp;&nbsp;            {<br />&nbsp;&nbsp;&nbsp;&nbsp;                 p = 0;<br />&nbsp;&nbsp;&nbsp;            }<br />&nbsp;&nbsp;&nbsp; loadImages(<span style="color: #3333ff;">data</span>, p);<br />&nbsp;&nbsp;&nbsp;            ++p;<br />&nbsp;&nbsp;        }<br />&nbsp;  }<span style="color: #3333ff;"><br />&nbsp;  clearInterval</span>(TransTimeInterval);<br />}<br /><span style="color: #3333ff;">var</span> randomNum = 0;<br /><span style="color: #3333ff;">var</span> randomNumLast = 0;<br /><span style="color: #3333ff;">var</span> container_mc = <span style="color: #3333ff;">this.createEmptyMovieClip</span>(<span style="color: #009900;">"container"</span>, 0);<br />container_mc.<span style="color: #3333ff;">createEmptyMovieClip</span>(<span style="color: #009900;">"loader1_mc"</span>, 2);<br />container_mc.<span style="color: #3333ff;">createEmptyMovieClip</span>(<span style="color: #009900;">"loader2_mc"</span>, 1);<br /><span style="color: #3333ff;">this.createEmptyMovieClip</span>(<span style="color: #009900;">"watcher_mc"</span>, 100);<br />image_changer_xml = <span style="color: #3333ff;">new XML</span>();<br />image_changer_xml.<span style="color: #3333ff;">ignoreWhite</span> = <span style="color: #3333ff;">true</span>;<br />image_changer_xml.<span style="color: #3333ff;">onLoad</span> = parse;<br />image_changer_xml.<span style="color: #3333ff;">load</span>(<span style="color: #009900;">"includes/flash/imagechanger/image_changer_addon.php"</span>);<br /><span style="color: #3333ff;">stop</span>();</p>
<p><span style="color: #3333ff;">MovieClip.prototype.alpha</span> = <span style="color: #3333ff;">function</span> (vel, to)<br />{<br />&nbsp;      <span style="color: #3333ff;">this</span>.vel = vel;<br />&nbsp;      <span style="color: #3333ff;">this</span>.to = to;<br />&nbsp;      <span style="color: #3333ff;">this</span>.alpha_init = <span style="color: #3333ff;">this</span>.<span style="color: #3333ff;">_alpha</span>;<br />&nbsp;      <span style="color: #3333ff;">this</span>.<span style="color: #3333ff;">onEnterFrame</span> = <span style="color: #3333ff;">function</span> ()<br />&nbsp;      {<br />&nbsp;           <span style="color: #3333ff;">updateAfterEvent</span>();<br />&nbsp;           <span style="color: #3333ff;">if</span> (<span style="color: #3333ff;">this</span>.to != <span style="color: #3333ff;">undefined</span> &amp;&amp; <span style="color: #3333ff;">this</span>.vel != <span style="color: #3333ff;">undefined</span>)<br />&nbsp;           {<br />&nbsp;&nbsp;               <span style="color: #3333ff;"> if</span> (<span style="color: #3333ff;">this</span>.to &gt; <span style="color: #3333ff;">this</span>.alpha_init)<br />&nbsp;&nbsp;                {<br />&nbsp;&nbsp;&nbsp;                     <span style="color: #3333ff;">if</span> (<span style="color: #3333ff;">this</span>.<span style="color: #3333ff;">_alpha</span> &lt;= 100)<br />&nbsp;&nbsp;&nbsp;                     {<br />&nbsp;&nbsp;&nbsp;&nbsp;                          <span style="color: #3333ff;">this</span>.<span style="color: #3333ff;">_alpha</span> = <span style="color: #3333ff;">this</span>.<span style="color: #3333ff;">_alpha</span> + <span style="color: #3333ff;">this</span>.vel;<br />&nbsp;&nbsp;&nbsp;      }<br />&nbsp;&nbsp;&nbsp;      <span style="color: #3333ff;">else</span><br />&nbsp;&nbsp;&nbsp;                     {<br />&nbsp;&nbsp;&nbsp;&nbsp;                          <span style="color: #3333ff;">this</span>.<span style="color: #3333ff;">onEnterFrame</span> = <span style="color: #3333ff;">null</span>;<br />&nbsp;&nbsp;&nbsp;                     }<br />&nbsp;&nbsp;                }<br />&nbsp;               <span style="color: #3333ff;"> else </span><br />&nbsp;     {<br />&nbsp;&nbsp;                     <span style="color: #3333ff;">if</span> (<span style="color: #3333ff;">this</span>.<span style="color: #3333ff;">_alpha</span> &gt; <span style="color: #3333ff;">this</span>.to)<br />&nbsp;&nbsp;                     {<br />&nbsp;&nbsp;&nbsp;                          <span style="color: #3333ff;">this</span>.<span style="color: #3333ff;">_alpha</span> = <span style="color: #3333ff;">this</span>.<span style="color: #3333ff;">_alpha</span> - <span style="color: #3333ff;">this</span>.vel;<br />&nbsp;&nbsp;                     }<br />&nbsp;&nbsp;                     <span style="color: #3333ff;">else</span><br />&nbsp;&nbsp;                     {<br />&nbsp;&nbsp;&nbsp;                         <span style="color: #3333ff;">this</span>.<span style="color: #3333ff;">onEnterFrame</span> = <span style="color: #3333ff;">null</span>;<br />&nbsp;&nbsp;     }<br />&nbsp;               }<br />&nbsp;               <span style="color: #3333ff;">return</span>;<br />&nbsp;   }<br />&nbsp;};<br />};<br /></code></p></blockquote>
<p>The image slideshow looks great!  My next post will be about a flash video player I have been working on to play videos on the site as well as search the database for relevant videos&#8230;
<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3343170865085826116-8998662131202653240?l=www.technicosolutions.com%2Fblog'/></div>
]]></content:encoded>
			<wfw:commentRss>http://www.technicosolutions.com/2008/09/flash-image-slideshow-with-xml/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Status Updates in MySQL</title>
		<link>http://www.technicosolutions.com/2008/08/status-updates-in-mysql/</link>
		<comments>http://www.technicosolutions.com/2008/08/status-updates-in-mysql/#comments</comments>
		<pubDate>Mon, 11 Aug 2008 23:20:00 +0000</pubDate>
		<dc:creator>Brandon</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">tag:blogger.com,1999:blog-3343170865085826116.post-3641144383766792913</guid>
		<description><![CDATA[I have been working on a website that required a script that imitates the status updates a la Twitter, Facebook status, MySpace status, etc. This post explains how I programmed that part of the website.
First, as part of a backend CMS, I created a form that submits the status update via PHP to a MySQL [...]]]></description>
			<content:encoded><![CDATA[<p>I have been working on a website that required a script that imitates the status updates a la Twitter, Facebook status, MySpace status, etc. This post explains how I programmed that part of the website.</p>
<p>First, as part of a backend CMS, I created a form that submits the status update via PHP to a MySQL database. Then I wrote a PHP class that includes a method to query the database for the most recent status update and another method that calls a MySQL stored procedure to get the time of that status update (i.e. &#8220;a few minutes ago&#8221;, &#8220;32 minutes ago&#8221;, &#8220;5 days ago&#8221;, etc.). The following is the code for the MySQL stored procedure that gets the time of the user&#8217;s most recent status update:<br />
<blockquote><span style="font-size: 85%;"><span style="color: blue;">DROP FUNCTION IF EXISTS</span> `my_DB`.`getStatusTime`;</p>
<p>DELIMITER $$<br /><span style="color: green;">/*!50003 SET @TEMP_SQL_MODE=@@SQL_MODE, SQL_MODE=&#8221; */</span> $$<br /><span style="color: blue;">CREATE FUNCTION</span> `my_DB`.`getStatusTime`<span style="color: #3333ff;">(</span>User <span style="color: blue;">VARCHAR</span><span style="color: #3333ff;">(</span>25<span style="color: #3333ff;">))</span> <span style="color: blue;">RETURNS VARCHAR</span><span style="color: #3333ff;">(</span>25<span style="color: #3333ff;">)</span><br /><span style="color: blue;">BEGIN</span><br /><span style="color: blue;">DECLARE</span> TodaysDate <span style="color: blue;">TIMESTAMP</span>;<br /><span style="color: blue;">DECLARE</span> StatusDate <span style="color: blue;">TIMESTAMP</span>;<br /><span style="color: blue;">DECLARE</span> TimeDifference <span style="color: blue;">TIME</span>;<br /><span style="color: blue;">DECLARE</span> Status_Time <span style="color: blue;">VARCHAR</span><span style="color: #3333ff;">(</span>25<span style="color: #3333ff;">)</span>;</p>
<p><span style="color: blue;">SELECT NOW()</span><br /><span style="color: blue;">INTO</span> TodaysDate;</p>
<p><span style="color: blue;">SELECT</span> s.Stat_Updated<br /><span style="color: blue;">INTO</span> StatusDate<br /><span style="color: blue;">FROM</span> T_Status s<br /><span style="color: blue;">INNER JOIN</span> T_Profile p <span style="color: blue;">ON</span> p.Profile_ID=s.Stat_Who<br /><span style="color: blue;">WHERE</span> p.Pr_Name_First=User<br /><span style="color: blue;">ORDER BY</span> s.Stat_Updated desc<br /><span style="color: blue;">LIMIT</span> 1;</p>
<p><span style="color: blue;">SELECT</span> TIMEDIFF<span style="color: #3333ff;">(</span> TodaysDate, StatusDate <span style="color: #3333ff;">)</span><br /><span style="color: blue;">INTO</span> TimeDifference;</p>
<p><span style="color: #3333ff;">SELECT <span style="color: black;">TIMEDIFF</span>( <span style="color: black;">MAKETIME</span>(<span style="color: red;">47</span>,<span style="color: red;">59</span>,<span style="color: red;">59</span>), <span style="color: black;">TimeOfStatus</span> )</span><br /><span style="color: #3333ff;">  INTO <span style="color: black;">YesterdayTimeDifference;</span></span><br /><span style="color: #3333ff;"><br /></span></span><span style="font-size: 85%;"><span style="color: green;">/*//////  Find the time of status update formatted as a string  /////// */</span></span><span style="font-size: 85%;"><span style="color: #3333ff;">  </span><br /><span style="color: #3333ff;">IF HOUR<span style="color: black;"><span style="color: #3333ff;">(</span>TimeOfStatus<span style="color: #3333ff;">)</span></span> &lt; <span style="color: red;">12</span> THEN SET <span style="color: black;">TimeOfStatusString</span> = CONCAT( &#8216; <span style="color: #999999;">at</span> &#8216;, HOUR(<span style="color: black;">TimeOfStatus</span>), &#8216;<span style="color: #999999;">:</span>&#8216;, MINUTE(<span style="color: black;">TimeOfStatus</span>), &#8216;<span style="color: #999999;"> AM</span>&#8216; )<span style="color: black;">;</span></span><br /><span style="color: #3333ff;">ELSEIF HOUR(<span style="color: black;">TimeOfStatus</span>) &lt; <span style="color: red;">13</span> THEN SET <span style="color: black;">TimeOfStatusString</span> = CONCAT( &#8216;<span style="color: #999999;"> at</span> &#8216;, HOUR(<span style="color: black;">TimeOfStatus</span>), &#8216;<span style="color: #999999;">:</span>&#8216;, MINUTE(<span style="color: black;">TimeOfStatus</span>), &#8216; <span style="color: #999999;">PM</span>&#8216; )<span style="color: black;">;</span></span><br /><span style="color: #3333ff;">ELSE SET <span style="color: black;">TimeOfStatusString</span> = CONCAT( &#8216;<span style="color: #999999;"> at</span> &#8216;, HOUR( DATE_SUB( <span style="color: black;">StatusDate</span>, INTERVAL <span style="color: red;">12</span> HOUR ) ), &#8216;<span style="color: #999999;">:</span>&#8216;, MINUTE(<span style="color: black;">TimeOfStatus</span>), &#8216; <span style="color: #999999;">PM</span>&#8216; )<span style="color: black;">;</span></span><br /><span style="color: #3333ff;">END IF<span style="color: black;">;</span></span></p>
<p><span style="color: green;">/*//////  Find the amount of time since most recent status update  /////// */<br />/*<br />Status options:<br />&#8216;a moment ago&#8217;<br />&#8216;less than 1 minute ago&#8217;<br />&#8216;1 minute ago&#8217;<br />&#8216;{n} minutes ago&#8217;<br />&#8216;1 hour ago&#8217;<br />&#8216;{n} hours ago&#8217;<br />&#8216;yesterday at {time}&#8217;<br />&#8216;on {day} at {time}&#8217;<br />&#8216;last {day} at {time}&#8217;<br />&#8216;on {date} at {time}&#8217;<br />*/</span><br /><span style="color: blue;">IF HOUR( <span style="color: black;">TimeDifference</span> ) <span style="color: black;">&lt;</span> <span style="color: red;">1</span> AND MINUTE( <span style="color: black;">TimeDifference</span> ) <span style="color: black;">&lt;</span> 1 THEN SET <span style="color: black;">Status_Time</span> = CONCAT( SECOND( <span style="color: black;">TimeDifference</span> ), &#8216;<span style="color: #999999;"> seconds ago</span>&#8216; )<span style="color: black;">;</span><br />ELSEIF HOUR(<span style="color: black;"> TimeDifference</span> ) &lt; <span style="color: red;">1</span> AND MINUTE( <span style="color: black;">TimeDifference</span> ) &lt; <span style="color: red;">2</span> THEN SET <span style="color: black;">Status_Time</span> = <span style="color: #999999;">&#8216;1 minute ago</span>&#8216;<span style="color: black;">;</span><br />ELSEIF HOUR( <span style="color: black;">TimeDifference </span>) &lt; <span style="color: red;">1</span> AND MINUTE(<span style="color: black;"> TimeDifference</span> ) &lt; <span style="color: red;">60</span> THEN SET <span style="color: black;">Status_Time</span> = CONCAT( MINUTE( <span style="color: black;">TimeDifference </span>), &#8216; <span style="color: #999999;">minutes ago</span>&#8216; )<span style="color: black;">;</span><br />ELSEIF HOUR(<span style="color: black;"> TimeDifference</span> ) &lt; <span style="color: red;">2</span> THEN SET <span style="color: black;">Status_Time</span> = &#8216;<span style="color: #999999;">1 hour ago</span>&#8216;<span style="color: black;">;</span><br />ELSEIF HOUR( <span style="color: black;">TimeDifference</span> ) &lt; <span style="color: red;">24</span> THEN SET <span style="color: black;">Status_Time</span> = CONCAT( HOUR( <span style="color: black;">TimeDifference</span> ), &#8216;<span style="color: #999999;"> hours ago</span>&#8216; )<span style="color: black;">;</span><br />ELSEIF HOUR(<span style="color: black;"> TimeDifference</span> ) &lt; ( <span style="color: black;">YesterdayTimeDifference</span></span> <span style="color: #3333ff;">) AND MINUTE(</span> <span style="color: black;">TimeDifference</span> ) <span style="color: #3333ff;">&lt; MINUTE</span><span style="color: #3333ff;">( </span>YesterdayTimeDifference</span> <span style="color: #3333ff;">) AND SECOND(</span> <span style="color: black;">TimeDifference</span> <span style="color: #3333ff;">) &lt;</span> <span style="color: #3333ff;">SECOND</span><span style="color: #3333ff;">( </span>YesterdayTimeDifference <span style="color: #3333ff;">) THEN SET</span> <span style="color: black;">Status_Time</span> <span style="color: #3333ff;">= CONCAT(</span> &#8216;<span style="color: #999999;">yesterday</span>&#8216;<span style="color: #3333ff;">,</span> <span style="color: black;">TimeOfStatusString</span> <span style="color: #3333ff;">)</span><span style="color: black;">;</span><br /><span style="color: #3333ff;">ELSEIF HOUR(</span> <span style="color: black;">TimeDifference</span> <span style="color: #3333ff;">) &lt;</span> <span style="color: red;">144</span> <span style="color: #3333ff;">THEN SET</span> <span style="color: black;">Status_Time</span> <span style="color: #3333ff;">= CONCAT(</span> <span style="color: #999999;"><span style="color: black;">&#8216;</span>on</span> &#8216;<span style="color: #3333ff;">, DAYNAME(</span> <span style="color: black;">StatusDate</span> <span style="color: #3333ff;">),</span> <span style="color: black;">TimeOfStatusString</span> <span style="color: #3333ff;">)</span><span style="color: black;">;</span><br /><span style="color: #3333ff;">ELSEIF HOUR(</span> <span style="color: black;">TimeDifference</span> <span style="color: #3333ff;">) &lt;</span> <span style="color: red;">168</span> <span style="color: #3333ff;">THEN SET</span><span style="color: black;"> Status_Time</span> <span style="color: #3333ff;">= CONCAT(</span> &#8216;<span style="color: #999999;">last</span> &#8216;<span style="color: #3333ff;">, DAYNAME(</span> <span style="color: black;">StatusDate </span><span style="color: #3333ff;">),</span> <span style="color: black;">TimeOfStatusString</span> <span style="color: #3333ff;">)</span><span style="color: black;">;</span><br /><span style="color: #3333ff;">ELSE SET</span> <span style="color: black;">Status_Time</span> <span style="color: #3333ff;">= CONCAT(</span> &#8216;<span style="color: #999999;">on</span> &#8216;<span style="color: #3333ff;">, MONTHNAME(</span> <span style="color: black;">StatusDate</span> <span style="color: #3333ff;">),</span> &#8216; &#8216;<span style="color: #3333ff;">, DAY( </span><span style="color: black;">StatusDate</span> <span style="color: #3333ff;">),</span> <span style="color: black;">TimeOfStatusString</span> <span style="color: #3333ff;">)</span><span style="color: black;">;</span><br /><span style="color: #3333ff;">END IF</span><span style="color: black;">;</span></p>
<p><span style="color: blue;">RETURN</span> Status_Time;<br /><span style="color: blue;">END</span> $$<br /><span style="color: green;">/*!50003 SET SESSION SQL_MODE=@TEMP_SQL_MODE */</span>  $$</p>
<p>DELIMITER ;</p>
</blockquote>
<p>The script works like a charm! My next project on this site is to create a Flash image slideshow where the images can be managed from the backend&#8230;
<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3343170865085826116-3641144383766792913?l=www.technicosolutions.com%2Fblog'/></div>
]]></content:encoded>
			<wfw:commentRss>http://www.technicosolutions.com/2008/08/status-updates-in-mysql/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Web 2.0</title>
		<link>http://www.technicosolutions.com/2008/05/web-2-0/</link>
		<comments>http://www.technicosolutions.com/2008/05/web-2-0/#comments</comments>
		<pubDate>Fri, 09 May 2008 03:44:00 +0000</pubDate>
		<dc:creator>Brandon</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Web Technologies]]></category>

		<guid isPermaLink="false">tag:blogger.com,1999:blog-3343170865085826116.post-4910685162280385994</guid>
		<description><![CDATA[Web 2.0 is a term describing the trend in the use of World Wide Web technology and web design that aims to enhance creativity, information sharing, and, most notably, collaboration among users.  The Web has enhanced productivity and knowledge throughout the civilized world because of the wide-spread availability of information and collaboration over the [...]]]></description>
			<content:encoded><![CDATA[<p>Web 2.0 is a term describing the trend in the use of World Wide Web technology and web design that aims to enhance creativity, information sharing, and, most notably, collaboration among users.  The Web has enhanced productivity and knowledge throughout the civilized world because of the wide-spread availability of information and collaboration over the Internet.  My side business is centered on developing, programming, and designing web applications using Web 2.0 technology.
<div class="blogger-post-footer"><img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3343170865085826116-4910685162280385994?l=www.technicosolutions.com%2Fblog'/></div>
]]></content:encoded>
			<wfw:commentRss>http://www.technicosolutions.com/2008/05/web-2-0/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
