PhillipBlanton.com

When I work, I work very fast, but preparing to work can take any length of time.
— Cy Twombly

Short Ebay Item Links

I posted this once before, but lost it when I moved the blog contents here from Radwarrior.com, so I am re-creating the post.

Have you ever wanted to email an ebay link to someone but hated copying and pasting the mile-long link?

http://cgi.ebay.com/ebaymotors/Flightcom-4DLX-Classic-Headsets-Set-of-2_W0QQitemZ270530825553QQcmdZViewItemQQptZMotors_Aviation_Parts_Gear?hash=item3efce4cd51

I don't know why EBay has to have such ugly, long links. There is a way to shorterize them yourself, without using a service like http://bit.ly, or http://tinyurl.com. All you have to do is hand craft the link on http://gci.ebay.com?viewitem&item= <item number>. Here's the same item with the short link...

http://cgi.ebay.com?ViewItem&item=270530825553

There's also a way to make a nice, short link to your ebay seller's page.

http://shop.ebay.com/merchant/pblanton

Just replaced the Windows 7 Bootcamp Partition with OpenSUSE 11.2

openSUSE.org

And it is the finest Linux distribution I have ever used. I used to use SUSE back in the 2001-2004 time, before Novell bought it. I liked buying the boxed version at Best Buy or CompUSA. After Novell bought it, they jacked up the price and it went away from the retailers. I'd heard good things about this upstart Ubuntu distro and that is what I started using. When OpenSUSE came out, I stuck with Ubuntu, because I liked it. Recently though I was wanting to try out a new distribution on a Windows machine I was upgrading to Linux, and the OpenSUSE with the latest KDE blew me away.

After getting my new Core i7, 27" iMac, I was thinking about setting up the Boot Camp partition with Windows 7, but thought I'd try OpenSUSE on Boot Camp. I downloaded the freshly released 11.2 in 64-bit and was hooked. I can run Windows 7 in a Fusion Virtual Machine without any trouble, so my newly carved out Boot Camp partition goes OpenSUSE. My machine is *nix to the metal. It's a good feeling.

If you are a Windows developer and are looking for a nice, clean operating system for a change (Yeah, I know Windows 7 is the bomb. I don't care), I heartily recommend upgrading to a Mac, and Boot Camping, 64-bit style with OpenSUSE Linux.

Lorem Ipsum Filler Text in Javascript.

I do page layouts for websites sometimes and I often find myself going to http://lipsum.com, in order to find satisfactory filler text. Today I needed something a little more dynamic for testing a fluid page layout. I ended up writing a javascript function that you can call from within your asp.net page in order to dynamically create some filler text. Saves me a trip to lipsum.com, and is easy to use. it's been added to my standard debug.js file. Here it is…

<script type="text/javascript">
var chunkCount = 5;
var minChunksPerPara = 3;
var chunk1 = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.';
var chunk2 = 'Nunc vitae dignissim turpis. Nulla eleifend felis sed velit molestie non fermentum nibh pellentesque.';
var chunk3 = 'Duis egestas dapibus felis ut posuere.';
var chunk4 = 'Ut nec neque eu lacus pulvinar commodo et vel diam. Integer semper adipiscing enim eu tempus.';
var lorem = ['p', chunk1, chunk2, chunk3, chunk4];
/* The number of chunks written to the current paragraph. */
var paraChunkCount = 0;
/* Minimum number of chunks to write per paragraph. Larger number means larger paragraphs. */
function fillLorem(chunks) {
	document.write('<p>' + chunk1 + ' ');
	for (var i = 0; i < chunks; i++) {
		var chunk = lorem[Math.floor(Math.random() * chunkCount)];
		if (chunk == 'p') {
			i--; /* decrement i, or else we'll lose a printed chunk for every p. */
			if (paraChunkCount >= minChunksPerPara) {
				/* we're writing the end of a paragraph and starting a new one. */
				paraChunkCount = 0;
				document.write('</p><p>');
				paraChunkCount = 0;
			}
		}
		else {
			/* We're writing the current chunk to the current paragraph. */
			document.write(chunk + ' ');
			paraChunkCount++;
		}
	}
	document.write('</p>');
}
</script>

…and here is how to use it:

<script type="text/javascript">fillLorem(50)</script>

That will create a filler text block made up of a random selection of fifty of chunk1 through chunk4. If you want a more natural looking Lipsum (fewer repeated passages), increase the number of chunks to something greater than four, and change the chunkCount variable to one greater than the number of chunks you have (one greater, because the 'p' is a chunk and needs to be represented in chunkCount).

Enjoy!