<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7438332029522992800</id><updated>2011-04-21T20:00:11.757-07:00</updated><category term='techbase'/><category term='mail'/><category term='vim snipper snippets snippet template templates scribes textmate'/><category term='first blog linux ubuntu python kde'/><category term='vim colorsheme'/><category term='plasma'/><category term='vim howto tips tutorial'/><category term='python vim scripts py vi tutorial tutorials howto'/><category term='gmail'/><category term='kde4'/><title type='text'>thomas blog</title><subtitle type='html'>A blog about all the things I want to write about, mostly things I have interest in, like: python, vim, linux, kubuntu, kde,...</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://tmske.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7438332029522992800/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://tmske.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>thomas</name><uri>http://www.blogger.com/profile/13728973542307461536</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>13</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7438332029522992800.post-2092902095835610135</id><published>2009-01-10T05:17:00.000-08:00</published><updated>2009-01-10T05:49:09.029-08:00</updated><title type='text'></title><content type='html'>Some days ago I discovered &lt;a href="http://labs.mozilla.com/2008/08/introducing-ubiquity/"&gt;ubiquity&lt;/a&gt; and I like it very much.&lt;br /&gt;Because I use google define a lot, I wrote a very simple script for it.&lt;br /&gt;You can find my script here: &lt;a href="http://gist.github.com/45454"&gt;http://gist.github.com/45454&lt;/a&gt; (I just changed the default google search script)&lt;br /&gt;&lt;br /&gt;To use it, install the script, launch ubiquity and then just type &lt;span style="font-family: courier new;"&gt;gdefine [word]&lt;/span&gt;, or type gdefine with a selected word and press enter.  It's that simple :-)&lt;br /&gt;&lt;br /&gt;I use this script all the time, so I hope it's useful for some of you! (there is already a define script but that uses &lt;a href="http://www.answers.com"&gt;http://www.answers.com&lt;/a&gt; but I don't like it as much as google define)&lt;br /&gt;&lt;br /&gt;Other commands that I recommend: switching tabs (just type the name of the tab), tagging sites (&lt;span style="font-family: courier new;"&gt;tag [tag1 tag2 ...]&lt;/span&gt;), &lt;a href="http://www.rememberthemilk.com"&gt;remember the milk&lt;/a&gt; commands (you can find it &lt;a href="http://garyhodgson.github.com/ubiquity-rtm-api/"&gt;here&lt;/a&gt;), &lt;a href="http://www.twitter.com"&gt;twitter&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7438332029522992800-2092902095835610135?l=tmske.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tmske.blogspot.com/feeds/2092902095835610135/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7438332029522992800&amp;postID=2092902095835610135' title='13 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7438332029522992800/posts/default/2092902095835610135'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7438332029522992800/posts/default/2092902095835610135'/><link rel='alternate' type='text/html' href='http://tmske.blogspot.com/2009/01/some-days-ago-i-discovered-ubiquity-and.html' title=''/><author><name>thomas</name><uri>http://www.blogger.com/profile/13728973542307461536</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>13</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7438332029522992800.post-4858566019215981083</id><published>2008-12-03T06:13:00.000-08:00</published><updated>2008-12-03T06:30:54.894-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='gmail'/><category scheme='http://www.blogger.com/atom/ns#' term='mail'/><title type='text'>How I organize my gmail</title><content type='html'>Since I first started using gmail, I started using labels for everything.  Every time I start a new project or subscribe to some mailing list I created a new label (mostly with a corresponding filter) without thinking too much about how I ordered them.  At first this was no real problem, but after a while I had too much unordered labels.  You can Imagine the clutter.  The moment gmail introduced labs and with it, the quick links feature, I rejoiced.  I started saving links for all my most used labels.&lt;br /&gt;But this was definitely no solution for the problem. So I recently decided it was time to think about a real solution.&lt;br /&gt;I started reading blogs about how other people organize their mail.  Soon I came to the conclusion that all those solutions are good in a certain way, but they didn't suffice for me.&lt;br /&gt;So In this post I'll explain what I do want, how my labels look now and what gmail still lacks.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;     What do I want?   &lt;/h2&gt; I want to organize my mail so that I don't need to spend much time organizing it (apart from spending quite a lot of time with this now).  This means that I have to be able to quickly process and search mail.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;The most important things are these:&lt;/u&gt;&lt;br /&gt;&lt;div&gt; &lt;ul&gt;&lt;li&gt; I need to be able to access my most accessed labels fastest.     &lt;/li&gt;&lt;/ul&gt;  &lt;div style="margin-left: 40px;"&gt; Quick search is a bit of a solution for this, but only a partial solution, it can still take some time to give a label to a mail if you have to search the label way down on the list.  So my labels need a good and logical order.&lt;br /&gt;&lt;/div&gt; &lt;ul&gt;&lt;li&gt;   I don't want an inbox full of mails.&lt;/li&gt;&lt;/ul&gt; &lt;div style="margin-left: 40px;"&gt;   This means that I need to be able to label mail or to archive it the moment I read it.&lt;br /&gt;&lt;/div&gt; &lt;ul&gt;&lt;li&gt;   Things I don't need may not clutter my mail.&lt;/li&gt;&lt;/ul&gt; &lt;div style="margin-left: 40px;"&gt;   Archive/delete those messages at once.  (I almost never delete mail)&lt;br /&gt;&lt;/div&gt; &lt;ul&gt;&lt;li&gt;   I don't want to spend my time on mail I don't need.&lt;/li&gt;&lt;/ul&gt; &lt;div style="margin-left: 40px;"&gt; There are three things you can do here:  If this is a message from something you can unsubscribe easily, do that, if not mark it is as spam and if that doesn't work, create a filter to mark the message as read and archive it.&lt;br /&gt;&lt;/div&gt; &lt;ul&gt;&lt;li&gt;   Be able to decide whether a message is important to read now or if it can wait.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;/div&gt; &lt;h2&gt;    Organizing my labels  &lt;/h2&gt; &lt;div&gt;    &lt;div&gt;      &lt;div&gt;       &lt;u&gt;I use a prefix to create a first ordering.&lt;/u&gt;               &lt;div&gt;         Things I am working on now, and thus have to access often have a _ as prefix so it's on top of the list:       &lt;/div&gt;        &lt;div&gt;         _/study/project       &lt;/div&gt;        &lt;div&gt;         If I'm finished with the project or task, I label them with a P (for processed and it doesn't clutter my first labels):       &lt;/div&gt;        &lt;div&gt;         P/study/project.&lt;br /&gt;When you rename this task, you can also add a timestamp for projects that return every year or every month, or you can sort the label more fine grained.&lt;br /&gt;   &lt;/div&gt;        &lt;div&gt;         Things I always need like personal or important mails, those I label with an A (for always and just below the _)       &lt;/div&gt;        &lt;div&gt;         A/important&lt;br /&gt;     A/notes&lt;br /&gt;If you have many labels that are only for personal use, you could create a secondary ordering for example A/me/important.&lt;br /&gt;   &lt;/div&gt;        &lt;div&gt;                 &lt;/div&gt;        &lt;div&gt;&lt;u&gt;         Other labels I use       &lt;/u&gt;&lt;/div&gt;        &lt;div&gt;         things I almost never need: Z (way down)&lt;br /&gt;If you create a label Z/unimportant you should delete that label and archive those mails as they are unimportant anyway!  I use the Z label for backups of old mail, or for my starred messages as sometimes desktop mail clients delete all the stars.&lt;br /&gt;The important remark here is that you should only label those messages with a Z that you want to find later, mail that you'll never need again needs to be archived.&lt;br /&gt; &lt;br /&gt;   &lt;/div&gt;        &lt;div&gt;         mailing lists: L&lt;br /&gt;You should make a filter for mailing lists.  If you make the filter so that you never look at the mail anymore, you should unsubscribe from the list &lt;/div&gt;        &lt;div&gt;                 &lt;/div&gt;        &lt;div&gt;         You can use as many prefix as you want but a rule that I like is to keep most used labels on top with _ and A!       &lt;/div&gt;        &lt;div&gt;         Things you can filter and don't need to access often doesn't matter much, make sure they don't get on top though.&lt;br /&gt; &lt;br /&gt;&lt;u&gt;         Things that don't need a label&lt;/u&gt;&lt;br /&gt;- all mail coming from one person, you can perfectly fine search for all that mail (from:person) and if typing that is too much, you can still create a quick link.&lt;br /&gt;     - unimportant mail.&lt;br /&gt; &lt;br /&gt;      &lt;h2&gt;           What with new mail?         &lt;/h2&gt;       &lt;/div&gt; I try to process all incoming mail at the moment I read it.  If you do have to defer it, for example when you have too much mail and don't have the time to read them all now, make a label for mail that you should access later, something like __/reply or __/waiting.  I personally don't have those labels.  If I label them like that, I just forget about that mail most of the time. &lt;/div&gt;      &lt;div&gt;        &lt;p&gt; I think it's more useful to distinguish between important unread mails and other unread mails.  That's why I have always two quick links: "important unread" and "unread".  When I don't have much time I only read the important unread messages, and I can always come back to the other unread messages. &lt;/p&gt;        &lt;p&gt; If there are then still mails that cannot be processed right away, I keep those mails in my inbox, so that they are always there when I open my mail.  But that are the only mails in my inbox.&lt;br /&gt;   &lt;/p&gt;        &lt;p&gt;         If you have mail that you don't need it anymore, archive it.&lt;br /&gt;   &lt;/p&gt;        &lt;p&gt;     &lt;br /&gt;   &lt;/p&gt;        &lt;h2&gt;         Some tips       &lt;/h2&gt;        &lt;ul&gt;&lt;li&gt; For abbreviations I use all caps, other words with all small letters.  (it doesn't matter what you use, but be sure to use it everywhere to keep things clean). &lt;/li&gt;&lt;li&gt;           I use simple and short names for labels.         &lt;/li&gt;&lt;li&gt;           I write drafts of notes/text to myself and mail them to &lt;a href="mailto:myemail+note@gmail.com"&gt;myemail+note@gmail.com&lt;/a&gt;.  You can use the +note to create a filter and label those mails like this: A/notes.  If I want to write nicely formatted text, I use google docs, and reply it to my note (the google docs gadget in labs makes drag and drop possible)&lt;br /&gt;     &lt;/li&gt;&lt;li&gt; I also have a filter for unwanted mail to mark the as read and archive/delete them, I use 1 filter for that, so I don't clutter my filters to much (this has the disadvantage that this filter becomes harder to edit if it becomes bigger). &lt;/li&gt;&lt;li&gt; I don't keep a todo list in gmail because I forget to do those items, I use remember the milk for my todo list which you can integrate in gmail. &lt;/li&gt;&lt;/ul&gt;   &lt;br /&gt;    &lt;h2&gt;         What gmail still lacks       &lt;/h2&gt;        &lt;h2&gt;                &lt;/h2&gt; Not much! that's for sure, it's becoming more and more feature complete with support for gadgets like google docs, calendar and remember the milk, quick links.&lt;br /&gt;   But 2 more things would be great:&lt;br /&gt;- Search labels with wild cards, so you can do something like this: search for "l:L-*" to search for all emails from mailing lists.&lt;br /&gt;- Support for folders in the labels (there are plugins for this though, but official support would be great as the plugins don't always seem to work)&lt;br /&gt;There is one more thing, but I don't think this is really a gmail thing.  It would be great if desktop mail clients would now when an email has a double label.  Not having to mark those messages as read twice would be great.&lt;br /&gt;&lt;br /&gt;    &lt;h2&gt;         Conclusion       &lt;/h2&gt; I've been using this scheme now for some days and I haven't yet found any issues with it.  One small thing is that you manually have to change the prefix _ to P for projects that are finished.&lt;br /&gt;   This sort of scheme will probably not work for everybody but for me it's great so far!&lt;br /&gt;&lt;br /&gt;   Now it's time to sort my google reader subscriptions.&lt;br /&gt;&lt;br /&gt; &lt;/div&gt;   &lt;/div&gt; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7438332029522992800-4858566019215981083?l=tmske.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tmske.blogspot.com/feeds/4858566019215981083/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7438332029522992800&amp;postID=4858566019215981083' title='0 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7438332029522992800/posts/default/4858566019215981083'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7438332029522992800/posts/default/4858566019215981083'/><link rel='alternate' type='text/html' href='http://tmske.blogspot.com/2008/12/how-i-organize-my-gmail-since-i-first.html' title='How I organize my gmail'/><author><name>thomas</name><uri>http://www.blogger.com/profile/13728973542307461536</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7438332029522992800.post-5100491120223167295</id><published>2008-02-06T13:44:00.000-08:00</published><updated>2008-02-06T13:51:46.911-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='techbase'/><category scheme='http://www.blogger.com/atom/ns#' term='kde4'/><category scheme='http://www.blogger.com/atom/ns#' term='plasma'/><title type='text'>My kde svn account</title><content type='html'>I applied today for an svn account and already have it :) so I just commited my first patch.  It's a simple patch to the Picture Frame applet and also some refactorings.  I'll sure be commiting more patches to plasma and kde.&lt;br /&gt;&lt;br /&gt;I also made a techbase page with all the current known plasmoids. (I still need to add those from playground) you can see the page here: &lt;a href="http://techbase.kde.org/index.php?title=Projects/Plasma/Plasmoids"&gt;http://techbase.kde.org/index.php?title=Projects/Plasma/Plasmoids&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7438332029522992800-5100491120223167295?l=tmske.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tmske.blogspot.com/feeds/5100491120223167295/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7438332029522992800&amp;postID=5100491120223167295' title='1 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7438332029522992800/posts/default/5100491120223167295'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7438332029522992800/posts/default/5100491120223167295'/><link rel='alternate' type='text/html' href='http://tmske.blogspot.com/2008/02/my-kde-svn-account.html' title='My kde svn account'/><author><name>thomas</name><uri>http://www.blogger.com/profile/13728973542307461536</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7438332029522992800.post-4720993307233600680</id><published>2008-01-18T02:27:00.000-08:00</published><updated>2008-01-18T02:44:00.242-08:00</updated><title type='text'></title><content type='html'>I wanted an easy way of following some matches on the australian open.&amp;nbsp; But since I couldn't get the IBM scoreboard working under linux&lt;sup&gt;1&lt;/sup&gt; I wanted to try write something myself.&lt;br&gt;&lt;br&gt;So I've come up with something really simple.&lt;br&gt;&lt;br&gt;I've just made a python script and with urllib2 I pull the results and format them simply.&lt;br&gt;&lt;br&gt;&lt;b&gt;Here is the script.&lt;/b&gt;&lt;br&gt;&lt;br /&gt;&lt;pre style="border: 1px dashed rgb(153, 153, 153); padding: 5px; overflow: auto; font-family: Andale Mono,Lucida Console,Monaco,fixed,monospace; color: rgb(0, 0, 0); background-color: rgb(238, 238, 238); font-size: 12px; line-height: 14px; width: 100%;"&gt;&lt;code&gt;#!/usr/bin/python&lt;br&gt;&lt;br&gt;&lt;br&gt;#The players you want to follow.&lt;br&gt;players =["Roger Federer", "Justine Henin", "Andy Roddick", "Rafael Nadal", "Maria Sharapova", "Lleyton Hewitt", "David Nalbandian", "Amelie Mauresmo"]&lt;br&gt;#The maximum width of the display (maximum chars)&lt;br&gt;max_width= 14&lt;br&gt;&lt;br&gt;#Only change below this if you know what you're doing.&lt;br&gt;import urllib2&lt;br&gt;import urllib&lt;br&gt;&lt;br&gt;&lt;br&gt;url = 'http://www.australianopen.com/en_AU/scores/index2.html'&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;def find_player_in_data(player, data):&lt;br&gt;    startString = '&amp;lt;table width="440" height="100" border="0" cellspacing="0" cellpadding="0" background="/images/scores/ao_sc_0000g5.gif"'&lt;br&gt;    endString = '&amp;lt;sup&amp;gt;&amp;lt;/sup&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td width="5"&amp;gt;&amp;lt;spacer type="block" height="1" width="1"&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td colspan="16" height="4"&amp;gt;'&lt;br&gt;    index = data.find(player)&lt;br&gt;    if index != -1:&lt;br&gt;        index = data.find(startString, index-200)&lt;br&gt;        endIndex = data.find(endString, index)&lt;br&gt;        return data[index: endIndex+len(endString)]&lt;br&gt;    else:&lt;br&gt;        return ""&lt;br&gt;&lt;br&gt;def find_numbers(data):&lt;br&gt;    lineBegin = '&amp;lt;td width="1"&amp;gt;&amp;lt;spacer type="block" height="1" width="1"&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;td width="19" valign="middle"&amp;gt;'&lt;br&gt;    lineEnd = '&amp;lt;/sup&amp;gt;&amp;lt;/td&amp;gt;'&lt;br&gt;    &lt;br&gt;    first = 0&lt;br&gt;    numbers = []&lt;br&gt;    last = 0&lt;br&gt;    while (first != (-1+len(lineBegin))):&lt;br&gt;        first = data.find(lineBegin)+len(lineBegin)&lt;br&gt;        last = data.find(lineEnd,first)&lt;br&gt;        numbers.append(getNumber(data[first:last]))&lt;br&gt;        data = data[last:]&lt;br&gt;    return numbers&lt;br&gt;    &lt;br&gt;def find_game_number(data):&lt;br&gt;    firstLine = '&amp;lt;td width="21" valign="middle"&amp;gt;'&lt;br&gt;    vet = "&amp;lt;b&amp;gt;&amp;lt;b&amp;gt;"&lt;br&gt;    first = data.find(firstLine)&lt;br&gt;    if (data.find(vet) != -1):&lt;br&gt;        return data[first+len(firstLine):2]&lt;br&gt;    else:&lt;br&gt;        return data[first+len(firstLine)+len(vet):2]&lt;br&gt;        &lt;br&gt;def is_serving(data):&lt;br&gt;    """ returns if the player is serving or not"""&lt;br&gt;    firstLine = '&amp;lt;td width="21" valign="middle"&amp;gt;'&lt;br&gt;    vet = "&amp;lt;b&amp;gt;&amp;lt;b&amp;gt;"&lt;br&gt;    first = data.find(firstLine)&lt;br&gt;    return (data.find(vet) != -1)&lt;br&gt;&lt;br&gt;def player(data):&lt;br&gt;    start = '&amp;lt;td width="264" align="left" valign="middle"&amp;gt;&amp;amp;nbsp;&amp;amp;nbsp;&amp;lt;a href='&lt;br&gt;    startNext = 'class="blue"&amp;gt;'&lt;br&gt;    end = "&amp;lt;/a&amp;gt;"&lt;br&gt;    winner_start = '&amp;lt;b&amp;gt;'&lt;br&gt;    winner_end = '&amp;lt;/b&amp;gt;'&lt;br&gt;    first = data.find(start)&lt;br&gt;    next = data.find(startNext,first)&lt;br&gt;    end = data.find(end,next)&lt;br&gt;    player_name = data[next+len(startNext):end]&lt;br&gt;    if player_name.find(winner_start) != -1:&lt;br&gt;        player_name = player_name[len(winner_start):-len(winner_end)]&lt;br&gt;        win = True&lt;br&gt;    else:&lt;br&gt;        win = False&lt;br&gt;        &lt;br&gt;    if len(player_name) &amp;gt; max_width:&lt;br&gt;        player_name_list = player_name.split(" ")&lt;br&gt;        first_len = max_width - (len(player_name_list[1])+1)&lt;br&gt;        result = player_name_list[0][0:first_len] + " " + player_name_list[1]&lt;br&gt;    return [result, win]&lt;br&gt;        &lt;br&gt;def getNumber(char):&lt;br&gt;    if char[0].isdigit():&lt;br&gt;        return char[0]&lt;br&gt;    else:&lt;br&gt;        return ""&lt;br&gt;    &lt;br&gt;def do(data):&lt;br&gt;    if data == "":&lt;br&gt;        return&lt;br&gt;    &lt;br&gt;    lastBlock = '&amp;lt;td width="5"&amp;gt;&amp;lt;spacer type="block" height="1" width="1"&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;'&lt;br&gt;    firstBlockLastIndex = data.find(lastBlock)&lt;br&gt;    first = data[0:firstBlockLastIndex]&lt;br&gt;    last = data[firstBlockLastIndex:]&lt;br&gt;    first_player = player(first)&lt;br&gt;    last_player = player(last)&lt;br&gt;    message = ""&lt;br&gt;    if (first_player[1] == True | last_player[1] == True):&lt;br&gt;        message += "Completed\nWinner:\n"&lt;br&gt;        if (first_player[1] == True):&lt;br&gt;            winner = first_player&lt;br&gt;        else:&lt;br&gt;            winner = last_player&lt;br&gt;        message += winner[0]&lt;br&gt;    else:&lt;br&gt;        serving_1 = is_serving(first)&lt;br&gt;        serving_2 = is_serving(last)&lt;br&gt;        message = join_results(first_player[0], find_numbers(first), serving_1) &lt;br&gt;        message += "\n"&lt;br&gt;        message += join_results(last_player[0], find_numbers(last), serving_2)&lt;br&gt;    return message&lt;br&gt;&lt;br&gt;def join_results(player, numbers, serving):&lt;br&gt;    result = player + "\n"&lt;br&gt;    if serving == True:&lt;br&gt;        result+= "* "&lt;br&gt;    else:&lt;br&gt;        result += "  "&lt;br&gt;    result += " ".join(numbers)&lt;br&gt;    return result&lt;br&gt;    &lt;br&gt;    &lt;br&gt;data = urllib2.urlopen(url)&lt;br&gt;stringData = data.read()&lt;br&gt;    &lt;br&gt;&lt;br&gt;&lt;br&gt;for p in players:&lt;br&gt;    data = find_player_in_data(p, stringData)&lt;br&gt;    result = do(data)&lt;br&gt;    if result != None:&lt;br&gt;        print result&lt;br&gt;&lt;br&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br&gt;&lt;b&gt;features:&lt;/b&gt;&lt;br&gt;show who's serving &lt;br&gt;truncate for maximum width (edit max_width in the script)&lt;br&gt;choose which players to follow (edit players in the script)&lt;br&gt;show the match winners&lt;br&gt;&lt;br&gt;&lt;b&gt;bugs/missing:&lt;/b&gt;&lt;br&gt;cannot show 15,30,40,AD,De (this should be simple to add, so maybe I'll add this later)&lt;br&gt;This script won't probably work for the double matches and if two&lt;br /&gt;players in your list play against each other it will display the match&lt;br /&gt;twice&lt;br&gt;&lt;br&gt;&lt;b&gt;how to use:&lt;/b&gt;&lt;br&gt;you can choose yourself but I use it in conky. (just add this line in conkyrc&lt;sup&gt;2&lt;/sup&gt;: "${texeci 90 python ~/path/to/script.py}") (&lt;a title="screenshot" href="http://lh5.google.com/thomas.coopman/R5CCh2wx06I/AAAAAAAAAHU/b4KY-EK8T40/snapshot1.png?imgmax=800" id="fxyf"&gt;screenshot&lt;/a&gt;)&lt;br&gt;other possible use would be: a cron script and terminal, a superkaramba widget, a plasmoid,...&lt;br&gt;&lt;br&gt;&lt;br&gt;I know this is only a really simple script.&amp;nbsp; There are probably better ways of doing this but it works and it was written fast.&lt;br&gt;If you have request, you can always ask, I'll see if I have the time for it (exams for now).&lt;br&gt;You can change the script as you like but if you made improvments it would always be cool if you shared them.&lt;br&gt;&lt;br&gt;&lt;sup&gt;1&lt;/sup&gt;Didn't work in konqueror, firefox nor opera (I have flash 9 installed),&amp;nbsp; I wrote them an email about this but haven't yet received a response.&lt;br&gt;&lt;sup&gt;2&lt;/sup&gt;To get conky working in kde I have installed feh and added this line to my conkyrc: "${exec feh --bg-scale `dcop kdesktop KBackgroundIface currentWallpaper 1`}" (source: &lt;a title="http://briancarper.net/2006/08/25/transparent-conky-in-kde-part-2/" href="http://briancarper.net/2006/08/25/transparent-conky-in-kde-part-2/" id="v2x0"&gt;http://briancarper.net/2006/08/25/transparent-conky-in-kde-part-2/&lt;/a&gt; )&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7438332029522992800-4720993307233600680?l=tmske.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tmske.blogspot.com/feeds/4720993307233600680/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7438332029522992800&amp;postID=4720993307233600680' title='0 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7438332029522992800/posts/default/4720993307233600680'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7438332029522992800/posts/default/4720993307233600680'/><link rel='alternate' type='text/html' href='http://tmske.blogspot.com/2008/01/i-wanted-easy-way-of-following-some.html' title=''/><author><name>thomas</name><uri>http://www.blogger.com/profile/13728973542307461536</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7438332029522992800.post-3993374492414643815</id><published>2007-06-25T06:03:00.000-07:00</published><updated>2007-06-25T06:10:27.399-07:00</updated><title type='text'>Finally some time</title><content type='html'>The exams are over so I have some time again to blog, and to continue work on snipper.  I have some big plans for it :-)&lt;br /&gt;&lt;br /&gt;I want to add some features, &lt;br /&gt;fix some bugs, &lt;br /&gt;make it easier to adapt,&lt;br /&gt;make it easier to make it work on windows.&lt;br /&gt;&lt;br /&gt;When I have done that, I'll try to write a plugin for some other text editor to use snipper, I want to see how hard that is, because I would love it if I could use snipper in more than one editor.&lt;br /&gt;The advantages are obvious: you only need to have on template file per filetype and you can use it on all your editors.&lt;br /&gt;This may be a bit of a dream, but it should be rather easy to let it work with at least some editors so I'll try it!&lt;br /&gt;&lt;br /&gt;I still haven't got much time, so the development won't be too fast for the moment.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7438332029522992800-3993374492414643815?l=tmske.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tmske.blogspot.com/feeds/3993374492414643815/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7438332029522992800&amp;postID=3993374492414643815' title='2 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7438332029522992800/posts/default/3993374492414643815'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7438332029522992800/posts/default/3993374492414643815'/><link rel='alternate' type='text/html' href='http://tmske.blogspot.com/2007/06/finally-some-time.html' title='Finally some time'/><author><name>thomas</name><uri>http://www.blogger.com/profile/13728973542307461536</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7438332029522992800.post-8725006230150725585</id><published>2007-05-29T07:30:00.000-07:00</published><updated>2007-05-29T07:33:12.228-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vim colorsheme'/><title type='text'>Vim colorsheme</title><content type='html'>if you're looking for a good colorsheme for vim,&lt;br /&gt;I found &lt;a href="http://www.cs.cmu.edu/~maverick/VimColorSchemeTest/index-pl.html"&gt;this&lt;/a&gt; site&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7438332029522992800-8725006230150725585?l=tmske.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tmske.blogspot.com/feeds/8725006230150725585/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7438332029522992800&amp;postID=8725006230150725585' title='0 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7438332029522992800/posts/default/8725006230150725585'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7438332029522992800/posts/default/8725006230150725585'/><link rel='alternate' type='text/html' href='http://tmske.blogspot.com/2007/05/vim-colorsheme.html' title='Vim colorsheme'/><author><name>thomas</name><uri>http://www.blogger.com/profile/13728973542307461536</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7438332029522992800.post-6725335350493043553</id><published>2007-05-29T04:14:00.001-07:00</published><updated>2007-05-29T07:34:02.528-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vim snipper snippets snippet template templates scribes textmate'/><title type='text'>Snipper 0.2 released</title><content type='html'>I've just released snipper 0.2,&lt;br /&gt;&lt;br /&gt;snipper 0.2 is a completely refactored version of 0.1,&lt;br /&gt;now it should work with python 2.4 and it also works when editing multiple buffers with different filetypes at the same time&lt;br /&gt;&lt;br /&gt;download it &lt;a href="https://launchpad.net/snipper/trunk/0.2/+download/snipper-0.2.tar.gz"&gt;here&lt;/a&gt;&lt;br /&gt;or on &lt;a href="http://www.vim.org/scripts/script.php?script_id=1908"&gt;vim.org&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;After this refactoring, I think I will be able to add new features much easier, so new features will be coming soon (but not too soon because I have to study also)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7438332029522992800-6725335350493043553?l=tmske.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tmske.blogspot.com/feeds/6725335350493043553/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7438332029522992800&amp;postID=6725335350493043553' title='6 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7438332029522992800/posts/default/6725335350493043553'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7438332029522992800/posts/default/6725335350493043553'/><link rel='alternate' type='text/html' href='http://tmske.blogspot.com/2007/05/snipper-02-released.html' title='Snipper 0.2 released'/><author><name>thomas</name><uri>http://www.blogger.com/profile/13728973542307461536</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7438332029522992800.post-1997722822894253081</id><published>2007-05-28T06:01:00.000-07:00</published><updated>2007-05-28T07:12:04.077-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vim snipper snippets snippet template templates scribes textmate'/><title type='text'>Snipper video available</title><content type='html'>I made a small video of snipper in action, it's an ogg&lt;br /&gt;&lt;br /&gt;&lt;a href="http://snipper.googlecode.com/files/snipper-0.1-example.ogg"&gt;http://snipper.googlecode.com/files/snipper-0.1-example.ogg&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7438332029522992800-1997722822894253081?l=tmske.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tmske.blogspot.com/feeds/1997722822894253081/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7438332029522992800&amp;postID=1997722822894253081' title='0 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7438332029522992800/posts/default/1997722822894253081'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7438332029522992800/posts/default/1997722822894253081'/><link rel='alternate' type='text/html' href='http://tmske.blogspot.com/2007/05/snipper-video-available.html' title='Snipper video available'/><author><name>thomas</name><uri>http://www.blogger.com/profile/13728973542307461536</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7438332029522992800.post-2266972063312895665</id><published>2007-05-27T02:40:00.000-07:00</published><updated>2007-05-28T07:25:53.063-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vim snipper snippets snippet template templates scribes textmate'/><title type='text'>Snipper</title><content type='html'>Snipper 0.1 released,&lt;br /&gt;&lt;br /&gt;After some days of working on vim scripting in python, I wanted to try the real deal, write a script that is really useful, so I wrote a snippets script for vim.&lt;br /&gt;&lt;br /&gt;For all of you who don't know what snippets are: snippets or templates are predefined pieces of text that you would like to insert in your text fast.  You basically type an alias and press a button and the complete text is inserted.&lt;br /&gt;I will be making a video of it soon but for now if you want more information, look at &lt;a href="http://scribes.sourceforge.net/"&gt;http://scribes.sourceforge.net/&lt;/a&gt; or at &lt;a href="http://macromates.com/"&gt;http://macromates.com/&lt;/a&gt;, two cool editors for if you don't know vim :-)&lt;br /&gt;&lt;br /&gt;So now everyone knows what snippets are, I can continue my explanation of my script that you can find on &lt;a href="https://launchpad.net/snipper/"&gt;https://launchpad.net/snipper/&lt;/a&gt;, download it &lt;a href="https://launchpad.net/snipper/+download"&gt;here&lt;/a&gt;&lt;br /&gt;Documentation will be available very soon. (for installation and use)&lt;br /&gt;&lt;br /&gt;This is the first version of the script, so expect some bugs.  If you find any bugs that haven't been posted, please do (&lt;a href="https://bugs.launchpad.net/snipper/"&gt;https://bugs.launchpad.net/snipper/&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;I hope you like this script (if you do, please add a comment) and stay tuned for more info.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7438332029522992800-2266972063312895665?l=tmske.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tmske.blogspot.com/feeds/2266972063312895665/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7438332029522992800&amp;postID=2266972063312895665' title='1 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7438332029522992800/posts/default/2266972063312895665'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7438332029522992800/posts/default/2266972063312895665'/><link rel='alternate' type='text/html' href='http://tmske.blogspot.com/2007/05/snipper.html' title='Snipper'/><author><name>thomas</name><uri>http://www.blogger.com/profile/13728973542307461536</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7438332029522992800.post-5496403560105575526</id><published>2007-05-23T00:24:00.000-07:00</published><updated>2007-05-23T00:47:45.153-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='vim howto tips tutorial'/><title type='text'>some helpful vim tips</title><content type='html'>Hi,&lt;br /&gt;&lt;br /&gt;In this blog I want to show a few helpful tips about vim, that you can use in my tutorials about vim scripting in python&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;first of all&lt;/span&gt;&lt;br /&gt;everyone should know the help command!&lt;br /&gt;&lt;span style="font-family: courier new; font-weight: bold;"&gt;:help somecommand&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;syntax highlighting on in console&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;:syn on&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;set commands based on filetype&lt;/span&gt;&lt;br /&gt;first set&lt;br /&gt;&lt;span style="font-weight: bold; font-family: courier new;"&gt;:filetype on&lt;/span&gt;&lt;br /&gt;now, vim will try to recognize the type of file you are editing,&lt;br /&gt;then you can use&lt;br /&gt;&lt;span style="font-family: courier new; font-weight: bold;"&gt;au FileType python source /path/to/python/commands&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;au, automatically execute on event&lt;br /&gt;source, read the source file with commands&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;execute command from .vimrc without having to press enter&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new; font-weight: bold;"&gt;:someCommand()^M&lt;/span&gt;&lt;br /&gt;and ^M you have to enter by typing &amp;#60ctrl-v&amp;#62&amp;#60ctrl-m&amp;#62 (so pressing those combinations)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7438332029522992800-5496403560105575526?l=tmske.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tmske.blogspot.com/feeds/5496403560105575526/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7438332029522992800&amp;postID=5496403560105575526' title='0 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7438332029522992800/posts/default/5496403560105575526'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7438332029522992800/posts/default/5496403560105575526'/><link rel='alternate' type='text/html' href='http://tmske.blogspot.com/2007/05/some-helpful-vim-tips.html' title='some helpful vim tips'/><author><name>thomas</name><uri>http://www.blogger.com/profile/13728973542307461536</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7438332029522992800.post-3588034507550441790</id><published>2007-05-21T00:36:00.000-07:00</published><updated>2007-05-23T01:45:54.094-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='python vim scripts py vi tutorial tutorials howto'/><title type='text'>python scripting in vim (2)</title><content type='html'>Hi,&lt;br /&gt;&lt;br /&gt;Hopefully you all found my first tutorial helpfull,&lt;br /&gt;this will be a second more advanced tutorial about scripting vim in python.&lt;br /&gt;In this tutorial we will make a script to test if your python script doesn't contain syntax errors, we will use pyflakes for this&lt;c-v&gt;&lt;br /&gt;&lt;br /&gt;let' s get started with the module pyflakse,&lt;br /&gt;you can find pyflakes on http://divmod.org/trac/wiki/DivmodPyflakes&lt;br /&gt;install it on ubuntu: apt-get install pyflakes&lt;br /&gt;&lt;br /&gt;We will use pyflakes because it is fast, if you're interested you can also look at pylint and pychecker.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;first let's do some tests with pyflakes&lt;/span&gt;&lt;br /&gt;open some python interpreter:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;&lt;br /&gt;&gt;&gt;&gt;file = "/path/to/file"&lt;br /&gt;&gt;&gt;&gt;code = open(file, 'r').read()&lt;br /&gt;&gt;&gt;&gt;tree = compiler.parse(code)&lt;br /&gt;&gt;&gt;&gt;w = pyflakes.Checker(tree)&lt;br /&gt;&gt;&gt;&gt;for warning in w.messages: print warning&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;if your file contains an error, it should be shown. If the code has a syntax or indentation error, the compiler fase will fail but we will handle that in the script.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Now lets write this in a vim script,&lt;/span&gt;&lt;br /&gt;we will write this script in a seperate file,&lt;br /&gt;this is because we can keep or .vimrc clean and because we only want to load this file when we are editing python scripts (see &lt;a href="http://tmske.blogspot.com/2007/05/some-helpful-vim-tips.html"&gt;this&lt;/a&gt; blog)&lt;br /&gt;&lt;br /&gt;the script we will write, will toggle a buffer to show the errors.  If no errors are found the scirpt will just write a message.&lt;br /&gt;We write 4 functions,&lt;br /&gt;checkSyntax&lt;br /&gt;doSyntaxCheck&lt;br /&gt;closeBuffer&lt;br /&gt;bufferOpen&lt;br /&gt;&lt;br /&gt;checkSyntax is the main function that you have to call when you want to have a map to this script&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-family:courier new;" &gt;&lt;br /&gt;#!/usr/bin/python&lt;br /&gt;&lt;br /&gt;import vim&lt;br /&gt;import pyflakes&lt;br /&gt;import compiler&lt;br /&gt;&lt;br /&gt;def checkSyntax():&lt;br /&gt;&lt;dir&gt;"""This function checks if the output buffer is already open.  If it is open,&lt;br /&gt;we will close it (because we want to toggle).  If it is not open, we will&lt;br /&gt;create&lt;br /&gt;the output buffer and do the real syntax check with (doSyntaxCheck)&lt;br /&gt;"""&lt;br /&gt;#first save the current buffer&lt;br /&gt;current = vim.current.buffer&lt;br /&gt;#check if the buffer is open&lt;br /&gt;b = bufferOpen()&lt;br /&gt;if not b:&lt;br /&gt;&lt;dir&gt;vim.command("bel silent new output")&lt;br /&gt;output =  vim.current.buffer&lt;br /&gt;doSyntaxCheck(current, output)&lt;/dir&gt;&lt;br /&gt;else:&lt;br /&gt;&lt;dir&gt;closeBuffer(b)&lt;/dir&gt;&lt;/dir&gt;&lt;br /&gt;&lt;br /&gt;def doSyntaxCheck(current, output):&lt;br /&gt;&lt;dir&gt;"""This function will do the real syntax check, first we will create a string&lt;br /&gt;that contains&lt;br /&gt;the current buffer, we will then try to parse the code with compiler and then&lt;br /&gt;run pyflakes on it.&lt;br /&gt;All errors are printed in the output window, if no errors are found, a message&lt;br /&gt;is printed and the buffer is closed again&lt;br /&gt;"""&lt;br /&gt;#convert the list of lines to a string&lt;br /&gt;code = "\n".join(current)&lt;br /&gt;try:&lt;br /&gt;&lt;dir&gt;tree = compiler.parse(code)&lt;/dir&gt;&lt;br /&gt;except (SyntaxError, IndentationError), inst:&lt;br /&gt;&lt;dir&gt;output[0:0] = [str(inst).strip()]&lt;/dir&gt;&lt;br /&gt;else:&lt;br /&gt;&lt;dir&gt;w = pyflakes.Checker(tree)&lt;br /&gt;w.messages.sort(lambda a,b: cmp(a.lineno, b.lineno))&lt;/dir&gt;&lt;br /&gt;if w.messages:&lt;br /&gt;&lt;dir&gt;for warning in w.messages:&lt;br /&gt;  &lt;dir&gt;output[0:0] = [str(warning).strip()]&lt;/dir&gt;&lt;/dir&gt;&lt;br /&gt;else:&lt;br /&gt;&lt;dir&gt;closeBuffer(output)&lt;br /&gt;print "code ok"&lt;/dir&gt;&lt;/dir&gt;&lt;br /&gt;&lt;br /&gt;def bufferOpen():&lt;br /&gt;&lt;dir&gt;"""This function checks all the buffers if a buffer with a name containing&lt;br /&gt;output exists.  If it exists we return that buffer, else we return None&lt;br /&gt;"""&lt;br /&gt;for b in vim.buffers:&lt;br /&gt;&lt;dir&gt;if "output" in b.name:&lt;br /&gt;&lt;dir&gt;return b&lt;/dir&gt;&lt;/dir&gt;&lt;br /&gt;return None&lt;/dir&gt;&lt;br /&gt;&lt;br /&gt;def closeBuffer(buffer):&lt;br /&gt;&lt;dir&gt;"""Completely delete buffer"""&lt;br /&gt;cmd = "bwipeout! " + buffer.name&lt;/dir&gt;&lt;br /&gt;vim.command(cmd)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Stay tuned...&lt;/span&gt;&lt;br /&gt;I hope you all liked this tutorial.&lt;br /&gt;reactions are always welcome, and I'll do my best to publish a new tutorial soon!&lt;/c-v&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7438332029522992800-3588034507550441790?l=tmske.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tmske.blogspot.com/feeds/3588034507550441790/comments/default' title='Reacties plaatsen'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7438332029522992800&amp;postID=3588034507550441790' title='5 reacties'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7438332029522992800/posts/default/3588034507550441790'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7438332029522992800/posts/default/3588034507550441790'/><link rel='alternate' type='text/html' href='http://tmske.blogspot.com/2007/05/python-scripting-in-vim-2.html' title='python scripting in vim (2)'/><author><name>thomas</name><uri>http://www.blogger.com/profile/13728973542307461536</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7438332029522992800.post-2385987739987241511</id><published>2007-05-20T01:01:00.001-07:00</published><updated>2007-05-21T00:26:09.733-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='first blog linux ubuntu python kde'/><title type='text'>My first blog</title><content type='html'>Hi,&lt;br /&gt;&lt;br /&gt;I just started a blog,&lt;br /&gt;I will try to write regular about things I'm most interested in, like linux, ubuntu, python, kde.&lt;br /&gt;&lt;br /&gt;Hopefully you like it,&lt;br /&gt;&lt;br /&gt;Thomas&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7438332029522992800-2385987739987241511?l=tmske.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7438332029522992800/posts/default/2385987739987241511'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7438332029522992800/posts/default/2385987739987241511'/><link rel='alternate' type='text/html' href='http://tmske.blogspot.com/2007/05/my-first-blog.html' title='My first blog'/><author><name>thomas</name><uri>http://www.blogger.com/profile/13728973542307461536</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-7438332029522992800.post-7739504246559952764</id><published>2007-05-20T00:57:00.000-07:00</published><updated>2007-05-21T00:26:50.199-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='python vim scripts py vi tutorial tutorials howto'/><title type='text'>python scripting in vim (1)</title><content type='html'>This is a short tutorial about writing vim scripts in python.&lt;br /&gt;This tutorial is for everyone who likes vim and python.&lt;br /&gt;&lt;br /&gt;&lt;font style="font-weight: bold;"&gt;Preperations:&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;To write vim scripts in python you need to have vim compiled with +python&lt;br /&gt;&lt;br /&gt;&lt;font style="font-style: italic;"&gt;Fedora/CentOS: vim-enhanced&lt;/font&gt;&lt;br /&gt;&lt;font style="font-style: italic;"&gt;Debian/Ubuntu: vim-python&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;font style="font-weight: bold;"&gt;Let's get started:&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;first a thing about how you can use python for vim-scripting,&lt;br /&gt;you can set these things in your &lt;font style="font-style: italic;"&gt;~/.vimrc&lt;/font&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;font style="font-style: italic;"&gt;autocmd FileType python [commands]&lt;/font&gt;&lt;br /&gt;Run commands when this type of file is edited &lt;/li&gt;&lt;li&gt;&lt;font style="font-style: italic;"&gt;python [python code]&lt;/font&gt;&lt;br /&gt;Evaluate the python code given&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;font style="font-style: italic;"&gt;python &lt;&lt; EOF&lt;/font&gt;&lt;br /&gt;Read python code untill the EOF&lt;/li&gt;&lt;li&gt;&lt;font style="font-style: italic;"&gt;pyfile [filename]&lt;/font&gt;&lt;br /&gt;Read python commands from a python file&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;font style="font-style: italic;"&gt;map [keys] [command]&lt;/font&gt;&lt;br /&gt;Run the specified command when the key(s) are pressed&lt;/li&gt;&lt;/ul&gt;&lt;font style="font-weight: bold;"&gt;Simple start...&lt;/font&gt;&lt;br /&gt;&lt;font style="font-weight: bold;" face="courier new"&gt;&lt;br /&gt;"first tutorial hello world&lt;br /&gt;imap &amp; &lt;Esc&gt;:python pythonHelloWorld()&lt;br /&gt;python &lt;&lt; EOF&lt;br /&gt;&lt;br /&gt;#start the function&lt;br /&gt;def pythonHelloWorld():&lt;br /&gt;&lt;dir&gt;import vim    #so you can use the vim functions&lt;br /&gt;buffer = vim.current.buffer #returns the current buffer&lt;br /&gt;buffer[0] = "hello world"&lt;br /&gt;#sets the first line of the buffer to "hello world"&lt;/dir&gt;&lt;br /&gt;EOF&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;font style="font-weight: bold;"&gt;What we have so far&lt;/font&gt;&lt;br /&gt;a line starting with " is a comment in the .vimrc&lt;br /&gt;&lt;font style="font-weight: bold;" face="courier new"&gt;&lt;br /&gt;imap &amp; &lt;Esc&gt;:python pythonHelloWorld()&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;press the &amp;amp; in insert mode to execute the command :python pythonHelloWordl(), notice the &lt;Esc&gt; so you leave insert mode and go to the command mode.&lt;br /&gt;&lt;font style="font-weight: bold;" face="courier new"&gt;&lt;br /&gt;python &lt;&lt; EOF&lt;/font&gt;&lt;br /&gt;everything between these lines will be read as python code&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;font style="font-weight: bold;"&gt;slightly improved version&lt;/font&gt;&lt;br /&gt;We will improve the previous version so that we insert the "hello world" line before the current line, so we don't overwrite anything.&lt;br /&gt;&lt;font style="font-weight: bold;" face="courier new"&gt;&lt;br /&gt;def pythonInsertHelloWorld():&lt;br /&gt;&lt;dir&gt;import vim&lt;br /&gt;buffer = vim.current.buffer&lt;br /&gt;#returns the row and column of the current cursor&lt;br /&gt;#position&lt;br /&gt;(row, col) = vim.current.window.cursor&lt;br /&gt;#python starts numbering from 0, vim from 1.&lt;br /&gt;#insert line above current cursor position&lt;br /&gt;#the argument must be a list, or it won't work&lt;br /&gt;buffer[row-1:row-1] = ["hello world"]&lt;br /&gt;&lt;/dir&gt;EOF&lt;br /&gt;&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;&lt;font style="font-weight: bold;"&gt;and further...&lt;/font&gt;&lt;br /&gt;this was the first really basic tutorial, more will follow soon, but you should have a start now.&lt;br /&gt;If you have questions, see mistakes or have comments, please add your reaction.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;font style="font-weight: bold;"&gt;see also:&lt;/font&gt;&lt;br /&gt;about python scripting:&lt;a href="http://www.tummy.com/Community/Presentations/vimpython-20070225/vim.html"&gt;http://www.tummy.com/Community/Presentations/vimpython-20070225/vim.html&lt;/a&gt;&lt;br /&gt;in vim    :help python&lt;br /&gt;help about map: &lt;a href="http://www.linux.com/article.pl?sid=06/06/08/1431210"&gt;http://www.linux.com/article.pl?sid=06/06/08/1431210&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7438332029522992800-7739504246559952764?l=tmske.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7438332029522992800/posts/default/7739504246559952764'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7438332029522992800/posts/default/7739504246559952764'/><link rel='alternate' type='text/html' href='http://tmske.blogspot.com/2007/05/python-scripting-in-vim-1.html' title='python scripting in vim (1)'/><author><name>thomas</name><uri>http://www.blogger.com/profile/13728973542307461536</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry></feed>
