Archive for the ‘random’ Category
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',)]
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)
GWT on Ubuntu
Had a hard job getting this to work. But as usual the solution is quite simple:
- Download and unzip http://google-web-toolkit.googlecode.com/svn/tools/redist/mozilla/mozilla-1.7.13.tar.gz
- Add $INSTALLED_MOZILLA (e.g. /code/mozilla-1.7.13) to mozilla-hosted-browser.conf in the GWT
- 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)
- run ldconfig
- 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.
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

