<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" 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:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Ryan Versaw's Blog</title>
        <link>http://versaw.com/Default.aspx</link>
        <description />
        <language>en-US</language>
        <copyright>Ryan Versaw</copyright>
        <generator>Subtext Version 2.5.1.19</generator>
        <image>
            <title>Ryan Versaw's Blog</title>
            <url>http://versaw.com/images/RSS2Image.gif</url>
            <link>http://versaw.com/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <item>
            <title>Custom Steam Wallet Purchases</title>
            <link>http://versaw.com/archive/2010/10/05/custom-steam-wallet-purchases.aspx</link>
            <description>&lt;p&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="SteamWallet" border="0" alt="SteamWallet" src="http://versaw.com/blog/images/versaw_com/blog/WindowsLiveWriter/CustomSteamWalletPurchases_10EC2/SteamWallet_1.png" width="634" height="200" /&gt; &lt;/p&gt;  &lt;p&gt;I haven’t seen this reported anywhere else, so I might as well throw a post up about it.&lt;/p&gt;  &lt;p&gt;Valve recently launched their Steam Wallet feature, which was widely reported, but I just found a way to add custom amounts to your Steam Wallet (so you won't be stuck with leftover pennies).&lt;/p&gt;  &lt;p&gt;If you're logged in and access &lt;a href="http://store.steampowered.com/steamaccount/addfunds"&gt;the Steam Wallet page&lt;/a&gt;, you can add specific increments. If you look into what the actual buttons are doing, they're all just using a javascript call to add those amounts, like "javascript:submitAddFunds( 1000 );". As this gives you the necessary precision to add whatever amount of money needed, this will help to make sure you don't have anything extra sitting around. Valve is still validating the amount to make sure it’s over $5.00, but it appears to work fine for any larger amounts.&lt;/p&gt;  &lt;p&gt;So basically, go to the &lt;a href="http://store.steampowered.com/steamaccount/addfunds"&gt;Steam Wallet page&lt;/a&gt; and throw "javascript:submitAddFunds( 1337 );" into your javascript console or address bar to try this for yourself.&lt;/p&gt;  &lt;p&gt;Based on &lt;a href="http://www.pcgamer.com/2010/09/30/interview-valve-on-why-theyre-selling-team-fortress-2-items-for-real-money/"&gt;this interview&lt;/a&gt;, this looks like something they intended rather than an exploit, so I feel comfortable using it:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;As gamers who’ve used these kinds of systems before, we wanted to avoid some things we didn’t like. One was being forced to add more funds than we wanted (and seeing purchase prices that didn’t seem to match the funding options) and the other was being forced to do conversion into some virtual currency in our heads.&lt;/p&gt;    &lt;p&gt;We’re not doing either of these in the Steam Wallet.&lt;/p&gt;&lt;/blockquote&gt;&lt;img src="http://versaw.com/aggbug/8.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Blog Author</dc:creator>
            <guid>http://versaw.com/archive/2010/10/05/custom-steam-wallet-purchases.aspx</guid>
            <pubDate>Tue, 05 Oct 2010 19:16:38 GMT</pubDate>
            <comments>http://versaw.com/archive/2010/10/05/custom-steam-wallet-purchases.aspx#feedback</comments>
            <slash:comments>5</slash:comments>
            <wfw:commentRss>http://versaw.com/comments/commentRss/8.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Check your Entity Framework Contains() Queries (and Everything Else)</title>
            <link>http://versaw.com/archive/2010/07/28/check-your-entity-framework-contains-queries.aspx</link>
            <description>&lt;p&gt;I was analyzing the queries generated by a few of our page loads and came across a rather strange query:&lt;/p&gt;&lt;pre&gt;SELECT CAST(NULL AS varchar(1))       AS [C1],
       CAST(NULL AS uniqueidentifier) AS [C2],
       CAST(NULL AS uniqueidentifier) AS [C3],
       CAST(NULL AS int)              AS [C4],
       CAST(NULL AS varchar(1))       AS [C5],
       CAST(NULL AS varchar(1))       AS [C6],
       CAST(NULL AS varchar(1))       AS [C7],
       CAST(NULL AS varchar(1))       AS [C8],
       CAST(NULL AS bit)              AS [C9],
       CAST(NULL AS varchar(1))       AS [C10],
       CAST(NULL AS varchar(1))       AS [C11],
       CAST(NULL AS varchar(1))       AS [C12],
       CAST(NULL AS varchar(1))       AS [C13],
       CAST(NULL AS varchar(1))       AS [C14],
       CAST(NULL AS varchar(1))       AS [C15],
       CAST(NULL AS varchar(1))       AS [C16],
       CAST(NULL AS varchar(1))       AS [C17]
FROM   (SELECT 1 AS X) AS [SingleRowTable1]
WHERE  1 = 0&lt;/pre&gt;&lt;pre&gt; &lt;/pre&gt;
&lt;p&gt;(Note, this query has not been modified in any way, this is exactly as I found it)&lt;/p&gt;
&lt;p&gt;When I investigated this, I found the following code generated this awesome SQL:&lt;/p&gt;&lt;pre&gt;GetContext().CreateObjectSet&amp;lt;ProductFamily&amp;gt;().Where(pf =&amp;gt; ids.Contains(pf.Id))&lt;/pre&gt;&lt;pre&gt; &lt;/pre&gt;
&lt;p&gt;If you’re unfamiliar with Entity Framework, this query should pull any ProductFamily records whose Id is within the ids collection. The problem I experienced came up when the ids collection was an empty set. I would have expected EF to short-circuit this query so it didn’t even hit the database, but this is another case where having a &lt;a href="http://efprof.com/"&gt;good profiler&lt;/a&gt; is often a necessity when using an ORM.&lt;/p&gt;
&lt;p&gt;I just came across another query that generated similar SQL:&lt;/p&gt;&lt;pre&gt;
        public virtual T GetById(object id)
        {
            return Items.SingleOrDefault(i =&amp;gt; i.Id == id);
        }
&lt;/pre&gt;
&lt;p&gt;This is on our base repository along with numerous other methods for ease of reuse, which is why an object comes in – we can support Guids, ints, or whatever other PKs are in use. This new issue came up when we were using a nullable Guid elsewhere. We weren’t checking to make sure it had a value, and instead passed the nullable Guid in directly. Once again, EF detected that the value was null and that no records will match it, but decided to execute a query anyway.&lt;/p&gt;&lt;img src="http://versaw.com/aggbug/7.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Blog Author</dc:creator>
            <guid>http://versaw.com/archive/2010/07/28/check-your-entity-framework-contains-queries.aspx</guid>
            <pubDate>Wed, 28 Jul 2010 16:13:53 GMT</pubDate>
            <comments>http://versaw.com/archive/2010/07/28/check-your-entity-framework-contains-queries.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://versaw.com/comments/commentRss/7.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Sidewinder X6 Keyboard!</title>
            <link>http://versaw.com/archive/2009/09/24/sidewinder-x6-keyboard.aspx</link>
            <description>&lt;p&gt;There have been numerous contests going on lately leading up to the release of Windows 7, and I was lucky enough to win one of them! If you’re interested in taking a look at the current contests, be sure to follow &lt;a href="http://twitter.com/WindowsGamer"&gt;@WindowsGamer&lt;/a&gt; and &lt;a href="http://twitter.com/MSWindows"&gt;@MSWindows&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;First of all, a picture of the keyboard (Logitech G15) I’m replacing:&lt;/p&gt;  &lt;p&gt;&lt;a title="G15" href="http://www.flickr.com/photos/40571704@N05/3949165167/"&gt;&lt;img border="0" alt="G15" src="http://static.flickr.com/3513/3949165167_d7abe76bda.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Here’s the new keyboard (Sidewinder X6):&lt;/p&gt;  &lt;p&gt;&lt;a title="X6" href="http://www.flickr.com/photos/40571704@N05/3949188291/"&gt;&lt;img border="0" alt="X6" src="http://static.flickr.com/2427/3949188291_4712e8a18d.jpg" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Some general thoughts so far:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;I miss my LCD – Not many games or programs support it, but it is useful when they do&lt;/li&gt;    &lt;li&gt;The volume knob on the X6 doesn’t seem very responsive&lt;/li&gt;    &lt;li&gt;The X6 keys took some getting used to, but I prefer the feel of them over the G15&lt;/li&gt;    &lt;li&gt;The moveable number pad seems nice – When I’m gaming I don’t need it, so it makes sense to use it for macros instead&lt;/li&gt;    &lt;li&gt;I’d prefer a Windows key on the right side as well, but I can deal with it. I’ve also found myself hitting F1 instead of Esc due to the altered placement&lt;/li&gt;    &lt;li&gt;The X6 is lacking USB ports, though I thankfully have some convenient ones on my monitor &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Overall, I’m a big fan of the X6 so far and I’ll definitely get used to the differences. The main thing I’ll miss is the LCD, though I suppose &lt;a href="http://www.ventrilo.com/"&gt;Ventrilo&lt;/a&gt; was one of the few apps I used it for. I’ll definitely keep using the X6 as my primary keyboard as I do prefer the feel of the keyboard over the G15 – Thanks again &lt;a href="http://twitter.com/WindowsGamer"&gt;@WindowsGamer&lt;/a&gt;!&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.flickr.com/photos/40571704@N05/sets/72157622319253497/"&gt;Keyboard Gallery&lt;/a&gt;&lt;/p&gt;&lt;img src="http://versaw.com/aggbug/6.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Blog Author</dc:creator>
            <guid>http://versaw.com/archive/2009/09/24/sidewinder-x6-keyboard.aspx</guid>
            <pubDate>Thu, 24 Sep 2009 05:57:24 GMT</pubDate>
            <comments>http://versaw.com/archive/2009/09/24/sidewinder-x6-keyboard.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://versaw.com/comments/commentRss/6.aspx</wfw:commentRss>
        </item>
        <item>
            <title>CustomAttributeFormatException in VS2010 Beta 1</title>
            <link>http://versaw.com/archive/2009/06/01/customattributeformatexception-in-vs2010-beta-1.aspx</link>
            <description>&lt;p&gt;I’ve been doing some development recently with Visual Studio 2010 Beta 1 and because of this I ran across a bug in .NET 4.0 Beta 1:&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="CustomAttributeFormatException" border="0" alt="CustomAttributeFormatException" src="http://versaw.com/blog/images/versaw_com/blog/WindowsLiveWriter/CustomAttributeFormatExceptioninVS2010Be_1239/image_10.png" width="693" height="179" /&gt; &lt;/p&gt;  &lt;p&gt;This cropped up when I decided to introduce logging into my application using the &lt;a href="http://entlib.codeplex.com/"&gt;Microsoft Enterprise Library&lt;/a&gt;. I soon found out that the current version of the Enterprise Library will not work with .NET 4.0 Beta 1 due to &lt;a href="http://entlib.codeplex.com/Thread/View.aspx?ThreadId=56814"&gt;an existing bug&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;The quick fix to this is to make sure your project is targeting .NET 3.5 SP1, which my project already was. After some more digging around I realized that though I was targeting 3.5, Visual Studio was hosting my WCF service using its .NET 4.0 version of WcfSvcHost.exe.&lt;/p&gt;  &lt;p&gt;The workaround that I’ve created involves pointing my project to the VS 2008 version of the WCF Service Host for debugging purposes:&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Project Properties" border="0" alt="Project Properties" src="http://versaw.com/blog/images/versaw_com/blog/WindowsLiveWriter/CustomAttributeFormatExceptioninVS2010Be_1239/image_9.png" width="627" height="473" /&gt; &lt;/p&gt;  &lt;p&gt;The external program path I’m using is “C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\WcfSvcHost.exe”, though your path may vary. I set the working directory to my project’s debug directory.&lt;/p&gt;  &lt;p&gt;&lt;a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=444020"&gt;Here&lt;/a&gt; is the direct link to the Microsoft Connect bug report in case you want to validate it or vote it up.&lt;/p&gt;&lt;img src="http://versaw.com/aggbug/5.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Blog Author</dc:creator>
            <guid>http://versaw.com/archive/2009/06/01/customattributeformatexception-in-vs2010-beta-1.aspx</guid>
            <pubDate>Tue, 02 Jun 2009 04:57:00 GMT</pubDate>
            <comments>http://versaw.com/archive/2009/06/01/customattributeformatexception-in-vs2010-beta-1.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://versaw.com/comments/commentRss/5.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Welcome!</title>
            <link>http://versaw.com/archive/2009/04/06/welcome.aspx</link>
            <description>&lt;p&gt;Considering I have no worthwhile content at this time, you likely know me. In the future I hope to update this blog with something that is actually useful, but don’t count on constant updates.&lt;/p&gt;  &lt;p&gt;When I find the time I’ll try to upload a few projects I’ve worked on over the past few years.&lt;/p&gt;&lt;img src="http://versaw.com/aggbug/4.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Blog Author</dc:creator>
            <guid>http://versaw.com/archive/2009/04/06/welcome.aspx</guid>
            <pubDate>Tue, 07 Apr 2009 04:56:00 GMT</pubDate>
            <comments>http://versaw.com/archive/2009/04/06/welcome.aspx#feedback</comments>
            <wfw:commentRss>http://versaw.com/comments/commentRss/4.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>
