Skip to content

Instantly share code, notes, and snippets.

@ssrosa
ssrosa / clean_up.py
Last active December 22, 2019 04:28
df.drop([0], axis = 0, inplace = True) #Drop column descriptors
#Index the df with datetimes
df.set_index(pd.to_datetime(df['timestamp']), inplace = True)
#Reset time zone to US Eastern time
df.index = df.index.tz_convert('US/Eastern')
#Drop unnecessary columns
df.drop(['timestamp', 'story_id'], axis = 1, inplace = True)
#Change remaining columns to int type
df = df.astype(int)
#Draw a plot of the data set
@cavedave
cavedave / genreloud.rmd
Last active February 17, 2025 16:55
Graph of how loud Music Genres are
---
title: "Loudness by Genre"
output: html_notebook
---
An analysis of music by Genre to see if loudness varies
It was believed that online streaming platform have reduced loudness. But does this have the same effect accross all genres of music?
@TAdeJong
TAdeJong / dask_array_compute_visualize.ipynb
Last active November 9, 2023 09:32
A simple notebook show casing a quick hack to visualize a dask array computation as it completes.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#lang rosette/safe
(require rosette/lib/angelic ; provides `choose*`
rosette/lib/destruct) ; provides `destruct`
; Tell Rosette we really do want to use integers.
(current-bitwidth #f)
// The missing *Map operator. Acts like a pushbutton toggle
// wrt to a returned Observable - one will be canceled if its running,
// one will only be started if it wasn't running!
export const toggleMap = (
spawner: Spawner,
mapper = (outer, inner) => inner
) => {
return function(source) {
return new Observable(observer => {

split-polywave.sh

Use case

I have a RØDECaster Pro, which records a multitrack file in the polyWAV format. It's kind of a pain to work with in editors, so I wrote this simple little ffmpeg script to split out the tracks easily.

Known issue

Probably needs to check to make ffmpeg is installed Doesn't retain chapter markers from the original file

@JonathanReeve
JonathanReeve / exercises-analysis.ipynb
Created September 8, 2019 19:44
Exercises in Style Analysis
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Introduction

I was recently asked to explain why I felt disappointed by Haskell, as a language. And, well. Crucified for crucified, I might as well criticise Haskell publicly.

First though, I need to make it explicit that I claim no particular skill with the language - I will in fact vehemently (and convincingly!) argue that I'm a terrible Haskell programmer. And what I'm about to explain is not meant as The Truth, but my current understanding, potentially flawed, incomplete, or flat out incorrect. I welcome any attempt at proving me wrong, because when I dislike something that so many clever people worship, it's usually because I missed an important detail.

Another important point is that this is not meant to convey the idea that Haskell is a bad language. I do feel, however, that the vocal, and sometimes aggressive, reverence in which it's held might lead people to have unreasonable expectations. It certainly was my case, and the reason I'm writing this.

Type classes

I love the concept of type class

@berinhard
berinhard / setup-foxdot-processing.md
Last active November 9, 2023 09:34
Setup de Algorave com Pythonn
@redknightlois
redknightlois / ralamb.py
Last active August 9, 2023 20:50
Ralamb optimizer (RAdam + LARS trick)
class Ralamb(Optimizer):
def __init__(self, params, lr=1e-3, betas=(0.9, 0.999), eps=1e-8, weight_decay=0):
defaults = dict(lr=lr, betas=betas, eps=eps, weight_decay=weight_decay)
self.buffer = [[None, None, None] for ind in range(10)]
super(Ralamb, self).__init__(params, defaults)
def __setstate__(self, state):
super(Ralamb, self).__setstate__(state)