<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>JohnArmitage.net - duh</title>
    <link>http://www.johnarmitage.net/word/</link>
    <description />
    <language>en-us</language>
    <copyright>John Armitage</copyright>
    <lastBuildDate>Fri, 18 Aug 2006 13:45:23 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 1.9.6264.0</generator>
    <managingEditor>blog@johnarmitage.net</managingEditor>
    <webMaster>blog@johnarmitage.net</webMaster>
    <item>
      <trackback:ping>http://www.johnarmitage.net/word/Trackback.aspx?guid=aae86c97-eea1-47fd-897a-bd5188d168b5</trackback:ping>
      <pingback:server>http://www.johnarmitage.net/word/pingback.aspx</pingback:server>
      <pingback:target>http://www.johnarmitage.net/word/PermaLink,guid,aae86c97-eea1-47fd-897a-bd5188d168b5.aspx</pingback:target>
      <dc:creator>John</dc:creator>
      <wfw:comment>http://www.johnarmitage.net/word/CommentView,guid,aae86c97-eea1-47fd-897a-bd5188d168b5.aspx</wfw:comment>
      <wfw:commentRss>http://www.johnarmitage.net/word/SyndicationService.asmx/GetEntryCommentsRss?guid=aae86c97-eea1-47fd-897a-bd5188d168b5</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Ok, so this isn't so much "Smooth" in the sense that it's a really slick piece of
code.  Rather it's "Smooth" because it took me way to long too figure it out
and I thought that I better write it down somewhere that google has a chance of indexing
it.  That way a month from now when I may have forgotten this, I'll be able to
look it up. 
</p>
        <p>
I'm working on this project where I show users an image and they can perform some
zoom in type action where they click on the image and drag a rectangle, or they click
on a bunch of points to draw lines allowing them to draw their own shape.  This
is basically all accomplished with javascript.  Good.  Not hard to figure
out.  When they are done drawing their shape, I am clicking on a button in the
background (by using javascript) to force a postback so that I can call some web service
in the code behind and reload the image.  Note that this isn't a full Page postback,
since I'm using an <a href="http://anthem-dot-net.sourceforge.net/">anthem</a>:button.
</p>
        <p>
Ok, so all is well, I get the new image url, I load it up.  Done!  Not quite. 
Because in my case, I'm doing some fancy fade in from a placeholder image that lets
the user know that something is going on.  Ok, so I need to get back to running
some javascript.  Stick it in the window.onload event.  Yeah.....no. 
Not so much.  This is where anthem causes a problem because the page isn't actually
reloading.  Just my image....which did I mention is an anthem:image?  So
the obvious solution now is to put my javascript method call in the
image's onload event.  Sounds like a good idea, right?  Well it is, but
the only tricky part is, how do you do it?
</p>
        <p>
This doesn't work:<br /></p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <font color="#000080">&lt;</font>
            <font color="#a52a2a">anthem:image</font>
            <font color="#ff0000">onload=</font>
            <span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">
              <font color="#000080">"FancyFadeIn()"&gt;</font>
            </span>
            <font color="#000080"> &lt;/</font>
            <font color="#a52a2a">anthem:image</font>
            <font color="#000080">&gt;</font>
          </span>
        </p>
        <p>
That's because an anthem:image doesn't play the onload game that way.  BUT if
you really know what's going on, you'll know that when everything is said and done
that &lt;anthem:image&gt; ends up as an &lt;img&gt; which does have an onload event. 
To add that attribute using the Language of the Gods VB.NET, you do something like
this:
</p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Me</span>.mapImage.Attributes.<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">Add</span>(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"onload"</span>, <span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"FancyFadeIn()"</span>)</span>
        </p>
        <p>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <font face="Verdana" size="2">Now
when the image reloads, the fade in javascript is called and everything is right
with the world.</font>
          </span>
        </p>
        <img width="0" height="0" src="http://www.johnarmitage.net/word/aggbug.ashx?id=aae86c97-eea1-47fd-897a-bd5188d168b5" />
      </body>
      <title>Smooth Code Move of the Week</title>
      <guid isPermaLink="false">http://www.johnarmitage.net/word/PermaLink,guid,aae86c97-eea1-47fd-897a-bd5188d168b5.aspx</guid>
      <link>http://www.johnarmitage.net/word/PermaLink,guid,aae86c97-eea1-47fd-897a-bd5188d168b5.aspx</link>
      <pubDate>Fri, 18 Aug 2006 13:45:23 GMT</pubDate>
      <description>&lt;p&gt;
Ok, so this isn't so much "Smooth" in the sense that it's a really slick piece of
code.&amp;nbsp; Rather it's "Smooth" because it took me way to long too figure it out
and I thought that I better write it down somewhere that google has a chance of indexing
it.&amp;nbsp; That way a month from now when I may have forgotten this, I'll be able to
look it up.&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
I'm working on this project where I show users an image and they can perform some
zoom in type action where they click on the image and drag a rectangle, or they click
on a bunch of points to draw lines allowing them to draw their own shape.&amp;nbsp; This
is basically all accomplished with javascript.&amp;nbsp; Good.&amp;nbsp; Not hard to figure
out.&amp;nbsp; When they are done drawing their shape, I am clicking on a button in the
background (by using javascript) to force a postback so that I can call some web service
in the code behind and reload the image.&amp;nbsp; Note that this isn't a full Page postback,
since I'm using an &lt;a href="http://anthem-dot-net.sourceforge.net/"&gt;anthem&lt;/a&gt;:button.
&lt;/p&gt;
&lt;p&gt;
Ok, so all is well, I get the new image url, I load it up.&amp;nbsp; Done!&amp;nbsp; Not quite.&amp;nbsp;
Because in my case, I'm doing some fancy fade in from a placeholder image that lets
the user know that something is going on.&amp;nbsp; Ok, so I need to get back to running
some javascript.&amp;nbsp; Stick it in the window.onload event.&amp;nbsp; Yeah.....no.&amp;nbsp;
Not so much.&amp;nbsp; This is where anthem causes a problem because the page isn't actually
reloading.&amp;nbsp; Just my image....which did I mention is an anthem:image?&amp;nbsp; So
the obvious solution now is to put&amp;nbsp;my javascript&amp;nbsp;method call&amp;nbsp;in the
image's onload event.&amp;nbsp; Sounds like a good idea, right?&amp;nbsp; Well it is, but
the only tricky part is, how do you do it?
&lt;/p&gt;
&lt;p&gt;
This doesn't work:&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font color=#000080&gt;&amp;lt;&lt;/font&gt;&lt;font color=#a52a2a&gt;anthem:image&lt;/font&gt; &lt;font color=#ff0000&gt;onload=&lt;/font&gt;&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;&lt;font color=#000080&gt;"FancyFadeIn()"&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;font color=#000080&gt; &amp;lt;/&lt;/font&gt;&lt;font color=#a52a2a&gt;anthem:image&lt;/font&gt;&lt;font color=#000080&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
That's because an anthem:image doesn't play the onload game that way.&amp;nbsp; BUT if
you really know what's going on, you'll know that when everything is said and done
that &amp;lt;anthem:image&amp;gt; ends up as an &amp;lt;img&amp;gt; which does have an onload event.&amp;nbsp;
To add that attribute using the Language of the Gods VB.NET, you do something like
this:
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Me&lt;/span&gt;.mapImage.Attributes.&lt;span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;Add&lt;/span&gt;(&lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"onload"&lt;/span&gt;, &lt;span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4"&gt;"FancyFadeIn()"&lt;/span&gt;)&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent"&gt;&lt;font face=Verdana size=2&gt;Now
when the&amp;nbsp;image reloads, the fade in javascript is called and everything is right
with the world.&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.johnarmitage.net/word/aggbug.ashx?id=aae86c97-eea1-47fd-897a-bd5188d168b5" /&gt;</description>
      <comments>http://www.johnarmitage.net/word/CommentView,guid,aae86c97-eea1-47fd-897a-bd5188d168b5.aspx</comments>
      <category>duh;code;anthem</category>
    </item>
    <item>
      <trackback:ping>http://www.johnarmitage.net/word/Trackback.aspx?guid=c34cbc12-4063-4c53-a3ce-0ddd451091f5</trackback:ping>
      <pingback:server>http://www.johnarmitage.net/word/pingback.aspx</pingback:server>
      <pingback:target>http://www.johnarmitage.net/word/PermaLink,guid,c34cbc12-4063-4c53-a3ce-0ddd451091f5.aspx</pingback:target>
      <dc:creator>John</dc:creator>
      <wfw:comment>http://www.johnarmitage.net/word/CommentView,guid,c34cbc12-4063-4c53-a3ce-0ddd451091f5.aspx</wfw:comment>
      <wfw:commentRss>http://www.johnarmitage.net/word/SyndicationService.asmx/GetEntryCommentsRss?guid=c34cbc12-4063-4c53-a3ce-0ddd451091f5</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
This is one of those stupid things.  Something where I’m trying to do something
and it’s just not working.  Then when I figure out how to do it, I get that feeling
like “I should have known how to do this”.  Many times that statement is modified
to be “I only program freaking computers for a living, you would think that I would
know how to do this”.  
</p>
        <p>
Today I was trying to put a link into a <a href="http://office.microsoft.com/en-us/FX010858031033.aspx">OneNote</a> page. 
Simple enough, right?  You would think so.  The only problem was that my
link had a few spaces in it \\SomeFancyServer\Applications Teams\Dev Team\Support. 
Now if I was adding this link to something like Word, I would click on the Insert/Hyperlink
menu item because I know that links and spaces in the address don’t mix.  But
OneNote doesn’t have that.  My first instinct was to put it in quotes. 
I didn’t think that would work, and it didn’t.  I next thought of using braces
‘[ ]’.  I really thought that was going to work, but it didn’t.  I scoured
the drop down menus for some kind of hyperlink functionality.  Nothing. 
I resorted to using help.  Nothing helpful.  It said to type in the link
and it would automatically be created.  It’s like nobody thought about spaces
in a link.  Not that it is an ideal thing to do, but it is not all that uncommon. 
Luckily some online research <a href="http://office.microsoft.com/en-us/assistance/HA011272421033.aspx">provided
some help</a> (actually for Outlook).  Use chevrons ‘&lt; &gt;’, or if you
are me use less than, greater than ‘&lt; &gt;’.  
<br />
This fixed my problem.  &lt;<a href="http://en.wikipedia.org/wiki/Chevron">Now
I can link with as many spaces as I want when using OneNote</a>&gt;.  
</p>
        <p>
Of course I’ll be using this everywhere now, just to see where it works.  You
often find these Microsoft shortcuts work across many applications.  Try using
ALT+Click/Drag the mouse sometime.  I learned that one using Visual Studio. 
I was surprised to see that it also worked in Word.  
<br /><br />
Notice that I filed this under 'duh'.  That's so I'll know where to look back
a month from now when I forget how to add a link that contains spaces.
</p>
        <img width="0" height="0" src="http://www.johnarmitage.net/word/aggbug.ashx?id=c34cbc12-4063-4c53-a3ce-0ddd451091f5" />
      </body>
      <title>Chevrons aren’t just for Sergeants</title>
      <guid isPermaLink="false">http://www.johnarmitage.net/word/PermaLink,guid,c34cbc12-4063-4c53-a3ce-0ddd451091f5.aspx</guid>
      <link>http://www.johnarmitage.net/word/PermaLink,guid,c34cbc12-4063-4c53-a3ce-0ddd451091f5.aspx</link>
      <pubDate>Thu, 06 Apr 2006 13:42:49 GMT</pubDate>
      <description>&lt;p&gt;
This is one of those stupid things.&amp;nbsp; Something where I’m trying to do something
and it’s just not working.&amp;nbsp; Then when I figure out how to do it, I get that feeling
like “I should have known how to do this”.&amp;nbsp; Many times that statement is modified
to be “I only program freaking computers for a living, you would think that I would
know how to do this”.&amp;nbsp; 
&lt;/p&gt;
&lt;p&gt;
Today I was trying to put a link into a &lt;a href="http://office.microsoft.com/en-us/FX010858031033.aspx"&gt;OneNote&lt;/a&gt; page.&amp;nbsp;
Simple enough, right?&amp;nbsp; You would think so.&amp;nbsp; The only problem was that my
link had a few spaces in it \\SomeFancyServer\Applications Teams\Dev Team\Support.&amp;nbsp;
Now if I was adding this link to something like Word, I would click on the Insert/Hyperlink
menu item because I know that links and spaces in the address don’t mix.&amp;nbsp; But
OneNote doesn’t have that.&amp;nbsp; My first instinct was to put it in quotes.&amp;nbsp;
I didn’t think that would work, and it didn’t.&amp;nbsp; I next thought of using braces
‘[ ]’.&amp;nbsp; I really thought that was going to work, but it didn’t.&amp;nbsp; I scoured
the drop down menus for some kind of hyperlink functionality.&amp;nbsp; Nothing.&amp;nbsp;
I resorted to using help.&amp;nbsp; Nothing helpful.&amp;nbsp; It said to type in the link
and it would automatically be created.&amp;nbsp; It’s like nobody thought about spaces
in a link.&amp;nbsp; Not that it is an ideal thing to do, but it is not all that uncommon.&amp;nbsp;
Luckily some online research &lt;a href="http://office.microsoft.com/en-us/assistance/HA011272421033.aspx"&gt;provided
some help&lt;/a&gt;&amp;nbsp;(actually for Outlook).&amp;nbsp; Use chevrons ‘&amp;lt; &amp;gt;’, or if you
are me use less than, greater than ‘&amp;lt; &amp;gt;’.&amp;nbsp; 
&lt;br&gt;
This fixed my problem.&amp;nbsp; &amp;lt;&lt;a href="http://en.wikipedia.org/wiki/Chevron"&gt;Now
I can link with as many spaces as I want when using OneNote&lt;/a&gt;&amp;gt;.&amp;nbsp; 
&lt;/p&gt;
&lt;p&gt;
Of course I’ll be using this everywhere now, just to see where it works.&amp;nbsp; You
often find these Microsoft shortcuts work across many applications.&amp;nbsp; Try using
ALT+Click/Drag the mouse sometime.&amp;nbsp; I learned that one using Visual Studio.&amp;nbsp;
I was surprised to see that it also worked in Word.&amp;nbsp; 
&lt;br&gt;
&lt;br&gt;
Notice that I filed this under 'duh'.&amp;nbsp; That's so I'll know where to look back
a month from now when I forget how to add a link that contains spaces.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.johnarmitage.net/word/aggbug.ashx?id=c34cbc12-4063-4c53-a3ce-0ddd451091f5" /&gt;</description>
      <comments>http://www.johnarmitage.net/word/CommentView,guid,c34cbc12-4063-4c53-a3ce-0ddd451091f5.aspx</comments>
      <category>duh</category>
    </item>
  </channel>
</rss>