Posts tagged ‘software’

WhoHasMy Home

I finally took the time to move WhoHasMy from my personal shared host to its new home on the Webfaction account we won in the competition that gave birth to it.

I’ve also updated WhoHasMy to include a few bug fixes I had been working on. I think I moved all the data from sample accounts that had signed up on the temporary host, and everything “seems to be working”.

Going forward, we have plans for several improvements to the project and hopefully turning a small profit on Amazon affiliate links. However, I think all of us are still recovering from the intense initial development during the dash, so there probably won’t be much new code going into it for a while.

Offline-Enabled Web Apps: The Future

I was reluctant to join the world of web development. I started in high school with a few sites and realized several things: Javascript sucks, Internet Explorer sucks; therefore web development sucks.

Fast-forward through a couple academic degrees. Job hunting with one requirement: Python. Python jobs all require Django.

So I learned Django, assuming, incorrectly, that if I was developing python backends, I wouldn’t need to work with the horrors of Javascript or Internet Explorer. I earned money. I relearned Javascript and became a first rate web developer.

In the back of my mind I still felt that web development sucks. So a few weeks back when deciding on a platform for a personal project, I thought I’d try something new. The Android platform was in my hands and I gave it a whirl.

I didn’t enjoy it much and I am now rewriting the app as an offline enabled webapp using Google Gears.

Then Chrome OS was announced and I realized that I’ll probably be doing a lot of offline enabled webapps using Google gears and/or HTML 5. Like it or not, it’s the future. Me, I like it. There are a lot of advantages to this kind of setup: I can access the apps from my phone, my laptop, my parent’s desktop, or Phrakture’s hacked computer whenever and wherever I want. I don’t have to write a different client for each one. Its true ‘write once, run anywhere’. I can upgrade each of those clients automatically as long as there’s a network connection.

On that note, you don’t need a network connection to run HTML 5 or Google Gears based apps. They both provide a ‘localserver’ that caches pages and javascripts, and give you an SQLite database for data caching. Typically offline versions of apps are not as powerful as their networked counterparts, but they do not require network access to run. Further, because they are locally cached, they can be made to run as fast as a “standard” (old fashioned) desktop app. The apps run in the browser, but the browser is just a container, a window manager, to hold the application.

In traditional webapps, you code most of the logic on the server side. In this new model, you end up coding most of the logic in the client, because the app needs to run without a guaranteed server connection. For me, this has a massive, nearly show-stopping drawback: A large portion of the app must be written in Javascript. JQuery makes Javascript suck lest, but it still sucks. I’m a Python programmer.

For years, I’ve dreamed of browsers supporting tags that allow me to write my DOM manipulation scripts in Python rather than the ubiquitous and annoying Javascript. This wasn’t possible because python can’t be adequately sandboxed such that arbitrary scripts running on the web don’t have access to, say, your entire hard drive.

This is no longer true. The PyPy project finally has a complete Python 2.5 interpreter that can be safely sandboxed. Since discovering this at Pycon 2009, I’ve been thinking about interfacing it with a web browser.

I figured “somebody must have started this already”. Google didn’t help much, but when I logged into #pypy on freenode I was told “fijal started doing that with webkit yesterday”. I’ve been following up trying to get the project to build (I was warned that the build process is a mess and was invited to wait until it is cleaned up a bit). So far, no luck, but I am optimistic that python support is finally coming to the browser. Granted, it won’t be much use for public webapps (at first) since browsers won’t want to be distributing pypy, but a lot of my projects are personal, and satisfying the general public will be far lower on my priorities list than ‘developing in my preferred language’.

I’ll have to install a pypy interpreter into Chrome Lite under Android before this is useful to me. That may be tricky.

Recent Developments

I’ve been awfully busy the past few weeks, but finally had three separate evenings to sit down and code on some of my little projects this week. I’m anticipating having more time in a couple weeks, as I gave notice on my job on Thursday. I am, however planning a move and exploring numerous job opportunities in my home province.

I managed to fix a couple bugs on WhoHasMy. As previously reported this project was originally coded in 48 hours for the Django Dash competition. We tied for fifth place and have traded the resulting bitbucket account for a github prize. I’m very happy with the placement given that my brilliant co-developers had nil django experience going into the competition and I hadn’t touched it professionally in months. I added a TOS to the page as requested in a comment on my earlier post, fixed some ordering bugs in the lists, fixed a couple broken links, and made it easier to add information about friends when you loan an item to someone not currently in the system. And here we thought it was 100% bug free when we finished our 48 hour stint and stumbled off to bed.

I have also spent a fair bit of time improving Quodroid, the Android app for controlling quod libet on my laptop from my phone. It now uses fancy icon buttons, allows you to specify the host and port you want to connect to, lists the currently playing song whenever you perform an action, allows volume control, and gives a semi-sane error message when the phone can’t connect. In short, its actually useful and usable by someone other than myself. I’ve been using it regularly the past few days. I still have to arrange it to perform the network stuff in a service instead of the main activity, which occasionally becomes unresponsive if the server is slow to respond. I’m actually becoming more comfortable with Java again as I develop this, its not as evil as I thought, but it certainly cuts into productivity.

Today, I made a few changes to opterator. I wrote my first app (a contrived example code-test for a job I’m pursuing) that actually used opterator a couple weeks back and found it was missing a few features. It now the ability to have multiple copies of a single option. Turns out this actually worked, all you had to do was use the ‘append’ action. I wrote three tests, didn’t change a line of code and poof, I had append support! I then realized that storing the action in the docstring was unnecessary as it could be introspected from the type of the keyword argument. This makes the @param docstrings a lot more readable and informative. As simple as this little module is, I feel its one of my more brilliant innovations.

I’ve also tossed around the idea of having multiple opterated main methods in a single module and allow the decorator to pick which one to call depending on the options. This seemed cool at first, but I think it may violate the ‘one best way’ policy of Python. I also realized that deriving sensible error messages and usage strings would be really painful, from the end user’s perspective, so I’m holding off on this until I’ve decided how best to do it.

Todo List

I’ve spent a lot of time thinking about the proper way to design a calendar and to-do list application.  The irony: I never got around to putting ‘write to-do list application’ on my to-do list.

The best to-do list I’ve seen was designed by Kim Hoyer with input from myself and another developer. Its part of Kim’s proprietary Pursuits XRM System, a comprehensive sales and company management system. Oprius also has a terrific to-do and appointment management system. Google’s Calendar, on the other hand, seems to have done everything all wrong, by my standards.

I’ve read about several of the web-based options and discarded them for various reasons, usually too much complexity. Remember The Milk is a notable exception in that its complexities can be easily ignored. However, its still due-date based, and that’s not the way I work.

Stephen Covey’s well-known ‘The Seven Habits of Highly Effective People’ describes a slightly over-engineered, but otherwise workable paper-based to-do system that really jives with the way I think.

I’ve tried numerous solutions and always fall back to writing stuff on a scrap of paper. I’ve been actively monitoring exactly how I really do things (instead of trying to imagine how I should do things) in the 5.5 months since getting a day-book for Christmas. I’m ready to design a to-do list. I’d probably have sat down and started coding by now if I didn’t have this blog thingy to lay out some ideas. Just a little groundwork.

Day-oriented, not due-date oriented

When I plan what I want to do, its always about what I want to do today. I don’t care that the due date of a task is in two weeks, I care only about choosing whether I am or am not working on that task today. When I’m done working on the task today, I cross it off my todo list, even if the task isn’t complete. If its not complete, I add a NEW task for the next day. Its good to break big tasks into bite-sized sub-tasks, but often I just write the same task down for each day that I work on it.

Only plan a few days in advance

I need to be able to add, reorder, and move tasks between all days, but typically I won’t have tasks listed for something more than a week in advance. Unless I’m specifically meeting someone or planning a vacation, I don’t have stuff filled out for two months from now.

Area for planned but scheduled tasks

I currently add tasks I intend to do in the future for other days and then ‘move’ them by crossing out and rewriting under another day. This is suboptimal. I want a separate section for tasks that I don’t want to forget. It needs to be easy to move them into a specific day.

Recurring Tasks Suck

Most of the tasks I do on a recurring basis don’t happen at the same date and time each week. I just know I need to do them once a week. Having them auto occur makes me easily ignore them.

Instead, I need an area (possibly same area from previous point) to store tasks that I do repeatedly. These would be generic tasks and whenever I need to put one on a specific date I can just select it and add a date.

Super minimalist

I don’t need to attach much info to a task. I don’t need priorities, descriptions, notes, durations, locations, contacts. This shit clogs up the interface and the task name itself usually helps me recall all I need to remember about this stuff. Maybe if I was a sales person with 90 contacts per day that I can’t remember their names and faces I’d need those details, but in my life, its just extra cruft.

Task Ordering

On any given day, I want the completed tasks at the bottom of the list. Uncompleted tasks are at the top in a semi-ordered fashion. Currently when I sit down at my daybook, I cross out the last item I did and pick another one based on my current priorities. Sometimes I draw numbers beside them to note the next three things I’m going to do. In software, I want to use either drag and drop or tap-to-raise to easily order the next few things I plan to do. When I finish one, I want it to be easy to change my mind about what I’m doing next. Keep it agile!

My Phone

I expect I would make this a web app in the long run so I can access it anywhere, but I definitely need to be able to access it on my phone (Android Dev Phone). Since I want to play with the android APIs anyway, my first attempt is going to be for Android. Later I’ll tie it up to a mobile-oriented webapp similar to Choncho.