similarities between "queen-woman+man" and ... = {'queen': 0.7664688552859836, 'woman': 0.16067344014964902, 'man': 0.643216410618745, 'king': 0.5296803458540953, 'knight': 0.36225247833752694, 'carpenter': 0.7134908064255635, 'baker': 0.723708193109565, 'girl': 0.734322206946502, 'boy': 0.7525008550380998}
similarities between "queen-girl+boy" and ... = {'queen': 0.9750610709453384, 'woman': 0.5392273263146471, 'man': 0.5579780738003502, 'king': 0.5312961528030734, 'knight': 0.5244125308085369, 'carpenter': 0.8835927517707559, 'baker': 0.9011729720423287, 'girl': 0.9227513575082695, 'boy': 0.9679081680297743}
similarities between "queen-woman-girl+man+boy" and ... = {'queen': 0.7059391012944155, 'woman': 0.11622645526937725, 'man': 0.6346237227600416, 'king': 0.5228061118283761, 'knight': 0.3225914898607214, 'carpenter': 0.6156882192910788, 'baker': 0.6321456800653157, 'girl': 0.6540596727195828, 'boy': 0.7065316024823556}
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 os | |
import re | |
import logging | |
def rename_it(dirpath, path_suffix, is_dir): | |
pattern = r"([a-zA-Z0-9\s\+\&\']+)\s([a-z0-9]{32})" | |
match = re.match(pattern, path_suffix) | |
if match is not None: | |
if is_dir: |
Voting Mechanisms and Weighted Analysis Dilemmas, for Portfolio, Crowdfundig, Majority overshadowing Problem and more.
Tweet: https://twitter.com/GWierzowiecki/status/1701162675084947892
A decentralized system is envisioned wherein fractional owners of a portfolio contribute to decision-making regarding the distribution of funds among tokens. As a simple example, consider tokens named A, B, C, D...
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
@prefix dc: <http://purl.org/dc/elements/1.1/>. | |
@prefix ex: <http://example.org/stuff/1.0/> . | |
@prefix foaf: <http://xmlns.com/foaf/0.1/>. | |
@prefix owl: <http://www.w3.org/2002/07/owl#>. | |
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. | |
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>. | |
@prefix vs: <http://www.w3.org/2003/06/sw-vocab-status/ns#>. | |
@prefix wot: <http://xmlns.com/wot/0.1/>. | |
@prefix xml: <http://www.w3.org/XML/1998/namespace>. | |
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>. |
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
# ffmpeg -i foo.m4a foo.wav | |
from pyannote.audio import Pipeline | |
pipeline = Pipeline.from_pretrained("pyannote/speaker-diarization") | |
diarization = pipeline("foo.wav") | |
# RTTM format https://catalog.ldc.upenn.edu/docs/LDC2004T12/RTTM-format-v13.pdf | |
with open("foo.rttm", "w") as rttm: | |
diarization.write_rttm(rttm) |
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
version: "3.8" | |
services: | |
chrome: | |
network_mode: "host" | |
image: jess/chrome | |
environment: | |
DISPLAY: 'unix:0' | |
volumes: | |
- /run/dbus/system_bus_socket:/run/dbus/system_bus_socket |
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
.block-children { | |
border-left-width: var(--ls-block-bullet-threading-width); | |
} | |
.block-content-wrapper { | |
position: relative; | |
} | |
.bullet-container { | |
height: 14px !important; |
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
#![allow(dead_code)] | |
// playground: https://gist.github.com/rust-play/6d697a29901d4b82cc8b184526d4b8f1 | |
fn all_postfixes_sorted(arr: &[&str]) -> Vec<String> { | |
let mut postfixes: std::collections::HashSet<String> = std::collections::HashSet::new(); | |
for &w in arr { | |
for start_idx in 0..(w.chars().count()) { | |
let slice: &str = &w[start_idx..]; | |
let w = String::from(slice); |
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
#![allow(dead_code)] | |
// https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=bda017580640d3b70ea211bec7e9038b | |
// Task: sorted postfixes for given list of strings | |
// Example: bcd -> bcd,cd,d | |
// Example: abc,bcd,xyz -> abc,bc,bcd,c,cd,d,xyz,yz,z | |
fn all_postfixes_sorted(arr: &[&str]) -> Vec<String> { | |
let mut postfixes: std::collections::HashSet<String> = std::collections::HashSet::new(); | |
for &w in arr { |
NewerOlder