<?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>Clay Lenhart's Blog</title>
	<atom:link href="http://clay.lenharts.net/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://clay.lenharts.net/blog</link>
	<description>A blog on .Net and SQL Server</description>
	<lastBuildDate>Mon, 30 Aug 2010 09:34:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>SQL Server Compressed Backup v1.2 Released</title>
		<link>http://clay.lenharts.net/blog/2009/11/23/sql-server-compressed-backup-v12-released/</link>
		<comments>http://clay.lenharts.net/blog/2009/11/23/sql-server-compressed-backup-v12-released/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 14:44:22 +0000</pubDate>
		<dc:creator>Clay Lenhart</dc:creator>
				<category><![CDATA[MSSQL Compressed Backup]]></category>
		<category><![CDATA[SQL Server Administration]]></category>

		<guid isPermaLink="false">http://clay.lenharts.net/blog/?p=126</guid>
		<description><![CDATA[I've just released version 1.2-20091123 of SQL Server Compressed Backup.  SQL Server Compressed Backup will back up a SQL Server database to a compressed file, using either gzip, zip and bzip2.  The new features are:]]></description>
			<content:encoded><![CDATA[<div class="diggthisplugin" style="float: right; width: 42px; padding-right: 10px; margin-left: 10px; margin-bottom: 0px;"><iframe src="http://digg.com/tools/diggthis.php?u=http://clay.lenharts.net/blog/2009/11/23/sql-server-compressed-backup-v12-released/&t=SQL Server Compressed Backup v1.2 Released&k=#FFFFFF" scrolling="no" style="border: none; height: 80px; width: 52px;"></iframe>
		</div><p>I've just released version 1.2-20091123 of <a href="https://sourceforge.net/projects/mssqlcompressed/">SQL Server Compressed Backup</a> which can be <a href="https://sourceforge.net/projects/mssqlcompressed/files/MSSQLCompressedBackup/1.2-20091123/MSSQLCompressedBackup-1.2-20091123.zip/download">downloaded here</a>.  </p>
<p>SQL Server Compressed Backup will back up SQL Server databases using either gzip, zip or bzip2 compression.</p>
<p>The new features are:<br />
<span id="more-126"></span></p>
<ul>
<li>Fixed the encoding problem by removing “\s”, “\p” and “\\” since they are commonly used in file paths and replacing them with “;;” to mean “;”. Looking at the command line options, it is only necessary to encode the semicolon, so “;;” is the only encoding the command line does.</li>
<li>Added a feature I’ve personally wanted: progress updates and an estimated time until completion. It is more verbose at the beginning (every few seconds), then slows down. After an hour of backing up, updates are only once every 24 minutes.</li>
<li>Worked on the BlockSize and BufferCount request. I’m not keen on implementing BlockSize. I’d like to hear someone explain how they take advantage of it. My understanding is that BlockSize is only for writing to devices (tapes and CD-ROMs — not files on a CD-ROM though), so it doesn’t seem appropriate for backing up to files. BufferCount and MaxTransferSize seem like reasonable options to request, so these are now available.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://clay.lenharts.net/blog/2009/11/23/sql-server-compressed-backup-v12-released/feed/</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
		<item>
		<title>How SSAS Cube Processing Affects Running Queries</title>
		<link>http://clay.lenharts.net/blog/2009/05/29/how-ssas-cube-processing-affects-running-queries/</link>
		<comments>http://clay.lenharts.net/blog/2009/05/29/how-ssas-cube-processing-affects-running-queries/#comments</comments>
		<pubDate>Fri, 29 May 2009 19:26:55 +0000</pubDate>
		<dc:creator>Clay Lenhart</dc:creator>
				<category><![CDATA[SSAS]]></category>
		<category><![CDATA[cube processing]]></category>

		<guid isPermaLink="false">http://clay.lenharts.net/blog/?p=119</guid>
		<description><![CDATA[SSAS cube processing can kill running queries.  That's right, it may kill queries in order to commit changes to the cube.  

Here is what happens during SSAS cube processing.]]></description>
			<content:encoded><![CDATA[<div class="diggthisplugin" style="float: right; width: 42px; padding-right: 10px; margin-left: 10px; margin-bottom: 0px;"><iframe src="http://digg.com/tools/diggthis.php?u=http://clay.lenharts.net/blog/2009/05/29/how-ssas-cube-processing-affects-running-queries/&t=How SSAS Cube Processing Affects Running Queries&k=#FFFFFF" scrolling="no" style="border: none; height: 80px; width: 52px;"></iframe>
		</div><p>SSAS cube processing can kill running queries.  That's right, it may kill queries in order to commit changes to the cube.  </p>
<p>Here is what happens during SSAS cube processing.<span id="more-119"></span></p>
<ol>
<li>The cube finishes calculating the next version of the cube</li>
<li>Before the data can be made available, SSAS prevents new queries from running</li>
<li>Any currently running queries are allowed to finished normally for 30 seconds</li>
<li>After 30 seconds, SSAS kills any running queries</li>
<li>SSAS commits the new version and allows new queries to hit the updated data</li>
</ol>
<p>The 30 second time out is a configuration setting that you can read about <a href="http://geekswithblogs.net/darrengosbell/archive/2007/04/24/SSAS-Processing-ForceCommitTimeout-and-quotthe-operation-has-been-cancelledquot.aspx">here</a>.</p>
<p>So, that's right, SSAS may kill long running queries.</p>
]]></content:encoded>
			<wfw:commentRss>http://clay.lenharts.net/blog/2009/05/29/how-ssas-cube-processing-affects-running-queries/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Execution Plan of Frequent Queries</title>
		<link>http://clay.lenharts.net/blog/2009/05/29/execution-plan-of-frequent-queries/</link>
		<comments>http://clay.lenharts.net/blog/2009/05/29/execution-plan-of-frequent-queries/#comments</comments>
		<pubDate>Fri, 29 May 2009 19:03:42 +0000</pubDate>
		<dc:creator>Clay Lenhart</dc:creator>
				<category><![CDATA[SQL Server Administration]]></category>
		<category><![CDATA[dynamic management views]]></category>
		<category><![CDATA[execution plan]]></category>
		<category><![CDATA[SQL Server 2005]]></category>
		<category><![CDATA[SQL Server 2008]]></category>
		<category><![CDATA[SQL Server Engine]]></category>

		<guid isPermaLink="false">http://clay.lenharts.net/blog/?p=110</guid>
		<description><![CDATA[Bill Galashan, DBA of bet365 sent over the following query that lists the execution plan of the 10 most frequently executed queries.]]></description>
			<content:encoded><![CDATA[<div class="diggthisplugin" style="float: right; width: 42px; padding-right: 10px; margin-left: 10px; margin-bottom: 0px;"><iframe src="http://digg.com/tools/diggthis.php?u=http://clay.lenharts.net/blog/2009/05/29/execution-plan-of-frequent-queries/&t=Execution Plan of Frequent Queries&k=#FFFFFF" scrolling="no" style="border: none; height: 80px; width: 52px;"></iframe>
		</div><p>Bill Galashan, DBA of <a href="http://www.bet365.com/">bet365</a> sent over the following query that lists the execution plan of the 10 most frequently executed queries.</p>
<p>He writes:</p>
<blockquote><p>We got into this due to different query plans coming from a VB or a web app than what was seen when running the same query from Management Studio. Eventually tracked this down to a difference in the set options predominatley whether Arithabort was on or off. </p></blockquote>
<p>Read more to see his query.<span id="more-110"></span></p>
<p>Click here to <a href="http://clay.lenharts.net/blog/2008/04/13/cached-execution-plans-in-sql-server/">see the execution plan of currently running queries</a>. </p>
<pre class="brush: sql;">
SELECT TOP 10 creation_time, last_execution_time,  last_worker_time / 1000 as [Last Worker Time (ms)] ,min_worker_time / 1000 as [Min Worker Time (ms)],
      max_worker_time / 1000 as [Max Worker Time (ms)],
    total_worker_time/execution_count/1000 AS [Avg Worker Time (ms)],
    execution_count,
    SUBSTRING(st.text, (qs.statement_start_offset/2) + 1,
    ((CASE statement_end_offset
        WHEN -1 THEN DATALENGTH(st.text)
        ELSE qs.statement_end_offset
        END
            - qs.statement_start_offset)/2) + 1) as statement_text,plan_generation_num ,query_plan, Plan_handle
FROM sys.dm_exec_query_stats as qs
CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) as st
CROSS APPLY sys.dm_exec_query_plan(qs.plan_handle)
-- where st.text like '%proc name to be searched for%'
ORDER BY execution_count DESC;
</pre>
<pre class="brush: sql;">
--- Determine options used at run time

select  * from sys.syscacheobjects with (nolock) where sql like '%proc to be searched for%' and objtype='proc'

select dbo.fn_setopts(249)

/*
 This contains a bitmap containing the SET options relevant to each cached plan for a proc.
The following function can be used to decipher this bitmask:
*/

create function dbo.fn_setopts(@setopts int)
returns nvarchar(4000)

as
begin

declare @s nvarchar(4000)
select @s='Options: '
if @setopts &amp;amp;amp;amp;amp; 1    &gt; 0 select @s = @s + N'ANSI_PADDING, '
if @setopts &amp;amp;amp;amp;amp; 2    &gt; 0 select @s = @s + N'max degree of parallelism, '
if @setopts &amp;amp;amp;amp;amp; 4    &gt; 0 select @s = @s + N'FORCEPLAN, '
if @setopts &amp;amp;amp;amp;amp; 8    &gt; 0 select @s = @s + N'CONCAT_NULL_YIELDS_NULL, '
if @setopts &amp;amp;amp;amp;amp; 16   &gt; 0 select @s = @s + N'ANSI_WARNINGS, '
if @setopts &amp;amp;amp;amp;amp; 32   &gt; 0 select @s = @s + N'ANSI_NULLS, '
if @setopts &amp;amp;amp;amp;amp; 64   &gt; 0 select @s = @s + N'QUOTED_IDENTIFIER, '
if @setopts &amp;amp;amp;amp;amp; 128  &gt; 0 select @s = @s + N'ANSI_NULL_DFLT_ON, '
if @setopts &amp;amp;amp;amp;amp; 256  &gt; 0 select @s = @s + N'ANSI_NULL_DFLT_OFF, '
if @setopts &amp;amp;amp;amp;amp; 512  &gt; 0 select @s = @s + N'NO_BROWSETABLE, '
if @setopts &amp;amp;amp;amp;amp; 1024 &gt; 0 select @s = @s + N'TriggerOneRow, '
if @setopts &amp;amp;amp;amp;amp; 2048 &gt; 0 select @s = @s + N'ResyncQuery, '
if @setopts &amp;amp;amp;amp;amp; 4096 &gt; 0 select @s = @s + N'ARITHABORT, '
if @setopts &amp;amp;amp;amp;amp; 8192 &gt; 0 select @s = @s + N'NUMERIC_ROUNDABORT, ' 

return @s

end
</pre>
]]></content:encoded>
			<wfw:commentRss>http://clay.lenharts.net/blog/2009/05/29/execution-plan-of-frequent-queries/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GWT is Flexible &#8212; an iPhone Demo</title>
		<link>http://clay.lenharts.net/blog/2009/05/25/gwt-is-flexible-iphone-demo/</link>
		<comments>http://clay.lenharts.net/blog/2009/05/25/gwt-is-flexible-iphone-demo/#comments</comments>
		<pubDate>Mon, 25 May 2009 14:36:30 +0000</pubDate>
		<dc:creator>Clay Lenhart</dc:creator>
				<category><![CDATA[Languages]]></category>
		<category><![CDATA[GWT]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Web Application]]></category>

		<guid isPermaLink="false">http://clay.lenharts.net/blog/?p=57</guid>
		<description><![CDATA[GWT is a very flexible environment that allows you to write a web application in Java and compile it to Javascript -- even for the iPhone.  A number of people have fears with GWT, for instance GWT isn't flexible which will lead developers down a dead-end path and GWT is ugly, and can't be used to make "gucci" UIs. This post will show that these are just myths.]]></description>
			<content:encoded><![CDATA[<div class="diggthisplugin" style="float: right; width: 42px; padding-right: 10px; margin-left: 10px; margin-bottom: 0px;"><iframe src="http://digg.com/tools/diggthis.php?u=http://clay.lenharts.net/blog/2009/05/25/gwt-is-flexible-iphone-demo/&t=GWT is Flexible &#8212; an iPhone Demo&k=#FFFFFF" scrolling="no" style="border: none; height: 80px; width: 52px;"></iframe>
		</div><p>GWT is a very flexible environment that allows you to write a web application in Java and compile it to Javascript -- even for the iPhone.</p>
<p>A number of people have fears with GWT, for instance </p>
<ul>
<li>(not true) GWT isn't flexible which will lead developers down a dead-end path.</li>
<li>(not true) GWT is ugly, and can't be used to make "gucci" UIs.</li>
</ul>
<p>This post will show that these are just myths.<span id="more-57"></span></p>
<div><strong>Demos</strong></div>
<p>First, lets take a look at the demo.  Below is a re-write of Apple's "Simple Browser" demo using GWT.  You can find the original demo here: <a href="https://developer.apple.com/webapps/docs/referencelibrary/index-date.html">https://developer.apple.com/webapps/docs/referencelibrary/index-date.html</a> (search on the page for "simple browser").</p>
<p>You can try the GWT version of the demo on the iPhone: <a title="live demo of the GWT version" href="http://clay.lenharts.net/blog/wp-content/images/20090525/Sampleiphoneapp/Sampleiphoneapp.html" target="_blank">live GWT demo</a>, and the <a href="http://clay.lenharts.net/blog/wp-content/images/20090525/sampleiphoneapp.zip">source code</a> which includes the source control history.</p>
<p>or compare it to the <a title="The original Apple demo of &quot;Simple Browser&quot;" href="http://clay.lenharts.net/blog/wp-content/images/20090525/SimpleBrowser/" target="_blank">original Apple demo</a></p>
<p>For those who don't have an iPhone, here is a quick video of the demo written in GWT:</p>
<p><object width="560" height="340" data="http://www.youtube.com/v/RZwR6tynsms&amp;hl=en&amp;fs=1" type="application/x-shockwave-flash"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/RZwR6tynsms&amp;hl=en&amp;fs=1" /><param name="allowfullscreen" value="true" /></object></p>
<p><strong>GWT is Flexible</strong></p>
<p>The iPhone provides several unique challenges to GWT:</p>
<ul>
<li>iPhone has specific events like orientation change, touch, and transition end events</li>
<li>iPhone has specific animation features to slide from one "page" to the next (Page, in the demo, is conceptual.  Once the app is loaded, it never goes to another HTML page.)</li>
<li>The built-in GWT controls prefer tags like &lt;div> and &lt;table>.  We want to use other HTML tags such as &lt;ul&gt; and &lt;li&gt; in the iPhone</li>
</ul>
<p>GWT manages events, with good reason.  By managing events, <a href="http://code.google.com/p/google-web-toolkit/wiki/DomEventsAndMemoryLeaks">GWT prevents a whole class of memory leaks</a>.  So implementing events that GWT is unaware of is not ideal.  The demo handles this by either firing event on objects that will always exist in the application, or adding or remove events when the control is added or removed from the DOM using the onLoad() and onUnload() methods.</p>
<p>The GWT demo wires up the iPhone specific events by calling native JSNI method.  In native methods you write any Javascript you want, but you have the added risk of memory leaks.  This method wires up the screen orientation change event:</p>
<pre class="brush: java;">
	private native void registerOrientationChangedHandler(
			OrientationChangedDomEvent handler) /*-{
		var callback = function(){
			handler.@net.lenharts.gwt.sampleiphoneapp.client.model.Screen$OrientationChangedDomEvent::onOrientationChanged()();
		}

		$wnd.addEventListener(&quot;orientationchange&quot;, callback, false);
	}-*/;
</pre>
<p>When the screen orientation changes, the handler.@net.lenharts.gwt.sampleiphoneapp.client.model.Screen$OrientationChangedDomEvent::onOrientationChanged()() method is called, which is a special GWT notation allow you to call Java methods from Javascript.  When the code is compiled to Javascript, this will be replaced with the actual compiled Javascript function.</p>
<p>Animations on the iPhone are surprising easy.  In fact <a href="http://webkit.org/blog/138/css-animation/">animations are included in the CSS 3 specification</a> soon to be released.  If you have the Google Chrome 2 browser, you can try out the animations in the link.</p>
<p>To use these animations the pseudo code is </p>
<ol>
<li>Set the content of a element.</li>
<li>Set the element to a CSS class that disables animations</li>
<li>Set the element to another CSS class that will position the element at the beginning position of the animation (give the element two classes)</li>
<li>Schedule a <a href="http://google-web-toolkit.googlecode.com/svn/javadoc/1.5/com/google/gwt/user/client/DeferredCommand.html">DeferredCommand</a></li>
<li>In the DeferredCommand, remove the CSS classes set above and set the element to a CSS class that enables animations.</li>
<li>Then set the element to a CSS class to position the element at the destination position. (again keeping the animation class).</li>
<li>When the transition ends (using the transitionend event), disable animations by removing the CSS class that enables animations and replace it with the CSS class to disable animations.
</ol>
<p>GWT allows you to create any type of element within the &lt;body> tag.  The default set of widgets, unfortunately, do not give you every tag, so you have to write your own class.  Luckily you only need two classes to create any element: one class for elements that contain text, and one class for elements that contain other elements.</p>
<p>Here is the class that contains other elements:</p>
<pre class="brush: java;">
package net.lenharts.gwt.sampleiphoneapp.client.util;

import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.ui.*;

public class GenericContainerTag extends ComplexPanel {
	public GenericContainerTag(String tagName) {
		setElement(DOM.createElement(tagName));
	}

	/**
	 * Adds a new child widget to the panel.
	 *
	 * @param w
	 *            the widget to be added
	 */
	@Override
	public void add(Widget w) {
		add(w, getElement());
	}

	/**
	 * Inserts a widget before the specified index.
	 *
	 * @param w
	 *            the widget to be inserted
	 * @param beforeIndex
	 *            the index before which it will be inserted
	 * @throws IndexOutOfBoundsException
	 *             if &lt;code&gt;beforeIndex&lt;/code&gt; is out of range
	 */
	public void insert(Widget w, int beforeIndex) {
		insert(w, getElement(), beforeIndex, true);
	}
}
</pre>
<p>To create the element, you pass in the name of the tag.  For instance, if you want to create a &lt;ul> tag, you create it like so</p>
<pre class="brush: java;">
GenericContainerTag ul = new GenericContainerTag(&quot;ul&quot;);
</pre>
<p>The class for elements that contain text is a bit more complicated, especially since we're enabling iPhone specific events here.  If you were to take out the event code, you'd find this to be much smaller.  Plus it tries to wire touch events for the iPhone, and click events for all other browsers.  For now, don't worry about the details, let's just skip down to how to create it. </p>
<pre class="brush: java;">
package net.lenharts.gwt.sampleiphoneapp.client.util;

//based on Label.java source code that comes with GWT

import com.google.gwt.user.client.ui.*;
import com.google.gwt.dom.client.Document;
import com.google.gwt.dom.client.Element;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.event.shared.HandlerRegistration;

public class GenericTextTag&lt;E&gt; extends Widget implements HasText {

	private boolean mMovedAfterTouch = false;
	private E mAttachedInfo;

	private boolean mWantsEvents = false;
	private boolean mEventsWiredUp = false;
	HandlerRegistration mHandlerRegistration;

	public GenericTextTag(String tagName) {
		setElement(Document.get().createElement(tagName));
	}

	@Override
	protected void onLoad() {
		if (mWantsEvents) {
			wireUpEvents();
		}
	}

	private void wireUpEvents() {
		if (!mEventsWiredUp &amp;&amp; this.isAttached()) {
			if (hasTouchEvent(this.getElement())) {
				registerDomTouchEvents();
			} else {
				// used for debugging:
				mHandlerRegistration = this.addDomHandler(new ClickHandler() {
					@Override
					public void onClick(ClickEvent event) {
						event.preventDefault();
						fireTouchClick();
					}
				}, ClickEvent.getType());
			}
			mEventsWiredUp = true;
		}
	}

	private void wireDownEvents() {
		if (mEventsWiredUp) {
			if (hasTouchEvent(this.getElement())) {
				unRegisterDomTouchEvents();
			} else {
				mHandlerRegistration.removeHandler();
			}
		}
		mEventsWiredUp = false;
	}

	@Override
	protected void onUnload() {
		wireDownEvents();
	}

	public GenericTextTag(String tagName, String text) {
		this(tagName);
		setText(text);
	}

	public void setAttachedInfo(E info) {
		mAttachedInfo = info;
	}

	public final HandlerRegistration addHandler(
			final TouchClickEvent.TouchClickHandler&lt;E&gt; handler) {
		if (!mWantsEvents) {
			mWantsEvents = true;
			wireUpEvents();
		}
		return this
				.addHandler(
						handler,
						(GwtEvent.Type&lt;TouchClickEvent.TouchClickHandler&lt;E&gt;&gt;) TouchClickEvent
								.getType());
	}

	public E getAttachedInfo() {
		return mAttachedInfo;
	}

	private native void registerDomTouchEvents() /*-{
		var instance = this;
		var element = this.@net.lenharts.gwt.sampleiphoneapp.client.util.GenericTextTag::getElement()();

		element.ontouchstart = function(e){
				instance.@net.lenharts.gwt.sampleiphoneapp.client.util.GenericTextTag::onDomTouchStart()();
		};

		element.ontouchmove = function(e){
				instance.@net.lenharts.gwt.sampleiphoneapp.client.util.GenericTextTag::onDomTouchMove()();
		};

		element.ontouchend = function(e){
				instance.@net.lenharts.gwt.sampleiphoneapp.client.util.GenericTextTag::onDomTouchEnd()();
		};
	}-*/;

	private native void unRegisterDomTouchEvents() /*-{
		var instance = this;
		var element = this.@net.lenharts.gwt.sampleiphoneapp.client.util.GenericTextTag::getElement()();

		element.ontouchstart = null;

		element.ontouchmove = null;

		element.ontouchend = null;
	}-*/;

	public void onDomTouchStart() {
		mMovedAfterTouch = false;
	}

	public void onDomTouchMove() {
		mMovedAfterTouch = true;
	}

	public void onDomTouchEnd() {
		if (mMovedAfterTouch) {
			return;
		}

		fireTouchClick();
	}

	private void fireTouchClick() {
		fireEvent(new TouchClickEvent&lt;E&gt;(this));
	}

	public String getText() {
		return getElement().getInnerText();
	}

	public void setText(String text) {
		getElement().setInnerText(text);
	}

	private static native boolean hasTouchEvent(Element e) /*-{
		var ua = navigator.userAgent.toLowerCase();

		if (ua.indexOf(&quot;safari&quot;) != -1 &amp;&amp;
			ua.indexOf(&quot;applewebkit&quot;) != -1 &amp;&amp;
			ua.indexOf(&quot;mobile&quot;) != -1)
		{
			return true;
		}
		else
		{
			return false;
		}
	}-*/;

}
</pre>
<p>The code below creates an &lt;li> tag that contains the text "Hello World!".  The "Hello World!" test is not fixed.  The class has getter and setter methods for changing the text too.</p>
<pre class="brush: java;">
GenericTextTag&lt;String&gt; li = new GenericTextTag&lt;String&gt;(&quot;li&quot;, &quot;Hello World!&quot;);
</pre>
<p><strong>GWT Does Not Have to be Ugly</strong></p>
<p>As you can see in the examples above, you can create any HTML tag, and you can use any CSS style you like.  The sky is the limit on how you style your GWT application.  Many people see the GWT examples and they have an "application" feel to it.  Granted the built-in widgets encourage this, but as you can see, you are not restricted to their widgets and you can have a more "document" feel to your webpage.  You have complete control of the body tag.</p>
<p><strong>Why GWT?</strong></p>
<p>For me, the difference between GWT and Javascript is whether you want to work with a static language like Java, or a dynamic language like Javascript.  I assert, with little proof, that static languages are better.  They provide a much deeper verification of your code which I feel is necessary of any sizable application.  I remember the VBScript days, and I don't want to return to shipping bugs that are trival to find by a static language compiler.</p>
<p>There are issues with the size of the javascript download that both sides claim to be better.</p>
<ul>
<li>Pure Javascript is smaller because you include a library from Google that the user has already downloaded plus your small javascript code that you write</li>
<li>GWT is smaller, because the GWT compiler is highly optimized to remove dead code and to restructure your code to be as small as possible.  For instance, if you only use 10% of a library, then the downloaded code includes only 10% of the library.</li>
</ul>
<p>Small apps can work OK with a dynamic language, with the potential that it will have less code to download.  However for larger applications, the GWT compiler will produce smaller code as compared to hand written, minified Javascript and the static language will help reduce the number of bugs.</p>
]]></content:encoded>
			<wfw:commentRss>http://clay.lenharts.net/blog/2009/05/25/gwt-is-flexible-iphone-demo/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>OpenID is great</title>
		<link>http://clay.lenharts.net/blog/2009/03/07/openid-is-great/</link>
		<comments>http://clay.lenharts.net/blog/2009/03/07/openid-is-great/#comments</comments>
		<pubDate>Sat, 07 Mar 2009 14:49:05 +0000</pubDate>
		<dc:creator>Clay Lenhart</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[OpenID]]></category>

		<guid isPermaLink="false">http://clay.lenharts.net/blog/?p=55</guid>
		<description><![CDATA[<div class="diggthisplugin" style="float: right; width: 42px; padding-right: 10px; margin-left: 10px; margin-bottom: 0px;"><iframe src="http://digg.com/tools/diggthis.php?u=http://clay.lenharts.net/blog/2009/03/07/openid-is-great/&t=OpenID is great&k=#FFFFFF" scrolling="no" style="border: none; height: 80px; width: 52px;"></iframe>
		</div><p>It's so easy to set up, I can't believe I haven't done it before.<br />
<span id="more-55"></span><br />
All you need is an openid account (like <a href="http://www.myopenid.com">www.myopenid.com</a>, which <a href="http://www.intertwingly.net/blog/2007/01/03/OpenID-for-non-SuperUsers">they</a> seem to like), and a static HTML page.</p>
<p>You don't really need the static HTML page, but it allows you to switch openid accounts easily.</p>
<p>To login to an openid enabled site, like <a href="http://sourceforge.net/account/login.php">sourceforge.net</a>, you enter your static HTML page into the openid field, for instance I use <a href="http://clay.lenharts.net/openid/">http://clay.lenharts.net/openid/</a>. The static HTML page contains some links that point to your real openid account.  After logging in you are done.</p>
]]></description>
			<content:encoded><![CDATA[<div class="diggthisplugin" style="float: right; width: 42px; padding-right: 10px; margin-left: 10px; margin-bottom: 0px;"><iframe src="http://digg.com/tools/diggthis.php?u=http://clay.lenharts.net/blog/2009/03/07/openid-is-great/&t=OpenID is great&k=#FFFFFF" scrolling="no" style="border: none; height: 80px; width: 52px;"></iframe>
		</div><p>It's so easy to set up, I can't believe I haven't done it before.<br />
<span id="more-55"></span><br />
All you need is an openid account (like <a href="http://www.myopenid.com">www.myopenid.com</a>, which <a href="http://www.intertwingly.net/blog/2007/01/03/OpenID-for-non-SuperUsers">they</a> seem to like), and a static HTML page.</p>
<p>You don't really need the static HTML page, but it allows you to switch openid accounts easily.</p>
<p>To login to an openid enabled site, like <a href="http://sourceforge.net/account/login.php">sourceforge.net</a>, you enter your static HTML page into the openid field, for instance I use <a href="http://clay.lenharts.net/openid/">http://clay.lenharts.net/openid/</a>. The static HTML page contains some links that point to your real openid account.  After logging in you are done.</p>
]]></content:encoded>
			<wfw:commentRss>http://clay.lenharts.net/blog/2009/03/07/openid-is-great/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The &#8220;Many Core&#8221; Problem</title>
		<link>http://clay.lenharts.net/blog/2008/10/25/the-many-core-problem/</link>
		<comments>http://clay.lenharts.net/blog/2008/10/25/the-many-core-problem/#comments</comments>
		<pubDate>Sat, 25 Oct 2008 23:03:31 +0000</pubDate>
		<dc:creator>Clay Lenhart</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Languages]]></category>
		<category><![CDATA[F#]]></category>
		<category><![CDATA[Multithread]]></category>

		<guid isPermaLink="false">http://clay.lenharts.net/blog/?p=43</guid>
		<description><![CDATA[We, as developers, have a problem.  CPUs will continue to have more cores, and each core is not going to be any faster.  The only way to write faster applications is to write multithreaded code, which has two challenges: 1) Multithreaded code is complex to write and think about. 2)Multithreaded code is difficult to test.  From what I've seen, people are pursuing 4 approaches. 
]]></description>
			<content:encoded><![CDATA[<div class="diggthisplugin" style="float: right; width: 42px; padding-right: 10px; margin-left: 10px; margin-bottom: 0px;"><iframe src="http://digg.com/tools/diggthis.php?u=http://clay.lenharts.net/blog/2008/10/25/the-many-core-problem/&t=The &#8220;Many Core&#8221; Problem&k=#FFFFFF" scrolling="no" style="border: none; height: 80px; width: 52px;"></iframe>
		</div><p>We, as developers, have a problem.  CPUs will continue to have more cores, and each core is not going to be any faster.  The only way to write faster applications is to write multithreaded code, which has two challenges:</p>
<ul>
<li>Multithreaded code is complex to write and think about.</li>
<li>Multithreaded code is difficult to test.</li>
</ul>
<p>From what I've seen, people are pursuing 4 approaches. <span id="more-43"></span></p>
<p><strong>Better Languages</strong></p>
<p>If languages are the whole answer, the language has to make it impossible to write multithreaded bugs, otherwise you only address the first problem (the complexity).</p>
<p>Erlang is one such language that removes whole class of multithreaded bugs. Erlang's approach is to isolate the threads, and give them a way to pass messages to each other.  However programming in Erlang is awkward and arguably it makes the code more complex.</p>
<p>Other languages, like Clojure and F#, take a different approach and make it easier to write and deal with multithreaded issues, however they don't prevent you from writing multithreaded bugs.  These languages do not address the whole problem as you still need a way to test the code.</p>
<p><strong>Better Libraries</strong></p>
<p>Microsoft has a library for .Net called <a href="http://msdn.microsoft.com/en-us/magazine/cc163340.aspx">Parallel Task Library </a>to make it easier to write multithreaded code.  Need to operate on each element in an array?  Use the Parallel.For() method.  This library makes it easier to think and write multithreaded code, but it doesn't make it any easier to test.</p>
<p><strong>Static Code Analyzer</strong></p>
<p>Java has a static code analyzer that is able to find multithreading bugs called <a href="http://findbugs.sourceforge.net/">FindBugs</a>.  It looks at your code and reports any code that will cause multithreaded bugs.  This would address the second issue, because it, in theory, reports all threading bugs.  It doesn't however address the first issue, making the code easier to write.</p>
<p><strong>Testing with Deterministic Threads</strong><strong><br />
</strong></p>
<p>Microsoft is going in a different direction.  They are working on something called <a href="http://research.microsoft.com/~madanm/papers/osdi2008-CHESS.pdf">CHESS</a> that makes your unit tests find multithreaded bugs.  It does this by taking over the scheduler and sysmatically repeating each test, weaving the threads differently each time to exercise every possible way the scheduler could run the code.  However it requires us to to write a set of tests that finds *all* the threading bugs.  Since it is common to write unit tests with less than 100% coverage, a code coverage tool should be used to write more tests.</p>
<p><strong>Conclusion</strong></p>
<p>The good news is that there appears to be a variety of approaches to the problem and the whole answer will likely involve a combination of language or library enhancements and analyser or testing enhancements that are already in the works.</p>
]]></content:encoded>
			<wfw:commentRss>http://clay.lenharts.net/blog/2008/10/25/the-many-core-problem/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Functional Language Explosion</title>
		<link>http://clay.lenharts.net/blog/2008/10/18/functional-language-exploision/</link>
		<comments>http://clay.lenharts.net/blog/2008/10/18/functional-language-exploision/#comments</comments>
		<pubDate>Sat, 18 Oct 2008 10:50:02 +0000</pubDate>
		<dc:creator>Clay Lenhart</dc:creator>
				<category><![CDATA[Languages]]></category>
		<category><![CDATA[F#]]></category>
		<category><![CDATA[Functional Langauges]]></category>
		<category><![CDATA[Immutable]]></category>

		<guid isPermaLink="false">http://clay.lenharts.net/blog/?p=41</guid>
		<description><![CDATA[There is suddenly a lot of interest in functional languages recently.  The two advantages are writing a DSL (Domain Specific Language) and writing concurrent code. The languages that seem to come up are Clojure (JVM), F# (based on OCaml, Haskell, and ML) (.Net CLR), and Erlang (JVM).
]]></description>
			<content:encoded><![CDATA[<div class="diggthisplugin" style="float: right; width: 42px; padding-right: 10px; margin-left: 10px; margin-bottom: 0px;"><iframe src="http://digg.com/tools/diggthis.php?u=http://clay.lenharts.net/blog/2008/10/18/functional-language-exploision/&t=Functional Language Explosion&k=#FFFFFF" scrolling="no" style="border: none; height: 80px; width: 52px;"></iframe>
		</div><p>There is suddenly a lot of interest in <a href="http://en.wikipedia.org/wiki/Functional_programming">functional languages </a>recently.  The two advantages are</p>
<ul>
<li>Writing a DSL (Domain Specific Language)</li>
<li>Writing concurrent code</li>
</ul>
<p>The languages that seem to come up are:</p>
<ul>
<li><a href="http://clojure.org/">Clojure</a> (JVM)</li>
<li><a href="http://msdn.microsoft.com/en-gb/fsharp/default.aspx">F#</a> (based on OCaml, Haskell, and ML) (.Net CLR)</li>
<li><a href="http://www.erlang.org/">Erlang</a> <span style="text-decoration: line-through;">(JVM)</span></li>
</ul>
<p>I'm not particularly interested in DSL (despite my last post on <a href="http://clay.lenharts.net/blog/2008/10/18/code-generator-built-in-to-vs-2008/">code generators</a>), however as CPUs contain more and more cores, we'll need a way to safely write multithreaded code.</p>
<p>The Clojure project has an interesting post on its approach on <a href="http://clojure.org/state">simplifying multithreaded code</a>.</p>
<p>Erlang handles concurrency by only having local variables and providing a way to send messages to and from other threads.</p>
<p>Lastly, <a href="http://www.osl.iu.edu/research/mpi.net/">MPI </a>is a .Net library for distributed processing where the same program executes multiple times and each instance communicates with each other using message passing which sounds very Erlang-like.</p>
]]></content:encoded>
			<wfw:commentRss>http://clay.lenharts.net/blog/2008/10/18/functional-language-exploision/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>GWT for Web Applications</title>
		<link>http://clay.lenharts.net/blog/2008/10/18/gwt-for-web-applications/</link>
		<comments>http://clay.lenharts.net/blog/2008/10/18/gwt-for-web-applications/#comments</comments>
		<pubDate>Sat, 18 Oct 2008 10:47:01 +0000</pubDate>
		<dc:creator>Clay Lenhart</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[GWT]]></category>
		<category><![CDATA[Web Application]]></category>

		<guid isPermaLink="false">http://clay.lenharts.net/blog/?p=42</guid>
		<description><![CDATA[<div class="diggthisplugin" style="float: right; width: 42px; padding-right: 10px; margin-left: 10px; margin-bottom: 0px;"><iframe src="http://digg.com/tools/diggthis.php?u=http://clay.lenharts.net/blog/2008/10/18/gwt-for-web-applications/&t=GWT for Web Applications&k=#FFFFFF" scrolling="no" style="border: none; height: 80px; width: 52px;"></iframe>
		</div><p>There are several approaches for writing web applications, each with their own advantages.  GWT is a new framework with its own niche.</p>
<ul>
<li>Your standard ASP.Net (or JSP/PHP/etc) w/ Ajax and JQuery (or other Javascript library)</li>
<li><a href="http://java.sun.com/javase/technologies/desktop/javawebstart/index.jsp">Java WebStart </a>or .Net <a href="http://en.wikipedia.org/wiki/ClickOnce">ClickOnce</a></li>
<li><a href="http://code.google.com/webtoolkit/">GWT</a> w/ Webservices</li>
</ul>
<p><span id="more-42"></span><br />
<strong>ASP.Net (or JSP/PHP/etc) - for Dynamic Websites<br />
</strong></p>
<p>ASP.Net is great, because it will run on any browser, but it difficult and error prone to write Javascript code, and many times the application or site isn't very interactive or responsive.</p>
<p>A coworker suggests that this is good for a "dynamic website", rather than a full blown "web application".  It certainly has a web site feel, rather than an application feel to it.  See the GWT demos below to see what I'm talking about.</p>
<p><strong>Java WebStart or .Net ClickOnce - for Internal Corporate Applications<br />
</strong></p>
<p>This, however, provides are great environment for writing interactive applications, however it requires either Java or .Net on the client.  Some users do not have permissions necessary to install Java and .Net.</p>
<p><strong>GWT w/ Webservices - for Public Applications<br />
</strong></p>
<p>GWT is a great idea that compiles Java code into Javascript to give you an HTML/Javascript web application.    It allows you to have *a lot* of javascript code that does not talk with the web server.  Be sure to check out these <a href="http://code.google.com/webtoolkit/examples/">GWT demos</a>.</p>
<p>You can't use the Java library with GWT, however you get a great GWT UI library, and you can call a webservice to do anything you like, for instance to make database calls.</p>
<p>As a C# developer, I find this great, because the learning curve is small.  The Java language is so close to C#, and I don't have to learn the Java library.</p>
]]></description>
			<content:encoded><![CDATA[<div class="diggthisplugin" style="float: right; width: 42px; padding-right: 10px; margin-left: 10px; margin-bottom: 0px;"><iframe src="http://digg.com/tools/diggthis.php?u=http://clay.lenharts.net/blog/2008/10/18/gwt-for-web-applications/&t=GWT for Web Applications&k=#FFFFFF" scrolling="no" style="border: none; height: 80px; width: 52px;"></iframe>
		</div><p>There are several approaches for writing web applications, each with their own advantages.  GWT is a new framework with its own niche.</p>
<ul>
<li>Your standard ASP.Net (or JSP/PHP/etc) w/ Ajax and JQuery (or other Javascript library)</li>
<li><a href="http://java.sun.com/javase/technologies/desktop/javawebstart/index.jsp">Java WebStart </a>or .Net <a href="http://en.wikipedia.org/wiki/ClickOnce">ClickOnce</a></li>
<li><a href="http://code.google.com/webtoolkit/">GWT</a> w/ Webservices</li>
</ul>
<p><span id="more-42"></span><br />
<strong>ASP.Net (or JSP/PHP/etc) - for Dynamic Websites<br />
</strong></p>
<p>ASP.Net is great, because it will run on any browser, but it difficult and error prone to write Javascript code, and many times the application or site isn't very interactive or responsive.</p>
<p>A coworker suggests that this is good for a "dynamic website", rather than a full blown "web application".  It certainly has a web site feel, rather than an application feel to it.  See the GWT demos below to see what I'm talking about.</p>
<p><strong>Java WebStart or .Net ClickOnce - for Internal Corporate Applications<br />
</strong></p>
<p>This, however, provides are great environment for writing interactive applications, however it requires either Java or .Net on the client.  Some users do not have permissions necessary to install Java and .Net.</p>
<p><strong>GWT w/ Webservices - for Public Applications<br />
</strong></p>
<p>GWT is a great idea that compiles Java code into Javascript to give you an HTML/Javascript web application.    It allows you to have *a lot* of javascript code that does not talk with the web server.  Be sure to check out these <a href="http://code.google.com/webtoolkit/examples/">GWT demos</a>.</p>
<p>You can't use the Java library with GWT, however you get a great GWT UI library, and you can call a webservice to do anything you like, for instance to make database calls.</p>
<p>As a C# developer, I find this great, because the learning curve is small.  The Java language is so close to C#, and I don't have to learn the Java library.</p>
]]></content:encoded>
			<wfw:commentRss>http://clay.lenharts.net/blog/2008/10/18/gwt-for-web-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Code Generator Built-in to VS 2008</title>
		<link>http://clay.lenharts.net/blog/2008/10/18/code-generator-built-in-to-vs-2008/</link>
		<comments>http://clay.lenharts.net/blog/2008/10/18/code-generator-built-in-to-vs-2008/#comments</comments>
		<pubDate>Sat, 18 Oct 2008 09:26:54 +0000</pubDate>
		<dc:creator>Clay Lenhart</dc:creator>
				<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Code Generator]]></category>

		<guid isPermaLink="false">http://clay.lenharts.net/blog/?p=40</guid>
		<description><![CDATA[<div class="diggthisplugin" style="float: right; width: 42px; padding-right: 10px; margin-left: 10px; margin-bottom: 0px;"><iframe src="http://digg.com/tools/diggthis.php?u=http://clay.lenharts.net/blog/2008/10/18/code-generator-built-in-to-vs-2008/&t=Code Generator Built-in to VS 2008&k=#FFFFFF" scrolling="no" style="border: none; height: 80px; width: 52px;"></iframe>
		</div><p>Guess what, a <a href="http://www.hanselman.com/blog/T4TextTemplateTransformationToolkitCodeGenerationBestKeptVisualStudioSecret.aspx">code generator is built-in to Visual Studio 2008</a>.</p>
]]></description>
			<content:encoded><![CDATA[<div class="diggthisplugin" style="float: right; width: 42px; padding-right: 10px; margin-left: 10px; margin-bottom: 0px;"><iframe src="http://digg.com/tools/diggthis.php?u=http://clay.lenharts.net/blog/2008/10/18/code-generator-built-in-to-vs-2008/&t=Code Generator Built-in to VS 2008&k=#FFFFFF" scrolling="no" style="border: none; height: 80px; width: 52px;"></iframe>
		</div><p>Guess what, a <a href="http://www.hanselman.com/blog/T4TextTemplateTransformationToolkitCodeGenerationBestKeptVisualStudioSecret.aspx">code generator is built-in to Visual Studio 2008</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://clay.lenharts.net/blog/2008/10/18/code-generator-built-in-to-vs-2008/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MSSQL Compressed Backup 1.0 Released</title>
		<link>http://clay.lenharts.net/blog/2008/08/24/mssql-compressed-backup-10-released/</link>
		<comments>http://clay.lenharts.net/blog/2008/08/24/mssql-compressed-backup-10-released/#comments</comments>
		<pubDate>Sun, 24 Aug 2008 21:40:10 +0000</pubDate>
		<dc:creator>Clay Lenhart</dc:creator>
				<category><![CDATA[MSSQL Compressed Backup]]></category>
		<category><![CDATA[SQL Server Administration]]></category>

		<guid isPermaLink="false">http://clay.lenharts.net/blog/?p=39</guid>
		<description><![CDATA[<div class="diggthisplugin" style="float: right; width: 42px; padding-right: 10px; margin-left: 10px; margin-bottom: 0px;"><iframe src="http://digg.com/tools/diggthis.php?u=http://clay.lenharts.net/blog/2008/08/24/mssql-compressed-backup-10-released/&t=MSSQL Compressed Backup 1.0 Released&k=#FFFFFF" scrolling="no" style="border: none; height: 80px; width: 52px;"></iframe>
		</div><p>I've just released version 1.0 of MSSQL Compressed Backup.  This is a command line utility that allows you to backup or restore your SQL Server 2005 databases to/from compressed files such as zip, bzip2, or gzip.</p>
<p><a href="http://mssqlcompressed.sourceforge.net/">http://mssqlcompressed.sourceforge.net/</a></p>
]]></description>
			<content:encoded><![CDATA[<div class="diggthisplugin" style="float: right; width: 42px; padding-right: 10px; margin-left: 10px; margin-bottom: 0px;"><iframe src="http://digg.com/tools/diggthis.php?u=http://clay.lenharts.net/blog/2008/08/24/mssql-compressed-backup-10-released/&t=MSSQL Compressed Backup 1.0 Released&k=#FFFFFF" scrolling="no" style="border: none; height: 80px; width: 52px;"></iframe>
		</div><p>I've just released version 1.0 of MSSQL Compressed Backup.  This is a command line utility that allows you to backup or restore your SQL Server 2005 databases to/from compressed files such as zip, bzip2, or gzip.</p>
<p><a href="http://mssqlcompressed.sourceforge.net/">http://mssqlcompressed.sourceforge.net/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://clay.lenharts.net/blog/2008/08/24/mssql-compressed-backup-10-released/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
