jorgenmodin.net
"Classicists have continued their efforts to suppress Wittgenstein's arguments up to the present day, e.g. on Wikipedia."
Det här är lite utanför mitt område, men om jag förstår andemeningen så är det att logik bör betraktas som en slags ingenjörskonst, och att den måste användas på ett liknande sätt som ingenjörskunskap, dvs inom rimliga ramar, och att man får acceptera motsägelser. Författaren föreslår något som han kallar "Consequently Direct Logic", som ska göra logikområdet mer relevant för t ex programvaruutveckling.
Classicists have continued their efforts to suppress Wittgenstein's arguments up to the present day, e.g. on Wikipedia.
Läs mer: Incompleteness Theorems - a knol by Carl Hewitt (see http://carlhewitt.info)
The Guardian om Sverige, Göran Lindberg och våra deckarförfattare
Deckarförfattarna Henning Mankell, Stieg Larsson och andra har visat en bild av Sverige som är annorlunda än den idealiserade bild som ofta finns i t ex Storbritannien. Efter domen mot förre länspolischefen Göran Lindberg så undrar The Guardian's Andrew Anthony om det kanske ligger något i denna nya bild:
Anthony skriver en lång och intressant artikel som redovisar synpunkter från olika svenska opinionsledare. Han avslutar med en undran om det kan vara så att svenskarna är överpragmatiska, att vi identifierar problem som ska lösas med utbildning, utan att ta in den större bilden av vad det är man försöker lösa.
Läs mer: Göran Lindberg and Sweden's dark side | feature | World news | The Observer
When clicking in folder_contents leads to downloads (Plone)
Having created my own MP3 content type in Plone, based on the File content type, I noticed the strange behavior that clicking on any MP3 in a folder contents listing would lead to a download of the MP3. Awkward.
Trying out the standard File content type, this does not happen; you get to the view of the content item instead.
So what's the difference? With File, there is "/view" appended to the url of each content item in the folder contents listing, with the MP3 file there is not. Time to look through the view configurations in XML for the two content types. There were differences, specifically File tacks on "/view" to the specification of "View". Changing this in MP3 made no difference.
Ok, time to take on the diving suit and chase down the code for the folder_contents view. Thankfully it was reasonably easy to find, in
./plone/app/content/browser/foldercontents.py
The view decides to tack on "/view" if the content type of the item to list is in this list:
use_view_action = site_properties.getProperty('typesUseViewActionInListings', ())
So, I added "MP3" on a line in the property "typesUseViewActionInListings" in the site_properties property sheet in portal_properties. And it worked. Not so obvious.
Link - On software project development estimates
Checking what would be updated before making an svn up
If you have a working copy in subversion that is older than the latest checkin, you may want to check the differences you would get if you made an svn up, without actually doing an svn up.
svn diff --revision HEAD
...will give you that.
--revision N The client compares TARGET@N against working copy.
Läs mer: svn diff
Video editors on Linux
Here is a list of Video editors available on Linux. I have tried them all, save Lombard. Will try to summarize more experiences at a later time.
- Cinelerra (Cinelerra for Grandma)
- LiVES The best one I have found for extracting short video clips from a video. My use case was extracting individual three second long moves from salsa dance performances. I tried three Linux based video editors for this: LiVES, Cinelerra and Pitivi. The best by far for this particular application was LiVES. It was easy to "scrub" with, essential for finding the right cut point.
- Kdenlive Has a lot of filters you can apply to video. Unsure of how cutting works.
- Pitivi
- Lombard Very recent contribution, supports only basic editing at this point in time, according to web site.
CLI ID3 editors - tagging a tree with find and xargs
The other command line utilities tested, id3tool, id3ren and id3v2 (all from Ubuntu's repository for 9.10 Karmic Koala) did not work at all. Note that there probably are other ways of making these editors work for the use case.
I needed to tag a whole directory tree of MP3 files with the genre tag "Salsa". This blog post is about whether the above mentioned command line tagging tools worked as expected with find and xargs to batch add a tag.
Now, a standard way in the shell on unixish systems to dig up files and pipe them to a command is something like this:
find -print0 -name "*.mp3"|xargs -0 tag-command --flags
- "find" finds all items and prints them out for you,
- the "-name "*.mp3" limits it to items ending in mp3,
- the "-print0" prints them in such a way that the next command in the chain does not get confused by any weird characters in the file names, achieved by putting a NULL character in between them. MP3 files often have weird file names
"xargs" then executes tag-command for each item that find finds. The "-0" flag is to unpack the NULL delimited items xargs gets from find.
Here are the results:
find -print0 -name "*.mp3"|xargs -0 id3tool -G=Salsa
Error is: id3tool: Can't open file "." for write.
id3tool misinterprets the item spec it got
find -print0 -name "*.mp3"|xargs -0 id3ren -genre Salsa
id3ren: id3_read_file: Error reading .: Is a directory
id3ren does the same
find -print0 -name "*.mp3"|xargs -0 id3v2 -g 143
fopen: .: id3v2: Is a directory
..and id3v2 too
eyeD3 seemed to work like a charm though:
find -print0 -name "*.mp3"|xargs -0 eyeD3 -G Salsa
a file.mp3 [ 4.29 MB ]
-------------------------------------------------------------------------------
Time: 03:14 MPEG1, Layer III [ ~193 kb/s @ 44100 Hz - Joint stereo ]
-------------------------------------------------------------------------------
Setting track genre: Salsa
Writing tag...
ID3 v2.3:
title: artist:
album: year: None
track: genre: Salsa (id 143)
UserTextFrame: [Description: Tagging time]
2010-07-27T21:18:38
...and eyeD3 just chugged on like that, adding tags. Actually it added tags to my *.m3u playlists as well, even though these were not included in the output from find. eye3D seems to work recursively by default, and somehow it managed to divine something it deemed useful from find's output.
I used eye3D's --remove-tags flag to remove the tags from the playlists.
Link - Wrapping mplayer in python
Sometimes I'd just like to make a video player/editor with the functions I need and nothing else: Slow motion, select a short piece and save it. If I ever get around to that, this may be a good starting point:
This article will just focus on creating a really simple Media Player that you can play movies with.
Läs mer: wxPython: Creating a Simple Media Player « The Mouse Vs. The Python
Yes please mama
I asked a friend a question yesterday, about how to remember rhythms. This afaik is for samba: "Yes please mama, I want cake, mama". I guess there are many rhythms in samba, though,
One of our patterns with a phrase to help you remember it: "Yes please mama, I want cake, mama!" When you play it, "mama" is played with open notes, all the rest are closed. See, easy!
Mp3cat - gets only the data part of the mp3
One's mp3 files have a tendency to get duplicated over different computers, hard disks and portable players. Some of the tags may also get edited on some copies but not others. Since tags are stored in the file there is no easy way to detect which mp3s are identical music-wise by just hashing the file with md5, sha-1 or other hashing algorithm. Instead you need to run the hashing on only the data part.
I have not found any modules for python that does this. I have found one python module which will report the byte offset of where the data starts, but I guess that only works if the meta data are in the start of the file. The only command line tool I have found that can extract the data part is mp3cat:
This is the mp3cat home page. Download the latest release tarball mp3cat-0.4.tar.gz or (better) check out the current version from my subversion repository: http://svn.tomclegg.net/repos/trunk/mp3cat
My intial evaluation is favorable, i.e. an md5 hash of two files with different meta data but same music data gets the same hash value. Found mp3cat via this blog post:
The author wants the same thing I am searching for–the ability to generate a checksum of the audio stream and store it in the file header as a tag. Furthermore, he mentions his use of mp3cat! I pulled down a copy of mp3cat and compiled it on my archive box. Then the fun began
Tim's Mind Organized » Checksum mp3 audio frames (the data and not the headers)
There has at least existed one java program that does the data extraction and hashing in one fell swoop. It is mentioned in this discussion, but the download link does not seem to work.
Update 2010-07-25
I now looked into the CPAN archive, and as usual there is a Perl module, Audio::Digest::MP3 that does exactly what you want :-)
Audio::Digest::MP3 - Get a message digest for the audio stream out of an MP3 file (skipping ID3 tagsAudio::Digest::MP3 - search.cpan.org
Untested by me so far.
Recent Comments
2010-08-09 20:40:58
2010-07-19 18:42:38
2010-07-19 17:20:37
2010-07-07 12:01:32
2010-06-08 11:33:28
2010-05-05 13:11:30
2010-04-29 00:22:20
2010-04-15 22:06:20
2010-04-13 11:19:12
2010-04-09 22:29:01