3
I Use This!
Activity Not Available

News

Posted over 17 years ago by Paul Hummer
On Friday, I decided to plan a sprint for the weekend. It required a little more coordination than I originally expected. With the developers strewn from Finland and Poland, to the UK, to Maryland, and finally, myself, in good ol' -7 GMT, there's a ... [More] 9 hour difference. This required me to get up quite early on Saturday, and spend a whole weekend hacking on Entertainer. After a whole weekend working with two other developers, and very good up-and-coming developer/tester, and the occasional testers dropping into the IRC channel to say hi, file a bug, and then leave, we got a lot accomplished. I was finally able to complete a working VideoThumbnailer class (which meant reading every gstreamer doc, and tons of blogs, and still learning from trial and error). Joshua Scotton was able to complete the news reader portions, with support for Liferea feeds, etc. Lauri has successfully written cd playback, and is hoping to get DVD playback in soon. We also now have 10x the tests than we had on Friday evening (from 4 to 41), with all but two passing, and four of which were tests that revealed bugs (and the two that aren't passing are among them). A total of 1,728 new lines of code were introduced into the codebase, over 25 commits. Documentation was updated and confirmed to be detailed. 10 new bugs were filed, and 7 reported bugs were closed. A large amount of code was refactored using our newfangled test framework, and we were able to find a few issues with architecture and coding practices, optimizing as we went. Overall, the sprint was an absolute success. We were able to talk to eachother, and determine what was required for a 0.1 "preview" release, and what we could push off for another version. I made some great progress on converting all of our current ASCII string data to UTF-8, although there is still a bit of room for improvement (and I'll be working on that off-and-on for the next while). I'm hoping that we can sprint once a month on Entertainer, and really get a neat, polished app soon. [Less]
Posted over 17 years ago by Joshua Scotton
We had a coding sprint on the Entertainer project over the weekend. We got the video thumbnailer working and I’ve added liferea support to the feed viewer. Take a look at the project at http://code.google.com/p/entertainer-media-center/
Posted over 17 years ago by Paul Hummer
I've slowly been reading the Python IAQ, a compilation of "infrequently asked questions" for Python. This fascinated me when I first stumbled over it because I had just learned that prefixing a member attribute of an object with '__' made the ... [More] attribute pseudo-private. I'd never used this idiom before, so I didn't know, and it only surfaced when I was trying to write unit tests for code that I hadn't actually written. My curiousity at what else I had been missing out on got the better of me, and I started reading the article a bit at a time compiling another project I'm working on. Some of it I grew tired of, because it was trying to make Python into C/C /Java/pick-your-favorite. One my favorite things about Python is its idioms and differences with other languages, so I wasn't thrilled about making Python look like Java. But after reading through those first few questions, I found quite a few little tricks, like implementing an abstract class in python, which I've always thought about. It uses a few neat little tricks in python to do things that otherwise wouldn't be simple. It's a good read. Go read it. Do it. Do it now. [Less]
Posted over 17 years ago by Paul Hummer
I've been working on a new project, called Entertainer, which is aiming to be similar to MythTV, but with a featureset devoted more to end users than MythTV is. It's got a pretty slick interface (although some of the interface code is based on an ... [More] alpha library right now), and has been quite educational for me, especially since I've been working specifically with the gstreamer python bindings. Recently, I've been working on a VideoThumbnailer for Entertainer using gstreamer. While I worked on it, another developer broke the actual GUI code (or rather, a widget from a library Entertainer's GUI depends on broke), which completely halted me from testing it (Entertainer is pre-alpha). This was okay, because I had only been reading documentation on the Gstreamer, and hadn't quite gotten to code yet. However, before I got to coding, I decided that I needed a way to the thumbnailer, and with the frontend broken, I couldn't very well do that. So I decided to write a unit test. After stubbing out the unit test, I got to work. Originally, I was using nose and then eventually just creating my own test runner, to eliminate dependencies (we already have a ton of them...). I put a lot of work into the test framework, making sure output was clean and everything. It was only after all of this, and I was working on the thumbnailer and running the unittest to see if it worked that I realized I was doing test-driven development. It was something I had always read about, but had never done. I will swear by it now. It's made my life so simple. Even now that the GUI in Entertainer is working again, I don't much care to use it to test. I've got a unittest that tells me all I need. If I need more, I'll modify the unittest. What's even better is that the rest of the Entertainer developers are also getting on the bandwagon. We even have a developer who's never written python before that will be writing the tests for a lot of the code we have. How cool? [Less]
Posted over 17 years ago by Paul Hummer
I stopped reading Slashdot two years ago. Compared to news sites that are more "web 2.0" compliant, and driven more by the community, Slashdot consists of the same rotten community comments of Web 2.0, without having anything that can merit "news." ... [More] However, while exploring more Google Reader features, I stumbled upon these prepackaged feed lists that Google compiles. I added a few, and lo and behold, Slashdot's feed was in there. Then I read this article about Python 3000's lack of compatibility. Did I miss something? How is this news? Guido van Rossum announced this quite some time ago. I severely doubt Google, with so many of python's developers as employees, is being taken by surprise at this news, or any other respectable Python shop. Needless to say, Slashdot had a good run of two days in my reader, but I removed it, so that I don't have quite so much "noise" in my reader. [Less]
Posted over 17 years ago by Joshua Scotton
I was recently generating some documentation from the Entertainer source code and decided to share how I managed to do it. I’m assuming python 2.4 is installed on your system. First install doxygen and graphviz
Posted over 17 years ago by Paul Hummer
I've been working in a Java environment recently. I've found that no matter how much Java I think I knew in school, it must not have stuck with me. I'm having to relearn data structures in Java, and now that I know a thing or two, I've come to ... [More] realize that Java's data structures are hugely verbose and rather difficult to work with sometimes. Of course, this is because I've been spoiled recently working in more "fun" languages, like my python... Consider the following situation. I had two maps that needed to be compared. If you're not a Java guy, think key->value structure. Anyway, I solved the problem by creating a Set (think array) or all the keys that were different between the two, and then showing the results. Here's the java result: Set<String> changes = null; Iterator it = map1.keySet().iterator(); while(it.hasNext()) { String key = (String)it.next(); if(map2.containsKey(key)) { if(!map1.get(key).equals(map2.get(key))) { changes.add(key); } } else { changes.add(key); } } In python, I just do this: changes = [] for key in dict1.keys(): if key in dict2: if dict1[key] != dict2[key]: changes.append(key) else: changes.append(key) Now, I may be nit-picking, but you tell me which one is more clear and concise. Sometimes, being verbose isn't such a good thing after all... (I'm thinking of a specific person who talks way too much) [Less]
Posted over 17 years ago by Paul Hummer
After looking through my Google Analytics results, I noticed that a few hits to my site were people looking for a howto on integrating django-tagging, which I have been wanting to write for quite some time. While I'm quite experienced working with ... [More] SQL schemas and the like, there were some ORM concepts that I had never been exposed to until I started using Django (it was my first framework featuring an ORM). Things like Generics confused me, although I knew how to do something similar in plain ol' SQL, it took me a bit to grasp the concepts. So I figure a good way to demonstrate their uses, along with demonstrating integrating django-tagging into an app would be a fine use of my precious blog space... Please keep in mind that I am not a Django expert, nor am I a django-tagging expert. My experience with django-tagging has been adding it to my blog posts. While I've considered making an entire category hierarchy-type site with tags, I haven't actually implemented it. All I can demonstrate on the basics. You'll have to learn the rest on your own. Also, it's important to point out that I have been using the svn version of django-tagging, although recently, a 0.2 version was released. I just set up my project's svn to use externals and keep me up to date on django-tagging. First thing's first, you need a model. I'm going to use a dumbed down version of the model I use for blog posts. Lay out your model like this: from django.db import models class BlogPost(models.Model): title = models.CharField(max_length=30) body = models.TextField() date_posted = models.DateField(auto_now_add=True) Now you have a pretty simple blog class. After a syncdb, you can fire up the admin app and start blogging! Er, kinda. You won't have any way for a user to see your posts, but you'll have posts in the database. However, you've got no tags! How would you implement tags into your new fangled blog? Easy. Download the tagging module and install it (I usually just copy the appropriate files to my $PYTHONPATH). Then it's actually quite simple, and you'll kick yourself for not figuring this out. Modify your blog model, and add this: from django.db import models from tagging.fields import TagField class BlogPost(models.Model): title = models.CharField(max_length=30) body = models.TextField() date_posted = models.DateField(auto_now_add=True) tags = TagField() However, you're going to want a method in your model that will allow you to iterate through the tags, called get_tags. I also have a set_tags method, and I know there was a reason I added that, I just can't remember what it was... (a good case for why you should always comment your code). So modify your model so that it now looks like this: from django.db import models from tagging.fields import TagField from tagging.models import Tag class BlogPost(models.Model): title = models.CharField(max_length=30) body = models.TextField() date_posted = models.DateField(auto_now_add=True) tags = TagField() def set_tags(self, tags): Tag.objects.update_tags(self, tags) def get_tags(self, tags): return Tag.objects.get_for_object(self) Now you've got a full blown model with tagging built in. Make sure you've got tagging installed in your INSTALLED_APPS, blow out your database, and syncdb again. Hooray! You'll notice on my blog that I have the tags shown at the top of each post, which is accomplished by with the following template code: {% for tag in blogpost.get_tags %} <a href="/blog/tag/{{tag}}" alt="{{tag}}" title="{{tag}}">{{tag}}</a> {%endfor%} I know there are template tags for many of the standard operations for django-tagging, but I haven't used any of them. I noticed that most of them are for tag clouds by model or object, and I would like a tag cloud period, with links to pages on the site with various items that are tagged with the given tag. I have just been far too lazy to actually implement it yet, but there is a weekend coming up... Edit: I've found some better ways to implement django-tagging, so I've made some changes to this tutorial [Less]
Posted over 17 years ago by Paul Hummer
All of this excitement about Django recently has been reminding me of all the projects I need to work on personally. In the last two weeks, I've probably written 10,000 lines of python, and very little to show for it (most of it was for scripts that ... [More] apparently no one needed after all...or don't need yet). After listing out all the projects I need to work on, I decided something needed to be done. Having worked with Scrum before in a professional capacity, and having liked it, I opted to implement "Personal Scrum : Scrum for Personal Projects" However, as I looked around for development tools for Scrum, I found a lack of tools in existence. If someone could prove me wrong, I would greatly appreciate it. When I used Scrum in a professional environment, we used Trac, and it had it's shortcomings. I was surprised to see that although many companies used Scrum in a normal development cycle, there weren't a lot of open source tools available for Scrum. So guess what? I'm writing one. In Django. Hooray. [Less]
Posted over 17 years ago by Joshua Scotton
Just committed a patch to the entertainer svn. patch18012008.diff