This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Book: | |
def __init__(self, id: str, title: str): | |
self.id: str = id | |
self.title: str = title | |
def __eq__(self, o: object) -> bool: | |
if isinstance(o, Book): | |
return self.id == o.id | |
return False |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: python:3.7 | |
before_script: | |
- curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python | |
- export PATH="$PATH:$HOME/.poetry/bin/" | |
- source $HOME/.poetry/env | |
- poetry install | |
- source `poetry env info --path`/bin/activate | |
build: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
class NeumorphicCard extends StatelessWidget { | |
const NeumorphicCard({Key key}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return Container( | |
height: 200, | |
width: 200, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="100dp" | |
android:layout_height="100dp" | |
app:layout_behavior="@string/appbar_scrolling_view_behavior" | |
tools:context=".MainActivity" | |
tools:showIn="@layout/first_widget"> | |
<TextView |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
secretGenerator: | |
- commands: | |
pgHost: bash -euc 'echo -n "$PG_HOST"' | |
pgPassword: bash -euc 'echo -n "$PG_PASSWORD"' | |
pgUser: bash -euc 'echo -n "$PG_USER"' | |
name: api-secret | |
## output-example | |
## | |
## apiVersion: v1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// --- 最上部のブロック | |
// state を変更するメソッド | |
setShouldReload = (shouldReload) => { | |
this.setState({shouldReload}) | |
} | |
// --- 左上のブロック | |
<MessageForm setShouldReload={this.setShouldReload} /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import shutil | |
from matplotlib import matplotlib_fname | |
# 設定ファイルをコピー | |
shutil.copyfile(matplotlib_fname(), 'matplotlibrc') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import numpy as np | |
from matplotlib import pyplot as plt, font_manager, get_cachedir | |
# フォントキャッシュを再構築します | |
font_manager._rebuild() | |
if os.name == 'nt': | |
# OS が Windows の場合、win32FontDirectory() が利用出来ます。 | |
font_dir = font_manager.win32FontDirectory() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 改めて回帰式を取得 | |
SLOPE, INTERCEPT, rvalue, pvalue, stder = linregress( | |
lego_df['pieces'], | |
lego_df['us_price']) | |
# 関数を定義 | |
def get_price(piece): | |
return piece * SLOPE + INTERCEPT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
slope, intercept, rvalue, pvalue, stderr = linregress( | |
lego_df['pieces'], | |
lego_df['us_price']) | |
piece = 500 | |
# Y = aX + b | |
price = slope * piece + intercept | |
round(price) |
NewerOlder