Adam Monsen

September 9, 2005

F/OSS (Free/Open Source Software) Finance Management

Filed under: Default — adam @ 8:38 pm PDT

Today, AdamMonsen.com asks, Is there really any quality
Personal/Business Finance Management software available for GNU/Linux systems?

GnuCash

  • PRO: good support for invoicing and tracking customers
  • PRO: useful reports
  • CON: double-entry accounting system known to provoke weeping
  • CON: development seems stagnant

Grisbi

  • PRO: runs on Windows

KMyMoney

  • PRO: can import GnuCash data

Summary

As you can see, this is a pretty flimsy article. I haven’t even tried Grisbi or
KMyMoney. I’ve been using GnuCash for the last two and a half years and have
been pretty happy with it; it doesn’t mess up my data, it makes pretty graphs,
and it really helps for invoicing customers and keeping track of who owes me
what. I’ve just been a little concerned lately that development is not
proceeding, so I’m evaluating alternatives.

September 7, 2005

Backquotes in Python

Filed under: Default — adam @ 8:47 pm PDT

Python logo

Backquotes (aka backticks, aka back-quotes, aka back-ticks) in Python are “string conversion” operators. It is difficult to use search engines for certain activities, like finding documentation on backquotes. I found the information I was looking for when I spotted “back-quotes” in the Python reference manual index. I feel that all Python symbols should be added to the index of the Python reference manual.

The sole purpose of this blog post is to provide Google (et al) with more appropriate search terms to aid people trying to figure out what the heck backquotes do in Python.

In case you’re curious, I saw backquotes in this script (yep, it’s a quine), and began trying to use Google to look up what backquotes mean. Turns out there is at least one way to search for backquotes, but I didn’t figure this out until later.

Here are some equivalent chunks of code showing that backticks work exactly like repr() and backquoted, parenthesized expressions:

Python 2.4.1 (#1, May 16 2005, 15:19:29)
[GCC 4.0.0 20050512 (Red Hat 4.0.0-5)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> a = 'foo'
>>> print `a`
'foo'
>>> print `(a)`
'foo'
>>> print repr(a)
'foo'

September 1, 2005

Flattening nested tuples and lists in Python

Filed under: Default — adam @ 6:59 pm PDT

Python logo

According to someone on ASPN, “…everyone carries around a version of flatten.”

Maybe true. Here’s mine, anyway.

def flat_tuple(a):
    """Flattens tuple and list combinations into a single tuple.
    Example Usage:
    >>> stuff = [[([[5,6], ("poo", 0, 1, None, 2), (3, 4, 5), (6, [7, 8])])]]
    >>> flat_tuple(stuff) == (5, 6, 'poo', 0, 1, None, 2, 3, 4, 5, 6, 7, 8)
    True
    """
    if type(a) not in (tuple, list): return (a,)
    if len(a) == 0: return tuple(a)
    return flat_tuple(a[0]) + flat_tuple(a[1:])

def _test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    _test()
« Newer Posts

Powered by WordPress