<?xml version="1.0" encoding="iso-8859-1"?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="en">
  <title>1001010</title>
  <link rel="alternate" type="text/html" href="http://www.1001010.com/" />
  <modified>2007-09-22T02:56:55Z</modified>
  <tagline>The Experiments of Jason De Arte - Evil Lawn Dart Master, Toy Maker and Professional Software Engineer</tagline>
  <id>tag:www.1001010.com,2007://1</id>
  <generator url="http://www.movabletype.org/" version="2.661">Movable Type</generator>
  <copyright>Copyright (c) 2007, Jason</copyright>
  <entry>
    <title>Biting the Bullet</title>
    <link rel="alternate" type="text/html" href="http://www.1001010.com/blog/archives/000421.shtml" />
    <modified>2007-09-22T02:56:55Z</modified>
    <issued>2007-09-21T19:56:55-08:00</issued>
    <id>tag:www.1001010.com,2007://1.421</id>
    <created>2007-09-22T02:56:55Z</created>
    <summary type="text/plain">I just started http://mysql-code.com/wp/ as my own version of http://ora-code.com Why? well simply, when my server apps send off oracle error emails to the IT guys, I automatically format it with a link to ora-code.com so that they can get...</summary>
    <author>
      <name>Jason</name>
      <url>http://1001010.com</url>
      <email>jason-blog@1001010.com</email>
    </author>
    <dc:subject>Work</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.1001010.com/">
      <![CDATA[<p>I just started <br />
<a href="http://mysql-code.com/wp/">http://mysql-code.com/wp/</a> as my own version of http://ora-code.com </p>

<p>Why? well simply, when my server apps send off oracle error emails to the IT guys, I automatically format it with a link to ora-code.com so that they can get some info about the error code.   Politics aside, it helped the junior <span class="caps">DBA</span>s and IT guys to better understand the problem and fix the errors faster.<br />
Instead of hours, it took moments because they could just click on a link and it told them everything they needed to know about the problem.</p>

<p>Now I have a site for my MySQL server project.  Now I can send them auto-formated error emails with links to that site - and if I don't have a page set up - I'll add it.</p>

<p>It should be educational for me.</p>]]>
      
    </content>
  </entry>
  <entry>
    <title>Please stop telling me that MySQL is free</title>
    <link rel="alternate" type="text/html" href="http://www.1001010.com/blog/archives/000420.shtml" />
    <modified>2007-09-12T02:32:45Z</modified>
    <issued>2007-09-11T19:32:45-08:00</issued>
    <id>tag:www.1001010.com,2007://1.420</id>
    <created>2007-09-12T02:32:45Z</created>
    <summary type="text/plain">Do you see this? https://shop.mysql.com/enterprise/?rz=s2 To me, in the high availability and high demand environment that I work in, that single server license costs $5k That&apos;s for ONE server. Sure it&apos;s not the wonky per-cpu model of Oracle, but it&apos;s...</summary>
    <author>
      <name>Jason</name>
      <url>http://1001010.com</url>
      <email>jason-blog@1001010.com</email>
    </author>
    <dc:subject>Work</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.1001010.com/">
      <![CDATA[<p>Do you see this?</p>

<p><a href="https://shop.mysql.com/enterprise/?rz=s2">https://shop.mysql.com/enterprise/?rz=s2</a></p>

<p>To me, in the high availability and high demand environment that I work in, that single server license costs $5k</p>

<p>That's for <span class="caps">ONE </span>server.  Sure it's not the wonky per-cpu model of Oracle, but it's still a cost.  I'll probably need several on the project I'm working on so it's not just a one time fee - it's yearly.  Combine that with the new hardware costs and the hiring of new <span class="caps">DBA </span>staff with MySQL experience to shadow our Oracle <span class="caps">DBA</span>s (or retraining) - MySQL is <strong>not</strong> fracking free!  It's downright expensive.</p>

<p>I am <em>soooo</em> tired of people telling me that MySQL is cheaper than Oracle.  Just because there's a free version for everyone to play with, that doesn't mean that your going to run the free version in a production environment.</p>

<p>I can already hear the whining "But you don't have to pay for it, it's open source man - it's like free love and stuff"<br />
<span class="caps">PUT DOWN THE WEED AND LISTEN.  YES</span> I <span class="caps">FRACKING</span> DO <span class="caps">HAVE</span> TO <span class="caps">PAY FOR</span> IT <span class="caps">YOU FRACKING HIPPIE</span>!</p>

<p>The free version doesn't come with support.  You get what you pay for.  We live and work in a capitalist marketplace where if you like something, you buy it to encourage the production of similar products.  It's sometimes called voting with your wallet.<br />
If the fecal matter hits the spinning blades of doom - I want someone on the phone <span class="caps">ASAP. </span> I've got somewhere over 1k employees using my software to provide support to some 9 million customers.  Downtime is <span class="caps">NOT </span>an option.  There is no way in hell I'm going to tell them - "Ooops, sorry, my bad - I got the free version and even if I buy it now, it will take a few buisness days before support starts."<br />
Yea, that's a big I don't think so.  I'd like to avoid being skinned alive if I can help it.</p>

<p>I just needed to vent.</p>]]>
      
    </content>
  </entry>
  <entry>
    <title>Did I ever mention that I hate tnsnames.ora?</title>
    <link rel="alternate" type="text/html" href="http://www.1001010.com/blog/archives/000419.shtml" />
    <modified>2007-03-20T17:41:48Z</modified>
    <issued>2007-03-20T10:41:48-08:00</issued>
    <id>tag:www.1001010.com,2007://1.419</id>
    <created>2007-03-20T17:41:48Z</created>
    <summary type="text/plain">For the record, I consider the Oracle tnsnames.ora to be just a file so I feel nothing for it per se. It&apos;s just a DNS file for mapping Oracle Server names to IP addresses. However, mentioning it invokes images of...</summary>
    <author>
      <name>Jason</name>
      <url>http://1001010.com</url>
      <email>jason-blog@1001010.com</email>
    </author>
    <dc:subject>Code</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.1001010.com/">
      <![CDATA[<p>For the record, I consider the Oracle tnsnames.ora to be just a file so I feel nothing for it per se.  It's just a <span class="caps">DNS </span>file for mapping Oracle Server names to IP addresses.</p>

<p>However, mentioning it invokes images of suffering and woe.</p>

<p>With all the Oracle servers my company runs, it's constantly out of date.  To make things more exciting, the <span class="caps">DBA</span>s don't like the names that we (in development) give the DBs so they insist on giving it there own names.  And then for added excitment we have separate DBs running in different countries - each with their own config.</p>

<p>So whenever I have an issue with connecting to a certain <span class="caps">DB,</span> I ask the <span class="caps">DBA</span>s for the latest settings.  And as usual, I get several new conflicting tnsnames.ora entries from the <span class="caps">DBA</span>s and/or IT people.  The only thing you can guarantee is that most of them won't work.  The joy of peer based personal sneaker-net backups. </p>

<p>This problem is easily solvable with some simple source control. </p>

<p>But that will require large quantities of feces hitting a giant spinning blade of doom before that ever happens.</p>

<p>Thus my woe.   I'm not a big enough pile of shit to effect change ;-)</p>]]>
      
    </content>
  </entry>
  <entry>
    <title>Ding Dong the Wiki is Gone</title>
    <link rel="alternate" type="text/html" href="http://www.1001010.com/blog/archives/000418.shtml" />
    <modified>2007-02-28T03:22:30Z</modified>
    <issued>2007-02-27T19:22:30-08:00</issued>
    <id>tag:www.1001010.com,2007://1.418</id>
    <created>2007-02-28T03:22:30Z</created>
    <summary type="text/plain">I now have an extra 4 gigs free after removing my spam trap wiki! I feel so much cleaner ;-) Besides all the pr0n links, the interesting part was the groups of links that were hidden in 1px wide DIV...</summary>
    <author>
      <name>Jason</name>
      <url>http://1001010.com</url>
      <email>jason-blog@1001010.com</email>
    </author>
    <dc:subject>HTML Fun</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.1001010.com/">
      <![CDATA[<p>I now have an extra 4 gigs free after removing my spam trap wiki!</p>

<p>I feel so much cleaner ;-)</p>

<p>Besides all the pr0n links, the <em>interesting part</em> was the groups of links that were hidden in 1px wide <span class="caps">DIV </span>tags.  These entries never showed up when looking at the page.  It was as if those responsible for adding the entries were trying to up their Google search result ratings by having more sites "link to" their site.... even if those sites never display them.</p>

<p>Here's how it works..</p>


<ol>
<li>Somebody with a site wants that site to become popular and rank higher in Google's search results.</li>
<li>That somebody is <em>usually</em> a low quality scam site of some sort that usually promises to offer something for nothing and installs spy ware instead.</li>
<li>That somebody gets a bot to find all the wikis out there because wikis are notoriously insecure and (by design) allow the general public to come in and edit entries.</li>
<li>They then use another bot to connect to all those open wikis and create entries that point to their site.  The links include all sorts of descriptions to what may actually be there - perfect for a Google (or similar) that's crawling the wiki to find. </li>
<li>As an added bonus, the bot may hide the entries in 1px <span class="caps">DIV </span>tags so it appears invisible to the human viewer.</li>
<li>Now, when somebody Google's for the term that has been embedded in all those wikis - their site will be high on the list.  I mean, if all those sites link to it - it must be good? right? ;-)</li>
<li>Profit!  I think?  Nope - that was the underwhere gnomes, and they got that way back at step 3</li>
</ol>

]]>
      
    </content>
  </entry>
  <entry>
    <title>Where does the disk space go?</title>
    <link rel="alternate" type="text/html" href="http://www.1001010.com/blog/archives/000417.shtml" />
    <modified>2007-02-24T18:16:30Z</modified>
    <issued>2007-02-24T10:16:30-08:00</issued>
    <id>tag:www.1001010.com,2007://1.417</id>
    <created>2007-02-24T18:16:30Z</created>
    <summary type="text/plain"><![CDATA[Today I went to my Dreamhost control panel &amp; it showed that I was using 1% of my 461.8GB of disk space. 1%? I've never noticed it that high before. On closer inspection that's 4.9 gig!? The last time I...]]></summary>
    <author>
      <name>Jason</name>
      <url>http://1001010.com</url>
      <email>jason-blog@1001010.com</email>
    </author>
    <dc:subject>HTML Fun</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.1001010.com/">
      <![CDATA[<p>Today I went to my Dreamhost control panel &amp; it showed that I was using 1% of my 461.8GB of disk space.  1%?  I've never noticed it that high before.  On closer inspection that's 4.9 gig!?   The last time I checked it was less than 1/2 gig. </p>

<p>Digging around shows that the DB used for my wiki was taking 4 <span class="caps">GB.</span></p>

<p>My Wiki?  I <em>have</em> a wiki?</p>

<p>Ohh, <strong>now</strong> I remember.  <br />
Over a year (or two?) ago I installed a wiki on this site because - well, it was easy enough to.  Dreamhost has a bunch of one-click installs &amp; all I had to do was click a button.  I played around with the wiki and figured out how things worked - and then ignored it.<br />
  <br />
While I was busy with our new baby Seamus and work, automated spam bots filled my little test wiki with 4 gigs of junk!</p>

<p>I'm now going to go lock the wiki and find out what exactly is in there.  I'll be impressed if it's all text.  That's a lot of spam bot activity!</p>

<p><strong><span class="caps">UPDATE</span></strong><br />
<a href="http://1001010.com/wiki/index.php?title=Special%3AAllpages">All Main Pages on the wiki</a></p>

<p>It's an <em>odd</em> assortment to say the least</p>]]>
      
    </content>
  </entry>
  <entry>
    <title>Virtual Vacation</title>
    <link rel="alternate" type="text/html" href="http://www.1001010.com/blog/archives/000416.shtml" />
    <modified>2006-07-13T00:01:59Z</modified>
    <issued>2006-07-12T17:01:59-08:00</issued>
    <id>tag:www.1001010.com,2006://1.416</id>
    <created>2006-07-13T00:01:59Z</created>
    <summary type="text/plain">Last week wasn&apos;t fun, my producer was out on an extended vacation durring the 4th of July holliday. Everything was fine at first - but I was quickly reminded how much meta filtering he does for me. A coworker raised...</summary>
    <author>
      <name>Jason</name>
      <url>http://1001010.com</url>
      <email>jason-blog@1001010.com</email>
    </author>
    <dc:subject>Work</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.1001010.com/">
      <![CDATA[<p>Last week wasn't fun, my producer was out on an extended vacation durring the 4th of July holliday.  Everything was fine at first - but I was quickly reminded how much meta filtering he does for me.  </p>

<p>A coworker raised an excelent question: "Why not take your vacation when HE takes his vacation?".  Unfortunatly my producer used up most of is vacation so he won't be leaving anytime soon.</p>

<p>Bummer.</p>

<p>But what if <strong>I</strong> take a <em>virtual</em> vacation? (we all know by now that virtual==fake, right?)<br />
I'll still come in to the office and work - but I'll set my IM to "Appear offline" and set up my mail client to send an out-of-office email to every one!</p>

<p>I'll get a vacation from the distractions!  Sweet!</p>]]>
      
    </content>
  </entry>
  <entry>
    <title>Teach me to update anything</title>
    <link rel="alternate" type="text/html" href="http://www.1001010.com/blog/archives/000415.shtml" />
    <modified>2006-06-15T02:40:33Z</modified>
    <issued>2006-06-14T19:40:33-08:00</issued>
    <id>tag:www.1001010.com,2006://1.415</id>
    <created>2006-06-15T02:40:33Z</created>
    <summary type="text/plain">This morning I was waiting around the house for the delivery guy (9am - 11am window) and I figgured I would update my resume. No - I&apos;m not looking for a job, but I&apos;m still getting calls from recruters and...</summary>
    <author>
      <name>Jason</name>
      <url>http://1001010.com</url>
      <email>jason-blog@1001010.com</email>
    </author>
    <dc:subject>Humor</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.1001010.com/">
      <![CDATA[<p>This morning I was waiting around the house for the delivery guy (9am - 11am window) and I figgured I would update my resume.  No - I'm not looking for a job, but I'm still getting calls from recruters and their junk in my inbox - which needs to stop.  Well that and it was bugging me to think that I still has Nexa as a "current" position when I have moved on to a more appropriate position.</p>

<p>If you look at my <a href="http://1001010.com/resume/">resume</a> page, you'll see bold letters at the top that read <b>"I'm off the market"</b></p>

<p>If you look at the word <a href="http://1001010.com/resume/resume.doc">doc</a>, I changed the listed email to my gmail account and added the <span class="caps">BOLD TEXT WITH THE BRIGHT YELLOW BACKGROUND</span><br />
<b>"Availability &nbsp; &nbsp;	<span class="caps">OFF THE MARKET AND UNAVAILABLE</span> AT <span class="caps">THIS TIME </span>this resume is here for historical purposes"</b></p>

<p>And then <span class="caps">TWO </span>(2) hours later, I get this jem of humor in my gmail inbox ;-)</p>

<blockquote><p>Jason,<br />
 <br />
I assume you are currently happy at employer x as your online resume indicates I won't be a pest. I am working on an assignment in the LA area for a senior online games coder for a great developer working on an original next gen title. <br />
 <br />
If your situation changes for any reason and you want to know your options please consider dropping me a line :)<br />
 <br />
Xxxx Xxxxxxx<br />
Vice President/Executive Recruiter<br />
<span class="caps">TSC</span> Management Services Group, Inc.<br />
<span class="caps">NNN.NNN.NNNN </span>ext. <span class="caps">NN, XXXXX</span>@XXXXXXXXX.XXX</p></blockquote>


<p><span class="caps">THAT WAS TWO HOURS LATER</span>?!  <span class="caps">WTF.</span></p>

<p>I'm honored that my skills are apparently so valuable - but let me be clear: Unless you can offer me 200K/yr to sit around an pick my nose - with a 500K restriction free signing bonus - I AM <span class="caps">NOT INTERESTED.</span></p>

<p>I just want to know:  How the frack did this guy find my resume that quickly?  Is Google that powerfull or do they have other tools?  </p>

<p>And no - I do not want to work on those types of applications at this time. ;-)</p>]]>
      
    </content>
  </entry>
  <entry>
    <title>Where&apos;s my 6Ghz Pentium something-or-other?</title>
    <link rel="alternate" type="text/html" href="http://www.1001010.com/blog/archives/000413.shtml" />
    <modified>2005-10-12T19:17:54Z</modified>
    <issued>2005-10-12T12:17:54-08:00</issued>
    <id>tag:www.1001010.com,2005://1.413</id>
    <created>2005-10-12T19:17:54Z</created>
    <summary type="text/plain">It&apos;s been like 3 years since I got my P4 3.06Ghz and I&apos;m a little confused. I thought that there would be 6Ghz CPUs out on the market by now. What was that thing about speeds allegedly doubling every 2...</summary>
    <author>
      <name>Jason</name>
      <url>http://1001010.com</url>
      <email>jason-blog@1001010.com</email>
    </author>
    <dc:subject>rant</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.1001010.com/">
      <![CDATA[<p>It's been like 3 years since I got my P4 3.06Ghz and I'm a little confused.<br />
I thought that there would be 6Ghz <span class="caps">CPU</span>s out on the market by now.</p>

<p>What was that thing about speeds allegedly <a href="http://en.wikipedia.org/wiki/Moore's_law">doubling every 2 years?</a></p>

<p>The fastest thing I can get from dell these days is a P4 3.8Ghz ?</p>

<p>Did I miss a memo?  Since when is a 25% increase a "doubling"?<br />
Could <span class="caps">AMD'</span>s PR rating/propaganda be right?  Maybe it's not about the the Hertz?  I'm so confused.</p>

<p>::sigh::</p>

<p>The real problem is that after years of buying a new twice as fast PC every few years, I've been conditioned to <em>want</em> a new (twice as fast) PC every few years.<br />
Right now it's just not worth it.  My 3.06Ghz is just fine.  And I think <em>that</em> weirds me out more than anything else.</p>


<p><br /><br />
But that wont stop me from looking for a faster video card ;-)</p>]]>
      
    </content>
  </entry>
  <entry>
    <title>Inititializing static class members</title>
    <link rel="alternate" type="text/html" href="http://www.1001010.com/blog/archives/000412.shtml" />
    <modified>2005-10-04T16:41:27Z</modified>
    <issued>2005-10-04T09:41:27-08:00</issued>
    <id>tag:www.1001010.com,2005://1.412</id>
    <created>2005-10-04T16:41:27Z</created>
    <summary type="text/plain">How many times have you heard that &quot;you must initialize static class members in the .cpp file&quot;? When my team leader (Ray) saw my previous post he immediately said, &quot;well we have put the initialization in the .cpp file&quot;. I...</summary>
    <author>
      <name>Jason</name>
      <url>http://1001010.com</url>
      <email>jason-blog@1001010.com</email>
    </author>
    <dc:subject>Code</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.1001010.com/">
      <![CDATA[<p>How many times have you heard that <i>"you must initialize static class members in the .cpp file"</i>?<br />
When my team leader (Ray) saw my <a href="http://www.1001010.com/blog/archives/000409.shtml">previous post</a> he immediately said, "well we have put the initialization in the .cpp file". <br />
I smirked.</p>

<p>That near pavlovian response is somehow ingrained in the c++ programmer's collective subconscious.  I can see how, most of us were taught that the class and function definitions go into the .h file while the implementation goes in the .cpp file.  And the initializing of static member would definitely fall into the category of initialization.</p>

<p>Have you ever even tried to do it in the .h?</p>

<p>Never?  really? that doesn't surprise me.  But did you know that it's done all over the place in the <span class="caps">ATL</span>?<br />
Think about it - the <span class="caps">ATL </span>resides almost entirely in .h files.  The exception being WinMain/DllMain exports and some calloc/realloc/free wrappers. </p>

<p>And there are static class members in there ...</p>

<p>They're initialized in the .h file ...</p>

<p>And they compile ...</p>

<p>[insert spooky Halloween music here]</p>]]>
      
    </content>
  </entry>
  <entry>
    <title>intitializing a static member of a template class</title>
    <link rel="alternate" type="text/html" href="http://www.1001010.com/blog/archives/000409.shtml" />
    <modified>2005-09-23T16:39:41Z</modified>
    <issued>2005-09-23T09:39:41-08:00</issued>
    <id>tag:www.1001010.com,2005://1.409</id>
    <created>2005-09-23T16:39:41Z</created>
    <summary type="text/plain"><![CDATA[Note to self: the format of static template class member is template&lt;class T&gt; int Test&lt;T&gt;::s_counter = 0; And don't I forget it! (what I originally forgot was the &lt;T&gt; - D'oH!) // testtemplate.cpp : Defines the entry point for the...]]></summary>
    <author>
      <name>Jason</name>
      <url>http://1001010.com</url>
      <email>jason-blog@1001010.com</email>
    </author>
    <dc:subject>Code</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.1001010.com/">
      <![CDATA[<p>Note to self: the format of static template class member is <br /><b>template&lt;class T&gt; int Test&lt;T&gt;::s_counter = 0;</b></p>

<p>And don't I forget it!<br />
(what I originally forgot was the <u>&lt;T&gt;</u> - D'oH!)</p>

<code>

<pre>
// testtemplate.cpp : Defines the entry point for the console application.
#include &quot;stdafx.h&quot;

template &lt;class T&gt;
class Test
{
public:
    static int s_counter;

    Test()
    {
        s_counter++;
    }

    ~Test()
    {
        s_counter--;
    }

    static int getInstanceCount()
    {
        return s_counter;
    }
};

template&lt;class T&gt; int Test&lt;T&gt;::s_counter = 0;

int main(int argc, char* argv[])
{
    Test&lt;long&gt; a,b,c,d,e,f,g[3];
    printf(&quot;InstanceCount: %d\n&quot;, Test&lt;long&gt;::getInstanceCount());
    return 0;
}</pre>

</code>]]>
      
    </content>
  </entry>
  <entry>
    <title>TODO: Find out if devstudio is stopped at a break point</title>
    <link rel="alternate" type="text/html" href="http://www.1001010.com/blog/archives/000408.shtml" />
    <modified>2005-09-22T23:05:59Z</modified>
    <issued>2005-09-22T16:05:59-08:00</issued>
    <id>tag:www.1001010.com,2005://1.408</id>
    <created>2005-09-22T23:05:59Z</created>
    <summary type="text/plain">I need to find a good book on dev studio scripting. Maybe I haven&apos;t thought this all through yet, but what I think I want is something that will automatically set my &quot;away&quot; status text in messenger based upon events...</summary>
    <author>
      <name>Jason</name>
      <url>http://1001010.com</url>
      <email>jason-blog@1001010.com</email>
    </author>
    <dc:subject>Code</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.1001010.com/">
      <![CDATA[<p>I need to find a good book on dev studio scripting.  </p>

<p>Maybe I haven't thought this all through yet, but what I think I want is something that will automatically set my "away" status text in messenger based upon events in DevStudio.</p>

<p>But why would you need that?</p>

<p>Well, just as when your status is "away" when the screen saver starts - it would nice to do the same when a break point hits or set it to "busy" when your typing in the editor.</p>

<p>In my scenario as soon as a break point was hit - the status would change to "Can't talk now - I'm in the debugger baby!!"</p>

<p>I know that nearly everything is scripted in DevStudio, there's got to be a way to monitor user / debugger events.   I would hate to hack together some solution where I monitor the child processes of <span class="caps">MSDEV.EXE </span>and install a DirectInput global keyboard hook - and match up keyboard input to the active window.</p>]]>
      
    </content>
  </entry>
  <entry>
    <title>Visitied Walla @ Blizzard for lunch</title>
    <link rel="alternate" type="text/html" href="http://www.1001010.com/blog/archives/000407.shtml" />
    <modified>2005-09-17T00:06:10Z</modified>
    <issued>2005-09-16T17:06:10-08:00</issued>
    <id>tag:www.1001010.com,2005://1.407</id>
    <created>2005-09-17T00:06:10Z</created>
    <summary type="text/plain">It took me a while - I got lost again. {mockingly shakes fist} Damn you UC regents for moving streets around so that my car&apos;s GPS gets overly confused! I was allowed in after being buzzed in through two separate...</summary>
    <author>
      <name>Jason</name>
      <url>http://1001010.com</url>
      <email>jason-blog@1001010.com</email>
    </author>
    <dc:subject>rant</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.1001010.com/">
      <![CDATA[<p>It took me a while - I got lost again.  </p>

<p>{mockingly shakes fist} Damn you UC regents for moving streets around so that my car's <span class="caps">GPS </span>gets overly confused!</p>

<p>I was allowed in after being buzzed in through two separate doors.  Since I signed an <span class="caps">NDA </span>&amp; don't want to do <em>another full cavity search</em> I can't and don't really want to say anything.  But I could possibly describe the office as what would happen if all the <i>stuff</i> from every trade show Blizzard ever went to, around the world, exploded in the old GameSpy Irvine office.  </p>]]>
      
    </content>
  </entry>
  <entry>
    <title>Things I dislike: Hard Coded IP Addresses</title>
    <link rel="alternate" type="text/html" href="http://www.1001010.com/blog/archives/000406.shtml" />
    <modified>2005-09-14T18:01:56Z</modified>
    <issued>2005-09-14T11:01:56-08:00</issued>
    <id>tag:www.1001010.com,2005://1.406</id>
    <created>2005-09-14T18:01:56Z</created>
    <summary type="text/plain">I seem to remember an incident or two where various game developers set the address of their master server to a specific IP address, rather than a DNS name. Can you guess what happened to those games when that server...</summary>
    <author>
      <name>Jason</name>
      <url>http://1001010.com</url>
      <email>jason-blog@1001010.com</email>
    </author>
    <dc:subject>Code</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.1001010.com/">
      <![CDATA[<p>I seem to remember an incident or two where various game developers set the address of their master server to a specific IP address, rather than a <span class="caps">DNS </span>name.</p>

<p>Can you guess what happened to those games when that server was moved to a different IP?</p>

<p><span class="caps">DING DING DING DING DING DING</span>!  That's right - it <b>all</b> broke.  <i>Vana - tell our lucky player what s/he's won!</i></p>

<p>Well, if you're lucky (there are more than 100 servers, the game company is still in business, there is at least one person still working activly on the codebase, and management is willing to <span class="caps">QA, </span>support and publish it) they <i><b>might</b></i> release a patch.  But only if you're lucky ;-)  </p>

<p>But if you're unlucky - well... say hello to a new friend - the ulcer.</p>]]>
      
    </content>
  </entry>
  <entry>
    <title>Things I dislike: Copy&apos;n&apos;Paste Comments</title>
    <link rel="alternate" type="text/html" href="http://www.1001010.com/blog/archives/000405.shtml" />
    <modified>2005-09-13T21:04:40Z</modified>
    <issued>2005-09-13T14:04:40-08:00</issued>
    <id>tag:www.1001010.com,2005://1.405</id>
    <created>2005-09-13T21:04:40Z</created>
    <summary type="text/plain">OK, I get it - you copied a function that did 75% of what you want to accomplish and updated it to do your evil bidding. But why then did you keep the original function comment??? it would be as...</summary>
    <author>
      <name>Jason</name>
      <url>http://1001010.com</url>
      <email>jason-blog@1001010.com</email>
    </author>
    <dc:subject>Code</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.1001010.com/">
      <![CDATA[<p><span class="caps">OK,</span> I get it - you copied a function that did 75% of what you want to accomplish and updated it to do your evil bidding.</p>

<p>But why then did you keep the original function comment???</p>

<p>it would be as if you had the code....</p>


<pre><code>
// Sometimes we need have someone else multiply radius by two
bool getDiameterFromRadius(float radius, double &amp; rDiameter) { ... }
</code></pre>



<p>And somebody copied the function to do something else....</p>


<pre><code>
// Sometimes we need have someone else multiply radius by two
bool getCircumferenceFromRadius(float radius, double &amp; rCircumference) { ... }
</code></pre>



<p><span class="caps">AND LEFT THE SAME COMMENT</span> IN <span class="caps">PLACE.</span></p>

<p>.ugh.</p>]]>
      
    </content>
  </entry>
  <entry>
    <title>Things I dislike: Hard-coded variable menu items</title>
    <link rel="alternate" type="text/html" href="http://www.1001010.com/blog/archives/000404.shtml" />
    <modified>2005-09-08T00:41:38Z</modified>
    <issued>2005-09-07T17:41:38-08:00</issued>
    <id>tag:www.1001010.com,2005://1.404</id>
    <created>2005-09-08T00:41:38Z</created>
    <summary type="text/plain">Hmm, that&apos;s not the best title - but maybe a contrived code sample or two will help out in explaining why sometimes I weep when I look at certain bits of code. Imagine if you would, creating a context menu...</summary>
    <author>
      <name>Jason</name>
      <url>http://1001010.com</url>
      <email>jason-blog@1001010.com</email>
    </author>
    <dc:subject>Code</dc:subject>
    <content type="text/html" mode="escaped" xml:lang="en" xml:base="http://www.1001010.com/">
      <![CDATA[<p>Hmm, that's not the best title - but maybe a contrived code sample or two will help out in explaining why sometimes I weep when I look at certain bits of code.</p>

<p>Imagine if you would, creating a context menu with a few dynamic elements without IDs</p>


<pre><code>
menu-&gt;append(&quot;Hello&quot;);
menu-&gt;append(&quot;This&quot;);
menu-&gt;append(&quot;is a&quot;);
menu-&gt;append(&quot;Test&quot;);
</code></pre>



<p>And you responded to the elements not by an ID number, but by a position index.</p>


<pre><code>
switch(selectedIndex):
{
    case 0: doHello(); break;
    case 1: doThis();  break;
    case 2: doIsA();   break;
    case 3: doTest();  break;
}
</code></pre>



<p>And then when you look at the code that creates the menu item with greater scrutiny, you notice it's not as simple as you once thought...</p>


<pre><code>
menu-&gt;append(&quot;Hello&quot;);
if(hasPermission(SECURITY_RIGHTS_THIS))
    menu-&gt;append(&quot;This&quot;);
menu-&gt;append(&quot;is a&quot;);
menu-&gt;append(&quot;Test&quot;);
</code></pre>



<p>That's why I wept.<br />
If an unlucky user doesn't have <code>SECURITY_RIGHTS_THIS</code> all the following menu items will be off by one!  <br />
This isn't a hard coded <span class="caps">COM </span>interface contract, but it IS a handshake usage contract that a future maintenance programmer (such as myself) may not even be aware of! </p>

<p>So here's a simple solution <i>(if you can't change it to use proper IDs because it would effect to many systems)</i>:<br />
Keep a table of what menu items were added and their appended menu index.  Maybe something along the lines of </p>

<pre><code>
enum PossibleMenuItems { pmiHello, pmiThis, pmiIsA, pmiTest, pmi_MAX };
typedef map&lt;int, PossibleMenuItems&gt; IndexToMenuItem;
IndexToMenuItem m_IndexToCommand;
...
int nMenuIndex = 0;
// For each item you add, append it AND record it...
menu-&gt;append(&quot;Hello&quot;);
m_IndexToCommand[nMenuIndex++] = pmiHello;

if(hasPermission(SECURITY_RIGHTS_THIS))
{
    menu-&gt;append(&quot;This&quot;);
    m_IndexToCommand[nMenuIndex++] = pmiThis;
}
...
</code></pre>



<p>Then in the menu handler...</p>


<pre><code>
IndexToMenuItem::iterator itFind = m_IndexToCommand.find(selectedIndex);
if( itFind != m_IndexToCommand.end() )
{
  switch( (*itFind) )
  {
    case pmiHello: doHello(); break;
    case pmiThis:  doThis();  break;
    case pmiIsA:   doIsA();   break;
    case pmiTest:  doTest();  break;
  }
}
</code></pre>



<p>Now it no longer matters if an item is not added to the menu.  As long as the table is updated - I'm happy.</p>]]>
      
    </content>
  </entry>

</feed>