<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Random Web Tools</title>
	<atom:link href="http://www.randomtools.net/feed" rel="self" type="application/rss+xml" />
	<link>http://www.randomtools.net</link>
	<description>Advice and tools from a young web developer</description>
	<lastBuildDate>Fri, 05 Mar 2010 19:50:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to Properly Test if jQuery is Loaded</title>
		<link>http://www.randomtools.net/how-to-properly-test-if-jquery-is-loaded-144.html</link>
		<comments>http://www.randomtools.net/how-to-properly-test-if-jquery-is-loaded-144.html#comments</comments>
		<pubDate>Fri, 05 Mar 2010 19:49:26 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[How To's]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.randomtools.net/?p=144</guid>
		<description><![CDATA[I saw many people claiming you can test for the existence of jQuery like this:

1
2
3
4
5
if &#40;jQuery&#41; &#123;
	// jQuery exists, put code here
&#125; else &#123;
	// jQuery not loaded, put code here
&#125;

This is incorrect. It will work fine if jQuery is loaded, but if it&#39;s not loaded, javascript will throw an error and the code to execute [...]]]></description>
			<content:encoded><![CDATA[<p>I saw many people claiming you can test for the existence of jQuery like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>jQuery<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #006600; font-style: italic;">// jQuery exists, put code here</span>
<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #006600; font-style: italic;">// jQuery not loaded, put code here</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>This is <strong>incorrect</strong>. It will work fine if jQuery is loaded, but if it&#39;s not loaded, javascript will throw an error and the code to execute if jQuery is not loaded will probably not be processed. The modification to fix this is simple:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>window.<span style="color: #660066;">jQuery</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #006600; font-style: italic;">// jQuery exists, put code here</span>
<span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #006600; font-style: italic;">// jQuery not loaded, put code here</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<div style="width: 300px; height: 300px;"></div>
]]></content:encoded>
			<wfw:commentRss>http://www.randomtools.net/how-to-properly-test-if-jquery-is-loaded-144.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Hide Android WebView Highlight Border (or change it&#8217;s color)</title>
		<link>http://www.randomtools.net/how-to-hide-android-webview-highlight-border-or-change-its-color-142.html</link>
		<comments>http://www.randomtools.net/how-to-hide-android-webview-highlight-border-or-change-its-color-142.html#comments</comments>
		<pubDate>Sat, 27 Feb 2010 23:20:37 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[How To's]]></category>

		<guid isPermaLink="false">http://www.randomtools.net/?p=142</guid>
		<description><![CDATA[Here&#39;s one that had me at a loss for a long time that I just figured out. You can easily remove the highlight border (the border that comes up when an element is focused) or change it&#39;s color in a WebView with CSS! The WebKit-specific property &#34;-webkit-tap-highlight-color&#34; is what you&#39;re looking for.
The following line will [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#39;s one that had me at a loss for a long time that I just figured out. You can easily remove the highlight border (the border that comes up when an element is focused) or change it&#39;s color in a WebView with CSS! The WebKit-specific property &quot;-webkit-tap-highlight-color&quot; is what you&#39;re looking for.</p>
<p>The following line will disable it on a page completely:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #00AA00;">*</span> <span style="color: #00AA00;">&#123;</span>
	-webkit-tap-highlight-<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> rgba<span style="color: #00AA00;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span>	
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>rgba() is just like rgb(), but it takes a 4th parameter for opacity. It&#39;s my belief that this would probably work for iPhone WebView&#39;s as well, since both Chrome and Safari are based off of WebKit.</p>
<div style="width: 300px; height: 300px;"></div>
]]></content:encoded>
			<wfw:commentRss>http://www.randomtools.net/how-to-hide-android-webview-highlight-border-or-change-its-color-142.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows 7 Icons Download</title>
		<link>http://www.randomtools.net/windows-7-icons-download-138.html</link>
		<comments>http://www.randomtools.net/windows-7-icons-download-138.html#comments</comments>
		<pubDate>Wed, 24 Feb 2010 00:54:15 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Downloads]]></category>

		<guid isPermaLink="false">http://www.randomtools.net/?p=138</guid>
		<description><![CDATA[Looking to use Windows 7 icons in your applications or extensions? Download the following file to conveniently access them.
Download Windows 7 Icons Zip File (8.91 MB)


]]></description>
			<content:encoded><![CDATA[<p>Looking to use Windows 7 icons in your applications or extensions? Download the following file to conveniently access them.</p>
<p><a href="http://www.randomtools.net/scripts/Windows_Seven_icon_pack_by_ziomekorko.zip">Download Windows 7 Icons Zip File</a> (8.91 MB)</p>
<div style="width: 300px; height: 300px;"></div>
<p><a href="http://www.randomtools.net/wp-content/uploads/2010/02/Big_Windows_7__s_icons_pack_by_NhatPG.jpg"><img alt="" class="alignright size-medium wp-image-140" height="186" src="http://www.randomtools.net/wp-content/uploads/2010/02/Big_Windows_7__s_icons_pack_by_NhatPG-300x186.jpg" title="Windows 7 Icon Pack" width="300" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.randomtools.net/windows-7-icons-download-138.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP RSS Parser &#8211; RSS Reader Class for PHP</title>
		<link>http://www.randomtools.net/php-rss-parser-rss-reader-class-for-php-133.html</link>
		<comments>http://www.randomtools.net/php-rss-parser-rss-reader-class-for-php-133.html#comments</comments>
		<pubDate>Mon, 22 Feb 2010 05:49:24 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://www.randomtools.net/?p=133</guid>
		<description><![CDATA[Just had to create a quick RSS parser for PHP and thought I&#8217;d post my solution. The implementation and class follows.

1
2
3
4
5
&#60;?php
$rss = new RSSReader&#40;'http://news.google.com/?output=rss'&#41;;
while &#40;$rss -&#62; hasNext&#40;&#41;&#41;
	print_r&#40;$rss -&#62; next&#40;&#41;&#41;;
?&#62;



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
&#60;?php
class RSSReader &#123;
	var $xml = null;
	var $pos = 0;
	var $count = 0;
&#160;
	function __construct&#40;$feed_url&#41; &#123;
		$this -&#62; load_url&#40;$feed_url&#41;;
	&#125;
&#160;
	function load_url&#40;$feed_url&#41; &#123;
		$this -&#62; load_string&#40;file_get_contents&#40;$feed_url&#41;&#41;;
	&#125;
&#160;
	function load_string&#40;$feed_string&#41; &#123;
		$this -&#62; xml = simplexml_load_string&#40;str_replace&#40;'content:encoded', 'content_encoded', [...]]]></description>
			<content:encoded><![CDATA[<p>Just had to create a quick RSS parser for PHP and thought I&#8217;d post my solution. The implementation and class follows.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$rss</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> RSSReader<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'http://news.google.com/?output=rss'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$rss</span> <span style="color: #339933;">-&gt;</span> <span style="color: #004000;">hasNext</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #990000;">print_r</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$rss</span> <span style="color: #339933;">-&gt;</span> <span style="color: #990000;">next</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<div style="width: 300px; height: 300px; clear: both;"></div>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">class</span> RSSReader <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$xml</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$pos</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$count</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span><span style="color: #000088;">$feed_url</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$this</span> <span style="color: #339933;">-&gt;</span> <span style="color: #004000;">load_url</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$feed_url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">function</span> load_url<span style="color: #009900;">&#40;</span><span style="color: #000088;">$feed_url</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$this</span> <span style="color: #339933;">-&gt;</span> <span style="color: #004000;">load_string</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$feed_url</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">function</span> load_string<span style="color: #009900;">&#40;</span><span style="color: #000088;">$feed_string</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$this</span> <span style="color: #339933;">-&gt;</span> <span style="color: #004000;">xml</span> <span style="color: #339933;">=</span> <span style="color: #990000;">simplexml_load_string</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'content:encoded'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'content_encoded'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$feed_string</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$this</span> <span style="color: #339933;">-&gt;</span> <span style="color: #990000;">pos</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$this</span> <span style="color: #339933;">-&gt;</span> <span style="color: #990000;">count</span> <span style="color: #339933;">=</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span> <span style="color: #339933;">-&gt;</span> <span style="color: #004000;">xml</span> <span style="color: #339933;">-&gt;</span> <span style="color: #004000;">channel</span> <span style="color: #339933;">-&gt;</span> <span style="color: #004000;">item</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">function</span> get_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span> <span style="color: #339933;">-&gt;</span> <span style="color: #004000;">xml</span> <span style="color: #339933;">-&gt;</span> <span style="color: #004000;">channel</span> <span style="color: #339933;">-&gt;</span> <span style="color: #004000;">title</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">function</span> get_link<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span> <span style="color: #339933;">-&gt;</span> <span style="color: #004000;">xml</span> <span style="color: #339933;">-&gt;</span> <span style="color: #004000;">channel</span> <span style="color: #339933;">-&gt;</span> <span style="color: #990000;">link</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">function</span> get_pubdate<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span> <span style="color: #339933;">-&gt;</span> <span style="color: #004000;">xml</span> <span style="color: #339933;">-&gt;</span> <span style="color: #004000;">channel</span> <span style="color: #339933;">-&gt;</span> <span style="color: #004000;">pubdate</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">function</span> hasNext<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span> <span style="color: #339933;">-&gt;</span> <span style="color: #990000;">count</span> <span style="color: #339933;">&gt;</span> <span style="color: #000088;">$this</span> <span style="color: #339933;">-&gt;</span> <span style="color: #990000;">pos</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">function</span> <span style="color: #990000;">next</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$obj</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span> <span style="color: #339933;">-&gt;</span> <span style="color: #004000;">xml</span> <span style="color: #339933;">-&gt;</span> <span style="color: #004000;">channel</span> <span style="color: #339933;">-&gt;</span> <span style="color: #004000;">item</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$this</span> <span style="color: #339933;">-&gt;</span> <span style="color: #990000;">pos</span><span style="color: #339933;">++</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
			<span style="color: #0000ff;">'title'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900;">&#40;</span>string<span style="color: #009900;">&#41;</span> <span style="color: #000088;">$obj</span> <span style="color: #339933;">-&gt;</span> <span style="color: #004000;">title</span><span style="color: #339933;">,</span>
			<span style="color: #0000ff;">'link'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900;">&#40;</span>string<span style="color: #009900;">&#41;</span> <span style="color: #000088;">$obj</span> <span style="color: #339933;">-&gt;</span> <span style="color: #990000;">link</span><span style="color: #339933;">,</span>
			<span style="color: #0000ff;">'description'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900;">&#40;</span>string<span style="color: #009900;">&#41;</span> <span style="color: #000088;">$obj</span> <span style="color: #339933;">-&gt;</span> <span style="color: #004000;">description</span><span style="color: #339933;">,</span>
			<span style="color: #0000ff;">'content'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900;">&#40;</span>string<span style="color: #009900;">&#41;</span> <span style="color: #000088;">$obj</span> <span style="color: #339933;">-&gt;</span> <span style="color: #004000;">content_encoded</span><span style="color: #339933;">,</span>
			<span style="color: #0000ff;">'pubDate'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">strtotime</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$obj</span> <span style="color: #339933;">-&gt;</span> <span style="color: #004000;">pubDate</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
		<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.randomtools.net/php-rss-parser-rss-reader-class-for-php-133.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Chrome Extensions: History Button, Extensions Button, Downloads Button</title>
		<link>http://www.randomtools.net/chrome-extensions-history-button-extensions-button-downloads-button-131.html</link>
		<comments>http://www.randomtools.net/chrome-extensions-history-button-extensions-button-downloads-button-131.html#comments</comments>
		<pubDate>Thu, 04 Feb 2010 06:46:45 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.randomtools.net/?p=131</guid>
		<description><![CDATA[I just created some very simple extensions for Chrome shortly after I taught myself how to create extensions.
As I said, they&#39;re VERY simple, but I find them useful, so I figured it wouldn&#39;t hurt to share them.
Each extension is a simple lightweight extension that adds a shortcut button to your browser for quick access to [...]]]></description>
			<content:encoded><![CDATA[<p>I just created some very simple extensions for Chrome shortly after I taught myself how to create extensions.</p>
<p>As I said, they&#39;re VERY simple, but I find them useful, so I figured it wouldn&#39;t hurt to share them.</p>
<p>Each extension is a simple lightweight extension that adds a shortcut button to your browser for quick access to your history, extensions, or downloads. It either opens a new tab, or switches to the respective tab if you already have it open in a tab you&#39;re not using.</p>
<p>You could nearly accomplish the same thing if you made a bookmark, but this assures you won&#39;t open multiple tabs and I like to keep some things separate from the bookmarks bar.</p>
<p><a href="https://chrome.google.com/extensions/detail/hfpnjihjndnmfcbclplooodjmhcdncan" rel="nofollow">Chrome Extensions Button</a></p>
<p><a href="http://chrome.google.com/extensions/detail/ejbmfhgfpejndimejlfghaddkphononj" rel="nofollow">Chrome History Button</a></p>
<p><a href="http://chrome.google.com/extensions/detail/pomlcckbphmgddbhchkpehnfkegaenke" rel="nofollow">Chrome Downloads Button</a></p>
<div style="width: 300px; height: 300px;"></div>
]]></content:encoded>
			<wfw:commentRss>http://www.randomtools.net/chrome-extensions-history-button-extensions-button-downloads-button-131.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>MySQL Select Count Distinct &#8211; Counting and Identifying Duplicate Records</title>
		<link>http://www.randomtools.net/mysql-select-count-distinct-counting-and-identifying-duplicate-records-125.html</link>
		<comments>http://www.randomtools.net/mysql-select-count-distinct-counting-and-identifying-duplicate-records-125.html#comments</comments>
		<pubDate>Fri, 22 Jan 2010 03:23:10 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.randomtools.net/?p=125</guid>
		<description><![CDATA[
Looking for a [relatively] quick way to identify duplicate records in a table and list how many records there are for each duplicate? Look no further.
In my case, I&#8217;ve got a table named Searches which tracks queries on one of my sites. I wanted to check the top queries, so I used this SQL statement:


1
2
3
4
5
SELECT [...]]]></description>
			<content:encoded><![CDATA[<div style="width: 300px; height: 300px; float: left; padding-right: 20px;"></div>
<p>Looking for a [relatively] quick way to identify duplicate records in a table and list how many records there are for each duplicate? Look no further.</p>
<p>In my case, I&#8217;ve got a table named <strong>Searches</strong> which tracks queries on one of my sites. I wanted to check the top queries, so I used this SQL statement:</p>
<div style="width: 350px; overflow: hidden;">

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> COUNT<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">*</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">AS</span> repetitions<span style="color: #66cc66;">,</span> Query
<span style="color: #993333; font-weight: bold;">FROM</span> Searches
<span style="color: #993333; font-weight: bold;">GROUP</span> <span style="color: #993333; font-weight: bold;">BY</span> Query
<span style="color: #993333; font-weight: bold;">HAVING</span> repetitions <span style="color: #66cc66;">&gt;</span> <span style="color: #cc66cc;">1</span>
<span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> repetitions <span style="color: #993333; font-weight: bold;">DESC</span>;</pre></td></tr></table></div>

</div>
<p>There you have it. A simple, effective way to count and label duplicate records.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.randomtools.net/mysql-select-count-distinct-counting-and-identifying-duplicate-records-125.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>30 Google Wave Invites</title>
		<link>http://www.randomtools.net/30-google-wave-invites-118.html</link>
		<comments>http://www.randomtools.net/30-google-wave-invites-118.html#comments</comments>
		<pubDate>Thu, 19 Nov 2009 01:44:50 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.randomtools.net/?p=118</guid>
		<description><![CDATA[







I&#39;ve got 30 more Google Wave invites to give away. Leave a comment with your email and I&#39;ll send them. First come, first serve.
This is actually a nomination and it may take a little while before you get your actual invite.
&#160;
From now on, you must retweet the bitly URL (http://bit.ly/2rwYsG) on twitter and reply to [...]]]></description>
			<content:encoded><![CDATA[<table>
<tbody>
<tr>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<p><a href="http://www.randomtools.net/wp-content/uploads/2009/11/Google-Wave-logo.jpg"><img alt="Google Wave logo" class="alignright size-thumbnail wp-image-120" height="150" src="http://www.randomtools.net/wp-content/uploads/2009/11/Google-Wave-logo-150x150.jpg" title="Google Wave logo" width="150" /></a>I&#39;ve got 30 more Google Wave invites to give away. Leave a comment with your email and I&#39;ll send them. First come, first serve.</p>
<p>This is actually a nomination and it may take a little while before you get your actual invite.</p>
<p>&nbsp;</p>
<p>From now on, you must retweet the bitly URL (http://bit.ly/2rwYsG) on twitter and reply to me in order to get an invite.</p>
<p><strong>Example tweet:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">@xoise Free Google Wave invites: http://bit.ly/2rwYsG #GoogleWave</pre></div></div>

<p>Then put a comment in the comment section and don&#39;t forget your email (doesn&#39;t have to be public).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.randomtools.net/30-google-wave-invites-118.html/feed</wfw:commentRss>
		<slash:comments>46</slash:comments>
		</item>
		<item>
		<title>How to retrive Yahoo Backlinks count with PHP</title>
		<link>http://www.randomtools.net/how-to-retrive-yahoo-backlinks-count-with-php-113.html</link>
		<comments>http://www.randomtools.net/how-to-retrive-yahoo-backlinks-count-with-php-113.html#comments</comments>
		<pubDate>Sun, 08 Nov 2009 19:38:27 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.randomtools.net/?p=113</guid>
		<description><![CDATA[Here&#39;s a simple script to retrieve the approximate number of backlinks Yahoo has for a site. The function and how to call it follows:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
function get_yahoo_backlinks_count&#40;$url&#41; &#123;
	$appid = ''; // get this from https://developer.apps.yahoo.com/wsregapp/
	$url = &#34;http://search.yahooapis.com/WebSearchService/V1/webSearch?appid=$appid&#38;query=site:$url&#38;results=1&#34;;
&#160;
	$ch = curl_init&#40;&#41;;
	curl_setopt&#40;$ch, CURLOPT_URL, $url&#41;;
	curl_setopt&#40;$ch, CURLOPT_RETURNTRANSFER, 1&#41;;
	curl_setopt&#40;$ch, CURLOPT_REFERER, 'http://www.yoursite.com/'&#41;;
	$response = curl_exec&#40;$ch&#41;;
	curl_close&#40;$ch&#41;;
&#160;
	$xml = simplexml_load_string&#40;$response&#41;;
	return $xml -&#62; attributes&#40;&#41; -&#62; totalResultsAvailable;
&#125;
&#160;
echo get_yahoo_backlinks_count&#40;'google.com'&#41;;


]]></description>
			<content:encoded><![CDATA[<p>Here&#39;s a simple script to retrieve the approximate number of backlinks Yahoo has for a site. The function and how to call it follows:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> get_yahoo_backlinks_count<span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$appid</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// get this from https://developer.apps.yahoo.com/wsregapp/</span>
	<span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;http://search.yahooapis.com/WebSearchService/V1/webSearch?appid=<span style="color: #006699; font-weight: bold;">$appid</span>&amp;query=site:<span style="color: #006699; font-weight: bold;">$url</span>&amp;results=1&quot;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$ch</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_URL<span style="color: #339933;">,</span> <span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_RETURNTRANSFER<span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_REFERER<span style="color: #339933;">,</span> <span style="color: #0000ff;">'http://www.yoursite.com/'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_exec</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">curl_close</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$xml</span> <span style="color: #339933;">=</span> <span style="color: #990000;">simplexml_load_string</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$response</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$xml</span> <span style="color: #339933;">-&gt;</span> <span style="color: #004000;">attributes</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-&gt;</span> <span style="color: #004000;">totalResultsAvailable</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> get_yahoo_backlinks_count<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'google.com'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<div style="width: 300px; height: 300px; clear: both;"></div>
]]></content:encoded>
			<wfw:commentRss>http://www.randomtools.net/how-to-retrive-yahoo-backlinks-count-with-php-113.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to retrieve Google Backlinks count with PHP</title>
		<link>http://www.randomtools.net/how-to-retrieve-google-backlinks-count-with-php-109.html</link>
		<comments>http://www.randomtools.net/how-to-retrieve-google-backlinks-count-with-php-109.html#comments</comments>
		<pubDate>Sun, 08 Nov 2009 19:12:06 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.randomtools.net/?p=109</guid>
		<description><![CDATA[Here&#8217;s a simple script to retrieve the approximate number of backlinks Google has for a site. The function and how to call it follows:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function get_google_backlinks_count&#40;$url&#41; &#123;
	$url = &#34;http://ajax.googleapis.com/ajax/services/search/web?v=1.0&#38;amp;q=site:$url&#34;;
&#160;
	$ch = curl_init&#40;&#41;;
	curl_setopt&#40;$ch, CURLOPT_URL, $url&#41;;
	curl_setopt&#40;$ch, CURLOPT_RETURNTRANSFER, 1&#41;;
	curl_setopt&#40;$ch, CURLOPT_REFERER, 'http://www.yoursite.com/'&#41;;
	$response = curl_exec&#40;$ch&#41;;
	curl_close&#40;$ch&#41;;
&#160;
	$json = json_decode&#40;$response&#41;;
	return $json -&#62; responseData -&#62; cursor -&#62; estimatedResultCount;
&#125;
&#160;
echo get_google_backlinks_count&#40;'yahoo.com'&#41;;


]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a simple script to retrieve the approximate number of backlinks Google has for a site. The function and how to call it follows:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> get_google_backlinks_count<span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;http://ajax.googleapis.com/ajax/services/search/web?v=1.0&amp;amp;q=site:<span style="color: #006699; font-weight: bold;">$url</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$ch</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_URL<span style="color: #339933;">,</span> <span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_RETURNTRANSFER<span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">curl_setopt</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_REFERER<span style="color: #339933;">,</span> <span style="color: #0000ff;">'http://www.yoursite.com/'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #990000;">curl_exec</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #990000;">curl_close</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$json</span> <span style="color: #339933;">=</span> <span style="color: #990000;">json_decode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$response</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$json</span> <span style="color: #339933;">-&gt;</span> <span style="color: #004000;">responseData</span> <span style="color: #339933;">-&gt;</span> <span style="color: #004000;">cursor</span> <span style="color: #339933;">-&gt;</span> <span style="color: #004000;">estimatedResultCount</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> get_google_backlinks_count<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'yahoo.com'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<div style="width: 300px; height: 300px; clear: both;"></div>
]]></content:encoded>
			<wfw:commentRss>http://www.randomtools.net/how-to-retrieve-google-backlinks-count-with-php-109.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to fix linux not sending mail problem: Sendmail stat=Deferred: Connection refused by [127.0.0.1]</title>
		<link>http://www.randomtools.net/how-to-fix-linux-not-sending-mail-problem-sendmail-statdeferred-connection-refused-by-127-0-0-1-106.html</link>
		<comments>http://www.randomtools.net/how-to-fix-linux-not-sending-mail-problem-sendmail-statdeferred-connection-refused-by-127-0-0-1-106.html#comments</comments>
		<pubDate>Wed, 28 Oct 2009 20:22:43 +0000</pubDate>
		<dc:creator>Dan</dc:creator>
				<category><![CDATA[How To's]]></category>

		<guid isPermaLink="false">http://www.randomtools.net/?p=106</guid>
		<description><![CDATA[
	I recently experienced a problem where my server was not sending mail from the PHP mail() function or the command line &#34;mail&#34; function. After looking through /var/log/maillog, I was able to see that the local 127.0.0.1 mail server was refusing the connection. Some Google searching landed me at the following thread, where the third post [...]]]></description>
			<content:encoded><![CDATA[<p>
	I recently experienced a problem where my server was not sending mail from the PHP mail() function or the command line &quot;mail&quot; function. After looking through /var/log/maillog, I was able to see that the local 127.0.0.1 mail server was refusing the connection. Some Google searching landed me at the following thread, where the third post did the trick:</p>
<p>
	<a href="http://www.howtoforge.com/forums/showthread.php?t=16246">http://www.howtoforge.com/forums/showthread.php?t=16246</a></p>
<div style="height: 300px; width: 300px; clear: both;">
	</div>
]]></content:encoded>
			<wfw:commentRss>http://www.randomtools.net/how-to-fix-linux-not-sending-mail-problem-sendmail-statdeferred-connection-refused-by-127-0-0-1-106.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
