Skip to content

Instantly share code, notes, and snippets.

@mineo
mineo / listen.json
Last active September 29, 2015 10:30
Submit this with something like
http POST "http://listenbrainz.org/1/submit-listens" "Authorization: Token $yourtokenhere" < listen.json
http is https://github.com/jkbrzt/httpie
listened_at are the seconds since epoch
listen_type can be single, import or playing_now, only import is allowed to contain more than one listen in the payload.
INSERT INTO statistics.statistic_event (date, title, link, description)
VALUES
('2016-02-22', 'New MusicBrainz design',
'https://blog.musicbrainz.org/2016/02/22/server-update-2016-02-22/',
'MusicBrainz itself has gotten a new design to better match the rest of the *Brainz family.'),
('2015-12-28', 'Edit note notifications',
'https://blog.musicbrainz.org/2015/12/28/server-update-2015-12-28/',
'A new banner message will now notify users whenever they receive a new edit note.'),
('2015-11-30', 'More auto-edits',
'https://blog.musicbrainz.org/2015/11/30/server-update-2015-11-30/',
explain analyze SELECT area.gid, url.gid, url.url
FROM l_area_url
JOIN link AS l
ON l_area_url.link=l.id
JOIN link_type AS lt
ON lt.id=l.link_type
JOIN area
ON entity0=area.id
JOIN url
ON l_area_url.entity1=url.id
# coding: utf-8
import json
path = "/home/wieland/Downloads/Unpack-6438/listenbrainz-listens-dump-20180315-000401/listens/0/04/04d5f670-7c04-4dcf-801c-89ff231f3a96.listens"
sc = spark.sparkContext
lines = sc.textFile(path)
from pyspark.sql import Row
listens = lines.map(lambda listen: Row(**json.loads(listen)))
print(listens.count())
from pyspark.sql.types import *
fields = [
************* Module picard.similarity
picard/similarity.py:55: [R1704(redefined-argument-from-local), similarity2] Redefining argument with the local name 'a'
picard/similarity.py:58: [R1704(redefined-argument-from-local), similarity2] Redefining argument with the local name 'b'
************* Module picard.cluster
picard/cluster.py:551: [R0201(no-self-use), ClusterEngine.can_refresh] Method could be a function
************* Module picard.track
picard/track.py:241: [R0201(no-self-use), Track._get_ignored_folksonomy_tags] Method could be a function
************* Module picard.file
picard/file.py:103: [W0221(arguments-differ), File.load] Parameters differ from overridden 'load' method
picard/file.py:389: [R0201(no-self-use), File._save_images] Method could be a function