Friday, May 28, 2010

Why is my ASP:Image not accessible from the vb?

I just figured this out. Figured it might bite someone else someday.

Given this code in an aspx file:

<table width="100%">
<tr>
<td class="normaltxt10" colSpan="50">
<!--
<asp:DataGrid id="dgImage" runat="server" ShowHeader="False"
AutoGenerateColumns="False" TabIndex="5">
<Columns>
<asp:BoundColumn Visible="False" DataField="file"></asp:BoundColumn>
<asp:TemplateColumn>
<ItemTemplate>
-->
<asp:Image ID="screenShotImage" Runat="server"></asp:Image>
<!--
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
-->
</td>
</tr>
</table>


Why would screenShotImage be not accessible in the vb code behind?

Answer: because it's in the commented out DataGrid, and in my case, dgImage wasn't referenced at all in the vb.
Removing the commented out DataGrid will fix this.
Like so:

<table width="100%">
<tr>
<td class="normaltxt10" colSpan="50">
<asp:Image ID="screenShotImage" Runat="server"></asp:Image>
</td>
</tr>
</table>

This is stupid in my opinion, but whatever. Now we know.

Monday, April 12, 2010

Far as a rental car can go

Gosh, I love driving the hell out of a rental car. I mean, it's not mine, and so long as I don't total it or get caught, no repercussions for me, right? I won't have to live with this car for very long, don't have to worry about any long term maintenance of it, so I can use it and abuse it with reckless abandon. The sheer acceleration that I'd never do in my car, knowing that it's all consequence-free because it's not my property that I'm fooling around with, there's simply No Comparison to that kind of thrill, is there?
If only I could live, constantly and henceforth, with the joy of non-ownership of that which I have: a house that I don't have to clean, friends that I don't have to be nice to, a body I can just totally let go of- that would be awesome. And if everybody else could do the same, surely that would be heaven.

Thursday, April 8, 2010

Output from a friend's cool applet



From here to here.

Must come back later and fool around with this some more.
I think my nephew (who has shown interest in animation) would really enjoy this.

Sunday, April 4, 2010

Heh

Working with XSL right now:

<xsl:choose>
<xsl:when test="1=1">
1=1
</xsl:when>
<xsl:otherwise>
1=2
</xsl:otherwise>
</xsl:choose>

prints out 1=1.
But

<xsl:choose>
<xsl:when test="a=a">
a=a
</xsl:when>
<xsl:otherwise>
a=b
</xsl:otherwise>
</xsl:choose>

prints out a=b.

So, a does not equal a, eh?

Friday, March 26, 2010

Perhaps someone can explain this to me

Let's start with this:
http://factcheck.org/2010/03/a-final-weekend-of-whoppers/

I'm glad to see a low-bias, honest presentation of the facts. One fact, though, that I don't see emphasized enough (here and in a lot of other places) is this: "mandating that individuals buy coverage". Why is this okay? Why would this not be seen as an outrageous affront to my personal liberty?

I've heard that if one does not accept the mandate, one must pay a fine, a non-insurance fee. The rest of this rant is based on the quite possibly false assumption that this is true.

Consider this. Let's say I give you the following choice: either you
1- chop off one of your feet and I give you a magical golden blanket that keeps you from getting sick (maybe); or
2- chop off one of your toes. You get nothing in return and your toe goes into a pot to help pay for other people's magical golden blankets.

Now, nevermind which option you choose- you can decide on your own time and keep that to yourself. What I want to know is:
Is it a good thing that you are being forced to make this choice? Hypothetically, am I a good person for forcing this choice upon you?

I'm sure I'm missing something here and I'd greatly appreciate someone telling me what it is, please. I'm honestly curious. If I'm not missing something, then I'm just baffled.

Wednesday, March 17, 2010

Set with Select

Today's forehard slap is brought to you by the following:

This is a perfectly valid syntax for setting a local variable using SET which gets its value from a SELECT:
set @VAR1 = (select var1 from table1 (nolock) where var2 = @var2 and var3 = @var3)

This will bring your company to a grinding halt and leave everyone breathing down your neck till you fix it:
set @VAR1 = select var1 from table1 (nolock) where var2 = @var2 and var3 = @var3

Be careful to note and recall the difference.

Thursday, March 11, 2010

Today I learned a little about robocopy and exit codes

So, not satisfied with the old DOS command "copy", I decided to step it up a notch and start using robocopy. This way, instead of overwriting the same files every time I rebuilt my solution in VisualStudio, I could skip over those and only update the files that had changed. And there was much rejoicing.

But lo, this tale would have ended much too soon and boringly if that was all there was to it. No, unlike copy, robocopy has the added bonus of exitting with a non-zero value when actually copying a file (and when not copying a file: either returning zero or not returning anything at all- it looks the same to me). VisualStudio interprets any non-zero exit code as "FAIL!". So, digging around, I found the way around this: in the bat file with all the robocopy calls, make the last line something other than a robocopy call, like: echo "Done."

Done. Yay!