<?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>BibleTech Blog &#187; code.logos.com</title>
	<atom:link href="http://www.bibletechconference.com/blog/category/code-logos-com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bibletechconference.com/blog</link>
	<description>Discussing the Intersection of the Bible and Technology</description>
	<lastBuildDate>Fri, 20 Aug 2010 16:14:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Uri.ToString Must Die</title>
		<link>http://www.bibletechconference.com/blog/uri-tostring-must-die/</link>
		<comments>http://www.bibletechconference.com/blog/uri-tostring-must-die/#comments</comments>
		<pubDate>Fri, 20 Aug 2010 16:14:07 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[code.logos.com]]></category>

		<guid isPermaLink="false">http://www.bibletechconference.com/blog/uri-tostring-must-die/</guid>
		<description><![CDATA[ If your code uses Uri.ToString , it’s probably a bug . The Uri.ToString method is documented as returning the “unescaped canonical representation” of the URI. Put simply, this means it’s corrupted. ]]></description>
			<content:encoded><![CDATA[<p>If your code uses <a title="Uri.ToString Method (MSDN)" href="http://msdn.microsoft.com/en-us/library/system.uri.tostring.aspx">Uri.ToString</a>, it’s <a title="System.Uri constructor automatically Urldecodes %26 and %3D to &#038; and =" href="http://connect.microsoft.com/VisualStudio/feedback/details/475650/system-uri-constructor-automatically-urldecodes-26-and-3d-to-and">probably</a> <a title="Uri.ToString method does not properly output Unicode characters" href="http://connect.microsoft.com/VisualStudio/feedback/details/305642/uri-tostring-method-does-not-properly-output-unicode-characters">a</a> <a title="Uri.ToString() Returns Invalid URL by Erroneously UrlDecoding Each Argument" href="http://connect.microsoft.com/VisualStudio/feedback/details/278867/uri-tostring-returns-invalid-url-by-erroneously-urldecoding-each-argument">bug</a>.</p>
<p>The Uri.ToString method is documented as returning the “unescaped canonical representation” of the URI. Put simply, this means it’s corrupted. Characters like + and &#038; will become unescaped, which completely changes the meaning of the URI.</p>
<p>Say you want to use WolframAlpha to do some maths:</p>
<div>
]]></content:encoded>
			<wfw:commentRss>http://www.bibletechconference.com/blog/uri-tostring-must-die/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exceptions thrown by BitmapImage and BitmapFrame</title>
		<link>http://www.bibletechconference.com/blog/exceptions-thrown-by-bitmapimage-and-bitmapframe/</link>
		<comments>http://www.bibletechconference.com/blog/exceptions-thrown-by-bitmapimage-and-bitmapframe/#comments</comments>
		<pubDate>Sun, 01 Aug 2010 00:38:36 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[code.logos.com]]></category>

		<guid isPermaLink="false">http://www.bibletechconference.com/blog/exceptions-thrown-by-bitmapimage-and-bitmapframe/</guid>
		<description><![CDATA[ Scott Hanselman blogged about an ArgumentException that can be thrown when loading an image with a corrupted color profile . Coincidentally, we had been unifying the exception handling for BitmapImage in the Logos 4 code that same day. These are all the exceptions we have found WPF (or WIC) to throw when loading a BitmapImage (by setting its StreamSource or UriSource property) or BitmapFrame (by calling BitmapFrame.Create). ]]></description>
			<content:encoded><![CDATA[<p>Scott Hanselman blogged about an ArgumentException that can be thrown when <a href="http://www.hanselman.com/blog/DealingWithImagesWithBadMetadataCorruptedColorProfilesInWPF.aspx">loading an image with a corrupted color profile</a>. Coincidentally, we had been unifying the exception handling for BitmapImage in the Logos 4 code that same day. These are all the exceptions we have found WPF (or WIC) to throw when loading a BitmapImage (by setting its StreamSource or UriSource property) or BitmapFrame (by calling BitmapFrame.Create).</p>
<h3>ArgumentException</h3>
<h4>Sample Call Stack</h4>
<pre>System.ArgumentException: The image has corrupted metadata header.
 ---> System.Runtime.InteropServices.COMException (0x88982F63): Exception from HRESULT: 0x88982F63
   --- End of inner exception stack trace ---
   at System.Windows.Media.Imaging.BitmapDecoder.SetupDecoderFromUriOrStream(Uri uri,
     Stream stream, BitmapCacheOption cacheOption, Guid&#038; clsId, Boolean&#038;
     isOriginalWritable, Stream&#038; uriStream, UnmanagedMemoryStream&#038;
     unmanagedMemoryStream, SafeFileHandle&#038; safeFilehandle)
   at System.Windows.Media.Imaging.BitmapDecoder.CreateFromUriOrStream(Uri baseUri, Uri uri,
     Stream stream, BitmapCreateOptions createOptions, BitmapCacheOption cacheOption,
     RequestCachePolicy uriCachePolicy, Boolean insertInDecoderCache)
   at System.Windows.Media.Imaging.BitmapDecoder.Create(Stream bitmapStream,
     BitmapCreateOptions createOptions, BitmapCacheOption cacheOption)
   at System.Windows.Media.Imaging.BitmapFrame.CreateFromUriOrStream(Uri baseUri, Uri uri,
     Stream stream, BitmapCreateOptions createOptions, BitmapCacheOption cacheOption,
     RequestCachePolicy uriCachePolicy)
   at System.Windows.Media.Imaging.BitmapFrame.Create(Stream bitmapStream,
     BitmapCreateOptions createOptions, BitmapCacheOption cacheOption)</pre>
<h4>Cause and Workaround</h4>
<p>An ArgumentException generally seems to be caused by a corrupted image metadata or header. Scott Hanselman suggests using <a href="http://msdn.microsoft.com/en-us/library/system.windows.media.imaging.bitmapcreateoptions.aspx">BitmapCreateOptions.IgnoreColorProfile</a> to ignore potentially corrupt color profile information; we don&#8217;t know of any workarounds for other types of corruption.</p>
<h3>COMException</h3>
<h4>Sample Call Stack</h4>
<pre>System.Runtime.InteropServices.COMException (0x80070000): An invalid character was found in text content.
  at System.Windows.Media.ColorContextHelper.OpenColorProfile(IntPtr pProfile)
  at System.Windows.Media.ColorContext.FromRawBytes(Byte[] data, Int32 dataLength)
  at System.Windows.Media.ColorContext.FromStream(Stream stm, String filename)
  at System.Windows.Media.ColorContext.Initialize(Uri profileUri, Boolean isStandardProfileUriNotFromUser)
  at System.Windows.Media.ColorContext..ctor(PixelFormat pixelFormat)
  at System.Windows.Media.Imaging.BitmapSource.CreateCachedBitmap(BitmapFrame frame,
    BitmapSourceSafeMILHandle wicSource, BitmapCreateOptions createOptions, BitmapCacheOption
    cacheOption, BitmapPalette palette)
  at System.Windows.Media.Imaging.BitmapFrameDecode.FinalizeCreation()
  at System.Windows.Media.Imaging.BitmapFrameDecode..ctor(Int32 frameNumber,
    BitmapSourceSafeMILHandle sourceHandle, BitmapCreateOptions createOptions,
    BitmapCacheOption cacheOption, BitmapDecoder decoder)
  at System.Windows.Media.Imaging.BitmapDecoder.SetupFrames(BitmapDecoder decoder,
    ReadOnlyCollection`1 frames)
  at System.Windows.Media.Imaging.BitmapDecoder.get_Frames()
  at System.Windows.Media.Imaging.BitmapFrame.CreateFromUriOrStream(Uri baseUri, Uri uri,
    Stream stream, BitmapCreateOptions createOptions, BitmapCacheOption cacheOption,
    RequestCachePolicy uriCachePolicy)
  at System.Windows.Media.Imaging.BitmapFrame.Create(Uri bitmapUri, RequestCachePolicy uriCachePolicy)
  at System.Windows.Media.Imaging.BitmapFrame.Create(Uri bitmapUri)</pre>
<h4>Cause and Workaround</h4>
<p>This particular exception was caused by an invalid system color profile (set in the Advanced tab in Color Management in Control Panel). The user with this problem got an error message when he opened that dialog, but once he reset the device profile to the system default, this COMException stopped being thrown.</p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Advanced Color Management dialog" border="0" alt="Advanced Color Management dialog" src="http://www.bibletechconference.com/blog/wp-content/uploads/2010/08/1856747483file_3.png.png" width="740" height="167" /> </p>
<p>Note that the exception message (&#8220;An invalid character was found&#8221;) is completely unrelated to the actual problem; the error handling logic in ColorContextHelper has <a href="https://connect.microsoft.com/VisualStudio/feedback/details/523138/system-windows-media-colorcontexthelper-openprofile-throws-meaningless-comexception">a bug</a>.</p>
<h3>FileFormatException</h3>
<h4>Sample Call Stack</h4>
<pre>System.IO.FileFormatException: The image format is unrecognized.
 ---> System.Runtime.InteropServices.COMException (0x88982F07): Exception from HRESULT: 0x88982F07
  --- End of inner exception stack trace ---
  at System.Windows.Media.Imaging.BitmapDecoder.SetupDecoderFromUriOrStream(Uri uri,
    Stream stream, BitmapCacheOption cacheOption, Guid&#038; clsId, Boolean&#038; isOriginalWritable,
    Stream&#038; uriStream, UnmanagedMemoryStream&#038; unmanagedMemoryStream,
    SafeFileHandle&#038; safeFilehandle)
  at System.Windows.Media.Imaging.BitmapDecoder.CreateFromUriOrStream(Uri baseUri, Uri uri,
    Stream stream, BitmapCreateOptions createOptions, BitmapCacheOption cacheOption,
    RequestCachePolicy uriCachePolicy, Boolean insertInDecoderCache)
  at System.Windows.Media.Imaging.BitmapImage.FinalizeCreation()
  at System.Windows.Media.Imaging.BitmapImage.EndInit()</pre>
<h4>Cause and Workaround</h4>
<p>This can be caused by trying to load a file that isn&#8217;t an image. It can also be caused by loading an image from a Stream that is not at the origin. To work around this bug, see <a title="Image Format Error when Loading from a Stream (Logos Code Blog)" href="http://code.logos.com/blog/2008/08/image_format_error_when_loading_from_a_stream.html">my previous blog post</a> and the sample <a title="RebasedStream.cs (GitHub)" href="http://github.com/LogosBible/Logos.Utility/blob/master/src/Logos.Utility/IO/RebasedStream.cs">RebasedStream source code</a>.</p>
<h3>NotSupportedException</h3>
<h4>Sample Call Stack</h4>
<pre>System.NotSupportedException: No imaging component suitable to complete this operation was found.
 ---> System.Runtime.InteropServices.COMException (0x88982F50): Exception from HRESULT: 0x88982F50
  --- End of inner exception stack trace ---
  at System.Windows.Media.Imaging.BitmapDecoder.SetupDecoderFromUriOrStream(Uri uri,
    Stream stream, BitmapCacheOption cacheOption, Guid&#038; clsId, Boolean&#038; isOriginalWritable,
    Stream&#038; uriStream, UnmanagedMemoryStream&#038; unmanagedMemoryStream,
    SafeFileHandle&#038; safeFilehandle)
  at System.Windows.Media.Imaging.BitmapDecoder.CreateFromUriOrStream(Uri baseUri, Uri uri,
    Stream stream, BitmapCreateOptions createOptions, BitmapCacheOption cacheOption,
    RequestCachePolicy uriCachePolicy, Boolean insertInDecoderCache)
  at System.Windows.Media.Imaging.BitmapFrame.CreateFromUriOrStream(Uri baseUri, Uri uri,
    Stream stream, BitmapCreateOptions createOptions, BitmapCacheOption cacheOption,
    RequestCachePolicy uriCachePolicy)
  at System.Windows.Media.Imaging.BitmapFrame.Create(Uri bitmapUri, RequestCachePolicy uriCachePolicy)
  at System.Windows.Media.Imaging.BitmapFrame.Create(Uri bitmapUri)</pre>
<h4>Cause and Workaround</h4>
<p>This error is typically due to bad metadata in the image. Curiously, we see this error the most often on Windows 7 (and a Vista system may load the same image just fine!); maybe this is due to <a href="http://blogs.msdn.com/b/rwlodarc/archive/2008/10/28/wic-in-windows-7-pre-beta.aspx">WIC changes in Windows 7</a>. For images we control, opening and saving them again in <a href="http://www.getpaint.net/">Paint.NET</a> (or some other image editing program) overwrites the bad metadata and allows WPF/WIC to load the image.</p>
<h3>OutOfMemoryException</h3>
<h4>Cause and Workaround</h4>
<p>If there is already memory pressure on the system (e.g., from other components in your application), and the image being loaded is very large, there may not be enough virtual address space for WIC/WPF to allocate the storage it needs to decode the bitmap. (And, sometimes, both native and managed buffers are required, which doubles memory usage!)</p>
<p>Setting <a href="http://msdn.microsoft.com/en-us/library/system.windows.media.imaging.bitmapimage.decodepixelwidth.aspx">BitmapImage.DecodePixelWidth</a> or <a href="http://msdn.microsoft.com/en-us/library/system.windows.media.imaging.bitmapimage.decodepixelheight.aspx">BitmapImage.DecodePixelHeight</a> (to something smaller than the actual size) can dramatically reduce memory usage and allow the image to be loaded. This is especially useful if your application only needs to show a thumbnail in the UI; it&#8217;s also much more efficient than loading the original image and scaling it in XAML.</p>
<h3>IOException / UnauthorizedAccessException</h3>
<h4>Sample Call Stack</h4>
<pre>System.IO.IOException: Cannot locate resource 'images/icon.png'.
  at MS.Internal.AppModel.ResourcePart.GetStreamCore(FileMode mode, FileAccess access)
  at System.IO.Packaging.PackagePart.GetStream(FileMode mode, FileAccess access)
  at System.IO.Packaging.PackWebResponse.CachedResponse.GetResponseStream()
  at System.IO.Packaging.PackWebResponse.GetResponseStream()
  at System.IO.Packaging.PackWebResponse.get_ContentType()
  at System.Windows.Media.Imaging.BitmapDecoder.SetupDecoderFromUriOrStream(Uri uri,
    Stream stream, BitmapCacheOption cacheOption, Guid&#038; clsId, Boolean&#038; isOriginalWritable,
    Stream&#038; uriStream, UnmanagedMemoryStream&#038; unmanagedMemoryStream,
    SafeFileHandle&#038; safeFilehandle)
  at System.Windows.Media.Imaging.BitmapDecoder.CreateFromUriOrStream(Uri baseUri, Uri uri,
    Stream stream, BitmapCreateOptions createOptions, BitmapCacheOption cacheOption,
    RequestCachePolicy uriCachePolicy, Boolean insertInDecoderCache)
  at System.Windows.Media.Imaging.BitmapImage.FinalizeCreation()
  at System.Windows.Media.Imaging.BitmapImage.EndInit()
  at System.Windows.Media.Imaging.BitmapImage..ctor(Uri uriSource, RequestCachePolicy uriCachePolicy)
  at System.Windows.Media.Imaging.BitmapImage..ctor(Uri uriSource)</pre>
<h4>Cause and Workaround</h4>
<p>If you&#8217;re loading an image from a file: URI, any normal filesystem-related exceptions that come from opening local files could be thrown. Or, if you&#8217;re using pack: URIs, an exception will be thrown if there&#8217;s a typo in the URI or the named resource is missing.</p>
<h3></h3>
<h3>Summary</h3>
<p>The BitmapImage and BitmapFrame creation functions can throw a wide variety of exception types&#8211;the list above may very well not be exhaustive (and the documentation provides no information on what else may be thrown). Since these exceptions can depend on many environmental factors (client OS, file permissions, memory pressure, etc.), code that loads bitmaps needs to anticipate failure when loading any image and gracefully handle this situation.</p>
<p>    <img src="http://feeds.feedburner.com/~r/LogosBibleSoftwareCodeBlog/~4/fRy3urSC7W8" height="1" width="1" /></p>
<p style=font-style:italic;font-size:10px;padding-top:15px;>This post originally appeared on <a href=http://code.logos.com/blog/2010/07/exceptions_thrown_by_bitmapimage_and_bitmapframe.html>code.logos.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bibletechconference.com/blog/exceptions-thrown-by-bitmapimage-and-bitmapframe/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Two patches for System.Data.SQLite</title>
		<link>http://www.bibletechconference.com/blog/two-patches-for-system-data-sqlite/</link>
		<comments>http://www.bibletechconference.com/blog/two-patches-for-system-data-sqlite/#comments</comments>
		<pubDate>Fri, 30 Jul 2010 21:05:10 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[code.logos.com]]></category>

		<guid isPermaLink="false">http://www.bibletechconference.com/blog/two-patches-for-system-data-sqlite/</guid>
		<description><![CDATA[ System.Data.SQLite is a great ADO.NET wrapper around the free SQLite embedded database library. ]]></description>
			<content:encoded><![CDATA[<p><a href="http://sqlite.phxsoftware.com/">System.Data.SQLite</a> is a great ADO.NET wrapper around the free <a href="http://sqlite.org/">SQLite</a> embedded database library. Today we contributed two simple patches to the project.</p>
<p>The <a href="http://sqlite.phxsoftware.com/forums/t/2482.aspx">first patch</a> adds support to SQLiteJournalModeEnum for the “truncate” journal mode (added in v3.6.4 of SQLite).</p>
<p>The <a href="http://sqlite.phxsoftware.com/forums/t/2483.aspx">second patch</a> adds support to SQLiteException for logging the extended error information (for SQLITE_IOERR).</p>
<p>    <img src="http://feeds.feedburner.com/~r/LogosBibleSoftwareCodeBlog/~4/Hke1_xBpeC0" height="1" width="1" /></p>
<p style=font-style:italic;font-size:10px;padding-top:15px;>This post originally appeared on <a href=http://code.logos.com/blog/2010/07/two_patches_for_systemdatasqlite.html>code.logos.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bibletechconference.com/blog/two-patches-for-system-data-sqlite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Detecting the Character Encoding of a File</title>
		<link>http://www.bibletechconference.com/blog/detecting-the-character-encoding-of-a-file/</link>
		<comments>http://www.bibletechconference.com/blog/detecting-the-character-encoding-of-a-file/#comments</comments>
		<pubDate>Thu, 13 May 2010 23:56:58 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[code.logos.com]]></category>

		<guid isPermaLink="false">http://www.bibletechconference.com/blog/detecting-the-character-encoding-of-a-file/</guid>
		<description><![CDATA[ There are several occasions when it’s necessary to automatically detect the encoding that’s used by a file: perhaps your program has an “Import” feature that allows the user to open an arbitrary text file, or perhaps you need to read a HTML file and don’t have access to (or can’t trust) the Content-Type HTTP header. (For an introduction to encodings, see The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!) by Joel Spolsky.) On U.S]]></description>
			<content:encoded><![CDATA[<p>There are several occasions when it’s necessary to automatically detect the encoding that’s used by a file: perhaps your program has an “Import” feature that allows the user to open an arbitrary text file, or perhaps you need to read a HTML file and don’t have access to (or can’t trust) the Content-Type HTTP header. (For an introduction to encodings, see <a href="http://www.joelonsoftware.com/articles/Unicode.html">The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)</a> by Joel Spolsky.)</p>
<p>On U.S. English Windows, you can usually assume that the file might be encoded with <a href="http://en.wikipedia.org/wiki/UTF-8">UTF-8</a> or <a href="http://en.wikipedia.org/wiki/Windows-1252">Windows-1252</a>, but if you guess wrong, you might get text that looks like this:</p>
<blockquote><p><tt>�It�s mine,� he said.</tt></p></blockquote>
<p>or this:</p>
<blockquote><p><tt>â€œItâ€™s mine,â€ he said.</tt></p></blockquote>
<p>or worst yet, this:</p>
<blockquote><p><tt>Unhandled System.Text.DecoderFallbackException</tt></p></blockquote>
<p>While it’s obviously best to know the encoding that’s used by the input you’re processing, sometimes there’s no way to know it ahead of time. In that case, there are libraries that can guess the encoding, usually based on statistical analysis of the bytes or detection of invalid byte sequences. The Mozilla project has a <a href="http://www.mozilla.org/projects/intl/detectorsrc.html">universal charset detector</a>, and Microsoft has been shipping <a href="http://msdn.microsoft.com/en-us/library/aa767865(VS.85).aspx">MLang</a>, a COM component that provides code page detection through the <a href="http://msdn.microsoft.com/en-us/library/aa740985(v=VS.85).aspx">IMultiLanguage2.DetectCodepageInIStream</a> method since IE5.</p>
<p>The COM interfaces and structures we need are declared as follows (definitions taken from MLang.h in the Windows SDK):</p>
<div>
]]></content:encoded>
			<wfw:commentRss>http://www.bibletechconference.com/blog/detecting-the-character-encoding-of-a-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pinned GCHandle Wrapper</title>
		<link>http://www.bibletechconference.com/blog/pinned-gchandle-wrapper/</link>
		<comments>http://www.bibletechconference.com/blog/pinned-gchandle-wrapper/#comments</comments>
		<pubDate>Thu, 13 May 2010 13:17:11 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[code.logos.com]]></category>

		<guid isPermaLink="false">http://www.bibletechconference.com/blog/pinned-gchandle-wrapper/</guid>
		<description><![CDATA[ The GCHandle type is useful when passing a memory address to an unmanaged function (without using unsafe code). In most cases, you will want to allocate it as GCHandleType.Pinned so that the garbage collector doesn’t move the data in memory while native code is using it. As per the documentation, “This prevents the garbage collector from moving the object and hence undermines the efficiency of the garbage collector. ]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.gchandle(v=VS.100).aspx">GCHandle</a> type is useful when passing a memory address to an unmanaged function (without using unsafe code). In most cases, you will want to allocate it as <a href="http://msdn.microsoft.com/en-us/library/83y4ak54(v=VS.100).aspx">GCHandleType.Pinned</a> so that the garbage collector doesn’t move the data in memory while native code is using it. As per the documentation, “This prevents the garbage collector from moving the object and hence undermines the efficiency of the garbage collector. Use the Free method to free the allocated handle as soon as possible.”</p>
<p>It would be nice to use the ‘using’ statement with GCHandle to (a) ensure that Free is always called, and (b) clearly mark the scope of the GCHandle and limit its lifetime. Unfortunately, GCHandle does not implement IDisposable, but it’s straightforward to write a wrapper struct that does:</p>
<div>
]]></content:encoded>
			<wfw:commentRss>http://www.bibletechconference.com/blog/pinned-gchandle-wrapper/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Using Extension for Spark View Engine</title>
		<link>http://www.bibletechconference.com/blog/a-using-extension-for-spark-view-engine/</link>
		<comments>http://www.bibletechconference.com/blog/a-using-extension-for-spark-view-engine/#comments</comments>
		<pubDate>Tue, 04 May 2010 20:19:18 +0000</pubDate>
		<dc:creator>jayson</dc:creator>
				<category><![CDATA[code.logos.com]]></category>

		<guid isPermaLink="false">http://www.bibletechconference.com/blog/a-using-extension-for-spark-view-engine/</guid>
		<description><![CDATA[ We've recently started using Spark View Engine for some ASP.NET MVC projects here at Logos. ]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve recently started using <a href="http://sparkviewengine.com/">Spark View Engine</a> for some ASP.NET MVC projects here at Logos. To me, the syntax feels cleaner than ASP.NET views, probably because it&#8217;s more markup and less embedded code. One thing that bugged me was that in order to use MVC form helpers I had to go back to embedding code.</p>
<div>
<p><span>#</span> <span>using</span> (Html.BeginForm()) {</p>
<p>
]]></content:encoded>
			<wfw:commentRss>http://www.bibletechconference.com/blog/a-using-extension-for-spark-view-engine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introduction: Dave Dunkin</title>
		<link>http://www.bibletechconference.com/blog/introduction-dave-dunkin/</link>
		<comments>http://www.bibletechconference.com/blog/introduction-dave-dunkin/#comments</comments>
		<pubDate>Tue, 04 May 2010 20:02:51 +0000</pubDate>
		<dc:creator>Sean Boisen</dc:creator>
				<category><![CDATA[code.logos.com]]></category>

		<guid isPermaLink="false">http://www.bibletechconference.com/blog/introduction-dave-dunkin/</guid>
		<description><![CDATA[ I'm Dave. I've been developing software in some form since around the time I learned to ride a bike, professionally since 1998 and at Logos since 2008. I've spent most of my career developing web applications, mostly in Java, but also PHP, Ruby and most recently, C#. ]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m Dave. I&#8217;ve been developing software in some form since around the time I learned to ride a bike, professionally since 1998 and at Logos since 2008. I&#8217;ve spent most of my career developing web applications, mostly in Java, but also PHP, Ruby and most recently, C#. In the last few months, Objective-C found its way into my toolbox as well as I&#8217;ve been working on the <a href="http://www.logos.com/iphone">Logos iPhone app</a>.</p>
<p style="font-style: italic; font-size: 10px; padding-top: 15px;">This post originally appeared on <a href="http://code.logos.com/blog/2010/05/introduction_dave_dunkin.html">code.logos.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bibletechconference.com/blog/introduction-dave-dunkin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Checking for possibly null values in LINQ</title>
		<link>http://www.bibletechconference.com/blog/checking-for-possibly-null-values-in-linq/</link>
		<comments>http://www.bibletechconference.com/blog/checking-for-possibly-null-values-in-linq/#comments</comments>
		<pubDate>Fri, 30 Apr 2010 21:21:42 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[code.logos.com]]></category>

		<guid isPermaLink="false">http://www.bibletechconference.com/blog/checking-for-possibly-null-values-in-linq/</guid>
		<description><![CDATA[ I recently encountered some confusing code that was written to work around this issue . ]]></description>
			<content:encoded><![CDATA[<p>I recently encountered some confusing code that was written to work around <a href="https://connect.microsoft.com/data/feedback/details/545491/linq-to-entities-incorrect-handling-of-null-variables-in-where-clause?wa=wsignin1.0">this issue</a>. Let&#8217;s say you want to find all items whose title is null. Using LINQ, you could do something like this:</p>
<pre>var titleless = items.Where(x => x.Title == null);</pre>
<p>This works just fine in LINQ to Objects, LINQ to SQL, and LINQ to Entities. But what if you instead want to find all items whose title is equal to a variable that may or may not be null?</p>
<pre>string title = null;
var titleless = items.Where(x => x.Title == title);</pre>
<p>This works in LINQ to Objects, but not LINQ to SQL or LINQ to Entities, due to the fact that it generates SQL something like this: </p>
<pre>select * from Items where Title = @x </pre>
<p>which translates into </p>
<pre>select * from Items where Title = null </pre>
<p>which doesn&#8217;t match anything, because null does not equal null in SQL. It needs to generate this:</p>
<pre>select * from Items where Title is null </pre>
<p>You can make it work in LINQ to SQL if you use object.Equals: </p>
<pre>var titleless = items.Where(x => object.Equals(x.Title, title)); </pre>
<p>That generates the <strong>is null</strong> when title is null. But it doesn&#8217;t work in LINQ to Entities. You can make it work in LINQ to Entities with this statement: </p>
<pre>var titleless = items.Where(  x => title == null ? x.Title == null : x.Title == title); </pre>
<p>But that generates some scary SQL akin to this: </p>
<pre>select * from Items where (</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bibletechconference.com/blog/checking-for-possibly-null-values-in-linq/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WhereNotNull Extension Method</title>
		<link>http://www.bibletechconference.com/blog/wherenotnull-extension-method/</link>
		<comments>http://www.bibletechconference.com/blog/wherenotnull-extension-method/#comments</comments>
		<pubDate>Thu, 22 Apr 2010 03:20:57 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[code.logos.com]]></category>

		<guid isPermaLink="false">http://www.bibletechconference.com/blog/wherenotnull-extension-method/</guid>
		<description><![CDATA[ It’s not uncommon to write code similar to the following: ]]></description>
			<content:encoded><![CDATA[<p>It’s not uncommon to write code similar to the following:</p>
<div>
<div>
]]></content:encoded>
			<wfw:commentRss>http://www.bibletechconference.com/blog/wherenotnull-extension-method/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Apply for an Internship at Logos</title>
		<link>http://www.bibletechconference.com/blog/how-to-apply-for-an-internship-at-logos/</link>
		<comments>http://www.bibletechconference.com/blog/how-to-apply-for-an-internship-at-logos/#comments</comments>
		<pubDate>Fri, 16 Apr 2010 21:28:46 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Videos]]></category>
		<category><![CDATA[code.logos.com]]></category>

		<guid isPermaLink="false">http://www.bibletechconference.com/blog/how-to-apply-for-an-internship-at-logos/</guid>
		<description><![CDATA[ Sometimes, when promoting internships at Logos, I’m asked what kind of questions we ask on the interview. Or I’ll get an email from a candidate we rejected, asking how they could have done better. ]]></description>
			<content:encoded><![CDATA[<p>Sometimes, when promoting internships at Logos, I’m asked what kind of questions we ask on the interview. Or I’ll get an email from a candidate we rejected, asking how they could have done better. I’m not going to give out our list of interview questions, but I will give advice on how to really stand out when applying.</p>
<p>We don’t require a checklist of skills (“3 years experience with .NET 4”), nor are we impressed with a dense list of acronyms on a résumé. We’re looking for coders who are passionate about programming and who have the talent to tackle any huge problem we will throw at them. Here are some qualities we want to see in a potential hire.</p>
<p><strong>CompSci Basics.</strong> Understand algorithms, data structures, computational complexity. Know the basics of hardware (e.g., order these by speed: HDD, LAN, L1, RAM, L2, Internet, DVD), bits &#038; bytes (e.g., the “interesting” powers of 2), and software (operating systems, compilers, Internet protocols). Become familiar with technologies relevant to our field (Unicode, cloud computing, information retrieval, etc.).</p>
<p><strong>Know the Company. </strong>Browse our websites, find out what we do &#038; who we are, watch our videos, read our blog, use our products. If you go to church, maybe your pastor owns a copy of our software and could show it to you. (If they don’t own it, <em>why not?</em> Get <em>them</em> to watch the videos.)</p>
<p><strong>Show Passion. </strong>Do something outside of school. Find an open source project and contribute to it. Learn what’s new in C++0x, C# 4, Java 7, or HTML5. Write a blog. Enter a programming competition. Download Python/Ruby/Haskell and work through an online tutorial. Write an online tutorial. Start a user group interested in some technology. Read a book that isn’t part of your CS curriculum.</p>
<p>For further reading, I recommend a three-part series posted by Tyler Hicks-Wright: <a href="http://hicks-wright.net/blog/how-to-get-a-job-at-fog-creek-part-1/">How to Get a Job at Fog Creek (and Other Selective Software Companies), Part 1</a>; <a title="How to Get a Job at Fog Creek (and Other Selective Software Companies), Part 2" href="http://hicks-wright.net/blog/how-to-get-a-job-at-fog-creek-part-2/">Part 2</a>; <a title="How to Get a Job at Fog Creek (and Other Selective Software Companies), Part 3" href="http://hicks-wright.net/blog/how-to-get-a-job-at-fog-creek-part-3/">Part 3</a>. </p>
<p>    <img src="http://feeds.feedburner.com/~r/LogosBibleSoftwareCodeBlog/~4/_GF02Gq13KA" height="1" width="1" /></p>
<p style=font-style:italic;font-size:10px;padding-top:15px;>This post originally appeared on <a href=http://code.logos.com/blog/2010/04/how_to_apply_for_an_internship_at_logos.html>code.logos.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bibletechconference.com/blog/how-to-apply-for-an-internship-at-logos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
