<?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>// do something here</title>
	<atom:link href="http://www.dosomethinghere.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dosomethinghere.com</link>
	<description>Turning impossibilities into 1s and 0s professionally since 0&#120;07C1</description>
	<lastBuildDate>Fri, 19 Mar 2010 16:34:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>E-Tech Sony replacement keyboard woes</title>
		<link>http://www.dosomethinghere.com/2010/03/19/e-tech-sony-replacement-keyboard-woes/</link>
		<comments>http://www.dosomethinghere.com/2010/03/19/e-tech-sony-replacement-keyboard-woes/#comments</comments>
		<pubDate>Fri, 19 Mar 2010 16:34:09 +0000</pubDate>
		<dc:creator>BP</dc:creator>
				<category><![CDATA[Hardware adventures]]></category>
		<category><![CDATA[Hardware]]></category>

		<guid isPermaLink="false">http://www.dosomethinghere.com/?p=491</guid>
		<description><![CDATA[For many years, I faithfully used a Sony Vaio VGN-FS742/W notebook computer. This computer was an absolute workhorse, and I never had a problem with it, despite using it heavily for software development as well as the usual e-mail and web surfing activities.
After I let my brother and his family use the computer, an unfortunate incident [...]]]></description>
			<content:encoded><![CDATA[<p>For many years, I faithfully used a Sony Vaio VGN-FS742/W notebook computer. This computer was an absolute workhorse, and I never had a problem with it, despite using it heavily for software development as well as the usual e-mail and web surfing activities.</p>
<p>After I let my brother and his family use the computer, an unfortunate incident occurred that involved the cosmetic destruction of the B key on the keyboard. The key worked, but the tabs that held the platform that the keycap sits on broke off, so the B key stuck out higher than the rest of the keys on the keyboard. Unsightly, yes, but still functional.</p>
<p>Alas, my brother had to have a functional and flat keyboard, so I began the process of looking to find a replacement keyboard for a computer that was 5+ years old. The Sony part number for this keyboard is 147915321, and it must be the same keyboard on all VGN-FS series Vaio notebooks.</p>
<p>The first thing that I found was that I was more than likely going to have to buy a used keyboard and hope that it worked just fine. So I ordered one from the E-Tech eStore. The keyboard arrived well packaged, and after I installed it, I tested every single key on the keyboard and found that all of the keys worked except for the V key.</p>
<p>At this point, I should have requested an RMA for a refund, but I mistakenly requested a replacement. After sending the first keyboard back and getting the second keyboard, the situation got worse, as on the 2nd keyboard, quite a few more keys were not working. And of course, at this point my return request for a refund was rejected, as E-Tech is claiming that their keyboards are all tested, and that I check my equipment for failure.</p>
<p>So, as a response, I created this little rant video showing that my equipment is fine:</p>
<p><a href="http://www.youtube.com/watch?v=A_c1hBj2MG0">	<!-- Smart Youtube -->
	<span class="youtube">
		<object width="425" height="344">
			<param name="movie" value="http://www.youtube.com/v/A_c1hBj2MG0&amp;rel=1&amp;color1=d6d6d6&amp;color2=f0f0f0&amp;border=0&amp;fs=1&amp;hl=en&amp;autoplay=0&amp;showinfo=0&amp;iv_load_policy=3&amp;showsearch=0" />
			<param name="allowFullScreen" value="true" />
			<embed wmode="transparent" 
				src="http://www.youtube.com/v/A_c1hBj2MG0&amp;rel=1&amp;color1=d6d6d6&amp;color2=f0f0f0&amp;border=0&amp;fs=1&amp;hl=en&amp;autoplay=0&amp;showinfo=0&amp;iv_load_policy=3&amp;showsearch=0" 
				type="application/x-shockwave-flash" 
				allowfullscreen="true" 
				width="425" 
				height="344">
			</embed>
			<param name="wmode" value="transparent" />
		</object>
	</span><a href="http://www.youtube.com/watch?v=A_c1hBj2MG0">www.youtube.com/watch?v=A_c1hBj2MG0</a></a></p>
<p>As I said in the video, I cannot see how they could have tested the keyboard fully, since my hardware seems to work fine with my old keyboard with the B key tabs broken. I am guessing that their replacement keyboards are all pulls from computers that are dropped off at the computer recycling, and for the particular keyboards that I received, the reason the computer was at the recycling center was that the keys stopped working.</p>
<p>By the way, congrats to the Ohio Bobcats.  Big win last night.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dosomethinghere.com/2010/03/19/e-tech-sony-replacement-keyboard-woes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VB.NET Printing For Dummies</title>
		<link>http://www.dosomethinghere.com/2010/03/16/vb-net-printing-for-dummies/</link>
		<comments>http://www.dosomethinghere.com/2010/03/16/vb-net-printing-for-dummies/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 01:02:18 +0000</pubDate>
		<dc:creator>BP</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Visual Basic]]></category>
		<category><![CDATA[VB.NET]]></category>

		<guid isPermaLink="false">http://www.dosomethinghere.com/?p=485</guid>
		<description><![CDATA[In order to send stuff to the printer in VB.NET, it is not quite as simple as dealing with the Printer object as in VB6. There are a couple of extra steps involved. Here is what I found, along with some helper methods that you might find useful.
On the form you want to print from, [...]]]></description>
			<content:encoded><![CDATA[<p>In order to send stuff to the printer in VB.NET, it is not quite as simple as dealing with the Printer object as in VB6. There are a couple of extra steps involved. Here is what I found, along with some helper methods that you might find useful.</p>
<p>On the form you want to print from, pull up the Toolbox and add a PrintDocument, a PrintDialog, and a Button, set the Document property of the PrintDialog to point to the PrintDocument you just created, and in the button&#8217;s Click event, insert the following code:</p>

<div class="wp_syntax"><div class="code"><pre class="vbnet" style="font-family:monospace;">    <span style="color: #FF8000;">Private</span> <span style="color: #0600FF;">Sub</span> butPrint_Click<span style="color: #000000;">&#40;</span><span style="color: #FF8000;">ByVal</span> sender <span style="color: #FF8000;">As</span> System.<span style="color: #FF0000;">Object</span>, <span style="color: #FF8000;">ByVal</span> e <span style="color: #FF8000;">As</span> System.<span style="color: #0000FF;">EventArgs</span><span style="color: #000000;">&#41;</span> <span style="color: #FF8000;">Handles</span> butPrint.<span style="color: #0000FF;">Click</span>
&nbsp;
        <span style="color: #0600FF;">If</span> PrintDialog1.<span style="color: #0000FF;">ShowDialog</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">=</span> Windows.<span style="color: #0000FF;">Forms</span>.<span style="color: #0000FF;">DialogResult</span>.<span style="color: #0600FF;">OK</span> <span style="color: #FF8000;">Then</span>
            PrintDocument1.<span style="color: #0000FF;">DefaultPageSettings</span>.<span style="color: #0000FF;">Landscape</span> <span style="color: #008000;">=</span> <span style="color: #0600FF;">True</span>
            PrintDocument1.<span style="color: #FF8000;">Print</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
        <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span>
&nbsp;
    <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Sub</span>
&nbsp;
    <span style="color: #FF8000;">Private</span> <span style="color: #0600FF;">Sub</span> PrintDocument1_PrintPage<span style="color: #000000;">&#40;</span><span style="color: #FF8000;">ByVal</span> sender <span style="color: #FF8000;">As</span> System.<span style="color: #FF0000;">Object</span>, <span style="color: #FF8000;">ByVal</span> e <span style="color: #FF8000;">As</span> System.<span style="color: #0000FF;">Drawing</span>.<span style="color: #0000FF;">Printing</span>.<span style="color: #0000FF;">PrintPageEventArgs</span><span style="color: #000000;">&#41;</span> <span style="color: #FF8000;">Handles</span> PrintDocument1.<span style="color: #0000FF;">PrintPage</span>
&nbsp;
        PrintTestPage<span style="color: #000000;">&#40;</span>e.<span style="color: #0000FF;">Graphics</span>, PrintDocument1<span style="color: #000000;">&#41;</span>
&nbsp;
    <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Sub</span></pre></div></div>

<p>The Print method call in the button click event then fires the PrintDocument PrintPage event. Notice that I have set the default page settings to landscape. Don&#8217;t forget to wire the PrintDialog Document property to your PrintDocument, otherwise if you change the printer to print to in the print dialog, the document will still go to the default printer.</p>
<p>The PrintTestPage method is just something simple that I put together to make sure that the coordinates and justifications are all working fine. Here is that code:</p>

<div class="wp_syntax"><div class="code"><pre class="vbnet" style="font-family:monospace;">    <span style="color: #0600FF;">Sub</span> PrintTestPage<span style="color: #000000;">&#40;</span><span style="color: #FF8000;">ByVal</span> g <span style="color: #FF8000;">As</span> System.<span style="color: #0000FF;">Drawing</span>.<span style="color: #0000FF;">Graphics</span>, <span style="color: #FF8000;">ByVal</span> doc <span style="color: #FF8000;">As</span> PrintDocument<span style="color: #000000;">&#41;</span>
&nbsp;
        <span style="color: #0600FF;">Dim</span> x, y <span style="color: #FF8000;">As</span> <span style="color: #FF0000;">Integer</span>
&nbsp;
        <span style="color: #FF8000;">For</span> x <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span> <span style="color: #FF8000;">To</span> <span style="color: #FF0000;">100</span> <span style="color: #FF8000;">Step</span> <span style="color: #FF0000;">10</span>
            <span style="color: #FF8000;">For</span> y <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span> <span style="color: #FF8000;">To</span> <span style="color: #FF0000;">100</span> <span style="color: #FF8000;">Step</span> <span style="color: #FF0000;">10</span>
                PrintAtLocationWithColor<span style="color: #000000;">&#40;</span>g, doc, x.<span style="color: #0000FF;">ToString</span> <span style="color: #008000;">+</span> <span style="color: #808080;">&quot;, &quot;</span> <span style="color: #008000;">+</span> y.<span style="color: #0000FF;">ToString</span>, x, y, _
                                         <span style="color: #0600FF;">If</span><span style="color: #000000;">&#40;</span>x <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span>, <span style="color: #808080;">&quot;L&quot;</span>, <span style="color: #0600FF;">If</span><span style="color: #000000;">&#40;</span>x <span style="color: #008000;">=</span> <span style="color: #FF0000;">100</span>, <span style="color: #808080;">&quot;R&quot;</span>, <span style="color: #808080;">&quot;C&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>, <span style="color: #0600FF;">If</span><span style="color: #000000;">&#40;</span>y <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span>, <span style="color: #808080;">&quot;T&quot;</span>, <span style="color: #0600FF;">If</span><span style="color: #000000;">&#40;</span>y <span style="color: #008000;">=</span> <span style="color: #FF0000;">100</span>, <span style="color: #808080;">&quot;B&quot;</span>, <span style="color: #808080;">&quot;C&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>, _
                                         <span style="color: #808080;">&quot;Arial&quot;</span>, <span style="color: #FF0000;">8</span>, <span style="color: #0600FF;">True</span>, Brushes.<span style="color: #0600FF;">Red</span><span style="color: #000000;">&#41;</span>
            <span style="color: #FF8000;">Next</span>
        <span style="color: #FF8000;">Next</span>
&nbsp;
        PrintRectangle<span style="color: #000000;">&#40;</span>g, doc, <span style="color: #FF0000;">0</span>, <span style="color: #FF0000;">0</span>, <span style="color: #FF0000;">100</span>, <span style="color: #FF0000;">100</span><span style="color: #000000;">&#41;</span>
        PrintRectangle<span style="color: #000000;">&#40;</span>g, doc, <span style="color: #FF0000;">10</span>, <span style="color: #FF0000;">10</span>, <span style="color: #FF0000;">80</span>, <span style="color: #FF0000;">80</span><span style="color: #000000;">&#41;</span>
        PrintRectangle<span style="color: #000000;">&#40;</span>g, doc, <span style="color: #FF0000;">20</span>, <span style="color: #FF0000;">20</span>, <span style="color: #FF0000;">60</span>, <span style="color: #FF0000;">60</span><span style="color: #000000;">&#41;</span>
        PrintRectangle<span style="color: #000000;">&#40;</span>g, doc, <span style="color: #FF0000;">30</span>, <span style="color: #FF0000;">30</span>, <span style="color: #FF0000;">40</span>, <span style="color: #FF0000;">40</span><span style="color: #000000;">&#41;</span>
        PrintRectangle<span style="color: #000000;">&#40;</span>g, doc, <span style="color: #FF0000;">40</span>, <span style="color: #FF0000;">40</span>, <span style="color: #FF0000;">20</span>, <span style="color: #FF0000;">20</span><span style="color: #000000;">&#41;</span>
&nbsp;
    <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Sub</span></pre></div></div>

<p>The two methods called here, PrintAtLocationWithColor and PrintRectangle, are shown here:</p>

<div class="wp_syntax"><div class="code"><pre class="vbnet" style="font-family:monospace;">    <span style="color: #0600FF;">Sub</span> PrintAtLocationWithColor<span style="color: #000000;">&#40;</span><span style="color: #FF8000;">ByVal</span> pg <span style="color: #FF8000;">As</span> Graphics, <span style="color: #FF8000;">ByVal</span> pd <span style="color: #FF8000;">As</span> PrintDocument, <span style="color: #FF8000;">ByVal</span> s <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">String</span>, _
                                <span style="color: #FF8000;">ByVal</span> xPosition <span style="color: #FF8000;">As</span> Single, <span style="color: #FF8000;">ByVal</span> yPosition <span style="color: #FF8000;">As</span> Single, _
                                <span style="color: #FF8000;">ByVal</span> justification <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">String</span>, <span style="color: #FF8000;">ByVal</span> verticalJustification <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">String</span>, _
                                <span style="color: #FF8000;">ByVal</span> fontFace <span style="color: #FF8000;">As</span> <span style="color: #FF8000;">String</span>, <span style="color: #FF8000;">ByVal</span> fontSize <span style="color: #FF8000;">As</span> Single, _
                                <span style="color: #FF8000;">ByVal</span> fontBold <span style="color: #FF8000;">As</span> <span style="color: #FF0000;">Boolean</span>, <span style="color: #FF8000;">ByVal</span> theColor <span style="color: #FF8000;">As</span> Brush<span style="color: #000000;">&#41;</span>
&nbsp;
        <span style="color: #0600FF;">Dim</span> w, h <span style="color: #FF8000;">As</span> Single
        <span style="color: #0600FF;">Dim</span> x, y <span style="color: #FF8000;">As</span> Single
        <span style="color: #0600FF;">Dim</span> f <span style="color: #FF8000;">As</span> Font
        <span style="color: #0600FF;">Dim</span> sty <span style="color: #FF8000;">As</span> FontStyle
&nbsp;
        sty <span style="color: #008000;">=</span> FontStyle.<span style="color: #0000FF;">Regular</span>
        <span style="color: #0600FF;">If</span> fontBold <span style="color: #FF8000;">Then</span> sty <span style="color: #008000;">=</span> sty <span style="color: #008000;">+</span> FontStyle.<span style="color: #0000FF;">Bold</span>
        <span style="color: #0600FF;">If</span> fontSize &lt; <span style="color: #FF0000;">1</span> <span style="color: #FF8000;">Then</span> fontSize <span style="color: #008000;">=</span> <span style="color: #FF0000;">8.0</span>
        f <span style="color: #008000;">=</span> <span style="color: #FF8000;">New</span> Font<span style="color: #000000;">&#40;</span>fontFace, fontSize, sty<span style="color: #000000;">&#41;</span>
&nbsp;
        <span style="color: #0600FF;">If</span> pd.<span style="color: #0000FF;">DefaultPageSettings</span>.<span style="color: #0000FF;">Landscape</span> <span style="color: #FF8000;">Then</span>
            x <span style="color: #008000;">=</span> xPosition <span style="color: #008000;">/</span> <span style="color: #FF0000;">100</span> <span style="color: #008000;">*</span> <span style="color: #000000;">&#40;</span>pd.<span style="color: #0000FF;">DefaultPageSettings</span>.<span style="color: #0000FF;">PrintableArea</span>.<span style="color: #0000FF;">Height</span><span style="color: #000000;">&#41;</span>
            y <span style="color: #008000;">=</span> yPosition <span style="color: #008000;">/</span> <span style="color: #FF0000;">100</span> <span style="color: #008000;">*</span> <span style="color: #000000;">&#40;</span>pd.<span style="color: #0000FF;">DefaultPageSettings</span>.<span style="color: #0000FF;">PrintableArea</span>.<span style="color: #0600FF;">Width</span><span style="color: #000000;">&#41;</span>
        <span style="color: #FF8000;">Else</span>
            x <span style="color: #008000;">=</span> xPosition <span style="color: #008000;">/</span> <span style="color: #FF0000;">100</span> <span style="color: #008000;">*</span> <span style="color: #000000;">&#40;</span>pd.<span style="color: #0000FF;">DefaultPageSettings</span>.<span style="color: #0000FF;">PrintableArea</span>.<span style="color: #0600FF;">Width</span><span style="color: #000000;">&#41;</span>
            y <span style="color: #008000;">=</span> yPosition <span style="color: #008000;">/</span> <span style="color: #FF0000;">100</span> <span style="color: #008000;">*</span> <span style="color: #000000;">&#40;</span>pd.<span style="color: #0000FF;">DefaultPageSettings</span>.<span style="color: #0000FF;">PrintableArea</span>.<span style="color: #0000FF;">Height</span><span style="color: #000000;">&#41;</span>
        <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span>
&nbsp;
        w <span style="color: #008000;">=</span> pg.<span style="color: #0000FF;">MeasureString</span><span style="color: #000000;">&#40;</span>s, f<span style="color: #000000;">&#41;</span>.<span style="color: #0600FF;">Width</span>
        h <span style="color: #008000;">=</span> pg.<span style="color: #0000FF;">MeasureString</span><span style="color: #000000;">&#40;</span>s, f<span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">Height</span>
&nbsp;
        <span style="color: #0600FF;">If</span> <span style="color: #0600FF;">Left</span><span style="color: #000000;">&#40;</span><span style="color: #0600FF;">UCase</span><span style="color: #000000;">&#40;</span>justification<span style="color: #000000;">&#41;</span>, <span style="color: #FF0000;">1</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;C&quot;</span> <span style="color: #FF8000;">Then</span>
            x <span style="color: #008000;">=</span> x <span style="color: #008000;">-</span> w <span style="color: #008000;">/</span> <span style="color: #FF0000;">2</span>
        <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span>
        <span style="color: #0600FF;">If</span> <span style="color: #0600FF;">Left</span><span style="color: #000000;">&#40;</span><span style="color: #0600FF;">UCase</span><span style="color: #000000;">&#40;</span>justification<span style="color: #000000;">&#41;</span>, <span style="color: #FF0000;">1</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;R&quot;</span> <span style="color: #FF8000;">Then</span>
            x <span style="color: #008000;">=</span> x <span style="color: #008000;">-</span> w
        <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span>
&nbsp;
        <span style="color: #0600FF;">If</span> <span style="color: #0600FF;">Left</span><span style="color: #000000;">&#40;</span><span style="color: #0600FF;">UCase</span><span style="color: #000000;">&#40;</span>verticalJustification<span style="color: #000000;">&#41;</span>, <span style="color: #FF0000;">1</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;C&quot;</span> <span style="color: #FF8000;">Then</span>
            y <span style="color: #008000;">=</span> y <span style="color: #008000;">-</span> h <span style="color: #008000;">/</span> <span style="color: #FF0000;">2</span>
        <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span>
        <span style="color: #0600FF;">If</span> <span style="color: #0600FF;">Left</span><span style="color: #000000;">&#40;</span><span style="color: #0600FF;">UCase</span><span style="color: #000000;">&#40;</span>verticalJustification<span style="color: #000000;">&#41;</span>, <span style="color: #FF0000;">1</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;B&quot;</span> <span style="color: #FF8000;">Then</span>
            y <span style="color: #008000;">=</span> y <span style="color: #008000;">-</span> h
        <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span>
&nbsp;
        pg.<span style="color: #0000FF;">DrawString</span><span style="color: #000000;">&#40;</span>s, f, theColor, x, y<span style="color: #000000;">&#41;</span>
&nbsp;
    <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Sub</span>
&nbsp;
    <span style="color: #0600FF;">Sub</span> PrintRectangle<span style="color: #000000;">&#40;</span><span style="color: #FF8000;">ByVal</span> pg <span style="color: #FF8000;">As</span> Graphics, <span style="color: #FF8000;">ByVal</span> pd <span style="color: #FF8000;">As</span> PrintDocument, <span style="color: #FF8000;">ByVal</span> xPosition <span style="color: #FF8000;">As</span> Single, <span style="color: #FF8000;">ByVal</span> yPosition <span style="color: #FF8000;">As</span> Single, _
                                <span style="color: #FF8000;">ByVal</span> <span style="color: #0600FF;">width</span> <span style="color: #FF8000;">As</span> Single, <span style="color: #FF8000;">ByVal</span> height <span style="color: #FF8000;">As</span> Single<span style="color: #000000;">&#41;</span>
&nbsp;
        <span style="color: #0600FF;">Dim</span> w, h <span style="color: #FF8000;">As</span> Single
        <span style="color: #0600FF;">Dim</span> x, y <span style="color: #FF8000;">As</span> Single
&nbsp;
        <span style="color: #0600FF;">If</span> pd.<span style="color: #0000FF;">DefaultPageSettings</span>.<span style="color: #0000FF;">Landscape</span> <span style="color: #FF8000;">Then</span>
            x <span style="color: #008000;">=</span> xPosition <span style="color: #008000;">/</span> <span style="color: #FF0000;">100</span> <span style="color: #008000;">*</span> <span style="color: #000000;">&#40;</span>pd.<span style="color: #0000FF;">DefaultPageSettings</span>.<span style="color: #0000FF;">PrintableArea</span>.<span style="color: #0000FF;">Height</span><span style="color: #000000;">&#41;</span>
            y <span style="color: #008000;">=</span> yPosition <span style="color: #008000;">/</span> <span style="color: #FF0000;">100</span> <span style="color: #008000;">*</span> <span style="color: #000000;">&#40;</span>pd.<span style="color: #0000FF;">DefaultPageSettings</span>.<span style="color: #0000FF;">PrintableArea</span>.<span style="color: #0600FF;">Width</span><span style="color: #000000;">&#41;</span>
            w <span style="color: #008000;">=</span> <span style="color: #0600FF;">width</span> <span style="color: #008000;">/</span> <span style="color: #FF0000;">100</span> <span style="color: #008000;">*</span> <span style="color: #000000;">&#40;</span>pd.<span style="color: #0000FF;">DefaultPageSettings</span>.<span style="color: #0000FF;">PrintableArea</span>.<span style="color: #0000FF;">Height</span><span style="color: #000000;">&#41;</span>
            h <span style="color: #008000;">=</span> height <span style="color: #008000;">/</span> <span style="color: #FF0000;">100</span> <span style="color: #008000;">*</span> <span style="color: #000000;">&#40;</span>pd.<span style="color: #0000FF;">DefaultPageSettings</span>.<span style="color: #0000FF;">PrintableArea</span>.<span style="color: #0600FF;">Width</span><span style="color: #000000;">&#41;</span>
        <span style="color: #FF8000;">Else</span>
            x <span style="color: #008000;">=</span> xPosition <span style="color: #008000;">/</span> <span style="color: #FF0000;">100</span> <span style="color: #008000;">*</span> <span style="color: #000000;">&#40;</span>pd.<span style="color: #0000FF;">DefaultPageSettings</span>.<span style="color: #0000FF;">PrintableArea</span>.<span style="color: #0600FF;">Width</span><span style="color: #000000;">&#41;</span>
            y <span style="color: #008000;">=</span> yPosition <span style="color: #008000;">/</span> <span style="color: #FF0000;">100</span> <span style="color: #008000;">*</span> <span style="color: #000000;">&#40;</span>pd.<span style="color: #0000FF;">DefaultPageSettings</span>.<span style="color: #0000FF;">PrintableArea</span>.<span style="color: #0000FF;">Height</span><span style="color: #000000;">&#41;</span>
            w <span style="color: #008000;">=</span> <span style="color: #0600FF;">width</span> <span style="color: #008000;">/</span> <span style="color: #FF0000;">100</span> <span style="color: #008000;">*</span> <span style="color: #000000;">&#40;</span>pd.<span style="color: #0000FF;">DefaultPageSettings</span>.<span style="color: #0000FF;">PrintableArea</span>.<span style="color: #0600FF;">Width</span><span style="color: #000000;">&#41;</span>
            h <span style="color: #008000;">=</span> height <span style="color: #008000;">/</span> <span style="color: #FF0000;">100</span> <span style="color: #008000;">*</span> <span style="color: #000000;">&#40;</span>pd.<span style="color: #0000FF;">DefaultPageSettings</span>.<span style="color: #0000FF;">PrintableArea</span>.<span style="color: #0000FF;">Height</span><span style="color: #000000;">&#41;</span>
        <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span>
&nbsp;
        pg.<span style="color: #0000FF;">DrawRectangle</span><span style="color: #000000;">&#40;</span>Pens.<span style="color: #0600FF;">Black</span>, x, y, w, h<span style="color: #000000;">&#41;</span>
&nbsp;
    <span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Sub</span></pre></div></div>

<p>All of the positioning and size parameters of these methods are percentages across and down the page, which I find much easier to deal with than absolute or printer specific positioning. This makes it dead simple to scale the reports to any page size I want to use.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dosomethinghere.com/2010/03/16/vb-net-printing-for-dummies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Documentation overload</title>
		<link>http://www.dosomethinghere.com/2010/03/05/documentation-overload/</link>
		<comments>http://www.dosomethinghere.com/2010/03/05/documentation-overload/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 18:17:11 +0000</pubDate>
		<dc:creator>BP</dc:creator>
				<category><![CDATA[Funny stuff]]></category>

		<guid isPermaLink="false">http://www.dosomethinghere.com/?p=482</guid>
		<description><![CDATA[Peanut allergies are really only a problem if you can open the package&#8230;  Oh wait, now I figured it out&#8230;

So I should probably take the jackhammer back to the tool rental place, I guess I won&#8217;t be needing it to eat my Kit Kat bar.
]]></description>
			<content:encoded><![CDATA[<p>Peanut allergies are really only a problem if you can open the package&#8230;  Oh wait, now I figured it out&#8230;</p>
<p><a href="http://www.dosomethinghere.com/wp-content/uploads/2010/03/kitkat.jpg"><img class="alignnone size-full wp-image-483" title="kitkat" src="http://www.dosomethinghere.com/wp-content/uploads/2010/03/kitkat.jpg" alt="" width="600" height="285" /></a></p>
<p>So I should probably take the jackhammer back to the tool rental place, I guess I won&#8217;t be needing it to eat my Kit Kat bar.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dosomethinghere.com/2010/03/05/documentation-overload/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sansa e250 database rebuild</title>
		<link>http://www.dosomethinghere.com/2010/03/02/sansa-e250-database-rebuild/</link>
		<comments>http://www.dosomethinghere.com/2010/03/02/sansa-e250-database-rebuild/#comments</comments>
		<pubDate>Wed, 03 Mar 2010 02:54:48 +0000</pubDate>
		<dc:creator>BP</dc:creator>
				<category><![CDATA[Hardware adventures]]></category>
		<category><![CDATA[Hardware]]></category>

		<guid isPermaLink="false">http://www.dosomethinghere.com/?p=480</guid>
		<description><![CDATA[For some reason, my Sandisk Sansa e250 MP3 player was stubbornly refusing to acknowledge the music that I was copying to it. I tried just about everything I could think of short of formatting the device to get it to see my folders in the Music folder. My device has the latest version 1 firmware [...]]]></description>
			<content:encoded><![CDATA[<p>For some reason, my Sandisk Sansa e250 MP3 player was stubbornly refusing to acknowledge the music that I was copying to it. I tried just about everything I could think of short of formatting the device to get it to see my folders in the Music folder. My device has the latest version 1 firmware upgrade, and I have tried to use both MSC and MTP mode to copy folders to the device, all to no avail.</p>
<p>Finally, I found out that I could force the device to do a database rebuild by doing the following steps, which should work on any Sansa e200 series MP3 player with the version 1 firmware:  <strong>(WARNING:  Please do not do this if you are worried about making your device inoperable.  There is always a risk that this will happen when you start futzing with the system files.)</strong></p>
<ul>
<li>Go into the Settings screen and scroll to USB mode, and set it to MSC</li>
<li>Connect the device to the computer</li>
<li>Once the device mounts as a drive on your computer, browse to the device, look for the System folder, and the Data folder in that folder</li>
<li>Delete the file called PP5000.DAT</li>
<li>Disconnect the device</li>
</ul>
<p>Once you disconnect, the device will restart, and it should refresh the database. If you prefer MTP mode, make sure to go back into the settings to change it back.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dosomethinghere.com/2010/03/02/sansa-e250-database-rebuild/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gmail phishing warning</title>
		<link>http://www.dosomethinghere.com/2010/03/01/gmail-phishing-warning/</link>
		<comments>http://www.dosomethinghere.com/2010/03/01/gmail-phishing-warning/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 18:21:03 +0000</pubDate>
		<dc:creator>BP</dc:creator>
				<category><![CDATA[Funny stuff]]></category>

		<guid isPermaLink="false">http://www.dosomethinghere.com/?p=471</guid>
		<description><![CDATA[I think that Google might have the Gmail phishing filter set just a tad too strong.  I was in my Gmail account this morning and accidentally clicked on the very first message I got in the account, which is of course the introductory e-mail that describes how to switch your existing e-mail over to [...]]]></description>
			<content:encoded><![CDATA[<p>I think that Google might have the Gmail phishing filter set just a tad too strong.  I was in my Gmail account this morning and accidentally clicked on the very first message I got in the account, which is of course the introductory e-mail that describes how to switch your existing e-mail over to Gmail.  Here is what I saw:</p>
<p><a href="http://www.dosomethinghere.com/wp-content/uploads/2010/03/gmail_warning1.png"><img class="alignnone size-full wp-image-473" title="gmail_warning" src="http://www.dosomethinghere.com/wp-content/uploads/2010/03/gmail_warning1.png" alt="" width="792" height="533" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dosomethinghere.com/2010/03/01/gmail-phishing-warning/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>.NET Kombat (Format vs. ToString)</title>
		<link>http://www.dosomethinghere.com/2010/02/23/net-kombat-format-vs-tostring/</link>
		<comments>http://www.dosomethinghere.com/2010/02/23/net-kombat-format-vs-tostring/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 03:43:51 +0000</pubDate>
		<dc:creator>BP</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Visual Basic]]></category>
		<category><![CDATA[VB.NET]]></category>

		<guid isPermaLink="false">http://www.dosomethinghere.com/?p=468</guid>
		<description><![CDATA[In converting some legacy VB6 code to VB.NET, I noticed that there was a lot of use of the Format function in the code to convert numbers to strings. This makes sense as Format was pretty much the only game in town in VB6.
However, in .NET, they introduced a handy-dandy .ToString() method that, on the [...]]]></description>
			<content:encoded><![CDATA[<p>In converting some legacy VB6 code to VB.NET, I noticed that there was a lot of use of the Format function in the code to convert numbers to strings. This makes sense as Format was pretty much the only game in town in VB6.</p>
<p>However, in .NET, they introduced a handy-dandy .ToString() method that, on the surface, seems to do much the same thing as the Format function. I have been able to use them pretty much interchangeably with the desired results coming out every time.</p>
<p>I started to wonder which way was faster. Since I am a big proponent of empirical knowledge instead of just trying to get the theoretical story behind the two ways to do this, I rolled together this quick VB.NET console application:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;">Imports System.Text
&nbsp;
Module Module1
&nbsp;
    <span style="color: #000080;">Sub</span> Main()
&nbsp;
        <span style="color: #000080;">Dim</span> i <span style="color: #000080;">As</span> <span style="color: #000080;">Integer</span>
        <span style="color: #000080;">Dim</span> r <span style="color: #000080;">As</span> <span style="color: #000080;">Random</span> = <span style="color: #000080;">New</span> <span style="color: #000080;">Random</span>()
        <span style="color: #000080;">Dim</span> t <span style="color: #000080;">As</span> <span style="color: #000080;">Double</span>
&nbsp;
        System.Console.WriteLine(<span style="color: #800000;">&quot;10,000,000 Formats&quot;</span>)
        <span style="color: #000080;">Dim</span> sb1 <span style="color: #000080;">As</span> <span style="color: #000080;">New</span> stringbuilder
        t = Timer
        <span style="color: #000080;">For</span> i = 1 <span style="color: #000080;">To</span> 10000000
            sb1.<span style="color: #000080;">Append</span>(Format(r.NextDouble * 100.0, <span style="color: #800000;">&quot;###0.00 &quot;</span>))
        <span style="color: #000080;">Next</span>
        System.Console.WriteLine(<span style="color: #800000;">&quot;Seconds elapsed: &quot;</span> + (Timer - t).ToString(<span style="color: #800000;">&quot;#######0.00&quot;</span>))
        System.Console.WriteLine(<span style="color: #800000;">&quot;Length of string builder: &quot;</span> + sb1.Length.ToString())
        System.Console.WriteLine()
&nbsp;
        System.Console.WriteLine(<span style="color: #800000;">&quot;10,000,000 ToStrings&quot;</span>)
        <span style="color: #000080;">Dim</span> sb2 <span style="color: #000080;">As</span> <span style="color: #000080;">New</span> StringBuilder
        t = Timer
        <span style="color: #000080;">For</span> i = 1 <span style="color: #000080;">To</span> 10000000
            sb2.<span style="color: #000080;">Append</span>((r.NextDouble * 100.0).ToString(<span style="color: #800000;">&quot;###0.00 &quot;</span>))
        <span style="color: #000080;">Next</span>
        System.Console.WriteLine(<span style="color: #800000;">&quot;Seconds elapsed: &quot;</span> + (Timer - t).ToString(<span style="color: #800000;">&quot;#######0.00&quot;</span>))
        System.Console.WriteLine(<span style="color: #800000;">&quot;Length of string builder: &quot;</span> + sb2.Length.ToString())
        System.Console.WriteLine()
&nbsp;
        System.Console.WriteLine(<span style="color: #800000;">&quot;Press any key to end the program &quot;</span>)
        System.Console.ReadKey()
&nbsp;
    <span style="color: #000080;">End</span> <span style="color: #000080;">Sub</span>
&nbsp;
<span style="color: #000080;">End</span> Module</pre></div></div>

<p>And here are the results:</p>
<p><a href="http://www.dosomethinghere.com/wp-content/uploads/2010/02/FormatVsToString.png"><img class="alignnone size-full wp-image-469" title="FormatVsToString" src="http://www.dosomethinghere.com/wp-content/uploads/2010/02/FormatVsToString.png" alt="" width="668" height="331" /></a></p>
<p>As you can see, the ToString method is about 15% faster when doing 10 million calls with random numbers.</p>
<p>Oh, and by the way, Happy <a href="http://www.ihoppancakeday.com/" target="_blank">Pancake Day</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dosomethinghere.com/2010/02/23/net-kombat-format-vs-tostring/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Weird Stuff Warehouse</title>
		<link>http://www.dosomethinghere.com/2010/02/12/weird-stuff-warehouse/</link>
		<comments>http://www.dosomethinghere.com/2010/02/12/weird-stuff-warehouse/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 20:23:16 +0000</pubDate>
		<dc:creator>BP</dc:creator>
				<category><![CDATA[Funny stuff]]></category>

		<guid isPermaLink="false">http://www.dosomethinghere.com/?p=466</guid>
		<description><![CDATA[A co-worker brought this link to my attention:
Silicon Valley’s Island of Misfit Tech
I can&#8217;t believe that, with all of the trips that I have made to the Bay Area, that I never heard of this place or stumbled upon it by accident. I so want to go there now to look for a copy of Microsoft [...]]]></description>
			<content:encoded><![CDATA[<p>A co-worker brought this link to my attention:</p>
<p><a href="http://technologizer.com/2010/02/10/silicon-valleys-island-of-misfit-tech/">Silicon Valley’s Island of Misfit Tech</a></p>
<p>I can&#8217;t believe that, with all of the trips that I have made to the Bay Area, that I never heard of this place or stumbled upon it by accident. I so want to go there now to look for a copy of Microsoft Bob. Or maybe I should try to sell my copy of Microsoft Dogs.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dosomethinghere.com/2010/02/12/weird-stuff-warehouse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UVa Online Judge runtime error</title>
		<link>http://www.dosomethinghere.com/2010/01/28/uva-online-judge-runtime-error/</link>
		<comments>http://www.dosomethinghere.com/2010/01/28/uva-online-judge-runtime-error/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 04:23:28 +0000</pubDate>
		<dc:creator>BP</dc:creator>
				<category><![CDATA[UVA Online Judge]]></category>

		<guid isPermaLink="false">http://www.dosomethinghere.com/?p=462</guid>
		<description><![CDATA[It has apparently been a long time since I had to do any kind of reading and writing from the console in C.
I was trying to work through the Minesweeper problem on the UVa Online Judge site, and my submissions kept failing with a &#8220;Runtime error&#8221;, with no explanation given as to the source of [...]]]></description>
			<content:encoded><![CDATA[<p>It has apparently been a long time since I had to do any kind of reading and writing from the console in C.</p>
<p>I was trying to work through the Minesweeper problem on the UVa Online Judge site, and my submissions kept failing with a &#8220;Runtime error&#8221;, with no explanation given as to the source of the problem. Of course, everything was working swimmingly when I was trying to run through the code as a command line application in Xcode on my Mac. Some investigation into this led me to pad my arrays and strings so that there was no chance of an array index going into areas they were not supposed to, but it was still failing.</p>
<p>I finally discovered the problem was that I had used an int variable in my code, but a %i instead of a %d in the scanf format string. As soon as I switched that over, the &#8220;Runtime error&#8221; went away. And I was able to move on to the &#8220;What do you mean &#8216;Wrong answer&#8217;???&#8221; part of my evening.</p>
<p>Oh, and Happy Data Privacy Day everyone.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dosomethinghere.com/2010/01/28/uva-online-judge-runtime-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easy way to format the time difference between two dates</title>
		<link>http://www.dosomethinghere.com/2010/01/27/easy-way-to-format-the-time-difference-between-two-dates/</link>
		<comments>http://www.dosomethinghere.com/2010/01/27/easy-way-to-format-the-time-difference-between-two-dates/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 18:56:36 +0000</pubDate>
		<dc:creator>BP</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Visual Basic]]></category>
		<category><![CDATA[VB]]></category>
		<category><![CDATA[VB.NET]]></category>

		<guid isPermaLink="false">http://www.dosomethinghere.com/?p=457</guid>
		<description><![CDATA[In converting my VB6 code over to VB.NET, I was looking for an easy way to take the different between two DateTime items and display in hours and minutes.  The TimeSpan gives a nice structure to dive into the difference and see exactly the interval, but I was hoping to find a way to output [...]]]></description>
			<content:encoded><![CDATA[<p>In converting my VB6 code over to VB.NET, I was looking for an easy way to take the different between two DateTime items and display in hours and minutes.  The TimeSpan gives a nice structure to dive into the difference and see exactly the interval, but I was hoping to find a way to output this in the same way that you can use the ToShortTimeString method of DateTime.</p>
<p>As it turns out, I found a posting by Jay Barlow that mentions converting the time different to a date time, and then using a custom format string to do the work so that I wouldn&#8217;t have to.  Here is my new VB.NET code, where rec is a class that includes the start and end date and duration is a string that holds the information to be displayed:</p>

<div class="wp_syntax"><div class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #000080;">If</span> rec.endDate IsNot <span style="color: #000080;">Nothing</span> <span style="color: #000080;">Then</span>
    <span style="color: #000080;">Dim</span> ts <span style="color: #000080;">As</span> TimeSpan = <span style="color: #000080;">CDate</span>(rec.endDate).Subtract(rec.startDate)
    <span style="color: #000080;">Dim</span> dt <span style="color: #000080;">As</span> DateTime = DateTime.MinValue.Add(ts)
    duration = <span style="color: #800000;">&quot;Event duration: &quot;</span> + dt.ToString(<span style="color: #800000;">&quot;H:mm&quot;</span>)
<span style="color: #000080;">End</span> <span style="color: #000080;">If</span></pre></div></div>

<p>Oh, and one more thing.  Am I the only one in the world that thinks that iPad is the worst product name in history? Sure, it is so close to iPod so as to create brand recognition and draw comparisons, but I would just wonder what kind of names were shot down, and if any of them did not begin with the letter i.</p>
<p>By the way, Happy (Belated) Australia Day.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dosomethinghere.com/2010/01/27/easy-way-to-format-the-time-difference-between-two-dates/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>My Tracks Android app review</title>
		<link>http://www.dosomethinghere.com/2010/01/18/my-tracks-android-app-review/</link>
		<comments>http://www.dosomethinghere.com/2010/01/18/my-tracks-android-app-review/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 01:39:35 +0000</pubDate>
		<dc:creator>BP</dc:creator>
				<category><![CDATA[Android]]></category>

		<guid isPermaLink="false">http://www.dosomethinghere.com/?p=455</guid>
		<description><![CDATA[I saw a news blurb a while back about this new app from the Google folks called My Tracks. I downloaded it to my Droid right away, but really didn&#8217;t try it out until today.
So I decided to try and use the application while walking one of my dogs. The navigation around the application is [...]]]></description>
			<content:encoded><![CDATA[<p>I saw a news blurb a while back about this new app from the Google folks called My Tracks. I downloaded it to my Droid right away, but really didn&#8217;t try it out until today.</p>
<p>So I decided to try and use the application while walking one of my dogs. The navigation around the application is pretty simple, and the track recording seemed to work very well. After I got back from the walk, I was able to see the path that I walked along with a bunch of statistics about it.</p>
<p>The program has upload options to send to Google Docs and Google Maps, so I tried them both at first. This first upload did complete to my Google Docs, but I did have a bit of trouble when it tried to upload the track to Google Maps. The first few times I tried it, I got some miscellaneous errors, such as an authentication error and other nondescript messages. Finally it did go through, and the track then was showing up on the My Maps page of Google Maps.</p>
<p>Even though this app is in the early stages of development, I think it rates quite well. I would give it a 4 star rating, if only because I had some trouble getting the Google Maps upload working.</p>
<p>If you can find it in your heart to help out a fellow nerd, please help out Shawn Powers, he is having a tough go of it. Here are the details:</p>
<p><a href="http://www.linuxjournal.com/content/urgent-help-shawn-powers-family" target="_blank">Urgent: Help Shawn Powers &amp; Family</a></p>
<p>Oh, and I hope everyone out there had a good Martin Luther King Day.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dosomethinghere.com/2010/01/18/my-tracks-android-app-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
