<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6599188130642820966</id><updated>2011-11-15T13:55:17.580-06:00</updated><category term='C#'/><category term='facebook'/><category term='flash'/><category term='caching'/><category term='syntax'/><category term='flex'/><category term='bug'/><category term='as3'/><category term='errors'/><title type='text'>Digital Disciple</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://digitaldisciple.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6599188130642820966/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://digitaldisciple.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>John</name><uri>http://www.blogger.com/profile/10976007525623220339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6599188130642820966.post-7780669636039132204</id><published>2011-11-15T13:55:00.000-06:00</published><updated>2011-11-15T13:55:17.590-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='flash'/><category scheme='http://www.blogger.com/atom/ns#' term='errors'/><title type='text'>Stupid "Flash Player Not Found" Error</title><content type='html'>When installing a fresh copy of Flash Builder 4 in Windows 7 and trying to debug a project without an HTML wrapper I often get the error "Flash Player not found". After much searching, I have finally found the ridiculous solution. First of all, you must download a debug version of Flash Player and associate .swf files with it either through the Windows control panel or by right clicking and choosing Open With...&lt;br /&gt;&lt;br /&gt;Simple enough, but this alone will not fix the error. Here's the ridiculous part of the process. You need to right-click the debug Flash Player that you downloaded and run it as an administrator. Doing this a single time should cause subsequent runs in Flash Builder to proceed without a hitch. So dumb.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6599188130642820966-7780669636039132204?l=digitaldisciple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://digitaldisciple.blogspot.com/feeds/7780669636039132204/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://digitaldisciple.blogspot.com/2011/11/stupid-flash-player-not-found-error.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6599188130642820966/posts/default/7780669636039132204'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6599188130642820966/posts/default/7780669636039132204'/><link rel='alternate' type='text/html' href='http://digitaldisciple.blogspot.com/2011/11/stupid-flash-player-not-found-error.html' title='Stupid &quot;Flash Player Not Found&quot; Error'/><author><name>John</name><uri>http://www.blogger.com/profile/10976007525623220339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6599188130642820966.post-612757374036904394</id><published>2011-07-01T14:01:00.000-05:00</published><updated>2011-07-01T14:01:07.430-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='caching'/><category scheme='http://www.blogger.com/atom/ns#' term='facebook'/><category scheme='http://www.blogger.com/atom/ns#' term='bug'/><category scheme='http://www.blogger.com/atom/ns#' term='flash'/><title type='text'>Facebook And Caching</title><content type='html'>I've been doing a lot of Facebook/Flash game integration as of late and I recently ran into an incredibly annoying caching bug. Basically the integration works like this:&lt;br /&gt;&lt;br /&gt;1) a "share" button in the game makes a call to Facebook's sharer.php script&amp;nbsp;with a parameter pointing to a PHP file&lt;br /&gt;2) this PHP file reads an XML file (specified via URL parameters) that contains the information that should appear in the Facebook post (link, title, picture URL, etc)&lt;br /&gt;3) the PHP file uses this XML info to generate an HTML page with the appropriate metadata&lt;br /&gt;4) Facebook's sharer.php script reads this HTML page to generate the Facebook post&lt;br /&gt;&lt;br /&gt;Now, here's the problem. Facebook was caching an old version of the PHP file. As a result, I would try editing the XML to change, say, the title of the Facebook post, and my changes would fail to appear. Very troublesome.&lt;br /&gt;&lt;br /&gt;The fix is quite simple. Facebook's sharer.php script works by passing in a 'u' parameter that holds the URI-encoded URL from which to generate the post. Here's an example pointing to Google:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fgoogle.com"&gt;http://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fgoogle.com&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Facebook appears to cache the page that is specified in the 'u' parameter, so in order to force it to read a fresh version of the page, you can append a dummy parameter to the end of the URL. So instead of pointing it to&amp;nbsp;http://www.google.com,&amp;nbsp;I would instead point it to:&lt;br /&gt;&lt;br /&gt;http://www.google.com?v=1&lt;br /&gt;&lt;br /&gt;which would appear in the sharer script with URI-encoding as:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fgoogle.com%3Fv%3D2"&gt;http://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fgoogle.com%3Fv%3D2&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;So in the Flash game, I generate a random number every time the share button is clicked and make a request to the sharer.php script with that random number tacked onto the end of the URL in the 'u' parameter. Take THAT Facebook.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6599188130642820966-612757374036904394?l=digitaldisciple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://digitaldisciple.blogspot.com/feeds/612757374036904394/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://digitaldisciple.blogspot.com/2011/07/facebook-and-caching.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6599188130642820966/posts/default/612757374036904394'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6599188130642820966/posts/default/612757374036904394'/><link rel='alternate' type='text/html' href='http://digitaldisciple.blogspot.com/2011/07/facebook-and-caching.html' title='Facebook And Caching'/><author><name>John</name><uri>http://www.blogger.com/profile/10976007525623220339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6599188130642820966.post-4399377183013507265</id><published>2011-01-30T16:41:00.000-06:00</published><updated>2011-01-30T16:41:07.061-06:00</updated><title type='text'>String To Enum Conversion In C#</title><content type='html'>In the XNA project I'm currently working on, many of the animations have a state for each cardinal direction. This information is stored in XML as a string (NE/NW/SE/SW). However, in the code it's convenient to store this information as an Enum like so:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public enum Facing {&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;NE, SE, SW, NW&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;In order to determine which state of the animation to use, it becomes necessary to convert between the Enum and the string in the XML file. Fortunately, there's a handy function Enum.Parse that makes this really easy:&lt;br /&gt;&lt;br /&gt;Facing enumValue = Enum.Parse(typeof(Facing), directionString);&lt;br /&gt;&lt;br /&gt;Very handy. I haven't really used enums before but they're becoming a very useful tool.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6599188130642820966-4399377183013507265?l=digitaldisciple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://digitaldisciple.blogspot.com/feeds/4399377183013507265/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://digitaldisciple.blogspot.com/2011/01/string-to-enum-conversion-in-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6599188130642820966/posts/default/4399377183013507265'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6599188130642820966/posts/default/4399377183013507265'/><link rel='alternate' type='text/html' href='http://digitaldisciple.blogspot.com/2011/01/string-to-enum-conversion-in-c.html' title='String To Enum Conversion In C#'/><author><name>John</name><uri>http://www.blogger.com/profile/10976007525623220339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6599188130642820966.post-6332700915918056309</id><published>2010-12-19T14:37:00.000-06:00</published><updated>2010-12-19T14:37:24.946-06:00</updated><title type='text'>Explicit Casting vs. Using the "as" Keyword</title><content type='html'>There are (at least) two ways to cast an object in C# and I recently became curious about the difference. Apparently, if an explicit cast fails it will throw an InvalidCastException. Alternatively, if a cast that uses the "as" keyword fails, the target object will be given a null value.&lt;br /&gt;&lt;br /&gt;So using the "as" keyword is perhaps slightly riskier since the program will continue on its merry way when there's a failed cast until you try to use your object and find out that it's null. However, I suspect most of the time this won't matter because the object is likely being casted for immediate use. So if for some reason you want your casts to be able to produce a null value upon failure, the "as" keyword is the way to go. Other than that, it seems like the difference will not have severe implications.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6599188130642820966-6332700915918056309?l=digitaldisciple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://digitaldisciple.blogspot.com/feeds/6332700915918056309/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://digitaldisciple.blogspot.com/2010/12/explicit-casting-vs-using-as-keyword.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6599188130642820966/posts/default/6332700915918056309'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6599188130642820966/posts/default/6332700915918056309'/><link rel='alternate' type='text/html' href='http://digitaldisciple.blogspot.com/2010/12/explicit-casting-vs-using-as-keyword.html' title='Explicit Casting vs. Using the &quot;as&quot; Keyword'/><author><name>John</name><uri>http://www.blogger.com/profile/10976007525623220339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6599188130642820966.post-5536981026789477407</id><published>2010-12-01T11:40:00.000-06:00</published><updated>2010-12-01T11:40:08.447-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='flex'/><category scheme='http://www.blogger.com/atom/ns#' term='as3'/><category scheme='http://www.blogger.com/atom/ns#' term='flash'/><category scheme='http://www.blogger.com/atom/ns#' term='errors'/><title type='text'>Flash Builder 4 "Java heap space" error</title><content type='html'>While attempting to compile and run a Flash Builder 4 project recently, I was receiving an error titled "Java heap space" with no additional information given. Some searching revealed that the IDE was running out of memory and a configuration file needed to be tweaked to give it more. Several forum posts suggested altering the jvm.config file in the /bin directory for the appropriate SDK such that the line:&lt;br /&gt;&lt;br /&gt;java.args=-Xmx384m&lt;br /&gt;&lt;br /&gt;has a higher numerical value. From what I understand, this is an argument passed in when opening the IDE that specifies an upper limit on the memory that the Java compiler is allowed to use. Unfortunately, changing this line did not fix the error. After some more searching, I found a forum post from an Adobe employee that suggested changing the eclipse.ini file in my Eclipse install directory so that the line:&lt;br /&gt;&lt;br /&gt;-Xmx384m&lt;br /&gt;&lt;br /&gt;has a higher value. I bumped this up to 768 and the error vanished. This is the same argument as the one in the jvm.config file but I suspect that the jvm.config argument was being ignored in favor of the eclipse.ini one. I do recall choosing to install Flash Builder 4 as a plug-in to Eclipse rather than a stand-alone application, so that may be the reason it's favoring eclipse.ini.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6599188130642820966-5536981026789477407?l=digitaldisciple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://digitaldisciple.blogspot.com/feeds/5536981026789477407/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://digitaldisciple.blogspot.com/2010/12/flash-builder-4-java-heap-space-error.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6599188130642820966/posts/default/5536981026789477407'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6599188130642820966/posts/default/5536981026789477407'/><link rel='alternate' type='text/html' href='http://digitaldisciple.blogspot.com/2010/12/flash-builder-4-java-heap-space-error.html' title='Flash Builder 4 &quot;Java heap space&quot; error'/><author><name>John</name><uri>http://www.blogger.com/profile/10976007525623220339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6599188130642820966.post-7946773256096056264</id><published>2010-11-21T01:26:00.001-06:00</published><updated>2010-12-19T14:37:49.558-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='syntax'/><title type='text'>System.out.println("Hello World");</title><content type='html'>A blog at last! In this digital brain-dump I plan to share my findings and perhaps create a few lessons about things that interest and inspire me, in hopes that they will do the same for someone else! I have taken so much from the collective knowledge of the internet community over the past few years and this is my first step to giving some of it back. I am a computer scientist by training and a software engineer by trade. I make video games now (for fun and for profit) and love ever minute of it. I plan to post about various programming topics as I learn them for myself, as well as any useful tips and tricks I pick up along the way. Right now I'm working in Flash/AS3 for my job and XNA/Python on a hobby project. Plenty to learn there!&lt;br /&gt;&lt;br /&gt;In any case, my dream is for this blog to grow and be full of useful information for fellow disciples of the digital domain. I'm looking forward to seeing what this baby can do!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6599188130642820966-7946773256096056264?l=digitaldisciple.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://digitaldisciple.blogspot.com/feeds/7946773256096056264/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://digitaldisciple.blogspot.com/2010/11/systemoutprintlnhello-world.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6599188130642820966/posts/default/7946773256096056264'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6599188130642820966/posts/default/7946773256096056264'/><link rel='alternate' type='text/html' href='http://digitaldisciple.blogspot.com/2010/11/systemoutprintlnhello-world.html' title='System.out.println(&quot;Hello World&quot;);'/><author><name>John</name><uri>http://www.blogger.com/profile/10976007525623220339</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
