Skip to content

Plutonic Rainbows

Sign Libra - Closer to the Equator

A wonderful little gem that puts me in mind of all those late 80s New-Age albums that appeared on esoteric electronic labels such as IC Innovative Communications and Narada. If you remember those types of albums, you'll feel right at home with this. The EP is available on the Antinote Label. Bleep also have a vinyl release.

CV & Jab - Zin Taylor's Thoughts Of A Dot As It Travels A Surface

Boomkat:

CV & JAB is Christina Vantzou and John Also Bennett, two artists that might already be familiar to many of you from their individual work over the years for the Kranky and Spectrum Spools labels. Together they have made this slowly engrossing album for Shelter Press - who else - perhaps one of the most elusive, uncanny and multi-layered “Ambient” albums we’ve heard in what feels like a long time, a worthy follow-up to a frankly astonishing sequence of releases on the label that started with Felicia Atkinson’s modern classic 'Hand In Hand'. If you’re into anything from Chris Watson’s field recordings to Vangelis and Badalamenti at their most romantic and evocative, or even Boards of Canada’s early forays into wildlife documentary pastiche, this one will sooth your mind like nothing else.

Don't let the very pretentious title put you off. This is excellent stuff. Vinyl and Digital are available here.

Flagging Extremist Content

Great article from ASI Data Science on Binary Classification and ROC Curves.

It is well known that online propaganda from terrorist organisations plays a key part in radicalisation in Europe and the UK. In collaboration with the UK Home Office, we recently developed and tested an AI algorithm designed to detect such propaganda on the web.

Following media coverage of the classifier (see, for example, BBC News and The Guardian), there has been much talk of how it works and its performance. In this post, without exposing the inner workings of the algorithm, we'll do our best to outline the general approach we took to design the classifier. We also specify precisely the metrics used and the performance achieved by the classifier.

Counting Things

This (fairly) simple few lines calculates the days between two dates - in this case, the 4th of July 2020. That's 888 days as of February 13th 2018.

from datetime import *

today = date.today()
future = date(2020,07,20)

diff = future - today

print "There are %s days left." % diff.days

Loan Calculator

Using the Functions available for Maths, I built a simple loan calculator -including the elif and else statements so that Python can make a decision. I am sure there are much simpler ways of doing this but as I am still learning, it's all I can do right now.

# -*- coding: utf-8 -*-

def amount_to_borrow(loan_request, twelve_months):
    print "Calculating 12 months interest totalling £{0:.2f}.\n".format (twelve_months)
    return loan_request + twelve_months


loan_request = (float(raw_input("How much do you want?\nEnter Amount: ")))

monthly_payments = loan_request / 12

twelve_months = monthly_payments + 15.00 * 12

interest_payments = 15 * 12

total = amount_to_borrow(loan_request, twelve_months)

raw_input("Press Return to get your decision.\n")

credit_limit = 5000

print "The cost of your loan is £{0:.2f}\n".format (total)
print "That's £{0:.2f} in 12 monthly payments".format (monthly_payments)
print "And £{0:.2f} in Interest Payments over 12 months.\n".format (interest_payments)
print "The limit for your account is £{0:.2f}\n".format (credit_limit)

if total < credit_limit:
    print "Your loan is approved.\n"

elif total > credit_limit:
    print "Sorry. You are not approved.\n"

else:
    print "Please come into the branch to discuss it.\n"

Using Functions to do Maths

Mathematics isn't really something I'm good at but luckily, Python makes it easy when using functions. I'm also using .format to correctly show decimal places - as well as # -*- coding: utf-8 -*- so that Python can print currency symbols..

# -*- coding: utf-8 -*-
def add(a, b, c):
    print "\nADDING %d + %d + %d" % (a, b, c)
    return a + b + c

price = add(12, 12, 12);print "The price is £{0:.2f}\n".format (price)

def multiply(a, b):
    print "MULTIPLYING %d * %d" % (a, b)
    return a * b

multiply_price = multiply(10, 10);print "The price is £{0:.2f}\n".format (multiply_price)

def subtracting(a, b):
    print "SUBTRACTING %d - %d" % (a, b)
    return a - b

subtract_price = subtracting(100, 50);print "The price is £{0:.2f}\n".format (subtract_price)

def division(a, b):
    print "DIVIDING %d / %d" % (a, b)
    return a / b

division_price = division(90, 2);print "The price is £{0:.2f}\n".format (division_price)

Rewinding

This will not sink in. Have to keep looking at it over and over again. I'm just not clever enough, I think. The only way to make it stick is to look at the previous variables etc.

from sys import argv

script, input_file = argv

def print_all(f):
    print f.read()

def rewind(f):
    f.seek(0)

def print_a_line(line_count, f):
    print line_count, f.readline()

current_file = open(input_file)

print "First let's print the whole file:\n"

print_all(current_file)

print "\nNow let's rewind. Just like a tape."

rewind(current_file)

print "Let's print three lines:\n"

current_line = 1
print_a_line(current_line, current_file)

current_line = current_line + 1
print_a_line(current_line, current_file)

current_line = current_line + 1
print_a_line(current_line, current_file)

print "\n"

Defining a Function

Ended the week with revision. Have to build this into learning if I want to remember what I've studied.

Defining a function:

def print_three(arg1, arg2, arg3):
    print "Name: %r, Surname: %r, Country: %r" % (arg1, arg2, arg3)

print_three("Elle", "Macpherson", "Australia")

Copying Files

Learning how to copy files with Python. The script also checks the file size in bytes.

from sys import argv
from os.path import exists

script, from_file, to_file = argv

print "Let's copy from %s to %s." % (from_file, to_file)

in_file = open(from_file)
indata = in_file.read()

print "The size is %s bytes in length." % len(indata);
print "Does the target file exist? %r" % exists (to_file)

raw_input()

out_file = open(to_file, 'w')
out_file.write(indata)

in_file.close()
out_file.close()

print "All done."

Kuniyuki Takahashi - Early Tape Works 1986 - 1993 Volume 1

Bleep:

The Amsterdam crew delve deep into the archives of Japanese deep house sensation Kuniyuki to bring us six entrancing early compositions. MFM027 collects some of the choice early recordings from a man known for his expert sound design and earthy, percussive leaning dance tracks. The songs that Tako & Jamie Tiller have opted for show a rough and slightly amateur sounding approach to the stylistic traits that would go on to define a career. Blurring the lines between kosmiche, ambient, dub and electro this record is top quality as you’ve no doubt come to expect from the label.

Vinyl & Digital from Bleep