Here's mine captured today.
USA > UK > Germany.
59% are windows users.
28% are marked as "linux" (whatever the heck that means).
and chrome > firefox.
Interesting.
Random musings on GNU+Linux. open source software, and Python. The main purpose of this blog is to archive (for myself) what I am learning about these wonderful technologies/communities
I write GPLv3 applications using python and pyqt4, and by association Qt.
I build binaries mainly for Debian based gnu/linux distributions. Consequently, I let the mighty apt take responsibility for a valid python and pyqt environment. Up until now, therefore, I am simply distributing my own code.
Recently, however, I have been playing with creating packages for windows. Using Pyinstaller I can build executables which pull all my python and qt dependencies and roll them into either a single folder, or even a single *.exe .
These give me cause for concern however, as these standalone executables contain several files I believe I am unlicensed to redistribute. Those files come from 2 sources.
In conjunction with Wix I can go even further and create an *.msi package which helps for clean installation, removal and upgrading of my application. I believe most application developers using these very same tools on windows simply do exactly this and don't care about the legal and moral issues here. I, however, am not content to do this and believe I need to find a way to comply with the licensing terms of microsoft, qt and pyqt4.
I believe one possibility is to write a separate application in conjunction with the Wix installer to emulate apt and install those components separately.
I would welcome comments from anyone who has addressed this problem.
Here are the files produced by one particular (non-trivial) PyQt4 application of mine.$ ls -lR rotagen/ rotagen/: 71680 Jul 4 2010 bz2.pyd 1019904 Oct 20 2010 LIBEAY32.dll 1857 Nov 7 2007 Microsoft.VC90.CRT.manifest 224768 Nov 6 2007 msvcm90.dll 568832 Nov 7 2007 msvcp90.dll 655872 Nov 7 2007 msvcr90.dll 266752 Nov 11 2010 phonon4.dll 1594880 Dec 24 2010 PyQt4.QtCore.pyd 5670912 Dec 24 2010 PyQt4.QtGui.pyd 468480 Dec 24 2010 PyQt4.QtNetwork.pyd 304640 Dec 24 2010 PyQt4.QtWebKit.pyd 2286080 Jul 4 2010 python27.dll 2238464 Nov 11 2010 QtCore4.dll 7943168 Nov 11 2010 QtGui4.dll 891392 Nov 11 2010 QtNetwork4.dll 674816 Nov 11 2010 QtOpenGL4.dll 276480 Nov 11 2010 QtSvg4.dll 10843136 Nov 11 2010 QtWebKit4.dll 339456 Nov 11 2010 QtXml4.dll 1009069 Dec 16 11:10 rotagen.exe 730 Dec 16 11:10 rotagen.exe.manifest 11776 Jul 4 2010 select.pyd 66560 Dec 24 2010 sip.pyd 209920 Oct 20 2010 SSLEAY32.dll 688128 Jul 4 2010 unicodedata.pyd rotagen/include: 21451 Dec 6 2009 pyconfig.h rotagen/qt4_plugins: rotagen/qt4_plugins/codecs: 141824 Nov 11 2010 qcncodecs4.dll 167936 Nov 11 2010 qjpcodecs4.dll 77824 Nov 11 2010 qkrcodecs4.dll 155136 Nov 11 2010 qtwcodecs4.dll rotagen/qt4_plugins/graphicssystems: 14336 Nov 11 2010 qglgraphicssystem4.dll rotagen/qt4_plugins/iconengines: 36864 Nov 11 2010 qsvgicon4.dll rotagen/qt4_plugins/imageformats: 26624 Nov 11 2010 qgif4.dll 28672 Nov 11 2010 qico4.dll 196096 Nov 11 2010 qjpeg4.dll 220672 Nov 11 2010 qmng4.dll 22016 Nov 11 2010 qsvg4.dll 284672 Nov 11 2010 qtiff4.dll
The title says it all, I have a folder of videos, and want to have them play on my Nexus 7 Android device.
In other words, I want to be able to do this:-
~$ cd Videos ~$ somescript *.avi|*.mov|*.mpeg
then go to bed and wake up with nexus 7 supported files.
Here is my version of that script.#! /bin/bash ############################################################ # script to convert video files to nexus (android) devices # ############################################################ HELP="\n This script will convert video files to the preferred format for android devices\n It uses ffmpeg to do a 2 pass encoding.\n See http://patdavila.wordpress.com/2010/03/10/re-encoding-mythtv-recordings-for-viewing-on-your-android-phone/\n \n EXAMPLES\n convert quicktime movies\n ~$ ./android_video.sh video_file.mov\n \n convert mpgs\n ~$ ./android_video.sh video_file.mpg\n \n convert avis\n ~$ ./android_video.sh video_file.avi\n \n wildcard use is supported, and unique filenames for the output videos should ensue by simply prefixing .mp4\n eg.\n ~$ ./android_video.sh *.avi\n " function show_help { echo -e $HELP exit 1 } convert() { SRC=$1 DEST=$1.mp4 ffmpeg -i $SRC -aspect 16:9 -s 800x480 -vcodec libx264 -b 480k -r 13 -acodec libfaac -ab 128k -sameq -pass 1 -f rawvideo -an -y /dev/null && \ ffmpeg -i $SRC -aspect 16:9 -s 800x480 -vcodec libx264 -b 480k -r 13 -acodec libfaac -ab 128k -ac 2 -sameq -pass 2 $DEST } if [[ "$1" == "" ]] then show_help fi while [[ "$1" != "" ]]; do convert $1 shift done exit 1
there seems to be a problem going around where mythtv is failing to record shows (on DVB tuners) and recording that the show HAS been recorded, but with a zero byte file size.
I have had this happen on my machine, which is currently running mythbuntu 12.10 64 bit.
When it happens on my machine, further recordings and live tv all fail too.
A quick google gives me the following impression.
so, as I am in category 1, I have tried fixes 2 and 3. incidentally, fix 3 should be done in this manner for most grub2 based distros.
sudo nano /etc/default/grubchange the line which looks this (you may have other options already like splash)
GRUB_CMDLINE_LINUX_DEFAULT="quiet"by appending vmalloc=512M ie..
GRUB_CMDLINE_LINUX_DEFAULT="quiet vmalloc=512M"then save & run
"sudo update-grub"
I've done this.. I'll let you know if it doesn't work (might be 2 weeks before the next program is missed, and I'll bet it is my wife's favourite gardening program again)
import MySQLdb db = MySQLdb.connect(db="openmolar", user="academy", passwd="XXXXXX") cursor = db.cursor() query = '''INSERT INTO notes (ndate, serialno, note) VALUES (DATE(NOW()), %s, %s)''' values = ((1, "hello"), (1, "world")) cursor.executemany(query, values)this code works with python-mysqldb 1.2.3 (on debian wheezy), but not python-mysqldb 1.2.2 (debian squeeze). the error I get is
TypeError: not all arguments converted during string formattingit seems that being able to include MySQL functions (ie. the DATE(NOW()) bit) in the values tuple is only recently supported. what is surprising, however, is that this can be done with single executions.. eg.
cursor.execute(query, (1, "hello"))Obviously, this is not consistent behaviour, and has been fixed in the current release, but it does demonstrate a hazard for developers who target various gnu/linux distros. (yes, I know I should have a test suite... ) FOLLOW-UP - I looked into the python-mysqldb sources, and found the culprit to be an improved regex lookup introduced in cursors.py
Populating a new database with demo data. |
Exploring/Editing the tables of that database. |
Making a Query on that database. |
And finally... using the client application for a graphical view of a (fictitious) patient's data. |
Contents: .gzafter that I ran "reprepro export" to update the indices. Job done.
~$ apt-file update ~$ apt-file search createdemodatabase.py openmolar-orig: /usr/lib/python2.6/dist-packages/openmolar/createdemodatabase.py openmolar-orig: /usr/lib/python2.7/dist-packages/openmolar/createdemodatabase.py openmolar-orig: /usr/share/pyshared/openmolar/createdemodatabase.py
~$ sudo apt-get install python-qt4-phonon phonon-backend-gstreamerthen the following code should work. (choose your own music file of course!)
import sys from PyQt4 import QtCore from PyQt4.phonon import Phonon app = QtCore.QCoreApplication(sys.argv) app.setApplicationName("my_player") #phonon useage requires an application name m = Phonon.MediaSource("/home/neil/Music/pop/ABC - All of My Heart.mp3") obj = Phonon.createPlayer(Phonon.MusicCategory, m) obj.play() app.exec_()
~# apt-get dist-upgrade Get:1 http://ftp.uk.debian.org/debian/ wheezy/main dpkg amd64 1.16.2 [2,327 kB] . (etc..) . . After this operation, 516 kB disk space will be freed. Do you want to continue [Y/n]? Y Create pre-installation snapshot with btrfs [Y/n] Y