2024-01-01から1年間の記事一覧
from pypdf import PdfReader, PdfWriter from reportlab.pdfgen import canvas from reportlab.pdfbase import pdfmetrics from reportlab.pdfbase.ttfonts import TTFont from reportlab.lib.colors import red,black import io import sys def main(): or…
モリサワの「BIZ UDフォント」のメモ www.morisawa.co.jp github.com github.com forest.watch.impress.co.jp
import openpyxl import PIL def main(): excel_file = './test_includeing_img.xlsx' wb = openpyxl.load_workbook(excel_file) for xlsx_img in wb['Sheet1']._images: #print( xlsx_img.path ) # sheet中の座標 print( xlsx_img.anchor._from.col, xlsx_i…
scikit-learn for pythonに頼っていましたが、実装してみました import math import collections def main(): """ TF-IDFとは? 各文書(document)にある各単語(term)が「その文書でどれくらい重要か」 https://atmarkit.itmedia.co.jp/ait/articles/2112/23/…
sql.jsは sqlite の javascript + web assembly版ですので、 先程のentryの続きとして、ブラウザでの全文検索を行います。 参考url SQLite FTS : trigram tokenizerでunigram&bigram検索までサポート-日本語全文検索 – スペース・アイ株式会社 【Python】SQ…
参考url 【Python】SQLite で日本語を全文検索するコード例【N-Gram, FTS4/FTS5】 | シラベルノート SQLite FTS5 Extension SQLite FTS : trigram tokenizerでunigram&bigram検索までサポート-日本語全文検索 – スペース・アイ株式会社 SQLite FTS5 拡張機…
先程のentryの続きです 参考url [JavaScript] kuromoji.js の辞書に単語を追加する | 「それなら猫の手で」 kuromoji.js + UniDic で形態素解析(辞書のビルド) #JavaScript - Qiita kuromoji.js + SudachiDict で形態素解析(辞書のビルド、IPADic・UniDic…
sudachipy for python (miniconda for win)による sudachiユーザ辞書作成 - end0tknr's kipple - web写経開発 sudachipy for python による sudachiユーザ辞書の利用 (形態素解析) - end0tknr's kipple - web写経開発 python版の形態素解析は、以前、上記ent…
Office365 (microsoft365)のmicrosoft listに添付されたexcelのリンクをクリックすると、 ファイルダウンロードにはならず、まずは、excel for webで起動されます。 selenium for pythonで excel for web からexcelファイルのダウンロードを 試みましたが、…
「区名・区域に変更のない天竜区のコードも変更」のようなケースで 市区町村コードが変わっていて驚きました https://www.city.hamamatsu.shizuoka.jp/ksh/imf/tkdk.html CODE 名称 old 22140-6 静岡県 浜松市天竜区 new 22137-6 〃
install SQL Server to Oracle Linux 8 - end0tknr's kipple - web写経開発 先日の上記entryの続きです。 今回は、SQL Server 2022 for Linux に対し、 utf-8で記載されたcsvファイルをbcpコマンドでインポートします。 目次 utf-8のデータベース作成と、そ…
参考url https://qiita.com/daichi_pd/items/1d9b4c8bef2579abc670 https://qiita.com/hamburg-love/items/ae819a7abf921af77376 https://itc-engineering-blog.netlify.app/blogs/rhel9-apache-php-postgresql install apache httpd php php-fpm $ sudo yum…
RHEL:Linux 上に SQL Server をインストールする - SQL Server | Microsoft Learn に記載の通りで全くOK。 以下は、インストールした sql serverのバージョン 1> SELECT @@VERSION 2> go - Microsoft SQL Server 2022 (RTM-CU12-GDR) (KB5036343) - 16.0.412…
先日のentryの続きとして、更に fastapi を経由し、 postgres への 生sqlを実行します import os import sys sys.path.append( os.path.dirname(__file__)+"/../lib" ) from fastapi.middleware.cors import CORSMiddleware import fastapi import json impo…
# -*- coding: utf-8 -*- import sqlalchemy db_conf = {"user":"postgres", "passwd":"", "host" :"localhost", "port" :"5432", "db" :"saawo" } def main(): sql = sqlalchemy.text("SELECT * FROM city WHERE code = :code") engine = sqlalchemy.create…
これまで、DBへの接続clientは、 http://www.hi-ho.ne.jp/tsumiki/ にある CSE程度しか触ったことがありませんが https://dbeaver.io/ も興味深い
async load_disp_date_range(vue_obj){ let req_url = this.server_api_base() + "DispDateRange"; let res = await fetch(req_url); let disp_dates = await res.json(); vue_obj.disp_date_min = disp_dates[0]; vue_obj.disp_date_max = disp_dates[1]; v…
更に前回entryの続きとして以下 from sklearn.feature_extraction.text import TfidfVectorizer from sudachipy import dictionary import csv import pandas import re import unicodedata qa_sys_src_csv = "qa_srcs_full.csv" sudachi_conf_json = "c:/Us…
先程のentryの続きです sudachi.json 元の sudachi.json をコピーし、「"userDict" : [~] 」を追加しています { "systemDict" : null, "characterDefinitionFile" : "char.def", "userDict" : ["c:/Users/end0t/tmp/QA_SGST/sudachi_user_dic/user.dic"], "…
以下の通りです sudachipy.exe コマンドを呼ぶのではなく、 https://github.com/WorksApplications/SudachiPy/blob/develop/sudachipy/dictionarylib/userdictionarybuilder.py にある UserDictionaryBuilder クラスを 内部的に呼びたかったのですが、userdi…
メモ O'Reilly Japan Blog - 「入門 自然言語処理」の12章を公開しています! Python による日本語自然言語処理 O'Reilly Japan - 入門 自然言語処理
pythonの自前コード内で、postgresへの connection poolを行い、更に、 concurrent.futures.ProcessPoolExecutor for python の並列処理による影響でしょうか psycopg2.DatabaseError: error with status PGRES_TUPLES_OK and no message from the libpq の…
wslで起動した oracle linuxをsambaで Xドライブをマウントし、 そこに TortoiseGitで git cloneし、commit等を行ったところ、以下のエラーが発生 --------------------------- TortoiseGit --------------------------- Could not get HEAD hash. libgit2 r…
ポイントは minicondaをinstallし、windowsのPATHを通す pip installで jediに加え、virtualenv もインストール かと思います。 step1 - miniconda (python11)の install 2024/3時点で、minicondaの最新は python12版ですが、 emacsのjediが対応していない為…
requests for python で、巨大なfileをhttp getする場合、stream=True で chunk化 - end0tknr's kipple - web写経開発 以前の上記entryの修正版です。 国土交通省で公開している不動産取引価格情報取得API ( https://www.land.mlit.go.jp/webland/api.html )…
$ sudo yum install ipa-gothic-fonts ipa-mincho-fonts \ ipa-pgothic-fonts ipa-pmincho-fonts 以前、centosに対しては上記のようにipaのフォントをインストールしていましたが、 redhat?には、このフォントがないみたい。 なので、以下 $ sudo yum search…
install postgres 14.1 from source to cent 7.9 - end0tknr's kipple - web写経開発 上記entryまでは、virtual box上のcentosにinstallしていましたが、 今回は、wsl(Windows Subsystem for Linux)上の Oracle Linuxへ、インストール $ cat /etc/redhat-rel…
sql.js によるブラウザでの sqlite3 操作 - end0tknr's kipple - web写経開発 先日の上記entryでは sql.js で sqlite3のバイナリファイルを扱いましたが、 今回は、csvを含むzipをjszip+papaparse for javascriptで読み、sql.js で sql select <html lang="ja"> <head> <meta charset="UTF-8"> </meta></head></html>
code snippet ですが、少々の修正で、動作すると思います #!python # -*- coding: utf-8 -*- from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from email.mime.application import MIMEApplication import csv import…
web assemblyのおかげでしょうか、 最近は javascriptで sqlite3 のデータベースファイルを そのまま扱えるらしい。 参考url https://sql.js.org https://github.com/sql-js/sql.js install sqlite3 DOS> wsl $ cat /etc/redhat-release Red Hat Enterprise …