Yak Shaving just me

28Dec/080

Banshee’s Database

I have been playing with Banshee the media player for Linux.

Its database is just a sqlite3 database. This makes getting data out very simple e.g.

:~$ sqlite3 ~/.config/banshee-1/banshee.db
SQLite version 3.5.9
Enter ".help" for instructions
sqlite> select name from CoreArtists;
Cradle of Filth
ACDC
Alice in Chains
A Perfect Circle

I used -1 on my banshee path as I`m running the latest version not available from the standard repos for Ubuntu.

To talk to the database from python use the following:

:~$ python
Python 2.5.2 (r252:60911, Oct  5 2008, 19:24:49)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
>>> conn = sqlite3.connect('.config/banshee-1/banshee.db')
>>> c = conn.cursor()
>>> c.execute("""select name from CoreArtists""")

>>> print c.fetchall()
[(u'Cradle of Filth',), (u'ACDC',), (u'Alice in Chains',), (u'A Perfect Circle',)]
6Nov/080

Problem 4

#!/usr/bin/python

winners = []

for a in range (100, 999):
    for b in range (100, 999):
        test = str(a * b)
        if test == test[::-1]:
            winners.append(int(test))

print max(winners)
Tagged as: , No Comments
19Sep/080

GWT on Ubuntu

Had a hard job getting this to work. But as usual the solution is quite simple:

  1. Download and unzip http://google-web-toolkit.googlecode.com/svn/tools/redist/mozilla/mozilla-1.7.13.tar.gz
  2. Add $INSTALLED_MOZILLA (e.g. /code/mozilla-1.7.13) to mozilla-hosted-browser.conf in the GWT
  3. Add $INSTALLED_MOZILLA (e.g. /code/mozilla-1.7.13) to /etc/ld.so.conf.d/libc.conf (can be any file in that dir ending in conf)
  4. run ldconfig
  5. Start your app and have fun!

If you see gwt-linux-1.5.2/libgwt-ll.so: undefined symbol: JS_PropertyStub then your mozilla-hosted-browser.conf needs to be set to the downloaded mozilla from set 1. Looks like the newer Firefox and Seamonkey dont have this symbol.

15Aug/080

Karoo…

Just logged into my control panel for my isp and saw my bandwidth usage for the month in the form of picture. Looking at the page source I can see they are using Google's Chart API:

http://chart.apis.google.com/chart?

I cant make my mind if this is cool or Karoo are just lazy :) 

Filed under: random No Comments