Skip to content

Instantly share code, notes, and snippets.

View masahitojp's full-sized avatar
🎯
Focusing

Masato Nakamura masahitojp

🎯
Focusing
View GitHub Profile
View gist:75e865bba4df147270a951c4ed3b9199
https://docs.google.com/presentation/d/1dUkD4KtvpMZL0ay4jHpgDevPhodmerwCF9vFDco10rI/edit#slide=id.p
@masahitojp
masahitojp / README.md
Last active March 22, 2022 14:57
It's a benchmark for simdjson vs json on python 3.10
View README.md
@masahitojp
masahitojp / matching_for_dataclasses.py
Last active October 31, 2023 19:54
Try pattern matching + dataclass in python 3.10
View matching_for_dataclasses.py
import dataclasses
@dataclasses.dataclass
class User:
name: str
age: int = 0
if __name__ == "__main__":
u = User("taro", 32)
@masahitojp
masahitojp / beam-linkage-check-4-beam11770
Created February 23, 2021 01:52
result for `sh sdks/java/build-tools/beam-linkage-check.sh origin/master beam-11770`
View beam-linkage-check-4-beam11770
~/src/beam >>> sh sdks/java/build-tools/beam-linkage-check.sh origin/master beam-11770
Comparing linkage of artifact lists beam-sdks-java-core beam-sdks-java-io-google-cloud-platform beam-runners-google-cloud-dataflow-java beam-sdks-java-io-hadoop-format using baseline origin/master and proposal beam-11770
Establishing baseline linkage for origin/master
HEAD is now at aaad864c9a [BEAM-7372] remove aliases created for python 2 (#14012)
2021年 2月 23日 火曜日 10:03:12 JST: Running linkage check (baseline) for beam-sdks-java-core
2021年 2月 23日 火曜日 10:03:12 JST: to create a baseline (existing errors before change) build/linkagecheck/baseline-beam-sdks-java-core.xml
+ ./gradlew -Ppublishing -PskipCheckerFramework -PjavaLinkageArtifactIds=beam-sdks-java-core -PjavaLinkageWriteBaseline=build/linkagecheck/baseline-beam-sdks-java-core.xml :checkJavaLinkage
Configuration on demand is an incubating feature.
> Task :sdks:java:io:clickhouse:compileJavacc
@masahitojp
masahitojp / median
Created December 26, 2020 14:13
calc median
View median
# for leetcode
# https://leetcode.com/problems/median-of-two-sorted-arrays/solution/
class Solution:
def findMedianSortedArrays(self, nums1: List[int], nums2: List[int]) -> float:
c = sorted(nums1 + nums2)
l = len(c)
ans =0
if l % 2 == 1:
ans = c[ l // 2]
else:
View paid_services.md

masahitoが課金しているwebサービス

key value
更新 2020-07-12
作者 @masahito
バージョン 20.07.12
URL https://masahito.me/
@masahitojp
masahitojp / BusinessLogicTest.kt
Created June 29, 2020 14:17
example for shrinking
View BusinessLogicTest.kt
import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.shouldBe
import io.kotest.property.*
import io.kotest.property.arbitrary.*
class BusinessLogicTests : FunSpec({
fun isPrimeNumber(number: Int): Boolean {
val root: Int = kotlin.math.floor(kotlin.math.sqrt(number.toDouble())).toInt()
@masahitojp
masahitojp / test.md
Created October 10, 2019 03:19
for hiroshima
View test.md
marp
true

footer: Python と型ヒントとその使い方 - PyCon Kyushu in Okinawa 2019 May 18th slidenumbers: true

Python と型ヒント

とその使い方

@masahitojp
masahitojp / stack.py
Created July 12, 2019 07:48
check generics for mypy
View stack.py
from typing import TypeVar, Generic
T = TypeVar('T', bound='Shape')
class Stack(Generic[T]):
def __init__(self) -> None:
# Create an empty list with items of type a T
print(__annotations__) # {}
self.items: List[T] = []
@masahitojp
masahitojp / withMixpanel
Created June 12, 2019 00:34
it's a example for RenderProps to HoC for react-mixpanel v1.0
View withMixpanel
// @flow
import { MixpanelConsumer } from 'react-mixpanel'
import { fromRenderProps } from 'recompose'
const enhancer = fromRenderProps(MixpanelConsumer, (mixpanel) => ({
mixpanel,
}))
export default enhancer