Archive for September, 2007

A confession from the boss

Andy Parkhouse - September 28th, 2007

We have a system where jobs have a status (active, inactive etc), which is stored in a field. There is also a list for each status containing the IDs of all the jobs matching that status.

When the status of a job is changed, a form-handling script updates the status of that job, and modifies the status lists. IF Andy writes code that does approximately the following things in roughly the following order:

* first check the status field of every job and update the status lists accordingly
* then write the new status of this job into the status field

which ahem, kind of doesn’t work. Forget ‘kind of’, it’s just flawed code and flawed thinking that causes other people problems in getting their work done, their timesheets entered, their tea made.

SO now the form handler does this instead:

* first write the status of this job into the status field
* then check the status field of every job and update the status lists accordingly

This is an example where, by trying to write a script that would be more robust (check all kubes and update everything JUST IN CASE), we end up with more errrrors than if I’d just followed the apparently sketchier route of appending the job to one status list and removing it from another. Hey ho.

Miami, er, Bristol Vice

Matt Wilkes - September 28th, 2007

We’ve been working on the new Vice syndication project, integrating it into our new Viral Content Manager system. Although the system is still pre-alpha it is very impressive! The basic structure of our content types is:

ContentItems are contained in a folderish portal tool, and contain a reference to 0..* ContentChannels which can be anywhere.

We now have working RSS and ATOM feeds for the ContentItems associated with a given ContentChannel, looking like this:

from zope.interface import implements
from zope.component import adapts, queryMultiAdapter, getMultiAdapter
from zope.interface import Interface
from Products.VCNArchetypes.interfaces import IChannel, IViral
from plone.syndication.outbound.interfaces import IFeed, IFeedItem
import logging

from plone.app.syndication.outbound.adapters.atct import ATFeedBase, ATFeedItemBase

class ContentFeed(ATFeedBase):
"""Adapter from IChannel to IFeed.
>>> from zope.interface.verify import verifyClass
>>> verifyClass(IFeed, ContentFeed)
True
"""

implements(IFeed)
adapts(IChannel, str)

def __iter__(self):
items = self.context.getContentItems()
while 1:
yield queryMultiAdapter((items.next(), self), IFeedItem)

class ViralFeedItem(ATFeedItemBase):
"""Adapter from IViral to IFeedItem.
Make sure that ViralFeedItem implements the IFeedItem
interface
>>> from zope.interface.verify import verifyClass
>>> verifyClass(IFeedItem, ViralFeedItem)
True
"""
implements(IFeedItem)
adapts(IViral, IFeed)

@property
def url(self):
return self.context.getViral_url()

@property
def body(self):
return self.context.getViral_description()

and called in with:

<configure>
xmlns="http://namespaces.zope.org/zope"
xmlns:zcml="http://namespaces.zope.org/zcml"
xmlns:five="http://namespaces.zope.org/five"></configure>

<class class="Products.VCNArchetypes.ContentChannel.ContentChannel">
<implements interface="plone.syndication.outbound.interfaces.IFeedable"></implements>
</class>

<!-- Adapt IChannel to IFeed -->
<adapter>
</adapter>    factory=".contentfeed.ContentFeed"
trusted="true" />
<class class=".contentfeed.ContentFeed">
<require>
permission="plone.syndication.ViewFeeds"
interface="plone.syndication.outbound.interfaces.IFeed" />
</require></class>

<!-- Adapt IViral to IFeedItem -->
<adapter>
</adapter>    factory=".contentfeed.ViralFeedItem"
trusted="true" />
<class class=".contentfeed.ViralFeedItem">
<require>
permission="plone.syndication.ViewFeeds"
interface="plone.syndication.outbound.interfaces.IFeedItem" />
</require></class>

One of the sprint tasks is creating an easy to follow, doctested, readme. Until that comes out hopefully this will help people use this brilliant addition to Plone!

Thanks derek_richardson, pbugni and everyone else who’s contributed!

Rubber Jelly Mice (wobble wobble)

Alaric King - September 28th, 2007

jelly mice1 Rubber Jelly Mice (wobble wobble)

Whilst opening a new mouse, i was delighted to find it came with a free Jelly mould. After following the instructions on the back of the mouse packet, i was informed this “wireless jelly mouse has extra sensitive tracking, egonomic personal soft moulding technology and gives the user instant office cred.”

So far, the Rubber Jelly Mouse has been refrained from actual use and has been on an office tour. Posing as a modern art installation, it has visited Developer Island, The Kirk Hullis Sales Room and Project Manager Island.

From Monday the 1st of October, the mouse will be put into its industrial placement – gliding across the desk of its Father (me).

Hepatitis Awareness film

Matt Golding - September 26th, 2007

For World Hepatitis Awareness Day, have a look at this brilliant little cartoon about Dennis and his efforts to catch Hepatitis C.

Shipped by: Rubberductions

Rubberductions Site

Alex Pitkin - September 26th, 2007

For the last few months, we’ve had a self-indulgent blog brewing, involving phrases like ‘judicious use of green’, ‘new and super-fast’, ‘all about our work, of which we’re very proud’ and other such friendly-but-still-professional-and- hip-but-not-offensively-cool snippets.

To legitimise this outpouring, we decided to build ourselves a new rubberductions website, features include:

  • judicious use of green
  • new, super-fastness
  • increased focus on our work, of which we’re very proud

Hope you like it. icon wink Rubberductions Site

Shipped by: Team Rubber

Optimisation, from the Viral contentnetwork blog

Tim Wintle - September 21st, 2007

Hi all, with the new developer blog up I decided to make sure any python coders had seen my post from the Viral Content Network Developer Blog on Optimisation in python, you probably know it already, but if you can think of any other advice, drop them in the comments.
Tim

Bristol Open Coffee was buzzy

Alaric King - September 7th, 2007

Team Rubber were out and about at Bristol Open Coffee last night. Conversations included:

  • OK Cool’s neat Facebook Music Wall app. Made me think about how we (Team Rubber) don’t build quick businesses to flip on a wave. We’re focussed on long-term value, but it’s great to see other people working hard to catch a trend, it’s an intelligent way to do business
  • UWE’s upcoming web design day (student-organised – good effort guys)
  • Python and other programming animals. Curly braces – are they needed if you’re indenting code anyway?
  • The Bristol Project: how do we build at least one web startup to a significant exit within 3 years?
  • Online social networks: have we evolved the manners and etiquette to suit?
  • Mobile apps & services
  • Heidigger, phenomenonology, and the relation between action and language for AI
  • Horse-riding makes you hurt in previously unknown muscle groups
  • Web 1 (big) business cards (like mine) versus web 2 (moo) business cards (like everyone else – except Dan Dixon whose biz cards are sized to be monstrous and amusing)
  • Barcamp upcoming in Bristol

Next open coffee will be in about a month – listing will be on Simon’s site.