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 xml.etree.ElementTree import * | |
import urllib.parse | |
import os | |
import shutil | |
filename = "<put your itunes library dir>/iTunes Library.xml" | |
walkman_music_root = '/Volumes/WALKMAN/MUSIC' | |
# load itunes library xml | |
def load_ituneslib(fname): |
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
sample = [ | |
{'name': 'hoge', 'val1': 10}, | |
{'name': 'fuga', 'val1': 30}, | |
] | |
# filter #1 | |
filter(lambda x: x['val1'] > 20, sample) | |
# => [{'val1': 30, 'name': 'fuga'}] | |
# filter #2 |
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
<?xml version="1.0"?> | |
<!DOCTYPE module PUBLIC | |
"-//Puppy Crawl//DTD Check Configuration 1.3//EN" | |
"http://checkstyle.sourceforge.net/dtds/configuration_1_3.dtd"> | |
<!-- | |
Checkstyle configuration that checks the Google coding conventions from Google Java Style | |
that can be found at https://google.github.io/styleguide/javaguide.html. | |
Checkstyle is very configurable. Be sure to read the documentation at |
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
# ignore all idea settings | |
.idea/* | |
*.iws | |
*.iml | |
*.ipr | |
# gradle project minimum | |
!.idea/gradle.xml | |
!.idea/misc.xml |
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 pyspark.sql import functions as F | |
df = spark.createDataFrame([(1, 1.2345), (2, 9.8765)], ["col1", "col2"]) | |
# 型のキャスト | |
df.select(F.col("col2").cast("int")).show() | |
# ↓ | |
# +----+ | |
# |col2| | |
# +----+ |
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
# 技術書典: 頒布物支払い状況 をCSVにする使い捨てスクリプト | |
# わたしの場合はこれでCSV変換できましたが、 | |
# どんなパターンがあるか分からないので、変換できるかは分からないです | |
# | |
# 1. 頒布物支払い状況をChromeで開く | |
# 2. ファイル→ページを別名で保存 | |
# 3. 保存したhtmlをorder.htmlに名称変更 | |
# 4. pip install beautifulsoup4 | |
# 5. pip install html5lib | |
# 6. このファイルをorder.htmlと同じディレクトリに置く |
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
# im@sparql to atok dic | |
# im@sparqlからアイドルの姓名を取り出し、ATOKに単語登録するためのスクリプト | |
# | |
# 登録手順: | |
# 1. pip install SPARQLWrapper | |
# 2. python imasparql2atok.py | sort | uniq | nkf -w16 -Lw > imasparql-dic.txt | |
# 3. atok -> 辞書ユーティリティー | |
# 4. ツール -> ファイルから登録削除 | |
# 5. 単語ファイルに、imasparql-dic.txtを選択して、登録ボタンを押す |
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 schema: <http://schema.org/> | |
PREFIX imas: <https://sparql.crssnky.xyz/imasrdf/URIs/imas-schema.ttl#> | |
SELECT (concat(group_concat(?nm1; separator=''), ' ', group_concat(?nm2; separator=''), ' ', group_concat(?nm3; separator='')) as ?h) | |
WHERE { | |
{ SELECT (1 as ?g) (?nm as ?nm1) ("" as ?nm2) ("" as ?nm3) | |
WHERE { ?s imas:nameKana ?nm. FILTER (strlen(str(?nm)) = 5) } | |
ORDER BY RAND() LIMIT 1 | |
} UNION { SELECT (1 as ?g) ("" as ?nm1) (?nm as ?nm2) ("" as ?nm3) | |
WHERE { ?s imas:nameKana ?nm. FILTER (strlen(str(?nm)) = 7) } | |
ORDER BY RAND() LIMIT 1 |
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
# im@sparql to gboard dic | |
# im@sparqlからアイドルの姓名を取り出し、GBoardに単語登録するためのスクリプト | |
# | |
# 登録手順: | |
# 1. pip install SPARQLWrapper | |
# 2. python imasparql2gboard.py | sort | uniq > dictionary.txt | |
# 3. zip PersonalDictionary.zip dictionary.txt | |
# 3. Android端末に転送(GoogleDriveとか、OneDriveとかを使えば良い) | |
# 4. 以降はAndroid端末で操作 | |
# 4.1. 設定→システム→言語と入力→仮想キーボード→GBoard→単語リスト→日本語→メニューからインポート |
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
<template> | |
<div class="hello"> | |
<input type="text" v-model="searchText"></input> | |
<ul> | |
<li v-for="item in candidates">{{ item.text }}</li> | |
</ul> | |
</div> | |
</template> | |
<script> |
OlderNewer