<?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>mattshaw.org</title>
	<atom:link href="http://mattshaw.org/news/feed/" rel="self" type="application/rss+xml" />
	<link>http://mattshaw.org/news</link>
	<description></description>
	<lastBuildDate>Tue, 13 Sep 2011 21:11:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Enable Page Reloads Even When Flash Has Stolen Keyboard Focus</title>
		<link>http://mattshaw.org/news/enable-page-reloads-even-when-flash-has-stolen-keyboard-focus/</link>
		<comments>http://mattshaw.org/news/enable-page-reloads-even-when-flash-has-stolen-keyboard-focus/#comments</comments>
		<pubDate>Tue, 13 Sep 2011 21:11:39 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[as3]]></category>
		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://mattshaw.org/news/?p=206</guid>
		<description><![CDATA[Sick of having to click elsewhere to unfocus your Flash movie in order to reload (CTRL+R, F5) the page? Splendid. Just listen for the same keyboard events in ActionScript and call the JavaScript yourself. import flash.ui.Keyboard; import flash.events.KeyboardEvent; import flash.external.ExternalInterface; stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown); protected function onKeyDown(e:KeyboardEvent):void { var ctrlR:Boolean = !e.shiftKey &#038;&#038; !e.altKey &#038;&#038; e.ctrlKey &#038;&#038; [...]]]></description>
			<content:encoded><![CDATA[<p>Sick of having to click elsewhere to unfocus your Flash movie in order to reload (CTRL+R, F5) the page? Splendid. Just listen for the same keyboard events in ActionScript and call the JavaScript yourself.</p>
<pre>
import flash.ui.Keyboard;
import flash.events.KeyboardEvent;
import flash.external.ExternalInterface;

stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);

protected function onKeyDown(e:KeyboardEvent):void {
    var ctrlR:Boolean = !e.shiftKey &#038;&#038; !e.altKey &#038;&#038; e.ctrlKey &#038;&#038; e.keyCode == Keyboard.R;
    if ( ctrlR || e.keyCode == Keyboard.F5 ){
        ExternalInterface.call('window.location.reload');
    }
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://mattshaw.org/news/enable-page-reloads-even-when-flash-has-stolen-keyboard-focus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Switching from Eclipse FDT to FlashDevelop 4</title>
		<link>http://mattshaw.org/news/switching-from-eclipse-fdt-to-flashdevelop-4/</link>
		<comments>http://mattshaw.org/news/switching-from-eclipse-fdt-to-flashdevelop-4/#comments</comments>
		<pubDate>Wed, 06 Jul 2011 21:23:33 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[as3]]></category>
		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://mattshaw.org/news/?p=184</guid>
		<description><![CDATA[In this post, I&#8217;ll explain how to make FlashDevelop much more comfortable for an FDT user. FDT is a great tool for Flash development but I found FDT 4 to be a real dog. I loved FDT 3 but I was forced to upgrade to FDT 4 because some newer syntax wasn&#8217;t supported. Using Eclipse [...]]]></description>
			<content:encoded><![CDATA[<p>In this post, I&#8217;ll explain how to make FlashDevelop much more comfortable for an FDT user.</p>
<p>FDT is a great tool for Flash development but I found FDT 4 to be a real dog. I loved FDT 3 but I was forced to upgrade to FDT 4 because some newer syntax wasn&#8217;t supported. Using Eclipse has always been about a 20% love and <a href="http://www.google.com/search?q=eclipse+sucks" target="_blank">80% hate</a> relationship. Eclipse has gotten slower and slower and more bloated over the years. With FDT 4 constantly freezing and eating over 1GB of ram (even on the tiniest of projects), I&#8217;ve decided to make a real effort to jump ship and try FlashDevelop. I&#8217;m working on a large project and FlashDevelop is using about 120MB of RAM after being open for a day!</p>
<p>FlashDevelop&#8217;s features have grown a ton over the years and the community support is great. You can even write plugins without having to get your Masters in Eclipse Plugin Development.</p>
<p>Steps I took:</p>
<h2>1. Install FlashDevelop 4:</h2>
<p><a href="http://www.flashdevelop.org/community/viewforum.php?f=11">http://www.flashdevelop.org/community/viewforum.php?f=11</a></p>
<p>When you download FlashDevelop plugins, you will copy them to:<br />
<strong>%localappdata%\FlashDevelop\Plugins\</strong></p>
<h2>2. Install the QuickNavigate plugin</h2>
<p>This will let you navigate to class members using <strong>Ctrl+Shift+O</strong>. You can change this shortcut in <strong>Program Settings (F10)</strong> to <strong>Ctrl+O</strong> to mimic FDT. Then remove default <strong>Ctrl+O</strong> shortcut for <strong>Open</strong> in <strong>Tools > Keyboard Shortcuts</strong>.</p>
<p><a href="http://flashdevelop.org/community/viewtopic.php?f=4&#038;t=5961">http://flashdevelop.org/community/viewtopic.php?f=4&#038;t=5961</a></p>
<h2>3. Install the Ant plugin</h2>
<p>If you don&#8217;t use Ant, you can skip this. Make sure to download the version for FD4.</p>
<p><a href="http://code.google.com/p/fd-ant-plugin/downloads/list">http://code.google.com/p/fd-ant-plugin/downloads/list</a></p>
<p>You&#8217;ll also need the Ant runtime:<br />
<a href="http://ant.apache.org/bindownload.cgi">http://ant.apache.org/bindownload.cgi</a></p>
<p>In <strong>Program Settings (F10)</strong> under <strong>AntPlugin</strong>, set <strong>Path to Ant</strong> to your Ant runtime folder.</p>
<h2>4. Customize your keyboard shortcuts</h2>
<p>Open <strong>Tools > Keyboard Shortcuts</strong>. Then change:</p>
<p>- <strong>EditMenu.Redo</strong> to <strong>Ctrl+Shift+Z</strong><br />
- <strong>RefactorMenu.CodeGenerator</strong> to <strong>Ctrl+1</strong><br />
- <strong>ProjectMenu.OpenResource</strong> to <strong>Ctrl+Shift+R</strong><br />
- <strong>SearchMenu.ViewReferences</strong> to <strong>Ctrl+R</strong><br />
- <strong>SearchMenu.GotoDeclaration</strong> to <strong>F3</strong><br />
- <strong>SearchMenu.QuickFindNext</strong> to <strong>Ctrl+D</strong> or <strong>Ctrl+K</strong><br />
- <strong>EditMenu.MoveLineDown</strong> to <strong>Alt+Down</strong><br />
- <strong>EditMenu.MoveLineUp</strong> to <strong>Alt+Up</strong><br />
- <strong>RefactorMenu.OrganizeImports</strong> to <strong>Ctrl+Shift+O</strong><br />
- <strong>ModifyMenu.Reload</strong> to <strong>None</strong><br />
- <strong>EditMenu.DuplicateSelection</strong> to <strong>None</strong><br />
- <strong>NewMenu.AS2Document</strong> to <strong>None</strong></p>
<p>I&#8217;ll update this post as I discover more&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://mattshaw.org/news/switching-from-eclipse-fdt-to-flashdevelop-4/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Multi-Part Form POST with Files in Python</title>
		<link>http://mattshaw.org/news/multi-part-form-post-with-files-in-python/</link>
		<comments>http://mattshaw.org/news/multi-part-form-post-with-files-in-python/#comments</comments>
		<pubDate>Wed, 20 Apr 2011 04:34:59 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[python]]></category>
		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://mattshaw.org/news/?p=174</guid>
		<description><![CDATA[This will let you to do a form-style POST with fields/values and also attach files. import httplib, mimetypes def post_multipart(host, uri, fields, files): content_type, body = encode_multipart_formdata(fields, files) h = httplib.HTTPConnection(host) headers = { 'User-Agent': 'INSERT USERAGENTNAME', 'Content-Type': content_type } h.request('POST', uri, body, headers) res = h.getresponse() return res.status, res.reason, res.read() def encode_multipart_formdata(fields, files): """ [...]]]></description>
			<content:encoded><![CDATA[<p>This will let you to do a form-style POST with fields/values and also attach files.</p>
<pre>
import httplib, mimetypes

def post_multipart(host, uri, fields, files):
    content_type, body = encode_multipart_formdata(fields, files)
    h = httplib.HTTPConnection(host)
    headers = {
        'User-Agent': 'INSERT USERAGENTNAME',
        'Content-Type': content_type
        }
    h.request('POST', uri, body, headers)
    res = h.getresponse()
    return res.status, res.reason, res.read() 

def encode_multipart_formdata(fields, files):
    """
    fields is a sequence of (name, value) elements for regular form fields.
    files is a sequence of (name, filename, value) elements for data to be uploaded as files
    Return (content_type, body) ready for httplib.HTTP instance
    """
    BOUNDARY = '----------bound@ry_$'
    CRLF = '\r\n'
    L = []
    for (key, value) in fields:
        L.append('--' + BOUNDARY)
        L.append('Content-Disposition: form-data; name="%s"' % key)
        L.append('')
        L.append(value)
    for (key, filename, value) in files:
        L.append('--' + BOUNDARY)
        L.append('Content-Disposition: form-data; name="%s"; filename="%s"' % (key, filename))
        L.append('Content-Type: %s' % get_content_type(filename))
        L.append('')
        L.append(value)
    L.append('--' + BOUNDARY + '--')
    L.append('')
    body = CRLF.join(L)
    content_type = 'multipart/form-data; boundary=%s' % BOUNDARY
    return content_type, body

def get_content_type(filename):
    return mimetypes.guess_type(filename)[0] or 'application/octet-stream'
</pre>
]]></content:encoded>
			<wfw:commentRss>http://mattshaw.org/news/multi-part-form-post-with-files-in-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash: Print a stack trace in ActionScript3 at any time</title>
		<link>http://mattshaw.org/news/flash-print-a-stack-trace-in-actionscript3-at-any-time/</link>
		<comments>http://mattshaw.org/news/flash-print-a-stack-trace-in-actionscript3-at-any-time/#comments</comments>
		<pubDate>Mon, 28 Mar 2011 21:31:12 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[as3]]></category>

		<guid isPermaLink="false">http://mattshaw.org/news/?p=165</guid>
		<description><![CDATA[Debug player needed, of course. trace( Error(new Error()).getStackTrace() );]]></description>
			<content:encoded><![CDATA[<p>Debug player needed, of course.</p>
<pre>trace( Error(new Error()).getStackTrace() );</pre>
]]></content:encoded>
			<wfw:commentRss>http://mattshaw.org/news/flash-print-a-stack-trace-in-actionscript3-at-any-time/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash FTE Bug #8,192: mirrorRegions is null with lonely newline</title>
		<link>http://mattshaw.org/news/flash-fte-bug-8192-mirrorregions-is-null-with-lonely-newline/</link>
		<comments>http://mattshaw.org/news/flash-fte-bug-8192-mirrorregions-is-null-with-lonely-newline/#comments</comments>
		<pubDate>Wed, 19 Jan 2011 21:57:03 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[as3]]></category>
		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://mattshaw.org/news/?p=151</guid>
		<description><![CDATA[If one of your TextLines has only a newline in it (e.g. two \n after a sentence), then mirrorRegions is null even thought it is clearly set! Thanks, Adobe! import flash.text.engine.TextBlock; import flash.text.engine.GroupElement; var mirror:EventDispatcher = new EventDispatcher(); var block:TextBlock = new TextBlock(); var t:TextElement = new TextElement("test\n\n", new ElementFormat(), mirror) // &#60;--mirror set! block.content [...]]]></description>
			<content:encoded><![CDATA[<p>If one of your TextLines has only a newline in it (e.g. two \n after a sentence), then mirrorRegions is null even thought it is clearly set! Thanks, Adobe!</p>
<pre style='color:#d1d1d1;background:#000000;'>import flash<span style='color:#d2cd86; '>.</span>text<span style='color:#d2cd86; '>.</span>engine<span style='color:#d2cd86; '>.</span>TextBlock<span style='color:#b060b0; '>;</span>
import flash<span style='color:#d2cd86; '>.</span>text<span style='color:#d2cd86; '>.</span>engine<span style='color:#d2cd86; '>.</span>GroupElement<span style='color:#b060b0; '>;</span>

<span style='color:#e66170; font-weight:bold; '>var</span> mirror<span style='color:#b060b0; '>:</span>EventDispatcher <span style='color:#d2cd86; '>=</span> <span style='color:#e66170; font-weight:bold; '>new</span> EventDispatcher<span style='color:#d2cd86; '>(</span><span style='color:#d2cd86; '>)</span><span style='color:#b060b0; '>;</span>
<span style='color:#e66170; font-weight:bold; '>var</span> block<span style='color:#b060b0; '>:</span>TextBlock <span style='color:#d2cd86; '>=</span> <span style='color:#e66170; font-weight:bold; '>new</span> TextBlock<span style='color:#d2cd86; '>(</span><span style='color:#d2cd86; '>)</span><span style='color:#b060b0; '>;</span>
<span style='color:#e66170; font-weight:bold; '>var</span> t<span style='color:#b060b0; '>:</span>TextElement <span style='color:#d2cd86; '>=</span> <span style='color:#e66170; font-weight:bold; '>new</span> TextElement<span style='color:#d2cd86; '>(</span><span style='color:#00c4c4; '>"test</span><span style='color:#008080; '>\n</span><span style='color:#008080; '>\n</span><span style='color:#00c4c4; '>"</span><span style='color:#d2cd86; '>,</span> <span style='color:#e66170; font-weight:bold; '>new</span> ElementFormat<span style='color:#d2cd86; '>(</span><span style='color:#d2cd86; '>)</span><span style='color:#d2cd86; '>,</span> mirror<span style='color:#d2cd86; '>)</span> <span style='color:#9999a9; '>// &lt;--mirror set!</span>
block<span style='color:#d2cd86; '>.</span>content <span style='color:#d2cd86; '>=</span> t

<span style='color:#e66170; font-weight:bold; '>var</span> prevLine<span style='color:#b060b0; '>:</span>TextLine<span style='color:#b060b0; '>;</span>
<span style='color:#e66170; font-weight:bold; '>while</span><span style='color:#d2cd86; '>(</span><span style='color:#008c00; '>1</span><span style='color:#d2cd86; '>)</span><span style='color:#b060b0; '>{</span>
    <span style='color:#e66170; font-weight:bold; '>var</span> line<span style='color:#b060b0; '>:</span>TextLine <span style='color:#d2cd86; '>=</span> block<span style='color:#d2cd86; '>.</span>createTextLine<span style='color:#d2cd86; '>(</span>prevLine<span style='color:#d2cd86; '>)</span><span style='color:#b060b0; '>;</span>
    <span style='color:#e66170; font-weight:bold; '>if</span> <span style='color:#d2cd86; '>(</span>!line<span style='color:#d2cd86; '>)</span> <span style='color:#e66170; font-weight:bold; '>break</span><span style='color:#b060b0; '>;</span>
    <span style='color:#9999a9; '>// This should always trace true but will trace false for the second line!</span>
    trace<span style='color:#d2cd86; '>(</span><span style='color:#00c4c4; '>"Has mirrors? "</span> <span style='color:#d2cd86; '>+</span> <span style='color:#d2cd86; '>(</span>line<span style='color:#d2cd86; '>.</span>mirrorRegions<span style='color:#d2cd86; '>!=</span><span style='color:#0f4d75; '>null</span><span style='color:#d2cd86; '>)</span><span style='color:#d2cd86; '>)</span><span style='color:#b060b0; '>;</span>
    prevLine <span style='color:#d2cd86; '>=</span> line<span style='color:#b060b0; '>;</span>
<span style='color:#b060b0; '>}</span>
</pre>
<p>This lovely code should trace:<br />
<code>Has mirrors? true<br />
Has mirrors? true</code></p>
<p>But instead traces:<br />
<code>Has mirrors? true<br />
Has mirrors? false</code></p>
]]></content:encoded>
			<wfw:commentRss>http://mattshaw.org/news/flash-fte-bug-8192-mirrorregions-is-null-with-lonely-newline/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apple&#8217;s Dumbing Down of Computers a.k.a The End of Super-User Computers</title>
		<link>http://mattshaw.org/news/apples-dumbing-down-of-computers-a-k-a-the-end-of-super-user-computers/</link>
		<comments>http://mattshaw.org/news/apples-dumbing-down-of-computers-a-k-a-the-end-of-super-user-computers/#comments</comments>
		<pubDate>Thu, 21 Oct 2010 17:17:55 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[apple]]></category>
		<category><![CDATA[news]]></category>

		<guid isPermaLink="false">http://unformatt.com/news/?p=122</guid>
		<description><![CDATA[Warning: Hyperbole and blind speculation follows. Apple was always touted as having the more user-friendly computer. At a high level, they aren&#8217;t any different than PCs. You click around, install software, plug in some hardware, configure some system preferences and download programs from wherever you want. Macs have a few less buttons and subjectively prettier [...]]]></description>
			<content:encoded><![CDATA[<p><em>Warning: Hyperbole and blind speculation follows.</em></p>
<p>Apple was always touted as having the more user-friendly computer. At a high level, they aren&#8217;t any different than PCs. You click around, install software, plug in some hardware, configure some system preferences and download programs from wherever you want. Macs have a few less buttons and subjectively prettier UI &#8211; which I guess lends to its ease of use. However, from Grandma&#8217;s point of view, it&#8217;s not much easier to use than a PC. There are lots of confusing icons, menus, and tiny text. Click the wrong thing, open the wrong app &#8211; how do you get back? Grandma is lost. In the end, it&#8217;s still hard to use for the layman.</p>
<p>I&#8217;d often wonder, in 50 years will everyone be a computer expert? A lot of our parents were around before 8-Tracks existed. So, it makes sense that understanding USB, HDMI, Gmail, or Playstation is not second nature. In 50 years, will Moms know how to get rid of spyware and install a new harddrive?* Will the general population&#8217;s knowledge of computers increase? Then I thought of cars which were a technical marvel at one point. Nowadays, most people have no idea how their car works but if they&#8217;re lucky, they can change the oil themselves.</p>
<p>Back to Apple. When iPad rumors were floating around, a lot of people were thinking it would be a tablet with OS X and USB ports and expandability and good times &#8211; like a &#8220;real&#8221; computer. Then it launched and Jobs was so excited to show us it ran iOS and had access to the App Store. Something clicked in my mind when that happened. I knew that when you own a Mac (I don&#8217;t) you pay the Apple Tax. You pay for more software, you pay for over-priced accessories and you pay to buy a new computer every year or two because of Apple&#8217;s slowing-dripping must-have features. We always knew Jobs was a control freak and perfectionist. However, Jobs&#8217; want for total control was never as clear as it was when the iPad launched with iOS and the AppStore.</p>
<p>Apple doesn&#8217;t want you use your computer to control an <a href="http://www.arduino.cc/">Arduino</a>, write custom printer drivers, run a game server or control your house lights. They want you to shut up and consume. Us nerds? We&#8217;re fine with our Space Station Control computers. But everyone else? Apple wants them to have their iPad, bag of Cheetos and credit card handy. You want to watch 30 Rock on your iPad? Apple gets 30%. You want to buy the latest BedazzleMyAngryBirdGemLoop game? Apple get 30% and could not be happier.</p>
<p>But let&#8217;s not get carried away. Everyone still has their Mac laptops and towers and they&#8217;re free to do what they want with them &#8211; for now. Apple&#8217;s <a href="http://www.engadget.com/2010/10/20/app-store-for-os-x-unveiled/">announcement </a> yesterday signifies another big leap forward in the controlling and dumbing down of consumer computers. The AppStore will now be running right on your lovely desktops and laptops! Please <a href="http://www.slashgear.com/firefox-director-says-apple-is-looking-to-bypass-the-web-21109568/">do not go elsewhere</a> for software. AppStore software is safe and Steve-Certified. Stop going on the internet. Stop visiting websites. Just get the app, pay for the subscription and live merrily. Can you see where this is going? Really, the majority of computers <i>should</i> be running something like iOS and us nerds should have our super-computers. The problem is that Apple is in control and what can that mean? </p>
<p>Firstly, I think it means Apple could shift towards selling desktops with iOS &#8211; this is all the functionality that most people need. The rest of you, you&#8217;ll have to pay for an expensive &#8220;developer&#8221; or &#8220;professional&#8221; computer and a license to be in the &#8220;professional&#8221; program to have your open OS X operating system. Your computer will also cost a lot more because you&#8217;re a professional. So Apple can bump up the profit margin that it once lost because of the commodification of fast computers.</p>
<p>Second is the problem that <a href="http://www.bit-101.com/blog/?p=2878">Bit-101</a> brings up. The AppStore will be the defacto place to go to get any software. You know Apple will promote the shit out of it. Your new mac with have a Safari icon, an iTunes AppStore icon and an icon of Steve Jobs&#8217; head that will tell you want to eat for lunch (and he gets 30% for the referral). So now, as a developer, if you want to sell your software it better be in the AppStore. If not, Mom will never find it and Mom wouldn&#8217;t trust it if she did. So, please pony up $99 for Apple&#8217;s developer program and start learning Objective C. Well, since you&#8217;re now in the AppStore &#8211; how does your app work on the iPad? The iPhone? The iPod touch? (What was Jobs saying about <a href="http://edition.cnn.com/2010/TECH/mobile/10/18/apple.earnings/">fragmentation</a>?) Better go buy all 3. Jobs loves fragmentation if it means you have to buy all his devices.</p>
<p>So, while I don&#8217;t like Apple&#8217;s general direction, I do think that an iOS-like OS is great for consumer computers. I&#8217;m just not sure it&#8217;s great for the rest of us and everyone&#8217;s wallets when Apple is in control.</p>
<p>*We probably won&#8217;t have spyware or harddrives in 50 years, eh?</p>
]]></content:encoded>
			<wfw:commentRss>http://mattshaw.org/news/apples-dumbing-down-of-computers-a-k-a-the-end-of-super-user-computers/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>mysql_secure_installation: ERROR 1045 (28000): Access denied for user &#8216;root&#8217;@&#039;localhost&#8217; (using password: NO)</title>
		<link>http://mattshaw.org/news/mysql_secure_installation-error-1045-28000-access-denied-for-user-rootlocalhost-using-password-no/</link>
		<comments>http://mattshaw.org/news/mysql_secure_installation-error-1045-28000-access-denied-for-user-rootlocalhost-using-password-no/#comments</comments>
		<pubDate>Sat, 11 Sep 2010 04:59:10 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[admin]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://unformatt.com/news/?p=112</guid>
		<description><![CDATA[Getting this error when trying to run mysql_secure_installation even though you are entering the correct password? ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) This can happen if you have a hash or something weird in your password (it&#8217;s a bug). Time to change it! I like to do it this way [...]]]></description>
			<content:encoded><![CDATA[<p>Getting this error when trying to run <strong>mysql_secure_installation</strong> even though you <em>are</em> entering the correct password?</p>
<pre>ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)</pre>
<p>This can happen if you have a hash or something weird in your password (<a href="http://bugs.mysql.com/bug.php?id=48031">it&#8217;s a bug</a>). Time to change it! I like to do it this way so it doesn&#8217;t leave my password in my command history:</p>
<pre>
mysql -u root -p
use mysql;
update user set password=PASSWORD("something-cool") where user='root';
flush privileges;
quit
</pre>
]]></content:encoded>
			<wfw:commentRss>http://mattshaw.org/news/mysql_secure_installation-error-1045-28000-access-denied-for-user-rootlocalhost-using-password-no/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adobe Flex Builder + Air 2: Nothing Happens, nothing shows or &#8220;invocation forwarded to primary instance&#8221;</title>
		<link>http://mattshaw.org/news/adobe-flex-builder-air-nothing-happens-nothing-shows-or-invocation-forwarded-to-primary-instance/</link>
		<comments>http://mattshaw.org/news/adobe-flex-builder-air-nothing-happens-nothing-shows-or-invocation-forwarded-to-primary-instance/#comments</comments>
		<pubDate>Tue, 03 Aug 2010 17:56:51 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://unformatt.com/news/?p=98</guid>
		<description><![CDATA[An obscure one, hard to Google. I was trying to use NativeProcess which is newly available in AIR 2.0. I wedged the AIR SDK into my Flex 3 SDK, then created a new AIR app. When I tried to run it (or debug it), nothing happened. If I tried to run it again, I got [...]]]></description>
			<content:encoded><![CDATA[<p>An obscure one, hard to Google. I was trying to use NativeProcess which is newly available in AIR 2.0. I wedged the AIR SDK into my Flex 3 SDK, then created a new AIR app. When I tried to run it (or debug it), nothing happened. If I tried to run it again, I got &#8220;invocation forwarded to primary instance&#8221;. This means that adl.exe is already running. You&#8217;ll have to kill that process. If I removed the reference to NativeProcess, everything ran fine. Turns out, my app.xml still referenced the AIR 1.5. Naturally, NativeProcess is not available in AIR 1.5 &#8211; but how about a damn error, Adobe? Silent failures are very AS1.</p>
<p><strong>In *-app.xml</strong></p>
<p>Was:</p>
<pre>
&lt;application xmlns="http://ns.adobe.com/air/application/1.5"&gt;
</pre>
<p>Changed to:</p>
<pre>
&lt;application xmlns="http://ns.adobe.com/air/application/2.0"&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://mattshaw.org/news/adobe-flex-builder-air-nothing-happens-nothing-shows-or-invocation-forwarded-to-primary-instance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using FTE CFF Font in Flash: Class mx.core::FontAsset could not be found.</title>
		<link>http://mattshaw.org/news/using-cff-font-in-flash-class-mxcorefontasset-could-not-be-found/</link>
		<comments>http://mattshaw.org/news/using-cff-font-in-flash-class-mxcorefontasset-could-not-be-found/#comments</comments>
		<pubDate>Tue, 27 Jul 2010 19:07:02 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[flash]]></category>
		<category><![CDATA[flex]]></category>

		<guid isPermaLink="false">http://unformatt.com/news/?p=94</guid>
		<description><![CDATA[This happened when I was using a CFF font in a non-Flex project. I compiled my font and the Flex compiler will leave out FontAsset because it thinks the host SWF will have this class &#8211; well, not so if it&#8217;s not Flex. So, when compiling your font you have to tell the compiler to [...]]]></description>
			<content:encoded><![CDATA[<p>This happened when I was using a CFF font in a non-Flex project. I compiled my font and the Flex compiler will leave out FontAsset because it thinks the host SWF will have this class &#8211; well, not so if it&#8217;s not Flex. So, when compiling your font you have to tell the compiler to include any Flex classes in your font SWF:</p>
<pre>
-static-link-runtime-shared-libraries=true
</pre>
]]></content:encoded>
			<wfw:commentRss>http://mattshaw.org/news/using-cff-font-in-flash-class-mxcorefontasset-could-not-be-found/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apache Error: Unknown DAV provider: svn</title>
		<link>http://mattshaw.org/news/apache-error-unknown-dav-provider-svn/</link>
		<comments>http://mattshaw.org/news/apache-error-unknown-dav-provider-svn/#comments</comments>
		<pubDate>Fri, 18 Jun 2010 19:33:11 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://unformatt.com/news/?p=89</guid>
		<description><![CDATA[This happened after I updated SVN but I guess I didn&#8217;t update some Apache svn mod crap. This also caused a problem with Trac &#8211; Unsupported version control system &#8220;svn&#8221;. I fixed it on CentOS with a simple: sudo yum install mod_dav_svn]]></description>
			<content:encoded><![CDATA[<p>This happened after I updated SVN but I guess I didn&#8217;t update some Apache svn mod crap. This also caused a problem with Trac &#8211; Unsupported version control system &#8220;svn&#8221;. </p>
<p>I fixed it on CentOS with a simple:</p>
<pre>
sudo yum install mod_dav_svn
</pre>
]]></content:encoded>
			<wfw:commentRss>http://mattshaw.org/news/apache-error-unknown-dav-provider-svn/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python mechanize gzip response handling</title>
		<link>http://mattshaw.org/news/python-mechanize-gzip-response-handling/</link>
		<comments>http://mattshaw.org/news/python-mechanize-gzip-response-handling/#comments</comments>
		<pubDate>Tue, 01 Jun 2010 22:18:27 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://unformatt.com/news/?p=83</guid>
		<description><![CDATA[Mechanize is awesome. The documentation is shit. The gzip support is non-existent. Some sites like Yahoo! require gzip support. def ungzipResponse(r,b): headers = r.info() if headers['Content-Encoding']=='gzip': import gzip gz = gzip.GzipFile(fileobj=r, mode='rb') html = gz.read() gz.close() headers["Content-type"] = "text/html; charset=utf-8" r.set_data( html ) b.set_response(r) b = Browser() b.addheaders.append( ['Accept-Encoding','gzip'] ) r = b.open('http://some-gzipped-site.com') ungzipResponse(r,b) print [...]]]></description>
			<content:encoded><![CDATA[<p>Mechanize is awesome. The documentation is shit. The gzip support is non-existent. Some sites like Yahoo! require gzip support.</p>
<pre>
def ungzipResponse(r,b):
	headers = r.info()
	if headers['Content-Encoding']=='gzip':
		import gzip
		gz = gzip.GzipFile(fileobj=r, mode='rb')
		html = gz.read()
		gz.close()
		headers["Content-type"] = "text/html; charset=utf-8"
		r.set_data( html )
		b.set_response(r)

b = Browser()
b.addheaders.append( ['Accept-Encoding','gzip'] )
r = b.open('http://some-gzipped-site.com')
ungzipResponse(r,b)
print r.read()
</pre>
]]></content:encoded>
			<wfw:commentRss>http://mattshaw.org/news/python-mechanize-gzip-response-handling/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash/Flex: VerifyError: Error #1033: Cpool entry is wrong type.</title>
		<link>http://mattshaw.org/news/flashflex-verifyerror-error-1033-cpool-entry-is-wrong-type/</link>
		<comments>http://mattshaw.org/news/flashflex-verifyerror-error-1033-cpool-entry-is-wrong-type/#comments</comments>
		<pubDate>Mon, 10 May 2010 19:47:04 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://unformatt.com/news/?p=66</guid>
		<description><![CDATA[Of course &#8211; the damn Cpool! I have no idea what this means but it happens when I compile a Flash 10 SWF with the Flex 4 SDK then accidentally run it in the Flash 9 player. Make sure you&#8217;re running it in Flash 10.]]></description>
			<content:encoded><![CDATA[<p>Of course &#8211; the damn Cpool! I have no idea what this means but it happens when I compile a Flash 10 SWF with the Flex 4 SDK then accidentally run it in the Flash 9 player. Make sure you&#8217;re running it in Flash 10.</p>
]]></content:encoded>
			<wfw:commentRss>http://mattshaw.org/news/flashflex-verifyerror-error-1033-cpool-entry-is-wrong-type/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Steve Jobs: Ironic Master of DoubleSpeak? (Yes, 1984)</title>
		<link>http://mattshaw.org/news/steve-jobs-ironic-master-of-doublespeak-yes-1984/</link>
		<comments>http://mattshaw.org/news/steve-jobs-ironic-master-of-doublespeak-yes-1984/#comments</comments>
		<pubDate>Thu, 29 Apr 2010 16:09:52 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[wtf]]></category>

		<guid isPermaLink="false">http://unformatt.com/news/?p=46</guid>
		<description><![CDATA[I&#8217;ve never really written anything on this blog. Just a bunch of code snippets. For whatever reason I felt compelled to say something but maybe today I should have had some coffee before reading Steve Jobs&#8217;s's latest Flash bullshit. No idea why SJ was even compelled to write a public message. There&#8217;s no substance here [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve never really written anything on this blog. Just a bunch of code snippets. For whatever reason I felt compelled to say something but maybe today I should have had some coffee before reading <a href="http://www.apple.com/hotnews/thoughts-on-flash/">Steve Jobs&#8217;s's latest Flash bullshit</a>. No idea why SJ was even compelled to write a public message. There&#8217;s no substance here &#8211; it&#8217;s just Steve pointing fingers on the playground. </p>
<p>I don&#8217;t really care if Flash is on the iPhone or not but since I&#8217;m quite familiar with the technology, it&#8217;s an interesting topic to me. Steve should just write his real one-sentence explanation (did Shantanu Narayen make fun of turtlenecks?) but instead he spews an essay of bull crap.</p>
<blockquote><p>why we do not allow Flash on iPhones, iPods and iPads&#8230;is based on technology issues</p></blockquote>
<p>So, admittedly, the iPhone is inferior to other phones because there are plenty of other phones that will be running Flash in 2010.</p>
<blockquote><p>Adobe’s Flash products are 100% proprietary. They are only available from Adobe, and Adobe has sole authority as to their future enhancement, pricing, etc.</p></blockquote>
<p>Remember that company Pystar that tried to sell hardware to run OS X? Stevie did not like that at all. Only Stevie is allowed to sell proprietary hardware and software at a huge markup. I won&#8217;t argue whether or not Flash or the player should be considered &#8220;proprietary&#8221; and not &#8220;open&#8221; because while the official player is not open-source, many Flash-related things are. </p>
<p>So, as it is right now, the iPhone does not like to support any proprietary technology. (Sarcasm intended)</p>
<p>This <a href="http://apple.slashdot.org/comments.pl?sid=1635814&#038;cid=32030576">Slashdot comment</a> puts it well:</p>
<blockquote><p>
Exactly, and the software/iPhone is not only proprietary, but actually  restricted too. It&#8217;s even worse than just proprietary software.</p>
<p>- Open source: Nobody restricts where you can install the application, and you get the source code too &#8212; the best situation.<br />
- Proprierary software: You dont get the source code, but nobody is restricting where or if you can install it, as long as its freeware or you have paid for it.<br />
- Apple: Not only will you not get the source code and in most cases you have to pay for it, Apple is in total control what applications the user is allowed to install. They dont even give you the option to decide yourself.</p>
<p>If you want to sell your software in App Store, you are not allowed to redistribute the source code or your app outside of it.</p>
<p>While certainly true, making a comment about Flash being proprietary is just hypocrisy and at the same time hilarious from Steve Jobs and Apple.</p></blockquote>
<p>Back to Steve&#8230;</p>
<blockquote><p>Apple has many proprietary products too. Though the operating system for the iPhone, iPod and iPad is proprietary, we strongly believe that all standards pertaining to the web should be open.</p></blockquote>
<p>Stevie will be closed and proprietary where he sees fit &#8211; let&#8217;s just confirm &#8211; he not actually against being closed and proprietary. That&#8217;s cool, it&#8217;s his platform. Let&#8217;s just not make up bullshit reasons, Stevie.</p>
<blockquote><p>Apple even creates open standards for the web&#8230;with a small open source project and created WebKit</p></blockquote>
<p>Stevie, creating a web browser is not <i>creating</i> a standard. Your web browser is <i>adopting</i> standards.</p>
<blockquote><p>almost all this video is also available in a more modern format, H.264</p></blockquote>
<p>Ah, the good ol&#8217;, <a href="http://www.streamingmedia.com/Articles/ReadArticle.aspx?ArticleID=65357">open-source, patent-free, license-free</a> H.264. </p>
<p>Hiliarous &#8211; where are your footnotes Steve? Just because most videos are on YouTube means most of the videos on the internet are available in H.264? </p>
<blockquote><p>iPad offering perhaps the best YouTube discovery and viewing experience ever</p></blockquote>
<p>Thank you for tossing in some signature hyperbole. How long did I have to wait to even see YouTube comments on my iPhone? Cutting edge shit.</p>
<blockquote><p>video from Vimeo, Netflix, Facebook, ABC, CBS, CNN, MSNBC, Fox News, ESPN, NPR, Time, The New York Times, The Wall Street Journal, Sports Illustrated, People, National Geographic, and many, many others.</p></blockquote>
<p>So, instead of Apple putting in some work to adopt Flash, they put all the work onto the content creators to make their sites work correctly with the iPhone &#8211; or better yet make a custom iPhone app. Well, at least they can use CS5 to streamline the process of making their Flash website for the iPhone. Oh wait.</p>
<blockquote><p>We also know first hand that Flash is the number one reason Macs crash&#8230;We don’t want to reduce the reliability and security of our iPhones, iPods and iPads by adding Flash.</p></blockquote>
<p>This is understandable. My iPhone already crashes all the time without the help of Apple ignoring Adobe&#8217;s needs to integrate with OS APIs. I guess if my phone can&#8217;t open Google Maps without freezing for 20 seconds, then Steve is right: I don&#8217;t know how it would run Flash.</p>
<blockquote><p> on an iPhone, for example, H.264 videos play for up to 10 hours</p></blockquote>
<p>I&#8217;m lucky if I get 10 hrs of email and web on my iPhone. I guess checking email is more intense than video decoding. Tethering eats a shitload of battery too. Yea, Stevie, I jailbroke your shit.</p>
<blockquote><p>When websites re-encode their videos using H.264, they can offer them without using Flash at all.</p></blockquote>
<p>Yes. When other people do extra work while Steve is playing golf, everyone wins. Ok, I take that one back. Steve wouldn&#8217;t play golf, he&#8217;s more of a Jai Alai player.</p>
<blockquote><p>Apple’s revolutionary multi-touch interface&#8230;there is no concept of a rollover.</p></blockquote>
<p>&#8220;Revolutionary&#8221;&#8230;.&#8221;no concept of&#8221;</p>
<blockquote><p>many Flash websites rely on “rollovers”</p></blockquote>
<p>Rollovers are never used in HTML. I&#8217;ve never seen a navigation menu in HTML that reveals on rollover. Ever.</p>
<blockquote><p>If developers need to rewrite their Flash websites, why not use modern technologies like HTML5, CSS and JavaScript?</p></blockquote>
<p>Because the shit is already made Steven! Now they have to recreate their entire site because they had a rollover? You&#8217;re a dick.</p>
<blockquote><p>Flash&#8230;doesn’t support touch based devices</p></blockquote>
<p><a href="http://theflashblog.com/?p=1666">Really?</a></p>
<blockquote><p>Adobe should focus&#8230;less on criticizing Apple for leaving the past behind.</p></blockquote>
<p>Objective-C&#8230;that&#8217;s from what like 1986? HTML is from like 1989? Oh, HTML <b>FIVE</b>; That is new! However, Flash 10: That&#8217;s in the past.</p>
<p>Steve then ends with some bullshit about how you can&#8217;t make good apps with third-party dev tools because they can&#8217;t keep up with platform advancements. Steve does not want some third-party software to get in the way of having basic functionality like copy-and-paste, MMS, or landscape typing. Apple will do just fine making you wait 2 years for that. It does not need your help.</p>
<p>For the record, I own an iPhone but I&#8217;ve never owned an Apple computer for the reasons above. Not until the iPad came out was Apple&#8217;s rabid consumerism so apparent. It was there all along, but the iPad really brought it to light. It&#8217;s just a mobile siphon to your bank account.  &#8220;Think Different&#8221; no longer applies. Jobs doesn&#8217;t want you to think at all, just do as he says, the way he says it and keep buying shit.</p>
<p>Well, I know I&#8217;ll be having a fun time making apps for Android with whatever tools I want. </p>
<p>Sorry about that, back to work.</p>
]]></content:encoded>
			<wfw:commentRss>http://mattshaw.org/news/steve-jobs-ironic-master-of-doublespeak-yes-1984/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Change Drupal Theme Based On URL Path</title>
		<link>http://mattshaw.org/news/change-drupal-theme-based-on-url-path/</link>
		<comments>http://mattshaw.org/news/change-drupal-theme-based-on-url-path/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 18:36:30 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[hacks]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://unformatt.com/news/?p=39</guid>
		<description><![CDATA[You could spend 9 years looking for a module to do it or you could do this. Put this in your settings.php $THEME_URLS = array( array('/admin','garland'), # Drupal already support admin theme anywho array('/users','fancy_user_theme'), array('/forum','forums_theme'), ); foreach ( $THEME_URLS as $info) if ( strpos($_SERVER['REQUEST_URI'],$info[0])===0) $conf['theme_default'] = $info[1];]]></description>
			<content:encoded><![CDATA[<p>You could spend 9 years looking for a module to do it or you could do this. Put this in your settings.php</p>
<pre>
$THEME_URLS = array(
	array('/admin','garland'), # Drupal already support admin theme anywho
	array('/users','fancy_user_theme'),
	array('/forum','forums_theme'),
	);
foreach ( $THEME_URLS as $info)
	if ( strpos($_SERVER['REQUEST_URI'],$info[0])===0)
		$conf['theme_default'] = $info[1];
</pre>
]]></content:encoded>
			<wfw:commentRss>http://mattshaw.org/news/change-drupal-theme-based-on-url-path/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Find Biggest MySQL Tables</title>
		<link>http://mattshaw.org/news/find-biggest-mysql-tables/</link>
		<comments>http://mattshaw.org/news/find-biggest-mysql-tables/#comments</comments>
		<pubDate>Tue, 23 Mar 2010 16:39:22 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://unformatt.com/news/?p=35</guid>
		<description><![CDATA[I found a great snippet for this from Peter Zaitsev. I modified it to show the size in MB instead of GB (Sorry my databases aren&#8217;t that awesome!). Peter&#8217;s code lists the biggest tables from all databases; I prefer to list tables just for one database so I added a WHERE. SELECT concat(table_schema,'.',table_name), concat(round(table_rows/1000000,2),'M') rows, [...]]]></description>
			<content:encoded><![CDATA[<p>I found a great snippet for this from <a href="http://www.mysqlperformanceblog.com/2008/02/04/finding-out-largest-tables-on-mysql-server/">Peter Zaitsev</a>. I modified it to show the size in MB instead of GB (Sorry my databases aren&#8217;t that awesome!).  Peter&#8217;s code lists the biggest tables from all databases; I prefer to list tables just for one database so I added a WHERE.</p>
<pre>
SELECT	concat(table_schema,'.',table_name),
	concat(round(table_rows/1000000,2),'M') rows,
	concat(round(data_length/(1024*1024),2),'MB') DATA,
	concat(round(index_length/(1024*1024),2),'MB') idx,
	concat(round((data_length+index_length)/(1024*1024),2),'MB') total_size,
	round(index_length/data_length,2) idxfrac
FROM information_schema.TABLES
WHERE table_schema = 'my_database_name'
ORDER BY data_length+index_length DESC LIMIT 10;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://mattshaw.org/news/find-biggest-mysql-tables/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Disable Enter Button for a Form in jQuery</title>
		<link>http://mattshaw.org/news/disable-enter-button-for-a-form-in-jquery/</link>
		<comments>http://mattshaw.org/news/disable-enter-button-for-a-form-in-jquery/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 21:03:18 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[ajax]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://unformatt.com/news/?p=31</guid>
		<description><![CDATA[$("#form").keypress(function(e){ return e.which != 13; });]]></description>
			<content:encoded><![CDATA[<p><code><br />
$("#form").keypress(function(e){ return e.which != 13; });<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://mattshaw.org/news/disable-enter-button-for-a-form-in-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Checkboxes and Vertical Text Alignment</title>
		<link>http://mattshaw.org/news/checkboxes-and-vertical-text-alignment/</link>
		<comments>http://mattshaw.org/news/checkboxes-and-vertical-text-alignment/#comments</comments>
		<pubDate>Thu, 02 Oct 2008 19:58:10 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://unformatt.com/news/checkboxes-and-vertical-text-alignment/</guid>
		<description><![CDATA[You set the vertical-align on the checkbox, not the parent div or the text. Intuitive. Works in Firefox and IE. &#60;style&#62; * { font-size: 10px; } #cb { vertical-align: text-bottom; _vertical-align: middle; padding: 0 !important; margin: 0 !important; } &#60;/style&#62; &#60;div&#62; &#60;input id="cb" type="checkbox"/&#62; Checkbox &#60;/div&#62;]]></description>
			<content:encoded><![CDATA[<p>You set the vertical-align on the checkbox, not the parent div or the text. Intuitive. Works in Firefox and IE.</p>
<pre>
&lt;style&gt;
    * {
        font-size: 10px;
    }
    #cb {
        vertical-align: text-bottom;
        _vertical-align: middle;
        padding: 0 !important;
        margin: 0 !important;
    }
&lt;/style&gt;
&lt;div&gt;
    &lt;input id="cb" type="checkbox"/&gt; Checkbox
&lt;/div&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://mattshaw.org/news/checkboxes-and-vertical-text-alignment/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mod_rewrite During Site Maintenance by IP Address</title>
		<link>http://mattshaw.org/news/mod_rewrite-during-site-maintenance-by-ip-address/</link>
		<comments>http://mattshaw.org/news/mod_rewrite-during-site-maintenance-by-ip-address/#comments</comments>
		<pubDate>Tue, 19 Aug 2008 18:58:50 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[admin]]></category>
		<category><![CDATA[apache]]></category>

		<guid isPermaLink="false">http://unformatt.com/news/mod_rewrite-during-site-maintenance-by-ip-address/</guid>
		<description><![CDATA[If you are performing site maintenance, you can redirect all users to a maintenance page while letting yourself through by IP address: .htaccess # If user IP is NOT 123.123.123.123, then redirect to maintenance.html # (Don't forget to escape the dots) RewriteCond %{REMOTE_ADDR} !123\\.123\\.123\\.123 RewriteRule .* /maintenance.html [L]]]></description>
			<content:encoded><![CDATA[<p>If you are performing site maintenance, you can redirect all users to a maintenance page while letting yourself through by IP address:</p>
<p><strong>.htaccess</strong></p>
<pre>
# If user IP is NOT 123.123.123.123, then redirect to maintenance.html
# (Don't forget to escape the dots)
RewriteCond %{REMOTE_ADDR} !123\\.123\\.123\\.123
RewriteRule .* /maintenance.html [L]
</pre>
]]></content:encoded>
			<wfw:commentRss>http://mattshaw.org/news/mod_rewrite-during-site-maintenance-by-ip-address/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Non-Standard SSH Ports with Tortoise SVN</title>
		<link>http://mattshaw.org/news/non-standard-ssh-ports-with-tortoise-svn/</link>
		<comments>http://mattshaw.org/news/non-standard-ssh-ports-with-tortoise-svn/#comments</comments>
		<pubDate>Tue, 19 Aug 2008 18:49:07 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[hacks]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://unformatt.com/news/non-standard-ssh-ports-with-tortoise-svn/</guid>
		<description><![CDATA[Supernifty shows a quick hack for this but it doesn&#8217;t work for multiple SVN servers. So you can take it one step further and put a batch script in between which will let you enter the port number in your connection string and it will pull it out and pass it to TortoisePlink. Save this [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.supernifty.com.au/blog/2007/09/27/hack-it-1-change-the-tortoisesvn-ssh-port/">Supernifty</a> shows a quick hack for this but it doesn&#8217;t work for multiple SVN servers. So you can take it one step further and put a batch script in between which will let you enter the port number in your connection string and it will pull it out and pass it to TortoisePlink. Save this script as something like ssh_router.bat and then go to TortoiseSVN->Settings->Network and set the SSH client to ssh_router.bat. Now you can pass this type of connection string to Tortoise: <strong>svn+ssh://user@host.com:123456/svn/blah/</strong></p>
<pre>
@echo off
set HOST=%1
set PORT=%HOST:*:=%

IF [%PORT%]==[%HOST%] (
    set PORT=22
)

c:\\Progra~1\\TortoiseSVN\\bin\\TortoisePlink.exe -P %PORT% %HOST% %2 %3</pre>
<p><span id="more-27"></span></p>
]]></content:encoded>
			<wfw:commentRss>http://mattshaw.org/news/non-standard-ssh-ports-with-tortoise-svn/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>AS3: MP3 Player</title>
		<link>http://mattshaw.org/news/as3-mp3-player/</link>
		<comments>http://mattshaw.org/news/as3-mp3-player/#comments</comments>
		<pubDate>Wed, 04 Jun 2008 21:20:12 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[as3]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[flash]]></category>

		<guid isPermaLink="false">http://unformatt.com/news/as3-mp3-player/</guid>
		<description><![CDATA[Usage: var player:Mp3Player = new Mp3Player(); player.play('blah.mp3'); or var player:Mp3Player = new Mp3Player(); player.playlist = ['item1.mp3','item2.mp3']; player.next(); // From http://unformatt.com/news/as3-mp3-player/ package { import flash.events.Event; import flash.events.EventDispatcher; import flash.media.Sound; import flash.media.SoundChannel; import flash.media.SoundTransform; import flash.net.URLRequest; import flash.utils.clearInterval; import flash.utils.setInterval; public class Mp3Player extends EventDispatcher { static public const EVENT_TIME_CHANGE:String = 'Mp3Player.TimeChange'; static public const EVENT_VOLUME_CHANGE:String = [...]]]></description>
			<content:encoded><![CDATA[<p>Usage:</p>
<p><code><br />
var player:Mp3Player =  new Mp3Player();<br />
player.play('blah.mp3');<br />
or<br />
var player:Mp3Player =  new Mp3Player();<br />
player.playlist = ['item1.mp3','item2.mp3'];<br />
player.next();<br />
</code></p>
<pre>
// From http://unformatt.com/news/as3-mp3-player/
package {
	import flash.events.Event;
	import flash.events.EventDispatcher;
	import flash.media.Sound;
	import flash.media.SoundChannel;
	import flash.media.SoundTransform;
	import flash.net.URLRequest;
	import flash.utils.clearInterval;
	import flash.utils.setInterval;		

	public class Mp3Player extends EventDispatcher {

		static public const EVENT_TIME_CHANGE:String = 'Mp3Player.TimeChange';
		static public const EVENT_VOLUME_CHANGE:String = 'Mp3Player.VolumeChange';
		static public const EVENT_PAN_CHANGE:String = 'Mp3Player.PanningChange';
		static public const EVENT_PAUSE:String = 'Mp3Player.Pause';
		static public const EVENT_UNPAUSE:String = 'Mp3Player.Unpause';
		static public const EVENT_PLAY:String = 'Mp3Player.Play';
		//
		public var playing:Boolean;
		public var playlist:Array;
		public var currentUrl:String;
		public var playlistIndex:int = -1;
		//
		protected var sound:Sound;
		protected var soundChannel:SoundChannel;
		protected var soundTrans:SoundTransform;
		protected var progressInt:Number;

		public function play( url:String ):void {
			clearInterval(progressInt);
			if ( sound ) {
				soundChannel.stop();
				try {sound.close();}catch(error:Error){trace(error);}
			}
			currentUrl = url;
			sound = new Sound();
			sound.addEventListener(Event.SOUND_COMPLETE, onLoadSong);
			sound.addEventListener(Event.ID3, onId3Info);

			sound.load(new URLRequest(currentUrl));

			soundChannel = sound.play();
			if ( soundTrans ) {
				soundChannel.soundTransform = soundTrans;
			} else {
				soundTrans = soundChannel.soundTransform;
			}
			soundChannel.addEventListener(Event.COMPLETE, onSongEnd);
			playing = true;
			clearInterval(progressInt);
			progressInt = setInterval(updateProgress, 30);
			dispatchEvent(new Event(EVENT_PLAY));
		}
		public function pause():void {
			if ( soundChannel ) {
				soundChannel.stop();
				dispatchEvent(new Event(EVENT_PAUSE));
				playing = false;
			}
		}
		public function unpause():void {
			if ( playing ) return;
			if ( soundChannel.position < sound.length ) {
				soundChannel = sound.play(soundChannel.position);
				soundChannel.soundTransform = soundTrans;
			} else {
				soundChannel = sound.play();
			}
			dispatchEvent(new Event(EVENT_UNPAUSE));
			playing = true;
		}
		public function seek( percent:Number ):void {
			soundChannel.stop();
			soundChannel = sound.play(sound.length * percent);
		}
		public function prev():void {
			playlistIndex--;
			if ( playlistIndex < 0 ) playlistIndex = playlist.length - 1;
			play(playlist[playlistIndex]);
		}
		public function next():void {
			playlistIndex++;
			if ( playlistIndex == playlist.length ) playlistIndex = 0;
			play(playlist[playlistIndex]);
		}
		public function get volume():Number {
			if (!soundTrans) return 0;
			return soundTrans.volume;
		}
		public function set volume( n:Number ):void {
			if ( !soundTrans ) return;
			soundTrans.volume = n;
			soundChannel.soundTransform = soundTrans;
			dispatchEvent(new Event(EVENT_VOLUME_CHANGE));
		}
		public function get pan():Number {
			if (!soundTrans) return 0;
			return soundTrans.pan;
		}
		public function set pan( n:Number ):void {
			if ( !soundTrans ) return;
			soundTrans.pan = n;
			soundChannel.soundTransform = soundTrans;
			dispatchEvent(new Event(EVENT_PAN_CHANGE));
		}
		public function get length():Number {
			return sound.length;
		}
		public function get time():Number {
			return soundChannel.position;
		}
		public function get timePretty():String {
			var secs:Number = soundChannel.position / 1000;
			var mins:Number = Math.floor(secs / 60);
			secs = Math.floor(secs % 60);
			return mins + ":" + (secs < 10 ? "0" : "") + secs;
		}
		public function get timePercent():Number {
			if ( !sound.length ) return 0;
			return soundChannel.position / sound.length;
		}
		protected function onLoadSong( e:Event ):void {
		}
		protected function onSongEnd( e:Event ):void {
			if ( playlist )
				next();
		}
		protected function onId3Info( e:Event ):void {
			dispatchEvent(new Event(Event.ID3, e.target.id3));
		}
		protected function updateProgress():void {
			dispatchEvent(new Event(EVENT_TIME_CHANGE));
			if ( timePercent >= .99 ) {
				onSongEnd(new Event(Event.COMPLETE));
				clearInterval(progressInt);
			}
		}
	}
}
</pre>
<p><span id="more-19"></span></p>
]]></content:encoded>
			<wfw:commentRss>http://mattshaw.org/news/as3-mp3-player/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

