<?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>.marky-b</title>
	<atom:link href="http://blog.marky-b.me/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://blog.marky-b.me</link>
	<description>.me</description>
	<lastBuildDate>Wed, 04 Aug 2010 03:16:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Delete all data from all tables with T-SQL</title>
		<link>http://blog.marky-b.me/?p=214</link>
		<comments>http://blog.marky-b.me/?p=214#comments</comments>
		<pubDate>Wed, 04 Aug 2010 03:15:17 +0000</pubDate>
		<dc:creator>marky-b</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.marky-b.me/?p=214</guid>
		<description><![CDATA[
Here&#8217;s a little something myself and a co-worker put together to delete all the data from all the tables in a database.

-- change me!
USE &#91;MyDatabase&#93;
&#160;
-- &#8230;]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/paopix/4653163189/in/pool-59554239@N00/"><img src="http://blog.marky-b.me/wp-content/uploads/2010/08/CompoundEye.jpg" alt="Flickr: Compound Eye" title="Alchemists of Sound" width="800" height="537" class="alignnone size-full wp-image-215" /></a></p>
<p>Here&#8217;s a little something myself and a co-worker put together to delete all the data from all the tables in a database.</p>

<div class="wp_syntax"><div class="code"><pre class="tsql" style="font-family:monospace;"><span style="color: #008080;">-- change me!</span>
<span style="color: #0000FF;">USE</span> <span style="color: #808080;">&#91;</span>MyDatabase<span style="color: #808080;">&#93;</span>
&nbsp;
<span style="color: #008080;">-- don't touch below here</span>
&nbsp;
<span style="color: #008080;">-- disable all constraints</span>
<span style="color: #0000FF;">EXEC</span> sp_MSForEachTable <span style="color: #FF0000;">&quot;ALTER TABLE ? NOCHECK CONSTRAINT all&quot;</span>
&nbsp;
<span style="color: #008080;">-- delete data in all tables</span>
<span style="color: #0000FF;">EXEC</span> sp_MSForEachTable <span style="color: #FF0000;">&quot;DELETE FROM ?&quot;</span>
&nbsp;
<span style="color: #008080;">-- enable all constraints</span>
<span style="color: #0000FF;">EXEC</span> sp_MSForEachTable <span style="color: #FF0000;">&quot;ALTER TABLE ? WITH CHECK CHECK CONSTRAINT all&quot;</span>
&nbsp;
<span style="color: #008080;">-- reseed identity columns</span>
<span style="color: #0000FF;">EXEC</span> sp_MSForEachTable <span style="color: #FF0000;">&quot;DBCC CHECKIDENT ( '?', RESEED, 0)&quot;</span>
&nbsp;
<span style="color: #008080;">-- check to see if any tables have rows</span>
<span style="color: #008080;">-- this could probably be handled better</span>
<span style="color: #0000FF;">CREATE</span> <span style="color: #0000FF;">TABLE</span> #CheckRows <span style="color: #808080;">&#40;</span>TableName <span style="color: #0000FF;">VARCHAR</span><span style="color: #808080;">&#40;</span><span style="color: #000;">255</span><span style="color: #808080;">&#41;</span>, NumRows <span style="color: #0000FF;">INT</span><span style="color: #808080;">&#41;</span>
<span style="color: #0000FF;">EXEC</span> sp_MSforeachtable <span style="color: #FF0000;">&quot;INSERT INTO #CheckRows SELECT '?',COUNT(1) FROM ?&quot;</span>
<span style="color: #0000FF;">SELECT</span> <span style="color: #808080;">*</span> <span style="color: #0000FF;">FROM</span> #CheckRows <span style="color: #0000FF;">WHERE</span> NumRows <span style="color: #808080;">&gt;</span> <span style="color: #000;">0</span>
<span style="color: #0000FF;">DROP</span> <span style="color: #0000FF;">TABLE</span> #CheckRows</pre></div></div>

<p>A TRUNCATE on the table was not an option for us, as wanted to retain the table constraints; even after the data purge.  I came up with a pretty ingenious plan to just disable the constraints before the DELETE, and then re-enable them just before reseeding the identity columns.  My co-worker came up with the post-delete row-check logic and built it into the script, which saves a step or two.</p>
<p>If you&#8217;re in a pinch to truncate all of your tables in a database, but keep the constraints, and don&#8217;t mind executing one of the scariest scripts in a DBA&#8217;s arsenal.. give it a go and let me know how it goes.  Hopefully you first test it out in that development environment you never seem to utilize to it&#8217;s potential.</p>
<p>Don&#8217;t forget to update your resume before you fire it off in production..</p>
<p>Photo by <a href="http://www.flickr.com/photos/paopix/">Compound Eye</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.marky-b.me/?feed=rss2&amp;p=214</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSMS Query Tab Customization</title>
		<link>http://blog.marky-b.me/?p=193</link>
		<comments>http://blog.marky-b.me/?p=193#comments</comments>
		<pubDate>Mon, 12 Jul 2010 16:40:26 +0000</pubDate>
		<dc:creator>marky-b</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://blog.marky-b.me/?p=193</guid>
		<description><![CDATA[


Just a quick post that addresses what was quite a nuisance in SQL Server Management Studio.  I would open multiple queries, and their tab &#8230;]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.marky-b.me/wp-content/uploads/2010/07/balakov1.jpg"><img class="aligncenter size-full wp-image-206" title="balakov" src="http://blog.marky-b.me/wp-content/uploads/2010/07/balakov1.jpg" alt="" width="800" height="586" /></a></p>
<p style="text-align: left;"><a href="http://blog.marky-b.me/wp-content/uploads/2010/07/balakov1.jpg">
</p>
<p>Just a quick post that addresses what was quite a nuisance in SQL Server Management Studio.  I would open multiple queries, and their tab names would be the maximum width due to the unwanted garbage they contained (Server Name, Database Name, User Name).  Well, a quick buzz through <strong>Tools &gt;&gt; Options&#8230;</strong> lead me to the <strong>Text Editor &gt;&gt; Editor Tab and Status Ba</strong>r customization window.</p>
<p><a href="http://blog.marky-b.me/wp-content/uploads/2010/07/tab-text-options-in-ssms-2008.png"><img class="alignnone size-full wp-image-195" title="tab-text-options-in-ssms-2008" src="http://blog.marky-b.me/wp-content/uploads/2010/07/tab-text-options-in-ssms-2008.png" alt="" width="725" height="509" /></a></p>
<p>Being that my status bar already contained which server and database I was working in, I felt that the same information in the tab&#8217;s title was just unwanted clutter.</p>
<p>Some people might like it as a quick reference when scanning tabs, but as for me.. they&#8217;re gone.</p>
<p>Photo by <a href="http://www.flickr.com/photos/balakov/">Balakov</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.marky-b.me/?feed=rss2&amp;p=193</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I love WordPress</title>
		<link>http://blog.marky-b.me/?p=183</link>
		<comments>http://blog.marky-b.me/?p=183#comments</comments>
		<pubDate>Fri, 25 Jun 2010 04:19:48 +0000</pubDate>
		<dc:creator>marky-b</dc:creator>
				<category><![CDATA[Friends]]></category>
		<category><![CDATA[My Life]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://blog.marky-b.me/?p=183</guid>
		<description><![CDATA[So apparently wordpress has been dumping my blogs for the past few months.. and I just about never check them.  So&#8211; They&#8217;re gone.  &#8230;]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/dhushor-jen/"><img src="http://blog.marky-b.me/wp-content/uploads/2010/06/jenny.jpg" alt="" title="~Je^n^ny~" width="800" height="530" class="alignnone size-full wp-image-186" /></a>So apparently wordpress has been dumping my blogs for the past few months.. and I just about never check them.  So&#8211; They&#8217;re gone.   Forever.  WordPress never decided to publish them.</p>
<p>All is figured out now (I hope) so this blog should actually live.</p>
<p>The past couple of days have been pretty great.</p>
<p>Yesterday, we had an intermural volleyball game, and WON for a change.  We&#8217;re pretty good, but all the other teams just seem to hold out longer than us when it comes to screwing something up.  Yesterday we also had one of our (crazy ultra-psycho demanding) players out and sub&#8217;ed in one my roommate&#8217;s friends.  We were kind of apprehensive about letting her play, but it actually turned out to be a good thing.  She wasn&#8217;t afraid to dive to hit the ball, and she wasn&#8217;t one to give up easily.  Hell.. she put in more effort than I did.  Of course, I felt juuuuust a tad guilty about it, so I stepped up my game.</p>
<p>I went for bumps I normally wouldn&#8217;t have; sets someone else could&#8217;ve gotten, and spikes.. well, i guess neither of us would&#8217;ve gone for those, so.. ignore those.  Turns out.. with this girl essentially showing me up.. I noticed myself trying more for the bumps and sets I previously thought un-bump/set-able.</p>
<p>Finally, we WON!  It feels good, but I know there is another power team out there, waiting for us.</p>
<p>The overall &#8220;feeling&#8221; of today was a bit off from yesterday.  I&#8217;m way behind at work, so i&#8217;ve been sticking around later than usual recently.  We had a team outing today to go frisbee golfing and grilling at about 2pm today, and I, being behind in my work lately, decided to stay back at the office and get some crap done.</p>
<p>I finished <em>some </em>work, before getting called up by a co-worker to bring the ketchup and cheese to the grill-out.  I saved the day with said items and actually had a great time unwinding with some co-workers.  It&#8217;s really nice to be able to inch away from your work life, and get to know your coworkers in different lights.</p>
<p>Now, I&#8217;m at home, and I&#8217;m feeling like the roomie&#8217;s and I will be watching some of The OC Season 1 as part of our &#8220;Drama June&#8221; marathon month.</p>
<p>More later.. as for now.. sleep.</p>
<p>Photo by <a target="_blank" href="http://www.flickr.com/photos/dhushor-jen/">~Je^n^ny~</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.marky-b.me/?feed=rss2&amp;p=183</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP, SQL, and FusionCharts</title>
		<link>http://blog.marky-b.me/?p=172</link>
		<comments>http://blog.marky-b.me/?p=172#comments</comments>
		<pubDate>Thu, 29 Oct 2009 04:49:37 +0000</pubDate>
		<dc:creator>marky-b</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[My Life]]></category>
		<category><![CDATA[Photography]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.marky-b.me/?p=172</guid>
		<description><![CDATA[
What I&#8217;m listening to atm:
Sasha - Live @ Creamfields 2003
At the beginning of this semester, a couple of friends and myself set out on a &#8230;]]></description>
			<content:encoded><![CDATA[<p><a target="_blank" href="http://www.flickr.com/photos/verenavianna/2168355041/"><img class="size-full wp-image-173" title="fire" src="http://blog.marky-b.me/wp-content/uploads/2009/10/fire.jpg" alt="Flickr: Fire Poi" width="800" height="601" /></a></p>
<p>What I&#8217;m listening to atm:<br />
<a class='wpaudio' href='http://jukebox.marky-b.me/mp3/Sasha%20-%20Creamfields%202003.mp3'>Sasha - Live @ Creamfields 2003</a></p>
<p>At the beginning of this semester, a couple of friends and myself set out on a mission.  A professor of one of our classes has an uncanny knack for inadvertently saying &#8220;k&#8221; multiple times per sentence.</p>
<p>We vowed to record every instance of this phenomenon, and keep crude records on which we could reflect, as well as use these counts of k&#8217;s to forewarn future generations of the undeniable and unavoidable distraction.</p>
<p>We started off with the basics; simply keeping tallies on spare pieces of paper, or in back covers of notebooks, summing and averaging along the way.  Eventually, my fingers got tired of repeatedly hammering numbers into a calculator, and I began thinking of alternatives to this madness.</p>
<p>Learning quite a bit of .NET/SQL at a summer internship, I decided that we (I) could make this into a data-driven web app, but opted for a PHP front-end to all the craziness.  I felt that we also needed some sort of graphical representation of our meticulous record-keeping (y&#8217;know.. for science).</p>
<p>And so it begins&#8230;</p>
<p>First, we need to decide what exactly we need in order for this vision to materialize.</p>
<ol>
<li>A database to store all the records.</li>
<li>An interface to record the &#8220;k&#8221;s.</li>
<li>A reports page to show our findings (graphs and stats).</li>
</ol>
<p>Lets begin&#8211;</p>
<p><strong>1.  A database to store all the records.</strong></p>
<p>For the sake of simplicity, the database I created contained only one table:</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">CREATE</span> <span style="color: #990099; font-weight: bold;">TABLE</span> <span style="color: #008000;">`Records`</span>
<span style="color: #FF00FF;">&#40;</span>
  <span style="color: #008000;">`RecordId`</span> <span style="color: #999900; font-weight: bold;">INT</span> <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span> <span style="color: #FF9900; font-weight: bold;">AUTO_INCREMENT</span> <span style="color: #990099; font-weight: bold;">PRIMARY KEY</span> <span style="color: #000033;">,</span>
  <span style="color: #008000;">`k`</span> <span style="color: #999900; font-weight: bold;">INT</span><span style="color: #FF00FF;">&#40;</span> <span style="color: #008080;">1</span> <span style="color: #FF00FF;">&#41;</span> <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span> <span style="color: #990099; font-weight: bold;">DEFAULT</span>  <span style="color: #008000;">'1'</span><span style="color: #000033;">,</span>
  <span style="color: #008000;">`CreatedDateTime`</span> <span style="color: #999900; font-weight: bold;">DATETIME</span> <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #9900FF; font-weight: bold;">NULL</span>
<span style="color: #FF00FF;">&#41;</span></pre></div></div>

<p>You&#8217;ll notice that i created a &#8216;RecordId&#8217; column to keep track of individual records.  This column is not necessarily needed, but I thought that it may be useful if I ever expand the functionality.</p>
<p>The &#8216;k&#8217; column is where we&#8217;ll actually be specifying a counted &#8220;k&#8221;.  The Int only needs to have a size of 1 because there will theoretically be no 2 &#8220;k&#8221;s at any given moment in time (depending on the next field&#8217;s granularity).</p>
<p>The &#8216;CreatedDateTime&#8217; column, which is DateTime format, will have the capability of recording to the thousandths of a second, but as you&#8217;ll see further down, in our PHP code, I will only be recording it down to seconds.</p>
<p>Now that the database table is set up, we can start at the PHP code!</p>
<p><strong>2.  An interface to record &#8220;k&#8221;s.</strong></p>
<p>This part is fairly straightforward, in my opinion.  I designed it to be a simple page with just a single button in the middle; when clicked, the form would POST (to itself), and on page load, record a &#8220;k&#8221; in the DB.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">// Save this file as index.php
&lt;html&gt;
  &lt;head&gt;
    <span style="color: #000000; font-weight: bold;">&lt;?</span>
      <span style="color: #666666; font-style: italic;">// The DateTime when this page is loaded, will be use w/ the DB insert</span>
      <span style="color: #000088;">$now</span> <span style="color: #339933;">=</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Y-m-d H:i:s&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">// ex. 2009-10-28 22:37:14</span>
&nbsp;
      <span style="color: #666666; font-style: italic;">// Database connection info</span>
      <span style="color: #000088;">$user</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;dbUsername&quot;</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$pass</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;dbPassword&quot;</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$db</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;dbName&quot;</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$server</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;localhost&quot;</span><span style="color: #339933;">;</span>
&nbsp;
      <span style="color: #666666; font-style: italic;">// Since the page is posting to itself, check to see</span>
      <span style="color: #666666; font-style: italic;">// if our specified page function is passed in.  This is</span>
      <span style="color: #666666; font-style: italic;">// a very inefficient way of doing this, but it works.</span>
      <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'func'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'func'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
      <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;">// The above 'strlen' is a quick and dirty way to sanitize</span>
        <span style="color: #666666; font-style: italic;">// input.  Usually doesnt work to well w/ anything above 2.</span>
        <span style="color: #000088;">$func</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'func'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$func</span> <span style="color: #339933;">==</span><span style="color: #0000ff;">'sk'</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
          <span style="color: #666666; font-style: italic;">//if the parameter passed in = &quot;sk&quot; (or, save k&quot;), write to db</span>
          <span style="color: #990000;">mysql_connect</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$server</span><span style="color: #339933;">,</span> <span style="color: #000088;">$user</span><span style="color: #339933;">,</span> <span style="color: #000088;">$pass</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #339933;">@</span><span style="color: #990000;">mysql_select_db</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$db</span><span style="color: #009900;">&#41;</span> or <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
          <span style="color: #000088;">$query</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;INSERT INTO Records (k, CreatedDateTime) VALUES (1, <span style="color: #006699; font-weight: bold;">$now</span>)&quot;</span><span style="color: #339933;">;</span>
          <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
      <span style="color: #009900;">&#125;</span>
    <span style="color: #000000; font-weight: bold;">?&gt;</span>
  &lt;/head&gt;
  &lt;body&gt;
    &lt;form action='index.php?func=sk' method='post'&gt;
      &lt;input type='Submit' value='k?'&gt;
    &lt;/form&gt;
  &lt;/body&gt;
&lt;/html&gt;</pre></div></div>

<p>Now, keep in mind that this is a very very simple example, and was coded in about 10 minutes, and is lacking styling and code efficiency/finesse.</p>
<p>All that&#8217;s left to do now is to show all those lovely &#8220;k&#8221;s in a fancy, flashy graph.</p>
<p><strong>3.  A reports page to show our findings (graphs and stats).</strong></p>
<p>There are plenty of flash and javascript based graphing code-ins out there, but I chose to use <a target="_blank" href='http://www.fusioncharts.com/'>FusionCharts</a> because there are flexible and amazing.  There is a free version on their site called FusionCharts FREE, but for these examples, I am using FusionCharts v3.  The syntax of some things are different between the two versions, so if you use the free version, my code may not work as expected.  All the installation and customization instructions are included in the download packages.</p>
<p>For the graph I was creating, i wanted to specify certain times on a certain date to show our recorded &#8220;k&#8221;s, so there was some fancy PHP work involved to manipulate strings and DateTimes, which is shown below.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">// Save this file as graph.php
&lt;html&gt;
  &lt;head&gt;
    <span style="color: #000000; font-weight: bold;">&lt;?</span>
      <span style="color: #666666; font-style: italic;">// Include FusionCharts/FusionCharts.php which contains functions to help w/ chart embedding</span>
      <span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;FusionCharts/FusionCharts.php&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #666666; font-style: italic;">// Also include some javascript to help w/ chart embedding</span>
    <span style="color: #000000; font-weight: bold;">?&gt;</span>
    &lt;SCRIPT LANGUAGE=&quot;Javascript&quot; SRC=&quot;FusionCharts/FusionCharts.js&quot;&gt;&lt;/SCRIPT&gt;
    <span style="color: #000000; font-weight: bold;">&lt;?</span>
      <span style="color: #666666; font-style: italic;">// Database connection info</span>
      <span style="color: #000088;">$user</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;dbUsername&quot;</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$pass</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;dbPassword&quot;</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$db</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;dbName&quot;</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$server</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;localhost&quot;</span><span style="color: #339933;">;</span>
&nbsp;
      <span style="color: #666666; font-style: italic;">// The date we would like to see the records of</span>
      <span style="color: #000088;">$date</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;2009-10-28&quot;</span><span style="color: #339933;">;</span>
&nbsp;
      <span style="color: #666666; font-style: italic;">// The start and end times on the above date to see the records of</span>
      <span style="color: #000088;">$startDateTime</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$date</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot; 18:00:00&quot;</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$endDateTime</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$date</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot; 20:45:00&quot;</span><span style="color: #339933;">;</span>
&nbsp;
      <span style="color: #666666; font-style: italic;">// We're going to need a loop to go through each minute of the above time slot</span>
      <span style="color: #666666; font-style: italic;">// and get the sum of all records for that minute from the DB.  Then record that</span>
      <span style="color: #666666; font-style: italic;">// sum to an array, along with the corresponding DateTime</span>
&nbsp;
      <span style="color: #666666; font-style: italic;">// this will be our incrementing variable for the loop</span>
      <span style="color: #000088;">$incrementingDateTime</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strtotime</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$startDateTime</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
      <span style="color: #990000;">mysql_connect</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$server</span><span style="color: #339933;">,</span> <span style="color: #000088;">$user</span><span style="color: #339933;">,</span> <span style="color: #000088;">$password</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #339933;">@</span><span style="color: #990000;">mysql_select_db</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$db</span><span style="color: #009900;">&#41;</span> or <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
      <span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
&nbsp;
      <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$incrementingDateTime</span> <span style="color: #339933;">&lt;=</span> <span style="color: #990000;">strtotime</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$endDateTime</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
      <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$queryDateTime</span> <span style="color: #339933;">=</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Y-m-d H:i&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$incrementingDateTime</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$query</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;
          SELECT SUM(k)
          FROM Records 
          WHERE CreatedDateTime LIKE '%<span style="color: #006699; font-weight: bold;">$queryDateTime</span>%'
        &quot;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$queryResult</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$resultArray</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_fetch_row</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$queryResult</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$count</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">// Number of &quot;k&quot;s in that given minute.</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$count</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;=</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span>  <span style="color: #666666; font-style: italic;">// If no records returned, returns empty string,</span>
        <span style="color: #009900;">&#123;</span>                          <span style="color: #666666; font-style: italic;">// so we turn that empty string into a &quot;0&quot;.</span>
          <span style="color: #000088;">$count</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;0&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
&nbsp;
        <span style="color: #000088;">$graphData</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;H:i&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$incrementingDateTime</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$graphData</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$count</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000088;">$incrementDateTime</span> <span style="color: #339933;">=</span> <span style="color: #666666; font-style: italic;">#incrementDateTime + 60; // Add a minute
</span>        <span style="color: #000088;">$i</span><span style="color: #339933;">++;</span>
      <span style="color: #009900;">&#125;</span>
      <span style="color: #990000;">mysql_close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
      <span style="color: #666666; font-style: italic;">// Lets build the XML for the graph!</span>
&nbsp;
      <span style="color: #666666; font-style: italic;">// Graph type, labels, etc.  Here's the one i created.  XML API is in the FusionCharts docs</span>
      <span style="color: #000088;">$strXML</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&lt;chart caption='Ks Per Minute' subcaption='&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$date</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;' showValues='0' showLabels='0' labelDisplay='ROTATE' slantLabels='1' showAlternateVGridColor='1' alternateVGridColor='D9E5F1' alternateVGridAlpha='100' animation='1' &gt;&quot;</span><span style="color: #339933;">;</span>
&nbsp;
      <span style="color: #666666; font-style: italic;">// Graph data.  This if/else statement will make it so the x-axis labels are only visible every quarter hour.</span>
      <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$arrData</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$arrSubData</span><span style="color: #009900;">&#41;</span>
      <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$arrSubData</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'00'</span> <span style="color: #339933;">||</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$arrSubData</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'15'</span> <span style="color: #339933;">||</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$arrSubData</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'30'</span> <span style="color: #339933;">||</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$arrSubData</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'45'</span><span style="color: #009900;">&#41;</span>
        <span style="color: #009900;">&#123;</span>
          <span style="color: #000088;">$strXML</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$strXML</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;&lt;set label='&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$arrSubData</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;' value='&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$arrSubData</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;' showName='1' /&gt;&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">else</span>
        <span style="color: #009900;">&#123;</span>
          <span style="color: #000088;">$strXML</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$strXML</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;&lt;set label='&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$arrSubData</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;' value='&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$arrSubData</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;' /&gt;&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
      <span style="color: #009900;">&#125;</span>
&nbsp;
      <span style="color: #666666; font-style: italic;">// Close out chart data</span>
      <span style="color: #000088;">$strXML</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$strXML</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;&lt;/chart&gt;&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">?&gt;</span>
  &lt;/head&gt;
  &lt;body
    //  Embedding the chart!
    <span style="color: #000000; font-weight: bold;">&lt;?</span>
      <span style="color: #b1b100;">echo</span> renderChart<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;FusionCharts/Line.swf&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$strXML</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;ksPerMinute&quot;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">900</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">300</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">?&gt;</span>
  &lt;/body&gt;
&lt;/html&gt;</pre></div></div>

<p>So, that&#8217;s pretty much it.</p>
<p>The entire project only took me a day or so to put together.  Most of that time was styling the actual graph.  Feel free to re-use this code and make it your own.</p>
<p>FusionCharts has an incredible number of different graphs and configurations, so if you&#8217;re looking to do any type of web-app charting or graphing, head on over to www.FusionCharts.com and see what you can create.</p>
<p>enjoy!</p>
<p>Photo by <a target="_blank" title="Flickr: Verena Vianna" href="http://www.flickr.com/photos/verenavianna/">Verena Vianna</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.marky-b.me/?feed=rss2&amp;p=172</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://jukebox.marky-b.me/mp3/Sasha%20-%20Creamfields%202003.mp3" length="104089806" type="audio/mpeg" />
		</item>
		<item>
		<title>VBScript GUIDs (and how i used them too!) :)</title>
		<link>http://blog.marky-b.me/?p=138</link>
		<comments>http://blog.marky-b.me/?p=138#comments</comments>
		<pubDate>Fri, 02 Oct 2009 05:41:18 +0000</pubDate>
		<dc:creator>marky-b</dc:creator>
				<category><![CDATA[Family]]></category>
		<category><![CDATA[Graphics]]></category>
		<category><![CDATA[My Life]]></category>
		<category><![CDATA[Photography]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.marky-b.me/?p=138</guid>
		<description><![CDATA[
My brother&#8217;s wedding was just last weekend, and they were looking to pay someone to combine a bunch of photos together into a slideshow to &#8230;]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-139" title="jukebox/tv" src="http://blog.marky-b.me/wp-content/uploads/2009/10/3878437188_51f81052f8_o.jpg" alt="jukebox/tv" width="800" height="626" /></p>
<p>My brother&#8217;s wedding was just last weekend, and they were looking to pay someone to combine a bunch of photos together into a slideshow to play during the reception.  Of course, I thought this was a task that wasn&#8217;t worth the amount of money they were going to pay (think triple digits).  So, by mentioning that doing such a project was not worth it, I think they took it that I would do it for them for free.. well, that is what happened anyways.</p>
<p>So, getting a ton of photos from them (little did I know, most were film, and would have warranted the triple digit price), I set to work.  Being the perfectionist that I am, I set off on the multi-night, multi-case-of-beer journey that is leveling all of their photos to a more eye-pleasing tone.</p>
<p>Once all the photo&#8217;s were looking good (or as good as they could :S ), I put them all in one folder, so it would be easier to access all of them from the slideshow software I used.  I soon came across my first problem.</p>
<p>The slideshow software I used didn&#8217;t have a &#8220;random&#8221; feature when adding photos to the timeline&#8230; what a pain!  Due to camera and scanner naming conventions,  a majority of the timeline showed a couple of random pictures, followed by a series of photos, then more random, then a series, and so on.</p>
<p>My first thought was to write a script to run through the photo directory and rename the files to [randomInts].jpg, and did just that.  However, my script bombed out about 10 photo&#8217;s in, when it hit a duplicate &#8220;random&#8221; filename.</p>
<p>Now, I suppose I could&#8217;ve just put a filename check into the script, but I didn&#8217;t feel like poking with it over and over, so I thought.. hmm.. GUIDs <img src='http://blog.marky-b.me/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Some googling later, I found a VBScript library that is used for GUIDs, and did a bit more research to come up with the following:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #000080;">Function</span> getGuid()
  <span style="color: #000080;">Set</span> objTypeLib = CreateObject(<span style="color: #800000;">&quot;Scriptlet.TypeLib&quot;</span>)
  guidNew = Left(objTypeLib.GUID, 38)
  guidNew = Left(guidNew, Len(guidNew) - 1)
  guidNew = Right(guidNew, Len(guidNew) - 1)
  <span style="color: #000080;">Set</span> objTypeLib = <span style="color: #000080;">Nothing</span>
  getGuid = guidNew
<span style="color: #000080;">End</span> <span style="color: #000080;">Function</span></pre></div></div>

<p>Now, because the GUID is returned with curly braces ( { }&#8217;s ) on either end, and those aren&#8217;t allowed in filenames, I chose to remove them with the Left() and Right() functions.</p>
<p>Just by calling that function, it will return a GUID (without the braces) as a string for use it just about anything you can throw it into.  I chose to use it for file renaming <img src='http://blog.marky-b.me/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Here&#8217;s the rest of the script.  I know I could have done something a bit better with the directory scanning, but it was a piece of code that I already had hanging around.  And, being the efficient coder that I am, reused.</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;">strComputer = <span style="color: #800000;">&quot;.&quot;</span>
strPhotoDir = <span style="color: #800000;">&quot;C:\Users\Admin\Desktop\Photos&quot;</span>
<span style="color: #000080;">Set</span> objWMIService = GetObject(<span style="color: #800000;">&quot;winmgmts:\\&quot;</span> &amp; _
  strComputer &amp;amp; <span style="color: #800000;">&quot;\root\cimv2&quot;</span>)
&nbsp;
<span style="color: #000080;">Set</span> colFiles = objWMIService.ExecQuery _
  (<span style="color: #800000;">&quot;ASSOCIATORS OF {Win32_Directory.Name='&quot;</span> _
  &amp; strPhotoDir &amp; <span style="color: #800000;">&quot;'} Where ResultClass =&quot;</span> _
  &amp; <span style="color: #800000;">&quot;CIM_DataFile&quot;</span>)
&nbsp;
<span style="color: #000080;">For</span> <span style="color: #000080;">Each</span> objFile <span style="color: #000080;">In</span> colFiles
  strEnd = Right(objFile.Name, 8 )
  strNewName = objFile.Drive &amp; objFile.Path &amp; getGuid() &amp; <span style="color: #800000;">&quot;.jpg&quot;</span>
  result = objFile.Rename(strNewName)
<span style="color: #000080;">Next</span>
&nbsp;
<span style="color: #000080;">Function</span> getGuid()
  <span style="color: #000080;">Set</span> objTypeLib = CreateObject(<span style="color: #800000;">&quot;Scriptlet.TypeLib&quot;</span>)
  guidNew = Left(objTypeLib.GUID, 38)
  guidNew = Left(guidNew, Len(guidNew) - 1)
  guidNew = Right(guidNew, Len(guidNew) - 1)
  <span style="color: #000080;">Set</span> objTypeLib = <span style="color: #000080;">Nothing</span>
  getGuid = guidNew
<span style="color: #000080;">End</span> <span style="color: #000080;">Function</span></pre></div></div>

<p>That&#8217;s it!  Well, I know it wasn&#8217;t that complicated of a task anyways, but hey, someone out there might find it useful.</p>
<p>Enjoy</p>
<p>Photo By Unknown</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.marky-b.me/?feed=rss2&amp;p=138</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clocks</title>
		<link>http://blog.marky-b.me/?p=131</link>
		<comments>http://blog.marky-b.me/?p=131#comments</comments>
		<pubDate>Tue, 29 Sep 2009 14:53:22 +0000</pubDate>
		<dc:creator>marky-b</dc:creator>
				<category><![CDATA[My Life]]></category>
		<category><![CDATA[Photography]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.marky-b.me/?p=131</guid>
		<description><![CDATA[
It&#8217;s been fairly chilly here the past few days, so I figured this post image was appropriate.
As for the title of the blog.. I have &#8230;]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/7744332@N02/3957847492/in/photostream/"><img class="alignnone size-full wp-image-123" title="footprints" src="http://blog.marky-b.me/wp-content/uploads/2009/09/footprints.jpg" alt="footprints" width="800" height="535" /></a></p>
<p>It&#8217;s been fairly chilly here the past few days, so I figured this post image was appropriate.</p>
<p>As for the title of the blog.. I have this obsession with stylish and/or nerdy clocks.. Here are some examples..</p>
<h3>Nixie Concrete Clock</h3>
<p><a href="http://www.nixie-concrete.com/Nixie/The_Nixie_Concrete_Clock.html"><img class="alignnone size-full wp-image-125" title="nixie-concrete-clock" src="http://blog.marky-b.me/wp-content/uploads/2009/09/nixie-concrete-09-13-09.jpg" alt="nixie-concrete-clock" width="507" height="313" /></a></p>
<p>If WWII/Cold War crap interests you, then this clock will fill your heart and empty your wallet. This clock (read as 10:23:54) is a combination of vintage Z560M Nixie tubes that are embedded in a clunky block of concrete. Incredible vintage design and quality construction. Although this is just a one-off concept, the creator, Daniel Kurth, is considering production possibilities. More info <a title="The Nixie Concrete Clock" href="http://www.nixie-concrete.com/Nixie/The_Nixie_Concrete_Clock.html" target="_blank">here</a>.</p>
<h3>QLOCKTWO</h3>
<p><a href="http://www.qlocktwo.com/index.php?lang=en"><img class="alignnone size-full wp-image-129" title="qlocktwo" src="http://blog.marky-b.me/wp-content/uploads/2009/09/qlocktwo.jpg" alt="qlocktwo" width="450" height="400" /></a></p>
<p>Because I&#8217;m too lazy to read and decypher numbers on a normal clock, <a title="QLOCKTWO" href="http://www.qlocktwo.com/index.php?lang=en" target="_blank">QLOCKTWO</a> tells me the time in plain ol&#8217; English (or German, Dutch, Italian, Spanish or French). Now, it&#8217;s not as accurate as most other clocks, as it&#8217;s missing minutes and seconds, but if you&#8217;re into obscure time-telling, head on over to QLOCKTWO and pick this baby up. Keep in mind, it&#8217;ll run you a cool € 885, plus a hefty shipping fee for the kraut&#8217;s to get it to your doorstep.</p>
<h3>Average Day</h3>
<p><a href="http://www.mrjoneswatches.com/index.html"><img class="alignnone size-full wp-image-130" title="average-day-watch" src="http://blog.marky-b.me/wp-content/uploads/2009/09/average-day-watch.jpg" alt="average-day-watch" width="417" height="417" /></a></p>
<p>Now here&#8217;s a gem if you hate to be tied down by numbers while on the go. The Average Day watch by <a title="Mr. Jones Watches" href="http://www.mrjoneswatches.com/index.html" target="_blank">Mr. Jones Watches</a> really transforms the conventional watch into &#8220;units of median daily routine.&#8221; The outer loop of the watch represents the AM hours, and the inner loop, the PM hours. Although I&#8217;m not to partial on the black and baby blue wrist straps, the the constant reminder of what I should be doing with my time more than makes up for it. Get yours now for only $165 (ish) at <a title="Mr. Jones Watches" href="http://www.mrjoneswatches.com/index.html" target="_blank">Mr. Jones Watches</a>.</p>
<p> </p>
<p>Photo by <a title="Flickr: Jill Anderson" href="http://www.flickr.com/photos/7744332@N02/" target="_blank">Jill Anderson</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.marky-b.me/?feed=rss2&amp;p=131</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>So you&#8217;re into that Web 2.0 thing, eh?</title>
		<link>http://blog.marky-b.me/?p=97</link>
		<comments>http://blog.marky-b.me/?p=97#comments</comments>
		<pubDate>Fri, 11 Sep 2009 23:14:40 +0000</pubDate>
		<dc:creator>marky-b</dc:creator>
				<category><![CDATA[Graphics]]></category>
		<category><![CDATA[Internet]]></category>

		<guid isPermaLink="false">http://blog.marky-b.me/?p=97</guid>
		<description><![CDATA[
So I&#8217;ll be taking a different approach to the blog from here on out.  Apparently small updates here and there are the thing to do, &#8230;]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/raphaelfiris/3880609552/"><img class="size-full wp-image-112 aligncenter" title="Flickr: raphaelfiris" src="http://blog.marky-b.me/wp-content/uploads/2009/09/shoes.jpg" alt="Flickr: raphaelfiris" width="800" height="530" /></a></p>
<p style="text-align: left; "><a href="http://www.flickr.com/photos/raphaelfiris/3880609552/"></a>So I&#8217;ll be taking a different approach to the blog from here on out.  Apparently small updates here and there are the thing to do, and I just want to fit in, k?</p>
<p style="text-align: left; ">So you like Web 2.0 crap, eh?  Well I&#8217;ve run across a few things around the net in the past couple of days that could give you some ideas, or just save you some time.</p>
<p>If you&#8217;ve ever seen a lightbox implementation on a site, they you&#8217;ve no-doubtedly seen a little loading icon while you waited for the picture to download.  Well, I&#8217;ve spotted a nifty little site called &#8220;<a title="Ajaxload" href="http://www.ajaxload.info" target="_blank">Ajaxload</a>&#8221; to create a variety of different types of those little spinners and crawlers.  Here are some examples:</p>
<p><img class="alignnone size-full wp-image-100" title="bigsnake" src="http://blog.marky-b.me/wp-content/uploads/2009/09/bigsnake.gif" alt="bigsnake" width="32" height="32" /> <img class="alignnone size-full wp-image-101" title="facebook" src="http://blog.marky-b.me/wp-content/uploads/2009/09/facebook.gif" alt="facebook" width="16" height="11" /> <img class="alignnone size-full wp-image-99" title="bar" src="http://blog.marky-b.me/wp-content/uploads/2009/09/bar.gif" alt="bar" width="220" height="19" /> <img class="alignnone size-full wp-image-102" title="hypnotize" src="http://blog.marky-b.me/wp-content/uploads/2009/09/hypnotize.gif" alt="hypnotize" width="32" height="16" /> <img class="alignnone size-full wp-image-103" title="indicator" src="http://blog.marky-b.me/wp-content/uploads/2009/09/indicator.gif" alt="indicator" width="16" height="16" /></p>
<p style="text-align: left;">.. hmm.. I haven&#8217;t seen that many animated .gif&#8217;s on a webpage since the AngelFire days..</p>
<p style="text-align: left;">Alright, moving on.  Love linking all of your endeavours with your social network profiles?  Then you&#8217;ll love this next bit.  I bring to you social network icons, Web 2.0 style.  They&#8217;re made by <a title="komodomedia" href="http://www.komodomedia.com/" target="_blank">komodomedia</a>, and are every bit as awesome as funions and back flips.  Here&#8217;s a little taste of what you get:</p>
<p><img class="alignnone size-full wp-image-104" title="twitter_32" src="http://blog.marky-b.me/wp-content/uploads/2009/09/twitter_32.png" alt="twitter_32" width="32" height="32" /> <img class="alignnone size-full wp-image-105" title="blogger_32" src="http://blog.marky-b.me/wp-content/uploads/2009/09/blogger_32.png" alt="blogger_32" width="32" height="32" /> <img class="alignnone size-full wp-image-106" title="facebook_32" src="http://blog.marky-b.me/wp-content/uploads/2009/09/facebook_32.png" alt="facebook_32" width="32" height="32" /> <img class="alignnone size-full wp-image-107" title="wordpress_32" src="http://blog.marky-b.me/wp-content/uploads/2009/09/wordpress_32.png" alt="wordpress_32" width="32" height="32" /> <img class="alignnone size-full wp-image-108" title="flickr_32" src="http://blog.marky-b.me/wp-content/uploads/2009/09/flickr_32.png" alt="flickr_32" width="32" height="32" /> <img class="alignnone size-full wp-image-109" title="lastfm_32" src="http://blog.marky-b.me/wp-content/uploads/2009/09/lastfm_32.png" alt="lastfm_32" width="32" height="32" /> <img class="alignnone size-full wp-image-110" title="delicious_32" src="http://blog.marky-b.me/wp-content/uploads/2009/09/delicious_32.png" alt="delicious_32" width="32" height="32" /></p>
<p style="text-align: left;">Of course, there are a billion (warning: &#8220;a billion&#8221; might be slightly exaggerated.) more to choose from, and in case you were wondering, they&#8217;re free.  You can download the entire set <a href="http://www.komodomedia.com/blog/2009/06/social-network-icon-pack/" target="_blank">here</a>.</p>
<p style="text-align: left;">Cool stuff for (un)cool nerds.  Check it out and get creative with it.</p>
<p style="text-align: left;">Photo by <span style="text-decoration: none;"><a style="color: #0063dc; text-decoration: underline;" title="Flickr: raphaelfiris" href="http://www.flickr.com/photos/raphaelfiris/" target="_blank">raphaelfiris</a>.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.marky-b.me/?feed=rss2&amp;p=97</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Copying PerfMon Counters from Windows Server 2003 to 2008</title>
		<link>http://blog.marky-b.me/?p=85</link>
		<comments>http://blog.marky-b.me/?p=85#comments</comments>
		<pubDate>Mon, 20 Jul 2009 20:56:19 +0000</pubDate>
		<dc:creator>marky-b</dc:creator>
				<category><![CDATA[My Life]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://blog.marky-b.me/?p=85</guid>
		<description><![CDATA[
A few weeks ago, I assisted in a performance monitoring server upgrade from Windows Server 2003 to Server 2008.  Much of the migration was fairly straightforward, &#8230;]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-170" title="Pink Fantasy" src="http://blog.marky-b.me/wp-content/uploads/2009/07/fence.jpg" alt="Pink Fantasy" width="800" height="602" /></p>
<p>A few weeks ago, I assisted in a performance monitoring server upgrade from Windows Server 2003 to Server 2008.  Much of the migration was fairly straightforward, however when we got to copying over the Performance Counters we ran into some issues.</p>
<p>Pre-Server 2008, a simple right-click on the counter and left click on &#8220;Save Settings As&#8230;&#8221; would pop up a dialog to save the counter&#8217;s settings to an .html file.  There is, however no way to import that saved .html into Windows Server 2008.</p>
<p>Instead, you must use the Logman.exe from the (or any) 2008 server to first export the 2003 settings remotely to a local .xml, and then import that .xml using the very same tool.  Logman.exe is located in the C:\Windows\system32 directory.</p>
<p>Here is an example of a couple of the commands we executed:</p>
<p>First, we need to navigate to the directory containing Logman.exe.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">cd c:\windows\system32</pre></div></div>

<p>Next, we&#8217;ll take a look at Logman.exe.  You can view proper syntax by typing</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">logman /?</pre></div></div>

<p>We&#8217;ll be focusing on the export and import switches. with the following syntax:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">logman export -s Server2003 -n CPUmon -xml Server2003_CPUmon.xml</pre></div></div>

<p>You can see above that i throw in three arguments after the export command.</p>
<ul>
<li><em>-s Server2003</em> tells Logman that we are looking at the server with host name &#8221;Server2003&#8243;</li>
<li><em>-n CPUmon</em> tells Logman that the Performance Counter we&#8217;re looking to export from the 2003 server is named &#8220;CPUmon&#8221;.  This is not case sensitive, so if you have a lot of counters to migrate, and you don&#8217;t feel like getting specific, feel free to type in all one case (your preference!).</li>
<li>Finally, <em>-xml C:\Server2003_CPUmon.xml</em> tells Logman that we&#8217;re looking to export all those settings into an xml named &#8220;Server2003_CPUmon.xml&#8221; located in the root C:\ drive.</li>
</ul>
<p>When you execute the command successfully, Logman will reply with &#8220;The command completed successfully.&#8221;  Pretty straight forward.</p>
<p>So now that you have all of your Performance Monitoring Counters exported, it is time to fire off some import commands.</p>
<p>To import the command is almost identical as the export.  If you&#8217;re looking to import to the machine you&#8217;re running the commands from, then your syntax will look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">logman import -n CPUmon -xml C:\Server2003_CPUmon.xml</pre></div></div>

<p>The arguments here are the same as before.</p>
<ul>
<li><em>-n CPUmon</em> specifies the name of the counter.  Whatever you enter here will become the name of the counter on the 2008 machine.  Though, I should note, this time it <em>is</em> case sensitive.</li>
<li><em>-xml C:\Server2003_CPUmon.xml</em> tells Logman where to actually look for the Performance Counter settings.</li>
</ul>
<p>Needless to say, both of the above arguments are required.</p>
<p>Now, if you&#8217;re looking to create a counter on a remote 2008 server, you would just add in that same <em>-s [ServerHostName]</em> that we used in the <em>export</em> command, like so:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">logman import -s Server2008 -n CPUmon -xml C:\Server2003_CPUmon.xml</pre></div></div>

<p>That&#8217;s it.  You can also find some more information about the export and import commands by typing</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">logman export /?
logman import /?</pre></div></div>

<p>And if you&#8217;re more of a cmd guy, like myself, then you&#8217;ll probably want to stick to starting and stopping the counters on the 2008 server from the command prompt.  You&#8217;ll end up saving a lot of time over right-clicking your life away in the GUI.  I&#8217;ve also noticed that the GUI is pretty unstable once you get up over 10 or so counters.  Kind of ironic for the <em>Reliability and Performance Monitoring</em> tool.</p>
<p>Don&#8217;t forget to check your security credentials once they&#8217;re setup!</p>
<p>Photo by <a title="Flickr: BluebirdMarie" href="http://www.flickr.com/photos/23591275@N05" target="_blank">BluebirdMarie</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.marky-b.me/?feed=rss2&amp;p=85</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Drop</title>
		<link>http://blog.marky-b.me/?p=76</link>
		<comments>http://blog.marky-b.me/?p=76#comments</comments>
		<pubDate>Wed, 08 Jul 2009 22:46:01 +0000</pubDate>
		<dc:creator>marky-b</dc:creator>
				<category><![CDATA[Friends]]></category>
		<category><![CDATA[My Life]]></category>
		<category><![CDATA[Photography]]></category>
		<category><![CDATA[Travel]]></category>

		<guid isPermaLink="false">http://blog.marky-b.me/?p=76</guid>
		<description><![CDATA[
Welcome back from what I hope were safe Canada and Independence days.  I ended up celebrating both, for the most part, on accident.  I was &#8230;]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/49598046@N00/3690209319/"><img class="alignnone size-full wp-image-78" title="Leaf" src="http://blog.marky-b.me/wp-content/uploads/2009/07/leaf.jpg" alt="Leaf" width="800" height="588" /></a></p>
<p>Welcome back from what I hope were safe Canada and Independence days.  I ended up celebrating both, for the most part, on accident.  I was only required to work a half day on Thursday, so I figured I would go out with some friends after work on Wednesday night and play some volleyball and drink some beer.  I was a bit apprehensive about going, but I&#8217;m glad I did.  Met quite a few people, who for the most part were a lot of fun (and decent at volleyball, thank God).</p>
<p>There&#8217;s nothing worse than when small kids or really bad volleyball players want to step in and &#8220;give it a shot.&#8221;  I know that sounds pretty inconsiderate, but it just isn&#8217;t that fun when you can&#8217;t get a good volley going.</p>
<p>So for the 4th, I went up to visit my parents, which ended up being a lot more relaxing than I thought it would be.  Typically whenever I decide on a weekend to go up to my parents place, my sister, a few of her friends, my brother, and his fiance all head up there too.  Definitely causes a hectic weekend (Sorry guys.  I love you, but sometimes, you&#8217;re all just too much).</p>
<p>I wasn&#8217;t able to make it up there until saturday afternoon due to a wedding the previous evening, so by the time I got there, the night was already planned.  My parents, my sister, two of her friends, and myself headed to my aunt&#8217;s place to watch the fireworks and then go to a &#8220;Fireman&#8217;s Dance&#8221; afterwards.  This little town definitly improved their fireworks from last year.  I wasn&#8217;t too impressed by the Fireman&#8217;s Dance.  The band was alright, and as my parents went out to dance, the rest of us just hung out along the wall and made fun of all the people with rediculously patriotic clothing.</p>
<p>We only stayed about 45 minutes at the dance and then headed back to my parents place to have a bonfire.  I&#8217;m pretty sure I&#8217;ve mentioned how much I love sitting around the fire.</p>
<p>Sunday was by far the most relaxing day I&#8217;ve ever had.  My sister and her friends left really early, and I finally crawled out of bed at about 11am.  I headed straight down to the lake with a couple of beers and just sat in a chair for close to 5 hours.  The lake would&#8217;ve felt nice, but I really didnt feel like moving once I was there.</p>
<p>We grilled up some steaks and potatoes for dinner (which were delicious) and I headed home pretty soon after that.  It was absolutely the way to spend independence day.  In past years, we&#8217;ve gone to my aunt&#8217;s place, but it usually ends up being such a huge production that by the time the fireworks are over, I&#8217;m beyond ready to leave.  This year was perfect.</p>
<p>Photo by <a title="Flickr: Uncle Phooey" href="http://www.flickr.com/photos/49598046@N00/" target="_blank">Uncle Phooey</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.marky-b.me/?feed=rss2&amp;p=76</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Heat</title>
		<link>http://blog.marky-b.me/?p=71</link>
		<comments>http://blog.marky-b.me/?p=71#comments</comments>
		<pubDate>Wed, 24 Jun 2009 14:42:25 +0000</pubDate>
		<dc:creator>marky-b</dc:creator>
				<category><![CDATA[My Life]]></category>
		<category><![CDATA[Photography]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.marky-b.me/?p=71</guid>
		<description><![CDATA[
it has been unbearably hot here the past few days. normally i would gladly welcome it and go off for a swim, but instead of &#8230;]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-74" title="Grass" src="http://blog.marky-b.me/wp-content/uploads/2009/06/grass.jpg" alt="Grass" width="600" height="400" /></p>
<p>it has been unbearably hot here the past few days. normally i would gladly welcome it and go off for a swim, but instead of being sunny and hot, it has been rainy and hot.</p>
<p>mother earth is rude. i feel very unproductive on days like these. instead of going out with friends and having fun, i&#8217;ve been cooped up in the house playing video games. i suppose i could at least be doing some design/css/coding work on some of my <a title="marky-b.me" href="http://marky-b.me" target="_blank">projects</a>.</p>
<p>bri came up a few nights ago before her uni orientation day.  that was nice.  she even left us her wii to use until this fall when she moves up near the uni.  now i can finally work on my tennis skills.  she accidentally also left her pillow here.  it&#8217;s a really nice tempur-pedic  one, and i&#8217;ve been enjoying using it.</p>
<p>yesterday, the IT guys here at work decided to play a little trick on me.  i&#8217;ve been working pretty hard on a Symantec AV Corp to Endpoint migration, and they thought it would be hilarious to add and remove some of my hostfile entries without me knowing.  i even checked my hostfile, only to see that they had set it back to default moments before i looked.  I was even eventually pushed into calling Symantec support.</p>
<p>this went on for about an hour until one of the guys finally felt bad.  he told me, i told the symantec guy, and now they&#8217;re &#8216;archiving&#8217; my case.  great.</p>
<p>they definitely got me.  in actuality, i&#8217;m impressed.  it was a good one.  nicely done.</p>
<p>photo by someone on flickr.  i grabbed it a long time ago, but never saved the users name.  whoops.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.marky-b.me/?feed=rss2&amp;p=71</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
