<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0.5" -->
<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/"
	>

<channel>
	<title>Madness and Macness</title>
	<link>http://madross.com</link>
	<description>groovy</description>
	<pubDate>Tue, 09 Jan 2007 12:12:28 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.5</generator>
	<language>en</language>
			<item>
		<title>Convert Windows Line endings to Unix / OS X</title>
		<link>http://madross.com/blog/convert-windows-line-endings-to-unix-os-x/</link>
		<comments>http://madross.com/blog/convert-windows-line-endings-to-unix-os-x/#comments</comments>
		<pubDate>Tue, 09 Jan 2007 12:12:28 +0000</pubDate>
		<dc:creator>Gazzer</dc:creator>
		
		<category>OS X</category>

		<category>Terminal</category>

		<guid isPermaLink="false">http://madross.com/blog/convert-windows-line-endings-to-unix-os-x/</guid>
		<description><![CDATA[After reading a Windows user&#8217;s nightmare of having to convert hundreds of files, I thought I&#8217;d post this solution. If you need to convert Windows line endings to Mac / Unix ones, you need to execute this command in Terminal. (This solution doesn&#8217;t add extra line-endings that some do)

$ cd /directory/with/your/files
$ find . -type f [...]]]></description>
			<content:encoded><![CDATA[<p>After reading a <a href = "http://www.computerworld.com/action/article.do?command=viewArticleBasic&#038;articleId=9005712&#038;pageNumber=2">Windows user&#8217;s nightmare of having to convert hundreds of files</a>, I thought I&#8217;d post this solution. If you need to convert Windows line endings to Mac / Unix ones, you need to execute this command in Terminal. (This solution doesn&#8217;t add extra line-endings that some do)</p>
<p><code><br />
$ cd /directory/with/your/files<br />
$ find . -type f -exec perl -pi -e 's/\r\n?/\n/g'  {} \;<br />
</code></p>
<p>The above works recursively. If you are a bit afraid of going recursive this is better:</p>
<p><code><br />
$ cd /directory/with/your/files<br />
$ perl -pi -e 's/\r\n?/\n/g' *<br />
</code></p>
<p>This above may through up some errors if it tries to convert directories, so you can be more specific if the file names have a pattern like : a.txt ; b.txt; c.txt; etc.</p>
<p><code><br />
$ cd /directory/with/your/files<br />
$ perl -pi -e 's/\r\n?/\n/g' *.txt<br />
</code></p>
<p>A good point to note that a command - period will interrupt a command if you go wrong. This is definitely one to <a href = "/blog/miscellaneous-terminal-basics/">put in your .profile file</a>:</p>
<p><code><br />
alias fle="perl -pi -e 's/\r\n?/\n/g'"<br />
alias fler="find . -type f -exec perl -pi -e 's/\r\n?/\n/g'  {} \;"<br />
</code></p>
<p>Then you can just do<br />
<code><br />
$ fle *<br />
$ fler<br />
</code></p>
<p>[Fle = fix line endings ]</p>
]]></content:encoded>
			<wfw:commentRss>http://madross.com/blog/convert-windows-line-endings-to-unix-os-x/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Remove the iTunes DRM with Roxio Toast Titanium</title>
		<link>http://madross.com/blog/remove-the-itunes-drm-with-roxio-toast-titanium/</link>
		<comments>http://madross.com/blog/remove-the-itunes-drm-with-roxio-toast-titanium/#comments</comments>
		<pubDate>Mon, 08 Jan 2007 07:25:21 +0000</pubDate>
		<dc:creator>Gazzer</dc:creator>
		
		<category>Music</category>

		<category>OS X</category>

		<guid isPermaLink="false">http://madross.com/blog/remove-the-itunes-drm-with-roxio-toast-titanium/</guid>
		<description><![CDATA[Apple allows you to burn a particular playlist to a CD a maximum of 7 times. You can use this method to remove the DRM and so play music that you yourself purchased on a player of your choice. However, if you don&#8217;t want to &#8216;waste&#8217; a CD in the process, and you still own [...]]]></description>
			<content:encoded><![CDATA[<p>Apple allows you to burn a particular playlist to a CD a maximum of 7 times. You can use <a href = "/blog/remove-the-itunes-drm/">this method to remove the DRM</a> and so play music that you yourself purchased on a player of your choice. However, if you don&#8217;t want to &#8216;waste&#8217; a CD in the process, and you still own Roxio Toast 6.0, you can do this instead:<br />
1. Selecting the Audio Tab<br />
2. Adding your songs<br />
3. From the File Menu, choose &#8220;Save as Disk Image&#8230;&#8221;<br />
4. Wait for the disk image to be created<br />
<!-- more --><br />
Finally, you need to mount the disk image, but here&#8217;s the weird part. If in Toast you go to Utilities > Mount Disk Image, the disk image that you just created is not selectable! But, if you change the file extension to <strong>.dmg</strong>, it will be, thus:</p>
<p>5. In the Finder, change the diskimage to have the <strong>.dmg</strong> extension.<br />
6. In Toast, go to Utilities > Mount Disk Image, and mount the disk image.<br />
7. It should now appear in iTunes and you can import the CD at an encoding of your choice (recommend at least, 192kbps VBR as noted <a href = "/blog/remove-the-itunes-drm/">here</a>)</p>
<p>Windows users can probably do much the same with an earlier version of Nero. This works with Toast 6.0.1, but not 7 and not perhaps with later versions of Toast 6. This should be legal as you are doing exactly what you can with iTunes anyway, but if you do more than 7 times you may be breaking the license agreement. I&#8217;m no lawyer because that line in <a href = "http://sethf.com/essays/major/killlawyers.php" title ="Kill all the lawyers">Shakespeare</a> scared me shitless as a kid, and I decided to become an astronaut instead.
</p>
]]></content:encoded>
			<wfw:commentRss>http://madross.com/blog/remove-the-itunes-drm-with-roxio-toast-titanium/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Set up multiple Apache virtual hosts in OS X</title>
		<link>http://madross.com/blog/set-up-multiple-apache-virtual-hosts-in-os-x/</link>
		<comments>http://madross.com/blog/set-up-multiple-apache-virtual-hosts-in-os-x/#comments</comments>
		<pubDate>Sun, 07 Jan 2007 10:20:58 +0000</pubDate>
		<dc:creator>Gazzer</dc:creator>
		
		<category>web</category>

		<category>OS X</category>

		<guid isPermaLink="false">http://madross.com/blog/set-up-multiple-apache-virtual-hosts-in-os-x/</guid>
		<description><![CDATA[When you are developing websites in OS X, you&#8217;ll often want to be able to have a unique test domain for site. For example, my testing domain for this site on localhost is
madross.lh  [the lh for localhost, use anything you like]
For j-cafe.com , I use j-cafe.lh
To do do this is fairly straightforward. You just [...]]]></description>
			<content:encoded><![CDATA[<p>When you are developing websites in OS X, you&#8217;ll often want to be able to have a unique test domain for site. For example, my testing domain for this site on localhost is<br />
<strong>madross.lh</strong>  [the <strong>lh</strong> for localhost, use anything you like]<br />
For <a href="http://j-cafe.com/">j-cafe.com</a> , I use <strong>j-cafe.lh</strong></p>
<p>To do do this is fairly straightforward. You just need to make sure the &#8216;dummy names&#8217; are added to the hosts file in <strong>/etc</strong></p>
<p><code><br />
127.0.0.1 j-cafe.lh<br />
127.0.0.1 madross.lh<br />
</code></p>
<p>Then in your Apache config file, have this:</p>
<p><code><br />
NameVirtualHost 127.0.0.1</p>
<p>&lt;VirtualHost 127.0.0.1&gt;<br />
ServerName madross.lh<br />
### add the other stuff obviously!<br />
&lt;/VirtualHost&gt;</p>
<p>&lt;VirtualHost 127.0.0.1&gt;<br />
ServerName j-cafe.lh<br />
### add the other stuff obviously!<br />
&lt;/VirtualHost&gt;<br />
</code></p>
<p>Then just restart the server:<br />
<code><br />
$ sudo apachectl graceful<br />
</code><br />
If you are having trouble with host names being cached you might try this:<br />
<code><br />
$ sudo lookupd -flushcache<br />
</code></p>
<p>I use <strong>madross.lh</strong> for my testing server, and <strong>madross.com</strong> is obviously the real site. I keep the number of dots the same to prevent cookie problems. However, you may prefer to have your test server and the real server to have the same name. Obviously, this means you are not going to be able to access the real site. But that&#8217;s not really a problem. Just comment the names in <strong>/etc/hosts</strong> when you want to visit the real site (and vice-versa <img src='http://madross.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  )</p>
<p><code><br />
# 127.0.0.1 j-cafe.com<br />
# 127.0.0.1 madross.com<br />
</code></p>
<p>And remember to do<br />
<code><br />
$ sudo lookupd -flushcache<br />
</code><br />
(Adding an<a href="/blog/miscellaneous-terminal-basics/"> alias in .profile</a> is helpful for this)</p>
<p>Fundamentally, this should work on Windows, Unix, Linux etc. On Windows, the hosts file is probably somewhere else.</p>
]]></content:encoded>
			<wfw:commentRss>http://madross.com/blog/set-up-multiple-apache-virtual-hosts-in-os-x/feed/</wfw:commentRss>
		</item>
		<item>
		<title>BBCode Spam Plugin</title>
		<link>http://madross.com/blog/bbcodespam/</link>
		<comments>http://madross.com/blog/bbcodespam/#comments</comments>
		<pubDate>Sat, 06 Jan 2007 17:04:40 +0000</pubDate>
		<dc:creator>Gazzer</dc:creator>
		
		<category>Wordpress</category>

		<guid isPermaLink="false">http://madross.com/blog/bbcodespam/</guid>
		<description><![CDATA[If you get a lot of spam with multiple BBCode links this will stop them. If it finds [/url] anywhere in the text it&#8217;ll give the poster a chance to modify the post and repost it. It&#8217;s unlikely that [/url] is required by a legitimate poster so it won&#8217;t impact your users too much.
All you [...]]]></description>
			<content:encoded><![CDATA[<p>If you get a lot of spam with multiple BBCode links this will stop them. If it finds [/url] anywhere in the text it&#8217;ll give the poster a chance to modify the post and repost it. It&#8217;s unlikely that [/url] is required by a legitimate poster so it won&#8217;t impact your users too much.</p>
<p>All you need to do is download either the <a href = "/bbcode-linkspam.php.zip">zipped file</a> or the <a href = "/bbcode-linkspam.php.gz">gzipped file</a> and pop it into the plugin folder, then activate the plugin.
</p>
]]></content:encoded>
			<wfw:commentRss>http://madross.com/blog/bbcodespam/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Miscellaneous Terminal Basics</title>
		<link>http://madross.com/blog/miscellaneous-terminal-basics/</link>
		<comments>http://madross.com/blog/miscellaneous-terminal-basics/#comments</comments>
		<pubDate>Sat, 06 Jan 2007 16:35:04 +0000</pubDate>
		<dc:creator>Gazzer</dc:creator>
		
		<category>OS X</category>

		<category>Terminal</category>

		<guid isPermaLink="false">http://madross.com/blog/miscellaneous-terminal-basics/</guid>
		<description><![CDATA[This is a random list of useful stuff for Terminal beginners. I&#8217;ll just add things as they come to mind.
TextWrangler
Rather than trying to faff around in Pico or vi, you can use the excellent and free Textwrangler from Barebones.
Want to edit an invisible file like .profile? Just drag a directory onto TextWrangler in the dock, [...]]]></description>
			<content:encoded><![CDATA[<p>This is a random list of useful stuff for Terminal beginners. I&#8217;ll just add things as they come to mind.</p>
<h3>TextWrangler</h3>
<p>Rather than trying to faff around in Pico or vi, you can use the excellent and free <a href="http://bbedit.com/products/textwrangler/index.shtml">Textwrangler</a> from <a href="http://bbedit.com/">Barebones</a>.</p>
<p>Want to edit an invisible file like .profile? Just drag a directory onto TextWrangler in the dock, and you can edit it from there. Alternatively, just type</p>
<p><code class = "terminal"><br />
$ edit foo.txt<br />
</code></p>
<p>and foo.txt will open.</p>
<h3>The .profile file</h3>
<p>In your home directory, there is an invisible file called .profile . You can edit this file to add shortcuts for common commands and various other customizations. So open up a new terminal window:</p>
<p><code class = "terminal"><br />
$ cd<br />
$ cp .profile .profile.saved<br />
$ edit .profile<br />
</code><br />
We can now edit the file in TextWrangler, and we&#8217;ve also created a backup (which we can restore with: mv .profile .profile.broken &#038;&#038; mv .profile.saved .profile)</p>
<p>Add these 2 lines to the .profile file and save it:<br />
<code class = "textedit"><br />
alias h='history 10'<br />
alias reload="source /Users/YOU/.profile"<br />
</code></p>
<p>[ replace /Users/YOU with the path to your home directory . If you don&#8217;t know this, then in terminal type cd followed by pwd and it&#8217;ll appear]</p>
<p>Before you can use these changes you have to reload the .profile file by typing:<br />
<code class = "terminal"><br />
$ source ~/.profile<br />
$ h<br />
</code></p>
<p>Do that now. But notice that we added that line as an alias, so from now we can just type reload instead.</p>
<p>Now type<br />
<code><br />
$ h<br />
</code></p>
<p>You&#8217;ll get the history of the last 10 things you did numbered. You can repeat a previous action by just doing !527 (or whatever the appropriate number is). !! repeats the last command.</p>
<h3>Command Path</h3>
<p>When you run a command, how does the Terminal (more properly the shell) know where to look to execute it. Basically, there is a variable called PATH which tells the shell where to look? Try<br />
<code><br />
$ which pico<br />
</code><br />
It should output<br />
<code><br />
/usr/bin/pico<br />
</code><br />
which tells the computer to execute pico which is inside /usr/bin</p>
<p>But why /usr/bin? Type<br />
<code><br />
$ echo $PATH<br />
</code><br />
and you should see something like<br />
<code><br />
/usr/bin:/usr/local/bin<br />
</code><br />
which tell the terminal where to look. (Never put stuff in /usr/bin by the way. That&#8217;s for the system, whereas /usr/local/bin is stuff that can added by admins for users to use.)</p>
<p>What happens if there is a pico inside /usr/bin and /usr/local/bin? Well, /usr/bin appears before /usr/local/bin so it will execute /usr/bin/pico. If you want to execute /usr/local/bin/pico then you&#8217;ll need to type out the whole path.</p>
<p>Now it&#8217;s often handy to be able to add executables to your own bin directory, and not have to type out the full path: /Users/YOU/bin/foobarit, but just foobarit instead. To do that add a directory in your home called bin, and add or modify your .profile file so it has a line like this:</p>
<p><code><br />
PATH=$PATH:.:/Users/YOU/bin<br />
</code></p>
<p>Now when you type in a command, the shell will look in this order:</p>
<p><code><br />
/usr/bin /usr/local/bin .(the present directory) /Users/YOU/bin<br />
</code></p>
<p>You want your bin to be last to prevent some nasty person dropping an cd (or something) file into your own bin modified to send private information about you. (Imagine typing cd and rather than executing /usr/bin/cd instead a modified ~/bin/cd got executed instead)
</p>
]]></content:encoded>
			<wfw:commentRss>http://madross.com/blog/miscellaneous-terminal-basics/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Speed up Azureus in OS X</title>
		<link>http://madross.com/blog/speed-up-azureus-in-os-x/</link>
		<comments>http://madross.com/blog/speed-up-azureus-in-os-x/#comments</comments>
		<pubDate>Sat, 06 Jan 2007 15:04:19 +0000</pubDate>
		<dc:creator>Gazzer</dc:creator>
		
		<category>OS X</category>

		<guid isPermaLink="false">http://madross.com/blog/speed-up-azureus-in-os-x/</guid>
		<description><![CDATA[This is about as basic as it gets. The BitTorrent client, Azureus, can be a memory hog if you leave it visible. Simply do Command-H whenever you want to switch out of it. I find the CPU dropping from 20% to 3%. Your mileage may vary.

]]></description>
			<content:encoded><![CDATA[<p>This is about as basic as it gets. The BitTorrent client, Azureus, can be a memory hog if you leave it visible. Simply do Command-H whenever you want to switch out of it. I find the CPU dropping from 20% to 3%. Your mileage may vary.
</p>
]]></content:encoded>
			<wfw:commentRss>http://madross.com/blog/speed-up-azureus-in-os-x/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Remove the iTunes DRM</title>
		<link>http://madross.com/blog/remove-the-itunes-drm/</link>
		<comments>http://madross.com/blog/remove-the-itunes-drm/#comments</comments>
		<pubDate>Sat, 06 Jan 2007 06:42:22 +0000</pubDate>
		<dc:creator>Gazzer</dc:creator>
		
		<category>Music</category>

		<guid isPermaLink="false">http://madross.com/blog/remove-the-itunes-drm/</guid>
		<description><![CDATA[A look at the possible methods of removing the DRM in iTunes, advantages, disadvantages, and their legal implications
Part 1: the &#8216;Apple&#8217; method and hints to avoid major loss of quality,
Part 2: removing the DRM without loss of quality

Note: this article is only about music that you have bought and own.
DRM? What&#8217;s not to hate. You [...]]]></description>
			<content:encoded><![CDATA[<p>A look at the possible methods of removing the DRM in iTunes, advantages, disadvantages, and their legal implications<br />
Part 1: the &#8216;Apple&#8217; method and hints to avoid major loss of quality,<br />
Part 2: <a href = "/blog/removing-the-itunes-drm-2/">removing the DRM without loss of quality</a><br />
<a id="more-4"></a><br />
<i>Note: this article is only about music that you have bought and own.</i></p>
<p>DRM? What&#8217;s not to hate. You buy a song, and then the DRM prevents you doing things that you are legally entitled to - like playing the song <em>at its originally quality</em> on another mp3 player that&#8217;s not an iPod. Apple and the record companies of course are thinking, DRM? What&#8217;s not to like? DRM prevents users from doing things they are <em>not</em> legally entitled to - copying the song and distributing it to other people.</p>
<p>The needs of the customer and those of the record companies are fundamentally at odds. The user has a right to <em>use</em> the product they paid for. The record companies have a right to turn a profit. They also have a right to market the crap they do, and screw over most of the bands they &#8216;represent&#8217;. It&#8217;s called market economics or something.</p>
<h4>The 100% legal way to remove the DRM</h4>
<p>The obvious way to remove the DRM is the one sanctioned by Apple.<br />
1. Make a playlist<br />
2. Burn your playlist to a CD (i.e. a wav/aiff file) *<br />
3. Re-import your songs from the CD<br />
(* you are limited to doing a particular playlist 7 times. If you still own Roxio Toast 6, you can burn to a <a href = "/blog/remove-the-itunes-drm-with-roxio-toast-titanium/">disk image, mount the image into iTunes and save yourself a blank CD</a>)</p>
<p>For many people, this is an acceptable approach. But let&#8217;s take a look at what happening here to see why it&#8217;s not ideal.</p>
<p>When you buy a song from iTunes it&#8217;s been compressed into an AAC file. In other words, the quality is not as good as an original CD you&#8217;d buy at the record store. For many people this loss of quality is unnoticeable or they simply don&#8217;t care - fair enough.</p>
<p>Now, when you burn these AAC files to a CD they are converted to standard CD files which are about about 10 times the size (so a 4MB AAC file will end up being a 40MB file on the CD). This does not recreate the original quality of a CD! The bigger file is simply what CD players understand. The quality will essentially be the same as your iTunes purchase.</p>
<p>So now, you can simply import the songs back into iTunes (or any other software that you like) from the CD. But, and its a big BUT:</p>
<p>You have to convert the CD back to an MP3 file or AAC file <em>which means a further loss of quality</em>. This is called <a class = "external" href="http://en.wikipedia.org/wiki/Transcoding">transcoding</a>.</p>
<h4>Avoiding reduction in Quality</h4>
<p>But there are still things you can do to make minimize this loss. First, let&#8217;s clear up a misunderstanding. If you convert a 128kbps file to a CD, <strong>it does NOT follow that you should reimport using 128kbps</strong>. The aim any time you import a song is to reduce the size of that approx. 40MB file to something much smaller without reducing the quality too much:</p>
<p><strong>.m4p file</strong> &#8212;&#8211;(1)&#8212;&#8212;> <strong>CD File</strong> &#8212;&#8211;(2)&#8212;&#8212;> <strong>.m4a or .mp3 (minus DRM)</strong></p>
<p>Step 1 maintains the quality, Step 2 will always reduce it. (ignoring FLAC)</p>
<p>This means that you choose an encoding that is not going to reduce quality too much. Remember, whatever you do the resultant file will have a (slightly) worse quality than the one you bought from iTunes. How much worse is the choice you make. My recommendation is to use at the very least:</p>
<p><em>192kbps and to use VBR.</em></p>
<h5>Which encoding?</h5>
<p>Should you use AAC or MP3? They both have good support (AAC is not proprietary). AAC theoretically has better quality, but modern MP3 encoders such as LAME are highly regarded. You may end up choosing whatever is convenient to you - but remembering to set the bit-rate high enough and to use VBR:</p>
<h4>So what have you achieved?</h4>
<p>You have removed the DRM, but the file is bigger and the quality is slightly reduced. You need to burn a CD and the process is hardly fast. If this is acceptable to you, then you&#8217;re done.</p>
<p><a href = "/blog/removing-the-itunes-drm-2/">Part 2</a> will explain how you can remove the DRM without going through this process, and without a loss of quality.
</p>
]]></content:encoded>
			<wfw:commentRss>http://madross.com/blog/remove-the-itunes-drm/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Removing the iTunes DRM (part 2)</title>
		<link>http://madross.com/blog/removing-the-itunes-drm-2/</link>
		<comments>http://madross.com/blog/removing-the-itunes-drm-2/#comments</comments>
		<pubDate>Thu, 04 Jan 2007 09:02:11 +0000</pubDate>
		<dc:creator>Gazzer</dc:creator>
		
		<category>Music</category>

		<guid isPermaLink="false">http://madross.com/blog/removing-the-itunes-drm-2/</guid>
		<description><![CDATA[In part 1, we explained how to remove the iTunes DRM using a method that is OK by Apple, and is 100% legal. This method has disadvantages in that there is a reduction of quality and it&#8217;s time consuming. If that doesn&#8217;t bother you then that&#8217;s probably the way to go.

However, in an ideal world, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="/blog/remove-the-itunes-drm/">In part 1</a>, we explained how to remove the iTunes DRM using a method that is OK by Apple, and is 100% legal. This method has disadvantages in that there is a reduction of quality and it&#8217;s time consuming. If that doesn&#8217;t bother you then that&#8217;s probably the way to go.<br />
<a id="more-5"></a><br />
However, in an ideal world, we&#8217;d like to be able to remove the DRM without a reduction of quality and without wasting time doing it.</p>
<p>Now, before we continue, this article is about removing the DRM of songs that you yourself bought. It won&#8217;t work for stuff you don&#8217;t own, and once you have removed the DRM, the usual legal restrictions apply (don&#8217;t distribute etc.)</p>
<h4>Removing the iTunes DRM</h4>
<p>You need to <a href = "http://hymn-project.org/forums/viewtopic.php?t=1555">use</a> the software <a href = "http://hymn-project.org/forums/viewtopic.php?t=1555">myFairTunes</a>. This is a Windows only application, so OS X users will have to use Bootcamp if they are on an Intel machine. </p>
<p>Then run that software to convert protected AAC (m4p) files to unprotected (m4a) AAC files. And you&#8217;re done. Note that in certain countries this may be illegal. See the discussion below.</p>
<h4>But I want to convert them to MP3s</h4>
<p>Frankly, why would you? An m4a AAC file is an unproprietary format, and is generally regarded as superior to mp3 especially at low-bitrates. If you convert to an MP3, you are just recompressing a file that has already been compressed. The whole point of using myFairTunes is to convert a protected m4p file into an unprotected mpa file.</p>
<h4>Wait! AAC is proprietary, right?</h4>
<p>No. AAC is not an Apple thing. It part of the MPEG-4 specification. It&#8217;s the fairplay DRM that is added to the iTunes AAC files that is proprietary. Once that is removed the file is similar to other compression systems like MP3. Apple chose AAC because it is better than MP3 at low-bitrates. They didn&#8217;t develop it. Hence, many other players support AAC such as Zune.</p>
<p>If your mp3-player doesn&#8217;t support AAC then you should consider getting a new player that does and most now do.</p>
<h4>Why would I want to remove the DRM if I&#8217;m not a crook</h4>
<p>Bear in mind that you can already easily buy non-DRM AAC files. Buy a CD and import it into iTunes, and you have your non-DRM AAC files.</p>
<p>It wasn&#8217;t long ago that Apple&#8217;s own <a href="http://www.macworld.com/2001/10/macbeat/rip/">Rip, Mix, Burn</a> campaign was encouraging you do just that on non-DRM&#8217;d CDs. In other words, Apple themselves agree that copying songs that you already own for <strong>your own personal use</strong> is legal.</p>
<p>Remove the DRM, and you can play your songs on the player of your choice without reduction of quality. There is nothing unethical about that desire. I bought the song, I want to choose where I can play it (in my own home, say).</p>
<h4>But is removing the DRM legal?</h4>
<p>This is the tricky point. Apple already allows you to remove the DRM in a certain way, using their own software, so the removal of the DRM per se is probably not illegal. However, you are certainly breaking the End User License Agreement by using other software to simply strip out the DRM. Since these EULA&#8217;s themselves may not actually be legitimate especially outside of the USA, the whole legality of what you can and cannot do with <a href="http://www.eff.org/IP/DMCA/">DRMs is a legal grey area</a>. Use your own judgement, and if your not happy use <a href="/blog/remove-the-itunes-drm/">the method outlined in Part 1</a>.</p>
<p>It&#8217;s definitely illegal to distribute copyrighted music to other people, so please respect the copyright of the material that you own.
</p>
]]></content:encoded>
			<wfw:commentRss>http://madross.com/blog/removing-the-itunes-drm-2/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to size text with CSS</title>
		<link>http://madross.com/blog/how-to-size-text-with-css/</link>
		<comments>http://madross.com/blog/how-to-size-text-with-css/#comments</comments>
		<pubDate>Fri, 06 Jan 2006 10:21:32 +0000</pubDate>
		<dc:creator>Gazzer</dc:creator>
		
		<category>css</category>

		<category>web</category>

		<guid isPermaLink="false">http://madross.com/blog/how-to-size-text-with-css/</guid>
		<description><![CDATA[A guide to resizing text with CSS]]></description>
			<content:encoded><![CDATA[<h3>For those in a hurry!</h3>
<p>After years of trying we can now use pure CSS to let users read text the size they want it. All, it takes is<br />
<code>body {<br />
font-size: 76%; /*sets a standard base of 12pixel*/<br />
}<br />
</code><br />
and from then on use ems like this:<br />
<code><br />
h1{<br />
font-size: 1.34em /*set base header 1 to 16px*/</p>
<p>}<br />
</code><br />
<a id="more-6"></a></p>
<h3>Intro</h3>
<p>We all know the frustrations of websites with text that&#8217;s either too small, too large, not resizable, not compatible with a wide range of browsers. <a href="http://www.useit.com/alertbox/designmistakes.html">Illegible text is number 1 complaint of users</a>, yet 10 years along it still remains the holy grail of web typography: how can the designer satisfy everyone?</p>
<p>A year ago, I&#8217;d have said it was impossible due to browser differences, OS incompabilities, DPI variations and so forth. (Commentators tended to blame designers without realizing the problem lay with the Browsers).</p>
<h3>The Problem with Pixels</h3>
<p>We cannot use pixels. Pixels would seem to be the perfect solution. A dot is a dot is a dot. So you go ahead and do this:<br />
<code>body{<br />
font-size: 12px;<br />
}</code><br />
Unfortunately, IE for Windows cannot resize text set in pixels. This become a real problem if you have captions at size 10px for example. It may be unreadable for some - yet no designer wants to make a site limited to minimum size of 12px.</p>
<h3>The Problem with Points</h3>
<p>We cannot use points. On a Windows machine a point is about 1.2pixels high on a Mac it&#8217;s 1pixel high. You can imagine the effect of<br />
<code>.caption<br />
{<br />
        font-size: 7pt; /* 9 pixels high in Windows, 7 pixels high on the Mac */</p>
<p>}</code><br />
Your site was unreadable to many. </p>
<p>So we&#8217;re left with Percents / Ems and keywords. I&#8217;ve found that percents and ems work best so I&#8217;m going to go with that.</p>
<h3>So what is an &#8216;em&#8217;? </h3>
<p>Essentially, in CSS an <strong>em</strong> is a relative size in the same way as <strong>percent</strong> is. 1em is equal to the &#8216;present&#8217; font-size (100% is effectively the same thing) or technically the font-size of the parent element. Of course, at this point (ha!) you are scratching your head thinking what is the &#8216;present&#8217; font-size of a new document. The answer is that it is what is specified in the browser preferences:<img style = "display: block; margin: 1em 0" src="http://www.j-foto.com/images/16937_0gbdek_o.gif" alt="Safari Default Font" /><br />
Fortunately, finally all the browser manufacturers have &#8216;agreed&#8217; to go with a default size that is effectively 16pixels high. Last year, this was not the case and &#8216;ems&#8217; were unusable still but with the minority browsers such as Safari moving to a 16px default (and the majority already having such a default in the first place we can now go with this). </p>
<p>Of course, 16px is unnecessarily massive but there we go. So now we need to decide what is our base size for our site, and we are done. So suppose we decide that 12pixels is a good base for our users then we calculate that 12px is 75% of 16 pixels, so we start our CSS with this:</p>
<p><code>body<br />
{<br />
font: 76%/160% "Lucida Grande", Verdana, Geneva, Arial, sans-serif;<br />
/*line-height is 1.6 times the font size*/<br />
/* 76% rather than 75% counteracts an Opera bug */<br />
}</code></p>
<p>So this means now we have set our site base to be 12px for a standard user. And from now on we can use ems to size things relative to this base.<br />
<code>p<br />
{<br />
font-size: 1em;<br />
}<br />
.caption<br />
{<br />
font-size: 0.834em;   /*standard is 10px*/<br />
}<br />
h1<br />
{<br />
font-size: 1.335em;   /* standard is 16px */<br />
}</code></p>
<h3>Conclusion</h3>
<p>We&#8217;ve managed to set a decent base-size for the majority of our users. Windows IE users can resize the text if it&#8217;s too small. The size of the text will resize itself depending on the preferences of the individual user. Users who like smaller text and have set their browser default size to 14 or 15 will see smaller text. This system may not work with very old browsers, but I think it&#8217;s the best we can hope for.</p>
<h3>Notes</h3>
<ul>
<li>
<h3>Ems Compound</h3>
<p>Be careful with embedding ems within themselves. They will compound! If you set for example<br />
<code>li<br />
{<br />
font-size: 0.8em;<br />
}</code><br />
and you have this a list in a list you&#8217;ll get 80% times 80% = 64%. Your text will rapidly become unreadable. </li>
<li>
<h3>Why use 76% percent rather than 0.76em in the body CSS.</h3>
<p>Unfortunately, some browsers don&#8217;t honour em sizes less than 1. This overcomes that. Also, I find it more intuitive to see the 76% as a levelling decision, and use ems from then on.
</li>
<li>
<h3>Why use 76% rather than 75%</h3>
<p>Opera has/had a bug where if its an exact em based font-size it will remove one pixel.<br />
So 16 times 75% equals 12. Opera would make this 11, but<br />
16 times 76% = 12.2. So which is rounded to twelve and everyone&#8217;s happy.
</li>
<li>
<h3>0.834em. Why so &#8216;accurate&#8217;?</h3>
<p>Some browsers have a habit of rounding incorrectly. They may round the size &#8216;down&#8217; from 8.7pixels to 8pixels. Also, some browsers apply the rounding to every stage. So for example in our stylesheet we have 76%. For a standard set browser, this means<br />
16px times 0.76 = 12.2pixels (which is rounded to 12pixels for display)<br />
Now, when we apply the<br />
0.835em is this applied to 12.2pixels or 12pixels?<br />
Correctly, it should be to the 12.2 pixels but it often isn&#8217;t. So by trial and error I get:<br />
12.2 times 0.834 = 10.17<br />
12 times 0.834 = 10.008<br />
The browser will always round it to 10pixels. In reality, you may just need to do by trial and error.</p>
</li>
<li>
<h3>Hey! You&#8217;re making your site 76% of my default. That&#8217;s not right</h3>
<p>In fact, although the browser preferences may say you are setting your default setting, due to historical reasons this is not really the case. Most users have their default at 16 and this is now the established standard, it much better to think in terms of <em>16 simply representing a baseline</em>.
</p>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://madross.com/blog/how-to-size-text-with-css/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
