勉強日記

チラ裏

2019-10-01から1ヶ月間の記事一覧

ReactJS チュートリアル 1/x

ReactJS触る 公式チュートリアル リポジトリ 準備 まずバージョンチェック node --version npm --version 古杉 v8.10.0 3.5.2 npxも入っていなかったのでNodeのバージョン上げる sudo npm i -g n sudo n stable installing : node-v12.13.0 mkdir : /usr/loc…

1つのform要素でGET/POSTのsubmitを共存

TL;DR 経緯 やったこと 考えうる別解 所感 TL;DR formmethod, formaction 属性使え GETリクエストにCSRFトークンが乗ってしまう問題は、2019時点でJSなしではたぶん解決不可能 ajax?なにそれおいしいの? 経緯 「条件を入力して帳票出力する」系の機能で、…

gitリポジトリが壊れたので.git/ディレクトリの中身を完全理解して修復した話

gitリポジトリが壊れた Gitのオブジェクト 壊れていない場合 壊れている場合 直す gitリポジトリが壊れた statusを確認したところエラーが git status error: object file .git/objects/06/f2e0fd1f94d73e7a59fdd0ab765957e339b8d2 is empty error: object f…

Version Control with Git ch6 Commits

shop.oreilly.com Commits Atomic Changesets Identifying Commits Absolute Commit Names refs and symrefs Relative Commit Names Commit History Viewing Old Commits Commit Graphs Using gitk to view Commit Graph Commit Ranges Reachability in Grap…

Use Case Driven Object Modeling with UMLTheory and Practice ch1. Introduction to ICONIX Process (1/2)

Introduction to ICONIX Process WHEN TO USE A COOKBOOK ICONIX Process in Theory Overview: Getting from Use Cases to Source Code Requirements Functional Requirements (What Will the System Be Capable Of?) Domain Modeling Behavioral Requiremen…

Version Control with Git ch5 File Management and the Index

shop.oreilly.com File Management and the Index It's All About the Index File Classifications in Git Using git add Some Notes on Using git commit Using git commit --all (git commit -A) Writing Commit Log Messages Using git rm Using git mv A…

Version Control with Git ch4 Basic Git Concepts (2/2)

shop.oreilly.com Git Concepts at Work Inside the .git Diretory Objects, Hashes, and Blobs How Do We Know a SHA1 Hash Is Unique? Files and Trees A Note on Git's Use of SHA1 Tree Hierarchies Commits Tags 英語 Git Concepts at Work 実際にGitリ…

Version Control with Git ch4 Basic Git Concepts (1/2)

shop.oreilly.com Basic Concepts Repositories Git Object Types Index Content-Addressable Names Globally Unique Identifiers Git Tracks Content Pathname Versus Content Pack Files Object Store Pictures 英語 Basic Concepts 前章で生じたであろう…

現場で役立つシステム設計の原則 ch1-3

gihyo.jp ch1 小さくまとめてわかりやすくする ch2 場合分けのロジック ch3 業務ロジックをわかりやすく整理する ch1 小さくまとめてわかりやすくする 変更を楽にするために 名前を略さない コードを段落に分ける 説明用の変数の導入 破壊的代入をしない コ…

A Philosophy of Software Design ch21 Conclusion

www.goodreads.com Conslusion Conslusion 本書のテーマはひとつ: 複雑性 複雑性に取り組むことは、ソフトウェア設計における最も重要な仕事である 複雑なソフトウェアは… 構築・保守しづらい 実行時速度が遅いことさえある 複雑性の原因について述べた: 依…

A Philosophy of Software Design ch20 Designing for Performance

www.goodreads.com Designing for Performance How to think about performance Measure before modifying Design around the critical path An example: RAMCloud Buffers Conclusion 英語 Designing for Performance ここまで(1-19章)のソフトウェア設計の…

A Philosophy of Software Design ch19 Software Trends

www.goodreads.com Software Trends Object-oriented programming and inheritance Agile development Unit test Test-driven development Design patterns Getters and setters Conclusion 英語 Software Trends ここ数十年で人気となったトレンドやパター…

A Philosophy of Software Design ch18 Code should be obvious

www.goodreads.com Code should be obvious Things that make code more obvious Things that make code less obvious Conclusion 英語 Code should be obvious 不明瞭さは複雑性の2大原因のうちひとつ 重要な情報が新参の開発者にとって明らかでないとおこ…

Version Control with Git ch3 Getting Started

shop.oreilly.com ch3 Getting Started git help --all git commit <ファイル名> git show-branch 設定ファイル 英語 ch3 Getting Started git --version git version 2.17.1 超導入なので知らなかったもののみ git help --all 全サブコマンドが出てくる git…

A Philosophy of Software Design ch16 Modifying Existing Code

www.goodreads.com Modifying Existing Code Stay strategic Maintaining comments: keep the comments near the code Comments belong in the code, not the commit logbook Maintaining comments: avoid duplication Maintaining: check the diffs Higher-…

A Philosophy of Software Design ch14 Choosing names

www.goodreads.com Choosing names Example: bad names cause bugs Create an image Names should be precise Use names consistently A different opinion: Go style guide Conclusion Choosing names 識別子の命名は、ソフトウェア設計において最も過小評…

A Philosophy of Software Design ch10 Define errors out of existence

www.goodreads.com Define errors out of existence Why exceptions add complexity Too many exceptions Define errors out of existence Example: file deletion in windows Example: Java substring methoda Mask exceptions Exception aggregation Just …

A Philosophy of Software Design ch9 Better Together Or Better Apart?

www.goodreads.com Better Together Or Better Apart? Bring together if information is shared Bring together if it will simplify the interface Bring together to eliminte duplication Separate general-purpose and special-purpose code Red Flag: …

A Philosophy of Software Design ch15 Write The Commnts First (Use Comments As Part Of The Design Process)

www.goodreads.com Write The Commnts First (Use Comments As Part Of The Design Process) Delayed comments are bad comments Write the comments first Comments are a design tool Early comments are fun comments Are early comments expensive? Conc…

A Philosophy of Software Design ch17 Consistency

www.goodreads.com Consistency Examples of consistency Ensuring consistency Taking it too far Conslusion 英語 Consistency 一貫性は複雑性を減らす強力なツール 似ているものは似たやりかた 似ていないものは異なるやりかた 一貫性がある 一貫性がない…

A Philosophy of Software Design ch7. Different Layer, Different Abstraction

www.goodreads.com Different Layer, Different Abstraction Pass-through methods When is interface duplication OK? Decorators Interface versus implementation Pass-through variables Conclusion 英語 Different Layer, Different Abstraction 上位の…

A Philosophy of Software Design ch8. Pull Complexity Downwords

www.goodreads.com Pull Complexity Downwords Example: editor text class Example: configuration parameters Taking it too far Conclusion 英語 Pull Complexity Downwords モジュールを開発するときは、実装ではなくインタフェースを単純化するのが大事…

A Philosophy of Software Design ch11. Design It Twice

www.goodreads.com Design It Twice 英語 Design It Twice ソフトウェア設計は難しいので、ベストなものを一発で考えつくことはまずできない 設計は二回せよ 列挙する 比較検討して選定する 例: GUIエディタのTextクラスのインタフェース設計 まずいくつか可…

A Philosophy of Software Design ch12 Why Write Comments? -- The Four Excuses

www.goodreads.com Why Write Comments? -- The Four Excuses Good code is self-documenting I don't have time to write comments Comments get out of date and become misleading All the comments I have seen are worthless Benefits of well-written …

PoEAA ch12 Dependent Mapping

martinfowler.com Dependent Mapping How It Works When to Use It Dependent Mapping Has one class perform the database mapping for a child class. 「他のオブジェクトのコンテキストでしか現れないオブジェクト」もある 例: アルバムに対するトラック …

PoEAA ch12 Association Table Mapping

martinfowler.com Association Table Mapping How It Works When to Use It Association Table Mapping Saves an association as a table with foreign keys to the tables that are linked by the association. 多対多ではForeign Key Mappingを適用できな…

A Philosophy of Software Design ch6. General-Purpose Modules Are Deeper

www.goodreads.com General-Purpose Modules Are Deeper Make classes somewhat general-purpose Example: storing text for an editor A more general-purpose API Generaity leads to better information hiding Questions to ask yourself What is the si…

A Philosophy of Software Design ch5. Information Hiding (and Leakage)

www.goodreads.com Information Hiding (and Leakage) Information hiding Information leakage Temporal decomposition Example: HTTP server Example: Too many classes Example: HTTP parameter handling Example: defaults in HTTP responses Red Flag: …

WSL2上のmysqlにWindows側のMySQL Workbenchから接続できない問題と解決

現象 127.0.0.1:3306にアクセスできない privilegeはバッチリroot@%に全GRANTしてる SSHポートフォワーディングは大丈夫 127.0.0.1::22経由 解決 IPv6の[::1]:3306だと大丈夫 逆に、SSHポートフォワーディングは[::1]:22だと駄目。謎 localhostって書けるや…

A Philosophy of Software Design ch4 Modules Should Be Deep

www.goodreads.com Modules Should Be Deep Modular design What's in an interface Abstractions Deep modules Shalow modules Classitis Examples: Java and Unix I/O Conclusion 英語 Modules Should Be Deep modular design 開発者が一度に直面する複雑…