Skip to content

Instantly share code, notes, and snippets.

View smellman's full-sized avatar

Taro Matsuzawa aka. btm smellman

View GitHub Profile
@smellman
smellman / plateau_wiki.py
Created March 31, 2025 13:11
OpenStreetMap: PLATEAU imports_listのwikiテンプレートを作成するためのスクリプト
import os
import glob
import argparse
"""
This script is used to generate wiki table from a given directory.
See: https://wiki.openstreetmap.org/wiki/JA:MLIT_PLATEAU/imports_list
"""
def get_bldg_meshcodes(path: str, epsg: str) -> list[str]:
@smellman
smellman / clamav_install_memo.md
Created January 28, 2025 12:34
clamav install memo

setup

macOS

brew install clamav
cp /opt/homebrew/etc/clamav/freshclam.conf.sample /opt/homebrew/etc/clamav/freshclam.conf
vim /opt/homebrew/etc/clamav/freshclam.conf
#!/bin/bash
for i in *; do
# 出力ディレクトリを生成(R0*ディレクトリに対応)
output_dir="/processing/lasprocessing/$i"
mkdir -p "$output_dir"
for j in "$i"/LAZ/*.laz; do
# ファイルが存在するか確認
if [ -f "$j" ]; then
# lazファイルの名前部分だけ取得してlasに変換
for i in `echo *`; do lasmerge64 -i $i/LAZ/*.laz -o /processing/$i.laz ; done
import xml.etree.ElementTree as ET
def convert_negative_ids(elements):
id_map = {}
new_elements = []
for elem in elements:
orig_id = int(elem.attrib['id'])
new_id = abs(orig_id)
id_map[new_id] = orig_id
--- qtwebengine.pro.orig 2024-07-16 15:50:07
+++ qtwebengine.pro 2024-07-16 15:50:34
@@ -2,6 +2,7 @@
load(qt_parts)
load(functions)
+QMAKE_CXXFLAGS += -Wno-enum-constexpr-conversion
QMAKE_DISTCLEAN += .qmake.cache
OTHER_FILES = \
--- src/3rdparty/chromium/v8/src/base/bit-field.h.orig 2024-07-16 13:14:42
+++ src/3rdparty/chromium/v8/src/base/bit-field.h 2024-07-16 13:16:11
@@ -40,7 +40,7 @@
static constexpr U kNumValues = U{1} << kSize;
// Value for the field with all bits set.
- static constexpr T kMax = static_cast<T>(kNumValues - 1);
+ static constexpr T kMax = static_cast<T>((1U << kBits) - 1);
template <class T2, int size2>
--- src/plugins/hunspell/hunspell.pro.orig 2024-07-14 22:25:32
+++ src/plugins/hunspell/hunspell.pro 2024-07-15 16:47:34
@@ -2,6 +2,9 @@
include(../../config.pri)
+INCLUDEPATH += /usr/local/include
+LIBS += -L/usr/local/lib -lhunspell
+
SUBDIRS += \
--- src/3rdparty/mapbox-gl-native/deps/boost/1.65.1/include/boost/mpl/aux_/integral_wrapper.hpp.orig 2024-07-14 16:34:25
+++ src/3rdparty/mapbox-gl-native/deps/boost/1.65.1/include/boost/mpl/aux_/integral_wrapper.hpp 2024-07-14 16:35:23
@@ -70,7 +70,7 @@
typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N - 1)) ) prior;
#else
typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value + 1)) ) next;
- typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value - 1)) ) prior;
+ typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (value > 0 ? value - 1 : 0))) prior;
#endif
@smellman
smellman / .gitignore
Last active December 9, 2024 01:33
WIP: qt5 build for qgis macos x86_64
qt-everywhere-opensource-src*
qt-everywhere-src*
venv/