<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>DanielKassner.com</title>
	
	<link>http://www.danielkassner.com</link>
	<description>Random technology, photos and life</description>
	<lastBuildDate>Fri, 30 Jul 2010 13:56:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1-alpha</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/DanielKassner" /><feedburner:info uri="danielkassner" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>A few new photos</title>
		<link>http://feedproxy.google.com/~r/DanielKassner/~3/OaHDDmEVF7c/a-few-new-photos</link>
		<comments>http://www.danielkassner.com/2010/07/26/a-few-new-photos#comments</comments>
		<pubDate>Mon, 26 Jul 2010 23:31:28 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[Photography]]></category>
		<category><![CDATA[Baltimore]]></category>
		<category><![CDATA[Canon 7D]]></category>
		<category><![CDATA[Gettysburg]]></category>
		<category><![CDATA[Traveling]]></category>
		<category><![CDATA[Washington DC]]></category>

		<guid isPermaLink="false">http://www.danielkassner.com/?p=398</guid>
		<description><![CDATA[Here are a few new photos from some trips so far this summer: Pagoda in Patterson Park Baltimore, MD Capitol Building, Washington DC Gettysburg, PA]]></description>
			<content:encoded><![CDATA[<p>Here are a few new photos from some trips so far this summer:</p>
<div class="g2image_centered">
<div class="wpg2tag-image"><a href="http://www.danielkassner.com/photos?g2_itemId=729" title="Pagoda in Patterson Park Baltimore, MD"><img src="http://www.danielkassner.com/gallery/main.php?g2_view=core.DownloadItem&amp;g2_itemId=731&amp;g2_serialNumber=2" width="500" height="334" id="IFid4" class="ImageFrame_none" alt="Pagoda in Patterson Park Baltimore, MD"/></a></div>
</div>
<p>Pagoda in Patterson Park Baltimore, MD</p>
<div class="g2image_centered">
<div class="wpg2tag-image"><a href="http://www.danielkassner.com/photos?g2_itemId=726" title="Capitol Building, Washington DC"><img src="http://www.danielkassner.com/gallery/main.php?g2_view=core.DownloadItem&amp;g2_itemId=728&amp;g2_serialNumber=2" width="386" height="500" id="IFid5" class="ImageFrame_none" alt="Capitol Building, Washington DC"/></a></div>
</div>
<p>Capitol Building, Washington DC</p>
<div class="g2image_centered">
<div class="wpg2tag-image"><a href="http://www.danielkassner.com/photos?g2_itemId=732" title="Gettysburg, PA"><img src="http://www.danielkassner.com/gallery/main.php?g2_view=core.DownloadItem&amp;g2_itemId=734&amp;g2_serialNumber=2" width="500" height="334" id="IFid6" class="ImageFrame_none" alt="Gettysburg, PA"/></a></div>
</div>
<p>Gettysburg, PA</p>

<p><a href="http://feedads.g.doubleclick.net/~a/c9hEqZzdL_h5RbO3_mei6hF9qU0/0/da"><img src="http://feedads.g.doubleclick.net/~a/c9hEqZzdL_h5RbO3_mei6hF9qU0/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/c9hEqZzdL_h5RbO3_mei6hF9qU0/1/da"><img src="http://feedads.g.doubleclick.net/~a/c9hEqZzdL_h5RbO3_mei6hF9qU0/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/DanielKassner/~4/OaHDDmEVF7c" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.danielkassner.com/2010/07/26/a-few-new-photos/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.danielkassner.com/2010/07/26/a-few-new-photos</feedburner:origLink></item>
		<item>
		<title>Uninstall Sophos Anti-Virus get Internal Error 2738</title>
		<link>http://feedproxy.google.com/~r/DanielKassner/~3/EEZ4Q2LokZg/uninstall-sophos-anti-virus-get-internal-error-2738</link>
		<comments>http://www.danielkassner.com/2010/07/21/uninstall-sophos-anti-virus-get-internal-error-2738#comments</comments>
		<pubDate>Wed, 21 Jul 2010 22:00:13 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[Sophos]]></category>
		<category><![CDATA[Windows 7]]></category>

		<guid isPermaLink="false">http://www.danielkassner.com/?p=393</guid>
		<description><![CDATA[Recently I was attempting to uninstall Sophos Anti-Virus from my computer to change which server I get the anti-virus updates from as we are switching which server anti-virus server is run on. I decided that I would uninstall the old version and re-install as this would be the easiest way for me to change settings [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I was attempting to uninstall Sophos Anti-Virus from my computer to change which server I get the anti-virus updates from as we are switching which server anti-virus server is run on. I decided that I would uninstall the old version and re-install as this would be the easiest way for me to change settings that were all grayed out not allowing me to change. I was able to un-install everything except for the Sophos AutoUpdate service as it would error out with an Internal Error 2738. Doing a quick 10 minute Google search found that I should attempt to register the vbscript.dll file. To do this follow the instructions below. Please note I am running Windows 7 32 bit.</p>
<ul>
<li>Click the Start button/pearl</li>
<li>In the Search programs and files box just above Start button do a search for Command. This will bring up the Command Prompt in the search. Right click this and Run as Administrator.</li>
<li>This should open a command prompt window with the default file path of c:\Windows\system32. Type the following in the command prompt then hit enter:<br />
<blockquote><p>regsvr32 vbscript.dll</p></blockquote>
</li>
<li>If success you will see a message that says: &#8220;DllRegisterServer in vbscript.dll succeeded.&#8221;</li>
</ul>
<p>Now that we have done that you can minimize the command prompt and attempt to uninstall the Sophos AutoUpdate client that we could not previously. If you are still getting the error above you will need to continue process below to delete a registry key. I would highly suggest backing up the registry before doing any changes to the registry in case something goes wrong which it shouldn&#8217;t.</p>
<ul>
<li>Bring back up your Administrator Command Prompt</li>
<li>Paste the following into the command prompt and then press enter:<br />
<blockquote><p>reg delete &#8220;HKCU\SOFTWARE\Classes\CLSID\{B54F3741-5B07-11CF-A4B0-00AA004A55E8}&#8221; /f</p></blockquote>
</li>
<li>Once you have deleted the registry key run the regsvr32 vbscript.dll command that we did above</li>
</ul>
<p>Now that we have deleted the registry key and re-registered the vbscript.dll file we should now have success in un-installing Sophos. If you are still having problems with this I highly recommend contacting Sophos support.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/jK0T2lZlyunbRRceGV1PGtVyfaE/0/da"><img src="http://feedads.g.doubleclick.net/~a/jK0T2lZlyunbRRceGV1PGtVyfaE/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/jK0T2lZlyunbRRceGV1PGtVyfaE/1/da"><img src="http://feedads.g.doubleclick.net/~a/jK0T2lZlyunbRRceGV1PGtVyfaE/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/DanielKassner/~4/EEZ4Q2LokZg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.danielkassner.com/2010/07/21/uninstall-sophos-anti-virus-get-internal-error-2738/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.danielkassner.com/2010/07/21/uninstall-sophos-anti-virus-get-internal-error-2738</feedburner:origLink></item>
		<item>
		<title>Feature request for Notepad++ Function List plugin</title>
		<link>http://feedproxy.google.com/~r/DanielKassner/~3/AUO0NUk7ZXU/feature-request-for-notepad-function-list-plugin</link>
		<comments>http://www.danielkassner.com/2010/06/30/feature-request-for-notepad-function-list-plugin#comments</comments>
		<pubDate>Wed, 30 Jun 2010 16:45:56 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[PHP Coding]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Function List]]></category>
		<category><![CDATA[Notepad++]]></category>

		<guid isPermaLink="false">http://www.danielkassner.com/?p=389</guid>
		<description><![CDATA[As the number of visitors continues to increase to my Notepad++ Function List for PHP development post I have frequently been asked if this plugin can do a certain task. This task would be to add multiple rules to one main category. So for instance you have a file that has multiple classes located in [...]]]></description>
			<content:encoded><![CDATA[<p>As the number of visitors continues to increase to my <a href="http://www.danielkassner.com/2010/01/22/using-notepads-function-list-plugin-for-php-development">Notepad++ Function List for PHP development</a> post I have frequently been asked if this plugin can do a certain task. This task would be to add multiple rules to one main category. So for instance you have a file that has multiple classes located in it and each class has its own set of variables and functions. The Function List plugin allows us to parse these out and find them. However, in its current state we can only link one parsing rule to another. </p>
<p>Example:<br />
Current State:<br />
-Classes<br />
&#8211;Training model extends Model<br />
&#8212;Functions<br />
&#8212;-__construct<br />
&#8212;-EventListing<br />
-Class Variables<br />
&#8211;$Month<br />
&#8211;$Day<br />
&#8211;$Year</p>
<p>What we would like:<br />
-Classes<br />
&#8211;Training model extends Model<br />
&#8212;Class Variables<br />
&#8212;-$Month<br />
&#8212;-$Day<br />
&#8212;-$Year<br />
&#8212;Functions<br />
&#8212;-__construct<br />
&#8212;-EventListing</p>
<p>I have sent an email to the creator of the plugin(Jens Lorenz) about asking the possibility of changing the plugin and that correspondence is listed below:</p>
<p>Sent from Me on March 17, 2010 7:57 AM</p>
<blockquote><p>I have used the Function List plugin for Notepad++ for some time now and really enjoy it. My question to you is if it would be possible to add multiple subgroups under one group? For instance I am a PHP developer; I have parsing rules for Classes, Class Variables and Functions. I would love to be able to put Class Variables along with the Functions rules under the classes tree. So instead of having:<br />
-Classes<br />
&#8211;printer extends resources<br />
&#8212;Functions<br />
&#8212;-__construct<br />
&#8212;-sqlInsert<br />
-Class Variables<br />
&#8211;$security<br />
&#8211;$db</p>
<p>I would have:<br />
-Classes<br />
&#8211;printer extends resources<br />
&#8212;Class Variables<br />
&#8212;-$security<br />
&#8212;-$db<br />
&#8212;Functions<br />
&#8212;-__construct<br />
&#8212;-sqlInsert</p>
<p>I have put up a blog posting of what my current FunctionListRules.xml section looks like at: http://www.danielkassner.com/2010/01/22/using-notepads-function-list-plugin-for-php-development</p>
<p>If you have any ideas that would be great. Thanks!</p></blockquote>
<p>Sent by Jens Lorenz on March 18, 2010 at 3:27 AM</p>
<blockquote><p>Hello Daniel,</p>
<p>currently it isn&#8217;t possible. Only one level of subgrouping is possible at the moment.</p>
<p>Best Regards<br />
Jens</p></blockquote>
<p>Sent by me on March 18, 2010 at 7:41 AM</p>
<blockquote><p>Do you think that this desired functionality will or could be added to a future release? I am sure that it will take some time to accomplish but it would be nice.</p>
<p>Thank you for the quick response.</p></blockquote>
<p>I did not get a response back from that last email. I wish that I knew more about C++ to modify and send the changes I would make to him for everyone else to enjoy. I am sure he is a busy man just like me which is why I probably did not get a response back.</p>
<p>If you would like to see this feature potentially get added please contact him via email and or post comment here on this posting. You can find his email by opening Notepad++, selecting the Plugins > Function List > Help menu item. </p>

<p><a href="http://feedads.g.doubleclick.net/~a/CxAVqgcrp-S8dHiUjDYRbZhP5ZQ/0/da"><img src="http://feedads.g.doubleclick.net/~a/CxAVqgcrp-S8dHiUjDYRbZhP5ZQ/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/CxAVqgcrp-S8dHiUjDYRbZhP5ZQ/1/da"><img src="http://feedads.g.doubleclick.net/~a/CxAVqgcrp-S8dHiUjDYRbZhP5ZQ/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/DanielKassner/~4/AUO0NUk7ZXU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.danielkassner.com/2010/06/30/feature-request-for-notepad-function-list-plugin/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.danielkassner.com/2010/06/30/feature-request-for-notepad-function-list-plugin</feedburner:origLink></item>
		<item>
		<title>Disable web browser tab previews in Windows 7</title>
		<link>http://feedproxy.google.com/~r/DanielKassner/~3/_5m15TvIuzw/disable-web-browser-tab-previews-in-windows-7</link>
		<comments>http://www.danielkassner.com/2010/06/24/disable-web-browser-tab-previews-in-windows-7#comments</comments>
		<pubDate>Thu, 24 Jun 2010 21:30:12 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[Opera]]></category>
		<category><![CDATA[Web Browser]]></category>
		<category><![CDATA[Windows 7]]></category>

		<guid isPermaLink="false">http://www.danielkassner.com/?p=381</guid>
		<description><![CDATA[Recently I upgraded my work machine from Windows Vista to Windows 7. While learning the new features of 7 I found that Aero likes to show tab previews of each tab I have open in Firefox, Internet Explorer and Opera. I am the kind of guy that keeps multiple tabs open almost all day long [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I upgraded my work machine from Windows Vista to Windows 7. While learning the new features of 7 I found that Aero likes to show tab previews of each tab I have open in Firefox, Internet Explorer and Opera. I am the kind of guy that keeps multiple tabs open almost all day long looking up items, coding, &#8230; the list could go on so I found this &#8220;feature&#8221; a pain. As you can see in the below image that I have multiple websites open but you cannot tell if it is multiple windows or multiple tabs.</p>
<div class="g2image_centered">
<div class="wpg2tag-image"><a href="http://www.danielkassner.com/photos?g2_itemId=696" title="Firefox1"><img src="http://www.danielkassner.com/gallery/main.php?g2_view=core.DownloadItem&amp;g2_itemId=696&amp;g2_serialNumber=1" width="500" height="151" id="IFid16" class="ImageFrame_none" alt="Firefox1"/></a></div>
</div>
<p>Now with the picture below you can easily see I have only one window open but four tabs.</p>
<div class="g2image_centered">
<div class="wpg2tag-image"><a href="http://www.danielkassner.com/photos?g2_itemId=700" title="Firefox2"><img src="http://www.danielkassner.com/gallery/main.php?g2_view=core.DownloadItem&amp;g2_itemId=700&amp;g2_serialNumber=1" width="500" height="175" id="IFid17" class="ImageFrame_none" alt="Firefox2"/></a></div>
</div>
<p>To disable tab previews in Firefox you need to do the following:</p>
<ul>
<li>Open the about:config page in a new tab or window</li>
<li>Filter for: browser.taskbar.previews.enable</li>
<li>By default this is set to true so double click on the true to swap the value to false</li>
<li>Your done!</li>
</ul>
<p>Now for Internet Explorer you have to open the the Internet Options. You will do this by opening Internet Explorer and in the toolbar look for the Tools icon which looks like a gear and then select Internet Options at the very bottom.</p>
<div class="g2image_centered">
<div class="wpg2tag-image"><a href="http://www.danielkassner.com/photos?g2_itemId=702" title="IE0"><img src="http://www.danielkassner.com/gallery/main.php?g2_view=core.DownloadItem&amp;g2_itemId=702&amp;g2_serialNumber=1" width="278" height="394" id="IFid18" class="ImageFrame_none" alt="IE0"/></a></div>
</div>
<p>Once in the Internet Options click on the Settings button in the Tabs section.</p>
<div class="g2image_centered">
<div class="wpg2tag-image"><a href="http://www.danielkassner.com/photos?g2_itemId=704" title="IE1"><img src="http://www.danielkassner.com/gallery/main.php?g2_view=core.DownloadItem&amp;g2_itemId=704&amp;g2_serialNumber=1" width="391" height="500" id="IFid19" class="ImageFrame_none" alt="IE1"/></a></div>
</div>
<p>Once in the Tabbed Browsing Settings un-check the option that says: Show previews for individual tabs in the taskbar*, then click OK on all the open windows and close out of Internet Explorer.</p>
<div class="g2image_centered">
<div class="wpg2tag-image"><a href="http://www.danielkassner.com/photos?g2_itemId=706" title="IE2"><img src="http://www.danielkassner.com/gallery/main.php?g2_view=core.DownloadItem&amp;g2_itemId=706&amp;g2_serialNumber=1" width="391" height="464" id="IFid20" class="ImageFrame_none" alt="IE2"/></a></div>
</div>
<p>Now for Opera we have to open the opera:config page in a new tab or window.</p>
<div class="g2image_centered">
<div class="wpg2tag-image"><a href="http://www.danielkassner.com/photos?g2_itemId=708" title="Opera1"><img src="http://www.danielkassner.com/gallery/main.php?g2_view=core.DownloadItem&amp;g2_itemId=708&amp;g2_serialNumber=1" width="469" height="86" id="IFid21" class="ImageFrame_none" alt="Opera1"/></a></div>
</div>
<p>Scroll down to a section titled User Prefs and expand this section.</p>
<div class="g2image_centered">
<div class="wpg2tag-image"><a href="http://www.danielkassner.com/photos?g2_itemId=710" title="Opera2"><img src="http://www.danielkassner.com/gallery/main.php?g2_view=core.DownloadItem&amp;g2_itemId=710&amp;g2_serialNumber=1" width="295" height="188" id="IFid22" class="ImageFrame_none" alt="Opera2"/></a></div>
</div>
<p>Scroll down towards the bottom of the User Prefs section and un-check the check box: &#8220;Use Windows 7 Taskbar Thumbnails&#8221;</p>
<div class="g2image_centered">
<div class="wpg2tag-image"><a href="http://www.danielkassner.com/photos?g2_itemId=712" title="Opera3"><img src="http://www.danielkassner.com/gallery/main.php?g2_view=core.DownloadItem&amp;g2_itemId=712&amp;g2_serialNumber=1" width="500" height="203" id="IFid23" class="ImageFrame_none" alt="Opera3"/></a></div>
</div>
<p>Once you have unchecked this box scroll down to the bottom of the User Prefs section and click the save button. You will eventually be presented with the following dialog box once complete.</p>
<div class="g2image_centered">
<div class="wpg2tag-image"><a href="http://www.danielkassner.com/photos?g2_itemId=714" title="Opera4"><img src="http://www.danielkassner.com/gallery/main.php?g2_view=core.DownloadItem&amp;g2_itemId=714&amp;g2_serialNumber=1" width="389" height="205" id="IFid24" class="ImageFrame_none" alt="Opera4"/></a></div>
</div>
<p>That is how you disable tab previews in Windows 7 for popular browsers.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/ALcN5oz3Aa-1dI4MHjOI03PZP3Y/0/da"><img src="http://feedads.g.doubleclick.net/~a/ALcN5oz3Aa-1dI4MHjOI03PZP3Y/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/ALcN5oz3Aa-1dI4MHjOI03PZP3Y/1/da"><img src="http://feedads.g.doubleclick.net/~a/ALcN5oz3Aa-1dI4MHjOI03PZP3Y/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/DanielKassner/~4/_5m15TvIuzw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.danielkassner.com/2010/06/24/disable-web-browser-tab-previews-in-windows-7/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.danielkassner.com/2010/06/24/disable-web-browser-tab-previews-in-windows-7</feedburner:origLink></item>
		<item>
		<title>Get user operating system with PHP</title>
		<link>http://feedproxy.google.com/~r/DanielKassner/~3/EhGHgkIFLbQ/get-user-operating-system-with-php</link>
		<comments>http://www.danielkassner.com/2010/06/11/get-user-operating-system-with-php#comments</comments>
		<pubDate>Fri, 11 Jun 2010 16:30:04 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[PHP Coding]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.danielkassner.com/?p=377</guid>
		<description><![CDATA[Ever wanted to find out what operating system your visitors are using? The following function will allow you to get the user operating system so you can use in a statistics application or show certain content on your website. This will allow server side decisions on what stylesheets to show or any other operating system [...]]]></description>
			<content:encoded><![CDATA[<p>Ever wanted to find out what operating system your visitors are using? The following function will allow you to get the user operating system so you can use in a statistics application or show certain content on your website. This will allow server side decisions on what stylesheets to show or any other operating system specific content to be shown/hide. </p>
<div class="hl-surround" style="height:280px;"><div class="hl-main"><pre><span class="hl-inlinetags">&lt;?php
</span><span class="hl-reserved">function </span><span class="hl-identifier">getOS</span><span class="hl-brackets">(</span><span class="hl-var">$userAgent</span><span class="hl-brackets">) {
  </span><span class="hl-comment">// Create list of operating systems with operating system name as array key 
	</span><span class="hl-var">$oses</span><span class="hl-code"> = </span><span class="hl-reserved">array </span><span class="hl-brackets">(
		</span><span class="hl-quotes">'</span><span class="hl-string">iPhone</span><span class="hl-quotes">'</span><span class="hl-code"> =&gt; </span><span class="hl-quotes">'</span><span class="hl-string">(iPhone)</span><span class="hl-quotes">'</span><span class="hl-code">,
		</span><span class="hl-quotes">'</span><span class="hl-string">Windows 3.11</span><span class="hl-quotes">'</span><span class="hl-code"> =&gt; </span><span class="hl-quotes">'</span><span class="hl-string">Win16</span><span class="hl-quotes">'</span><span class="hl-code">,
		</span><span class="hl-quotes">'</span><span class="hl-string">Windows 95</span><span class="hl-quotes">'</span><span class="hl-code"> =&gt; </span><span class="hl-quotes">'</span><span class="hl-string">(Windows 95)|(Win95)|(Windows_95)</span><span class="hl-quotes">'</span><span class="hl-code">, </span><span class="hl-comment">// Use regular expressions as value to identify operating system
		</span><span class="hl-quotes">'</span><span class="hl-string">Windows 98</span><span class="hl-quotes">'</span><span class="hl-code"> =&gt; </span><span class="hl-quotes">'</span><span class="hl-string">(Windows 98)|(Win98)</span><span class="hl-quotes">'</span><span class="hl-code">,
		</span><span class="hl-quotes">'</span><span class="hl-string">Windows 2000</span><span class="hl-quotes">'</span><span class="hl-code"> =&gt; </span><span class="hl-quotes">'</span><span class="hl-string">(Windows NT 5.0)|(Windows 2000)</span><span class="hl-quotes">'</span><span class="hl-code">,
		</span><span class="hl-quotes">'</span><span class="hl-string">Windows XP</span><span class="hl-quotes">'</span><span class="hl-code"> =&gt; </span><span class="hl-quotes">'</span><span class="hl-string">(Windows NT 5.1)|(Windows XP)</span><span class="hl-quotes">'</span><span class="hl-code">,
		</span><span class="hl-quotes">'</span><span class="hl-string">Windows 2003</span><span class="hl-quotes">'</span><span class="hl-code"> =&gt; </span><span class="hl-quotes">'</span><span class="hl-string">(Windows NT 5.2)</span><span class="hl-quotes">'</span><span class="hl-code">,
		</span><span class="hl-quotes">'</span><span class="hl-string">Windows Vista</span><span class="hl-quotes">'</span><span class="hl-code"> =&gt; </span><span class="hl-quotes">'</span><span class="hl-string">(Windows NT 6.0)|(Windows Vista)</span><span class="hl-quotes">'</span><span class="hl-code">,
		</span><span class="hl-quotes">'</span><span class="hl-string">Windows 7</span><span class="hl-quotes">'</span><span class="hl-code"> =&gt; </span><span class="hl-quotes">'</span><span class="hl-string">(Windows NT 6.1)|(Windows 7)</span><span class="hl-quotes">'</span><span class="hl-code">,
		</span><span class="hl-quotes">'</span><span class="hl-string">Windows NT 4.0</span><span class="hl-quotes">'</span><span class="hl-code"> =&gt; </span><span class="hl-quotes">'</span><span class="hl-string">(Windows NT 4.0)|(WinNT4.0)|(WinNT)|(Windows NT)</span><span class="hl-quotes">'</span><span class="hl-code">,
		</span><span class="hl-quotes">'</span><span class="hl-string">Windows ME</span><span class="hl-quotes">'</span><span class="hl-code"> =&gt; </span><span class="hl-quotes">'</span><span class="hl-string">Windows ME</span><span class="hl-quotes">'</span><span class="hl-code">,
		</span><span class="hl-quotes">'</span><span class="hl-string">Open BSD</span><span class="hl-quotes">'</span><span class="hl-code">=&gt;</span><span class="hl-quotes">'</span><span class="hl-string">OpenBSD</span><span class="hl-quotes">'</span><span class="hl-code">,
		</span><span class="hl-quotes">'</span><span class="hl-string">Sun OS</span><span class="hl-quotes">'</span><span class="hl-code">=&gt;</span><span class="hl-quotes">'</span><span class="hl-string">SunOS</span><span class="hl-quotes">'</span><span class="hl-code">,
		</span><span class="hl-quotes">'</span><span class="hl-string">Linux</span><span class="hl-quotes">'</span><span class="hl-code">=&gt;</span><span class="hl-quotes">'</span><span class="hl-string">(Linux)|(X11)</span><span class="hl-quotes">'</span><span class="hl-code">,
		</span><span class="hl-quotes">'</span><span class="hl-string">Safari</span><span class="hl-quotes">'</span><span class="hl-code"> =&gt; </span><span class="hl-quotes">'</span><span class="hl-string">(Safari)</span><span class="hl-quotes">'</span><span class="hl-code">,
		</span><span class="hl-quotes">'</span><span class="hl-string">Macintosh</span><span class="hl-quotes">'</span><span class="hl-code">=&gt;</span><span class="hl-quotes">'</span><span class="hl-string">(Mac_PowerPC)|(Macintosh)</span><span class="hl-quotes">'</span><span class="hl-code">,
		</span><span class="hl-quotes">'</span><span class="hl-string">QNX</span><span class="hl-quotes">'</span><span class="hl-code">=&gt;</span><span class="hl-quotes">'</span><span class="hl-string">QNX</span><span class="hl-quotes">'</span><span class="hl-code">,
		</span><span class="hl-quotes">'</span><span class="hl-string">BeOS</span><span class="hl-quotes">'</span><span class="hl-code">=&gt;</span><span class="hl-quotes">'</span><span class="hl-string">BeOS</span><span class="hl-quotes">'</span><span class="hl-code">,
		</span><span class="hl-quotes">'</span><span class="hl-string">OS/2</span><span class="hl-quotes">'</span><span class="hl-code">=&gt;</span><span class="hl-quotes">'</span><span class="hl-string">OS/2</span><span class="hl-quotes">'</span><span class="hl-code">,
		</span><span class="hl-quotes">'</span><span class="hl-string">Search Bot</span><span class="hl-quotes">'</span><span class="hl-code">=&gt;</span><span class="hl-quotes">'</span><span class="hl-string">(nuhk)|(Googlebot)|(Yammybot)|(Openbot)|(Slurp/cat)|(msnbot)|(ia_archiver)</span><span class="hl-quotes">'
	</span><span class="hl-brackets">)</span><span class="hl-code">;

	</span><span class="hl-reserved">foreach</span><span class="hl-brackets">(</span><span class="hl-var">$oses </span><span class="hl-reserved">as </span><span class="hl-var">$os</span><span class="hl-code">=&gt;</span><span class="hl-var">$pattern</span><span class="hl-brackets">){ </span><span class="hl-comment">// Loop through $oses array
    // Use regular expressions to check operating system type
		</span><span class="hl-reserved">if</span><span class="hl-brackets">(</span><span class="hl-identifier">eregi</span><span class="hl-brackets">(</span><span class="hl-var">$pattern</span><span class="hl-code">, </span><span class="hl-var">$userAgent</span><span class="hl-brackets">)) { </span><span class="hl-comment">// Check if a value in $oses array matches current user agent.
			</span><span class="hl-reserved">return </span><span class="hl-var">$os</span><span class="hl-code">; </span><span class="hl-comment">// Operating system was matched so return $oses key
		</span><span class="hl-brackets">}
	}
	</span><span class="hl-reserved">return </span><span class="hl-quotes">'</span><span class="hl-string">Unknown</span><span class="hl-quotes">'</span><span class="hl-code">; </span><span class="hl-comment">// Cannot find operating system so return Unknown
</span><span class="hl-brackets">}
</span><span class="hl-inlinetags">?&gt;</span></pre></div></div>
<p>An example of how this would be used:</p>
<div class="hl-surround" ><div class="hl-main"><pre><span class="hl-inlinetags">&lt;?php
</span><span class="hl-reserved">echo </span><span class="hl-identifier">getOS</span><span class="hl-brackets">(</span><span class="hl-var">$_SERVER</span><span class="hl-brackets">[</span><span class="hl-quotes">'</span><span class="hl-string">HTTP_USER_AGENT</span><span class="hl-quotes">'</span><span class="hl-brackets">])</span><span class="hl-code">;
</span><span class="hl-inlinetags">?&gt;</span></pre></div></div>
<p>This script can be used with the <a href="http://www.danielkassner.com/2010/06/01/get-browser-type">Get Browser Type</a>, which also has the same structure as this script.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/fu9meqCw8nq5CK8G8ijpsVnstg0/0/da"><img src="http://feedads.g.doubleclick.net/~a/fu9meqCw8nq5CK8G8ijpsVnstg0/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/fu9meqCw8nq5CK8G8ijpsVnstg0/1/da"><img src="http://feedads.g.doubleclick.net/~a/fu9meqCw8nq5CK8G8ijpsVnstg0/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/DanielKassner/~4/EhGHgkIFLbQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.danielkassner.com/2010/06/11/get-user-operating-system-with-php/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.danielkassner.com/2010/06/11/get-user-operating-system-with-php</feedburner:origLink></item>
		<item>
		<title>Change outgoing BlackBerry PIN message sender email address</title>
		<link>http://feedproxy.google.com/~r/DanielKassner/~3/MvV99tMnkbs/change-outgoing-blackberry-pin-message-sender-email-address</link>
		<comments>http://www.danielkassner.com/2010/06/09/change-outgoing-blackberry-pin-message-sender-email-address#comments</comments>
		<pubDate>Wed, 09 Jun 2010 16:45:04 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[Cell Phones]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[BlackBerry]]></category>
		<category><![CDATA[Email]]></category>

		<guid isPermaLink="false">http://www.danielkassner.com/?p=367</guid>
		<description><![CDATA[At the organization I work for we have a BlackBerry server setup with around 30 users. Works great for those employees that don&#8217;t get computer access but still need access to get emails to stay up to date on daily schedules and patient care. However when there is a problem that affects email on the [...]]]></description>
			<content:encoded><![CDATA[<p>At the organization I work for we have a BlackBerry server setup with around 30 users. Works great for those employees that don&#8217;t get computer access but still need access to get emails to stay up to date on daily schedules and patient care. However when there is a problem that affects email on the devices it is best to notify those staff there is an issue or that the issue has been resolved. This is where using PIN messaging comes in very handy. This last time I had a device in my hand and I noticed that the email address on the PIN message was from admin@yourcompanydomain.com instead of something related to our organization. Below I will show you how to change this so that your outgoing PIN messages have an email address that actually correlates with your own business.</p>
<p>* I am doing these processes on BlackBerry Server 5 and not 4. The process for 4 will be different as it is not a browser based management.</p>
<ul>
<li>Open your BlackBerry Administration Service page and log in.</li>
<li>Navigate to the Devices > Wireless activations > Device activation settings
<div class="g2image_centered">
<a href="http://www.danielkassner.com/photos?g2_itemId=689"><img src="http://www.danielkassner.com/gallery/main.php?g2_view=core.DownloadItem&#038;g2_itemId=689&#038;g2_GALLERYSID=a4b14865f3c4643fc0a226a3fc04367d"  alt="BlackBerry Device Activation Settings" title="BlackBerry Device Activation Settings" class="g2image_centered" /></a></div>
</li>
<li>You will notice at the top of this page there is a Email initialization message section with the Sender address by default as: admin@yourcompanydomain.com. Select the Edit activation settings button to change this</li>
<li>Change the Sender address field to an actual email of your company and then select Save all
<div class="g2image_centered"><a href="http://www.danielkassner.com/photos?g2_itemId=692"><img src="http://www.danielkassner.com/gallery/main.php?g2_view=core.DownloadItem&#038;g2_itemId=692&#038;g2_GALLERYSID=a4b14865f3c4643fc0a226a3fc04367d"  alt="BlackBerry Email Initialization Message Settings" title="BlackBerry Email Initialization Message Settings" class="g2image_centered" /></a></div>
</li>
</ul>
<p>Once you have changed this all of your outgoing PIN messages will have the new email address as the sender name.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/XfIk9_e5LtjK12nR9Q4c0XsDupY/0/da"><img src="http://feedads.g.doubleclick.net/~a/XfIk9_e5LtjK12nR9Q4c0XsDupY/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/XfIk9_e5LtjK12nR9Q4c0XsDupY/1/da"><img src="http://feedads.g.doubleclick.net/~a/XfIk9_e5LtjK12nR9Q4c0XsDupY/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/DanielKassner/~4/MvV99tMnkbs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.danielkassner.com/2010/06/09/change-outgoing-blackberry-pin-message-sender-email-address/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.danielkassner.com/2010/06/09/change-outgoing-blackberry-pin-message-sender-email-address</feedburner:origLink></item>
		<item>
		<title>Prevent direct file access</title>
		<link>http://feedproxy.google.com/~r/DanielKassner/~3/18V6DyhXVnk/prevent-direct-file-access</link>
		<comments>http://www.danielkassner.com/2010/06/04/prevent-direct-file-access#comments</comments>
		<pubDate>Fri, 04 Jun 2010 17:01:55 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[PHP Coding]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.danielkassner.com/?p=362</guid>
		<description><![CDATA[Do you have PHP files that you do not want visitors to directly run but would still like to use them in your code? Here is a little trick picked up from the code in the phpBB forum code. Create a file named config.php or some other file that you are going to include before [...]]]></description>
			<content:encoded><![CDATA[<p>Do you have PHP files that you do not want visitors to directly run but would still like to use them in your code? Here is a little trick picked up from the code in the phpBB forum code.</p>
<p>Create a file named config.php or some other file that you are going to include before any other code. In this file put the following:</p>
<div class="hl-surround" ><div class="hl-main"><pre><span class="hl-inlinetags">&lt;?php
</span><span class="hl-reserved">define</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">INMYSCRIPT</span><span class="hl-quotes">'</span><span class="hl-code">, </span><span class="hl-number">1</span><span class="hl-brackets">)</span><span class="hl-code">;
</span><span class="hl-inlinetags">?&gt;</span></pre></div></div>
<p>This code creates a defined variable INMYSCRIPT which can be named as anything that you want. Then on every other page in your script that you do not want to be ran on their own put the following: (This filename is code.php)</p>
<div class="hl-surround" ><div class="hl-main"><pre><span class="hl-inlinetags">&lt;?php
</span><span class="hl-reserved">if</span><span class="hl-brackets">(</span><span class="hl-code">!</span><span class="hl-identifier">defined</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">INMYSCRIPT</span><span class="hl-quotes">'</span><span class="hl-brackets">)){
</span><span class="hl-reserved">echo </span><span class="hl-quotes">'</span><span class="hl-string">You cannot access this file directly.</span><span class="hl-quotes">'</span><span class="hl-code">;
</span><span class="hl-reserved">die</span><span class="hl-code">;
</span><span class="hl-brackets">}

</span><span class="hl-comment">// Whatever other code you wish goes below here
</span><span class="hl-reserved">echo </span><span class="hl-quotes">'</span><span class="hl-string">This file is safe to be ran</span><span class="hl-quotes">'</span><span class="hl-code">;
</span><span class="hl-inlinetags">?&gt;</span></pre></div></div>
<p>Now, instead of the file outputting any data to the browser that could be harmful, the only content output is: &#8220;You cannot access this file directly&#8221;. You could very easily create a re-direct script to transfer them to a specific page or you could modify the text to any other HTML or other content you wanted. </p>
<p>Open up your web browser and try accessing code.php. You should get that error message that we created. Now if you create one last file that we will name as test.php, place the following:</p>
<div class="hl-surround" ><div class="hl-main"><pre><span class="hl-inlinetags">&lt;?php
</span><span class="hl-reserved">require</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">config.php</span><span class="hl-quotes">'</span><span class="hl-brackets">)</span><span class="hl-code">;
</span><span class="hl-reserved">require</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">code.php</span><span class="hl-quotes">'</span><span class="hl-brackets">)</span><span class="hl-code">;
</span><span class="hl-inlinetags">?&gt;</span></pre></div></div>
<p>Now if you try accessing the test.php file from your web server you will be shown: &#8220;This file is safe to be ran&#8221;.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/rmkBbGhzXa5D0hF86jH_ehBBPYc/0/da"><img src="http://feedads.g.doubleclick.net/~a/rmkBbGhzXa5D0hF86jH_ehBBPYc/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/rmkBbGhzXa5D0hF86jH_ehBBPYc/1/da"><img src="http://feedads.g.doubleclick.net/~a/rmkBbGhzXa5D0hF86jH_ehBBPYc/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/DanielKassner/~4/18V6DyhXVnk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.danielkassner.com/2010/06/04/prevent-direct-file-access/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.danielkassner.com/2010/06/04/prevent-direct-file-access</feedburner:origLink></item>
		<item>
		<title>Calculate a percentage</title>
		<link>http://feedproxy.google.com/~r/DanielKassner/~3/HtH33ayST6g/calculate-a-percentage</link>
		<comments>http://www.danielkassner.com/2010/06/04/calculate-a-percentage#comments</comments>
		<pubDate>Fri, 04 Jun 2010 16:30:13 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[PHP Coding]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Math]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.danielkassner.com/?p=358</guid>
		<description><![CDATA[Below is a quick function that simplifies the process of calculating a percentage in PHP. &#60;?php function percent($Amount = 0, $Total = 0, $Decimal = 0) { // Make sure our numbers are actually numbers $Amount = (INT) $Amount; $Total = (INT) $Total; $Decimal = (INT) $Decimal; // Cannot divide by zero so check if [...]]]></description>
			<content:encoded><![CDATA[<p>Below is a quick function that simplifies the process of calculating a percentage in PHP.</p>
<div class="hl-surround" ><div class="hl-main"><pre><span class="hl-inlinetags">&lt;?php
</span><span class="hl-reserved">function </span><span class="hl-identifier">percent</span><span class="hl-brackets">(</span><span class="hl-var">$Amount</span><span class="hl-code"> = </span><span class="hl-number">0</span><span class="hl-code">, </span><span class="hl-var">$Total</span><span class="hl-code"> = </span><span class="hl-number">0</span><span class="hl-code">, </span><span class="hl-var">$Decimal</span><span class="hl-code"> = </span><span class="hl-number">0</span><span class="hl-brackets">) {
	</span><span class="hl-comment">// Make sure our numbers are actually numbers
	</span><span class="hl-var">$Amount</span><span class="hl-code"> = </span><span class="hl-brackets">(</span><span class="hl-identifier">INT</span><span class="hl-brackets">) </span><span class="hl-var">$Amount</span><span class="hl-code">;
	</span><span class="hl-var">$Total</span><span class="hl-code"> = </span><span class="hl-brackets">(</span><span class="hl-identifier">INT</span><span class="hl-brackets">) </span><span class="hl-var">$Total</span><span class="hl-code">;
	</span><span class="hl-var">$Decimal</span><span class="hl-code"> = </span><span class="hl-brackets">(</span><span class="hl-identifier">INT</span><span class="hl-brackets">) </span><span class="hl-var">$Decimal</span><span class="hl-code">;
	</span><span class="hl-comment">// Cannot divide by zero so check if Total = 0
	</span><span class="hl-reserved">if </span><span class="hl-brackets">(</span><span class="hl-var">$Total</span><span class="hl-code"> === </span><span class="hl-number">0</span><span class="hl-brackets">) {
		</span><span class="hl-reserved">return </span><span class="hl-number">0</span><span class="hl-code">;
	</span><span class="hl-brackets">}
	</span><span class="hl-var">$p</span><span class="hl-code"> = </span><span class="hl-var">$Amount</span><span class="hl-code"> / </span><span class="hl-var">$Total</span><span class="hl-code">;
	</span><span class="hl-comment">// Multiply by 100 to move decimal point to correct location
	</span><span class="hl-var">$p</span><span class="hl-code"> *= </span><span class="hl-number">100</span><span class="hl-code">;
	</span><span class="hl-comment">// Return the percentage with specified decimal places
	</span><span class="hl-reserved">return </span><span class="hl-identifier">number_format</span><span class="hl-brackets">(</span><span class="hl-var">$p</span><span class="hl-code">, </span><span class="hl-var">$Decimal</span><span class="hl-brackets">)</span><span class="hl-code">;
</span><span class="hl-brackets">}
</span><span class="hl-inlinetags">?&gt;</span></pre></div></div>
<p>Then to use this code you can do:</p>
<div class="hl-surround" ><div class="hl-main"><pre><span class="hl-inlinetags">&lt;?php
</span><span class="hl-comment">// prints out 10% on the screen
</span><span class="hl-reserved">echo </span><span class="hl-identifier">percent</span><span class="hl-brackets">(</span><span class="hl-number">10</span><span class="hl-code">, </span><span class="hl-number">100</span><span class="hl-brackets">)</span><span class="hl-code">,</span><span class="hl-quotes">'</span><span class="hl-string">%</span><span class="hl-quotes">'</span><span class="hl-code">;
</span><span class="hl-inlinetags">?&gt;</span></pre></div></div>

<p><a href="http://feedads.g.doubleclick.net/~a/GaO0YP1jbTk8TNoGTRr5KV3G2PY/0/da"><img src="http://feedads.g.doubleclick.net/~a/GaO0YP1jbTk8TNoGTRr5KV3G2PY/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/GaO0YP1jbTk8TNoGTRr5KV3G2PY/1/da"><img src="http://feedads.g.doubleclick.net/~a/GaO0YP1jbTk8TNoGTRr5KV3G2PY/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/DanielKassner/~4/HtH33ayST6g" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.danielkassner.com/2010/06/04/calculate-a-percentage/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.danielkassner.com/2010/06/04/calculate-a-percentage</feedburner:origLink></item>
		<item>
		<title>Trip up the Blue Star Highway in Michigan</title>
		<link>http://feedproxy.google.com/~r/DanielKassner/~3/09w1Cre8zZU/trip-up-the-blue-star-highway-in-michigan</link>
		<comments>http://www.danielkassner.com/2010/06/02/trip-up-the-blue-star-highway-in-michigan#comments</comments>
		<pubDate>Thu, 03 Jun 2010 03:25:34 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[Photography]]></category>
		<category><![CDATA[Transportation]]></category>
		<category><![CDATA[Canon 7D]]></category>
		<category><![CDATA[Google Map]]></category>
		<category><![CDATA[Michigan]]></category>
		<category><![CDATA[Suzuki]]></category>
		<category><![CDATA[SV650]]></category>

		<guid isPermaLink="false">http://www.danielkassner.com/?p=352</guid>
		<description><![CDATA[Back on May 22 I took a nice trip up the Blue Star Highway in Michigan. The section I was riding was from Hagar Shore Rd (Exit 7 on US 31/196) north of Benton Harbor to Glenn Michigan. I just had to stop and take a few shots with the Canon 7D I was carrying [...]]]></description>
			<content:encoded><![CDATA[<p>Back on May 22 I took a nice trip up the Blue Star Highway in Michigan. The section I was riding was from Hagar Shore Rd (Exit 7 on US 31/196) north of Benton Harbor to Glenn Michigan. I just had to stop and take a few shots with the Canon 7D I was carrying in my backpack. As you can tell from the photos it was kind of foggy and it was a bit chilly but a great escape for a ride.</p>
<div class="g2image_centered">
<div class="wpg2tag-image"><a href="http://www.danielkassner.com/photos?g2_itemId=681" title="Blue Star Highway, Michigan"><img src="http://www.danielkassner.com/gallery/main.php?g2_view=core.DownloadItem&amp;g2_itemId=683&amp;g2_serialNumber=2" width="500" height="334" id="IFid27" class="ImageFrame_none" alt="Blue Star Highway, Michigan"/></a></div>
</div>
<div class="g2image_centered">
<div class="wpg2tag-image"><a href="http://www.danielkassner.com/photos?g2_itemId=684" title="Blue Star Highway, Michigan"><img src="http://www.danielkassner.com/gallery/main.php?g2_view=core.DownloadItem&amp;g2_itemId=686&amp;g2_serialNumber=2" width="500" height="334" id="IFid28" class="ImageFrame_none" alt="Blue Star Highway, Michigan"/></a></div>
</div>
<div class="g2image_centered">
<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=d&amp;source=s_d&amp;saddr=MI-63+N&amp;daddr=42.281437,-86.328249+to:5+Star+Hwy%2FBlue+Star+Hwy+to:Ruggles+Rd+to:Blue+Star+Hwy+to:Blue+Star+Hwy+to:Co+Rd+2%2FOld+U.S.+31+N+to:Adams+Rd%2FCo+Rd+2%2FOld+U.S.+31+S+to:Adams+Rd%2FCo+Rd+2%2FOld+U.S.+31+N+to:Co+Rd+2%2FOld+U.S.+31+N&amp;hl=en&amp;geocode=FdhfhAId7Bva-g%3B%3BFVI6hgId9VHb-g%3BFUWhhgId2oTb-g%3BFWTqhgIdlsrb-g%3BFYgMhwId5srb-g%3BFY7ihwIdfPjb-g%3BFQYuiAIdUvrb-g%3BFd-RiAIdREDc-g%3BFSj3iAIdDGjc-g&amp;mra=dpe&amp;mrcr=0&amp;mrsp=1&amp;sz=14&amp;via=1,2,3,4,5,6,7,8&amp;sll=42.28042,-86.309023&amp;sspn=0.055057,0.111494&amp;ie=UTF8&amp;ll=42.28042,-86.309023&amp;spn=0.055057,0.111494&amp;t=h&amp;output=embed"></iframe><br /><small><a href="http://maps.google.com/maps?f=d&amp;source=embed&amp;saddr=MI-63+N&amp;daddr=42.281437,-86.328249+to:5+Star+Hwy%2FBlue+Star+Hwy+to:Ruggles+Rd+to:Blue+Star+Hwy+to:Blue+Star+Hwy+to:Co+Rd+2%2FOld+U.S.+31+N+to:Adams+Rd%2FCo+Rd+2%2FOld+U.S.+31+S+to:Adams+Rd%2FCo+Rd+2%2FOld+U.S.+31+N+to:Co+Rd+2%2FOld+U.S.+31+N&amp;hl=en&amp;geocode=FdhfhAId7Bva-g%3B%3BFVI6hgId9VHb-g%3BFUWhhgId2oTb-g%3BFWTqhgIdlsrb-g%3BFYgMhwId5srb-g%3BFY7ihwIdfPjb-g%3BFQYuiAIdUvrb-g%3BFd-RiAIdREDc-g%3BFSj3iAIdDGjc-g&amp;mra=dpe&amp;mrcr=0&amp;mrsp=1&amp;sz=14&amp;via=1,2,3,4,5,6,7,8&amp;sll=42.28042,-86.309023&amp;sspn=0.055057,0.111494&amp;ie=UTF8&amp;ll=42.28042,-86.309023&amp;spn=0.055057,0.111494&amp;t=h" style="color:#0000FF;text-align:left">View Larger Map</a></small>
</div>

<p><a href="http://feedads.g.doubleclick.net/~a/ACUjwlmCEcfuTz2EyuBt4DR0Ocs/0/da"><img src="http://feedads.g.doubleclick.net/~a/ACUjwlmCEcfuTz2EyuBt4DR0Ocs/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/ACUjwlmCEcfuTz2EyuBt4DR0Ocs/1/da"><img src="http://feedads.g.doubleclick.net/~a/ACUjwlmCEcfuTz2EyuBt4DR0Ocs/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/DanielKassner/~4/09w1Cre8zZU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.danielkassner.com/2010/06/02/trip-up-the-blue-star-highway-in-michigan/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.danielkassner.com/2010/06/02/trip-up-the-blue-star-highway-in-michigan</feedburner:origLink></item>
		<item>
		<title>Add suffix to a number</title>
		<link>http://feedproxy.google.com/~r/DanielKassner/~3/lX9ZciAYAZ0/add-suffix-to-a-number</link>
		<comments>http://www.danielkassner.com/2010/06/01/add-suffix-to-a-number#comments</comments>
		<pubDate>Wed, 02 Jun 2010 03:39:34 +0000</pubDate>
		<dc:creator>Daniel</dc:creator>
				<category><![CDATA[PHP Coding]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[Numbers]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.danielkassner.com/?p=346</guid>
		<description><![CDATA[Have you ever had to dynamically add the suffix to a number? (ie. st, nd, rd, th) &#60;?php function number_suffix($i) { switch( floor($i/10) % 10 ) { default: switch( $i % 10 ) { case 1: return 'st'; case 2: return 'nd'; case 3: return 'rd'; } case 1: } return 'th'; } ?&#62; Then [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever had to dynamically add the suffix to a number? (ie. st, nd, rd, th)</p>
<div class="hl-surround" ><div class="hl-main"><pre><span class="hl-inlinetags">&lt;?php
</span><span class="hl-reserved">function </span><span class="hl-identifier">number_suffix</span><span class="hl-brackets">(</span><span class="hl-var">$i</span><span class="hl-brackets">) {
    </span><span class="hl-reserved">switch</span><span class="hl-brackets">( </span><span class="hl-identifier">floor</span><span class="hl-brackets">(</span><span class="hl-var">$i</span><span class="hl-code">/</span><span class="hl-number">10</span><span class="hl-brackets">)</span><span class="hl-code"> % </span><span class="hl-number">10 </span><span class="hl-brackets">) {
        </span><span class="hl-reserved">default</span><span class="hl-code">:
	    </span><span class="hl-reserved">switch</span><span class="hl-brackets">( </span><span class="hl-var">$i</span><span class="hl-code"> % </span><span class="hl-number">10 </span><span class="hl-brackets">) {
                </span><span class="hl-reserved">case </span><span class="hl-number">1</span><span class="hl-code">: </span><span class="hl-reserved">return </span><span class="hl-quotes">'</span><span class="hl-string">st</span><span class="hl-quotes">'</span><span class="hl-code">;
                </span><span class="hl-reserved">case </span><span class="hl-number">2</span><span class="hl-code">: </span><span class="hl-reserved">return </span><span class="hl-quotes">'</span><span class="hl-string">nd</span><span class="hl-quotes">'</span><span class="hl-code">;
                </span><span class="hl-reserved">case </span><span class="hl-number">3</span><span class="hl-code">: </span><span class="hl-reserved">return </span><span class="hl-quotes">'</span><span class="hl-string">rd</span><span class="hl-quotes">'</span><span class="hl-code">;  
            </span><span class="hl-brackets">}
        </span><span class="hl-reserved">case </span><span class="hl-number">1</span><span class="hl-code">:
    </span><span class="hl-brackets">}
    </span><span class="hl-reserved">return </span><span class="hl-quotes">'</span><span class="hl-string">th</span><span class="hl-quotes">'</span><span class="hl-code">;
</span><span class="hl-brackets">}
</span><span class="hl-inlinetags">?&gt;</span></pre></div></div>
<p>Then to use the code you would do like:</p>
<div class="hl-surround" ><div class="hl-main"><pre><span class="hl-inlinetags">&lt;?php
</span><span class="hl-var">$number</span><span class="hl-code"> = </span><span class="hl-number">10</span><span class="hl-code">;
</span><span class="hl-comment">// This will display 10th
</span><span class="hl-reserved">echo </span><span class="hl-var">$number</span><span class="hl-code">,</span><span class="hl-identifier">number_suffix</span><span class="hl-brackets">(</span><span class="hl-var">$number</span><span class="hl-brackets">)</span><span class="hl-code">;
</span><span class="hl-inlinetags">?&gt;</span></pre></div></div>

<p><a href="http://feedads.g.doubleclick.net/~a/_z-33nx6srJ-vRgr9NRbLzetz4s/0/da"><img src="http://feedads.g.doubleclick.net/~a/_z-33nx6srJ-vRgr9NRbLzetz4s/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/_z-33nx6srJ-vRgr9NRbLzetz4s/1/da"><img src="http://feedads.g.doubleclick.net/~a/_z-33nx6srJ-vRgr9NRbLzetz4s/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/DanielKassner/~4/lX9ZciAYAZ0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.danielkassner.com/2010/06/01/add-suffix-to-a-number/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.danielkassner.com/2010/06/01/add-suffix-to-a-number</feedburner:origLink></item>
	</channel>
</rss>
