<?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>Ning Zhang&#039;s Blog &#187; Blog</title>
	<atom:link href="http://www.ningzhang.org/category/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ningzhang.org</link>
	<description>About Silverlight, Microsoft technologies, and software development in general.</description>
	<lastBuildDate>Thu, 14 Apr 2011 22:47:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Migrate Windows Live Writer Data</title>
		<link>http://www.ningzhang.org/2009/05/08/migrate-windows-live-writer-data/</link>
		<comments>http://www.ningzhang.org/2009/05/08/migrate-windows-live-writer-data/#comments</comments>
		<pubDate>Fri, 08 May 2009 15:09:28 +0000</pubDate>
		<dc:creator>Ning Zhang</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Windows Live Writer]]></category>

		<guid isPermaLink="false">http://www.ningzhang.org/2009/05/08/migrate-windows-live-writer-data/</guid>
		<description><![CDATA[This post discusses where Windows Live Writer saves its settings and data (like auto linking, dictionary, posts etc), how to migrate those data and settings, and how to find out more about Windows Live Writer via tools like procmon, reflector, and windbg.]]></description>
			<content:encoded><![CDATA[<p>I am re-imaging my laptop with Windows 7 RC: it is so much fun and productivity boost to spend a day or two re-installing and re-configuring OS and apps <img src='http://www.ningzhang.org/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  One of my favorite apps is <a href="http://download.live.com/writer" target="_blank">Windows Live Writer</a>, so I need to migrate all my Windows Live Writer settings and data. This is what I did:</p>
<ul>
<li><a href="http://technet.microsoft.com/en-us/library/cc733145.aspx" target="_blank">robocopy</a> posts under “%userprofile%\Documents\My Weblog Posts”</li>
<li>copy auto linking entries in “%appdata%\Windows Live Writer\LinkGlossary\linkglossary.xml”</li>
</ul>
<p>For those curious, this is where Windows Live Writer settings are stored:</p>
<ul>
<li>posts:<br />
<img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="WLW posts directory" src="http://www.ningzhang.org/wp-content/uploads/2009/05/image5.png" border="0" alt="WLW posts directory" width="447" height="289" /></li>
<li>User dictionaries, keywords and auto links:<br />
<a href="http://www.ningzhang.org/wp-content/uploads/2009/05/image10.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="WLW config directory" src="http://www.ningzhang.org/wp-content/uploads/2009/05/image-thumb6.png" border="0" alt="WLW config directory" width="554" height="295" /></a></li>
<li>other settings in registry:<br />
<a href="http://www.ningzhang.org/wp-content/uploads/2009/05/image11.png" target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="WLW settings in registry" src="http://www.ningzhang.org/wp-content/uploads/2009/05/image-thumb7.png" border="0" alt="WLW settings in registry" width="554" height="270" /></a></li>
</ul>
<p>For those even more curious, this is how I found out where those settings are, besides web search:</p>
<ul>
<li> configuration is usually persisted in registry and/or files, and those registry and files usually follow well known path convention. Registry is usually a good start. For files, try %appdata% and/or &#8220;%userprofile%.</li>
<li>use <a href="http://technet.microsoft.com/en-us/sysinternals/default.aspx" target="_blank">sysinternals</a>’ <a href="http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx" target="_blank">procmon</a> to see what registry and files a process is accessing:<br />
<a href="http://www.ningzhang.org/wp-content/uploads/2009/05/image8.png" target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="procmon on linkglossary.xml" src="http://www.ningzhang.org/wp-content/uploads/2009/05/image-thumb4.png" border="0" alt="procmon on linkglossary.xml" width="554" height="198" /></a></li>
<li>for managed code, load all their assemblies (usually under %programfiles%) into <a href="http://en.wikipedia.org/wiki/.NET_Reflector" target="_blank">reflector</a>, and see how it is implemented:<br />
<a href="http://www.ningzhang.org/wp-content/uploads/2009/05/image9.png" target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="reflector on LinkGlossary" src="http://www.ningzhang.org/wp-content/uploads/2009/05/image-thumb5.png" border="0" alt="reflector on LinkGlossary" width="554" height="277" /></a></li>
</ul>
<ul> Happy blogging, and hacking <img src='http://www.ningzhang.org/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </ul>
<p> </p>
<p> </p>
<p> </p>
<div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:1848c3e0-d0d2-4742-ae17-eec381875305" class="wlWriterEditableSmartContent" style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px">Technorati Tags: <a rel="tag" href="http://technorati.com/tags/Windows+Live+Writer">Windows Live Writer</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.ningzhang.org/2009/05/08/migrate-windows-live-writer-data/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Photoblog with WordPress</title>
		<link>http://www.ningzhang.org/2009/05/04/photoblog-with-wordpress/</link>
		<comments>http://www.ningzhang.org/2009/05/04/photoblog-with-wordpress/#comments</comments>
		<pubDate>Tue, 05 May 2009 07:07:02 +0000</pubDate>
		<dc:creator>Ning Zhang</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[photoblog]]></category>
		<category><![CDATA[Windows Live Writer]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.ningzhang.org/?p=360</guid>
		<description><![CDATA[This blog discusses how to do photoblog with Windows Live Photo Gallery, Windows Live Writer, WordPress, NextGEN gallery, and WP-SimpleViewer.]]></description>
			<content:encoded><![CDATA[<h3>Introduction</h3>
<p>I’ve been using <a href="http://spaces.live.com" target="_blank">Windows Live Spaces</a> for personal blogging, but since I moved my work blog to <a href="http://wordpress.org/" target="_blank">WordPress</a>, I wanted to build my personal blog with WordPress too. WordPress is a great blog software, but features for photo blogging, which my personal blog is mostly about, are lacking out of box. So I spent the past weekend experimenting with various desktop software and WordPress plugins, and here is the result:</p>
<p><img class="alignnone size-full wp-image-361" title="mypersonalblog" src="http://www.ningzhang.org/wp-content/uploads/2009/05/mypersonalblog.jpg" alt="mypersonalblog" width="608" height="1116" /></p>
<p>Basically my photoblog solution consists of:</p>
<ul>
<li>Build my WordPress blog site with <a href="http://wordpress.org/extend/plugins/wp-simpleviewer/" target="_blank">WP-SimpleViewer</a> and <a href="http://wordpress.org/extend/plugins/nextgen-gallery/" target="_blank">NextGEN Gallery</a> plugins
<ul>
<li>WP-SimpleViewer for slow connection (&lt; 1mbps)</li>
<li>NextGEN Gallery for fast connection (&gt;10mbps), gallery, and widgets</li>
</ul>
</li>
<li>Manage photos locally using <a href="http://download.live.com/photogallery" target="_blank">Windows Live Photo Gallery</a> </li>
<li>Backup photos remotely on both Live Spaces and my WordPress site</li>
<li>Write blogs and cross post them to both Live Spaces and WordPress site using <a href="http://download.live.com/writer" target="_blank">Windows Live Writer</a></li>
</ul>
<h3>WP-SimpleViewer</h3>
<p><a href="http://wordpress.org/extend/plugins/wp-simpleviewer/" target="_blank">WP-SimpleViewer</a> plugin “enables you to easily add fancy <a href="http://www.airtightinteractive.com/simpleviewer/" target="_blank">SimpleViewer</a> Flash galleries to your posts and pages. The admin interface helps you to create the thumbs for a new gallery and change its settings.” The slideshow in the middle of the screenshot above is generated with WP-SimpleViewer. Besides the fancy UI and easy keyboard navigation for in-page photo viewing, the biggest benefit, to me at least, is that WP-SimpleViewer generates 20-30KB sized scaled down photos under reg folder, and 1-2KB sized thumbnails under tn subfolder, and display those photos instead of the originals in the slide show. This allows very slick photo viewing experience even on slow connections (&lt;1mbps).</p>
<p>It is pretty easy to install WP-SimpleViewer, but making it work isn’t so trivial. By default, it always hangs during gallery creation. The fix is to uncomment line 101 of wp-simpleviewer-admin.php:</p>
<div style="line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: consolas, 'Courier New', courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: gray 1px solid; padding: 4px;">
<pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #008000">/*If the plugin should hang up while it is creating the thumbs (last line on the admin is: "Now I am working on file xzy.jpg:") you</span>
<span style="color: #008000">can try to uncomment the following line (remove // ) to define a new memory limit (40MB in this case). More info on the plugins FAQ.*/</span>
<span style="color: #008000">//ini_set("memory_limit","40M");</span></pre>
</div>
<p>I changed it to ini_set(“memory_limit”, “120MB”). I also increased the limits in php.in:</p>
<div style="line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: consolas, 'Courier New', courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: gray 1px solid; padding: 4px;">
<pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;">;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;

max_execution_time = 30     ; Maximum execution time of each script, in seconds
max_input_time = 60    ; Maximum amount of time each script may spend parsing request data
memory_limit = 128M      ; Maximum amount of memory a script may consume (32MB)</pre>
</div>
<p>But even with those changes, WP-SimpleViewer still hangs when there are a lot of photos in one gallery.</p>
<p>Another trick I did is to set the images directory to wp-content/gallery instead of the default wp-content/photos in WP-SimpleViewer’s admin page, so the same original photos can be used by both <a href="http://wordpress.org/extend/plugins/wp-simpleviewer/" target="_blank">WP-SimpleViewer</a> and <a href="http://wordpress.org/extend/plugins/nextgen-gallery/" target="_blank">NextGEN Gallery</a>.</p>
<p> </p>
<h3>NextGEN Gallery</h3>
<p><a href="http://wordpress.org/extend/plugins/nextgen-gallery/" target="_blank">NextGen Gallery</a> is probably the most popular image gallery plugin for WordPress. It has a basic set of image gallery functions, like albums, tags, roles etc, and a set of <a href="http://faq.wordpress.com/2008/06/18/what-are-the-wordpress-shortcodes/" target="_blank">shortcode</a> for different rendering. NextGEN’s slideshow and PicLens view both display the original photos. My photos are usually 2-3MB in size, so they look great with fast connection (&gt;10mpbs), and can be displayed with <a href="http://www.cooliris.com/" target="_blank">cooliris</a> browser addin (need separate install) as shown below:</p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="cooliris view" src="http://www.ningzhang.org/wp-content/uploads/2009/05/image1.png" border="0" alt="cooliris view" width="644" height="404" /></p>
<p>But that doesn’t really work with slow connections (&lt;1mbps): those MB sized photos take forever to download on slow connection, so I usually put both WP-SimpleViewer and NextGEN shortcode on a page. Besides the nice rendering UI, NextGEN Gallery also comes with two nice widgets: the NextGEN Slideshow and NextGEN Gallery widget, as shown at the top left corner of my personal blog screenshot above.</p>
<p>Just like WP-SimpleViewer, it is pretty easy to install to NextGEN Gallery, but it takes some effort to make it work. Besides modifying php.ini as mentioned above, I also need to uncomment line 168 of lib/gd.thumbnail.inc.php:</p>
<blockquote><p>lib\gd.thumbnail.inc.php:168:           // @ini_set(&#8216;memory_limit&#8217;, &#8217;128M&#8217;);</p></blockquote>
<p>Once working, it seems more reliable than WP-SimpleViewer.</p>
<p> </p>
<h3>Windows Live Photo Gallery</h3>
<p>I used to use <a href="http://en.wikipedia.org/wiki/Picasa" target="_blank">Picasa</a>, but after trying out the new Windows Live Photo Gallery 2009, I am really impressed. The features I really like about Windows Live Photo Gallery:</p>
<ul>
<li>easy navigation with folder, date, people and tag hierarchical views</li>
<li>tagging, rating, and people tagging features</li>
<li>metadata in the info panel</li>
<li>fix functions, especially <a href="http://blogs.msdn.com/pix/archive/2008/10/21/straighten-up.aspx" target="_blank">straighten photo</a>: I am getting into the habit of applying it on all photos <img src='http://www.ningzhang.org/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </li>
<li>easy publishing to live spaces, and other photo sharing sites (require plugin)</li>
<li>and the publishing plugin platform</li>
</ul>
<h3>Windows Live Writer</h3>
<p><a href="http://download.live.com/writer" target="_blank">Windows Live Writer</a> is probably the best blog authoring tool. The nice new feature related to photo blogging is the Insert –&gt; Photo album… function:</p>
<p><a href="http://www.ningzhang.org/wp-content/uploads/2009/05/image2.png" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Window Live Writer - Insert Photo Album Dialog" src="http://www.ningzhang.org/wp-content/uploads/2009/05/image-thumb.png" border="0" alt="Window Live Writer - Insert Photo Album Dialog" width="493" height="484" /></a></p>
<p>It is nicely integrated with Live Spaces, allowing users to browse their existing photo albums or create new one, and insert it into blog post with four different layout. In my personal blog screenshot above, the top photo album in scatter view is inserted via Insert –&gt; Photo album. You can find more from <a href="http://windowslivewriter.spaces.live.com/Blog/" target="_blank">Windows Live Writer blog</a>, like post <a href="http://windowslivewriter.spaces.live.com/Blog/cns!D85741BB5E0BE8AA!1650.entry" target="_blank">Windows Live Writer 2009: Now Available for Download</a>.</p>
<p>Photo in Live Spaces are also doubled scaled for easy browsing on both slow and fast connections, just like WP-SimpleViewer: thumbnail and regular photos are displayed, but user can also click on a photo to get the original version. Live Spaces allows 25GB for photo storage, so it can be used as an online storage for photos.</p>
<p> </p>
<h3>Conclusion</h3>
<p> </p>
<p>I am by no means a blog or photoblog expert, and don’t really know WordPress, PHP, or the various Live services as a developer. This post is just to share what I’ve learned about photo blogging with WordPress. I am actually quite happy with what I’ve managed to do over the weekend. It is good enough for me for now, photo blogging wise.</p>
<p> </p>
<p> </p>
<div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:0dc6a37b-ad67-445e-9b6c-7f7f3af327bc" class="wlWriterEditableSmartContent" style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px">Technorati Tags: <a rel="tag" href="http://technorati.com/tags/photoblog">photoblog</a>,<a rel="tag" href="http://technorati.com/tags/wordpress">wordpress</a>,<a rel="tag" href="http://technorati.com/tags/nextgen+gallery">nextgen gallery</a>,<a rel="tag" href="http://technorati.com/tags/wp-simpleviewer">wp-simpleviewer</a>,<a rel="tag" href="http://technorati.com/tags/windows+live">windows live</a>,<a rel="tag" href="http://technorati.com/tags/windows+live+photo+gallery">windows live photo gallery</a>,<a rel="tag" href="http://technorati.com/tags/windows+live+writer">windows live writer</a>,<a rel="tag" href="http://technorati.com/tags/windows+live+spaces">windows live spaces</a>,<a rel="tag" href="http://technorati.com/tags/cooliris">cooliris</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.ningzhang.org/2009/05/04/photoblog-with-wordpress/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Fix Windows Live Writer Issue with WordPress</title>
		<link>http://www.ningzhang.org/2009/04/30/fix-windows-live-writer-issue-with-wordpress/</link>
		<comments>http://www.ningzhang.org/2009/04/30/fix-windows-live-writer-issue-with-wordpress/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 17:33:02 +0000</pubDate>
		<dc:creator>Ning Zhang</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Windows Live Writer]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.ningzhang.org/2009/04/30/fix-windows-live-writer-issue-with-wordpress/</guid>
		<description><![CDATA[This post discusses how to fix Windows Live Writer publish issues with WordPress site, especially the issue of invalid server response from XmlRpc server. ]]></description>
			<content:encoded><![CDATA[<p>I have always been using <a href="http://download.live.com/writer" target="_blank">Windows Live Writer</a> (WLW) in writing my blogs and cross posting them to both WordPress site <a href="http://www.ningzhang.org">www.ningzhang.org</a> and Blogger site <a href="http://download.live.com/writer" target="_blank">blog.ningzhang.org</a>, very convenient. Yesterday I ran into issues opening and posting to my <a href="http://wordpress.org/" target="_blank">WordPress</a> site using Windows Live Writer: got an error dialog saying</p>
<blockquote><p>Invalid Server Response &#8211; The response to the metaWeblog.newMediaObject method received from the blog server was invalid</p></blockquote>
<p>I searched the web, tried a few things, and fixed the issue pretty quickly. Share my findings here in hope it may be helpful for others run into similar problems.</p>
<h4>Windows Live Writer Log</h4>
<p>WLW has pretty good log. Open Help-&gt;About Windows Live Writer menu item:</p>
<p><a href="http://www.ningzhang.org/wp-content/uploads/2009/04/image17.png" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Windows Live Writer Help-&gt;About menu item" src="http://www.ningzhang.org/wp-content/uploads/2009/04/image-thumb16.png" border="0" alt="Windows Live Writer Help-&gt;About menu item" width="602" height="484" /></a></p>
<p>You will see the About dialog, click the Show log file link:</p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="WLW About Windows" src="http://www.ningzhang.org/wp-content/uploads/2009/04/image-thumb17.png" border="0" alt="WLW About Windows" width="385" height="292" /></p>
<p>the folder “%localappdata%\Windows Live Writer” will pop up, which contains “Windows Live Writer.log” file. I copied relevant error log below. Pretty good stack trace, very helpful for debugging and diagnosing <img src='http://www.ningzhang.org/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<div style="line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: consolas, 'Courier New', courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: gray 1px solid; padding: 4px;">
<pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;">WindowsLiveWriter,1.7696,Fail,00031,30-Apr-2009 01:28:58.595,"WindowsLive.Writer.Extensibility.BlogClient.BlogClientInvalidServerResponseException: Invalid Server Response - The response to the metaWeblog.newMediaObject method received from the blog server was invalid:

Invalid response document returned from XmlRpc server
   at WindowsLive.Writer.BlogClient.Clients.XmlRpcBlogClient.CallMethod(String methodName, XmlRpcValue[] parameters)
   at WindowsLive.Writer.BlogClient.Clients.MetaweblogClient.DoBeforePublishUploadWork(IFileUploadContext uploadContext)
   at WindowsLive.Writer.PostEditor.WeblogBlogFileUploader.DoUploadWorkBeforePublish(IFileUploadContext uploadContext)
   at WindowsLive.Writer.PostEditor.BlogPostReferenceFixer.FileUploadWorker.DoUploadWork(String fileReference, BlogFileUploader fileUploader, Boolean isWindowsLiveLightboxCloneEnabled)
   at WindowsLive.Writer.PostEditor.BlogPostReferenceFixer.LocalFileTransformer.Transform(BeginTag tag, String reference)
   at WindowsLive.Writer.CoreServices.HTML.HtmlReferenceFixer.LocalFileReferenceFixupFilter.FixReferences(BeginTag tag, String reference)
   at WindowsLive.Writer.CoreServices.HTML.HtmlReferenceFixer.OnBeginTag(BeginTag tag)
   at WindowsLive.Writer.CoreServices.LightWeightHTMLDocumentIterator.Parse()
   at WindowsLive.Writer.CoreServices.HTML.HtmlReferenceFixer.FixReferences(TextWriter output, ReferenceFixer referenceFixer, ReferenceFixedCallback referenceFixed)
   at WindowsLive.Writer.CoreServices.HTML.HtmlReferenceFixer.FixReferences(String html, ReferenceFixer fixer, ReferenceFixedCallback referenceFixed)
   at WindowsLive.Writer.CoreServices.HTML.HtmlReferenceFixer.FixLocalFileReferences(String html, ReferenceFixer fixer, ReferenceFixedCallback referenceFixed)
   at WindowsLive.Writer.CoreServices.HTML.HtmlReferenceFixer.FixLocalFileReferences(String html, ReferenceFixer fixer)
   at WindowsLive.Writer.PostEditor.UpdateWeblogAsyncOperation.LocalSupportingFileUploader.UploadFilesBeforePublish()
   at WindowsLive.Writer.PostEditor.UpdateWeblogAsyncOperation.DoWork()
   at WindowsLive.Writer.CoreServices.AsyncOperation.InternalStart()","   at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
   at System.Environment.get_StackTrace()
   at WindowsLive.Writer.CoreServices.Diagnostics.LogFileTraceListener.Fail(String message)
   at System.Diagnostics.TraceInternal.Fail(String message)
   at System.Diagnostics.Trace.Fail(String message)
   at WindowsLive.Writer.PostEditor.BlogPostEditingManager.UpdateWeblog(Boolean publish)
   at WindowsLive.Writer.PostEditor.BlogPostEditingManager.PostToWeblog(Boolean publish)
   at WindowsLive.Writer.PostEditor.BlogPostEditingManager.PublishAsDraft()
   at WindowsLive.Writer.PostEditor.PostEditorMainControl.commandPostAsDraft_Execute(Object sender, EventArgs e)
   at WindowsLive.Writer.ApplicationFramework.Command.RaiseEvent(Object eventKey, EventArgs e)
   at WindowsLive.Writer.ApplicationFramework.Command.OnExecute(EventArgs e)
   at WindowsLive.Writer.ApplicationFramework.CommandOwnerDrawMenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.MenuItem.MenuItemData.Execute()
   at System.Windows.Forms.Command.Invoke()
   at System.Windows.Forms.Command.DispatchID(Int32 id)
   at System.Windows.Forms.Control.WmCommand(Message&amp; m)
   at System.Windows.Forms.Control.WndProc(Message&amp; m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message&amp; m)
   at System.Windows.Forms.ContainerControl.WndProc(Message&amp; m)
   at System.Windows.Forms.Form.WndProc(Message&amp; m)
   at WindowsLive.Writer.ApplicationFramework.ApplicationForm.WndProc(Message&amp; m)
   at WindowsLive.Writer.ApplicationFramework.SatelliteApplicationForm.WndProc(Message&amp; m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp; m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp; m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.NativeWindow.DefWndProc(Message&amp; m)
   at System.Windows.Forms.NativeWindow.WndProc(Message&amp; m)
   at WindowsLive.Writer.PostEditor.ImageInsertion.InsertImageDialog.ThumbnailReadinessListener.WndProc(Message&amp; m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.NativeWindow.DefWndProc(Message&amp; m)
   at System.Windows.Forms.NativeWindow.WndProc(Message&amp; m)
   at WindowsLive.Writer.PostEditor.ImageInsertion.InsertImageDialog.ThumbnailReadinessListener.WndProc(Message&amp; m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.NativeWindow.DefWndProc(Message&amp; m)
   at System.Windows.Forms.NativeWindow.WndProc(Message&amp; m)
   at WindowsLive.Writer.PostEditor.ImageInsertion.InsertImageDialog.ThumbnailReadinessListener.WndProc(Message&amp; m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.NativeWindow.DefWndProc(Message&amp; m)
   at System.Windows.Forms.NativeWindow.WndProc(Message&amp; m)
   at WindowsLive.Writer.PostEditor.ImageInsertion.InsertImageDialog.ThumbnailReadinessListener.WndProc(Message&amp; m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.NativeWindow.DefWndProc(Message&amp; m)
   at System.Windows.Forms.NativeWindow.WndProc(Message&amp; m)
   at WindowsLive.Writer.PostEditor.ImageInsertion.InsertImageDialog.ThumbnailReadinessListener.WndProc(Message&amp; m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.NativeWindow.DefWndProc(Message&amp; m)
   at System.Windows.Forms.NativeWindow.WndProc(Message&amp; m)
   at WindowsLive.Writer.PostEditor.ImageInsertion.InsertImageDialog.ThumbnailReadinessListener.WndProc(Message&amp; m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.NativeWindow.DefWndProc(Message&amp; m)
   at System.Windows.Forms.NativeWindow.WndProc(Message&amp; m)
   at WindowsLive.Writer.PostEditor.ImageInsertion.InsertImageDialog.ThumbnailReadinessListener.WndProc(Message&amp; m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&amp; msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.Run(Form mainForm)
   at WindowsLive.Writer.ApplicationFramework.SatelliteApplicationForm.Launcher.ThreadMain(Object[] parameters)
   at WindowsLive.Writer.CoreServices.Threading.ThreadStartWithParams.Run()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()"</pre>
</div>
<h4>It is the Gold Star Rating Plugin!</h4>
<p>Since WLW has always worked fine with my WordPress site till now, so I suspect it is some recent changes on my WordPress site, and most likely recent plugin updates, so I tried deactivating plugins one by one. I was lucky! Since I knew what plugins I updated lately, so I first deactivated <a href="http://www.gdstarrating.com/" target="_blank">Gold Start Rating plugin</a> and then use WLW to open and post, and it worked!</p>
<p> </p>
<h4>Updates</h4>
<h5>2009-05-05</h5>
<p>I ran into this error again while publishing a post from Windows Live Writer:</p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Invalid Server Response" src="http://www.ningzhang.org/wp-content/uploads/2009/05/image3.png" border="0" alt="Invalid Server Response" width="359" height="233" /></p>
<p>Windows Live Writer log shows similar error message and call stack as before. I opened error_log under the top directory of my WordPress site, it has something like this:</p>
<blockquote><p>05-May-2009 08:10:59] PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 865469 bytes) in /[deleted]/wp-includes/class-IXR.php on line 242</p></blockquote>
<p>and line 242 of class-IXR.php is the second line below:</p>
<div>
<pre style="line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: consolas, 'Courier New', courier, monospace; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #0000ff">case</span> <span style="color: #006080">'base64'</span>:
    $<span style="color: #0000ff">value</span> = base64_decode( trim( $<span style="color: #0000ff">this</span>-&gt;_currentTagContents ) );
    $valueFlag = <span style="color: #0000ff">true</span>;
    <span style="color: #0000ff">break</span>;</pre>
</div>
<p>So it looks like it ran out of memory while base64_decode an image. I removed the largest image in my post, post draft to blog, and it succeeded. I then edited the draft from WordPress web UI, select Add an Image from computer and insert it to post:</p>
<p><a href="http://www.ningzhang.org/wp-content/uploads/2009/05/image4.png" target="_blank"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Add an Image from computer" src="http://www.ningzhang.org/wp-content/uploads/2009/05/image-thumb1.png" border="0" alt="Add an Image from computer" width="644" height="209" /></a></p>
<p>and it succeeded.</p>
<p>I don’t really know WordPress or PHP as a developer, so if anyone know how to raise this better, please let me know. A general novice user approach seems:</p>
<ul>
<li>post draft to server frequently to pinpoint the troublemaker image while you are authoring</li>
<li>upload and insert the image to post from WordPress web UI</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.ningzhang.org/2009/04/30/fix-windows-live-writer-issue-with-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick Introduction to Web Analytics for Bloggers</title>
		<link>http://www.ningzhang.org/2009/01/18/quick-introduction-to-web-analytics-for-bloggers/</link>
		<comments>http://www.ningzhang.org/2009/01/18/quick-introduction-to-web-analytics-for-bloggers/#comments</comments>
		<pubDate>Sun, 18 Jan 2009 20:10:51 +0000</pubDate>
		<dc:creator>Ning Zhang</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Analytics]]></category>

		<guid isPermaLink="false">http://www.ningzhang.org/?p=93</guid>
		<description><![CDATA[This post gives a quick introduction to popular free web analytics tools (Google Analytics, Microsoft AdCenter Analytics, FeedBurner Stats, WordPress Stats), how to set it up, and how web analytics works.]]></description>
			<content:encoded><![CDATA[<h3>Summary</h3>
<p>This post gives a quick introduction to popular free web analytics tools (<a href="http://www.google.com/analytics" target="_blank">Google Analytics</a>, <a href="http://adcenter.microsoft.com" target="_blank">Microsoft AdCenter Analytics</a>, <a href="http://www.feedburner.com" target="_blank">FeedBurner Stats</a>, <a href="http://www.wordpress.com" target="_blank">WordPress Stats</a>), how to set it up, and how web analytics works.</p>
<h3>What is web analytics?</h3>
<p>If you blog, you may be very interested in knowing:</p>
<ul>
<li>who read your blog: the demographic, geographic, techno-graphic information of your readers; </li>
<li>what do they do on your site: what pages do they read, how much time do they spend on each page, how frequently do they come back etc; </li>
<li>how do they find your blog: referrals, keywords, search engines that lead people to your blog. </li>
</ul>
<p><a href="http://en.wikipedia.org/wiki/Web_analytics" target="_blank">Web Analytics</a> answer those questions, help you to better connect with your readers, improve your site, and motivate you to blog more. It is those who contribute information to the Web that have made the Internet so much useful.</p>
<p>After about 20 years of development, web analytics is now fairly mature and easy to use. There are many free web analytics tool on the Web, the most popular one is probably <a href="http://en.wikipedia.org/wiki/Google_analytics" target="_blank">Google Analytics</a> (GA):     <br /><a href="http://www.ningzhang.org/wp-content/uploads/2009/01/image63.png" target="_blank"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="619" alt="Google Analytics" src="http://www.ningzhang.org/wp-content/uploads/2009/01/image63-thumb.png" width="604" border="0" /></a></p>
<p>Microsoft has a free web analytics offering too, called <a href="http://advertising.microsoft.com/search-advertising/adcenter-analytics" target="_blank">AdCenter Analytics</a> (ACA):     <br /><a href="http://www.ningzhang.org/wp-content/uploads/2009/01/image69.png" target="_blank"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="588" alt="AdCenter Analytics" src="http://www.ningzhang.org/wp-content/uploads/2009/01/image69-thumb.png" width="604" border="0" /></a></p>
<p>Besides those general web analytics tools, there are analytics tools for specific sectors, in particular <a href="http://www.feedburner.com" target="_blank">FeedBurner</a> Feed Stats for bloggers who publish blog feeds via FeedBurner:     <br /><a href="http://www.ningzhang.org/wp-content/uploads/2009/01/image2.png" target="_blank"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="484" alt="FeedBurner Stats" src="http://www.ningzhang.org/wp-content/uploads/2009/01/image-thumb3.png" width="577" border="0" /></a></p>
<p>And if you use WordPress, probably the best blogging software, WordPress.com has free blog stats:    <br /><a href="http://www.ningzhang.org/wp-content/uploads/2009/01/image76.png" target="_blank"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="572" alt="WP Stats" src="http://www.ningzhang.org/wp-content/uploads/2009/01/image76-thumb.png" width="604" border="0" /></a></p>
<h3>How to set it up?</h3>
<p>&quot;OK, you&#8217;ve convinced me, so how do I get started?&quot; You ask. Just follow below three simple steps:</p>
<ol>
<li>Open an account with an web analytics provider, like Google Analytics or AdCenter Analytics; </li>
<li>Add the piece of JavaScript code from your analytics provider to pages in your site; </li>
<li>Log into your provider&#8217;s site and watch analytics roll in, or if you prefer, receive analytics reports via email. </li>
</ol>
<p>The only tricky part is step two. Some blog providers don&#8217;t allow JavaScript, like <a href="http://spaces.live.com/" target="_blank">Windows Live Spaces</a>, then you are out of luck there. For those providers do allow JavaScript, like <a href="http://www.blogger.com/" target="_blank">Blogger</a> and <a href="http://www.wordpress.com" target="_blank">WordPress</a>, or you host your own blog software, you have several options, for example:</p>
<ol>
<li>modify the html template directly </li>
<li>use some widget/gadget that allow your add JavaScript code </li>
</ol>
<p>I usually go with option two, because it makes it easy to switch/upgrade templates.</p>
<ul>
<li>Blogger: use HTML/JavaScript Gadget, contain JavaScript for both Google Analytics and AdCenter Analytics </li>
</ul>
<p><a href="http://www.ningzhang.org/wp-content/uploads/2009/01/image4.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="484" alt="Blogger Html/JavaScript Gadget" src="http://www.ningzhang.org/wp-content/uploads/2009/01/image-thumb6.png" width="428" border="0" /></a></p>
<ul>
<li>WordPress: use Text widget, ACA only, since GA is tracked using Google Analytics for WordPress widget </li>
</ul>
<p><a href="http://www.ningzhang.org/wp-content/uploads/2009/01/image5.png" target="_blank"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="442" alt="WordPress Text widget" src="http://www.ningzhang.org/wp-content/uploads/2009/01/image-thumb7.png" width="431" border="0" /></a></p>
<p>Please note: account code (UA-1234567-1, A1B2) in above screenshots are fake, to protect my privacy <img src='http://www.ningzhang.org/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>It is generally advised to use two or more analytics providers:</p>
<ul>
<li>to verify data and possibly fix data discrepancies </li>
<li>to duplicate traffic history and avoid get locked into one provider </li>
<li>each provider usually offers some unique features, like AdCenter Analytics has better demographic data, FeedBurner gives subscriber stats. </li>
</ul>
<h3>How does it work?</h3>
<p>For those curious minds, this is how web analytics works, over-simplified version:</p>
<ul>
<li>The JavaScript code you add to your pages references a JavaScript file, like ga.js for GA, and msAnalytics.js for ACA. Those JavaScript files contain a whole set of JavaScript API&#8217;s for web analytics. The code by default uses just one API, like GA&#8217;s pageTracker._trackPageView(), or ACA&#8217;s msAnalytics.TrackPage(). You can add other API calls for more sophisticated analytics scenarios, like msAnalytics.EnableLinkTracking() in above screenshot for tracking outbound referrals. </li>
<li>The JavaScript calls mentioned above generate http requests, usually for a 1&#215;1 transparent gif, (those requests are also called <a href="http://en.wikipedia.org/wiki/Web_bug" target="_blank">web beacon</a>), to the analytic provider&#8217;s log servers. Those http requests contain a lot of information:
<ul>
<li>the web page on your site that issued the http request </li>
<li>the user who is browsing the page, usually identified by <a href="http://en.wikipedia.org/wiki/Web_cookie" target="_blank">cookies</a> </li>
<li>the machine and software the user is using in browsing your page </li>
</ul>
</li>
<li>The web analytics servers have complex logic in analyzing and aggregating information from those logs, together with other online and offline information, and then produce the web analytics for your site, via web site, email, or API. </li>
</ul>
<p>Below screenshots show some of those web analytics http requests in Fiddler and FireBug:</p>
<p><a href="http://www.ningzhang.org/wp-content/uploads/2009/01/image30.png" target="_blank"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="302" alt="GA gif request in Fiddler" src="http://www.ningzhang.org/wp-content/uploads/2009/01/image30-thumb.png" width="604" border="0" /></a></p>
<p><a href="http://www.ningzhang.org/wp-content/uploads/2009/01/image42.png" target="_blank"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="302" alt="ACA xgif request in Fiddler" src="http://www.ningzhang.org/wp-content/uploads/2009/01/image42-thumb.png" width="604" border="0" /></a></p>
<p><a href="http://www.ningzhang.org/wp-content/uploads/2009/01/image91.png"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="539" alt="ACA x.gif request in FireBug" src="http://www.ningzhang.org/wp-content/uploads/2009/01/image9-thumb.png" width="554" border="0" /></a></p>
<h3>Conclusion</h3>
<p>Hopefully this post will help those who haven&#8217;t tried web analytics before to get started in using it. Happy blogging!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ningzhang.org/2009/01/18/quick-introduction-to-web-analytics-for-bloggers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

