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
[ | |
{ | |
"lng" : "4.1428327560425", | |
"lat" : "52.01150069904", | |
"country" : "Netherlands", | |
"name" : "'s-Gravenzande" | |
}, | |
{ | |
"lng" : "3.3628463745118", | |
"lat" : "51.370923071145", |
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 re | |
import nltk | |
sent_detector = nltk.RegexpTokenizer(u'[^ !?。]*[!?。.\n]') | |
sents = sent_detector.tokenize(u" 原子番号92のウランより重い元素は全て人工的に合成され、118番まで発見の報告がある。\ | |
113番については、理研と米露の共同チームがそれぞれ「発見した」と報告し、国際純正・応用化学連合と国際純粋・応用物理学連合の合同作業部会が審査していた。両学会は「データの確実性が高い」ことを理由に、理研の発見を認定し、31日に森田さんに通知した。未確定だった115番と117番、118番の新元素は米露チームの発見を認めた。森田さんは「周期表に名前が残ることは感慨深い。大勢の共同研究者にまずは感謝したい」と述べた。 \n") | |
for s in sents: | |
print s, len(s) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# from vscode_audio import * | |
# Audio(audio_numpy_array, sr=SR) | |
import IPython.display | |
import numpy as np | |
import json | |
def Audio(audio: np.ndarray, sr: int): | |
""" | |
Use instead of IPython.display.Audio as a workaround for VS Code. |
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
CMItemCount numSamplesInBuffer = CMSampleBufferGetNumSamples(buffer); | |
AudioBufferList audioBufferList; | |
CMSampleBufferGetAudioBufferListWithRetainedBlockBuffer( | |
buffer, | |
NULL, | |
&audioBufferList, | |
sizeof(audioBufferList), | |
NULL, |
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
# see: https://www.daniweb.com/programming/software-development/code/216976/play-a-midi-music-file-using-pygame | |
# sudo pip install pygame | |
# on ubuntu | |
# sudo apt-get install python-pygame | |
import pygame | |
def play_music(music_file): |
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 re | |
emoji_pattern = re.compile( | |
u"(\ud83d[\ude00-\ude4f])|" # emoticons | |
u"(\ud83c[\udf00-\uffff])|" # symbols & pictographs (1 of 2) | |
u"(\ud83d[\u0000-\uddff])|" # symbols & pictographs (2 of 2) | |
u"(\ud83d[\ude80-\udeff])|" # transport & map symbols | |
u"(\ud83c[\udde0-\uddff])" # flags (iOS) | |
"+", flags=re.UNICODE) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder