A few tips for pd development on macOS:
Pd.app is not enabled for debugging, thus the app needs to be re-signed with the get-task-allow entitlement enabled:
- obtain the current entitlements with:
#include <string> | |
#include <vector> | |
#include <map> | |
#include <cmath> | |
#include <random> | |
#include <chrono> | |
#include <iostream> | |
#include <Eigen/Geometry> |
Since communication over ROS2 across WSL2 border doesn't work out of the box, here's my notes for getting it to work.
Make sure to select cyclonedds RMW on both ends:
(Linux)
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
(Windows)
#!/usr/bin/env python3 | |
market, period = 'XBTEUR', 60 | |
imgw, imgh = 22, 22 | |
import krakenex | |
from pykrakenapi import KrakenAPI | |
api = krakenex.API() | |
k = KrakenAPI(api) | |
ohlc, last = k.get_ohlc_data(market, period) | |
a = ohlc.to_numpy() | |
a = a[:imgw,:] |
correct_position(A, B, C, S) :- S = [A, _, _], \+ member(B, S), \+ member(C, S). | |
correct_position(A, B, C, S) :- S = [_, B, _], \+ member(A, S), \+ member(C, S). | |
correct_position(A, B, C, S) :- S = [_, _, C], \+ member(A, S), \+ member(B, S). | |
wrong_position(A, B, C, S) :- (S = [_, A, _] ; S = [_, _, A]), \+ member(B, S), \+ member(C, S). | |
wrong_position(A, B, C, S) :- (S = [B, _, _] ; S = [_, _, B]), \+ member(A, S), \+ member(C, S). | |
wrong_position(A, B, C, S) :- (S = [C, _, _] ; S = [_, C, _]), \+ member(A, S), \+ member(B, S). | |
two_wrong_position(A, B, C, S) :- S \= [A, _, _], S \= [_, B, _], member(A, S), member(B, S), \+ member(C, S). | |
two_wrong_position(A, B, C, S) :- S \= [A, _, _], S \= [_, _, C], member(A, S), member(C, S), \+ member(B, S). |
# solution to puzzle https://www.youtube.com/watch?v=LyyHt7NfBxI | |
# "can you make 24 from 3 3 8 8 using only + - * / ( ) ?" | |
class Add: | |
def __init__(self, a, b): | |
self.a, self.b = a, b | |
def eval(self): | |
return self.a.eval() + self.b.eval() | |
def __repr__(self): | |
return '({!r} + {!r})'.format(self.a, self.b) |
from spotipy.oauth2 import SpotifyClientCredentials | |
import spotipy | |
import json | |
import urllib | |
import urllib.request | |
import urllib.parse | |
from bs4 import BeautifulSoup | |
import re | |
from unidecode import unidecode | |
import youtube_dl |
def dist(x, y): | |
return sum((xi-yi)**2 for xi,yi in zip(x,y)) | |
class KDTree: | |
class Node: | |
def __init__(self, x, payload=None, axis=0): | |
self.x, self.axis, self.payload = x, axis, payload | |
self.l, self.r = None, None | |
def insert(self, x, payload=None): |
#include <QtCore> | |
class SignalSpy { | |
static QThreadStorage<bool> entered; | |
static void signalBegin(QObject *caller, int signalIndex, void **); | |
static void slotBegin(QObject *caller, int index, void **); | |
public: | |
static void start(); | |
}; |