Ron Toland
About Canada Writing Updates Recently Read Photos Also on Micro.blog
  • How I Failed to Get Clojure Adopted at my Workplace

    I’m a little obsessive about the tools I and my co-workers use. If I come into a company and they’re still on svn, I push to get us switched to git. If people have to login to a remote server to develop on via a slow internet connection, I figure out how to get a local VM install to do everything we need, and share it with everyone.

    So when my current company started experiencing pains with PHP, and the other devs talked about switching languages, I immediately thought of persuading them to switch to Clojure.

    Why Clojure? It’s fast. It’s code is compact but still readable. And it’s got the power of Lisp.

    I got permission to build some internal tools in Clojure, and set to work. I thought it was just a matter of time before the other devs would “see the light” and start switching over to Clojure.

    Nine months later, we’re still building everything in PHP. No one’s even looked at my Clojure code. Beyond some jokes about Python, there’s been no further movement toward switching languages.

    I’ve failed.

    But why? In order to document my mistakes, so I and others can learn from them, here’s what I did wrong:

    No Expertise

    I'd only been using Clojure for a little over a year when I started building those internal tools. I'd never deployed a Clojure application, didn't know too much about how to write tests in Clojure, and had only done hobby projects using it.

    As a result, those internal tools I built were full of bugs when they launched. When I got pulled off of working on those tools and back to working on the core company applications, those bugs stayed - for months - without being fixed.

    My co-workers' first experience with Clojure was of a buggy, slow application that didn’t do too much. That first impression was hard to shake, even after I went back and fixed bugs and improved the apps.

    No Designer

    Not only were the web apps slow and buggy when they first launched, they looked terrible. I got so focused on using Clojure that I ignored the user interface, and didn't get a front-end developer to help me with it.

    No Maintenance

    Some of the my co-workers were brave enough to use the applications I'd built, despite the bugs and horrible user interface. They all had good feedback, and gave it freely.

    I documented everything they told me, capturing it in Jira tickets, and then sat on them for months.

    Why? I’d been pulled off of internal tools to doing other application development. So instead of being able to iterate with my users, constantly improving the application, they had to wait a long time before they saw any changes. I lost what goodwill I’d had to start with, because I didn’t respond to their needs.

    No Training

    None of the other developers had any experience with Lisp. But instead of hosting a training session, or calling for a special code review session with Clojure as the topic, I waited for them to "come to me."

    I was certain that some of them would peek at the Clojure code, just to see what it was like, and then start asking questions. I told myself this was the natural, organic way to start spreading Clojure knowledge around the organization.

    I was dead wrong. The other developers had a hard enough time deciphering PHP code from 2 years ago; they weren’t going to spend time trying to read my stuff too. Especially since it was buggy. And slow. And hard to use.

    Conclusion

    In the end, I should have been much more proactive if I wanted to see Clojure adopted at my company. I should have given them some training, carved out some time every week to maintain the applications, and gotten some design input from the very beginning so the tools would be easier to use. Even then, we might not have decided to switch to Clojure, but at least then it would have been an informed decision, based on well-working example applications that everyone was using.
    → 3:42 PM, Jul 16
  • Four Things You Should Do When Starting a New (Dev) Job

    Your first 30 days with a company can be nerve-wracking. Your boss is watching your performance, trying to decide if he made the right choice. Your co-workers are trying to learn if you’re going to be a helpful member of the team or just dead weight.

    All that scrutiny gives you a golden opportunity to make a great impression.

    Here’s four ways to make sure they’ll be glad to have you on board:

    1) Go in Early

    I know a lot of developers are night owls, but for the first 30 days, you should make an exception. Come in earlier than you normally would, but stay as late as everyone else does. You’ll show everyone you’re serious about the job, and aren’t afraid of work.

    Even if you shift your schedule back to a normal one after the first 30 days, you’ve gone a long way to reassure your colleagues that you’re here to help them out.

    2) Update Documentation

    Was the system setup process well documented? If not, fix it. If documentation doesn’t exist yet for something you’re supposed to learn, create it. Your boss will notice, and you’ll be helping future employees get up and running faster.

    3) Ask Questions

    It’s one thing to learn how a company does things. It’s better to learn why they do them the way they do.

    Look for areas where they don’t have any reason to back up how they’re doing something. If you can find a better way of doing it, pitch it to your boss. You’ll show him you care about the quality of your code, and you won’t have to step on anyone’s toes.

    4) Stay Calm

    You’re learning a lot of new things, and trying to stay productive at the same time. Don’t rush yourself. Most employers don’t expect their employees to start seriously contributing until they’ve put in 90 days. You’re going to be slower than normal, but that’s ok. Take the time to really learn all the nooks and crannies of the system you’ll be working in now, so you can contribute more later.

    → 2:44 PM, Feb 29
  • Five Reasons to Learn a New Programming Language

    You’ve landed a good job. You negotiated a high salary, plenty of vacation days, and flexible work hours.

    Congratulations. But don’t stop thinking about your career just yet. Now that you know your way around your current programming language, it’s time to learn another one.

    Here’s why:

    1) Languages go obsolete

    Every programming language becomes obsolete at some point. COBOL isn’t used for new software anymore. Whatever language you’re using now will be obsolete, or at least on the downward trend, in 5-10 years. You don’t want to end up chained to one company (or worse, laid off from said company) with only an obsolete language on your resume.

    Pick a language that looks to be on the upward curve, and learn it. Think of it as insurance against the future.

    2) Languages express best practices

    When someone creates a new programming language, they’re codifying a certain style of programming that they consider to be the best. After all, if Guido Van Rossum thought functional programming was the best style to work in, Python would have been a functional language.

    One of the easiest ways to get deep into someone else’s ideas about the best way to program is to learn their language. Consider the learning experience a conversation you’re having with the language creator, trying to learn how they think programming should be done.

    You’ll probably agree with them on some things, and disagree on others. Take the things you like - the parts of the language that make some best practices easier - and find ways to incorporate them in the language you’re currently using.

    3) Languages don’t do everything well

    Most of the general-purpose programming languages we’ve got are actually really good at just one or two things, and terrible at others. PHP is a great scripting language, but pushing it to express a complicated DSL leads to code that’s hard to read and painful to write.

    Picking up a new language gives you a larger toolbox to draw on, so when it comes time to build that internal website, or reporting system, or distributed image processing software, you’ll be able to use the best language for the job.

    4) Languages lead to jobs

    This one almost goes without saying. You can’t land a Ruby job without learning some Ruby. You need to know C++ (or Objective-C) to work in the games industry. If you want to switch from web development to scientific computing, learning a new language is your best bet.

    5) Languages teach programming fundamentals

    Do you know what a monad is? How about S-expressions? Learning a language that’s radically different from what you normally work in (say, Haskell for Python devs) can teach you new programming concepts. You’ll learn new ways of thinking about programming, and new ways to approach traditional programming problems.

    In the end, learning a new language (or several languages) is all part of becoming a mature, experienced developer. If you want to prepare for the future, expand your programming horizons, and keep a secret weapon (or two) in your dev toolbox, then you should learn a new language.

    → 3:40 PM, Feb 1
  • 10 Questions Every Developer Should Ask In Their Next Interview

    With the market for developers so fierce, we can afford to be a little more careful about where we work.

    Over the years, I’ve interviewed at several companies. Whenever we got to the part of the interview where they asked what questions I had for them, I had plenty of stuff to ask about their tech stack, but not as much to ask about their working environment. Here are 10 questions I wish I’d asked at every interview:

    1. How many hours a day do you require from your developers?

    You’d be surprised how many places expect more than 40 hours. If they want you to work 45 or 50 hours a week, it’s best to know that up front, so you can negotiate an appropriate salary.

    1. Do you allow working from home? How many of your developers work from home at least once a week?

    A lot of companies will say they allow working from home. If they’re actually committed to it, though, they’ll be at least one or two developers taking advantage. If no one works from home, it’s because it’s discouraged by management, or they don’t really have the infrastructure (VPN, etc) in place.

    1. What is the timetable for getting vested in shares?

    A critical question for startups. They’ll usually ask you to take a lower salary in exchange for shares. But if those shares take 5 years to become vested, you’re looking at a long wait for a risky payoff. Do you really want to sacrifice money in the bank for that long? Best to make an informed choice.

    1. Do you have “office hours” you like your developers to keep? What are those?

    Most places are flexible, but have some sort of core hours they want you to keep. These may not fit your natural schedule (I’m personally a morning person, but I know a lot of developers that prefer to code at night).

    1. What’s your leave policy? Are Vacation and Sick Days lumped together? How many do you give a year?

    Several startups are offering unlimited leave these days. It makes sense; if you’re a salaried employee, paid per year to get a job done, does it matter how many sick days you took?

    If they won’t go unlimited, consider bargaining for increased vacation instead of a higher salary. You’ll thank yourself later.

    1. What’s your process for changing internal tools - e.g., if you were to change version control systems, how would you go about that?

    Over the life of any piece of software, your tools are going to change. Is this dev team ready to handle that?

    1. Do you allow developers any time to work on open source projects, or just projects of their own for the company?

    You’re going to want to spend time on your own stuff, whether to try out a new language or keep your skills up to snuff. You’ll probably want at least some of that to be open source work, so you can show future employers your coding prowess without violating NDAs. If your new job won’t let you invest in yourself, will they pay for training or conferences to compensate?

    1. What’s your employee review process? How often do you do employee reviews?

    Ideal would be reviews after 30, 60, and 90 days for new employees, with everyone else getting evaluated every 6 months. You need the feedback an employee review can give, and they should want to hear from you.

    1. Do you do code reviews? How often? What’s the process?

    Feedback, feedback, feedback. One of the fastest ways to grow as a developer is to have other people read and comment on your code. Frequent code reviews mean the team is committed to getting better.

    1. Do you do project reviews? What’s the process? Alternate: How is the performance of the dev team as a whole measured?

    Another feedback question. Again, you’re trying to see if the team is serious about getting better.

    These questions won’t cover everything, but they’re areas we developers often forget to check when looking for a new job.

    → 4:27 AM, Jan 18
  • How To: Sync Last Read Page Between Nook for Android and iPad

    Both Amazon and Barnes and Noble claim their ereaders will sync where you are in your books between the different devices (iPad, Android phone, PC or Mac) you might be reading on. Amazon’s works in the background, without a hitch, but Barnes and Noble’s (Nook) takes some finesse to get working.

    I nearly pulled my hair out in frustration trying to figure out why the last read page in my books wasn’t syncing between the Nook software on my iPad and the Nook software on my Android phone. I looked in the Settings for both devices, trying to find something that said “sync” and might have been turned off, but no luck.

    Here’s how to get them to sync:

    1. Whenever you finish reading on one device, instead of just closing out the software (or putting your device to sleep), go back to your "Home" or "Library".
    2. Look in the upper-right-hand corner of your Library screen. You should see a pair of curved arrows. Touch those arrows to force your device to upload its information (last read page, new bookmarks, etc) to B&N's servers.
    3. When you open your second device, make sure you start out on your Home/Library screen, and hit the same arrows. This will force the device to pull the latest information from B&N's servers (including the last read page you just uploaded).
    4. Open the book on your second device. It should jump to the last read page from the first device.
    That's it! Hope this helps, and let me know if you encounter any other weirdness while using the Nook ereader software.
    → 3:57 AM, Dec 16
  • Short Review of the Pangolin Performance

    Ever since I gave away my trusty Macbook, I’ve been pining for a new computer. The iPad purchase helped, but let’s face it: I’m not going to be able to do any programming on that thing.

    I knew I was going to install Linux on whatever I bought, so I thought I’d cut out the middle man and buy one direct from System76. They’ve been making laptops and desktops with Ubuntu pre-installed for a few years now, and their reviews have been positive. So I swallowed my trepidation at buying a laptop without test-driving it in the store first and ordered one of their Pangolin Performance machines.

    After two weeks, here’s what I think (in brief):

    What’s Good

    • Ubuntu: I didn't have to do any configuration out of the box, or hunt down any extra drivers. Nice.
    • Speed: Ye gods, is this thing fast. Transferring my entire music collection (a good 20 GB) from my backup drive took just 15 minutes. It's good to know the i5 processor + solid state drive were worth it.
    What's Bad
    • Keyboard: In a word, terrible. It's shifted to the left of the center of the screen, so I'm always twisted in my seat if I'm trying to type on it. The keys are more widely spaced than is comfortable, making my fingers work more to type anything. The spacebar also refuses to recognize most key-presses. Altogether it feels cheaply made, and is really frustrating to type on.
    • Customer Service: Not so helpful. I emailed System76 support about my spacebar problem. Their solution? "Press it closer to the center" Well, thanks, guys, but if I can only get a space by hitting a single spot on the space*bar*, it's not much use to me, is it?
    • General Build: Cheap. The "Ubuntu key" is just a regular key with a tacky sticker on it (placed off-center, no less). The laptop won't turn on unless you hit the power button at the exact right angle for the exact right amount of time. The whole thing feels shoddy.
    • Wifi: Maddeningly drops connections at random. Had to connect the laptop to ethernet to get reliable internet access. Sort of defeats the purpose of having a laptop, IMHO.
    It's a very frustrating laptop. It runs Ubuntu well, it's screaming fast, and it didn't cost me an arm and a leg. Unfortunately, it's impossible to type on for longer than a few minutes without making me want to throw it across the room, and it's useless without an ethernet connection.

    I’m close to returning it and just buying a Macbook. It might cost more, but at least I’ll know it’s solidly built.

    Update 12-15-2010: Finally convinced system76 to let me ship the computer to them for a keyboard replacement. Hopefully this’ll fix the spacebar problem and make the laptop worth keeping.

    Update 12-27-2010: They fixed the keyboard! Got the laptop back just before Christmas, and the spacebar works normally (as does the rest of the keyboard). Definitely keeping the laptop now. Thanks to system76 for coming through with hardware support.

    → 1:36 AM, Oct 24
  • iPad: 30 days in

    30 days ago, I broke down and bought an iPad.

    I know, I’ve ranted and raved against Apple’s unfair closed-source system. And yes, I hated the shopping experience my first time out.

    But lugging around my netbook + my Nook so I could read books and check email and read pdfs and read The Economist online started bugging me. Doubly so when I realized there were some ebooks I could only get from the Kindle store (damn you, DRM!), but neither my Nook nor my netbook could read Kindle books (Linux, it so happens, is the one platform Amazon’s Kindle software doesn’t run on). So I had to read Kindle books on my phone (Android), Barnes and Noble books on my Nook, and pdfs (Linux Journal - why do you guys cling to the old pdf format?) on my netbook.

    Needless to say, this drove me batshit after a while.

    So I trudged down to the Apple store to try out the iPad again.

    And guess what? My experience was much better this time. There was plenty of software installed on the demo units for me to try out. The staff answered all my questions, and actually seemed to care about selling me one.

    I picked one up, and after 30 days I don’t miss the Nook or the netbook at all.

    I can read all my books, from every store. I can push my pdfs into DropBox and read them with GoodReader. I’ve even started jotting down notes for a few short stories in Elements, again using DropBox to sync up the files between my Nook and my desktop.

    Oh, and I’ve also picked up a few games. Plants vs Zombies HD is almost worth the price of admission on its own.

    Can I program on it? Nope. Is it annoying that iTunes can’t play my .ogg files? Hell, yes.

    But you’ll have to pry it from my cold, dead hands before I’ll give it up.

    → 2:22 AM, Oct 15
  • How To: Run Clojure with Clojure-Contrib Library

    I recently picked up Programming Clojure and started working through it, trying to wrap my head around this new variant of Lisp.

    Installing clojure itself was pretty simple (sudo apt-get install clojure, since I’m using Ubuntu), but I had a hard time figuring out how to make the clojure contrib libraries available from the clojure REPL (I kept getting errors about the clojure-contrib classes not being on the classpath).

    Here’s how you do it: start the clojure REPL with an extra argument pointing to where you’ve installed the source files for clojure-contrib. For example:

    clojure -cp /home/rontoland/Code/clojure-contrib-1.1.0/src

    Since the clojure-contrib libraries are used throughout the book, I put the above code in a small script and saved it in my /usr/local/bin folder as clojure-repl, so I don’t have to remember the longer command.

    → 4:57 PM, Aug 22
  • Apple Kills Lala.com

    A few months ago, when Apple bought Lala.com, I didn’t panic. I thought Apple’d integrate Lala.com’s store into iTunes, rebrand the site, and keep things rolling.

    I was wrong:

    Dear Ron T.,

    The Lala service will be shut down on May 31st.

    In appreciation of your support over the last five years, you will receive a credit in the amount of your Lala web song purchases for use on Apple’s iTunes Store. If you purchased and downloaded mp3 songs from Lala, those songs will continue to play as part of your local music library.

    That’s part of the message I got in my inbox this morning. Apple’s shutting Lala.com down, and offering me “credit” in the iTunes store as compensation.

    Fuck you, Apple. I bought music from Lala.com because I didn’t want to buy it from your store. I had a choice, and I exercised it. But you just can’t understand that, can you?

    I will never buy anything from the iTunes store. I will never throw my money away on songs in your proprietary format.

    Lala.com’s ease of use, free access to every song in the catalog, cheap prices and web-based portability were far superior to the iTunes store. You couldn’t compete with that, could you, Apple? So you bought it and killed it.

    Fuck you.

    → 3:02 PM, Apr 30
  • The Choices I've Made

    Finished reading Just a Geek. Surprisingly, my experiences and feelings toward NASA parallel Wheaton’s feelings toward Star Trek in many ways: the feeling that I need to prove leaving was the right decision, the odd mix of guilt, excitement and nostalgia I feel whenever I see someone I used to work with, the worry that something went horribly wrong with my life and I’ll never get it back on track.

    It’s good, then, to see that Wil has grown into an acceptance of his past and his decision. I feel like I’m still somewhere in the middle of the story, with a sense that I can and should let go of both the image of myself that working at NASA gave to me, and the dreams I originally left NASA for. But I can’t bring myself to drop them, yet.

    That’s not to say I can’t dream new dreams. I know I should, and I’m trying hard to, but I’ll be damned if both dreams–NASA Engineer and Novel Writer–aren’t hard to wake up from.

    → 3:03 PM, Apr 15
  • What Have You Done For Me Lately?

    This weekend, a friend of my wife’s was gushing about how her church had just started a program to help the poor in Uganda: they take unwanted clothes from Ugandans, ship them over to the US so her church-members can sew them back together using Christian-themed patches, sell the clothes to people in the US, and then send most of the proceeds back to poor Ugandans.

    “Why not help the Ugandans setup a factory to do the clothes repair in Uganda, so they can sell the clothes to other Ugandans (or ship them themselves) for a profit?” I asked.

    She looked at me like such a thought had never entered her mind. Why wasn’t I proud that her church was helping the poor, helpless Ugandans?

    Because they’re not helpless. Because teaching someone to fish is always superior to giving them a fish. Because what her church is doing is not helping anything other than their own sense of self-righteousness.

    Christians in the 19th century were a progressive force: they pushed for the abolition of slavery, they setup workshops for the poor, they endowed schools and universities teaching up-to-date science and technology.

    The current crop of Christian evangelicals could not be more different from those charitable pioneers: they want to take rights away from homosexual couples, cheer when Muslims are discriminated against, and want science muzzled.

    So here’s my challenge to any evangelical, fundamentalist Christian: What are you doing to make the world more free, to add to the body of human knowledge, to increase the prosperity of your fellow man?

    → 3:05 PM, Apr 14
  • 3 Careers

    I was going to write up a list of the differences between my three careers (optical engineering, writing, and programming) and post them here, but then I realized what all my differences had in common: they were changes in the way people thought of me.

    As a NASA employee I was awe-inspiring, as a writer people envied me, and as a programmer I’m mundane but very very useful.

    Is that all a career is to me? A set of other people’s opinions?

    What I should talk about is what each career taught me.

    How NASA showed me how much human engineering can accomplish, while humbling me by forcing me to realize that decades-long projects are too long for me.

    Writing made me appreciate how hard it is to tell a good story, because my own efforts were far short of what I needed to keep steady writing work.

    And programming took me back to my days learning BASIC on a Commodore-128, while schooling me in how hard it is to run a company, to compete with other businesses and succeed.

    But I keep thinking that’s using the present to justify the past. What I’d like to know is: was I right to leave NASA, at the time I left it?

    → 2:33 PM, Apr 9
  • Facing the Past

    I’m reading Wil Wheaton’s Just a Geek, for two reasons: because I’ve enjoyed his blog, and wanted to check out more of his writing. And because I’m hoping he can help.

    If you don’t already know, Just a Geek is Wil’s book about his shift from being “That Guy Who Used to be on Star Trek” to the writer, blogger, and all-around geek Wil Wheaton.

    Here’s a guy who went from working on a show with millions of adoring fans, to being an out-of-work actor struggling with his bills, to a popular writer who’s given keynotes at PAX and has done hilarious cameos on The Guild and Big Bang Theory.

    And here’s the thing: he quit Star Trek. He wasn’t fired, they didn’t replace him with someone else, he walked away. Walked away from certain success to an uncertain future. He writes about how that decision haunted him, like my decision’s been haunting me.

    You see, I used to work at NASA. And not as a janitor or maintenance guy. I was an optical engineer, responsible for putting together instruments for the likes of the Hubble Space Telescope and the James Webb Space Telescope. I was paid really well to do really challenging work with brilliant people.

    But I quit. Five years after I started working as a wide-eyed college kid, my wife and I picked up and moved to Arkansas, leaving all that behind.

    And I’ve been wondering if I made the right decision ever since.

    So I’m reading Just a Geek, hoping Wil’s story will help me feel better about my own past, that learning how he grew beyond working on and then leaving Star Trek will help me put my own demons to rest.

    ‘Cause some nights I still dream that I’m back there at the Goddard Space Flight Center, working to expand our knowledge of the universe.

    → 3:08 PM, Apr 8
  • The iPad Experience: Best Buy Edition

    Me: Hey, iPad! Mind if I install this cool KoboBooks app I’ve heard so much about?

    iPad: Sure thing! Just gimme your iTunes password.

    Me: I don’t have an iTunes account.

    iPad: No account, no software.

    Me: Ok…Let’s just fire up mail.google.com, so I can check my email.

    iPad: Nope.

    Me: No?! I can’t check my email?

    iPad: Sure thing! Just enter your .Mac password…

    Me: Screw this. I’m buying a netbook.

    → 9:47 PM, Apr 6
  • Apple's Garden is Walled, with Locked Gates

    I’ve just been reminded why I left Mac for Linux.

    Me (to store rep): “Can I install and play with some apps on this demo iPad so I can decide if I want to buy one?”

    Rep: “Nope. Use just what’s installed.”

    …and that’s when I left. If I can’t be allowed into the Walled Garden of Apple long enough to decide if I want to spend some money there, I’ll stick with my open-source.

    I’m off to Best Buy to look at a Linux-compatible netbook.

    → 8:20 PM, Apr 6
  • How To: Change Imagefield Thumbnail Size in Drupal

    In Drupal, the Imagefield fieldtype comes with a built-in thumbnail generator. If you'd like to control the size of the thumbnail, just set the value of the imagefield_thumb_size variable, like so:

    variable_set('imagefield_thumb_size', '200x200');

    That'll set the imagefield thumbnail size to 200 x 200 pixels.

    → 9:09 AM, Feb 9
  • 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?
    → 4:39 AM, Jan 1
  • 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.

    → 8: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).

    → 3:39 AM, Nov 30
  • 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

    → 5:45 PM, 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?

    → 1:28 AM, Apr 25
  • 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?

    → 1:32 AM, Apr 24
  • 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.

    → 7:28 PM, Apr 13
  • How To: Install Sun Java in Ubuntu from Command-Line

    Had to do a fresh install of Sun's Java on a remote Ubuntu machine this weekend. It's pretty easy to do in a graphical environment, but I only had ssh access. Since I couldn't find a set of instructions on how to install Sun's Java from the command line, I thought I'd put together my own how-to.

    You'll use the apt-get command to grab the Sun java .deb files and install them. It works just like a command-line version of the Synaptic Package Manager you probably used to install software from the graphical environment.

    But apt-get doesn't know how to find the Sun Java files unless you add some sources to its repositories: a list of all the places apt-get looks for software.

    Once you've added the repositories to the source list for apt-get, one command will install everything for you. Here's a step-by-step way to do it:

    1. Type "nano /etc/apt/sources.list" to open a command-line text editor to edit the list of repositories apt-get will look through.
    2. You'll see some lines, starting with "deb" or "deb-src" already in the file. Add the following lines to the file:

      deb http://us.archive.ubuntu.com/ubuntu/ hardy universe deb-src http://us.archive.ubuntu.com/ubuntu/ hardy universe deb http://us.archive.ubuntu.com/ubuntu/ hardy-updates universe deb-src http://us.archive.ubuntu.com/ubuntu/ hardy-updates universe deb http://us.archive.ubuntu.com/ubuntu/ hardy multiverse deb-src http://us.archive.ubuntu.com/ubuntu/ hardy multiverse deb http://us.archive.ubuntu.com/ubuntu/ hardy-updates multiverse deb-src http://us.archive.ubuntu.com/ubuntu/ hardy-updates multiverse

    3. Press Ctrl-O to save the file. Press Return to agree to name the file sources.list, then press Ctrl-X to leave the editor.
    4. Type: "apt-get update"
    5. Type: "apt-get install sun-java6-jdk"

    That should do it!

    → 2:24 AM, Nov 15
  • Hope Mingled with Despair

    So, Obama won the Presidential race, making me proud to be a citizen of the USA and hopeful that we can turn things around here.

    But Proposition 8, the hateful law banning gay marriage and writing bigotry into the California state constitution, looks like it will pass.

    Thousands of perfectly legal marriages between same-sex couples will be in legal limbo, not officially dissolved but suddenly not recognized, either. The thought that such an evil law could pass in what is supposed to be the most progressive state in the Union makes me fear for the ability of the U.S. to grow up into a modern nation.

    For those of you who voted for Proposition 8, I hope you live long enough to see your vote as shameful, just as voting for a law banning interracial marriage is shameful today.

    → 12:08 AM, Nov 6
← Newer Posts Page 31 of 34 Older Posts →
  • RSS
  • JSON Feed