Don’t Be Ashamed

Posted February 6, 2011 under General, Keryx

Something that has been on my mind recently is the quality of software I produce. I’ll be graduating in a few short months. I feel it’s absolutely crucial that I write elegant code so that when I begin applying for jobs, I’ll have great code samples.

This is an idea I don’t actually believe. It’s been engrained in my mind and I don’t know why. Throughout school I’ve been trained to do things “better” so that I can get better grades.

In reality, I’m not sure this translates well into the business world. Writing “better” software means getting things done sooner and iterating more often. Assignments in school are one shot. You either do well or you don’t and it’s over after that.

Building businesses and software typically aren’t like this. You’re given the it a go, and you present it early, draw feedback, revise, and launch. Once you’ve launched, you can continue iterating and maybe even recover from a somewhat failed launch.

It all depends on your heart and motivation. Are you ready to accept failure? Heck no! Are you willing to pivot? Yeah, it’s what I have to do.

I know a lot of fellow developers and students who dislike showing their work until it is finished. One class project I am a part of consists of our team building a website to manage campus tour visitor registrations. Since this is our first and only major project of our entire Bachelors degrees, we decided an agile approach would be best. We iterate, present it to the client, make sure it’s something that will help them in the end. Not surprisingly, one of my team members is completely against showing our client the product before it is polished and complete. No matter how much arguing we do, he stands his ground that testing is not very important until the product is finished.

We only have a semester for implementation and have class and work outside of this project. There is certainly no time to rewrite the project from scratch if the client doesn’t like our approach so it is imperative we start getting feedback right away.

Of course we aren’t going to present them with bug ridden code, but as we complete features, we certainly want to know if they like them.

I felt the same way when I launched Keryx. This was a project I spent many months on. I was naive at the time, and just release an incomplete application to the public. Not expecting anyone to care, I was pleasantly surprised when people started talking about it. Without releasing early, I wouldn’t have felt any drive to continue development. It did enough of what I wanted, still horribly incomplete, but people’s reactions drove me the extra mile. Now I have something I can be proud of, I have continued iterating on Keryx with help from several unbelievable volunteers and we have surpassed 50,000 downloads. This naive approach could have ended there, but instead it has brought me much more, even to tears at times through some incredibly heartfelt thank you’s I have received.

So don’t be ashamed of anything you do. Show everyone you can, be proud of what you accomplished. If someone says it’s crap, be humble about it. Ask them what is wrong, how you can improve it, and do so. Nothing can stop you if you hustle hard enough.


Podcasts!

Posted December 23, 2010 under General, Keryx

Quite a while back I had the idea of doing a podcast. Of course, like everything else, the idea got tucked underneath a huge pile of papers in the filing cabinet you might call my brain. I’m happy to say that I’ve joined a podcast called Techie Trio with a couple of my friends Oliver Krystal and Michael Secord. Sure we might ramble and get lost in conversation a bit, it’s kind of a fun project (or should we call it experiment?) that we have all been working on. The Techie Trio homepage is over at http://tt.g2k5.us for anyone interested. :-)

Along with that, today I was put on trial for my good friend Zach Thibeau’s podcast. We talked about Keryx, Linux, and some other random topics. Check it out if you’d like to hear a little background on Keryx, how it got started, over at: http://zachthibeau.com/blog.php/podcast-episode-2/

It’s interesting to say that I have never met anyone of them in person, but we chat all the time online. Pretty cool to see what a little internet sprinkled on things can do. Or is it creepy? All in all I’d have to say I would have liked to get started doing podcasts a while ago. I’m sure I’m terrible at it, but given enough hours droning on and on about random tech, we should eventually be good at it right? o_O


Ubuntu Quickly, Python, and DistUtils

Posted December 20, 2010 under Keryx, Python

Preparing for the Keryx 1.0 release over the past couple of days, one of the things I’ve been learning is how to build Ubuntu and Debian packages. Sure sure, I’ve been “cheating” using Quickly. :)

Quickly is probably one of the coolest tools I have used. All the hassle of building an Ubuntu application is already taken care of, and it takes the Ruby on Rails approach to guiding you through development. It’s quite great.

As I was packaging Keryx 1.0 last night, I ran into an issue. DistUtils could not find my python modules. I was getting an ERROR: Python XXXXXXX module not found. when I would run quickly package.

Well that’s no good. Keryx runs just fine, all those modules are imported just fine. What the heck is going on??

I spent a few minutes trying to configure DistUtils py_modules to try to add them manually. No dice. It turns out that DistUtils really does not like relative path imports. Seriously?? Yeah. :( Sad story huh?

The most convenient solution I could come up with was to change ALL of my imports. My directory structure was pretty simple:

bin/keryx
keryx/
keryx/unwrapt

bin/keryx is the main application. keryx is a folder of extra GTK code. keryx/unwrapt is the entire backend for Keryx. The backend is a separate module and uses relative imports so that it can function independently.

I decided to move Unwrapt into Keryx’s source tree instead of making it a separate package. This would reduce dependencies and overall make things less complicated. The solution to DistUtils problem was to simply go through and change all of my imports from relative import XXXX to import keryx.unwrapt.XXXX. You reference modules from the top level which is where DistUtils will be run from. This lets Keryx still run, and everyone be happy.


Python binary executables with Pyinstaller!

Posted October 24, 2010 under Keryx, Python

We’ve had a hard time finding a decent Python binary builder. This is of course coupled with our requirement that it needs to build the wxWidgets binaries with it. I’m sure that it’s not a terribly easy task to build such a library that is capable of this. We’ve finally found a pretty decent solution I think.

Pyinstaller has hit version 1.4 and supports quite a few popular libraries out of the box. This turned out to be a godsend after we had fiddled for a long time with py2exe and then had to figure out yet another tool to build a Linux binary. Pyinstaller can build for Windows, Linux and OSX!

The only downside I have seen to using Pyinstaller so far is that we have to consistently build individual releases of Keryx along with each release of Ubuntu. As so many things regarding libraries between each release, it’s incredibly hard to have a binary that works across multiple releases.

That’s about all I can say about Pyinstaller, it works, and it works quite well. You can grab the latest release of Pyinstaller over at www.pyinstaller.org if you are looking to build a Python binary for your application.


Keryx on OMG!Ubuntu!

Posted September 24, 2010 under Keryx, Ubuntu

It’s been a while since I’ve posted anything on here. Life has been hectic, senior year of college has begun, and I’m working quite a few hours each week. Little free time means I’m usually too exhausted during those hours to actually accomplish something productive. That’s going to change and I needed a little boost to get motivation. I submitted Keryx as a tip for OMG!Ubuntu! yesterday to help spread the word.

I certainly did not expect such an overwhelming and encouraging response from the community. :-) It really touched me, as this blossomed out of an itch I had, and I never expected to have contributed to so many users along the way. It’s been a rough 4 years learning Python, version control, proper programming styles, and managing a decent sized project for a college student with no experience. I never dreamed I’d have over 32,000 downloads.

I just wanted to stop for a moment and thank each and every one of you. Each download sparks another ounce of motivation, and the contributions of code, translations, and bug reports has been unbelievably helpful in teaching me and helping to build a better product. Again, thanks for being such a wonderful community, I’m just happy that I could be of help to at least one other Linux user. :D

For those of you that haven’t read the article or the comments, here is the link: omgubuntu.co.uk/2010/09/keryx-offline-package-installation-made-easy-in-ubuntu/


Multiple Version Control Systems At Once!

Posted July 12, 2010 under General, Hacking, Keryx, Ubuntu

For Keryx, I have been working on a new backend system called Unwrapt (A play on words regarding the APT package system :P ). I’ve been coding on github for the social coding aspects and keeping the branch on Launchpad.net as well to be part of Keryx’s page. This meant every time I wanted to commit and push, I’d have to do twice the amount of commands. Of course, being a lazy coder like the rest of us, I decided to script it. Fired up Gedit, and two seconds later I had this:

#!/bin/bash
 
bzr commit -m "$@"
bzr push
 
git commit -am "$@"
git push origin master

Usage is simple (example is using this script saved in ~/vcs.sh). Just execute this from inside your versioned directory like you would normally with git and bazaar:

$ sh ~/vcs.sh "first commit"

It pushes to your default branches (if you have any setup) in one strike using the commit message you pass to the script. Easy as that! I’m sure people might have some good ideas on features and improvements so leave them in the comments!


Getting Started With Quickly

Posted June 21, 2010 under Keryx, Python

Recently an open source project called Quickly has sprung up and looks to be an incredible tool for new developers looking to work on open source GUI projects. The description from their website reads as follows:

Quickly helps you create software programs (and other things) quickly. You can select from a set of application templates and use some simple quickly commands to create, edit code and GUI, and publish your software for others to use. Quickly’s templates are easy to write. So if you are a fan of language foo, you can create a foo-project template. Or if you want to help people making plugins for your killer app, you can make a killer-app-plugin template. You can even create a template for managing corporate documents, creating your awesome LaTeX helpers The sky is the limit!

Sounds like a cool project right? You bet. I’m going to be using Quickly to begin working on the official unstable branch for Keryx 1.0 and will outline the steps I took to get started here.

Installing Quickly

Super simple. Just fire up a terminal and “sudo apt-get install quickly” or install the quickly package via Synaptic or your favorite package management tool (maybe even through Keryx!). Once that is installed, you can fire up the documentation if you like by typing “quickly tutorial ubuntu-application” and it will open up the Quickly User Guide which is a handy reference.

Creating a Project

Nothing more than a “quickly create ubuntu-application keryx”. Just tells quickly you are building a new application with the Ubuntu template named Keryx. Simple as that. It sets up the directory structure for you and everything! So handy!

Getting to Work

Modifying the GUI is simple, just do “quickly design” and Glade is opened up with your ui file ready to go. The same goes for editing the code with a simple “quickly edit” which opens up all the files necessary for your application in your standard text editor.

Committing

“quickly save notes” is all you need to do to make a commit of your changes with the comment “notes” and submit this to launchpad using the bzr version control system.

There are a few other commands you might be interested in, mainly for packaging and releasing but this is a very simple tutorial on how we setup Keryx 1.0. If you’d like to contribute, just download the unstable code branch from launchpad and start using it with Quickly!

So I suppose I will leave it at that for now. Quickly is a way for new developers and contributors to easily be able to jump in and start working on projects. We will be using this for Keryx 1.0 and hope this will encourage contributions and make bugs easier to fix.


Resume downloads with PycURL RESUME_FROM

Posted June 12, 2010 under Keryx, Python

If you’ve ever played with urllib, you might have noticed its reasonably slow download speeds and wanted something a little bit more. That’s where cURL comes into play. It’s a very powerful library and is used in applications such as Gwibber. Seeing that this ships with Ubuntu, it is a good fit for Keryx’s new backend library Unwrapt.

I spent yesterday working on this new downloading code and wanted to share my code as I found the documentation (in reality, the entire library too) is primarily in C style and confusing examples. This is an easy to use class that helps to take care of some of the mundane details like following redirects (which is important! if you don’t enable this you won’t be able to reach a lot of files). I plan on extending this to support proxies soon as well as a GTK progress function.

#    Unwrapt - cross-platform package system emulator
#    Copyright (C) 2010 Chris Oliver <chris@excid3.com>
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 
import math
import pycurl
import os
import time
import sys
 
 
class EasyCurl:
 
 
    def __init__(self, proxy=None):
 
        self.pco = pycurl.Curl()
        self.pco.setopt(pycurl.FOLLOWLOCATION, 1)
        self.pco.setopt(pycurl.MAXREDIRS,      5)
        #self.pco.setopt(pycurl.TIMEOUT,       5*3600)
        self.pco.setopt(pycurl.CONNECTTIMEOUT, 30)
        self.pco.setopt(pycurl.AUTOREFERER,    1)
 
        #TODO: Proxy!
 
 
    def perform(self, url, filename=None, resume=True, progress=None):
 
        # Generate filename if not given
        if not filename:
            filename = url.strip("/").split("/")[-1].strip()        
        self.filename = filename
 
        # Get resume information 
        self.existing = self.start_existing = 0
        if resume and os.path.exists(filename):
            self.existing = self.start_existing = os.path.getsize(filename)
            self.pco.setopt(pycurl.RESUME_FROM, self.existing)
 
        # Configure progress hook            
        if progress:
            self.pco.setopt(pycurl.NOPROGRESS,       0)
            self.pco.setopt(pycurl.PROGRESSFUNCTION, progress)
 
        # Configure url and destination
        self.pco.setopt(pycurl.URL, url)
        self.pco.setopt(pycurl.WRITEDATA, open(filename, "ab"))
 
        # Start
        self.pco.perform()
 
        sys.stdout.write("n")
 
 
    def textprogress(self, download_t, download_d, upload_t, upload_d):            
 
        downloaded = download_d + self.existing
        total      = download_t + self.start_existing
        try:    frac = float(downloaded)/float(total)
        except: frac = 0
 
        bar = "=" * int(25*frac)
 
        sys.stdout.write("r%-25.25s %3i%% |%-25.25s| %5sB of %5sB" % 
            (self.filename,
             frac*100,
             bar,
             format_number(downloaded),
             format_number(total)))
 
 
# Borrowed from the urlgrabber source
def format_number(number, SI=0, space=' '):
    """Turn numbers into human-readable metric-like numbers"""
    symbols = ['',  # (none)
               'k', # kilo
               'M', # mega
               'G', # giga
               'T', # tera
               'P', # peta
               'E', # exa
               'Z', # zetta
               'Y'] # yotta
 
    if SI: step = 1000.0
    else: step = 1024.0
 
    thresh = 999
    depth = 0
    max_depth = len(symbols) - 1
 
    # we want numbers between 0 and thresh, but don't exceed the length
    # of our list.  In that event, the formatting will be screwed up,
    # but it'll still show the right number.
    while number > thresh and depth < max_depth:
        depth  = depth + 1
        number = number / step
 
    if type(number) == type(1) or type(number) == type(1L):
        # it's an int or a long, which means it didn't get divided,
        # which means it's already short enough
        format = '%i%s%s'
    elif number < 9.95:
        # must use 9.95 for proper sizing.  For example, 9.99 will be
        # rounded to 10.0 with the .1f format string (which is too long)
        format = '%.1f%s%s'
    else:
        format = '%.0f%s%s'
 
    return(format % (float(number or 0), space, symbols[depth]))
 
 
if __name__ == "__main__":
    url = "http://launchpad.net/keryx/stable/0.92/+download/keryx_0.92.4.zip"
    ec = EasyCurl()
    ec.perform(url, progress=ec.textprogress)

Unable to open file: unknown opcode

Posted June 10, 2010 under Keryx, Python

Well, this certainly isn’t too common of a problem it appears. I have been searching for a bit today trying to work out a recent Keryx bug that has crept up on our current stable release. Took me a little bit but I seem to have figured it out.

Now this all is all based around our Pyinstaller Linux binary. We packaged this with 1.4 (pre-release) and didn’t think much of it until now. It seemed that the release we had built ran fine on Ubuntu 32 and 64bit releases. That has proved to be an incorrect assumption now. Something must have changed in the latest Ubuntu release that caused this to break. Maybe it’s libraries that have changed, maybe it’s something else. I’m not sure.

What happens is when you run the Pyinstaller Linux binary of Keryx on a 64bit machine, you receive the following errors:

/usr/lib/gio/modules/libgvfsdbus.so: wrong ELF class: ELFCLASS64
Failed to load module: /usr/lib/gio/modules/libgvfsdbus.so
/usr/lib/gio/modules/libgioremote-volume-monitor.so: wrong ELF class: ELFCLASS64
Failed to load module: /usr/lib/gio/modules/libgioremote-volume-monitor.so
/usr/lib/gio/modules/libgiogconf.so: wrong ELF class: ELFCLASS64
Failed to load module: /usr/lib/gio/modules/libgiogconf.so
XXX lineno: 320, opcode: 54
Unable to open file: unknown opcode

This appears to happen when opening the gzip files which we downloaded just before the error occurred. The rest of the application seems to have normal execution. Testing this exact same release on my Eee PC running 32 bit Ubuntu 10.04, you can imagine that it worked perfectly fine. So it appears that something in the Python gzip libraries that was dynamically linked (and not bundled into the executable) has changed and is no longer compatible.

I’m working on building a 64bit copy of the Linux executable using Pyinstaller for those users. I’ll post an announcement on the Keryx website when it is available.


Keryx Shwag!

Posted June 6, 2010 under Keryx

Available starting today is our CafePress store! You can buy things like Keryx tshirts, hoodies, and gift items to support the project! http://shops.cafepress.com/KeryxProject


« Older |