/tutorials

This is my notebook for learning.

Primary LanguageJavaApache License 2.0Apache-2.0

Tutorials

  • XXX Best Practice
  • Best Programming Resource

Java: https://www.youtube.com/@java/playlists

必读书籍

  • 《代码大全》
  • 《程序员修炼之道》
  • 《计算机的构造和解释》
  • 《算法导论》
  • 《重构》
  • 《人月神话》
  • 《代码整洁之道》
  • 《Effective C++》 《More Effective C++》
  • 《Unix 编程艺术》 《Unix 高级环境编程》
  • The C Programming Language by Kernighan and Ritchie
  • Introduction to Algorithms by Cormen, Leiserson, Rivest & Stein
  • Design Patterns by the Gang of Four
  • Refactoring: Improving the Design of Existing Code
  • The Mythical Man Month
  • The Art of Computer Programming by Donald Knuth
  • Compilers: Principles, Techniques and Tools by Alfred V. Aho, Ravi Sethi and Jeffrey D. Ullman
  • Gödel, Escher, Bach by Douglas Hofstadter
  • Clean Code: A Handbook of Agile Software Craftsmanship by Robert C. Martin
  • CODE by Charles Petzold
  • Programming Pearls by Jon Bentley
  • Working Effectively with Legacy Code by Michael C. Feathers
  • Peopleware by Demarco and Lister
  • Coders at Work by Peter Seibel
  • Surely You're Joking, Mr. Feynman!
  • Effective Java 2nd edition
  • Patterns of Enterprise Application Architecture by Martin Fowler
  • The Little Schemer
  • The Seasoned Schemer
  • Why's (Poignant) Guide to Ruby
  • The Inmates Are Running The Asylum: Why High Tech Products Drive Us Crazy and How to Restore the Sanity
  • The Art of Unix Programming
  • Test-Driven Development: By Example by Kent Beck
  • Practices of an Agile Developer
  • Don't Make Me Think
  • Agile Software Development, Principles, Patterns, and Practices by Robert C. Martin
  • Domain Driven Designs by Eric Evans
  • The Design of Everyday Things by Donald Norman
  • Modern C++ Design by Andrei Alexandrescu
  • Best Software Writing I by Joel Spolsky
  • The Practice of Programming by Kernighan and Pike
  • Pragmatic Thinking and Learning: Refactor Your Wetware by Andy Hunt
  • Software Estimation: Demystifying the Black Art by Steve McConnel
  • The Passionate Programmer (My Job Went To India) by Chad Fowler
  • Hackers: Heroes of the Computer Revolution
  • Algorithms + Data Structures = Programs
  • Writing Solid Code
  • JavaScript - The Good Parts
  • Getting Real by 37 Signals
  • Foundations of Programming by Karl Seguin
  • Computer Graphics: Principles and Practice in C (2nd Edition)
  • Thinking in Java by Bruce Eckel
  • The Elements of Computing Systems
  • Refactoring to Patterns by Joshua Kerievsky
  • Modern Operating Systems by Andrew S. Tanenbaum
  • The Annotated Turing
  • Things That Make Us Smart by Donald Norman
  • The Timeless Way of Building by Christopher Alexander
  • The Deadline: A Novel About Project Management by Tom DeMarco
  • The C++ Programming Language (3rd edition) by Stroustrup
  • Patterns of Enterprise Application Architecture
  • Computer Systems - A Programmer's Perspective
  • Agile Principles, Patterns, and Practices in C# by Robert C. Martin
  • Growing Object-Oriented Software, Guided by Tests
  • Framework Design Guidelines by Brad Abrams
  • Object Thinking by Dr. David West
  • Advanced Programming in the UNIX Environment by W. Richard Stevens
  • Hackers and Painters: Big Ideas from the Computer Age
  • The Soul of a New Machine by Tracy Kidder
  • CLR via C# by Jeffrey Richter
  • The Timeless Way of Building by Christopher Alexander
  • Design Patterns in C# by Steve Metsker
  • Alice in Wonderland by Lewis Carol
  • Zen and the Art of Motorcycle Maintenance by Robert M. Pirsig
  • About Face - The Essentials of Interaction Design
  • Here Comes Everybody: The Power of Organizing Without Organizations by Clay Shirky
  • The Tao of Programming
  • Computational Beauty of Nature
  • Writing Solid Code by Steve Maguire
  • Philip and Alex's Guide to Web Publishing
  • Object-Oriented Analysis and Design with Applications by Grady Booch
  • Effective Java by Joshua Bloch
  • Computability by N. J. Cutland
  • Masterminds of Programming
  • The Tao Te Ching
  • The Productive Programmer
  • The Art of Deception by Kevin Mitnick
  • The Career Programmer: Guerilla Tactics for an Imperfect World by Christopher Duncan
  • Paradigms of Artificial Intelligence Programming: Case studies in Common Lisp
  • Masters of Doom
  • Pragmatic Unit Testing in C# with NUnit by Andy Hunt and Dave Thomas with Matt Hargett
  • How To Solve It by George Polya
  • The Alchemist by Paulo Coelho
  • Smalltalk-80: The Language and its Implementation
  • Writing Secure Code (2nd Edition) by Michael Howard
  • Introduction to Functional Programming by Philip Wadler and Richard Bird
  • No Bugs! by David Thielen
  • Rework by Jason Freid and DHH
  • JUnit in Action

Framework


Objenesis

Excellent Literature

高可用,高并发

疑问点

  • 对于生命周期的概念,是否对应映射到容器,使得对象数据与生命周期隔离会不会更合适;
  • 枚举引入二进制

微服务设计原则

隔离系统变化点

  • 高内聚,低耦合;
  • 高度自治:开发、测试、构建、部署、运行、发布(无状态);
  • 以业务为中心;
  • 弹性设计(容错、隔离、降级);
  • 自动化(CI、CD);
  • 粒度把控(按照业务逻辑来);

AKF

x 轴:水平复制; y 轴:业务拆分(拆分成更小的服务); z 轴:数据分片(按照业务类型,地区等;

QPS(Queries Per Second, 每秒查询率)

(2000/300)

服务器每秒处理查询的数量;

TPS(Transactions Per Second, 每秒事务率)

服务器每秒处理事务的数量;

接口设计原则

  • Restful 风格(Http)

    重在资源

    • 协议 超文本传输协议
    • 域名 api.domain_name.com
    • 版本 v1
    • 路径 建议使用名词
    • 动作
      • post 新增
      • put 修改(传输修改记录的全量数据)
      • patch 修改(仅传输修改的具体部分)
      • delete 删除
      • get 查询

接口安全

  • CIA:

    • 保密性(脱敏)
    • 完整性(防止篡改)
    • 可用性
  • 数据层面:防止 SQL 注入

    • 过滤(jsoup 框架)
    • spring-htmlUtils 预防 xss
    • 人机交互、token 防止 csrf 攻击
  • 数据权限控制(水平越权、垂直越权)

MyBatis $ 直接拼接 #

xss 攻击

提交内容含有 JavaScript 脚本;

csrf 跨站伪装请求

xss vs csrf

xss 在正常请求中执行了恶意代码,用户数据没有过滤、转义; csrf 冒充登录信息,没有防范不信任的调用;

Referer

HTTP 请求头的一部分; 表示来源;用于防盗链、防止恶意请求;

日志

  • dao 层异常,不用打日志, catch 抛出;
  • service 层打印异常日志,覆盖详细信息;
  • controller 层捕获异常,包装成状态码;
  • dto 抽象到公共层(common, 二方库);

通用项目结构

-> project-name -----> .github -----> ci -----> design -----> docs -----> scripts -----> scr -----> pom.xml -----> README.md

Spring


  1. 制品管理
  2. 持续集成持续部署
  3. code review
  4. 测试组件
  5. Java Language Updates
  6. OSGI

QT GUI 库

https://qskinny.github.io/

https://github.com/uwerat/qskinny

My IDEA Plugins

  • Infinitest
  • ExcelReader
  • GitToolBox
  • Grep Console
  • Ideolog
  • JenkinsControl
  • MapStruct Support
  • Maven Helper
  • PlantUML integration
  • Rainbow Brackets
  • String Manipulation
  • Translation
  • UnitVisualizer

IDEA Keymap

HotKey -
ctrl + ctrl Run Anything
ctrl + ` VCS Operations
ctrl + shift + F10 Run context configuration from editor
ctrl + shift + r Run Maven Goal
ctrl + F12 Inherited members
ctrl + I Anonymous Classes
ctrl + shift + F12 Hide All Windows
ctrl + alt + L Reformat Code
ctrl + h view interface implements
ctrl + alt + shift + t Refactor This Windows
ctrl + alt + b Navigate to implementation
ctrl + alt + n Inline...
ctrl + alt + v Introduce Variable...
  • Linux install Idea Create Desktop Entry... : double Shift + Desktop or Tools -> Create Desktop Entry..

  • 不同变量不同颜色标识: Semantic Highlighting

img.png

img_1.png

  • 变量不同颜色 val_color