<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Dot Mac</title>
	
	<link>http://dotmac.rationalmind.net</link>
	<description>Adventures with OS X and DotNet</description>
	<lastBuildDate>Tue, 09 Mar 2010 00:33:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/dotmacblog" /><feedburner:info uri="dotmacblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Response.Redirect and 302 and 301 status codes</title>
		<link>http://feedproxy.google.com/~r/dotmacblog/~3/zjmIEwF-4hc/</link>
		<comments>http://dotmac.rationalmind.net/2010/03/response-redirect-and-302-and-301-status-codes/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 00:32:13 +0000</pubDate>
		<dc:creator>David Veksler</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://dotmac.rationalmind.net/?p=170</guid>
		<description>If you use Response.Redirect to direct users to a new location, you should be aware that it issues a status code of 302, which means that &amp;#8220;the resource resides temporarily under a different URI.&amp;#8221;  If you intend to communicate that the resource has permanently changed locations, you should not use Response.Redirect.  This is [...]</description>
			<content:encoded><![CDATA[<p>If you use Response.Redirect to direct users to a new location, you should be aware that it issues a status code of 302, <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html">which mean</a>s that &#8220;the resource resides temporarily under a different URI.&#8221;  If you intend to communicate that the resource has <em>permanently</em> changed locations, you should <em>not</em> use Response.Redirect.  This is important for search engines and other crawlers that might need to know the definitive url.</p>
<p>To send a 301 redirect:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">Response.<span style="color: #0000FF;">Status</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;301 Moved Permanently&quot;</span><span style="color: #008000;">;</span>
Response.<span style="color: #0000FF;">StatusCode</span> <span style="color: #008000;">=</span> <span style="color: #FF0000;">301</span><span style="color: #008000;">;</span>
Response.<span style="color: #0000FF;">AddHeader</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Location&quot;</span>, url<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
Response.<span style="color: #0000FF;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div>

<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/dotmacblog?a=zjmIEwF-4hc:9oGkhzcwndw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/dotmacblog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dotmacblog?a=zjmIEwF-4hc:9oGkhzcwndw:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/dotmacblog?i=zjmIEwF-4hc:9oGkhzcwndw:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dotmacblog?a=zjmIEwF-4hc:9oGkhzcwndw:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/dotmacblog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dotmacblog?a=zjmIEwF-4hc:9oGkhzcwndw:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/dotmacblog?d=cGdyc7Q-1BI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/dotmacblog/~4/zjmIEwF-4hc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://dotmac.rationalmind.net/2010/03/response-redirect-and-302-and-301-status-codes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://dotmac.rationalmind.net/2010/03/response-redirect-and-302-and-301-status-codes/</feedburner:origLink></item>
		<item>
		<title>Set the admin color scheme for all WordPress users</title>
		<link>http://feedproxy.google.com/~r/dotmacblog/~3/gFTyRPkTqh8/</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>INSERT INTO wp_usermeta
&amp;#40;
user_id,
meta_key,
meta_value
&amp;#41;
&amp;#40;
SELECT 
id,
'admin_color',
'classic'
FROM wp_users
WHERE id  NOT  IN &amp;#40;SELECT user_Id FROM wp_usermeta WHERE meta_key = 'admin_color'&amp;#41;
&amp;#41;
&amp;#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>

<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/dotmacblog?a=gFTyRPkTqh8:VP5sEk7XiTs:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/dotmacblog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dotmacblog?a=gFTyRPkTqh8:VP5sEk7XiTs:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/dotmacblog?i=gFTyRPkTqh8:VP5sEk7XiTs:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dotmacblog?a=gFTyRPkTqh8:VP5sEk7XiTs:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/dotmacblog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dotmacblog?a=gFTyRPkTqh8:VP5sEk7XiTs:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/dotmacblog?d=cGdyc7Q-1BI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/dotmacblog/~4/gFTyRPkTqh8" height="1" width="1"/>]]></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>
		<feedburner:origLink>http://dotmac.rationalmind.net/2010/03/set-the-admin-color-scheme-for-all-wordpress-users/</feedburner:origLink></item>
		<item>
		<title>Bulk update post slugs in a WordPress blog</title>
		<link>http://feedproxy.google.com/~r/dotmacblog/~3/p_XcY14RVic/</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>The following script updates missing post slugs (permalinks) in a WordPress blogs, or reformats them according to your needs:


&amp;#34;;
&amp;#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);
&amp;#160;
/** Loads the WordPress Environment and Template, allowing wp functions like the_title() */
define('WP_USE_THEMES', false);
require('./wp-blog-header.php');
&amp;#160;
function bleach($which)
{
    [...]</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>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/dotmacblog?a=p_XcY14RVic:End-qT1w14E:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/dotmacblog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dotmacblog?a=p_XcY14RVic:End-qT1w14E:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/dotmacblog?i=p_XcY14RVic:End-qT1w14E:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dotmacblog?a=p_XcY14RVic:End-qT1w14E:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/dotmacblog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dotmacblog?a=p_XcY14RVic:End-qT1w14E:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/dotmacblog?d=cGdyc7Q-1BI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/dotmacblog/~4/p_XcY14RVic" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://dotmac.rationalmind.net/2010/03/bulk-update-post-slugs-in-a-wordpress-blog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://dotmac.rationalmind.net/2010/03/bulk-update-post-slugs-in-a-wordpress-blog/</feedburner:origLink></item>
		<item>
		<title>Delete smart quotes and fix latin1&gt;utf8 encoding issues in WordPress</title>
		<link>http://feedproxy.google.com/~r/dotmacblog/~3/ECbuQkZLgyI/</link>
		<comments>http://dotmac.rationalmind.net/2010/03/delete-smart-quotes-in-wordpress/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 07:36:17 +0000</pubDate>
		<dc:creator>David Veksler</dc:creator>
				<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://dotmac.rationalmind.net/?p=158</guid>
		<description>If you use wptexturize, smart quotes will just mess you up.


UPDATE wordpress.wp_posts SET post_content = REPLACE&amp;#40;post_content,&amp;#34;&amp;#34;&amp;#34;,&amp;#34;'&amp;#34;);
UPDATE wordpress.wp_posts SET post_content = REPLACE(post_content,&amp;#34;&amp;#38;ldquo;&amp;#34;,'&amp;#34;');
UPDATE wordpress.wp_posts SET post_content = REPLACE(post_content,&amp;#34;”&amp;#34;,'&amp;#34;');
UPDATE wordpress.wp_posts SET post_content = REPLACE(post_content,&amp;#34;‘&amp;#34;,&amp;#34;'&amp;#34;);
UPDATE wordpress.wp_posts SET post_content = REPLACE(post_content,&amp;#34;’&amp;#34;,&amp;#34;'&amp;#34;);
UPDATE wordpress.wp_posts SET post_content = REPLACE(post_content,&amp;#34;Ã¶&amp;#34;,&amp;#34;ö&amp;#34;);
UPDATE wordpress.wp_posts SET post_content = REPLACE(post_content,&amp;#34;Ã¼&amp;#34;,&amp;#34;ü&amp;#34;);
UPDATE wordpress.wp_posts SET post_content = REPLACE(post_content,&amp;#34;Ã©&amp;#34;,&amp;#34;é&amp;#34;);
UPDATE wordpress.wp_posts SET post_content = [...]</description>
			<content:encoded><![CDATA[<p>If you use <a href="http://codex.wordpress.org/Function_Reference/wptexturize">wptexturize</a>, smart quotes will just mess you up.<br />
<span id="more-158"></span></p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><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> post_content <span style="color: #66cc66;">=</span> <span style="color: #993333; font-weight: bold;">REPLACE</span><span style="color: #66cc66;">&#40;</span>post_content<span style="color: #66cc66;">,</span><span style="color: #ff0000;">&quot;&quot;</span><span style="color: #ff0000;">&quot;,&quot;</span><span style="color: #ff0000;">'&quot;);
UPDATE wordpress.wp_posts SET post_content = REPLACE(post_content,&quot;&amp;ldquo;&quot;,'</span><span style="color: #ff0000;">&quot;');
UPDATE wordpress.wp_posts SET post_content = REPLACE(post_content,&quot;</span>”<span style="color: #ff0000;">&quot;,'&quot;</span><span style="color: #ff0000;">');
UPDATE wordpress.wp_posts SET post_content = REPLACE(post_content,&quot;‘&quot;,&quot;'</span><span style="color: #ff0000;">&quot;);
UPDATE wordpress.wp_posts SET post_content = REPLACE(post_content,&quot;</span>’<span style="color: #ff0000;">&quot;,&quot;</span><span style="color: #ff0000;">'&quot;);
UPDATE wordpress.wp_posts SET post_content = REPLACE(post_content,&quot;Ã¶&quot;,&quot;ö&quot;);
UPDATE wordpress.wp_posts SET post_content = REPLACE(post_content,&quot;Ã¼&quot;,&quot;ü&quot;);
UPDATE wordpress.wp_posts SET post_content = REPLACE(post_content,&quot;Ã©&quot;,&quot;é&quot;);
UPDATE wordpress.wp_posts SET post_content = REPLACE(post_content,&quot;Ã‰&quot;,&quot;É&quot;);
&nbsp;
UPDATE wordpress.wp_users SET display_name = REPLACE(display_name,&quot;Ã©&quot;,&quot;é&quot;);
UPDATE wordpress.wp_users SET display_name = REPLACE(display_name,&quot;&quot;&quot;,&quot;'</span><span style="color: #ff0000;">&quot;);
UPDATE wordpress.wp_users SET display_name = REPLACE(display_name,&quot;</span>“<span style="color: #ff0000;">&quot;,'&quot;</span><span style="color: #ff0000;">');
UPDATE wordpress.wp_users SET display_name = REPLACE(display_name,&quot;”&quot;,'</span><span style="color: #ff0000;">&quot;');
UPDATE wordpress.wp_users SET display_name = REPLACE(display_name,&quot;</span>‘<span style="color: #ff0000;">&quot;,&quot;</span><span style="color: #ff0000;">'&quot;);
UPDATE wordpress.wp_users SET display_name = REPLACE(display_name,&quot;’&quot;,&quot;'</span><span style="color: #ff0000;">&quot;);
UPDATE wordpress.wp_users SET display_name = REPLACE(display_name,&quot;</span>Ã¶<span style="color: #ff0000;">&quot;,&quot;</span>ö<span style="color: #ff0000;">&quot;);
UPDATE wordpress.wp_users SET display_name = REPLACE(display_name,&quot;</span>Ã¼<span style="color: #ff0000;">&quot;,&quot;</span>ü<span style="color: #ff0000;">&quot;);
UPDATE wordpress.wp_users SET display_name = REPLACE(display_name,&quot;</span>Ã©<span style="color: #ff0000;">&quot;,&quot;</span>é<span style="color: #ff0000;">&quot;);
&nbsp;
&nbsp;
UPDATE wordpress.wp_posts SET post_title = REPLACE(post_title,&quot;</span><span style="color: #ff0000;">&quot;&quot;</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">&quot;'&quot;</span><span style="color: #66cc66;">&#41;</span>;
<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> post_title <span style="color: #66cc66;">=</span> <span style="color: #993333; font-weight: bold;">REPLACE</span><span style="color: #66cc66;">&#40;</span>post_title<span style="color: #66cc66;">,</span><span style="color: #ff0000;">&quot;“&quot;</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'&quot;'</span><span style="color: #66cc66;">&#41;</span>;
<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> post_title <span style="color: #66cc66;">=</span> <span style="color: #993333; font-weight: bold;">REPLACE</span><span style="color: #66cc66;">&#40;</span>post_title<span style="color: #66cc66;">,</span><span style="color: #ff0000;">&quot;”&quot;</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">'&quot;'</span><span style="color: #66cc66;">&#41;</span>;
<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> post_title <span style="color: #66cc66;">=</span> <span style="color: #993333; font-weight: bold;">REPLACE</span><span style="color: #66cc66;">&#40;</span>post_title<span style="color: #66cc66;">,</span><span style="color: #ff0000;">&quot;‘&quot;</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">&quot;'&quot;</span><span style="color: #66cc66;">&#41;</span>;
<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> post_title <span style="color: #66cc66;">=</span> <span style="color: #993333; font-weight: bold;">REPLACE</span><span style="color: #66cc66;">&#40;</span>post_title<span style="color: #66cc66;">,</span><span style="color: #ff0000;">&quot;’&quot;</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">&quot;'&quot;</span><span style="color: #66cc66;">&#41;</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> post_title <span style="color: #66cc66;">=</span> <span style="color: #993333; font-weight: bold;">REPLACE</span><span style="color: #66cc66;">&#40;</span>post_title<span style="color: #66cc66;">,</span><span style="color: #ff0000;">&quot;Ã¶&quot;</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">&quot;ö&quot;</span><span style="color: #66cc66;">&#41;</span>;
<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> post_title <span style="color: #66cc66;">=</span> <span style="color: #993333; font-weight: bold;">REPLACE</span><span style="color: #66cc66;">&#40;</span>post_title<span style="color: #66cc66;">,</span><span style="color: #ff0000;">&quot;Ã¼&quot;</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">&quot;ü&quot;</span><span style="color: #66cc66;">&#41;</span>;
<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> post_title <span style="color: #66cc66;">=</span> <span style="color: #993333; font-weight: bold;">REPLACE</span><span style="color: #66cc66;">&#40;</span>post_title<span style="color: #66cc66;">,</span><span style="color: #ff0000;">&quot;Ã©&quot;</span><span style="color: #66cc66;">,</span><span style="color: #ff0000;">&quot;é&quot;</span><span style="color: #66cc66;">&#41;</span>;</pre></div></div>

<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/dotmacblog?a=ECbuQkZLgyI:EuYGQvnWQQY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/dotmacblog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dotmacblog?a=ECbuQkZLgyI:EuYGQvnWQQY:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/dotmacblog?i=ECbuQkZLgyI:EuYGQvnWQQY:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dotmacblog?a=ECbuQkZLgyI:EuYGQvnWQQY:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/dotmacblog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dotmacblog?a=ECbuQkZLgyI:EuYGQvnWQQY:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/dotmacblog?d=cGdyc7Q-1BI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/dotmacblog/~4/ECbuQkZLgyI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://dotmac.rationalmind.net/2010/03/delete-smart-quotes-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://dotmac.rationalmind.net/2010/03/delete-smart-quotes-in-wordpress/</feedburner:origLink></item>
		<item>
		<title>SQL script to migrate from Movable Type to WordPress</title>
		<link>http://feedproxy.google.com/~r/dotmacblog/~3/VrYu6hHjbQQ/</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>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 [...]</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>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/dotmacblog?a=VrYu6hHjbQQ:08ryh4_83C0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/dotmacblog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dotmacblog?a=VrYu6hHjbQQ:08ryh4_83C0:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/dotmacblog?i=VrYu6hHjbQQ:08ryh4_83C0:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dotmacblog?a=VrYu6hHjbQQ:08ryh4_83C0:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/dotmacblog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dotmacblog?a=VrYu6hHjbQQ:08ryh4_83C0:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/dotmacblog?d=cGdyc7Q-1BI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/dotmacblog/~4/VrYu6hHjbQQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://dotmac.rationalmind.net/2010/03/sql-script-to-migrate-from-movable-type-to-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://dotmac.rationalmind.net/2010/03/sql-script-to-migrate-from-movable-type-to-wordpress/</feedburner:origLink></item>
		<item>
		<title>Luhn algorithm validation via a CustomValidator control</title>
		<link>http://feedproxy.google.com/~r/dotmacblog/~3/_s6eajJPPsA/</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>The Luhn algorithm is a checksum used for credit cards and many other identifying numbers as a basic integrity validation check.  It&amp;#8217;s useful for credit card forms because it avoids unneeded transaction attempts when card numbers are mis-typed.
It&amp;#8217;s easy to add an account # Luhn checksum validation control to credit card forms in ASP.Net:

Add this [...]</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>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/dotmacblog?a=_s6eajJPPsA:2YVP6UOn0e8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/dotmacblog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dotmacblog?a=_s6eajJPPsA:2YVP6UOn0e8:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/dotmacblog?i=_s6eajJPPsA:2YVP6UOn0e8:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dotmacblog?a=_s6eajJPPsA:2YVP6UOn0e8:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/dotmacblog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dotmacblog?a=_s6eajJPPsA:2YVP6UOn0e8:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/dotmacblog?d=cGdyc7Q-1BI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/dotmacblog/~4/_s6eajJPPsA" height="1" width="1"/>]]></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>
		<feedburner:origLink>http://dotmac.rationalmind.net/2010/02/luhn-algorithm-validation-via-a-customvalidator-control/</feedburner:origLink></item>
		<item>
		<title>Quickly open an app in Terminal</title>
		<link>http://feedproxy.google.com/~r/dotmacblog/~3/0g3DbjslKjQ/</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>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 &amp;#8220;set completion-ignore-case On&amp;#8221; &amp;#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>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/dotmacblog?a=0g3DbjslKjQ:_V-zLOMlasc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/dotmacblog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dotmacblog?a=0g3DbjslKjQ:_V-zLOMlasc:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/dotmacblog?i=0g3DbjslKjQ:_V-zLOMlasc:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dotmacblog?a=0g3DbjslKjQ:_V-zLOMlasc:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/dotmacblog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dotmacblog?a=0g3DbjslKjQ:_V-zLOMlasc:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/dotmacblog?d=cGdyc7Q-1BI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/dotmacblog/~4/0g3DbjslKjQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://dotmac.rationalmind.net/2009/11/quickly-open-an-app-in-terminal/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://dotmac.rationalmind.net/2009/11/quickly-open-an-app-in-terminal/</feedburner:origLink></item>
		<item>
		<title>Correct photo orientation using EXIF data with C#</title>
		<link>http://feedproxy.google.com/~r/dotmacblog/~3/e4LVhlW3Ke0/</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>When processing photos, sometimes you want to re-orient the photo according the orientation recorded by the camera (such as the iPhone&amp;#8217;s accelerometer) and stored in the EXIF meta data.  It&amp;#8217;s easy to do:

// Rotate the image according to EXIF data
var bmp = new Bitmap&amp;#40;pathToImageFile&amp;#41;;
var exif = new EXIFextractor&amp;#40;ref bmp, &amp;#34;\n&amp;#34;&amp;#41;; // get source from http://www.codeproject.com/KB/graphics/exifextractor.aspx?fid=207371
&amp;#160;
if [...]</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>

<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/dotmacblog?a=e4LVhlW3Ke0:vUzxwYrvZds:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/dotmacblog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dotmacblog?a=e4LVhlW3Ke0:vUzxwYrvZds:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/dotmacblog?i=e4LVhlW3Ke0:vUzxwYrvZds:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dotmacblog?a=e4LVhlW3Ke0:vUzxwYrvZds:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/dotmacblog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dotmacblog?a=e4LVhlW3Ke0:vUzxwYrvZds:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/dotmacblog?d=cGdyc7Q-1BI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/dotmacblog/~4/e4LVhlW3Ke0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://dotmac.rationalmind.net/2009/08/correct-photo-orientation-using-exif/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://dotmac.rationalmind.net/2009/08/correct-photo-orientation-using-exif/</feedburner:origLink></item>
		<item>
		<title>Maxing out HTTP compression in IIS7</title>
		<link>http://feedproxy.google.com/~r/dotmacblog/~3/JCu7bxM5OCk/</link>
		<comments>http://dotmac.rationalmind.net/2009/07/maxing-out-http-compression-in-iis7/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 17:41:21 +0000</pubDate>
		<dc:creator>David Veksler</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[compression]]></category>
		<category><![CDATA[gzip]]></category>
		<category><![CDATA[zip]]></category>

		<guid isPermaLink="false">http://dotmac.rationalmind.net/?p=115</guid>
		<description>1:  In IIS7 manager, enable dynamic and static compriession.   (This adds &amp;#60;urlCompression doStaticCompression=&amp;#8221;true&amp;#8221; doDynamicCompression=&amp;#8221;true&amp;#8221; /&amp;#62; to applicationHost.config)
2: Open C:\Windows\System32\Inetsrv\Config\applicationHost.config and go to the httpCompression section. For both dynamicTypes and staticTypes: &amp;#60;mimetype=&amp;#8221;*/*&amp;#8221; enabled=&amp;#8221;true&amp;#8221;&amp;#62;
3:   Run appcmd in %systemroot%\system32\inetsrv\
appcmd set config /section:httpCompression /[name='gzip'].dynamicsCompressionLevel:10
appcmd set config /section:httpCompression /[name='gzip'].staticCompressionLevel:10
(Set the value to 7,8,or 9 for less CPU usage)
Note: compressing static [...]</description>
			<content:encoded><![CDATA[<p>1:  In IIS7 manager, enable dynamic and static compriession.   (This adds &lt;urlCompression doStaticCompression=&#8221;true&#8221; doDynamicCompression=&#8221;true&#8221; /&gt; to applicationHost.config)</p>
<p>2: Open C:\Windows\System32\Inetsrv\Config\applicationHost.config and go to the httpCompression section. For both dynamicTypes and staticTypes: &lt;mimetype=&#8221;*/*&#8221; enabled=&#8221;true&#8221;&gt;</p>
<p>3:   Run <a href="http://learn.iis.net/page.aspx/114/getting-started-with-appcmdexe/">appcmd</a> in %systemroot%\system32\inetsrv\<br />
appcmd set config /section:httpCompression /[name='gzip'].dynamicsCompressionLevel:10<br />
appcmd set config /section:httpCompression /[name='gzip'].staticCompressionLevel:10</p>
<p>(Set the value to 7,8,or 9 for less CPU usage)</p>
<p>Note: compressing static files prevents them from displaying incrementally while the rest of the file downloads in the background.  This may be useful for viewing partially loaded PDF&#8217;s, text files, images, etc.  It may be appropriate to enable/disable compression per-directory in some cases.</p>
<p><a href="http://www.iis.net/ConfigReference/system.webServer/httpCompression">More information on IIS7 HTTP compression.</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/dotmacblog?a=JCu7bxM5OCk:D5AIY1uFV-o:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/dotmacblog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dotmacblog?a=JCu7bxM5OCk:D5AIY1uFV-o:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/dotmacblog?i=JCu7bxM5OCk:D5AIY1uFV-o:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dotmacblog?a=JCu7bxM5OCk:D5AIY1uFV-o:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/dotmacblog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dotmacblog?a=JCu7bxM5OCk:D5AIY1uFV-o:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/dotmacblog?d=cGdyc7Q-1BI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/dotmacblog/~4/JCu7bxM5OCk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://dotmac.rationalmind.net/2009/07/maxing-out-http-compression-in-iis7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://dotmac.rationalmind.net/2009/07/maxing-out-http-compression-in-iis7/</feedburner:origLink></item>
		<item>
		<title>Xcode All-In-One View</title>
		<link>http://feedproxy.google.com/~r/dotmacblog/~3/vKYYT00ylWw/</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>One thing I don&amp;#8217;t like about the default Xcode layout is that all the views &amp;#8211; code, debug, console, find, etc open in new windows by default.
If you&amp;#8217;d rather not manage a bunch of Xcode windows all the time,  Xcode has a &amp;#8220;hidden&amp;#8221; All-One-One view which shows all your views in a single window and [...]</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>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/dotmacblog?a=vKYYT00ylWw:ZZjMKhL_Ik8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/dotmacblog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dotmacblog?a=vKYYT00ylWw:ZZjMKhL_Ik8:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/dotmacblog?i=vKYYT00ylWw:ZZjMKhL_Ik8:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dotmacblog?a=vKYYT00ylWw:ZZjMKhL_Ik8:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/dotmacblog?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/dotmacblog?a=vKYYT00ylWw:ZZjMKhL_Ik8:cGdyc7Q-1BI"><img src="http://feeds.feedburner.com/~ff/dotmacblog?d=cGdyc7Q-1BI" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/dotmacblog/~4/vKYYT00ylWw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://dotmac.rationalmind.net/2009/05/xcode-all-in-one-view/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://dotmac.rationalmind.net/2009/05/xcode-all-in-one-view/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic page generated in 0.686 seconds. --><!-- Cached page generated by WP-Super-Cache on 2010-03-12 10:30:30 --><!-- Compression = gzip -->
