<?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>Terry's Worklog &#187; Microsoft</title>
	<atom:link href="http://people.oregonstate.edu/~reeset/blog/groups/microsoft/feed" rel="self" type="application/rss+xml" />
	<link>http://people.oregonstate.edu/~reeset/blog</link>
	<description>On my work (programming, digital libraries, cataloging) and other stuff that perks my interest (family, cycling, etc)</description>
	<lastBuildDate>Sat, 21 Nov 2009 10:07:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Trying out Windows 7 with the TV</title>
		<link>http://people.oregonstate.edu/~reeset/blog/archives/616</link>
		<comments>http://people.oregonstate.edu/~reeset/blog/archives/616#comments</comments>
		<pubDate>Tue, 03 Feb 2009 09:01:42 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Media PC]]></category>
		<category><![CDATA[Netbook]]></category>
		<category><![CDATA[Windows 7]]></category>

		<guid isPermaLink="false">http://oregonstate.edu/~reeset/blog/archives/616</guid>
		<description><![CDATA[One of the benefits of having a large flat screen TV is the wide abundance of video inputs.&#160; At present, there are 8 on our TV, 4 HD,&#160; 2 RCA style, 1 cable and 1 PC connection (DVI).&#160; This leaves lots of room for experimentation.&#160; 
As noted on Saturday (http://oregonstate.edu/~reeset/blog/archives/614), I picked up a netbook, [...]]]></description>
			<content:encoded><![CDATA[<p>One of the benefits of having a large flat screen TV is the wide abundance of video inputs.&#160; At present, there are 8 on our TV, 4 HD,&#160; 2 RCA style, 1 cable and 1 PC connection (DVI).&#160; This leaves lots of room for experimentation.&#160; </p>
<p>As noted on Saturday (<a title="http://oregonstate.edu/~reeset/blog/archives/614" href="http://oregonstate.edu/~reeset/blog/archives/614">http://oregonstate.edu/~reeset/blog/archives/614</a>), I picked up a netbook, the MSI Wind (<a title="http://www.msimobile.com/level3_productpage.aspx?cid=3&amp;id=40" href="http://www.msimobile.com/level3_productpage.aspx?cid=3&amp;id=40">http://www.msimobile.com/level3_productpage.aspx?cid=3&amp;id=40</a>).&#160; Officially, the netbook is for my wife – who has taken up blogging and book reviewing as a hobby.&#160; It gives her a chance to work away from the desktop and in the living room with me in the evening.&#160; However, unofficially, it’s also a toy for me to try new things, as well as play with a netbook (as well as evaluate the feasibility of getting these for work).&#160; </p>
<p>Anyway, one of the first things that I did with the Netbook was drop Windows XP for the test build of Windows 7.&#160; I’ve been looking for a place to try it, and since my wife has been using Vista for a little over a year (I like the parental controls) – I figured that Windows 7 wouldn’t be too much of a difference.&#160; As I noted in the previous post, I was very pleased with how well it has run on this netbook.&#160; In all honest, it boots faster than the original XP system (takes about 10 seconds to go from a cold boot to active) – can run the areo interface on much lighter hardware than Vista (the netbook for example has no problem with it using the integrated video card), and as I spend time working with the system, have been really impressed with the polish in a beta build (especially when you consider what the first public Vista beta looked like).&#160; </p>
<p>So, that was a long explanation for my current project.&#160; I have a lot of computers at home.&#160; The oldest machine that I still use occasionally is a machine that I purchased from Dell in 1998 (I just keep updating the components) up to our current desktop.&#160; Well, yesterday, I was sitting around and wanted to watch an episode of the Simpsons .&#160; I didn’t have the particular episode that I was interested in watching, so I went online and found it (on hulu I think).&#160; Anyway, I hooked up the netbook and feed the video directly to the TV and it worked so well through the DVI cable that I thought I’d setup my own Media PC and see how well I could get it to work.</p>
<p>So….I dusted off a 4 year old media pc that I rarely turn on and decided to wipe the hard-drive and install Windows 7 and see how the new media functionality worked on it (as well as see how Windows 7 worked on a really old system that I wouldn’t touch Vista with).&#160; Again, like with the netbook, the install took approximately 20 minutes to install and apply current updates and create user account.&#160; As well, Windows 7 recognized all the old hardware, and appropriate drivers were added.&#160; From there, I moved the computer next to the TV and let the experiment begin.&#160; I figure, if I like this setup, I’ll likely end up purchasing a light-weight PC that I can use as a media machine – but for now – this will do.&#160; With the current setup, the machine can stream content directly to the TV (unfortunately, not recording yet – though I might pick up a cheap TV input card so I can setup a simplified DVR recorder).&#160; So right now, I’m hanging out at home watching the last episode of the <em>Office</em> (which I missed), an episode of <em>He Man, masters of the Universe</em> (I love old cartoons) and then an episode of <em>Married…With Children</em> (another one of my guilty pleasures).&#160; I’ve been primarily watching episodes via Hulu – and I’m surprised at the video quality.&#160; It’s not DVD quality – but certainly as good an anything off VHS or cable.&#160; I’m not sure if this is because of Hulu’s quality, my high speed internet (thank you Monmouth-Independence) or a combination of things.&#160; </p>
<p>But so far, so good.&#160; It looks like this little setup will work great for testing and seeing why so many people are getting DVR devices.&#160; If anyone has done something similar, give me a shout.&#160; Otherwise, I’ll continue to post updates as I (and my boys) spend time feeding videos through our new test media PC (the boys like watching cartoons online as much as I do, though they seem to be more interested in the current content on Cartoon Network).</p>
<p>&#8211;TR&#160; </p>
]]></content:encoded>
			<wfw:commentRss>http://people.oregonstate.edu/~reeset/blog/archives/616/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>New toys</title>
		<link>http://people.oregonstate.edu/~reeset/blog/archives/614</link>
		<comments>http://people.oregonstate.edu/~reeset/blog/archives/614#comments</comments>
		<pubDate>Mon, 02 Feb 2009 02:26:34 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Netbook]]></category>
		<category><![CDATA[Windows 7]]></category>

		<guid isPermaLink="false">http://oregonstate.edu/~reeset/blog/archives/614</guid>
		<description><![CDATA[So like most folks, I’m hanging out today kind of watching the super bowl – but am also playing with a new toy, my MSI Wind netbook.&#160; This is a nifty little device, running a 1.6 ghz, 1 gb, 160 gb HD, 10.1 inch monitor weight about 2 lbs.&#160; The machine came installed by default [...]]]></description>
			<content:encoded><![CDATA[<p>So like most folks, I’m hanging out today kind of watching the super bowl – but am also playing with a new toy, my MSI Wind netbook.&#160; This is a nifty little device, running a 1.6 ghz, 1 gb, 160 gb HD, 10.1 inch monitor weight about 2 lbs.&#160; The machine came installed by default with Windows XP – but part of the reason why I decided to pick up this little device was to have a platform to test Windows 7, and the netbook seemed like as good as place as any to test out the claims that this OS will take less resources, be more efficient, etc.&#160; So, occasionally, I may jot down a few notes of my experiences using my little advice.</p>
<p>First thoughts are I like this little machine.&#160; It has a full keyboard so I don’t feel cramped typing, has an expandable drive (so soon I’ll have 2 GBs on the machine), 3 USB drives, an SD card reader – all the stuff that you really need to get things onto and off of the machine.&#160; The device seems fairly rugged and cannot believe how light it is.&#160; I’ve tried the ASUS, Acer and HP netbooks and I really like the design that the folks at MSI have used here.&#160; Oh, and the 6 cell battery – looks like I’ve been getting about 3 1/2 hours of burn time.&#160; Oh, and this is quiet and cool.&#160; The laptops that I have at home simply run hot (I’m rarely cold during the winter so long as I have my laptop).&#160; This little device simply doesn’t put out much heat and is super quiet.&#160; A nice, unexpected change from previous hardware used.</p>
<p>Windows 7…At home, I use a wide number of operating systems.&#160; I have a couple of flavors of linux, XP and Vista (no mac since they won’t let me virtualize it), mostly to test various projects that I work on under different systems.&#160; One of the hallmark of Windows installs tends to be scary installs.&#160; I was pleasantly surprised to see that install tool approximately 18 minutes on this netbook – all hardware was recognized, drivers loaded.&#160; Since, I’ve loaded Google Chrome, Office 2007, Live Writer (which is what I’m using now) and MarcEdit.&#160; Overall, I’ve been pretty impressed with the way the system handles.&#160; At this point, I have Chrome open, streaming a video from youtube (bruises from chairlift), 5 other tabs, IE with 3 tabs (one my exchange mail), 3 word documents, an excel document (~4 mbs in size) and MarcEdit and still have ~200 mbs of RAM free and not a hint of sluggishness.&#160; This is something I’ll track as I continue working on this little box.</p>
<p>&#8211;TR</p>
]]></content:encoded>
			<wfw:commentRss>http://people.oregonstate.edu/~reeset/blog/archives/614/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>.NET 64-bit processor memory issues when using sendmessage to access a winform element</title>
		<link>http://people.oregonstate.edu/~reeset/blog/archives/444</link>
		<comments>http://people.oregonstate.edu/~reeset/blog/archives/444#comments</comments>
		<pubDate>Wed, 01 Aug 2007 07:40:00 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[MarcEdit]]></category>
		<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://oregonstate.edu/~reeset/blog/archives/444</guid>
		<description><![CDATA[I&#8217;m posting this in hopes that it will save someone else a lot of time or someone that knows .NET a bit better than I can provide a better solution. 
Problem:
Last week, I had someone ping me regarding MarcEdit and a problem that they were running into with the Editor running it on a 64-bit version of [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m posting this in hopes that it will save someone else a lot of time or someone that knows .NET a bit better than I can provide a better solution. </p>
<p><strong>Problem:</strong></p>
<p>Last week, I had someone ping me regarding MarcEdit and a problem that they were running into with the Editor running it on a 64-bit version of Windows 2003 Server.  MarcEdit is compiled for any processor, so in theory, the framework should adjust the variable types to the current CPU type and go on it&#8217;s merry way.  And was it not that I have to work with some unmanaged code within my application, I&#8217;m sure that this would be the case.  However, when opening the MarcEditor, the user was getting the following error message:</p>
<p><a atomicselection="true" href="http://oregonstate.edu/~reeset/blog/wp-content/mslive_images/a51.NET64bitprocessormemoryissueswhenusi_15125/load_error2.png"><img border="0" width="609" src="http://oregonstate.edu/~reeset/blog/wp-content/mslive_images/a51.NET64bitprocessormemoryissueswhenusi_15125/load_error_thumb.png" height="243" style="border: 0px" /></a></p>
<p>This is odd because I test MarcEdit on every version of Windows from 98 to Vista.  The problem however, is I&#8217;ve never ran the program in a 64-bit version of Windows. </p>
<p><strong>Background:</strong></p>
<p>I did a little bit of research, and found what I thought to be the problem.  The 64-bit version of windows shares many of the same signatures as its 32-bit counter-part, but one place where the signatures differ is in the Messaging Queue.  SendMessage, for example, which uses integers to pass values between processes had been updated to 64 bit integers and would crash if the wrong data type is sent into the function.  No problem, I fixed the signature issue, but the error message remained.  What I didn&#8217;t realize is that this wasn&#8217;t the actual problem (though it was a problem).  The real problem seemed to be related to simply accessing the RichTextbox Handle and passing it the callback.  Anytime the Handle was touched and passed, this error would be generated.</p>
<p><strong>Solution:</strong></p>
<p>So, Microsoft does make the Enterprise version of Windows 2003 Server available on a trial basis for developers wanting to test their software.  So, I dug up a box with an AMD-64 bit processor and set to installing the software.  Next, I installed <a target="_blank" href="http://www.icsharpcode.net/OpenSource/SD/">SharpDevelop,</a> an Open Source IDE for .NET.  I created a small sample program to isolate the code that was causing me problems.  In my case, the code that was causing the problem is necessary because of MARC being a UTF8 encoded data format.  Microsoft&#8217;s Richtext library supports the loading of plaintext (ASCII), Unicode text, text with OLE objects and text in just about any character format, including UTF8.  Unfortunately, the .NET framework only exposes plaintext and Unicode text as supported formats.  This means that in order to load UTF8 data and utilize the components streaming nature to minimize the memory footprint during loading, we need to essentially write our own EditStreamCallback function, create the delegates, the EDITSTREAM struct, etc.  And in that, there is the rub.  When compiling the code in SharpDevelop, I specified that the code should be targeted specifically for a 64-bit processor.  During compile, I got two warning messages that two core .NET components are compiled specifically for 32-bit processors.  Since the signatures on the 64 and 32 bit machines are identical, one can generally ignore these compilation warnings, as the framework does it&#8217;s magic.  However, the fact that I&#8217;m utilizing functionality from one of these two components within an unmanaged code block causes the problem.  Within the .NET (and 64-bit environment in general), an 64-bit process cannot load a library compiled for a 32-bit process.  A 32-bit process can run within a 64-bit environment, they just cannot share processes between themselves.  My best guess is that this is what was happening.  Since these two .NET components were compiled specifically for the 32-bit processors, my attempts to load them into a 64-bit process and utilize them within an unmanaged code block caused issues.  The solution is a simply one &#8212; for the GUI application of MarcEdit (which doesn&#8217;t do much anyway), the program simply needs to be complied to target 32-bit processors.  Now it runs just fine within a 64-bit environment, and will remain so until Microsoft cleans up these two core libraries.  With that said, if anyone has a better way of dealing with this problem (code is attached, so if you can make it work, I&#8217;d love to here from you), I&#8217;d love to hear about it.</p>
<p><strong>RichText Code:</strong></p>
<p>Finally, it&#8217;s pretty difficult to find example code dealing with the Richtext components in C#.  I think this is primarily because most folks that use high level languages like C# either don&#8217;t have a need for it or don&#8217;t have the background in C++ to understand what is actually happening at the Proc level.  Anyway, to that end, I&#8217;m posting the source to my small sample program (get it <a target="_blank" href="http://oregonstate.edu/~reeset/marcedit/anonymous/WindowsApplication3.zip">here</a>) that I used to diagnosis this problem.  The trick to doing this type of interaction is to avoid the use of integer class variables.  In .NET, you have to remember that you are dealing with managed code, so when you make the call to a API like SendMessage, you should be Marshalling all your data, and passing it into the function via the IntPtr structure.  The only exception to that with the SendMessage API is the message argument, which microsoft defines and an unsigned 32-bit integer on all platforms, though for practical purposes, the message argument should be classed as a 32-bit integer.</p>
<p><em>API/Delegate Declarations</em></p>
<p class="csharpcode">
<pre class="alt"><span class="lnum">   1:  </span><span class="kwrd">private</span> <span class="kwrd">const</span> <span class="kwrd">int</span> SF_USECODEPAGE = 0x020;</pre>
<pre><span class="lnum">   2:  </span>        <span class="kwrd">private</span> <span class="kwrd">const</span> <span class="kwrd">int</span> SF_TEXT = 0x001;</pre>
<pre class="alt"><span class="lnum">   3:  </span>        <span class="kwrd">private</span> <span class="kwrd">const</span> <span class="kwrd">int</span> SF_RTF = 0x002;</pre>
<pre><span class="lnum">   4:  </span>        <span class="kwrd">private</span> <span class="kwrd">const</span> <span class="kwrd">int</span> CP_UTF8 = 65001;</pre>
<pre class="alt"><span class="lnum">   5:  </span> </pre>
<pre><span class="lnum">   6:  </span>        <span class="kwrd">private</span> <span class="kwrd">const</span> <span class="kwrd">int</span> WM_SETREDRAW      = 0x000B;</pre>
<pre class="alt"><span class="lnum">   7:  </span> </pre>
<pre><span class="lnum">   8:  </span>        <span class="kwrd">private</span> <span class="kwrd">const</span> <span class="kwrd">int</span> WM_USER = 0x400;</pre>
<pre class="alt"><span class="lnum">   9:  </span>        <span class="kwrd">private</span> <span class="kwrd">const</span> <span class="kwrd">int</span> EM_STREAMIN = WM_USER + 73;</pre>
<pre><span class="lnum">  10:  </span>        <span class="kwrd">private</span> <span class="kwrd">const</span> <span class="kwrd">int</span> EM_GETEVENTMASK   = (WM_USER + 59);</pre>
<pre class="alt"><span class="lnum">  11:  </span>        <span class="kwrd">private</span> <span class="kwrd">const</span> <span class="kwrd">int</span> EM_SETEVENTMASK   = (WM_USER + 69);</pre>
<pre><span class="lnum">  12:  </span>        <span class="kwrd">private</span> <span class="kwrd">const</span> <span class="kwrd">int</span> EM_STREAMOUT = WM_USER + 74;</pre>
<pre class="alt"><span class="lnum">  13:  </span>        <span class="kwrd">private</span> <span class="kwrd">const</span> <span class="kwrd">int</span> ENM_NONE =    0;</pre>
<pre><span class="lnum">  14:  </span>        <span class="kwrd">private</span> <span class="kwrd">const</span> <span class="kwrd">int</span> EM_SETTEXTMODE        = WM_USER + 89;</pre>
<pre class="alt"><span class="lnum">  15:  </span> </pre>
<pre><span class="lnum">  16:  </span>        <span class="kwrd">private</span> <span class="kwrd">const</span> <span class="kwrd">int</span> TM_PLAINTEXT       = 1;</pre>
<pre class="alt"><span class="lnum">  17:  </span> </pre>
<pre><span class="lnum">  18:  </span>        <span class="kwrd">private</span> <span class="kwrd">const</span> <span class="kwrd">int</span> ECO_AUTOWORDSELECTION = 0x00000001;</pre>
<pre class="alt"><span class="lnum">  19:  </span>        <span class="kwrd">private</span> <span class="kwrd">const</span> <span class="kwrd">int</span> ECO_AUTOVSCROLL = 0x00000040;</pre>
<pre><span class="lnum">  20:  </span>        <span class="kwrd">private</span> <span class="kwrd">const</span> <span class="kwrd">int</span> ECO_AUTOHSCROLL = 0x00000080;</pre>
<pre class="alt"><span class="lnum">  21:  </span>        <span class="kwrd">private</span> <span class="kwrd">const</span> <span class="kwrd">int</span> ECO_NOHIDESEL = 0x00000100;</pre>
<pre><span class="lnum">  22:  </span>        <span class="kwrd">private</span> <span class="kwrd">const</span> <span class="kwrd">int</span> ECO_READONLY = 0x00000800;</pre>
<pre class="alt"><span class="lnum">  23:  </span>        <span class="kwrd">private</span> <span class="kwrd">const</span> <span class="kwrd">int</span> ECO_WANTRETURN = 0x00001000;</pre>
<pre><span class="lnum">  24:  </span>        <span class="kwrd">private</span> <span class="kwrd">const</span> <span class="kwrd">int</span> ECO_SAVESEL = 0x00008000;</pre>
<pre class="alt"><span class="lnum">  25:  </span>        <span class="kwrd">private</span> <span class="kwrd">const</span> <span class="kwrd">int</span> ECO_SELECTIONBAR = 0x01000000;</pre>
<pre><span class="lnum">  26:  </span>        <span class="kwrd">private</span> <span class="kwrd">const</span> <span class="kwrd">int</span> ECO_VERTICAL = 0x00400000;</pre>
<pre class="alt"><span class="lnum">  27:  </span>        <span class="kwrd">private</span> <span class="kwrd">const</span> <span class="kwrd">int</span> ECOOP_SET = 0x0001;</pre>
<pre><span class="lnum">  28:  </span>        <span class="kwrd">private</span> <span class="kwrd">const</span> <span class="kwrd">int</span> ECOOP_OR = 0x0002;</pre>
<pre class="alt"><span class="lnum">  29:  </span>        <span class="kwrd">private</span> <span class="kwrd">const</span> <span class="kwrd">int</span> ECOOP_AND = 0x0003;</pre>
<pre><span class="lnum">  30:  </span>        <span class="kwrd">private</span> <span class="kwrd">const</span> <span class="kwrd">int</span> ECOOP_XOR = 0x0004;</pre>
<pre class="alt"><span class="lnum">  31:  </span></pre>
<pre><span class="lnum">  32:  </span>        <span class="kwrd">private</span> <span class="kwrd">const</span> <span class="kwrd">int</span> EM_SETOPTIONS = (WM_USER + 77);</pre>
<pre class="alt"><span class="lnum">  33:  </span>        <span class="kwrd">private</span> <span class="kwrd">const</span> <span class="kwrd">int</span> EM_GETOPTIONS = (WM_USER + 78);</pre>
<pre><span class="lnum">  34:  </span> </pre>
<pre class="alt"><span class="lnum">  35:  </span> </pre>
<pre><span class="lnum">  36:  </span>        <span class="kwrd">delegate</span> IntPtr EditStreamCallback(IntPtr dwCookie, IntPtr pbBuff, IntPtr</pre>
<pre class="alt"><span class="lnum">  37:  </span>            cb, <span class="kwrd">out</span> IntPtr pcb);</pre>
<pre><span class="lnum">  38:  </span> </pre>
<pre class="alt"><span class="lnum">  39:  </span></pre>
<pre><span class="lnum">  40:  </span>        <span class="kwrd">struct</span> EDITSTREAM</pre>
<pre class="alt"><span class="lnum">  41:  </span>        {</pre>
<pre><span class="lnum">  42:  </span>            <span class="kwrd">public</span> IntPtr dwCookie;</pre>
<pre class="alt"><span class="lnum">  43:  </span>            <span class="kwrd">public</span> IntPtr dwError;</pre>
<pre><span class="lnum">  44:  </span>            <span class="kwrd">public</span> EditStreamCallback pfnCallback;</pre>
<pre class="alt"><span class="lnum">  45:  </span>        }</pre>
<pre><span class="lnum">  46:  </span> </pre>
<pre class="alt"><span class="lnum">  47:  </span></pre>
<pre><span class="lnum">  48:  </span> </pre>
<pre class="alt"><span class="lnum">  49:  </span>        [DllImport(<span class="str">"user32.dll"</span>, CharSet = CharSet.Auto, SetLastError = <span class="kwrd">false</span>)]</pre>
<pre><span class="lnum">  50:  </span>        <span class="kwrd">static</span> <span class="kwrd">extern</span> IntPtr SendMessage(HandleRef hWnd, Int32 Msg,</pre>
<pre class="alt"><span class="lnum">  51:  </span>                                        IntPtr wParam, IntPtr lParam);</pre>
<pre><span class="lnum">  52:  </span></pre>
<pre class="alt"><span class="lnum">  53:  </span>        [DllImport(<span class="str">"user32.dll"</span>, CharSet = CharSet.Auto, SetLastError = <span class="kwrd">false</span>)]</pre>
<pre><span class="lnum">  54:  </span>        <span class="kwrd">static</span> <span class="kwrd">extern</span> IntPtr SendMessage(HandleRef hwnd, Int32 msg, IntPtr</pre>
<pre class="alt"><span class="lnum">  55:  </span>            wParam,    <span class="kwrd">ref</span> EDITSTREAM lParam);</pre>
<p>In the declarations, you will see that two forms of SendMessage have been defined.  One where the lParam references the EDITSTREAM structure and on where it references an IntPtr structure.  The former is used when streaming data into the RichText window, the latter is used when sending regular messages between controls.  It should be noted, the later could be removed in .NET 2.0 by making use of the System.Windows.Forms.Message class, which essentially allows you to send messages to controls so long as all arguments can be sent as IntPtrs.</p>
<p>After the declarations, the remainder of the code is setting up the actual streaming, and creating the function that the delegate prototypes.  In this example, I&#8217;ve called the streaming function, ReadRichTextStream and the actual streaming function, StreamIn.  These functions would look like the following:</p>
<p><em>ReadRichTextStream: Accepts a RichTextBox Object and the filename of the file to load.</em></p>
<style type="text/css">  .csharpcode, .csharpcode pre  {  	font-size: small;  	color: black;  	font-family: consolas, "Courier New", courier, monospace;  	background-color: #ffffff;  	/*white-space: pre;*/  }  .csharpcode pre { margin: 0em; }  .csharpcode .rem { color: #008000; }  .csharpcode .kwrd { color: #0000ff; }  .csharpcode .str { color: #006080; }  .csharpcode .op { color: #0000c0; }  .csharpcode .preproc { color: #cc6633; }  .csharpcode .asp { background-color: #ffff00; }  .csharpcode .html { color: #800000; }  .csharpcode .attr { color: #ff0000; }  .csharpcode .alt   {  	background-color: #f4f4f4;  	width: 100%;  	margin: 0em;  }  .csharpcode .lnum { color: #606060; }</style>
<p class="csharpcode">
<pre class="alt"><span class="lnum">   1:  </span>        <span class="kwrd">private</span> <span class="kwrd">void</span> ReadRichTextStream(System.Windows.Forms.RichTextBox objRich,</pre>
<pre><span class="lnum">   2:  </span>            <span class="kwrd">string</span> sfilename)</pre>
<pre class="alt"><span class="lnum">   3:  </span>        {</pre>
<pre><span class="lnum">   4:  </span></pre>
<pre class="alt"><span class="lnum">   5:  </span>            <span class="kwrd">string</span> filename = sfilename.ToLower();</pre>
<pre><span class="lnum">   6:  </span>            objRich.Text = <span class="str">""</span>;</pre>
<pre class="alt"><span class="lnum">   7:  </span>            <span class="kwrd">int</span> eType = SF_TEXT;</pre>
<pre><span class="lnum">   8:  </span>            <span class="kwrd">if</span> (filename.EndsWith(<span class="str">".mrk"</span>)|filename.EndsWith(<span class="str">".mrk8"</span>)|filename.EndsWith(<span class="str">".tmp"</span>)|filename.EndsWith(<span class="str">".xml"</span>))</pre>
<pre class="alt"><span class="lnum">   9:  </span>            {</pre>
<pre><span class="lnum">  10:  </span>                eType = (((CP_UTF8)&lt;&lt;16)|SF_USECODEPAGE|SF_TEXT);</pre>
<pre class="alt"><span class="lnum">  11:  </span>            }</pre>
<pre><span class="lnum">  12:  </span>            <span class="kwrd">else</span> <span class="kwrd">if</span> (filename.EndsWith(<span class="str">".bmrk"</span>))</pre>
<pre class="alt"><span class="lnum">  13:  </span>            {</pre>
<pre><span class="lnum">  14:  </span>                eType = SF_TEXT;</pre>
<pre class="alt"><span class="lnum">  15:  </span>            }</pre>
<pre><span class="lnum">  16:  </span>            <span class="kwrd">else</span> <span class="kwrd">if</span> (filename.EndsWith(<span class="str">".rtf"</span>))</pre>
<pre class="alt"><span class="lnum">  17:  </span>            {</pre>
<pre><span class="lnum">  18:  </span>                eType = SF_RTF;</pre>
<pre class="alt"><span class="lnum">  19:  </span>            }</pre>
<pre><span class="lnum">  20:  </span>            <span class="kwrd">else</span> <span class="kwrd">if</span> (filename.EndsWith(<span class="str">".txt"</span>))</pre>
<pre class="alt"><span class="lnum">  21:  </span>            {</pre>
<pre><span class="lnum">  22:  </span>                eType = SF_TEXT;</pre>
<pre class="alt"><span class="lnum">  23:  </span>            }</pre>
<pre><span class="lnum">  24:  </span>            <span class="kwrd">else</span></pre>
<pre class="alt"><span class="lnum">  25:  </span>            {</pre>
<pre><span class="lnum">  26:  </span>                eType = (((CP_UTF8)&lt;&lt;16)|SF_USECODEPAGE|SF_TEXT);</pre>
<pre class="alt"><span class="lnum">  27:  </span>            }</pre>
<pre><span class="lnum">  28:  </span> </pre>
<pre class="alt"><span class="lnum">  29:  </span>            <span class="rem">//this.Redraw = false;</span></pre>
<pre><span class="lnum">  30:  </span>            <span class="kwrd">long</span> b_length = 0;</pre>
<pre class="alt"><span class="lnum">  31:  </span>            System.IO.FileStream fs = <span class="kwrd">new</span> System.IO.FileStream(sfilename, System.IO.FileMode.Open, System.IO.FileAccess.Read, System.IO.FileShare.Read);</pre>
<pre><span class="lnum">  32:  </span>            b_length = fs.Length;</pre>
<pre class="alt"><span class="lnum">  33:  </span>            Application.DoEvents();</pre>
<pre><span class="lnum">  34:  </span>            System.Runtime.InteropServices.GCHandle gch = System.Runtime.InteropServices.GCHandle.Alloc(fs, System.Runtime.InteropServices.GCHandleType.Normal);</pre>
<pre class="alt"><span class="lnum">  35:  </span>            EDITSTREAM es = <span class="kwrd">new</span> EDITSTREAM();</pre>
<pre><span class="lnum">  36:  </span>            es.dwCookie = (IntPtr)gch;</pre>
<pre class="alt"><span class="lnum">  37:  </span>            EditStreamCallback callback = <span class="kwrd">new</span> EditStreamCallback(StreamIn);</pre>
<pre><span class="lnum">  38:  </span>            es.pfnCallback = callback</pre>
<pre class="alt"><span class="lnum">  39:  </span></pre>
<pre><span class="lnum">  40:  </span>            SendMessage(<span class="kwrd">new</span> HandleRef(objRich, objRich.Handle), (Int32)EM_STREAMIN, (IntPtr)eType, <span class="kwrd">ref</span> es);</pre>
<pre class="alt"><span class="lnum">  41:  </span></pre>
<pre><span class="lnum">  42:  </span>            <span class="rem">//Remember to free allocated memory to avoid leaks.</span></pre>
<pre class="alt"><span class="lnum">  43:  </span>            gch.Free();</pre>
<pre><span class="lnum">  44:  </span>            fs.Close();</pre>
<pre class="alt"><span class="lnum">  45:  </span></pre>
<pre><span class="lnum">  46:  </span></pre>
<pre class="alt"><span class="lnum">  47:  </span>        }</pre>
<style type="text/css">  .csharpcode, .csharpcode pre  {  	font-size: small;  	color: black;  	font-family: consolas, "Courier New", courier, monospace;  	background-color: #ffffff;  	/*white-space: pre;*/  }  .csharpcode pre { margin: 0em; }  .csharpcode .rem { color: #008000; }  .csharpcode .kwrd { color: #0000ff; }  .csharpcode .str { color: #006080; }  .csharpcode .op { color: #0000c0; }  .csharpcode .preproc { color: #cc6633; }  .csharpcode .asp { background-color: #ffff00; }  .csharpcode .html { color: #800000; }  .csharpcode .attr { color: #ff0000; }  .csharpcode .alt   {  	background-color: #f4f4f4;  	width: 100%;  	margin: 0em;  }  .csharpcode .lnum { color: #606060; }</style>
<p><em>StreamIn: StreamIn is the function that actually reads the data from the file and pushs the data into the RichTextBox callback to print into the control.</em></p>
<p class="csharpcode">
<pre class="alt"><span class="lnum">   1:  </span>        <span class="kwrd">public</span> IntPtr StreamIn(IntPtr dwCookie, IntPtr pbBuff, IntPtr</pre>
<pre><span class="lnum">   2:  </span>            cb, <span class="kwrd">out</span> IntPtr pcb)</pre>
<pre class="alt"><span class="lnum">   3:  </span>        {</pre>
<pre><span class="lnum">   4:  </span>            <span class="kwrd">byte</span>[] buffer = <span class="kwrd">new</span> <span class="kwrd">byte</span>[cb.ToInt32()];</pre>
<pre class="alt"><span class="lnum">   5:  </span>            <span class="kwrd">uint</span> result = 0;</pre>
<pre><span class="lnum">   6:  </span> </pre>
<pre class="alt"><span class="lnum">   7:  </span></pre>
<pre><span class="lnum">   8:  </span></pre>
<pre class="alt"><span class="lnum">   9:  </span></pre>
<pre><span class="lnum">  10:  </span>            System.IO.FileStream fs = (System.IO.FileStream)((GCHandle)dwCookie).Target;</pre>
<pre class="alt"><span class="lnum">  11:  </span>            <span class="rem">//pcb = cb;</span></pre>
<pre><span class="lnum">  12:  </span>            <span class="kwrd">try</span></pre>
<pre class="alt"><span class="lnum">  13:  </span>            {</pre>
<pre><span class="lnum">  14:  </span>                pcb = (IntPtr)fs.Read(buffer, 0, cb.ToInt32());</pre>
<pre class="alt"><span class="lnum">  15:  </span></pre>
<pre><span class="lnum">  16:  </span>                <span class="kwrd">if</span> (pcb.ToInt32()&lt;=0)</pre>
<pre class="alt"><span class="lnum">  17:  </span>                {</pre>
<pre><span class="lnum">  18:  </span>                    pcb = IntPtr.Zero;</pre>
<pre class="alt"><span class="lnum">  19:  </span>                    result = 1;</pre>
<pre><span class="lnum">  20:  </span>                    <span class="kwrd">return</span> (IntPtr)result;</pre>
<pre class="alt"><span class="lnum">  21:  </span>                }</pre>
<pre><span class="lnum">  22:  </span>                <span class="kwrd">else</span></pre>
<pre class="alt"><span class="lnum">  23:  </span>                {</pre>
<pre><span class="lnum">  24:  </span></pre>
<pre class="alt"><span class="lnum">  25:  </span>                    System.Runtime.InteropServices.Marshal.Copy(buffer, 0, pbBuff, pcb.ToInt32());</pre>
<pre><span class="lnum">  26:  </span>                }</pre>
<pre class="alt"><span class="lnum">  27:  </span>            }</pre>
<pre><span class="lnum">  28:  </span>            <span class="kwrd">catch</span></pre>
<pre class="alt"><span class="lnum">  29:  </span>            {</pre>
<pre><span class="lnum">  30:  </span>                pcb = IntPtr.Zero;</pre>
<pre class="alt"><span class="lnum">  31:  </span>                result = 1;</pre>
<pre><span class="lnum">  32:  </span>                <span class="kwrd">return</span> (IntPtr)result;</pre>
<pre class="alt"><span class="lnum">  33:  </span>            }</pre>
<pre><span class="lnum">  34:  </span>            fs.Close();</pre>
<pre class="alt"><span class="lnum">  35:  </span>            <span class="kwrd">return</span> (IntPtr)result;</pre>
<pre><span class="lnum">  36:  </span>        }</pre>
<style type="text/css">  .csharpcode, .csharpcode pre  {  	font-size: small;  	color: black;  	font-family: consolas, "Courier New", courier, monospace;  	background-color: #ffffff;  	/*white-space: pre;*/  }  .csharpcode pre { margin: 0em; }  .csharpcode .rem { color: #008000; }  .csharpcode .kwrd { color: #0000ff; }  .csharpcode .str { color: #006080; }  .csharpcode .op { color: #0000c0; }  .csharpcode .preproc { color: #cc6633; }  .csharpcode .asp { background-color: #ffff00; }  .csharpcode .html { color: #800000; }  .csharpcode .attr { color: #ff0000; }  .csharpcode .alt   {  	background-color: #f4f4f4;  	width: 100%;  	margin: 0em;  }  .csharpcode .lnum { color: #606060; }</style>
<p>Anyway, the gist of all this, is that by setting the compile option to target 32-bit processors in the MarcEdit gui, I&#8217;ve been able to solve this issue.  I&#8217;m having the user that found the problem verify that I&#8217;ve indeed hunted this bug down and squashed it &#8212; so as soon as that&#8217;s confirmed, I&#8217;ll be pushing this fix out with MarcEdit.</p>
<p>&#8211;TR</p>
]]></content:encoded>
			<wfw:commentRss>http://people.oregonstate.edu/~reeset/blog/archives/444/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Random Google Thoughts</title>
		<link>http://people.oregonstate.edu/~reeset/blog/archives/378</link>
		<comments>http://people.oregonstate.edu/~reeset/blog/archives/378#comments</comments>
		<pubDate>Wed, 25 Oct 2006 16:55:38 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://oregonstate.edu/~reeset/blog/archives/378</guid>
		<description><![CDATA[I was following a thread today talking about some of the legal wrangling&#8217;s related to Google and their Google&#160;Books project.&#160; The message that made me laugh was a series where someone had commented that Google had long since forgotten their &#8216;do no evil&#8217; philosophy and have become pure evil.&#160; Of which, someone said it was [...]]]></description>
			<content:encoded><![CDATA[<p>I was following a thread today talking about some of the legal wrangling&#8217;s related to Google and their Google&nbsp;Books project.&nbsp; The message that made me laugh was a series where someone had commented that Google had long since forgotten their &#8216;do no evil&#8217; philosophy and have become pure evil.&nbsp; Of which, someone said it was a tie between Microsoft and Google, and then asked the question: <em>What would happen if they merged? The end of civilization as we know it?, </em>which put a smile on my face.</p>
<p>However, it did get me thinking &#8212; why do folks view Google in such a positive light?&nbsp; Or, better yet, how did Google convince libraries (large academic libraries) to essentially give away their content for virtually nothing.&nbsp; Well, I should qualify that &#8212; Google is spending a great deal of money digitizing library content &#8212; but the costs of digitization pale in terms of the total value of the collection itself and the value of the collection in terms of the collection development decisions that went into building a library&#8217;s materials.&nbsp; In putting up some capital, Google is able to catch up as a cultural archive on nearly 200+ years of purchasing and collection management decisions and will have surpassed some of our finest academic libraries in terms of content and breath of collection.&nbsp; Not a bad deal for them.&nbsp;</p>
<p>But I&#8217;ll digress since that&#8217;s a different discussion.&nbsp; I&#8217;m really fascinated by Google&#8217;s image and how they have been able to maintain their image as a socially conscious company that&#8217;s open for integration by others and open as in friendly to open source.&nbsp; However, if you really think about it &#8212; that image doesn&#8217;t fit reality.&nbsp; Google has in effect cultivated this image of &#8220;open&#8221; by making available bread crumbs into their systems.&nbsp; Folks have often been able to do very cool things with these bread crumbs (Google Maps, Search API, etc) but these really are only a small part of the Google machine.&nbsp; While Google offers api it also is, without a doubt, one of the most propriety companies that I&#8217;ve ever seen.&nbsp; Their answers in fiscal filings are difficult to pin down (that&#8217;s just about any large corporation though) and they vigorously (actually, that&#8217;s an understatement) guard their search algorithems.&nbsp; Folks&nbsp;should make no mistake &#8212; they are a big business and they act like any other business, but&nbsp;they&#8217;ve just somehow been able to wrap themselves in a cloak of openness.&nbsp; In fact, I&#8217;ve started to wonder if Google&nbsp;isn&#8217;t the ultimate leech.&nbsp; Now, leeches aren&#8217;t bad things.&nbsp; They&#8217;ve used them in medicine for years &#8212; but leeches don&#8217;t produce anything &#8212; and lately, I&#8217;ve been starting to wonder what exactly Google has produced.&nbsp; There is their search engine &#8212; which while still wildly popular, is no longer my first choice for all types of searches and then their add placement.&nbsp; And while innovative in their time &#8212; even these services don&#8217;t really produce anything.&nbsp; Outside of that &#8212; I can think of a lot of places where Google is taking other people&#8217;s content and repackaging it (or using it to sell versions of it) or are swallowing&nbsp;technologies and assimilating them into the collective.&nbsp; Maybe that should be Google&#8217;s new motto, &#8220;Resistance is futile&#8221;, well, maybe not.&nbsp;&nbsp;;)</p>
<p>&#8211;TR</p>
]]></content:encoded>
			<wfw:commentRss>http://people.oregonstate.edu/~reeset/blog/archives/378/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sorry for the multiple posts</title>
		<link>http://people.oregonstate.edu/~reeset/blog/archives/343</link>
		<comments>http://people.oregonstate.edu/~reeset/blog/archives/343#comments</comments>
		<pubDate>Wed, 30 Aug 2006 18:25:24 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://oregonstate.edu/~reeset/blog/archives/343</guid>
		<description><![CDATA[I&#8217;m playing with MS&#8217;s Live Writer (which I actually like) and kept getting an error message.&#160; I&#8217;d assumed that meant that it didn&#8217;t post.&#160; Apparently not.  
&#160;
&#8211;TR
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m playing with MS&#8217;s Live Writer (which I actually like) and kept getting an error message.&nbsp; I&#8217;d assumed that meant that it didn&#8217;t post.&nbsp; Apparently not. <img src='http://people.oregonstate.edu/~reeset/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>&nbsp;</p>
<p>&#8211;TR</p>
]]></content:encoded>
			<wfw:commentRss>http://people.oregonstate.edu/~reeset/blog/archives/343/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using XMLTextReader to improve XSLT processing</title>
		<link>http://people.oregonstate.edu/~reeset/blog/archives/312</link>
		<comments>http://people.oregonstate.edu/~reeset/blog/archives/312#comments</comments>
		<pubDate>Sat, 29 Jul 2006 05:46:02 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://oregonstate.edu/~reeset/blog/archives/312</guid>
		<description><![CDATA[One of the things that I spend a little too much time working on was how to setup a more streamlined version of resolving entities and ignoring entities.  The key has to do with avoiding a call to the XMLValidateNavigator object, and using the XMLTextReader gives you more granularity over the process.  Here&#8217;s an example:
/*=====================================================
* [...]]]></description>
			<content:encoded><![CDATA[<p>One of the things that I spend a little too much time working on was how to setup a more streamlined version of resolving entities and ignoring entities.  The key has to do with avoiding a call to the XMLValidateNavigator object, and using the XMLTextReader gives you more granularity over the process.  Here&#8217;s an example:</p>
<p><font size="2" /><font color="#008000" size="2">/*=====================================================<br />
* Function/sub: TransformXSLT<br />
* Description: Does the XSLT translation<br />
* ====================================================*/</font><font size="2" /><font size="2" /><font color="#0000ff" size="2">public</font><font size="2"> </font><font color="#0000ff" size="2">int</font><font size="2"> TransformXSLT(</font><font color="#0000ff" size="2">string</font><font size="2"> sSource,<br />
</font><font color="#0000ff" size="2">string</font><font size="2"> sDest,<br />
</font><font color="#0000ff" size="2">string</font><font size="2"> sXSLT,<br />
</font><font color="#0000ff" size="2">bool</font><font size="2"> bRemote)<br />
{</font><font size="2">System.Xml.XmlTextReader reader = </font><font color="#0000ff" size="2">new</font><font size="2"> System.Xml.XmlTextReader(sSource);<br />
</font><font color="#0000ff" size="2">if</font><font size="2"> (bRemote==</font><font color="#0000ff" size="2">false</font><font size="2">) {<br />
reader.XmlResolver = </font><font color="#0000ff" size="2">null</font><font size="2">;<br />
}</font><font size="2"> </font><font size="2" /><font size="2">System.Text.UTF8Encoding Encoding = </font><font color="#0000ff" size="2">new</font><font size="2"> System.Text.UTF8Encoding(</font><font color="#0000ff" size="2">false</font><font size="2">);<br />
System.IO.StreamWriter writer = </font><font color="#0000ff" size="2">new</font><font size="2"> System.IO.StreamWriter(sDest, </font><font color="#0000ff" size="2">false</font><font size="2">, Encoding);<br />
</font></p>
<p><font size="2" /><font color="#0000ff" size="2">try</font><font size="2"><br />
{</font><font size="2"> </font><font size="2" /><font size="2"> System.Xml.XPath.XPathDocument doc = </font><font color="#0000ff" size="2">new</font><font size="2"> System.Xml.XPath.XPathDocument(reader);<br />
    System.Xml.Xsl.XslTransform xslt = new System.Xml.Xsl.XslTransform();<br />
    xslt.Load(sXSLT);<br />
    xslt.Transform(doc, null, writer, null);<br />
    writer.Close();<br />
    reader.Close();</font></p>
<p><font size="2" /><font size="2" /><font size="2"> } catch (System.Exception eee) {<br />
    this.sXSLTError = eee.ToString();<br />
    writer.Close();<br />
    reader.Close();<br />
    return mengine60.ERR_XSLT_ERROR;<br />
}<br />
return 0;<br />
}</font></p>
<p> </p>
<p>&#8211;TR<font size="2" /><font size="2" /><font size="2">    <br />
</font></p>
]]></content:encoded>
			<wfw:commentRss>http://people.oregonstate.edu/~reeset/blog/archives/312/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OSCON 2006: Day 2</title>
		<link>http://people.oregonstate.edu/~reeset/blog/archives/310</link>
		<comments>http://people.oregonstate.edu/~reeset/blog/archives/310#comments</comments>
		<pubDate>Fri, 28 Jul 2006 07:28:16 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Digital Libraries]]></category>
		<category><![CDATA[General Computing]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[OSCON 2006]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://oregonstate.edu/~reeset/blog/archives/310</guid>
		<description><![CDATA[Keynotes:
The Zen of Free
Simon Phipps, Sun
&#8220;Opening&#8221; the Possibilities: APIs and Open Source
Gary Lang, AutoDesk, Inc.
Ugh &#8212; As good as the first day&#8217;s keynotes were &#8212; these were not.  I was nearly ready to bag the keynotes when&#8230;
5 a day
Robert &#8220;rOml&#8221; Lefkowitz, Root Markets
This was a fantastic keynote.  He started with a tomato and eventually wound [...]]]></description>
			<content:encoded><![CDATA[<p><strong><u>Keynotes:</u></strong></p>
<p><strong>The Zen of Free</strong><br />
Simon Phipps, Sun</p>
<p><strong>&#8220;Opening&#8221; the Possibilities: APIs and Open Source</strong><br />
Gary Lang, AutoDesk, Inc.</p>
<p>Ugh &#8212; As good as the first day&#8217;s keynotes were &#8212; these were not.  I was nearly ready to bag the keynotes when&#8230;</p>
<p><strong>5 a day</strong><br />
Robert &#8220;rOml&#8221; Lefkowitz, Root Markets</p>
<p>This was a fantastic keynote.  He started with a tomato and eventually wound his way around a discussion of the quantification of open source.  It was hillarious and interested&#8230;fantastic.</p>
<p><strong>Building Rails to Legacy Applications</strong><br />
Robert Treat, Open Source Developer</p>
<p>Since we are in the process of porting a set of code from PHP to Ruby, I thought I&#8217;d go to this session to see what was up.  There was a number of interesting tricks and techniques discussed that I definitely am looking forward to trying.</p>
<p><strong>AJAX + .NET = Atlas</strong><br />
Christian Wenz, Hauser &#038; Wenz</p>
<p>Since frameworks are big right now, I wanted to see what Microsoft&#8217;s frameworks offerings are.  What I found was that I actually find this pretty interesting.  The .NET Atlas framework provides a comperable framework to Rails, but specifically generated for ASP.Net.  Looking at some sample code &#8212; it looks very simple and I&#8217;m pretty sure &#8212; looking at the implementation, should run on a &#8216;nix machine using MONO.  Also, the javascript/ajax code generated is browser neutral.  This I found somewhat suprising, but very cool.  The code generated works equally well in the current major browsers.  I&#8217;ve actually downloaded the framework and am looking at it right now trying to see how I might be able to incorporate it in some of the ASP.net coding that I&#8217;ve been doing lately.</p>
<p><strong>Scripting .NET with IronPython</strong></p>
<p>I&#8217;ll admit, I went to this session primarily because I&#8217;ve been putting together some documentation on running MarcEdit with IronPython for dchud (btw dan, I&#8217;ll send you these slides/code as soon as they post them).  I really wasn&#8217;t sure what to expect with this session, partly because IronPython was first released 2 or 3 years ago at OSCON and at the time, only would run a single test case.  In 3 years, the development team has been officially picked up by Microsoft and has implemented ~80 percent of the current Python 2.4 feature set.  At the session, they showed some very cool demos, like some 3d work, an mp3 player, etc.  Very cool.  They will actually be posting the source code to all these projects later so when I see them, I&#8217;ll let folks know.  Oh, and they announced that the software has hit release canidate 1 status.</p>
<p><strong>Building Internet Applications with Mozilla Xulrunner<br />
</strong>Benjamin Smedberg, Mozilla</p>
<p>Aside from showing demos of code written using XULRunner, the speaker spent a bit of time discussing how Mozilla is looking to implement this platform for developers. </p>
<p>&#8211;TR</p>
]]></content:encoded>
			<wfw:commentRss>http://people.oregonstate.edu/~reeset/blog/archives/310/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Amazon jumps off the Google ship</title>
		<link>http://people.oregonstate.edu/~reeset/blog/archives/234</link>
		<comments>http://people.oregonstate.edu/~reeset/blog/archives/234#comments</comments>
		<pubDate>Mon, 01 May 2006 18:09:34 +0000</pubDate>
		<dc:creator>reeset</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://oregonstate.edu/~reeset/blog/archives/234</guid>
		<description><![CDATA[Its been noted in a few places around the blogsphere, but a number of notable Google-partners have been jumping ship.  The largest of these partners has been Amazon.  Amazon, who&#8217;s search engine, A9, utilized google to provide web search results, has moved to Microsoft&#8217;s new Live search service.  The switch came as a bit of [...]]]></description>
			<content:encoded><![CDATA[<p>Its been noted in a few places around the blogsphere, but a number of notable Google-partners have been jumping ship.  The largest of these partners has been Amazon.  Amazon, who&#8217;s search engine, A9, utilized google to provide web search results, has moved to Microsoft&#8217;s new Live search service.  The switch came as a bit of a surprise, since Amazon hadn&#8217;t given any indications that a move was coming. </p>
<p>Along that vain, I&#8217;m wondering if we will see Google become more isolated as it starts to move into direct competition with its former partner sites.  Amazon, for example, had to be concerned about Google&#8217;s own print service that it&#8217;s building.  I wonder who will be next and ultimately, who will be the beneficiary of these defections.  On Search Engine watch, there is a feeling that Ask.com could come out the big winner, since they are the last of the major search vendors still providing Pure searching. </p>
<p>And finally, I&#8217;d like to point out a post by Nicolas Carr at: <a href="http://www.roughtype.com/archives/2006/04/the_default_war.php">http://www.roughtype.com/archives/2006/04/the_default_war.php</a>.  Carr looks at some of the things that appear to have Google nervous as Microsoft starts focusing more on search and Google in general.</p>
<p> </p>
<p>&#8211;Terry</p>
]]></content:encoded>
			<wfw:commentRss>http://people.oregonstate.edu/~reeset/blog/archives/234/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dealing with malformed http headers</title>
		<link>http://people.oregonstate.edu/~reeset/blog/archives/167</link>
		<comments>http://people.oregonstate.edu/~reeset/blog/archives/167#comments</comments>
		<pubDate>Fri, 24 Feb 2006 05:43:39 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://oregonstate.edu/~reeset/blog/archives/167</guid>
		<description><![CDATA[If you have a link checker, you invariably want to just read page headers.  Well, in .NET, they enforce a very strict interpretation of the HTTP header standard.  Unfortunately, a great number of servers (Innovative Interface&#8217;s ILS for one), don&#8217;t follow the output rules, so .NET&#8217;s HTTPWebRequest object will throw a webexception when requesting headers [...]]]></description>
			<content:encoded><![CDATA[<p>If you have a link checker, you invariably want to just read page headers.  Well, in .NET, they enforce a very strict interpretation of the HTTP header standard.  Unfortunately, a great number of servers (Innovative Interface&#8217;s ILS for one), don&#8217;t follow the output rules, so .NET&#8217;s HTTPWebRequest object will throw a webexception when requesting headers from the server.  Correcting this is fairly easy.  Essentially, you need to build a .config file for your component/application and enter the following configuration data:</p>
<p><font color="#0000ff" size="2" /><font color="#0000ff" size="2">< <font color="#800000" size="2">configuration</font><font color="#0000ff" size="2">></font></p>
<p><font size="2"></font><font color="#0000ff" size="2">< </font></font><font color="#800000" size="2">system.net</font><font color="#0000ff" size="2">></font></p>
<p><font size="2"></font><font color="#0000ff" size="2">< </font></font><font color="#800000" size="2">settings</font><font color="#0000ff" size="2">></font></p>
<p><font size="2"></font><font color="#0000ff" size="2">< </font></font><font color="#800000" size="2">httpWebRequest</font><font color="#ff00ff" size="2"> </font><font color="#ff0000" size="2">useUnsafeHeaderParsing</font><font color="#0000ff" size="2">=&#8221;true&#8221;</font><font color="#ff00ff" size="2"> </font><font color="#0000ff" size="2">/></font></p>
<p><font size="2"></font><font color="#0000ff" size="2"></font><font color="#800000" size="2">settings</font><font color="#0000ff" size="2">></font></p>
<p><font size="2"></font><font color="#0000ff" size="2"></font><font color="#800000" size="2">system.net</font><font color="#0000ff" size="2">></font></p>
<p> </p>
<p>&#8211;Terry</p>
]]></content:encoded>
			<wfw:commentRss>http://people.oregonstate.edu/~reeset/blog/archives/167/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dealing with expired certificates and .NET&#8217;s HTTPWebRequest object</title>
		<link>http://people.oregonstate.edu/~reeset/blog/archives/166</link>
		<comments>http://people.oregonstate.edu/~reeset/blog/archives/166#comments</comments>
		<pubDate>Fri, 24 Feb 2006 05:39:04 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://oregonstate.edu/~reeset/blog/archives/166</guid>
		<description><![CDATA[Some folks that had tried using the Verify URL utility had notified me that it wasn&#8217;t reporting a response status when attempting to query materials through an ezproxy url.  The problem it appears, was that the servers in question had either expired security certificates or certificates that were not issued by a trusted site (i.e., [...]]]></description>
			<content:encoded><![CDATA[<p>Some folks that had tried using the Verify URL utility had notified me that it wasn&#8217;t reporting a response status when attempting to query materials through an ezproxy url.  The problem it appears, was that the servers in question had either expired security certificates or certificates that were not issued by a trusted site (i.e., hasn&#8217;t gone through Microsoft&#8217;s verification process).  Well, in .NET, the HTTPWebResponse object cannot accept data by default from a site with an invalid or expired security certificate.  Since this is likely going to be an ongoing problem, I ended up needing to setup a class that would reset the application&#8217;s C<font size="2">ertificatePolicy object.  To do this, you basically need to setup a class that will accept all Certificates given to it.  Obviously doing this requires a bit of trust &#8212; and in this case, since the URLs are coming from MARC records and only being used to read headers&#8211;I think we can make that leap.  Anyway, to reset the .NET CertificatePolicy object, you need to setup a class that looks something like this:</font></p>
<p><font size="2"><font size="2" /></font><font color="#0000ff" size="2">internal</font><font size="2"> </font><font color="#0000ff" size="2">class</font><font size="2"> AcceptAllCertificatePolicy : System.Net.ICertificatePolicy </font><font size="2">{</font><font size="2"><font size="2" /></font><font color="#0000ff" size="2">public</font><font size="2"> AcceptAllCertificatePolicy() </font><font size="2">{</font><font size="2">}</p>
<p></font><font color="#0000ff" size="2">public</font><font size="2"> </font><font color="#0000ff" size="2">bool</font><font size="2"> CheckValidationResult(System.Net.ServicePoint sPoint, </font><font size="2">System.Security.Cryptography.X509Certificates.X509Certificate cert, System.Net.WebRequest wRequest,</font><font color="#0000ff" size="2">int</font><font size="2"> certProb)</font><font size="2">{</font><font size="2"></font><font color="#008000" size="2">// Always accept </font></p>
<p><font size="2"></font><font color="#0000ff" size="2">return</font><font size="2"> </font><font color="#0000ff" size="2">true</font><font size="2">; </font><font size="2">}</font><font size="2"></font><font size="2">}</p>
<p></font><font size="2">To make use of this function, you need to call this class before you initialize the HTTPWebRequest object with a call like:</font></p>
<p><font size="2" /><font size="2">System.Net.ServicePointManager.CertificatePolicy = </font><font color="#0000ff" size="2">new</font><font size="2"> AcceptAllCertificatePolicy(); </font></p>
<p><font size="2">&#8211;Terry</font><font size="2" /><font size="2" /><font size="2"><font color="#008000" size="2" /> </font></p>
]]></content:encoded>
			<wfw:commentRss>http://people.oregonstate.edu/~reeset/blog/archives/166/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
