Ye Old Cue - Visualizando multiples posts

September 13, 2007 at 09:08 AM | categories: python, oldblog | View Comments

Posted here ---  El blog de Michael Sparks Ye Old Cue, propone una solución nueva al viejo probelma de la visualización de posts, usando una ventana de preview y los posts en algo muy parecido a post-its, valga la redundancia. Además el blog está abierto a que cualquiera, sin necesidad de registrase, deje un post
Read and Post Comments

Ruby Based Kamaelia Core (miniaxon.rb)

September 10, 2007 at 11:07 PM | categories: python, oldblog | View Comments

I finally got around to learning sufficient ruby to write a Mini Axon in Ruby - which means there is a basic Kamaelia core in Ruby available now. This means the following code is valid Ruby code and the components work in exactly the same way as Python based Kamaelia components:
class Producer < Component
   @@name = "Producer"
   def initialize(message)
      super
      @message = message
   end
   def main
      loop do
         yield 1
         send @message, "outbox"
         showboxes if $debug
      end
   end
end

class Consumer < Component
   @@name = "Consumer"
   def main
      count = 0
      loop do
         yield 1
         count = count +1
         if dataReady("inbox")
            data = recv("inbox")
            print data, " ", count, "\n"
         end
      end
   end
end

p = Producer.new("Hello World")
c = Consumer.new()
postie = Postman.new(p, "outbox", c, "inbox")

myscheduler = Scheduler.new()
myscheduler.activateMicroprocess(p)
myscheduler.activateMicroprocess(c)
myscheduler.activateMicroprocess(postie)

run(myscheduler)
(yes, I bought 2 ruby books at pycon uk, so shoot me :-) )

This compares fairly well with the equivalent python mini-axon code:
class Producer(component):
    def __init__(self, message):
        super(Producer, self).__init__()
        self.message = message
    def main(self):
        while 1:
            yield 1
            self.send(self.message, "outbox")

class Consumer(component):
    def main(self):
        count = 0
        while 1:
            yield 1
            count += 1 # This is to show our data is changing :-)
            if self.dataReady("inbox"):
                data = self.recv("inbox")
                print data, count

p = Producer("Hello World")
c = Consumer()
postie = postman(p, "outbox", c, "inbox")

myscheduler = scheduler()
myscheduler.activateMicroprocess(p)
myscheduler.activateMicroprocess(c)
myscheduler.activateMicroprocess(postie)

for _ in myscheduler.main():
    pass

The code for this miniaxon is here in subversion:
The first class in that file (Coroutine) and first utility function there come from this entry:
What's next for this? Don't know really. As a proof of concept, it's interesting - its *as* capable an equivalent python based mini-axon, and could in theory give ruby developers the same boost that we get in python.  I've no intention on doing a massive rewrite of existing python  kamaelia code into Ruby, but it does open up some interesting options.

Language agnosticism is something I've always wanted for Kamaelia and this, along with Michael Barker's  Java based experiments (and the fact that jython can run mini axon too), imply to me that the approach really can be language agnostic as was always intended :-)

Read and Post Comments

Erlang vs Stackless

August 02, 2007 at 12:16 AM | categories: python, oldblog | View Comments

Not sure how valid the following benchmark is, but it's an interesting datapoint.
Read and Post Comments

More People on Facebook than live in Iraq

July 31, 2007 at 11:08 AM | categories: python, oldblog | View Comments

Interesting factoid - there are over 30 million people on Facebook. That means if facebook was a nation, it would be the 39th (possibly 38th) largest country in the world according to the list of countries by population page of Wikipedia. This puts it in the spot above Iraq and below Uganda.
Read and Post Comments

Greylisting for non-techies

July 31, 2007 at 12:03 AM | categories: python, oldblog | View Comments

Greylisting is like magical glass for mystical flies. Real email is delivered by real flies, whereas spam email is delivered by fake mystical flies. The difference is that fake mystical flies don't bang their head against the glass repeatedly when they hit a window to try and get through, they just bounce of and don't try again. However real flies do bang their head against the window repeatedly until they get through.

Now greylisting is like magical glass that can recognise real flies from mystical flies because it can see that this sort of fly (since flies are all numbered as we all know) is willing to bang its head against the glass repeatedly. As a result the first time it sees a new sort of fly it tests the fly - does it bang its head repeatedly to get through or does it give up. If it gives up, it will never let that fly deliver its message. However if it proves its worth as a real fly and retries, then the magical glass will, from that day forward always allow that fly (they're all numbered remember) through to deliver the real email it carries.

Now obviously, the first time a new fly is seen this also means the magical glass has to check to see if the fly is a real fly or a mystical fly. This takes a little while, so the first time this happens this can cause the email the fly is delivering to be delayed, but does reduce the spam you recieve, so its not all bad :-)


Read and Post Comments

Design Thinking Links

July 20, 2007 at 10:38 AM | categories: python, oldblog | View Comments

A bunch of links nabbed from Michael Tiemann's OSI blog
I like this, because the second from last link focusses on design books. 3 of which I already own. Though it would be good to read the other 7 probably.

It also matches with the way I tend to manage development in Kamaelia's SVN - it's set up to encourage a high diversity of ideas, large amounts of checkins, and rigourously stable and clean code in releases. Design is crucial in making something new. Taking that design and moving it to engineering is just as vital however, and there are some very important steps to bear in mind how that happens. (not least that the skill set can be extremely different and many people need to learn at least one of those sets of skills)

Read and Post Comments

Python, Nokia Mobiles, Easy control from linux; Sync of profile/blog picture with facebook

July 19, 2007 at 01:41 AM | categories: python, oldblog | View Comments

Quick and simple access to the BT console (based on notes here)
# sdptool add-channel=27 SP
# rfcomm listen /dev/rfcomm0 27
Waiting for connection on channel 27
Connection from 00:11:22:33:44:55 to /dev/rfcomm0
Press CTRL-C for hangup
connect using btconsole.py on phone
on different console on linux
minicom -s -m (set device to /dev/rfcomm0 )
Also, facebook image syncing:
curl 2>/dev/null -O -A "Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.8.1) Gecko/2006102
3 SUSE/2.0-30 Firefox/2.0" http://www.facebook.com/p/Michael_Sparks/747770380
F=`grep profileimage 747770380|sed -e "s/^.*http:/http:/"|sed -e "s/\.jpg.*/\.jpg/"`
G=`grep profileimage 747770380|sed -e "s/^.*http:/http:/"|sed -e "s/\.jpg.*/\.jpg/"|sed
 "s#.*/##"`
curl 2>/dev/null -O $F
mv $G michael.jpg
cp michael.jpg /usr/local/httpd/sites/com.yeoldeclue/docs/michael.jpg

Read and Post Comments

Configuring Exim to block email to all except specified addresses

May 20, 2007 at 05:41 PM | categories: python, oldblog | View Comments

Ever needed to only allow emails from specific people through to specific addresses using exim? If you have then hopefully this post is of use to you. I'm writing it up here because it's proving useful to me right now.

Blocking email to all addresses except specific ones using exim is pretty easy. First of all create one file /etc/blocked_emails.list, and add to it a list of email addresses which are blocked:
foo@bar.com
bibble@bar.com
etc@bar.com
Next step is to create a list of addresses those emails can send to. Put these into a file called /etc/exceptions.list and list one local part per line - for example:
john
bob
rita

You then have two possible modes here. You can either defer accepting email so it takes a while to bounce, or have it deny delivery immediately. The former is in many cases actually preferable because someone will assume its been delivered and only find out its bounced, with a relatively innocuous error message some days later. Given you only tend to block people because they're being OTT, this gives them a chance to cool off and for any nasty messages to be lost, unread, in the ether.

To have the mail system defer delivery of email from any of the blocked_emails, to any address other than any of the emails in the exceptions, put the following in your exim ACL's rules for rcpt checking:

begin acl

acl_check_rcpt:

  accept local_parts   = /etc/exceptions.list
         senders = /etc/blocked_emails.list

  defer   message = Mailbox full, retry later
          senders = /etc/blocked_emails.list


The message is deliberately innocuous. However if the person (or persons) ramps up their antisocial behaviour and doesn't take the hint, you can change this to instantly deny access and send a message back immediately rather than 4-24 hours later by changing defer to deny:

begin acl

acl_check_rcpt:

  accept local_parts   = /etc/exceptions.list
         senders = /etc/blocked_emails.list

  deny   message = Your email has not been and will not be delivered - it has been blocked
          senders = /etc/blocked_emails.list
It's really sad when things come to this. There is an advantage to using config files like this however in that you only need to edit the contents then of blocked_emails and exceptions in order to re-allow emails through, or to block access completely to all emails.

In case anyone is wondering why I know these rules and why I'm writing it up - it's because I'm in the situation where I'm having to use this right now.

Read and Post Comments

Come to PyCon UK - September 8th&9th !

April 20, 2007 at 11:26 PM | categories: python, oldblog | View Comments

The PyCon UK Society has announced a UK Python Conference. This is an affordable community conference taking place on 8th/9th September. The conference is fantastic value, especially if you take advantage of the extra early bird booking offer. Both new and experienced Python programmers will benefit from the varied programme.

Why am I posting about this? I'd personally like to invite UK pythonistas to come, share their knowledge with others, learn new things and hang out. It's a community conference, which means it has the following characteristics:

  • You can help make it amazing, by participating & speaking, by helping, by attending!
  • It is cheap
  • It will be fun, and accessible. We (I'm helping organise this :) ) really want the conference to be accessible to all, from those who have no idea of what python is, let alone coded in it, through to those who are working on their upteenth bytecode hack/compiler.
Seriously though aside from this, I'm really posting about this because despite being a language pragmatist - ie I'll use any language that gets the job done - I'm largely finding that I'll use python for almost everything these days. Community conferences are a real opportunity to dive in and help and learn and share. Like python itself, the conference is also platform agnostic, so you're welcome if you use Windows, Mac OS X, Solaris, FreeBSD, or even the same OS as me - Linux :) .
Read and Post Comments

One Laptop Per Child Project Looking For Pygame Devs

April 07, 2007 at 09:48 AM | categories: python, oldblog | View Comments

From the pygame mailing list:
From: Noah Kantrowitz [ check pygame archives for email (don't want to cause spammage) ]
Subject: [pygame] Calling all game developers

Calling all game developers! The One Laptop Per Child project needs
talented game developers to work on software for the XO laptops. Thanks
to a few awesome developers, PyGame is now up and running under Sugar
(the OLPC graphical environment) and should be included in the build
system shortly. What we need now is games geared towards children in
developing areas. Information about PyGame on the XO can be found at
http://mailman.laptop.org/pipermail/games/2007-April/000036.html. I
would ask anyone interested in either building new games or porting
existing ones to join the OLPC games list
(http://mailman.laptop.org/mailman/listinfo/games) and discuss your
ideas there. This is a chance to have a major impact on the lives of
millions of children, as well as work on a unique platform. If you have
any questions please don't hesitate to email me, or ask on the games list.

--Noah Kantrowitz
OLPC Evangelist

If you know and enjoy pygame and are looking for something good and fun, it'd be well worth getting in touch.
Read and Post Comments

« Previous Page -- Next Page »