masahitoが課金しているwebサービス
key | value |
---|---|
更新 | 2020-07-12 |
作者 | @masahito |
バージョン | 20.07.12 |
URL | https://masahito.me/ |
# 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: |
key | value |
---|---|
更新 | 2020-07-12 |
作者 | @masahito |
バージョン | 20.07.12 |
URL | https://masahito.me/ |
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() |
marp |
---|
true |
footer: Python と型ヒントとその使い方 - PyCon Kyushu in Okinawa 2019 May 18th slidenumbers: true
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] = [] |
// @flow | |
import { MixpanelConsumer } from 'react-mixpanel' | |
import { fromRenderProps } from 'recompose' | |
const enhancer = fromRenderProps(MixpanelConsumer, (mixpanel) => ({ | |
mixpanel, | |
})) | |
export default enhancer |
// Template Tree | |
global.templateIDsByPath = global.templateIDsByPath || { | |
'404': undefined | |
} | |
// Get template for given path | |
const getComponentForPath = path => { | |
path = cleanPath(path) | |
return global.componentsByTemplateID[global.templateIDsByPath[path]] | |
} |
PatternsSpec.scala | |
PoolSpec.scala | |
PipelineSpec.scala |
# #load "str.cma";; | |
# List.map int_of_string (Str.split (Str.regexp "[^0-9]+") "1234");; | |
- : int list = [1234] | |
# List.map int_of_string (Str.split (Str.regexp "") "1234");; | |
- : int list = [1; 2; 3; 4] |
object | detail |
---|---|
chage date | 2018/5/12 |
version | fabic 2.0.0 |
os | ubuntu 18.04 |
python | 3.6.5 |