<?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>Jarred Capellman / Random Texels</title>
	<atom:link href="http://www.jarredcapellman.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jarredcapellman.com</link>
	<description>Manipulating 1s and 0s since 1995</description>
	<lastBuildDate>Mon, 20 Feb 2012 14:10:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Quake 2 IRIX &gt; 128mb doesn&#8217;t seem to matter (much)</title>
		<link>http://www.jarredcapellman.com/2012/02/20/quake-2-irix-128mb-doesnt-seem-to-matter-much/</link>
		<comments>http://www.jarredcapellman.com/2012/02/20/quake-2-irix-128mb-doesnt-seem-to-matter-much/#comments</comments>
		<pubDate>Mon, 20 Feb 2012 14:10:28 +0000</pubDate>
		<dc:creator>Jarred Capellman</dc:creator>
				<category><![CDATA[New Hardware/Software]]></category>
		<category><![CDATA[o2 quake2]]></category>
		<category><![CDATA[quake 2 irix]]></category>
		<category><![CDATA[sgi]]></category>
		<category><![CDATA[sgi o2]]></category>

		<guid isPermaLink="false">http://www.jarredcapellman.com/?p=960</guid>
		<description><![CDATA[Just benchmarked my 180mhz R5000SC cpu with only 128mb of memory in Quake 2, it's marginally worse than when I benchmarked the same CPU, but with 1gb of memory. This makes sense though in that back in 1997 when Quake 2 came out, I think I only had just upgraded to 32mb of ram in [...]]]></description>
			<content:encoded><![CDATA[<p>Just benchmarked my 180mhz R5000SC cpu with only 128mb of memory in Quake 2, it's marginally worse than when I benchmarked the same CPU, but with 1gb of memory.  This makes sense though in that back in 1997 when Quake 2 came out, I think I only had just upgraded to 32mb of ram in my Pentium 200 MMX running Windows NT 4.  So all the extra ram wouldn't help this scenario.</p>
<p>The one major caveat I noticed was running in a 320x240 window @ 640x480, my O2 ran out of memory and started paging to the Virtual Memory (thank you <code>gmemusage</code>).  I tested it twice to make sure, but a word to the wise, do not run Quake 2 in a window if you only have 128mb of memory.  I'll test it out with 192mb shortly.</p>
<p>In case anyone was interested here is an updated list:</p>
<p><strong>320x240</strong><br />
128mb - 180mhz R5000SC - 4.1 / 169.6 seconds<br />
1024mb - 180mhz R5000SC - 14.9 / 46.3 seconds<br />
1024mb - 300mhz R5200SC - 18.8 / 36.7 seconds</p>
<p><strong>640x480</strong><br />
128mb - 180mhz R5000SC - 12.2 / 56.3 seconds<br />
1024mb - 180mhz R5000SC - 12.4fps / 55.4 seconds<br />
1024mb - 300mhz R5200SC - 14.5fps / 47.4 seconds</p>
<p><strong>800x600</strong><br />
128mb - 180mhz R5000SC - 10.2 / 67.3 seconds<br />
1024mb - 180mhz R5000SC - 10.3 / 67.2 seconds<br />
1024mb - 300mhz R5200SC - 11.7 / 58.7 seconds</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jarredcapellman.com/2012/02/20/quake-2-irix-128mb-doesnt-seem-to-matter-much/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IIS Fingerprinting with C#</title>
		<link>http://www.jarredcapellman.com/2012/02/19/iis-fingerprinting-with-c/</link>
		<comments>http://www.jarredcapellman.com/2012/02/19/iis-fingerprinting-with-c/#comments</comments>
		<pubDate>Mon, 20 Feb 2012 04:02:32 +0000</pubDate>
		<dc:creator>Jarred Capellman</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[fingerprinting]]></category>
		<category><![CDATA[http headers]]></category>
		<category><![CDATA[iis]]></category>

		<guid isPermaLink="false">http://www.jarredcapellman.com/?p=955</guid>
		<description><![CDATA[Continuing my work on my secret project, I've been really intrigued on how nmap's ability to determine the Operating System and Web Server of the host you are scanning. With every test I had done with it, it had always returned exactly what was running, even the more obscure hosts like that of those on [...]]]></description>
			<content:encoded><![CDATA[<p>Continuing my work on my secret project, I've been really intrigued on how <strong>nmap's</strong> ability to determine the Operating System and Web Server of the host you are scanning.  With every test I had done with it, it had always returned exactly what was running, even the more obscure hosts like that of those on IRIX.  So I started my research into what would be necessary.</p>
<p>From what I have read so far, you have really two main options for detection.  You can either use the return values of an <strong>ICMP</strong> request or if they are running IIS, using the <strong>WebResponse Headers</strong> to determine the version of IIS running (Apache will return something like <code>Apache/1.3.23</code>).  Digging into <strong>ICMP</strong>, I realized that would require a good bit more reading so I chose the later for Stage 1 of my detection mechanism.</p>
<p>First off you need to create and return the <strong>WebResponse Header</strong>:</p>
<pre>
private string getHttpServerHeader(string ipAddress) {
     WebRequest webRequest = WebRequest.Create("http://" + ipAddress);
     WebResponse webResponse = null;

     string ServerHeader = String.Empty;

     try {
         webResponse = webRequest.GetResponse();
     } catch (WebException ex) {
          if (ex.Response.Headers != null) {
               ServerHeader = ex.Response.Headers["Server"];
          }
     } finally {
          if (webResponse != null) {
               webResponse.Close();
          }
     }

     return ServerHeader;
}
</pre>
<p>Then using the <code>string</code> result of that function:</p>
<pre>
private string getWebServerName(string server) {
    // IIS Detection from HTTP.SYS
    if (server.StartsWith("Microsoft-HTTPAPI")) {
        switch(server.Split('/')[1]) {
            case "1.0":
                return "IIS 6.0";
            case "2.0":
                return "IIS 6.0/7.x";
        }
    }

    // IIS Detection not from HTTP.SYS
    if (server.StartsWith("Microsoft-IIS")) {
        return "IIS " + server.Split('/')[1];
    }

    // If no conditional has trapped the Server entry, most likely the Web Server is either Apache or a masked IIS Server
    return server;
}
</pre>
<p>In reading about Fingerprinting it occurred to me that within IIS itself you can mask it with a custom Server Header like "WS" for instance.  I doubt it would prevent a true attack, but it might save a couple bytes per connection over Microsoft-IIS 7.5 <img src='http://www.jarredcapellman.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.jarredcapellman.com/2012/02/19/iis-fingerprinting-with-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The requested protocol has not been configured into the system, or no implementation for it exists&#8230;</title>
		<link>http://www.jarredcapellman.com/2012/02/18/the-requested-protocol-has-not-been-configured-into-the-system-or-no-implementation-for-it-exists/</link>
		<comments>http://www.jarredcapellman.com/2012/02/18/the-requested-protocol-has-not-been-configured-into-the-system-or-no-implementation-for-it-exists/#comments</comments>
		<pubDate>Sun, 19 Feb 2012 02:35:23 +0000</pubDate>
		<dc:creator>Jarred Capellman</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[socket]]></category>
		<category><![CDATA[SocketType]]></category>

		<guid isPermaLink="false">http://www.jarredcapellman.com/?p=944</guid>
		<description><![CDATA[Just got that lovely exception when attempting to do a UDP Socket connection. It's been years since I had done Socket programming and forgot one little gotcha, you have to switch the SocketType to Dgram instead of Stream. So for instance if you wanted to create a TCP socket object in .NET: Socket clientSocket = [...]]]></description>
			<content:encoded><![CDATA[<p>Just got that lovely exception when attempting to do a UDP Socket connection.  It's been years since I had done Socket programming and forgot one little gotcha, you have to switch the <strong>SocketType</strong> to <code>Dgram</code> instead of <code>Stream</code>.</p>
<p>So for instance if you wanted to create a TCP socket object in .NET:</p>
<pre>
Socket clientSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
</pre>
<p>or on UDP:</p>
<pre>
Socket clientSocket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.jarredcapellman.com/2012/02/18/the-requested-protocol-has-not-been-configured-into-the-system-or-no-implementation-for-it-exists/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows Phone 7 ObservableCollection populating a Listbox Asynchronously</title>
		<link>http://www.jarredcapellman.com/2012/02/18/windows-phone-7-observablecollection-populating-a-listbox-asynchronously/</link>
		<comments>http://www.jarredcapellman.com/2012/02/18/windows-phone-7-observablecollection-populating-a-listbox-asynchronously/#comments</comments>
		<pubDate>Sat, 18 Feb 2012 22:43:17 +0000</pubDate>
		<dc:creator>Jarred Capellman</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[listobx async]]></category>
		<category><![CDATA[observablecollection]]></category>
		<category><![CDATA[wp7]]></category>

		<guid isPermaLink="false">http://www.jarredcapellman.com/?p=942</guid>
		<description><![CDATA[I've been working on a small-ish scale project for the last week now off and on, I'll be announcing it officially probably next week. But anyway, I was running into a problem the main function of the app taking quite a while to process. Given that the performance of the app is entirely dependent on [...]]]></description>
			<content:encoded><![CDATA[<p>I've been working on a small-ish scale project for the last week now off and on, I'll be announcing it officially probably next week.  But anyway, I was running into a problem the main function of the app taking quite a while to process.  Given that the performance of the app is entirely dependent on the 3G, 4G, LTE or WiFi connection strength of the phone I wanted to assume the worst when it gets released.  Therefore I started looking around for a way to as the the results were returned have the <code>Listbox</code> update asynchronously.  Previously with the Windows Phone 7 apps I have developed I simply have had a "Loading" Indicator and a second or two later it would go away, so there really wasn't a need for a "better" solution until now.</p>
<p>Hunting around the WP7 SDK, I came across exactly what I was looking for: <code>Observable Collections</code>.  In the "default" solution I had noticed this collection type previously, but always removed it in lieu of a Generic List Collection of whatever object I was using.  The only caveat I found when using this approach is that you have to use the Dispatcher to update the collection on the UI Thread.</p>
<p>That being said here's a quick code sample:</p>
<p><strong>In your Button or Page_Load Event set your Listbox ItemSource to the ObservableCollection you're going to populate:</strong></p>
<pre>
lstBxResults.ItemsSource = App.ViewModel.Results;
</pre>
<p><strong>Inside your ViewModel loop or asynchronously task (like a WCF service call for instance), wrap the addition of the result inside a Dispatcher Invoke:</strong></p>
<pre>
System.Windows.Deployment.Current.Dispatcher.BeginInvoke(() => {
     Results.Add(new YourObject(e.Result));
});
</pre>
<p>With those 2 blocks you'll have your Listbox updated as they get added to the ObservableCollection from whatever time consuming task your phone is doing.  Hope that helps someone out.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jarredcapellman.com/2012/02/18/windows-phone-7-observablecollection-populating-a-listbox-asynchronously/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quake 2 IRIX &#8211; 180mhz R5000SC vs 300mhz R5200SC</title>
		<link>http://www.jarredcapellman.com/2012/02/17/quake-2-irix-180mhz-r5000sc-vs-300mhz-r5200sc/</link>
		<comments>http://www.jarredcapellman.com/2012/02/17/quake-2-irix-180mhz-r5000sc-vs-300mhz-r5200sc/#comments</comments>
		<pubDate>Fri, 17 Feb 2012 22:41:49 +0000</pubDate>
		<dc:creator>Jarred Capellman</dc:creator>
				<category><![CDATA[New Hardware/Software]]></category>
		<category><![CDATA[irix]]></category>
		<category><![CDATA[quake2 irix]]></category>
		<category><![CDATA[sgi o2]]></category>
		<category><![CDATA[silicon graphics]]></category>

		<guid isPermaLink="false">http://www.jarredcapellman.com/?p=935</guid>
		<description><![CDATA[I got a 300mhz R5200SC CPU (the highest R5k series CPU for the O2) for my main Silicon Graphics O2. I ran before and after Quake 2 results out of curiosity if it would make a big difference having nearly 2X the mhz and that the CRIME graphics core is tightly integrated with the CPU. [...]]]></description>
			<content:encoded><![CDATA[<p>I got a 300mhz R5200SC CPU (the highest R5k series CPU for the O2) for my main Silicon Graphics O2.  I ran before and after Quake 2 results out of curiosity if it would make a big difference having nearly 2X the mhz and that the <code>CRIME</code> graphics core is tightly integrated with the CPU.</p>
<p>Using the following commands on the console:<br />
<code><br />
timedemo 1<br />
map demo1.dm2<br />
</code></p>
<p>Here's the results:</p>
<p><strong>320x240</strong><br />
180mhz - 14.9 / 46.3 seconds<br />
300mhz - 18.8 / 36.7 seconds</p>
<p><strong>640x480</strong><br />
180mhz - 12.4fps / 55.4 seconds<br />
300mhz - 14.5fps / 47.4 seconds</p>
<p><strong>800x600</strong><br />
180mhz - 10.3 / 67.2 seconds<br />
300mhz - 11.7 / 58.7 seconds</p>
<p>Kind of surprised at the results, I'll be testing my 180mhz R5000PC vs 180mhz R5000SC shortly to see what if any difference the Level 2 cache makes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jarredcapellman.com/2012/02/17/quake-2-irix-180mhz-r5000sc-vs-300mhz-r5200sc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SGI O2 &#8211; Maxed out Memory</title>
		<link>http://www.jarredcapellman.com/2012/02/12/o2-maxed-out-memory/</link>
		<comments>http://www.jarredcapellman.com/2012/02/12/o2-maxed-out-memory/#comments</comments>
		<pubDate>Sun, 12 Feb 2012 18:06:43 +0000</pubDate>
		<dc:creator>Jarred Capellman</dc:creator>
				<category><![CDATA[New Hardware/Software]]></category>
		<category><![CDATA[sgi]]></category>
		<category><![CDATA[sgi o2]]></category>
		<category><![CDATA[silicon graphics]]></category>

		<guid isPermaLink="false">http://www.jarredcapellman.com/?p=931</guid>
		<description><![CDATA[Found a guy on Craigslist who was selling his O2, didn't know the specs other than it was not a R10k or R12k model, but offered it for $50. The going rate on eBay for O2 parts is generally higher than that, so I took a gamble. Surprisingly, the O2 was the lowest end CPU, [...]]]></description>
			<content:encoded><![CDATA[<p>Found a guy on Craigslist who was selling his O2, didn't know the specs other than it was not a R10k or R12k model, but offered it for $50.  The going rate on eBay for O2 parts is generally higher than that, so I took a gamble.  Surprisingly, the O2 was the lowest end CPU, but had 8 128mb sticks of memory, the max you can pop in an O2.  One pair of these go for over a hundred bucks on eBay.  I migrated all of my memory out of my O2 and swapped it in, voila 1GB for $50 and now I've got an "extra" O2 that I'll probably use to record guitar riffs.</p>
<div id="attachment_932" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.jarredcapellman.com/wp-content/uploads/2012/02/O2-Screenshot.png" rel="lightbox[931]" title="Silicon Graphics O2 showing the 1GB of RAM"><img src="http://www.jarredcapellman.com/wp-content/uploads/2012/02/O2-Screenshot-300x240.png" alt="" title="Silicon Graphics O2 showing the 1GB of RAM" width="300" height="240" class="size-medium wp-image-932" /></a><p class="wp-caption-text">Silicon Graphics O2 showing the 1GB of RAM</p></div>
<p>I tried Quake II, it boots up a little bit quicker, but FPS wise, I didn't notice a difference.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jarredcapellman.com/2012/02/12/o2-maxed-out-memory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quake II on IRIX</title>
		<link>http://www.jarredcapellman.com/2012/02/12/quake-ii-on-irix/</link>
		<comments>http://www.jarredcapellman.com/2012/02/12/quake-ii-on-irix/#comments</comments>
		<pubDate>Sun, 12 Feb 2012 13:11:47 +0000</pubDate>
		<dc:creator>Jarred Capellman</dc:creator>
				<category><![CDATA[New Hardware/Software]]></category>
		<category><![CDATA[irix]]></category>
		<category><![CDATA[quake 2]]></category>
		<category><![CDATA[sgi]]></category>
		<category><![CDATA[sgi o2]]></category>
		<category><![CDATA[silicon graphics]]></category>

		<guid isPermaLink="false">http://www.jarredcapellman.com/?p=926</guid>
		<description><![CDATA[I figured after attempting to compile SDLQuake and running into x86 assembly, UDP and linking issues I decided to try the "official" IRIX port from SGI. Oddly enough, Quake II runs at 640x480x16 with full textures on my Silicon Graphics O2. Feeling adventurous, I wanted to see if it would play with the x86 Windows [...]]]></description>
			<content:encoded><![CDATA[<p>I figured after attempting to compile <code>SDLQuake</code> and running into x86 assembly, UDP and linking issues I decided to try the "official" IRIX port from SGI.  Oddly enough, Quake II runs at 640x480x16 with full textures on my Silicon Graphics O2.  Feeling adventurous, I wanted to see if it would play with the x86 Windows 3.20 version. Sure enough, I was able to play with an IRIX hosted game (it would probably work the other way as well) with my Windows 7 workstation.</p>
<div id="attachment_927" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.jarredcapellman.com/wp-content/uploads/2012/02/WP_000160.jpg" rel="lightbox[926]" title="Quake II on my O2"><img src="http://www.jarredcapellman.com/wp-content/uploads/2012/02/WP_000160-300x225.jpg" alt="" title="Quake II on my O2" width="300" height="225" class="size-medium wp-image-927" /></a><p class="wp-caption-text">Quake II on my O2</p></div>
<p>On a side note, I got <code>SDLQuake</code> to get all the way to the linking stage before giving up on it.  For whatever reason using <code>-lSDL</code> was not including what looks like X11 or OpenAL libraries.  I included both of those libraries and was still getting the errors.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jarredcapellman.com/2012/02/12/quake-ii-on-irix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quake on IRIX</title>
		<link>http://www.jarredcapellman.com/2012/02/11/quake-on-irix/</link>
		<comments>http://www.jarredcapellman.com/2012/02/11/quake-on-irix/#comments</comments>
		<pubDate>Sat, 11 Feb 2012 18:43:22 +0000</pubDate>
		<dc:creator>Jarred Capellman</dc:creator>
				<category><![CDATA[New Hardware/Software]]></category>
		<category><![CDATA[irix]]></category>
		<category><![CDATA[o2]]></category>
		<category><![CDATA[quake]]></category>
		<category><![CDATA[sgi quake]]></category>
		<category><![CDATA[silicon graphics]]></category>

		<guid isPermaLink="false">http://www.jarredcapellman.com/?p=923</guid>
		<description><![CDATA[Finally got Quake working on my Silicon Graphics O2. Using the "official" SGI port from September 1997, it runs fairly smooth at 1024x768x16. It did bring up old memories of my first LAN party in Summer of 1998 playing Quake, particularly E1M7 as seen in the picture. Definitely makes me want to have a Retrogaming [...]]]></description>
			<content:encoded><![CDATA[<p>Finally got Quake working on my Silicon Graphics O2.  Using the "official" SGI port from September 1997, it runs fairly smooth at 1024x768x16.</p>
<div id="attachment_924" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.jarredcapellman.com/wp-content/uploads/2012/02/WP_000158.jpg" rel="lightbox[923]" title="Quake on my SGI O2"><img src="http://www.jarredcapellman.com/wp-content/uploads/2012/02/WP_000158-300x225.jpg" alt="" title="Quake on my SGI O2" width="300" height="225" class="size-medium wp-image-924" /></a><p class="wp-caption-text">Quake on my SGI O2</p></div>
<p>It did bring up old memories of my first LAN party in Summer of 1998 playing Quake, particularly E1M7 as seen in the picture.  Definitely makes me want to have a Retrogaming LAN with Quake or Descent.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jarredcapellman.com/2012/02/11/quake-on-irix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting a picture from Android to a WCF Service</title>
		<link>http://www.jarredcapellman.com/2012/02/08/getting-a-picture-from-android-to-a-wcf-service/</link>
		<comments>http://www.jarredcapellman.com/2012/02/08/getting-a-picture-from-android-to-a-wcf-service/#comments</comments>
		<pubDate>Thu, 09 Feb 2012 00:28:37 +0000</pubDate>
		<dc:creator>Jarred Capellman</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[ImageView]]></category>
		<category><![CDATA[monodroid]]></category>

		<guid isPermaLink="false">http://www.jarredcapellman.com/?p=919</guid>
		<description><![CDATA[Had a fun time today getting a picture taken from an Android 2.3.4 HTC Vivid to my Mobile WCF Platform. Oddly enough, I could not find any tutorials on it for Monodroid like there are for MonoTouch. Piecing together several stackoverflow posts, I finally figured it out. Here is a possible solution (most likely not [...]]]></description>
			<content:encoded><![CDATA[<p>Had a fun time today getting a picture taken from an Android 2.3.4 HTC Vivid to my Mobile WCF Platform.  Oddly enough, I could not find any tutorials on it for Monodroid like there are for MonoTouch.  Piecing together several stackoverflow posts, I finally figured it out.  Here is a possible solution (most likely not the best):</p>
<p><strong>At the top of your class, add the following:</strong></p>
<pre>
private string _imageUri;
private ImageView imageView;

private Boolean isMounted {
            get {
                return Android.OS.Environment.ExternalStorageState.Equals(Android.OS.Environment.MediaMounted);
            }
        }
</pre>
<p><strong>Inside your <code>Button</code> Click Event:</strong></p>
<pre>
     var uri = ContentResolver.Insert(isMounted ? Android.Provider.MediaStore.Images.Media.ExternalContentUri : Android.Provider.MediaStore.Images.Media.InternalContentUri, new ContentValues());
     _imageUri = uri.ToString();
     var i = new Intent(Android.Provider.MediaStore.ActionImageCapture);
     i.PutExtra(Android.Provider.MediaStore.ExtraOutput, uri);
     StartActivityForResult(i, 0);
</pre>
<p><strong>Right below your Click Event function (or anywhere inside the Activity Class you're in):</strong></p>
<pre>
protected override void OnActivityResult(int requestCode, Result resultCode, Intent data) {
            if (resultCode == Result.Ok &amp;&amp; requestCode == 0) {
                imageView = FindViewById&lt;ImageView&gt;(Resource.Id.ivThumbnail);
                imageView.DrawingCacheEnabled = true;

                imageView.SetImageURI(Android.Net.Uri.Parse(_imageUri));

                btnUploadImage.Visibility = ViewStates.Visible;
            }
        }
</pre>
<p><strong>Then inside your "Upload Button Click" function:</strong></p>
<pre>
Bitmap bitmap = imageView.GetDrawingCache(true);
MemoryStream ms = new MemoryStream();

// Note anything less than 50 will result in very pixelated images from what I've seen
bitmap.Compress(Android.Graphics.Bitmap.CompressFormat.Jpeg, 100, ms);

// At this point set your Byte[] variable/property with ms.ToArray();
// for instance I have a SyncFile object with a FileData Property, so I use
// SyncFile sFile = new SyncFile() { FileData = ms.ToArray(); };
</pre>
<p>Effectively this code captures a picture, puts it in an <code>ImageView</code> as a thumbnail on the <code>Activity</code> and then upon hitting your <code>Upload Button</code> it converts the image into a Byte Array after compressing it (or not like in my case) and from there call your WCF service upload function.</p>
<p>Hopefully that helped someone out.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jarredcapellman.com/2012/02/08/getting-a-picture-from-android-to-a-wcf-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Accessing Activity from TabActivity using Monodroid</title>
		<link>http://www.jarredcapellman.com/2012/02/06/accessing-activity-from-tabactivity-using-monodroid/</link>
		<comments>http://www.jarredcapellman.com/2012/02/06/accessing-activity-from-tabactivity-using-monodroid/#comments</comments>
		<pubDate>Tue, 07 Feb 2012 00:12:16 +0000</pubDate>
		<dc:creator>Jarred Capellman</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[activity]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[monodroid]]></category>
		<category><![CDATA[tabactivity]]></category>

		<guid isPermaLink="false">http://www.jarredcapellman.com/?p=913</guid>
		<description><![CDATA[Monodroid gave me headaches this afternoon, trying to mimic the Pivots on Windows Phone 7 on Android using the TabActivity. You would think you access an Activity after attaching it to a TabActivity. Well the answer is you can, but figuring it out on Monodroid will make your hair go gray. After digging through the [...]]]></description>
			<content:encoded><![CDATA[<p>Monodroid gave me headaches this afternoon, trying to mimic the <code>Pivots</code> on Windows Phone 7 on Android using the <code>TabActivity</code>.  You would think you access an <code>Activity</code> after attaching it to a <code>TabActivity</code>.  Well the answer is you can, but figuring it out on Monodroid will make your hair go gray.  After digging through the Java based Android Documentation I finally figured it out.  I don't know if this is the right way, but it works:</p>
<p><strong>Declare an enumeration object with each of your tabs:</strong></p>
<pre>
public enum TABS {
   BasicInformation = 0,
   Detailinformation = 1,
   OptionalInforation = 2
};
</pre>
<p><strong>Then add an abstract class to each of your <code>Activity</code> Objects:</strong></p>
<pre>
public abstract class MyDroidActivity : Activity {
   public abstract bool SaveActivity();

   // Any other custom code you had
}
&lt;/code&gt;

&lt;strong&gt;Then inside your inherited &lt;code&gt;Activity&lt;/code&gt;:&lt;/strong&gt;
&lt;code&gt;
public class BasicInfoActivity : MyDroidActivity {
   public override bool SaveActivity() {
         // Error handling to return false if for instance the fields weren&#039;t populated
   }
}
</pre>
<p><strong>Then in your <code>TabActivity</code> Class:</strong></p>
<pre>
private void SaveAllTabs() {
   TabHost.CurrentTab = (int)TABS.BasicInformation;

   BasicInformation biTab = (BasicInformation)LocalActivityManager.GetActivity(TabHost.CurrentTabTag);

if (!biTab.SaveActivity()) {
return;
}

// And continue with your other Tabs
}
</pre>
<p>Not the most elegant, but works.  The inherited class and enumerations are not necessary, but helps keep things in order, especially if you have a larger application in my opinion.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jarredcapellman.com/2012/02/06/accessing-activity-from-tabactivity-using-monodroid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

