Audacious CSS Desktop Programming

Posted in Art and Creation, Free and Open Source Software, Multimedia Entry, Programming and Technical, Ubuntu, Video Entry on April 8th, 2012 by doctormo

Take a look at this video, here I show an awesome new technology for using Clutter/Gtk with Cascading Style Sheets.


Audacious Video

You can test this out for yourself with Ubuntu 12.04 (Beta) using the following:

sudo apt-get install gir1.2-gtk-3.0 gir1.2-clutter-1.0 gir1.2-gtkclutter-1.0 gir1.2-gconf-2.0
bzr branch lp:csslavie
cd csslavie
./netbook-launcher.py

Note: default clutter/cogl has a bug which prevents the background’s opacity setting, so you won’t get as cool an effect. But a fixed version of those libraries should be available eventually.

Please comment below what you think.

Tags: , , , , , , , , ,

Introspection Introspection

Posted in Programming and Technical, Ubuntu on March 6th, 2012 by doctormo

I’ve written a script which I can use to get information about gobject introspection modules for use in python. It’s written in python and allows you to look at actual function names, actual object names and what really is going on.

http://paste.ubuntu.com/872138/

This is mainly a problem because the documentation for Gtk with gi.repository is so poor and not clearly described that it makes it impossible to use without great force of will.

Hopefully this script can make the job easier for others, feel free to adapt it and post your remixes.

Tags: , , , , ,

Ubuntu TV a Case Study

Posted in Free and Open Source Software, Multimedia Entry, Programming and Technical, Ubuntu, Video Entry on January 15th, 2012 by doctormo

Hello Community, I’ve put together a video to show my existing Ubuntu TV; the one I’ve been using with XBMC for the past year or more.


See Video Here

If you’re using a similar setup, I’d love to know how you manage your content library and do remote access. If you’re interested in my fall-over easy python modules for accessing the XBMC library database you can find the code on launchpad and the librarian code too.

Tags: , ,

Sculpt vs Mold Programming

Posted in Hat Talk, Programming and Technical, Ubuntu on January 2nd, 2012 by doctormo

I really like the idea of test suites, they give me a positive feeling that the code I’m making is probably going to do what it’s supposed to do. Not only that, but I feel far more confident about hacking the code to pieces in a random fit of creative genius if I know I can run a set of unit tests at the end and make sure all my designed APIs still work from the outside.

But why should I feel so good about tests? Isn’t writing the tests just like writing the code? except for the second time?

Well the logic of tests may mean that you have to do all the same kinds of logic, but it’s not really the same logic. You’re telling the computer what you expect to happen, not what happens. Take the analogy given in the title: If you were to carve/sculpt a masterpiece, you could be expected to gain some great notoriety for being a genius artist; alas much like code without tests it’s a one shot deal. As soon as you try and change the work, change it’s material and reproduce it for more customers you suddenly find yourself with lots of work making, remaking, fixing and refixing.

Any hired programmer will recognize the situation. Conversely software with complete testing (of all three kinds) will be much more like a mold, given any language with enough consistent code you could fill the mold many times to arrive at the same quality as before. The tests aren’t the same as the original sculpting, they’re much more like the framework that shows how to reproduce the work with ever tighter testing resulting in ever more accurate reproduction.

This assumes of course you imagine programming cycles as if they were mass production units.

Enough waffle! what do you think?

New Release: Lab Session Manager

Posted in Free and Open Source Software, Programming and Technical, Ubuntu on September 2nd, 2011 by doctormo

Over on launchpad, I’ve released version 1.4 of the lab-session-manager, included in this release is:

  • Bug fixes for administrators and other infinate time periods
  • Uses gnome’s SessionManager API to logout instead of SIGKILL
  • Pauses a logout until logging of logout event has completed
  • Correctly logs methods of logging out (session timeout, logoff button, off switch)

You can get your hands on the PPA and give it try here: DoctorMo’s Greeter PPA, Let me know what you think below in the comments.

Tags: , , , , , , , , , ,

XBMC Librarian (New Addon)

Posted in Free and Open Source Software, Programming and Technical, Ubuntu on August 31st, 2011 by doctormo

Hello Community,

I’ve finished writing a new addon for xbmc (the tv media center for Ubuntu) called Librarian. She will take a look at your impressive video library and check for various inconsistencies and potential problems which you might want to look into. This 1.0 release includes the following features:

  • List Movie Files not Included in the Database
  • List Movies which have incorrect length, i.e. misidentified or corrupt (requires ffmpeg installed)
  • Lists TV Shop Episodes separately with both above features
  • Tells you which seasons and which episodes of each show you’re missing
  • Shows you which TV Show Paths are being ignored completely.

More checking can be added as good ideas come in, I’ve also written an addon module called xbmcdata which wraps sqlite3 the xbmc httpapi to give a consistant inside xbmc and outside testing/scripting interface. This makes addon development _much_ easier. For instance listing movies is now just a case of:

from xbmcdata import Movies

for movie in Movies():
    print "%s (%s)" % (unicode(movie), movie['Year'])

Please download the code here: http://divajutta.com/doctormo/doctormo-xbmc-addons.tar.gz and install in ~/.xbmc/addons/ then test, entry is available under ‘Programs’. Please report issues back to me with full logs from ~/.xbmc/temp/xbmc.log included.

Have fun.

Tags: , , , , , , , ,

Python List Inheritance Post Creation Pattern

Posted in Programming and Technical, Ubuntu on July 31st, 2011 by doctormo

One of the fun things to do with python is to use the language to bend the rules of programming. One neat way of using your resources wisely with objects is to create objects in the right places, but not generate or call costly data gathering operations until you absolutely need to.

So called ‘late data initialisation’ is useful in certain kinds of programs. I document here the best pattern I’ve found to turn a python list into a late data class:

class newList(list):
    @property
    def data(self):
        if self.populate:
            self.populate()
        return self

    def populate(self):
        print "Generating Now"
        for x in range(42):
            self.append( x )
        self.populate = None

    def __getitem__(self, key):
        return super(newList, self.data).__getitem__(key)

    def __len__(self):
        return super(newList, self.data).__len__()

    def __iter__(self):
        return super(newList, self.data).__iter__()

Basically populate can be any piece of code which calls what ever it needs in order to gather the data. It’ll only be called once and to prevent having to use an __init__ variable we just clobber the method attribute. Sneaky!

When the list is used for an iteration (for loop), or if you delve into it directly for a specific item, or need to know it’s length, then we can get the data behind our object and have it contained within the list object we’re inheriting. No need for secondary list object variables dangling off of self. Ugly! Although this pattern does require that every use you want to put the object to (i.e. string, representation, slicing, dicing, mincing or conditionalising) you’ll have to make a new super method to wrap around to make sure that the data is generated if that’s the first way the list will be used.

What are your thoughts about this pattern? Do you know how to fix the init issue with a better pattern?

Tags: , ,

Lab Session Manager, New Release 1.2

Posted in Free and Open Source Software, Programming and Technical, Ubuntu on July 21st, 2011 by doctormo

I’m pleased to release a new version of the lab session manager.

The Lab Session Manager is a indicator which times how long you can be on the computer for, notifies you when you’re running out of time and then logs you off when your time is over. It replaces the old and unmaintained timed functionality with a modern, gtk based system tray icon and logging functionality for generating reports about who is using the computer for how long. See previous blog post here.

This version includes a successful upgrade of the code to python modualisation which will help future bug fixing. plus a big upgrade to the logging functionality to allow logs to be read back and sorted and reported on. New reporting mechanisms are in the works for the next version too.

You can find this release’s ppa here or the source packages in the above link. Please give the PPA time to build everything.

The next release should also include more fixes and some custom icons, so we can guarentee the style and design of the dialogs no matter what theme you’re using.

If you find any bugs, please report them in launchpad here.

Tags: , , , ,

Letter to: Creative Industry

Posted in Free and Open Source Software, Programming and Technical, Ubuntu on July 19th, 2011 by doctormo

This is the letter I sent to the petition organiser to try and get apple’s final cut reinstated.

Dear Andrew Landini,

I read with great interest the petition of a great many creative people who have built their work around the Final Cut product line. Of course, I feel your pain and wish to offer my sympathies.

But I also wish to share with you what I have learned about software and the importance of ownership and control. It is true that there are a great number of good, solid software packages being made by companies like Adobe and Apple which artists and businesses regularly use to get their work done in the best way possible.

The problem with these packages is that they take away effective ownership and with that any sense of control over the direction of the development of the tools in use. These programs are known as proprietary software[1], because they use trade secretes to hide their source code, strong copyright to sell products in a box and even go so far as to implement anti-features[2] to ensure stratification of their market money earning potential.

This isn’t necessarily at issue, but it does put users (and more importantly businesses) at a huge disadvantage. Instead of investing into an ecosystem that requires it take control away from your business, I would like to propose supporting Free and Open Source[3] business models for the furthering of creative tools.

This new way of creating software doesn’t require programmers keep secretes from their users. Development is done in the open, multiple different parties generally pay into development of the same features and we end up with free software that every participant gets full rights to use, modify, and basically do with as they wish for their own business needs.

Tools such as Gimp, Inkscape and Blender are not always first with features or even the best technical tool at the moment. But what they offer is something far more important, they give every user Freedom, Ownership and Control to take the software and fully define how they want to see the software developed further. They require no loyalty to any one set of developers, there is no one company you must go to for support. Despite marginal investment from the creative industry, these tools are already quite powerful.

With most artists and creative businesses understanding and supporting Free and Open Source as a good business strategy, I think we can prevent, in the future, ever having to write an petition begging a mischievous company from putting small creative businesses out of work because they decided to develop for the lowest common denominator.

Best Regards, Martin Owens (Artist, Programmer, Teacher)

[1] http://en.wikipedia.org/wiki/Proprietary_software
[2] http://wiki.mako.cc/Antifeatures
[3] http://en.wikipedia.org/wiki/Free_software

Tags: , , , , ,

Packaging: Need Help!

Posted in Free and Open Source Software, Programming and Technical, Ubuntu on July 11th, 2011 by doctormo

I haven’t had much time to blog about interesting things, sorry guys. But I did want to take an opportunity to share a problem I’m having.

I make software, and I make it for people. I’ve driven by people’s needs. So I tend to make lots of smaller things to fix certain problems or do something interesting on a small scale. The difficulty I’m having is with packaging and getting packages into Debian and thus into Ubuntu. I make lots of PPAs and they seem to work for users who are interested in getting what I do directly from me. But…

I feel that as the developer, designer, QA and possibly only user; that to do all the work on the packaging and being the sponsor in the upload process would deny my projects much needed oversight, not to mention being tiresome.

If you check out my launchpad list of code branches, I have A LOT of really awesome code which isn’t in the Ubuntu archive. I have a lot of interesting and useful tools which should be available to all kinds of people and just aren’t. The reason why all these code branches have failed to move anywhere is because I’m not good at asking for help on packaging and when I do I ask the wrong people. Despite on a number of projects being asked by users to get packages into Ubuntu, the answer is simply: I can’t do it myself and I need help.

If you know how to get code into Ubuntu _without_ having to be the packager and Debian maintainer: let me know you thoughts, as always below.

Tags: , , , , ,