<?xml version="1.0" encoding="UTF-8"?><!-- generator="WordPress/2.9.2" -->
<rss version="0.92">
<channel>
	<title>solutions.hans-eric.com</title>
	<link>http://solutions.hans-eric.com</link>
	<description>Hans-Eric Grönlund's Log of Solutions to Technical Problems</description>
	<lastBuildDate>Fri, 23 Apr 2010 07:39:00 +0000</lastBuildDate>
	<docs>http://backend.userland.com/rss092</docs>
	<language>en</language>
	
	<item>
		<title>UNC Paths in Windows Command Shell</title>
		<description><![CDATA[Problem:
Copy and other command shell commands don&#8217;t work with UNC paths, i.e. \\server\dir.
Solution:
Use pushd &#60;path&#62; to temporarily assign a drive letter and map it to the path.
pushd \\server\rootfolder\subfolder
When done, use popd to unmap the letter.
]]></description>
		<link>http://solutions.hans-eric.com/unc-paths-in-windows-command-shell</link>
			</item>
	<item>
		<title>Extracting date and time from text using Ruby</title>
		<description><![CDATA[Problem:
We want to extract a date and time of the format YYYY-MM-DD MM:SS from a body of text using Ruby.
Solution:
This is extremely easy in ruby, and other languages that features regular expressions.

require "Date"

text = "Some text containing a date and a time, for instance 2010-03-19 17:25."

if text =~ /(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2})/
  dt = DateTime.new($1.to_i, $2.to_i, [...]]]></description>
		<link>http://solutions.hans-eric.com/extracting-date-and-time-from-text-using-ruby</link>
			</item>
	<item>
		<title>Upgrading a Customized Wordpress Theme</title>
		<description><![CDATA[Problem:
You&#8217;re using a third party wordpress theme but have made changes to customize it for your own needs (changed a picture, added advertising, etc.). When the third party releases an upgrade to the theme you&#8217;d like to upgrade but don&#8217;t want to lose your changes.
Solution:
Let your version management system move your changes over to the [...]]]></description>
		<link>http://solutions.hans-eric.com/upgrading-a-customized-wordpress-theme</link>
			</item>
	<item>
		<title>Adding Linebreaks in C#</title>
		<description><![CDATA[Problem:
We want to insert linebreak character sequences into a string in C#. 
Solution:
The platform safe way of doing this is by using the Environment.NewLine property.

msg = "An error occurred: " + Environment.NewLine + e.Message;

Composing a string with more than one line break can become really messy, so using string.Format might be a good idea.

msg = string.Format("{1} An [...]]]></description>
		<link>http://solutions.hans-eric.com/adding-linebreaks-in-c</link>
			</item>
	<item>
		<title>Dynamic Updating of Action Visibilities</title>
		<description><![CDATA[Problem: You want to change an action&#8217;s visible property and does so in its OnUpdate event handler, but it doesn&#8217;t seem to work. Once an action is hidden it can&#8217;t seem to become visible again.   Solution: By design Delphi won&#8217;t invoke OnUpdate event handlers for actions that have their Visible property set to false. [...]]]></description>
		<link>http://solutions.hans-eric.com/dynamic-updating-of-action-visibilities</link>
			</item>
	<item>
		<title>How To Create a Tray Icon Controlled Application in Delphi</title>
		<description><![CDATA[Problem:
We want to create a System Tray Icon featured application that doesn&#8217;t shut down when the user closes the main window. Instead, the form simply hides and is reactivated when the user clicks the associated tray icon.
Solution:
Tested in Delphi 2009.
1. Hide the main form.
Since closing the main form automatically terminates the application we need to [...]]]></description>
		<link>http://solutions.hans-eric.com/how-to-create-a-tray-icon-controlled-application-in-delphi</link>
			</item>
	<item>
		<title>Rounding off floating point numbers in Ruby</title>
		<description><![CDATA[Problem:
If you want to round a floating point number off to two decimals, there is no standard method in Ruby that does it for you.
Solution:
The general solution is
(f * 10**d).round.to_f / 10**d
where f is the floating number and d is the number of decimals.
See my code sample for adding this functionality to the Float class.
Although [...]]]></description>
		<link>http://solutions.hans-eric.com/rounding-off-floating-point-numbers-in-ruby</link>
			</item>
	<item>
		<title>Turn On ArcSDE Logging</title>
		<description><![CDATA[Problem:
You want to log the traffic between the client (i.e. ArcMap) and an ArcSDE database.
Solution:
In the Command Window, write:
&#62;set SDEINTERCEPTLOC = c:\tempclient
&#62;c:\program files\arcgis\bin\arcmap.exe
It&#8217;s important to start the client (ArcMap in the above example) from the command prompt. ArcMap will intercept the traffic and log it to temp files, named like this:
c:\tempclient.001, c:\tempclient.002, and so on.
]]></description>
		<link>http://solutions.hans-eric.com/turn-on-arcsde-logging</link>
			</item>
	<item>
		<title>Migrations and Environments in Ruby on Rails</title>
		<description><![CDATA[Problem:
You want to migrate a target environment other than development.
Solution:
For production:
&#62;rake environment RAILS_ENV=production migrate
For test:
&#62;rake environment RAILS_ENV=test migrate
]]></description>
		<link>http://solutions.hans-eric.com/ruby-on-rails-migrations-and-environments</link>
			</item>
	<item>
		<title>Redirect Pages in Wordpress</title>
		<description><![CDATA[Problem
I want to move a page in a WordPress site to a different location, but I still want the old address to be active and instead redirect to the new address.
Solution
Unfortunatelly as per WordPress 2.7 there isn&#8217;t any standard functionallity to accomplish this, so the easiest way to go is to use plugins.
I use Paul [...]]]></description>
		<link>http://solutions.hans-eric.com/redirect-pages-in-wordpress</link>
			</item>
</channel>
</rss>
