Artikel mit Tag ‘Snippet’

Get the gist of it

Veröffentlicht in Kategorie Coding, Computer, Python am 11. Februar 2014 von Chris – Ersten Kommentar schreiben

Some months ago I finally caught up with modern development practices and switched to Git for new software projects. I even now use my GitHub and Bitbucket accounts more often, e.g. for collaboration projects, though I host my own projects on my own server with the help of Trac and gitosis.

One thing I do like about GitHub though, are Gists. Like many good ideas this one makes one wonder, why nobody came up with it before. Basically Gists are code snippets you publish on the web (like in a pastebin) but they are under version control and each Gist is its own mini git repository. They let you share programming ideas and nifty little tools with the rest of the world with ease and others can easily take them and comment, expand or correct them. The revision control makes it clear, what developed from where and who did what. Finally, your Gist page on GitHub serves as a central place, where you can browse, search and present all these digital scrap notes.

It is also very easy to include Gists in your blog, which is what I’m starting with this post.

Weiter lesen »

Audiosignalverabeitung mit Python

Veröffentlicht in Kategorie Coding, Computer, Musik, Python, Verschiedenes am 28. Februar 2011 von Chris – Ersten Kommentar schreiben

Wie man an einzelnen Beiträgen in diesem Blog sehen kann, beschäftige ich mich seit einiger Zeit verstärkt mit Soundsynthese und Audioprocessing. Als bekennender Fan von Python habe ich mich mal nach Tools für die mathematische Analyse und Verarbeitung von Audiosignalen in Python umgesehen und möchte hier mal meine Recherche-Ergebnisse vorstellen.

Weiter lesen »

How to create a new ticket in Trac from a script

Veröffentlicht in Kategorie Coding, Python am 26. Februar 2010 von Chris – Ersten Kommentar schreiben

This is just a note to myself and to spare someone, who faces the same task, going through the Trac sources to find out how to do this:

from trac.env import open_environment
from trac.ticket.model import Ticket

# A list of email addresses or trac user names
NOTIFICATION_LIST = ['randomhacker', 'boss']

ticket = Ticket(open_environment('/path/to/trac/env'))
ticket.populate(dict(
    component = u'My component',
    type = u'task',
    status = u'new',
    summary = u'Make the world a better place',
    reporter = u'me',
    # Set owner to default for given component
    owner = None,
    # You can use Trac wiki syntax here
    description = u"Don't ask '''me''' how to do it...",
    cc = ",".join(NOTIFICATION_LIST))
)
ticket_id = ticket.insert()

That’s all!

Update 2010-03-01: Naturally, after I figured this all out by myself by looking through the Trac source, I found this similar explanation on the trac wiki.