Skip to content

Instantly share code, notes, and snippets.

View bowd's full-sized avatar
always.

boqdan bowd

always.
View GitHub Profile
/**
* @file session_file.h
* @Author Bogdan Dumitru ([email protected])
* @date July, 2012
* @brief Functions related to the processing of Ableton Live Session files (.als)
*
* The functions regarding processing of ALS files. This is currently devided in
* three subsections with appropriate prefixes:
*
* (1) Regarding specifically to ALS files and entities:
def write(type, attributes, plan)
geo = resolve_geo(attributes[:remote_addr])
listener =
if attributes[:anonymous] == true
-1
else
( attributes[:user_id].to_i == 0 ? nil : attributes[:user_id].to_i )
end
Updates:
totals
{ 'b' }
tracks
{ 't', 'b', 'u' } # This is theoretically irrelevant
# because track links 1-to-1 to user
{ 't', 'b' }
@bowd
bowd / Access Pattern
Created October 29, 2010 14:39
Access patterns
Updates:
totals
{ 'b' }
tracks
{ 't', 'b', 'u' } # This is theoretically irrelevant
# because track links 1-to-1 to user
{ 't', 'b' }
Indexes for [apps/track]
_id_
t_1
t_-1_b_-1_v_-1_c_-1
t_-1_b_-1_v_-1_d_-1
t_-1_b_-1_v_-1_f_-1
t_-1_b_-1_v_-1_p_-1
Indexes for [apps/track/slim]
_id_
t_1
if exists?(referrer = event[:referrer])
if ((matches = referrer.match(/([^\#]+)\#(.+)?\:(.+)?/))) && matches.size == 4
detail = "#{DETAILS}.#{escape(matches[2])}.#{escape(matches[3])}.#{PLAYS}"
# Here we split the stuff in the specialised referrer
# i.e. facebook.com#p:AwsomePage
# And we increment the detail below, but in the REFERRER for the update
# referrer is passed instead of matches[1] ( which is just the facebook.com )
buckets.each do |bucket|
@referrers_per_track.update({ TRACK => track_id, BUCKET => bucket, REFERRER => referrer }, {
'$inc' => {