Skip to content

Instantly share code, notes, and snippets.

View log5r's full-sized avatar

log5 log5r

View GitHub Profile
@log5r
log5r / 20230206_error.log
Last active February 6, 2023 15:04
20230206_magenta-docker-cpu_docker-compose_build_error
➜ magenta-docker-cpu git:(master) ✗ docker-compose build --no-cache
[+] Building 490.0s (13/15)
=> [internal] load build definition from dockerfile 0.0s
=> => transferring dockerfile: 427B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for docker.io/library/python:3.8-buster 1.9s
=> [ 1/12] FROM docker.io/library/python:3.8-buster@sha256:e3d93e56949804080b55a57cdc8db47e0c01c1972ca4c1da799407ad460740b1 0.0s
=> CACHED [ 2/12] WORKDIR /data
@log5r
log5r / temp-vimrc
Created January 25, 2023 03:03
temp
" setting
"文字コードをUFT-8に設定
set fenc=utf-8
" バックアップファイルを作らない
set nobackup
" スワップファイルを作らない
set noswapfile
" 編集中のファイルが変更されたら自動で読み直す
set autoread
" バッファが編集中でもその他のファイルを開けるように
@log5r
log5r / related-to-algo-1029.swift
Created August 15, 2022 15:59
Algo-1029とKeyPathについての疑問とか
@log5r
log5r / mathler_solver_helper.swift
Created February 21, 2022 06:46
mathler solver helper
extension Sequence {
func permutations() -> [[Element]] {
func _permutations<T>(of values: [T], indices: Range<Int>, result: inout [[T]]) {
if indices.isEmpty {
result.append(values)
return
}
var values = values
for i in indices {
values.swapAt(indices.lowerBound, i)
@log5r
log5r / c_cpp_properties.json
Created February 9, 2022 10:02
c_cpp_properties_ss_20220209_1901
{
"configurations": [
{
"name": "Mac",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
"macFrameworkPath": [
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks"
@log5r
log5r / AlgorithmMath_3.6.2_q.swift
Last active January 2, 2022 16:56
「アルゴリズム×数学」の問題3.6.3の「マージソートを行う未完成のプログラム」のSwift版
var N: Int
var A = [Int](repeating: 0, count: 200009)
var C = [Int](repeating: 0, count: 200009)
/// A[l], A[l+1], ..., A[r−1] を小さい順に整列する関数
///
/// - Parameters:
/// - l: 左端(閉)
/// - r: 右端(開)
func mergeSort(_ l: Int, _ r: Int) {
@log5r
log5r / rename.ps1
Last active December 30, 2021 07:01
【DDD共有用】ファイルを一括リネームするやつ
function RenameMyFiles ($file) {
$ext = $file.Extension
$fragments = $file.BaseName.Split(" ")
$newName = $fragments[1] + " " + $fragments[0] + $ext
Rename-Item $file.Name $newName -Verbose
}
gci | % { RenameMyFiles $_ }
@log5r
log5r / abc226-d.swift
Last active November 7, 2021 13:58
err chk
import Foundation
func gcd(_ x: Int, _ y: Int) -> Int {
guard y != 0 else { return x }
return gcd(y, x % y)
}
struct Pair: Hashable, Equatable {
static func ==(lhs: Pair, rhs: Pair) -> Bool {
lhs.x == rhs.x && lhs.y == rhs.y
@log5r
log5r / handmade_mint.cpp
Created November 7, 2021 05:51
handmade_mint
#include <bits/stdc++.h>
struct mint {
long long int value;
mint() : value(0) {}
mint(long long int value) : value((value % MOD + MOD) % MOD) {}
mint &fix() {
#include <iostream>
#include <vector>
#include <chrono>
using namespace std;
// 扱う値の最大値
const int MAX = 1000000000;
int main() {
// 素数砂漠の長さの最大値