Sample code for making drawing playground
A Pen by Augsorn Chanklad on CodePen.
| from multiprocessing import Pool | |
| from multiprocessing import cpu_count | |
| def f(x): | |
| while True: | |
| x*x | |
| if __name__ == '__main__': | |
| processes = cpu_count() | |
| pool = Pool(processes) |
| version: '4' | |
| # As of JanusGraph 0.4.0, up to Cassandra 3.11 and Elasticsearch 6.x | |
| # are supported. | |
| # | |
| # Here's the compatibility matrix: | |
| # https://docs.janusgraph.org/latest/version-compat.html | |
| # | |
| # Here's the compatibility data for ScyllaDB: | |
| # http://docs.scylladb.com/using-scylla/cassandra-compatibility/ |
| import xml.etree.ElementTree as ET | |
| import pandas as pd | |
| tree = ET.parse('Restaurants_Train.xml') | |
| root = tree.getroot() | |
| labeled_reviews = [] | |
| for sentence in root.findall("sentence"): | |
| entry = {} | |
| if sentence.find("aspectTerms"): |
| # curl -L mini.conda.ml | bash | |
| source ~/.bash_profile | |
| conda create --name nlp python=3.6 | |
| source ~/.bash_profile | |
| conda activate nlp | |
| pip install spacy | |
| conda install tensorflow | |
| conda install -c pandas | |
| conda install -c jupyter | |
| pip install textacy |
| SELECT ?PermID ?hasPermId ?rank ?prefLabel ?hasReportedTitle ?hasHolder ?hasPositionType ?hasPublicationStatus ?isPositionIn ?to ?familyName ?givenName ?holdsPosition ?hasTenureInOrganization ?additionalName ?hasGender ?bday ?honorificPrefix ?from ?hasQualification ?preferredName ?honorificSuffix ?withDegree ?fromInstitutionName ?inSubject ?isTenureIn ?dateOfDeath | |
| WHERE { OPTIONAL { ?PermID <http://permid.org/ontology/common/hasPermId> ?hasPermId } | |
| OPTIONAL { ?PermID <http://permid.org/ontology/person/rank> ?rank } | |
| OPTIONAL { ?PermID <http://www.w3.org/2004/02/skos/core#prefLabel> ?prefLabel } | |
| OPTIONAL { ?PermID <http://permid.org/ontology/person/hasReportedTitle> ?hasReportedTitle } | |
| OPTIONAL { ?PermID <http://permid.org/ontology/person/hasHolder> ?hasHolder } | |
| OPTIONAL { ?PermID <http://permid.org/ontology/person/hasPositionType> ?hasPositionType } | |
| OPTIONAL { ?PermID <http://permid.org/ontology/common/hasPublicationStatus> ?hasPublicationStatus } | |
| OPTIONA |
| #!/usr/bin/env python | |
| """ | |
| Convert CSV file to libsvm format. Works only with numeric variables. | |
| Put -1 as label index (argv[3]) if there are no labels in your file. | |
| Expecting no headers. If present, headers can be skipped with argv[4] == 1. | |
| """ | |
| import sys |
Sample code for making drawing playground
A Pen by Augsorn Chanklad on CodePen.
| #!/usr/bin/perl | |
| # Program to filter Wikipedia XML dumps to "clean" text consisting only of lowercase | |
| # letters (a-z, converted from A-Z), and spaces (never consecutive). | |
| # All other characters are converted to spaces. Only text which normally appears | |
| # in the web browser is displayed. Tables are removed. Image captions are | |
| # preserved. Links are converted to normal text. Digits are spelled out. | |
| # Written by Matt Mahoney, June 10, 2006. This program is released to the public domain. |
Make some noise and record your voice! Deep Learning models will analyze and build a drum kit, then start generating drum patterns infinitely with your sound.
Convolutional Neural Network is used to analyze and classify audio segments based on spectrograms (demo codepen) and Recurrent Neural Network(LSTM) for generating drum sequences. Shout-out to Tero Parviainen! Rhythm generation part of this codepen is based on his amazing Neural Drum Machine
Built with magenta.js, tensorflow.js and p5.js by @naotokui_en
| import json | |
| import re | |
| import time | |
| from random import choice, random | |
| from typing import TextIO, Callable, Sequence, Tuple, Optional | |
| import click | |
| NAME = DATE = str | |
| SPAN_OFFSET = Tuple[int, int] |