<?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>Dot Mac &#187; Uncategorized</title>
	<atom:link href="http://dotmac.rationalmind.net/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://dotmac.rationalmind.net</link>
	<description>Adventures with OS X and DotNet</description>
	<lastBuildDate>Wed, 07 Jul 2010 12:42:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>.Net Graphics: drawing text on a bitmap</title>
		<link>http://dotmac.rationalmind.net/2010/04/net-graphics-drawing-text-on-a-bitmap/</link>
		<comments>http://dotmac.rationalmind.net/2010/04/net-graphics-drawing-text-on-a-bitmap/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 06:50:58 +0000</pubDate>
		<dc:creator>David Veksler</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://dotmac.rationalmind.net/?p=174</guid>
		<description><![CDATA[I use this code here. Graphics backgroundGraphics; backgroundImage = &#40;Bitmap&#41;Image.FromFile&#40;AppDomain.CurrentDomain.BaseDirectory + &#34;\\images\\Header.jpg&#34;&#41;; backgroundGraphics = Graphics.FromImage&#40;backgroundImage&#41;; var font = new Font&#40;&#34;Perpetua Titling MT&#34;, 24F, FontStyle.Regular&#41;; backgroundGraphics.DrawString&#40;authorname.ToUpper&#40;&#41;, font, new SolidBrush&#40;Color.FromArgb&#40;100, 0, 0, 0&#41;&#41;, 10, 5&#41;; Now save &#8211; or output to the browser: backgroundImage.Save&#40;context.Response.OutputStream, ImageFormat.Jpeg&#41;;]]></description>
			<content:encoded><![CDATA[<p>I use this code <a href="http://mises.org/media.aspx?action=author&amp;ID=443">here</a>.</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">Graphics backgroundGraphics<span style="color: #008000;">;</span>
backgroundImage <span style="color: #008000;">=</span> <span style="color: #000000;">&#40;</span>Bitmap<span style="color: #000000;">&#41;</span>Image.<span style="color: #0000FF;">FromFile</span><span style="color: #000000;">&#40;</span>AppDomain.<span style="color: #0000FF;">CurrentDomain</span>.<span style="color: #0000FF;">BaseDirectory</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;<span style="color: #008080; font-weight: bold;">\\</span>images<span style="color: #008080; font-weight: bold;">\\</span>Header.jpg&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
backgroundGraphics <span style="color: #008000;">=</span> Graphics.<span style="color: #0000FF;">FromImage</span><span style="color: #000000;">&#40;</span>backgroundImage<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
var font <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> Font<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Perpetua Titling MT&quot;</span>, 24F, FontStyle.<span style="color: #0000FF;">Regular</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
backgroundGraphics.<span style="color: #0000FF;">DrawString</span><span style="color: #000000;">&#40;</span>authorname.<span style="color: #0000FF;">ToUpper</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, font, <span style="color: #008000;">new</span> SolidBrush<span style="color: #000000;">&#40;</span>Color.<span style="color: #0000FF;">FromArgb</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">100</span>, <span style="color: #FF0000;">0</span>, <span style="color: #FF0000;">0</span>, <span style="color: #FF0000;">0</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>, <span style="color: #FF0000;">10</span>, <span style="color: #FF0000;">5</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div>

<p>Now save &#8211; or output to the browser:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">backgroundImage.<span style="color: #0000FF;">Save</span><span style="color: #000000;">&#40;</span>context.<span style="color: #0000FF;">Response</span>.<span style="color: #0000FF;">OutputStream</span>, ImageFormat.<span style="color: #0000FF;">Jpeg</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://dotmac.rationalmind.net/2010/04/net-graphics-drawing-text-on-a-bitmap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Set the admin color scheme for all WordPress users</title>
		<link>http://dotmac.rationalmind.net/2010/03/set-the-admin-color-scheme-for-all-wordpress-users/</link>
		<comments>http://dotmac.rationalmind.net/2010/03/set-the-admin-color-scheme-for-all-wordpress-users/#comments</comments>
		<pubDate>Sat, 06 Mar 2010 08:32:38 +0000</pubDate>
		<dc:creator>David Veksler</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://dotmac.rationalmind.net/?p=167</guid>
		<description><![CDATA[INSERT INTO wp_usermeta &#40; user_id, meta_key, meta_value &#41; &#40; SELECT id, 'admin_color', 'classic' FROM wp_users WHERE id NOT IN &#40;SELECT user_Id FROM wp_usermeta WHERE meta_key = 'admin_color'&#41; &#41; &#160; UPDATE wp_usermeta SET meta_value = 'classic' WHERE meta_key = 'admin_color']]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> wp_usermeta
<span style="color: #66cc66;">&#40;</span>
user_id<span style="color: #66cc66;">,</span>
meta_key<span style="color: #66cc66;">,</span>
meta_value
<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span>
<span style="color: #993333; font-weight: bold;">SELECT</span> 
id<span style="color: #66cc66;">,</span>
<span style="color: #ff0000;">'admin_color'</span><span style="color: #66cc66;">,</span>
<span style="color: #ff0000;">'classic'</span>
<span style="color: #993333; font-weight: bold;">FROM</span> wp_users
<span style="color: #993333; font-weight: bold;">WHERE</span> id  <span style="color: #993333; font-weight: bold;">NOT</span>  <span style="color: #993333; font-weight: bold;">IN</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> user_Id <span style="color: #993333; font-weight: bold;">FROM</span> wp_usermeta <span style="color: #993333; font-weight: bold;">WHERE</span> meta_key <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'admin_color'</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #993333; font-weight: bold;">UPDATE</span> wp_usermeta <span style="color: #993333; font-weight: bold;">SET</span> meta_value <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'classic'</span> <span style="color: #993333; font-weight: bold;">WHERE</span> meta_key <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'admin_color'</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://dotmac.rationalmind.net/2010/03/set-the-admin-color-scheme-for-all-wordpress-users/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bulk update post slugs in a WordPress blog</title>
		<link>http://dotmac.rationalmind.net/2010/03/bulk-update-post-slugs-in-a-wordpress-blog/</link>
		<comments>http://dotmac.rationalmind.net/2010/03/bulk-update-post-slugs-in-a-wordpress-blog/#comments</comments>
		<pubDate>Sat, 06 Mar 2010 07:25:07 +0000</pubDate>
		<dc:creator>David Veksler</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://dotmac.rationalmind.net/?p=165</guid>
		<description><![CDATA[The following script updates missing post slugs (permalinks) in a WordPress blogs, or reformats them according to your needs: &#34;; &#60; ?php // change this this to strip old slugs if needed: //update wp_posts set post_name = '' where guid like '%.asp' set_time_limit(20000); &#160; /** Loads the WordPress Environment and Template, allowing wp functions like [...]]]></description>
			<content:encoded><![CDATA[<p>The following script updates missing post slugs (permalinks) in a WordPress blogs, or reformats them according to your needs:</p>
<p><span id="more-165"></span></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #0000ff;">&quot;;
&lt; ?php
// change this this to strip old slugs if needed:
//update wp_posts set post_name = '' where guid like '%.asp'
set_time_limit(20000);
&nbsp;
/** Loads the WordPress Environment and Template, allowing wp functions like the_title() */
define('WP_USE_THEMES', false);
require('./wp-blog-header.php');
&nbsp;
function bleach(<span style="color: #006699; font-weight: bold;">$which</span>)
{
    <span style="color: #006699; font-weight: bold;">$result</span> = sanitize_title(get_the_title(<span style="color: #006699; font-weight: bold;">$which</span>));
    return <span style="color: #006699; font-weight: bold;">$result</span>;
}
&nbsp;
<span style="color: #006699; font-weight: bold;">$dbhost</span> = 'data.mises.org';
<span style="color: #006699; font-weight: bold;">$dbuser</span> = 'mises_blog';
<span style="color: #006699; font-weight: bold;">$dbpass</span> = '5u7$^kjW8V';
<span style="color: #006699; font-weight: bold;">$dbname</span> = 'WordPress';
&nbsp;
<span style="color: #006699; font-weight: bold;">$sql</span> = 'SELECT ID, post_title' . ' FROM `wp_posts`' . ' WHERE post_status = &quot;</span>publish<span style="color: #0000ff;">&quot;' . &quot;</span> and post_name <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span> <span style="color: #0000ff;">&quot; . ' order by ID asc';
&nbsp;
<span style="color: #006699; font-weight: bold;">$db</span> = mysql_connect(<span style="color: #006699; font-weight: bold;">$dbhost</span>, <span style="color: #006699; font-weight: bold;">$dbuser</span>, <span style="color: #006699; font-weight: bold;">$dbpass</span>) or die('Could not connect: ' . mysql_error());
mysql_select_db(<span style="color: #006699; font-weight: bold;">$dbname</span>);
&nbsp;
<span style="color: #006699; font-weight: bold;">$result</span> = mysql_query(<span style="color: #006699; font-weight: bold;">$sql</span>) or die('&lt;b&gt;Query failed: ' . mysql_error());
while (<span style="color: #006699; font-weight: bold;">$row</span> = mysql_fetch_array(<span style="color: #006699; font-weight: bold;">$result</span>, MYSQL_ASSOC)) {
    <span style="color: #006699; font-weight: bold;">$id</span>         = <span style="color: #006699; font-weight: bold;">$row</span>['ID'];
    <span style="color: #006699; font-weight: bold;">$title</span>      = <span style="color: #006699; font-weight: bold;">$row</span>['post_title'];
    <span style="color: #006699; font-weight: bold;">$clean_slug</span> = bleach(<span style="color: #006699; font-weight: bold;">$id</span>);
&nbsp;
    echo &quot;</span>ID<span style="color: #339933;">&lt;</span>i<span style="color: #339933;">&gt;:</span><span style="color: #009900;">&#123;</span><span style="color: #000088;">$row</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ID'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#125;</span> <span style="color: #0000ff;">&quot; . &quot;</span>post_title <span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span><span style="color: #000088;">$title</span><span style="color: #009900;">&#125;</span> <span style="color: #0000ff;">&quot; . &quot;</span>sanitized <span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span><span style="color: #000088;">$clean_slug</span><span style="color: #009900;">&#125;</span> <span style="color: #0000ff;">&quot;;
    <span style="color: #006699; font-weight: bold;">$sql_u</span> = &quot;</span>UPDATE `wp_posts` SET post_name <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&quot; . $clean_slug . &quot;'</span> <span style="color: #0000ff;">&quot; . 'WHERE ID = ' . <span style="color: #006699; font-weight: bold;">$id</span>;
    echo '&lt;b&gt;QUERY:&lt;/b&gt;' . <span style="color: #006699; font-weight: bold;">$sql_u</span> . '';
    mysql_query(<span style="color: #006699; font-weight: bold;">$sql_u</span>) or die('ERROR: ' . mysql_error());
    flush();
}
&nbsp;
mysql_close(<span style="color: #006699; font-weight: bold;">$db</span>);
?&gt;
&lt;/i&gt;&lt;/b&gt;</span></pre></div></div>

<p><b><br />
</b></p>
]]></content:encoded>
			<wfw:commentRss>http://dotmac.rationalmind.net/2010/03/bulk-update-post-slugs-in-a-wordpress-blog/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SQL script to migrate from Movable Type to WordPress</title>
		<link>http://dotmac.rationalmind.net/2010/03/sql-script-to-migrate-from-movable-type-to-wordpress/</link>
		<comments>http://dotmac.rationalmind.net/2010/03/sql-script-to-migrate-from-movable-type-to-wordpress/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 06:05:02 +0000</pubDate>
		<dc:creator>David Veksler</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[Movable Type]]></category>
		<category><![CDATA[MySql]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://dotmac.rationalmind.net/?p=145</guid>
		<description><![CDATA[While trying to migrate a large blog from Movable Type to WordPress, I found the built-in export and import functionality unable to handle volume of content on the blog or to properly preserve the primary keys needed for permalinks. With assistance from Alvaro on the MisesDev list, we came up with the following MySql SQL [...]]]></description>
			<content:encoded><![CDATA[<p>While trying to migrate a large blog from <a class="zem_slink" href="http://www.movabletype.com/" title="Movable Type" rel="homepage">Movable Type</a> to <a class="zem_slink" href="http://wordpress.org" title="WordPress" rel="homepage">WordPress</a>, I found the built-in export and import functionality unable to handle volume of content on the blog or to properly preserve the primary keys needed for permalinks.  </p>
<p>With assistance from <a href="http://groups.google.com/group/misesdev/browse_thread/thread/4dc7502b8d363a4e">Alvaro on the MisesDev</a> list, we came up with the following MySql SQL script to import the entries directly from the Movable Type (5.01) database to WordPress (2.9.2).  What would take many hours otherwise can be done in a minute or two.  This is especially important if you don&#8217;t want to lose data during the time it takes to migrate the blog, as the script can be run immediately before the switch.  This script also includes additional stuff like IP addresses and url-friendly names.<br />
<span id="more-145"></span><br />
Change the MT database name in the script below:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;">&nbsp;
<span style="color: #993333; font-weight: bold;">USE</span> <span style="color: #ff0000;">`WordPress`</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">/*  !!! Truncate tables to prevent primary key conflicts !!! */</span>
<span style="color: #993333; font-weight: bold;">TRUNCATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> wp_posts;
<span style="color: #993333; font-weight: bold;">TRUNCATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> wp_comments;
<span style="color: #993333; font-weight: bold;">TRUNCATE</span> <span style="color: #993333; font-weight: bold;">TABLE</span> wp_users;
&nbsp;
<span style="color: #808080; font-style: italic;">/* users from author */</span>
<span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> wp_users <span style="color: #66cc66;">&#40;</span>
ID<span style="color: #66cc66;">,</span>
user_login<span style="color: #66cc66;">,</span>
user_pass<span style="color: #66cc66;">,</span>
user_nicename<span style="color: #66cc66;">,</span>
user_email<span style="color: #66cc66;">,</span>
user_url<span style="color: #66cc66;">,</span>
user_registered<span style="color: #66cc66;">,</span>
<span style="color: #808080; font-style: italic;">/* user_activation_key, */</span>
user_status<span style="color: #66cc66;">,</span>
display_name
&nbsp;
<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span>
author_id<span style="color: #66cc66;">,</span>
author_name<span style="color: #66cc66;">,</span>
author_password<span style="color: #66cc66;">,</span> <span style="color: #808080; font-style: italic;">/* fingers crossed */</span>
<span style="color: #993333; font-weight: bold;">IF</span> <span style="color: #66cc66;">&#40;</span>author_basename <span style="color: #993333; font-weight: bold;">IS</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>author_basename<span style="color: #66cc66;">,</span>author_name<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">,</span>
author_email<span style="color: #66cc66;">,</span>
<span style="color: #993333; font-weight: bold;">IF</span> <span style="color: #66cc66;">&#40;</span>author_url <span style="color: #993333; font-weight: bold;">IS</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>author_url<span style="color: #66cc66;">,</span><span style="color: #ff0000;">' '</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
author_created_on<span style="color: #66cc66;">,</span>
<span style="color: #808080; font-style: italic;">/* user_activation_key, */</span>
author_status<span style="color: #66cc66;">,</span> 
<span style="color: #993333; font-weight: bold;">IF</span> <span style="color: #66cc66;">&#40;</span>author_nickname <span style="color: #993333; font-weight: bold;">IS</span> <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">NULL</span><span style="color: #66cc66;">,</span>author_nickname<span style="color: #66cc66;">,</span>author_name<span style="color: #66cc66;">&#41;</span> 
 <span style="color: #993333; font-weight: bold;">FROM</span> mtutf<span style="color: #66cc66;">.</span>mt_author<span style="color: #66cc66;">&#41;</span>; 
&nbsp;
<span style="color: #808080; font-style: italic;">/*  post from entry */</span>
<span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> wp_posts <span style="color: #66cc66;">&#40;</span>
ID<span style="color: #66cc66;">,</span>
post_author<span style="color: #66cc66;">,</span>
post_date<span style="color: #66cc66;">,</span>
post_date_gmt<span style="color: #66cc66;">,</span>
post_content<span style="color: #66cc66;">,</span>
post_title<span style="color: #66cc66;">,</span>
post_excerpt<span style="color: #66cc66;">,</span>
post_status<span style="color: #66cc66;">,</span>
comment_status<span style="color: #66cc66;">,</span>
ping_status<span style="color: #66cc66;">,</span>
<span style="color: #808080; font-style: italic;">/* post_password  */</span>
post_name<span style="color: #66cc66;">,</span>
post_modified<span style="color: #66cc66;">,</span>
post_modified_gmt<span style="color: #66cc66;">,</span> <span style="color: #808080; font-style: italic;">/* --post_modified_gmt,  */</span>
<span style="color: #808080; font-style: italic;">/* --post_content_filter,  */</span>
<span style="color: #808080; font-style: italic;">/* --post_parent,  */</span>
<span style="color: #808080; font-style: italic;">/* --guid,  */</span>
<span style="color: #808080; font-style: italic;">/* --menu_order,  */</span>
<span style="color: #808080; font-style: italic;">/* --post_type,  */</span>
<span style="color: #808080; font-style: italic;">/* --post_mime_type,  */</span>
comment_count<span style="color: #66cc66;">,</span>
to_ping<span style="color: #66cc66;">,</span>
pinged  
<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#40;</span>
<span style="color: #993333; font-weight: bold;">SELECT</span>
entry_id<span style="color: #66cc66;">,</span>
entry_author_id<span style="color: #66cc66;">,</span>
entry_created_on<span style="color: #66cc66;">,</span>
CONVERT_TZ<span style="color: #66cc66;">&#40;</span>entry_created_on<span style="color: #66cc66;">,</span><span style="color: #ff0000;">'+00:00'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'-06:00'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span> <span style="color: #808080; font-style: italic;">/* GMT */</span>
CONCAT<span style="color: #66cc66;">&#40;</span>entry_text<span style="color: #66cc66;">,</span><span style="color: #ff0000;">'&lt;!--more--&gt;'</span><span style="color: #66cc66;">,</span>entry_text_more<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">,</span>
entry_title<span style="color: #66cc66;">,</span>
entry_excerpt<span style="color: #66cc66;">,</span>
TRIM<span style="color: #66cc66;">&#40;</span>CAST<span style="color: #66cc66;">&#40;</span>entry_status <span style="color: #993333; font-weight: bold;">AS</span> CHAR<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
TRIM<span style="color: #66cc66;">&#40;</span>CAST<span style="color: #66cc66;">&#40;</span>entry_allow_comments <span style="color: #993333; font-weight: bold;">AS</span> CHAR<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
TRIM<span style="color: #66cc66;">&#40;</span>CAST<span style="color: #66cc66;">&#40;</span>entry_allow_pings <span style="color: #993333; font-weight: bold;">AS</span> CHAR<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
<span style="color: #808080; font-style: italic;">/* --post_password  */</span>
entry_basename<span style="color: #66cc66;">,</span>
<span style="color: #808080; font-style: italic;">/* --to_ping  */</span>
<span style="color: #808080; font-style: italic;">/* --pinged  */</span>
entry_modified_on<span style="color: #66cc66;">,</span>
CONVERT_TZ<span style="color: #66cc66;">&#40;</span>entry_modified_on<span style="color: #66cc66;">,</span><span style="color: #ff0000;">'+00:00'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'-06:00'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span> <span style="color: #808080; font-style: italic;">/* -- post_modified_gmt,  */</span>
<span style="color: #808080; font-style: italic;">/* --post_content_filter,  */</span>
<span style="color: #808080; font-style: italic;">/* --post_parent,  */</span>
<span style="color: #808080; font-style: italic;">/* --guid,  */</span>
<span style="color: #808080; font-style: italic;">/* --menu_order,  */</span>
<span style="color: #808080; font-style: italic;">/* --post_type,  */</span>
<span style="color: #808080; font-style: italic;">/* --post_mime_type,  */</span>
entry_comment_count<span style="color: #66cc66;">,</span>
<span style="color: #ff0000;">''</span><span style="color: #66cc66;">,</span>
<span style="color: #ff0000;">''</span>
 <span style="color: #993333; font-weight: bold;">FROM</span> mtutf<span style="color: #66cc66;">.</span>mt_entry<span style="color: #66cc66;">&#41;</span>;
&nbsp;
&nbsp;
<span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> wp_comments <span style="color: #66cc66;">&#40;</span>
comment_ID<span style="color: #66cc66;">,</span>
comment_post_ID<span style="color: #66cc66;">,</span>
comment_author<span style="color: #66cc66;">,</span>
comment_author_email<span style="color: #66cc66;">,</span>
comment_author_url<span style="color: #66cc66;">,</span>
comment_author_IP<span style="color: #66cc66;">,</span>
comment_date<span style="color: #66cc66;">,</span>
comment_date_gmt<span style="color: #66cc66;">,</span>
comment_content<span style="color: #66cc66;">,</span>
<span style="color: #808080; font-style: italic;">/* comment_karma, junk_score? */</span>
<span style="color: #808080; font-style: italic;">/* comment_approved, comment_junk_status?? */</span>
<span style="color: #808080; font-style: italic;">/* comment_agent, */</span>
<span style="color: #808080; font-style: italic;">/* comment_type, */</span>
comment_parent<span style="color: #66cc66;">,</span>
user_id
 <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#40;</span> <span style="color: #993333; font-weight: bold;">SELECT</span>
comment_id<span style="color: #66cc66;">,</span>
comment_entry_id<span style="color: #66cc66;">,</span>
comment_author<span style="color: #66cc66;">,</span>
comment_email<span style="color: #66cc66;">,</span>
comment_url<span style="color: #66cc66;">,</span>
comment_ip<span style="color: #66cc66;">,</span>
comment_created_on<span style="color: #66cc66;">,</span>
CONVERT_TZ<span style="color: #66cc66;">&#40;</span>comment_created_on<span style="color: #66cc66;">,</span><span style="color: #ff0000;">'+00:00'</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'-06:00'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span> <span style="color: #808080; font-style: italic;">/* comment_date_gmt, */</span>
comment_text<span style="color: #66cc66;">,</span>
<span style="color: #808080; font-style: italic;">/* comment_karma, */</span>
<span style="color: #808080; font-style: italic;">/* comment_approved, */</span>
<span style="color: #808080; font-style: italic;">/* comment_agent, */</span>
<span style="color: #808080; font-style: italic;">/* comment_type, */</span>
comment_parent_id<span style="color: #66cc66;">,</span>
comment_created_by
 <span style="color: #993333; font-weight: bold;">FROM</span> mtutf<span style="color: #66cc66;">.</span>mt_comment <span style="color: #993333; font-weight: bold;">WHERE</span> comment_junk_status <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
&nbsp;
<span style="color: #993333; font-weight: bold;">UPDATE</span> wp_posts <span style="color: #993333; font-weight: bold;">SET</span> post_status <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'publish'</span><span style="color: #66cc66;">,</span> comment_status<span style="color: #66cc66;">=</span><span style="color: #ff0000;">'open'</span><span style="color: #66cc66;">,</span> ping_status<span style="color: #66cc66;">=</span><span style="color: #ff0000;">'open'</span>;
&nbsp;
<span style="color: #808080; font-style: italic;">/*  More... */</span>
&nbsp;
<span style="color: #993333; font-weight: bold;">UPDATE</span> 
wordpress<span style="color: #66cc66;">.</span>wp_posts<span style="color: #66cc66;">,</span> mises_blog<span style="color: #66cc66;">.</span>mt_entry
&nbsp;
<span style="color: #993333; font-weight: bold;">SET</span> post_content <span style="color: #66cc66;">=</span> CONCAT<span style="color: #66cc66;">&#40;</span>CONCAT<span style="color: #66cc66;">&#40;</span>entry_text<span style="color: #66cc66;">,</span><span style="color: #ff0000;">'&lt;!--more--&gt;'</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span> entry_text_more<span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #993333; font-weight: bold;">WHERE</span> LENGTH<span style="color: #66cc66;">&#40;</span>entry_text_more<span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&gt;</span> <span style="color: #cc66cc;">0</span> 
<span style="color: #993333; font-weight: bold;">AND</span> 
mises_blog<span style="color: #66cc66;">.</span>mt_entry<span style="color: #66cc66;">.</span>entry_id <span style="color: #66cc66;">=</span> wp_posts<span style="color: #66cc66;">.</span>id
&nbsp;
&nbsp;
<span style="color: #808080; font-style: italic;">/* Specific to our DB: */</span>
&nbsp;
<span style="color: #993333; font-weight: bold;">UPDATE</span> wordpress<span style="color: #66cc66;">.</span>wp_posts <span style="color: #993333; font-weight: bold;">SET</span> guid <span style="color: #66cc66;">=</span> CONCAT<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'http://blog.mises.org/archives/'</span><span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">RIGHT</span><span style="color: #66cc66;">&#40;</span>CONCAT<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'000000'</span><span style="color: #66cc66;">,</span> ID<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">6</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span> <span style="color: #ff0000;">&quot;.asp&quot;</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
&nbsp;
<span style="color: #808080; font-style: italic;">/* Set User Contributor Levels */</span>
&nbsp;
<span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> wp_usermeta
<span style="color: #66cc66;">&#40;</span>
user_id<span style="color: #66cc66;">,</span>
meta_key<span style="color: #66cc66;">,</span>
meta_value
<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span>
<span style="color: #993333; font-weight: bold;">SELECT</span> 
id<span style="color: #66cc66;">,</span>
<span style="color: #ff0000;">'wp_user_level'</span><span style="color: #66cc66;">,</span>
<span style="color: #cc66cc;">1</span>
<span style="color: #993333; font-weight: bold;">FROM</span> wp_users
<span style="color: #993333; font-weight: bold;">WHERE</span> id  <span style="color: #993333; font-weight: bold;">NOT</span>  <span style="color: #993333; font-weight: bold;">IN</span> <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">295</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">3</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#41;</span>;
&nbsp;
<span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> wp_usermeta
<span style="color: #66cc66;">&#40;</span>
user_id<span style="color: #66cc66;">,</span>
meta_key<span style="color: #66cc66;">,</span>
meta_value
<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span>
<span style="color: #993333; font-weight: bold;">SELECT</span> 
id<span style="color: #66cc66;">,</span>
<span style="color: #ff0000;">'nickname'</span><span style="color: #66cc66;">,</span>
display_name
<span style="color: #993333; font-weight: bold;">FROM</span> wp_users
<span style="color: #993333; font-weight: bold;">WHERE</span> id  <span style="color: #993333; font-weight: bold;">NOT</span>  <span style="color: #993333; font-weight: bold;">IN</span> <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">3</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">295</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#41;</span>
&nbsp;
<span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> wp_usermeta
<span style="color: #66cc66;">&#40;</span>
user_id<span style="color: #66cc66;">,</span>
meta_key<span style="color: #66cc66;">,</span>
meta_value
<span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#40;</span>
<span style="color: #993333; font-weight: bold;">SELECT</span> 
id<span style="color: #66cc66;">,</span>
<span style="color: #ff0000;">'wp_capabilities'</span><span style="color: #66cc66;">,</span>
meta_value <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'a:1:{s:6:&quot;author&quot;;b:1;}'</span> 
<span style="color: #993333; font-weight: bold;">FROM</span> wp_users
<span style="color: #993333; font-weight: bold;">WHERE</span> id  <span style="color: #993333; font-weight: bold;">NOT</span>  <span style="color: #993333; font-weight: bold;">IN</span> <span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">295</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">3</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #66cc66;">&#41;</span></pre></div></div>

<div class="zemanta-pixie"><a class="zemanta-pixie-a" href="http://reblog.zemanta.com/zemified/394ce66e-aa4c-41a7-938f-79c4cef70b8f/" title="Reblog this post [with Zemanta]"><img class="zemanta-pixie-img" src="http://img.zemanta.com/reblog_e.png?x-id=394ce66e-aa4c-41a7-938f-79c4cef70b8f" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related pretty-attribution"><script type="text/javascript" src="http://static.zemanta.com/readside/loader.js" defer="defer"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://dotmac.rationalmind.net/2010/03/sql-script-to-migrate-from-movable-type-to-wordpress/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Luhn algorithm validation via a CustomValidator control</title>
		<link>http://dotmac.rationalmind.net/2010/02/luhn-algorithm-validation-via-a-customvalidator-control/</link>
		<comments>http://dotmac.rationalmind.net/2010/02/luhn-algorithm-validation-via-a-customvalidator-control/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 05:25:43 +0000</pubDate>
		<dc:creator>David Veksler</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[DotNet]]></category>

		<guid isPermaLink="false">http://dotmac.rationalmind.net/?p=131</guid>
		<description><![CDATA[The Luhn algorithm is a checksum used for credit cards and many other identifying numbers as a basic integrity validation check.  It&#8217;s useful for credit card forms because it avoids unneeded transaction attempts when card numbers are mis-typed. It&#8217;s easy to add an account # Luhn checksum validation control to credit card forms in ASP.Net: [...]]]></description>
			<content:encoded><![CDATA[<div>The <a href="http://en.wikipedia.org/wiki/Luhn_algorithm">Luhn algorithm</a> is a checksum used for credit cards and many other identifying numbers as a basic integrity validation check.  It&#8217;s useful for credit card forms because it avoids unneeded transaction attempts when card numbers are mis-typed.<br />
It&#8217;s easy to add an account # Luhn checksum validation control to credit card forms in ASP.Net:</div>
<ul>
<li><a href="http://www.codeguru.com/csharp/.net/net_security/authentication/article.php/c12283/">Add this method</a> to your business logic.</li>
<li>Add a &lt;asp:CustomValidator  &#8230; /&gt; control with the error message, target control, etc.</li>
<li>Add and wire up a <em>void ServerValidation <span style="font-style: normal;">method</span><strong>:</strong></em></li>
</ul>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">void</span> ServerValidation<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">object</span> source, ServerValidateEventArgs args<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
<span style="color: #008080; font-style: italic;">// use a RequiredFieldValidator to check for an empty value</span>
 <span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>txtCardNum.<span style="color: #0000FF;">Text</span> <span style="color: #008000;">==</span> <span style="color: #FF0000;">string</span>.<span style="color: #0000FF;">Empty</span><span style="color: #000000;">&#41;</span> args.<span style="color: #0000FF;">IsValid</span> <span style="color: #008000;">=</span> true<span style="color: #008000;">;</span>
 args.<span style="color: #0000FF;">IsValid</span> <span style="color: #008000;">=</span> IsCreditCardValid<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">txtCardNum</span>.<span style="color: #0000FF;">Text</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #0600FF;">protected</span> <span style="color: #0600FF;">override</span> <span style="color: #0600FF;">void</span> OnInit<span style="color: #000000;">&#40;</span>EventArgs e<span style="color: #000000;">&#41;</span>    <span style="color: #000000;">&#123;</span>
 <span style="color: #0600FF;">base</span>.<span style="color: #0000FF;">OnInit</span><span style="color: #000000;">&#40;</span>e<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
 valLunCode.<span style="color: #0000FF;">ServerValidate</span> <span style="color: #008000;">+=</span> ServerValidation<span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

<ul>
<li> (Optional:) For client-side code, use a Javascript version from <a href="http://en.wikipedia.org/wiki/Luhn_algorithm">here.</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://dotmac.rationalmind.net/2010/02/luhn-algorithm-validation-via-a-customvalidator-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quickly open an app in Terminal</title>
		<link>http://dotmac.rationalmind.net/2009/11/quickly-open-an-app-in-terminal/</link>
		<comments>http://dotmac.rationalmind.net/2009/11/quickly-open-an-app-in-terminal/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 04:39:28 +0000</pubDate>
		<dc:creator>David Veksler</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Terminal]]></category>

		<guid isPermaLink="false">http://dotmac.rationalmind.net/?p=129</guid>
		<description><![CDATA[To open an app in terminal, type open -a AppName or open /Applications/AppName.app if you want to specify the path. I use it for starting VNC server via SSH. Bonus:  echo &#8220;set completion-ignore-case On&#8221; &#62; ~/.inputrc will make auto-completion case-insensitive.]]></description>
			<content:encoded><![CDATA[<p>To open an app in terminal, type open <em>-a AppName</em> or <em>open /Applications/AppName.app</em> if you want to specify the path. I use it for starting VNC server via SSH.</p>
<p>Bonus:  <em>echo &#8220;set completion-ignore-case On&#8221; &gt; ~/.inputrc</em> will make auto-completion case-insensitive.</p>
]]></content:encoded>
			<wfw:commentRss>http://dotmac.rationalmind.net/2009/11/quickly-open-an-app-in-terminal/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Correct photo orientation using EXIF data with C#</title>
		<link>http://dotmac.rationalmind.net/2009/08/correct-photo-orientation-using-exif/</link>
		<comments>http://dotmac.rationalmind.net/2009/08/correct-photo-orientation-using-exif/#comments</comments>
		<pubDate>Tue, 25 Aug 2009 22:43:55 +0000</pubDate>
		<dc:creator>David Veksler</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[EXIF]]></category>
		<category><![CDATA[photos]]></category>

		<guid isPermaLink="false">http://dotmac.rationalmind.net/?p=118</guid>
		<description><![CDATA[When processing photos, sometimes you want to re-orient the photo according the orientation recorded by the camera (such as the iPhone&#8217;s accelerometer) and stored in the EXIF meta data.  It&#8217;s easy to do: // Rotate the image according to EXIF data var bmp = new Bitmap&#40;pathToImageFile&#41;; var exif = new EXIFextractor&#40;ref bmp, &#34;\n&#34;&#41;; // get [...]]]></description>
			<content:encoded><![CDATA[<p>When processing photos, sometimes you want to re-orient the photo according the orientation recorded by the camera (such as the iPhone&#8217;s accelerometer) and stored in the EXIF meta data.  It&#8217;s easy to do:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #008080; font-style: italic;">// Rotate the image according to EXIF data</span>
var bmp <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> Bitmap<span style="color: #000000;">&#40;</span>pathToImageFile<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
var exif <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> EXIFextractor<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">ref</span> bmp, <span style="color: #666666;">&quot;<span style="color: #008080; font-weight: bold;">\n</span>&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span> <span style="color: #008080; font-style: italic;">// get source from http://www.codeproject.com/KB/graphics/exifextractor.aspx?fid=207371</span>
&nbsp;
<span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>exif<span style="color: #000000;">&#91;</span><span style="color: #666666;">&quot;Orientation&quot;</span><span style="color: #000000;">&#93;</span> <span style="color: #008000;">!=</span> <span style="color: #0600FF;">null</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
RotateFlipType flip <span style="color: #008000;">=</span> OrientationToFlipType<span style="color: #000000;">&#40;</span>exif<span style="color: #000000;">&#91;</span><span style="color: #666666;">&quot;Orientation&quot;</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">ToString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #0600FF;">if</span> <span style="color: #000000;">&#40;</span>flip <span style="color: #008000;">!=</span> RotateFlipType.<span style="color: #0000FF;">RotateNoneFlipNone</span><span style="color: #000000;">&#41;</span> <span style="color: #008080; font-style: italic;">// don't flip of orientation is correct</span>
<span style="color: #000000;">&#123;</span>
bmp.<span style="color: #0000FF;">RotateFlip</span><span style="color: #000000;">&#40;</span>flip<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
exif.<span style="color: #0000FF;">setTag</span><span style="color: #000000;">&#40;</span>0x112, <span style="color: #666666;">&quot;1&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span> <span style="color: #008080; font-style: italic;">// Optional: reset orientation tag</span>
bmp.<span style="color: #0000FF;">Save</span><span style="color: #000000;">&#40;</span>pathToImageFile, ImageFormat.<span style="color: #0000FF;">Jpeg</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span>
&nbsp;
<span style="color: #008080; font-style: italic;">// Match the orientation code to the correct rotation:</span>
&nbsp;
<span style="color: #0600FF;">private</span> <span style="color: #0600FF;">static</span> RotateFlipType OrientationToFlipType<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span> orientation<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
<span style="color: #0600FF;">switch</span> <span style="color: #000000;">&#40;</span><span style="color: #FF0000;">int</span>.<span style="color: #0000FF;">Parse</span><span style="color: #000000;">&#40;</span>orientation<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
<span style="color: #0600FF;">case</span> <span style="color: #FF0000;">1</span><span style="color: #008000;">:</span>
<span style="color: #0600FF;">return</span> RotateFlipType.<span style="color: #0000FF;">RotateNoneFlipNone</span><span style="color: #008000;">;</span>
break<span style="color: #008000;">;</span>
<span style="color: #0600FF;">case</span> <span style="color: #FF0000;">2</span><span style="color: #008000;">:</span>
<span style="color: #0600FF;">return</span> RotateFlipType.<span style="color: #0000FF;">RotateNoneFlipX</span><span style="color: #008000;">;</span>
break<span style="color: #008000;">;</span>
<span style="color: #0600FF;">case</span> <span style="color: #FF0000;">3</span><span style="color: #008000;">:</span>
<span style="color: #0600FF;">return</span> RotateFlipType.<span style="color: #0000FF;">Rotate180FlipNone</span><span style="color: #008000;">;</span>
break<span style="color: #008000;">;</span>
<span style="color: #0600FF;">case</span> <span style="color: #FF0000;">4</span><span style="color: #008000;">:</span>
<span style="color: #0600FF;">return</span> RotateFlipType.<span style="color: #0000FF;">Rotate180FlipX</span><span style="color: #008000;">;</span>
break<span style="color: #008000;">;</span>
<span style="color: #0600FF;">case</span> <span style="color: #FF0000;">5</span><span style="color: #008000;">:</span>
<span style="color: #0600FF;">return</span> RotateFlipType.<span style="color: #0000FF;">Rotate90FlipX</span><span style="color: #008000;">;</span>
break<span style="color: #008000;">;</span>
<span style="color: #0600FF;">case</span> <span style="color: #FF0000;">6</span><span style="color: #008000;">:</span>
<span style="color: #0600FF;">return</span> RotateFlipType.<span style="color: #0000FF;">Rotate90FlipNone</span><span style="color: #008000;">;</span>
break<span style="color: #008000;">;</span>
<span style="color: #0600FF;">case</span> <span style="color: #FF0000;">7</span><span style="color: #008000;">:</span>
<span style="color: #0600FF;">return</span> RotateFlipType.<span style="color: #0000FF;">Rotate270FlipX</span><span style="color: #008000;">;</span>
break<span style="color: #008000;">;</span>
<span style="color: #0600FF;">case</span> <span style="color: #FF0000;">8</span><span style="color: #008000;">:</span>
<span style="color: #0600FF;">return</span> RotateFlipType.<span style="color: #0000FF;">Rotate270FlipNone</span><span style="color: #008000;">;</span>
break<span style="color: #008000;">;</span>
<span style="color: #0600FF;">default</span><span style="color: #008000;">:</span>
<span style="color: #0600FF;">return</span> RotateFlipType.<span style="color: #0000FF;">RotateNoneFlipNone</span><span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://dotmac.rationalmind.net/2009/08/correct-photo-orientation-using-exif/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Xcode All-In-One View</title>
		<link>http://dotmac.rationalmind.net/2009/05/xcode-all-in-one-view/</link>
		<comments>http://dotmac.rationalmind.net/2009/05/xcode-all-in-one-view/#comments</comments>
		<pubDate>Fri, 15 May 2009 22:57:19 +0000</pubDate>
		<dc:creator>David Veksler</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[page menu]]></category>
		<category><![CDATA[page toggle]]></category>
		<category><![CDATA[Xcode]]></category>

		<guid isPermaLink="false">http://dotmac.rationalmind.net/?p=112</guid>
		<description><![CDATA[One thing I don&#8217;t like about the default Xcode layout is that all the views &#8211; code, debug, console, find, etc open in new windows by default. If you&#8217;d rather not manage a bunch of Xcode windows all the time,  Xcode has a &#8220;hidden&#8221; All-One-One view which shows all your views in a single window [...]]]></description>
			<content:encoded><![CDATA[<p>One thing I don&#8217;t like about the default Xcode layout is that all the views &#8211; code, debug, console, find, etc open in new windows by default.</p>
<p>If you&#8217;d rather not manage a bunch of Xcode windows all the time,  Xcode has a &#8220;hidden&#8221; All-One-One view which shows all your views in a single window and ads a page toggle which conveniently switched between code and debugging toolbars.  You can access under Preferences &#8211; General &#8211; Layout.  This took me a long time to figure out because the Layout dropdown is disabled when a project is open.  Maybe it&#8217;s my Visual Studio background, but I like the integrated view much better.</p>
<p><img class="aligncenter size-full wp-image-113" title="xcode_allinone" src="http://dotmac.rationalmind.net/wp-content/uploads/2009/05/xcode_allinone.png" alt="xcode_allinone" width="100%" /></p>
]]></content:encoded>
			<wfw:commentRss>http://dotmac.rationalmind.net/2009/05/xcode-all-in-one-view/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Switching from the Windows to the Mac version of Picasa</title>
		<link>http://dotmac.rationalmind.net/2009/03/switching-from-the-windows-to-the-mac-version-of-picasa/</link>
		<comments>http://dotmac.rationalmind.net/2009/03/switching-from-the-windows-to-the-mac-version-of-picasa/#comments</comments>
		<pubDate>Tue, 24 Mar 2009 04:37:16 +0000</pubDate>
		<dc:creator>David Veksler</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[picasa]]></category>

		<guid isPermaLink="false">http://dotmac.rationalmind.net/?p=110</guid>
		<description><![CDATA[When I migrated my Picasa photo collection from Windows to Mac, I didn&#8217;t realize that the folder created when you save your changes changed from Originals to .picasaoriginals. To rename all the folders created with the Windows version, run this in terminal: find . -name Originals -type d -execdir mv &#8216;{}&#8217; \.picasaoriginals \;]]></description>
			<content:encoded><![CDATA[<p>When I migrated my Picasa photo collection from Windows to Mac, I didn&#8217;t realize that the folder created when you save your changes changed from Originals to .picasaoriginals.  To rename all the folders created with the Windows version, run this in terminal:</p>
<blockquote><p>find . -name Originals -type d -execdir mv &#8216;{}&#8217; \.picasaoriginals  \;</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://dotmac.rationalmind.net/2009/03/switching-from-the-windows-to-the-mac-version-of-picasa/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sorting artists by first/last name in iTunes</title>
		<link>http://dotmac.rationalmind.net/2009/02/sorting-itunes/</link>
		<comments>http://dotmac.rationalmind.net/2009/02/sorting-itunes/#comments</comments>
		<pubDate>Tue, 24 Feb 2009 22:49:30 +0000</pubDate>
		<dc:creator>David Veksler</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[iTunes]]></category>
		<category><![CDATA[sorting]]></category>

		<guid isPermaLink="false">http://dotmac.rationalmind.net/?p=99</guid>
		<description><![CDATA[Until today, I was very confused by the fact that iTunes sorted some of my artists by last name and some by first name.  Then I figured out why &#8211; when editing the mp3/aac meta tags, you can specify custom sort fields.  To change the sort field, select one or more songs, right click and [...]]]></description>
			<content:encoded><![CDATA[<p><img class="size-medium wp-image-100 alignright" title="picture-1" src="http://dotmac.rationalmind.net/wp-content/uploads/2009/02/picture-1-300x205.png" alt="picture-1" width="300" height="205" align="right" />Until today, I was very confused by the fact that iTunes sorted some of my artists by last name and some by first name.  Then I figured out why &#8211; when editing the mp3/aac meta tags, you can specify custom sort fields.  To change the sort field, select one or more songs, right click and Get Info.  Then select a sort artist or other sort fields in the Sorting tab.</p>
]]></content:encoded>
			<wfw:commentRss>http://dotmac.rationalmind.net/2009/02/sorting-itunes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
