I hereby claim:
- I am bact on github.
- I am bact (https://keybase.io/bact) on keybase.
- I have a public key ASA8vzg-kfcvZpfOGoeTXJR8gVCxI4B3NQ3I8H8JQ15B8Ao
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| import re | |
| def bingap(num): # wronggggg | |
| zeroes = re.findall(r"0+", bin(num)[2:]) | |
| return len(max(zeroes, key=len)) if zeroes else 0 | |
| n = 32 | |
| print(bin(n)) | |
| bingap(n) |
| def is_one_swap_can_sort(nums): | |
| sorted_nums = sorted(nums) | |
| if nums == sorted_nums: | |
| return True | |
| len_nums = len(nums) | |
| for i in range(len_nums): | |
| for j in range(i+1, len_nums): | |
| test = nums.copy() | |
| if test[i] > test[j]: |
| # thai_strftime() | |
| # Thai date and time string formatter | |
| # Formatting directives similar to datetime.strftime() | |
| # | |
| # จัดรูปแบบข้อความวันที่และเวลา แบบเดียวกับ datetime.strftime() | |
| # โดยจะใช้ชื่อเดือนเป็นภาษาไทย และปีเป็นพุทธศักราช | |
| # (ไม่รองรับปีก่อน พ.ศ. 2484 - ก่อนการเปลี่ยนวันปีใหม่ไทย) | |
| # | |
| # No Rights Reserved | |
| # PUBLIC DOMAIN or CC0 1.0 Universal |
| _THAI_ARABIC = { | |
| "๐": "0", | |
| "๑": "1", | |
| "๒": "2", | |
| "๓": "3", | |
| "๔": "4", | |
| "๕": "5", | |
| "๖": "6", | |
| "๗": "7", | |
| "๘": "8", |
| # 1) export text from JSON | |
| import json | |
| import pandas as pd | |
| from pandas import json_normalize | |
| # note: have to remove `window.YTD...` in the first line | |
| data = json.load(open('bact-tweet.json')) | |
| df = pd.DataFrame.from_records(json_normalize(data)) | |
| df = df[df["tweet.lang"] == "th"] |
| #!/bin/bash | |
| amount=$1 | |
| regex=$2 | |
| echo "Generating $amount UUIDs with $regex..." | |
| count=0 | |
| while [ $count -lt $amount ]; do | |
| uuid=$(uuidgen | awk '{print tolower($0)}') |
| jobs: | |
| build: | |
| steps: | |
| - name: Make Python implementation ID (non-Windows) | |
| id: convert-version-id | |
| if: startsWith(matrix.os, 'windows-') == false | |
| run: | | |
| PYTHON_VERSION=${{ matrix.python-version }} | |
| if [[ "$PYTHON_VERSION" == pypy* ]]; then | |
| CP_VER="pp${PYTHON_VERSION:4}" |
| # SPDX-FileCopyrightText: 2025-present Arthit Suriyawongkul | |
| # SPDX-FileType: SOURCE | |
| # SPDX-License-Identifier: 0BSD | |
| # | |
| # Generate a simplified interface to classes and functions. | |
| # | |
| # It import all classes and functions from the original module, | |
| # removing the (long IRI-based) prefix from class names, | |
| # and re-export them to the new module. | |
| # |