Ron Toland
About Canadian Adventures Keeping Score Archive Photos Replies Also on Micro.blog
  • Predictions for 2010

    Everybody’s got ‘em. Here’s mine:

    What Will Change Radically:

    1. Ebooks. In 2009 they really started taking off. With the release of Apple's Tablet, the Nook finally appearing in stores, and Borders launching their own reader/ebook service, the world of publishing will finally start lurching into the 21st century.
    2. The OS Wars. With the release of Google's Chrome OS netbooks, coupled with the increasing market share of Android on smartphones, the internet revolution will be complete. Mac vs Windows won't matter as much to users anymore, since everything important (email, documents, reading) will either work on their phone or in their browser. Only coders and gamers will care about platforms as such anymore, since you'll still need a full-featured OS to develop or play on.
    3. Online Publishing. The Nook and the Kindle are already experimenting with subscription-based magazine and newspaper content. This market will grow to replace the paper-based income streams for most newspapers and magazines. Some customers will still want their ad-based online content, and some will still want a physical copy, but most will switch over to the convenience of electronic versions. Publishers will also move in this space when they see it's a way to replicate their old revenue streams in the new electronic age.
    What Will Stay The Same:
    1. Sci-fi/Fantasy Publishing. While everyone else starts to pile on the ebook wagon, genre presses (especially the small ones, that could benefit the most from electronic distribution) will continue to take timid steps in the direction of electronic publishing, but refuse to embrace it.
    2. M$ dominance. Even though Google is pulling the rug out from under Windows, sheer inertia will keep them moving forward in the marketplace for the next year or two. That, and the videogame industry.
    3. Books. They won't go anywhere. They'll just finally be seen for what they are: 500-year-old relics that have a lot of nostalgic value, but don't meet the needs of most people anymore.
    What do you think? How far off am I?
    → 9:39 PM, Dec 31
  • UNR on HP Mini 110

    I’ve been thinking about trying out Ubuntu Netbook Remix, the version of Ubuntu Linux made especially for netbooks like my HP MIni 110, for a while now. I was attracted to the idea of being able to run a real Linux distro on the netbook, as opposed to the tightly-controlled version that came on the Mini. HP’s version of Ubuntu–Mie–isn’t bad, so much as completely un-customizable: you can’t remove the screen-hogging front panels from the desktop, for instance, which left me staring a large blank space where Email was supposed to appear (I used Gmail, so a desktop-bound email program is useless to me).

    So this week I finally bit the bullet, wiped the harddrive, and installed the latest version of UNR.

    Thus far, things have gone well. I had some problems with wifi at first, but running the software updater and rebooting fixed that problem. I’ve been able to download and install Wine, which lets me use the Windows version of eReader for reading my ebooks. I’ve re-arranged the icons in the menus, ripped out some software I didn’t need, and in general had a good time customizing the hell out of the OS.

    I feel like I’ve been given a new computer, one that’s more fun to use and easier to bend to my will. In the end, that’s always been the appeal of Linux to me: it puts power back in the hands of users, where it belongs.

    → 1:34 PM, Dec 31
  • eReader for Android!

    They just released a version of the eReader software (formerly Palm eReader, then just eReader, now the Barnes and Noble eReader) for the Android platform.

    It’s a little bit buggy: you need to wait for an entire book’s table of contents to load before reading/scrolling, else the book will get stuck partway through. Other than that, it works great on my G1. Nice to see a commercial ereader on a Linux platform. (Yes, the books still have DRM, but the format’s got some longevity behind it, and is supported on enough devices that I’m not worried about getting locked into one platform).

    → 8:39 PM, Nov 29
  • Guilty as Charged

    Ripped from Code Complete:

    People who preach software design as a disciplined activity spend considerable energy making us all feel guilty. We can never be structured enough or object-oriented enough to achieve nirvana in this lifetime. We all truck around a kind of original sin from having learned Basic at an impressionable age. But my bet is that most of us are better designers than the purists will ever acknowledge.

    —P. J. Plauger

    → 10:45 AM, Aug 19
  • Sorting Algorithms, Part Two

    The second sorting algorithm I decided to learn was the QuickSort. It’s a little more complicated than the StraightSort, but generally faster for larger numbers of integers.

    The idea is to look at the first number of a list, call it the firstElement. You scan up the list looking for a number greater than the firstElement. Once you’ve found one, you scan down from the end of the list looking for a number less than the firstElement. When you’ve found both, swap them. Repeat this process till all the numbers greater than the firstElement are further down the list than all the numbers lower than the firstElement.

    Congratulations, you’ve sorted the list with respect to the firstElement! Now, snip the firstElement off the front of the list, and slip it back into the list at the point where your probe scanning down the list first passed your probe scanning up the list. You’ve got the firstElement placed correctly in the list.

    Now, break your list into two parts: one part extends from the beginning of the list up to the newly-placed firstElement, and the second part extends from just past the firstElement to the end of the list. Do the same “take the first Element and scan up from the list…” work you did before on the whole list, but this time do it to each part separately.

    When the partial lists get down to around 7 elements or less, go ahead and do a StraightSort on them instead of the swap-and-scan sorting. When you’ve got the parts sorted, put them back together, and you’ve got a fully sorted list!

    This one took me a while to wrap my head around, so don’t be intimidated if it doesn’t make sense at first. Have a look at the code below, and remember that you’re doing a sort on the whole list, then breaking it down and doing the same kind of sort on parts of the list, and so on down the line.

    Here’s the code:

    def quickSort(data): “““Takes a list of integers and returns a sorted list. Based on QuickSort method Note: will not sort non-unique items!””” insertedElement = data[0] swappedData = swapSort(data) insertedIndex = swappedData.index(insertedElement) firstHalf = swappedData[:insertedIndex + 1] if (insertedIndex != (len(swappedData) - 1)): secondHalf = swappedData[insertedIndex + 1:] else: secondHalf = swappedData[insertedIndex:] if len(firstHalf) > 7: firstHalf = quickSort(firstHalf) else: firstHalf = straightSort(firstHalf) if len(secondHalf) > 7: secondHalf = quickSort(secondHalf) else: secondHalf = straightSort(secondHalf) sortedData = firstHalf sortedData.extend(secondHalf) return sortedData

    def swapSort(data): “““This is the first half of the QuickSort algorithm. Implemented here to prevent recursion errors””” firstElement = data[0] greaterIndex = 1 lesserIndex = len(data) - 1 while (lesserIndex >= greaterIndex): if (data[greaterIndex] > firstElement) & (data[lesserIndex] < firstElement): greater = data[greaterIndex] data[greaterIndex] = data[lesserIndex] data[lesserIndex] = greater greaterIndex += 1 lesserIndex -= 1 else: if data[greaterIndex] firstElement: lesserIndex -= 1 data.insert(greaterIndex, firstElement) data = data[1:] return data

    Notice how I’ve broken up the algorithm into two functions: one that does the swap-and-scan, the other that breaks the list up and decides whether or not to run a StraightSort on the pieces. Again, I’m not sure I’ve fully Pythonized this code; any suggestions?

    → 6:28 PM, Apr 24
  • Sorting Algorithms, Part One

    Inspired by a question from a programming interview, I’ve taken it upon myself to learn how to implement different sorting algorithms in Python. My goal is to:

    1. Learn a bit more about programming algorithms, and
    2. Get back into Python-coding shape.

    The first algorithm I’ve coded up is a simple Straight Sort. It sorts a series of numbers like you’d sort a hand of cards: it picks the second number and sorts it with respect to the first, then picks the third number and places it where it should be with respect to the first two, and so on. It’s pretty fast for low numbers of integers, but slows down exponentially as the number of integers grows.

    Here’s the actual code:

    def straightSort(data): “““Takes a list of integers and returns a sorted list. Based on Straight Insertion method. Note: will not sort non-unique items!””” for item in data: currentIndex = data.index(item) for i in data[:currentIndex]: if data[currentIndex - 1] > item and currentIndex > 0: data[currentIndex] = data[currentIndex - 1] data[currentIndex - 1] = item currentIndex -= 1 return data

    It’s pretty simple, but I feel I may have been writing C++ style code in Python, instead of writing Python-style code. Any suggestions?

    → 6:32 PM, Apr 23
  • HowTo: Get Filezilla working after FTP connection drop

    If you’re using Filezilla to connect to a shared hosting account that uses cPanel, and your internet connection gets dropped during a transfer, you’re going to get an error from Filezilla when you try to reconnect after getting your internet up again.

    Here’s how to clear that error:

    1. Login to your shared hosting account.

    2. In cPanel, go to “FTP Session Manager”

    3. You should see a long list of “IDLE” connections. Delete each of them, one by one, using the “X” button beside each entry.

    4. Logout of cPanel when all the ftp sessions have been deleted.

    …and that’s it! You should be able to connect normally to your account through ftp again.

    → 12:28 PM, Apr 13
  • RSS
  • JSON Feed
  • Surprise me!