This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select id, mbid, (length/60)::text || ':' || (length%60)::text from submission where id in (select distinct submission_id from track_mbid_source where track_mbid_id =1231384); | |
id | mbid | ?column? | |
----------+--------------------------------------+---------- | |
24884813 | 6afd8432-f56e-44b0-8331-ce62fdf408fc | 4:1 | |
16685155 | 06d955ce-b888-4bdc-a15f-b206a2f7ac77 | 4:3 | |
1504569 | 5f5335d6-9151-42a9-a3ee-b3ba756228a8 | 4:3 | |
2959818 | 6afd8432-f56e-44b0-8331-ce62fdf408fc | 4:1 | |
11888389 | 5f5335d6-9151-42a9-a3ee-b3ba756228a8 | 4:3 | |
8861348 | 5f5335d6-9151-42a9-a3ee-b3ba756228a8 | 4:3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install cpanminus liblocal-lib-perl libossp-uuid-perl | |
sudo apt-get install libxml2-dev libpq-dev libexpat1-dev | |
echo 'eval `perl -Mlocal::lib`' >>~/.bashrc | |
eval `perl -Mlocal::lib` | |
perl Makefile.PL | |
cpanm -n . | |
sudo apt-get install postgresql-server-dev-8.4 gcc-4.4 libicu-dev postgresql-contrib-8.4 | |
cd postgresql-musicbrainz-collate/ | |
make PG_CONFIG=/usr/lib/postgresql/8.4/bin/pg_config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# PROVIDE: fpserver | |
# KEYWORD: shutdown | |
# | |
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf to | |
# enable fpserver: | |
# | |
# fpserver_enable (bool): Set to NO by default. Set it to YES to | |
# enable fpserver. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
./configure \ | |
--prefix=$PREFIX \ | |
--enable-cross-compile \ | |
--arch=$ARCH \ | |
--target-os=darwin \ | |
--cc="/usr/bin/gcc-4.0" \ | |
--extra-ldflags="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -arch $ARCH" \ | |
--extra-cflags="-isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -arch $ARCH" \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import chromaprint | |
popcnt_table_8bit = [ | |
0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5, | |
1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6, | |
1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6, | |
2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7, | |
1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6, | |
2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def format_time(secs): | |
return "%d:%02d" % (secs / 60, secs % 60) | |
def invert(arr): | |
""" | |
Make a dictionary that with the array elements as keys and | |
their positions positions as values. | |
>>> invert([3, 1, 3, 6]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my $tree = HTML::TreeBuilder::XPath->new; | |
$tree->parse_content($response->content); | |
my @elements = $tree->findnodes("//div[id='foo']"); | |
my $content = @elements > 0 ? $elements[0]->as_HTML : ''; |
NewerOlder