Tom Purl's Web Site

My '83 Datusun on the side of the information superhighway :)

Converting a Number List to a Number in CL

I spent a while tonight trying to figure this out, and I didn’t find much that helped me, so I thought I would share my solution in case someone else has this problem.

I’m using Common Lisp, and I need to convert a list of numbers into a concatenated version of that number. So I basically need to convert (1 2 3 4) to 1234 (as a number, not a string).

Here’s basically what you have to do:

  1. Convert your list into a string
  2. Convert your string into a number

The second part is easy - just use the parse-integer function. However, the first part is what was so tricky to a CL beginner. There isn’t a built-in function that I could find to perform that conversion, so I created the following function:

I hope this helps out a few other Common Lisp newbies.

New Feed Available

Just a quick housekeeping post for those of you who have subscribed to my blog.

I just started using Feed Burner to host my RSS feed. If you like to keep up with my posts, then this means the following:

Writing a Book With Vim, Restructured Text, and Sphinx

I’m in the process of writing a free ebook about performance testing using the Wideload tool set. To write the book, I decided to use the following basic tools:

  • Vim (as my text editor)
  • Restructured Text (as my markup language)
  • Sphinx (as my publishing system)

If you would like to know why I use these tools and some tips on making them work really well, please keep reading.

Wideload Presentation

Here’s a brief and hopefully not too boring overview of Wideload and why you may want to use it:

Please note that this presentation uses deck.js, so you can use your arrow keys to navigate it.

Introducing Wideload

A couple of years ago, I decided to try to learn more about tuning the performance of Java-based web applications. I’m a big fan of learning by doing, so I thought that I would build a VM that contained everything that I needed to test an analyze a web application, including a full application stack. I would then use this VM as an “educational sandbox” for performance testing and tuning.

Well, I soon learned that building such a VM was no small task. Not only was it difficult to find the tools that I needed, but it was another challenge to actually get them installed, configured, and talking to each other. Also, I decided that provisioning my system using Puppet would save me time in the long run. However, this was my first Puppet project, so I also had to work with that learning curve.

It took a bit of effort, but I’m happy to say that Widleload is now stable enough for use by other people. If you have any interest in web application performance testing, then I would love it if you could take a look.

Also, I am in the process of writing a free short book to help people install Wideload run a few tests. You can find that documentation here:

This book is probably only 15% done at this point, but there should be enough docs to help you install and provision your Wideload VM.

I’m excited to see what other people think of the project and I am looking forward to any constructive criticism. If you have an problems with the code or book, then please feel free to open an issue on the respective Github page. Also, I’m always open to pull requests.

Vim Scripting Using Macros and Registers

I recently discovered how easy it was to basically “convert” macros into mappings in my .vimrc, and I thought that information was terribly useful to most Vim users, so I tried to write a blog post about it.

However, I soon discovered that the best and fastest way to explain this awesome feature was to create a screencast. So here it is:

Vim Scripting Using Macros and Registers from Tom Purl on Vimeo.

Like I said in the screencast, this is a “quick” overview of a lot of awesome features in Vim. It’s designed to whet your appetite, not be a complete tutorial. However, I am more than happy to answer any questions in the comments.

Also, please note that I have not created many screencasts before. Any constructive criticism is greatly appreciated!

Text File Data Mining for SQL Users

Occasionally, I need to send log files to a vendor or co-worker for further examination. About half the time, I get a response that is like one of the following:

I tried opening your log but it was so big that it crashed my text editor.

or…

I can’t read your log file. It’s very large and I don’t have the time to read it.

or finally:

Please delete all of your log files and restart your system so we can have a “clean” copy of the data.

If you’ve ever found yourself saying any of these things, then there’s really no way to sugarcoat it: you’re doing it wrong. Simply put, log files aren’t books. They’re not designed to be read from beginning to end by people in text editors.

Android Rooting Tutorial for Busy People

I recently needed to remove some bloatware from my LG Optimus T. I wanted to install some terribly useful applications that could not be installed on my SD card, but my phone’s internal memory was filled with junk that my phone company thought I might like.

Unfortunately, phone companies actually make money off of installing this space-wasting garbage, so they remove the option of removing software like this. So even though I want to install the 7 MB Weatherbug app, I simply can’t because I don’t have the space.

I did a little research on this, and I kept bumping into pages that mention a concept called rooting. This sounded very promising to me, but also a little dangerous, so I tried in vain to find a simple, definitive guide that would explain what it meant, how I could do it, and the risks.