<?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"
	>

<channel>
	<title>SethAnderson.net</title>
	<atom:link href="http://sethanderson.net/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://sethanderson.net</link>
	<description>Contributions to the Network</description>
	<pubDate>Sat, 20 Jun 2009 14:39:11 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.5</generator>
	<language>en</language>
			<item>
		<title>When Changing the Site URL in Wordpress Config&#8230;</title>
		<link>http://sethanderson.net/?p=14</link>
		<comments>http://sethanderson.net/?p=14#comments</comments>
		<pubDate>Sat, 20 Jun 2009 14:37:17 +0000</pubDate>
		<dc:creator>seth</dc:creator>
		
		<category><![CDATA[Tech]]></category>

		<category><![CDATA[database]]></category>

		<category><![CDATA[db]]></category>

		<category><![CDATA[sql]]></category>

		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://sethanderson.net/?p=14</guid>
		<description><![CDATA[You must remember that there are hard-coded urls all over word press. Here are 3 sql statements to update those urls:

Update all post guids: UPDATE wp_posts SET guid = replace(guid, 'http://www.old-domain-name.com','http://www.new-domain-name.com');
Update all post content: UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-domain-name.com', 'http://www.new-domain-name.com');
Update all home and site_url options: UPDATE wp_options SET option_value = replace(option_value, 'http://www.old-domain-name.com', 'http://www.new-domain-name.com') [...]]]></description>
			<content:encoded><![CDATA[<p>You must remember that there are hard-coded urls all over word press. Here are 3 sql statements to update those urls:</p>
<ol>
<li><strong>Update all post guids:</strong> <em>UPDATE wp_posts SET guid = replace(guid, 'http://www.old-domain-name.com','http://www.new-domain-name.com');</em></li>
<li><strong>Update all post content:</strong> <em>UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-domain-name.com', 'http://www.new-domain-name.com');</em></li>
<li><strong>Update all home and site_url options:</strong> <em>UPDATE wp_options SET option_value = replace(option_value, 'http://www.old-domain-name.com', 'http://www.new-domain-name.com') WHERE option_name = 'home' OR option_name = 'siteurl';</em></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://sethanderson.net/?feed=rss2&amp;p=14</wfw:commentRss>
		</item>
		<item>
		<title>Linux Find Examples</title>
		<link>http://sethanderson.net/?p=11</link>
		<comments>http://sethanderson.net/?p=11#comments</comments>
		<pubDate>Thu, 28 May 2009 12:30:21 +0000</pubDate>
		<dc:creator>seth</dc:creator>
		
		<category><![CDATA[Tech]]></category>

		<category><![CDATA[linux reference]]></category>

		<guid isPermaLink="false">http://sethanderson.net/?p=11</guid>
		<description><![CDATA[There is a very helpful reference on wagoneers.com for the Linux 'find' command. Download a printer friendly version of the Linux Find Examples.
]]></description>
			<content:encoded><![CDATA[<p>There is a very helpful reference on <a href="http://www.wagoneers.com/UNIX/FIND/find-usage.html">wagoneers.com</a> for the Linux 'find' command. <a href="http://sethanderson.net/wp-content/uploads/2009/05/linux_find_examples.pdf">Download a printer friendly version of the Linux Find Examples</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://sethanderson.net/?feed=rss2&amp;p=11</wfw:commentRss>
		</item>
		<item>
		<title>Sql foo gone bad&#8230;</title>
		<link>http://sethanderson.net/?p=10</link>
		<comments>http://sethanderson.net/?p=10#comments</comments>
		<pubDate>Tue, 09 Dec 2008 19:40:36 +0000</pubDate>
		<dc:creator>seth</dc:creator>
		
		<category><![CDATA[Tech]]></category>

		<category><![CDATA[sql db]]></category>

		<guid isPermaLink="false">http://www.sethanderson.net/?p=10</guid>
		<description><![CDATA[group_concat is awesome, until your realize it starts truncating at 1024 :(...
http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html#sysvar_group_concat_max_len

]]></description>
			<content:encoded><![CDATA[<p><span class="Apple-style-span" style="border-collapse: collapse; color: #000000; font-family: arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px">group_concat is awesome, until your realize it starts truncating at 1024 :(...</p>
<p><a href="http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html#sysvar_group_concat_max_len" target="_blank" style="color: #1c51a8">http://dev.mysql.com/doc/<wbr></wbr>refman/5.0/en/server-system-<wbr></wbr>variables.html#sysvar_group_<wbr></wbr>concat_max_len</a></p>
<p></span></p>
]]></content:encoded>
			<wfw:commentRss>http://sethanderson.net/?feed=rss2&amp;p=10</wfw:commentRss>
		</item>
		<item>
		<title>BEWARE! Koobface Facebook Virus</title>
		<link>http://sethanderson.net/?p=9</link>
		<comments>http://sethanderson.net/?p=9#comments</comments>
		<pubDate>Tue, 09 Dec 2008 19:39:53 +0000</pubDate>
		<dc:creator>seth</dc:creator>
		
		<category><![CDATA[Tech]]></category>

		<category><![CDATA[sysadmin spyware virus]]></category>

		<guid isPermaLink="false">http://www.sethanderson.net/?p=9</guid>
		<description><![CDATA[I just finished cleaning off a machine with this virus. Please don't click on any links from Facebook that sound like this...
Yesterday, reports started circulating about a virulent piece of worm spreading through Facebook. The malicious code isn't exactly new (it started surfacing in August), but has now been altered to strike social networking websites only and is currently making the rounds on Facebook pretty quickly, it seems. The virus can spread fast because they travel through messages which appear to come from your friends.
The Koobface messages carry subject lines like "You look so funny on our new video" or something similar, and contain a link to a video site that appears to contain a movie clip. If the user tries to watch it, a message appears saying that he or she needs the latest version of Flash Player in order to play the clip. This tricks users into downloading a file carrying the malware. An earlier version of the virus targeted MySpace users earlier this year but was quickly eliminated after new security measures were put in place.
Entire article here...http://www.washingtonpost.com/wp-dyn/content/article/2008/12/05/AR2008120501081.html

]]></description>
			<content:encoded><![CDATA[<p><span class="Apple-style-span" style="border-collapse: collapse; color: #000000; font-family: arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px">I just finished cleaning off a machine with this virus. Please don't click on any links from Facebook that sound like this...</p>
<blockquote class="gmail_quote" style="border-left: 1px solid #cccccc; margin: 0px 0px 0px 0.8ex; padding-left: 1ex"><p><span style="font-style: italic">Yesterday, reports started circulating <wbr></wbr>about a virulent piece of <wbr></wbr>worm spreading through <wbr></wbr>Facebook. The malicious code <wbr></wbr>isn't exactly new (it started <wbr></wbr>surfacing in August), but has <wbr></wbr>now been altered to strike <wbr></wbr>social networking websites <wbr></wbr>only and is currently making <wbr></wbr>the rounds on Facebook pretty <wbr></wbr>quickly, it seems. The virus <wbr></wbr>can spread fast because they <wbr></wbr>travel through messages which <wbr></wbr>appear to come from your <wbr></wbr>friends.</span></p></blockquote>
<blockquote class="gmail_quote" style="border-left: 1px solid #cccccc; margin: 0px 0px 0px 0.8ex; padding-left: 1ex"><p><span style="font-style: italic"><span style="font-family: 'Times New Roman'; font-size: 17px; font-style: normal"></span>The Koobface messages carry <wbr></wbr>subject lines like "You look <wbr></wbr>so funny on our new video" or <wbr></wbr>something similar, and <wbr></wbr>contain a link to a video <wbr></wbr>site that appears to contain <wbr></wbr>a movie clip. If the user <wbr></wbr>tries to watch it, a message <wbr></wbr>appears saying that he or she <wbr></wbr>needs the latest version of <wbr></wbr>Flash Player in order to play <wbr></wbr>the clip. This tricks users <wbr></wbr>into downloading a file <wbr></wbr>carrying the malware. An <wbr></wbr>earlier version of the virus <wbr></wbr>targeted MySpace users <wbr></wbr>earlier this year but was <wbr></wbr>quickly eliminated after new <wbr></wbr>security measures were put in <wbr></wbr>place.</span></p></blockquote>
<p>Entire article here...<a href="http://www.washingtonpost.com/wp-dyn/content/article/2008/12/05/AR2008120501081.html" target="_blank" style="color: #1c51a8">http://www.<wbr></wbr>washingtonpost.com/wp-dyn/<wbr></wbr>content/article/2008/12/05/<wbr></wbr>AR2008120501081.html</a></p>
<p></span></p>
]]></content:encoded>
			<wfw:commentRss>http://sethanderson.net/?feed=rss2&amp;p=9</wfw:commentRss>
		</item>
		<item>
		<title>Counter Class</title>
		<link>http://sethanderson.net/?p=7</link>
		<comments>http://sethanderson.net/?p=7#comments</comments>
		<pubDate>Thu, 13 Mar 2008 01:38:40 +0000</pubDate>
		<dc:creator>seth</dc:creator>
		
		<category><![CDATA[Tech]]></category>

		<category><![CDATA[php code]]></category>

		<guid isPermaLink="false">http://www.sethanderson.net/?p=7</guid>
		<description><![CDATA[Counter Class
Counter class can be used to keep a count and timer of a given object or group of objects. I use it mainly for counting links and stopping and starting a timer in session. This helps me to keep track of how long a user is on a particular page or group of pages. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.sethanderson.net/wp-content/uploads/2008/03/counterclassphp.txt" title="Counter Class">Counter Class</a></p>
<p>Counter class can be used to keep a count and timer of a given object or group of objects. I use it mainly for counting links and stopping and starting a timer in session. This helps me to keep track of how long a user is on a particular page or group of pages. You may find it useful to call this object through AJAX to update counter information in your database, or just hit it using a normal post. In my case, I wrote a small extension of this class which does all of the necessary DB handshaking between the counter data and the database.</p>
<p>Usage:<br />
* @example $counter = new Counter(100) - this instantiates the $counter object and sets the initial counter 'page'=&gt;100,'count'=&gt;1<br />
* @example $counter = new Counter(null,true); - this instantiates the $counter object and sets the initial counter [page]=&gt;'http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'],[count] =&gt; 1, [time] =&gt; 0<br />
If the second value is true, the clock will start ticking on your page's session variable. Every time the counter is called again,  the session variable will update to the time difference between the second call and the initial call. You may use the other methods such as, stopTimer, restartTimer to do the obvious. When finished counting and timing, you may obtain all of your counts and times using the getAllCounts method. That's about it. It's simple, but it comes in real handy for me when attempting to, well, count things.</p>
<p><a href="http://www.sethanderson.net/wp-content/uploads/2008/03/counterclassphp.txt" title="Counter Class">Counter Class</a></p>
]]></content:encoded>
			<wfw:commentRss>http://sethanderson.net/?feed=rss2&amp;p=7</wfw:commentRss>
		</item>
		<item>
		<title>Fade to DIV with MooFX</title>
		<link>http://sethanderson.net/?p=6</link>
		<comments>http://sethanderson.net/?p=6#comments</comments>
		<pubDate>Sat, 24 Nov 2007 20:33:39 +0000</pubDate>
		<dc:creator>seth</dc:creator>
		
		<category><![CDATA[Tech]]></category>

		<category><![CDATA[javascript moofx setOpacity opacity moo]]></category>

		<guid isPermaLink="false">http://www.sethanderson.net/?p=6</guid>
		<description><![CDATA[Here's a quick example of fading in/out of divs with Moofx. In order to use this, you will need two href tags with ids, and two divs to fade in and out of. Read the code comments for more instruction:


/* Set default opacities
 * When the page loads, display the gallery;
 * Turn off the [...]]]></description>
			<content:encoded><![CDATA[<p>Here's a quick example of fading in/out of divs with Moofx. In order to use this, you will need two href tags with ids, and two divs to fade in and out of. Read the code comments for more instruction:</p>
<div class="scroll">
<pre class="javascript">
/* Set default opacities
 * When the page loads, display the gallery;
 * Turn off the display of the specials page;
 * Also turn down the opacity.
 */
Window.onDomReady(function(){
	$('gallery').setOpacity(1);
	$('specials').setOpacity(0);
	$('specials').setStyle('display','none');
})

/* Attach events to the href ids that you will be using to trigger the events;
 * In this example, I have two divs to toggle, specials and gallery.
 * When one div is toggled, make sure to toggle off the other div first.
 * Also make sure to set your opacity to 0 before displaying.
 * If not, your div will display in full before doing the actual fade in.
 */
$('show_gallery').addEvent('click', function(e){
	$('specials').setStyle('display','none');
	$('gallery').setOpacity(0);
	$('gallery').setStyle('display','');
	var myFx = new Fx.Style('gallery', 'opacity').start(0,1);
});

$('show_specials').addEvent('click', function(e){
	$('gallery').setStyle('display','none');
	$('specials').setOpacity(0);
	$('specials').setStyle('display','');
	var myFx = new Fx.Style('specials', 'opacity').start(0,1);
});
</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://sethanderson.net/?feed=rss2&amp;p=6</wfw:commentRss>
		</item>
		<item>
		<title>Having SQL: An Easy Way to Find Duplicate Rows with SQL</title>
		<link>http://sethanderson.net/?p=4</link>
		<comments>http://sethanderson.net/?p=4#comments</comments>
		<pubDate>Sun, 18 Nov 2007 02:51:31 +0000</pubDate>
		<dc:creator>seth</dc:creator>
		
		<category><![CDATA[Tech]]></category>

		<category><![CDATA[sql database]]></category>

		<guid isPermaLink="false">http://www.sethanderson.net/?p=4</guid>
		<description><![CDATA[This will not get you to SQL-foo master status, but it will help you out when trying to find duplicate rows in a database table that is, err, let's just say not-so-well-formed:

select
count(*),
min(id),
max(id),
email
from users
group by email having count(*)  > 1;

]]></description>
			<content:encoded><![CDATA[<p>This will not get you to SQL-foo master status, but it will help you out when trying to find duplicate rows in a database table that is, err, let's just say not-so-well-formed:</p>
<pre class="sql">
select
count(*),
min(id),
max(id),
email
from users
group by email having count(*)  > 1;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://sethanderson.net/?feed=rss2&amp;p=4</wfw:commentRss>
		</item>
		<item>
		<title>State name &gt;&gt; abbreviation</title>
		<link>http://sethanderson.net/?p=3</link>
		<comments>http://sethanderson.net/?p=3#comments</comments>
		<pubDate>Tue, 13 Nov 2007 04:33:23 +0000</pubDate>
		<dc:creator>seth</dc:creator>
		
		<category><![CDATA[Tech]]></category>

		<category><![CDATA[php function array_walk]]></category>

		<guid isPermaLink="false">http://www.sethanderson.net/?p=3</guid>
		<description><![CDATA[This is a quick write up for walking through a result set data and converting state names to abbreviations:

/**
* Walks through an array and looks for a specific state key. It then tries to convert the full state name to its abbreviation.
* Originally written for importing CSV data to the database where all of the [...]]]></description>
			<content:encoded><![CDATA[<p>This is a quick write up for walking through a result set data and converting state names to abbreviations:</p>
<div class="scroll">
<pre class="php"><span style="color: #808080; font-style: italic;">/**
* Walks through an array and looks for a specific state key. It then tries to convert the full state name to its abbreviation.
* Originally written for importing CSV data to the database where all of the rows contained full length state names. Thought it would
* be useful in other functions so added it to global. Call it like this: array_walk($arr,'state_abbr',[state_key_name]);/sa
* @uses array $states - Must have a states array formatted with abbreviations as the key.
* @param array $arr - reference to the array we are walking through
* @param string $key - current key
* @param string $array_key - state field name string we should be checking for in array
* @return void
*/</span>
<span style="color: #000000; font-weight: bold;">function</span> state_abbr<span style="color: #66cc66;">&#40;</span>&amp;<span style="color: #0000ff;">$arr</span>,<span style="color: #0000ff;">$key</span>,<span style="color: #0000ff;">$array_key</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
<a href="http://www.php.net/global"><span style="color: #000066;">global</span></a> <span style="color: #0000ff;">$states</span>;
<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><a href="http://www.php.net/strlen"><span style="color: #000066;">strlen</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$arr</span><span style="color: #66cc66;">&#91;</span><span style="color: #0000ff;">$array_key</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>==<span style="color: #cc66cc;">2</span> &amp;&amp; <a href="http://www.php.net/array_key_exists"><span style="color: #000066;">array_key_exists</span></a><span style="color: #66cc66;">&#40;</span><a href="http://www.php.net/strtoupper"><span style="color: #000066;">strtoupper</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$arr</span><span style="color: #66cc66;">&#91;</span><span style="color: #0000ff;">$array_key</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>,<span style="color: #0000ff;">$states</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span> <span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">false</span>; <span style="color: #66cc66;">&#125;</span>; <span style="color: #808080; font-style: italic;">//if the value is already a abbr, don't do anything</span>
<span style="color: #0000ff;">$arr</span><span style="color: #66cc66;">&#91;</span><span style="color: #0000ff;">$array_key</span><span style="color: #66cc66;">&#93;</span> = <a href="http://www.php.net/array_search"><span style="color: #000066;">array_search</span></a><span style="color: #66cc66;">&#40;</span><a href="http://www.php.net/ucwords"><span style="color: #000066;">ucwords</span></a><span style="color: #66cc66;">&#40;</span><a href="http://www.php.net/strtolower"><span style="color: #000066;">strtolower</span></a><span style="color: #66cc66;">&#40;</span><a href="http://www.php.net/trim"><span style="color: #000066;">trim</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$arr</span><span style="color: #66cc66;">&#91;</span><span style="color: #0000ff;">$array_key</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>,<span style="color: #0000ff;">$states</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #808080; font-style: italic;">/* Don't forget your states array */</span>
<a href="http://www.php.net/array"><span style="color: #000066;">array</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'AL'</span>=&gt;<span style="color: #ff0000;">'Alabama'</span>,<span style="color: #ff0000;">'AK'</span>=&gt;<span style="color: #ff0000;">'Alaska'</span><span style="color: #66cc66;">&#41;</span>;</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://sethanderson.net/?feed=rss2&amp;p=3</wfw:commentRss>
		</item>
	</channel>
</rss>
