0%

读书时听着老师念答案不太能读懂诗词,年纪大了便能体会到其中的韵味和阅历。每次读时,还能有不同的品味。

诗词包含了古人所有的情感,你的酸甜苦辣,各种感受都能从中找到共鸣。

定风波·莫听穿林打叶声

苏轼

三月七日,沙湖道中遇雨,雨具先去,同行皆狼狈,余独不觉。已而遂晴,故作此词。

莫听穿林打叶声,何妨吟啸且徐行。竹杖芒鞋轻胜马,谁怕?一蓑烟雨任平生。

料峭春风吹酒醒,微冷,山头斜照却相迎。回首向来萧瑟处,归去,也无风雨也无晴。

Read more »

当测试程序需要数据时,可以通过faker来构造测试数据

安装

1
$ pip install faker

基本使用

1
2
3
4
5
6
7
8
9
10
11
12
from faker import Faker
faker = Faker()

faker.name()
# 'Lucy Cechtelar'

faker.address()
# '426 Jordy Lodge
# Cartwrightshire, SC 88120-6700'

faker.ipv4()
# '196.67.103.129'

对方法 faker.ipv4()的每次调用都会产生不同的随机结果

1
2
3
4
5
6
7
8
9
10
11
12
13
for _ in range(10):
print(faker.ipv4())

# '120.36.235.152'
# '16.58.6.69'
# '170.215.56.41'
# '135.217.158.192'
# '218.235.87.38'
# '175.80.75.73'
# '122.120.1.128'
# '99.91.143.38'
# '1.90.129.142'
# '184.148.193.249'
Read more »

Steve Jobs

I am honored to be with you today at your commencement from one of the finest universities in the world. Truth be told, I never graduated from college, and this is the closest I’ve ever gotten to a college graduation. Today I want to tell you three stories from my life. That’s it. No big deal. Just three stories.

The first story is about connecting the dots.

I dropped out of Reed College after the first 6 months, but then stayed around as a drop-in for another 18 months or so before I really quit. So why did I drop out?

It started before I was born. My biological mother was a young, unwed college graduate student, and she decided to put me up for adoption. She felt very strongly that I should be adopted by college graduates, so everything was all set for me to be adopted at birth by a lawyer and his wife. Except that when I popped out they decided at the last minute that they really wanted a girl.

Read more »

1. 概述

Protocol Buffers(又名protobuf) 是一种语言中立、平台中立的可扩展机制,用于序列化结构化的数据

它就像JSON,只是它更小、更快

只需定义一次数据如何被结构化,然后就可以使用特殊生成的源代码,轻松地从各种数据流和使用各种语言写入和读取结构化数据

Read more »

On August 28, 1963, some 100 years after President Abraham Lincoln signed the Emancipation Proclamation freeing the slaves, a young man named Martin Luther King climbed the marble steps of the Lincoln Memorial in Washington, D.C. to describe his vision of America. More than 200,000 people-black and white-came to listen. They came by plane, by car, by bus, by train, and by foot. They came to Washington to demand equal rights for black people. And the dream that they heard on the steps of the Monument became the dream of a generation.

As far as black Americans were concerned, the nation’s response to Brown was agonizingly slow, and neither state legislatures nor the Congress seemed willing to help their cause along. Finally, President John F. Kennedy recognized that only a strong civil rights bill would put teeth into the drive to secure equal protection of the laws for African Americans. On June 11, 1963, he proposed such a bill to Congress, asking for legislation that would provide “the kind of equality of treatment which we would want for ourselves.” Southern representatives in Congress managed to block the bill in committee, and civil rights leaders sought some way to build political momentum behind the measure.

A. Philip Randolph, a labor leader and longtime civil rights activist, called for a massive march on Washington to dramatize the issue. He welcomed the participation of white groups as well as black in order to demonstrate the multiracial backing for civil rights. The various elements of the civil rights movement, many of which had been wary of one another, agreed to participate. The National Association for the Advancement of Colored People, the Congress of Racial Equality, the Southern Christian Leadership Conference, the Student Non-violent Coordinating Committee and the Urban League all managed to bury their differences and work together. The leaders even agreed to tone down the rhetoric of some of the more militant activists for the sake of unity, and they worked closely with the Kennedy administration, which hoped the march would, in fact, lead to passage of the civil rights bill.

Read more »

简介

tcpdump是一个命令行数据包分析、抓取工具

可以使用 -D 标志来列出可用于捕获的接口

1
2
3
4
5
6
7
8
9
10
11
$ tcpdump -D

1.virbr0
2.docker0
3.vethdb0f731
4.nflog (Linux netfilter log (NFLOG) interface)
5.nfqueue (Linux netfilter queue (NFQUEUE) interface)
6.usbmon1 (USB bus number 1)
7.enp2s0
8.usbmon2 (USB bus number 2)
9.enp3s0

可以使用 -i 标志指定要捕获的接口,指定 any 作为接口将从所有活动接口捕获

1
2
$ tcpdump -i any
$ tcpdump -i eth1

可以使用 -v 标志来调整tcpdump输出中的详细程度

1
2
3
$ tcpdump -i any -v (Verbose output)
$ tcpdump -i any -vv (Even more verbose output)
$ tcpdump -i any -vvv (The most verbose output)
Read more »

The Pragmatic Programmer Quick Reference Guide

  1. 关心你的技艺
    Care About Your Craft
    如果你不在乎能否漂亮地开发出软件,你又为何要耗费生命去开发软件呢?

  2. 思考!你的工作
    Think!About Your Work
    关掉自动驾驶,接管操作,不断地批评和评估你的工作

  3. 提供各种选择,不要找蹩脚的借口
    Provide Options, Don’t Make Lame Excuses
    要提供各种选择,而不是找借口,不要说事情做不到,说明能够做什么

  4. 不要容忍破窗户
    Don’t Live with Broken Windows
    当你看到糟糕的设计、错误的决策和糟糕的代码时,修正它们

  5. 做变化的催化剂
    Be a Catalyst for Change
    你不能强迫人们改变。相反,要向他们展示未来可能会怎样,并帮助他们参与对未来的创造

  6. 记住大图景
    Remember the Big Picture
    不要太过专注于细节,已忘了查看周围正在发生什么

Read more »

1. GET KAFKA

Download the latest Kafka release and extract it:

1
2
$ tar -xzf kafka_2.13-3.2.1.tgz
$ cd kafka_2.13-3.2.1

2.START THE KAFKA ENVIRONMENT

NOTE: Your local environment must have Java 8+ installed.

Run the following commands in order to start all services in the correct order:

1
2
3
# Start the ZooKeeper service
# Note: Soon, ZooKeeper will no longer be required by Apache Kafka.
$ bin/zookeeper-server-start.sh config/zookeeper.properties

Open another terminal session and run:

1
2
# Start the Kafka broker service
$ bin/kafka-server-start.sh config/server.properties

Once all services have successfully launched, you will have a basic Kafka environment running and ready to use.

Read more »

1. What is event streaming?

Event streaming is the digital equivalent of the human body’s central nervous system. It is the technological foundation for the ‘always-on’ world where businesses are increasingly software-defined and automated, and where the user of software is more software.

事件流是人体中枢神经系统的数字等效物。它是”永远在线”世界的技术基础,在这个世界中,企业越来越多地由软件定义和自动化,并且软件的用户更多地是软件。

Technically speaking, event streaming is the practice of capturing data in real-time from event sources like databases, sensors, mobile devices, cloud services, and software applications in the form of streams of events; storing these event streams durably for later retrieval; manipulating, processing, and reacting to the event streams in real-time as well as retrospectively; and routing the event streams to different destination technologies as needed. Event streaming thus ensures a continuous flow and interpretation of data so that the right information is at the right place, at the right time.

从技术上讲,事件流是从事件源(如数据库、传感器、移动设备、云服务和软件应用程序)以事件流的形式实时捕获数据的实践;持久存储这些事件流以供以后检索;实时和回顾性地操作、处理和响应事件流;并根据需要将事件流路由到不同的目标技术。因此,事件流确保了数据的连续流动和解释,以便正确的信息在正确的时间出现在正确的位置。

Read more »

# Problems Difficulty Solutions
1 Two Sum Easy Two Sum
2 Add Two Sum Medium Add Two Number
3 Longest Substring Without Repeating Characters Medium Longest Substring Without Repeating Characters
4 Median of Two Sorted Arrays Hard Median of Two Sorted Arrays
5 Longest Palindromic Substring Medium Longest Palindromic Substring
10 Regular Expression Matching Hard Regular Expression Matching
12 Integer to Roman Medium Integer to Roman
22 Generate Parentheses Medium Generate Parentheses
39 Combination Sum Medium Combination Sum
42 Trapping Rain Water Hard Trapping Rain Water
90 Subsets II Medium Subsets II
94 Binary Tree Inorder Traversal Medium Binary Tree Inorder Traversal(简书)
108 Convert Sorted Array to Binary Search Tree Medium Convert Sorted Array to Binary Search Tree
122 Best Time to Buy and Sell Stock II Medium Best Time to Buy and Sell Stock II
136 Single Number Medium Single Number(简书)
144 Binary Tree Preorder Traversal Medium Binary Tree Preorder Traversal
167 Two Sum II - Input array is sorted Medium Two Sum II - Input array is sorted
238 Product of Array Except Self Medium Product of Array Except Self(简书)
260 Single Number III Medium Single Number III(简书)
268 Missing Number Medium Missing Number
309 Best Time to Buy and Sell Stock with Cooldown Medium Best Time to Buy and Sell Stock with Cooldown
318 Maximum Product of Word Lengths Medium Maximum Product of Word Lengths(简书)
319 Bulb Switcher Medium Bulb Switcher(简书)
338 Counting Bits Medium Counting Bits(简书)
343 Integer Break Medium Integer Break(简书)
347 Top K Frequent Elements Medium Top K Frequent Elements(简书)
357 Count Numbers with Unique Digits Medium Count Numbers with Unique Digits
377 Combination Sum IV Medium Combination Sum IV
492 Construct the Rectangle Easy Construct the Rectangle
530 Minimum Absolute Difference in BST Easy Minimum Absolute Difference in BST
535 Encode and Decode TinyURL Medium Encode and Decode TinyURL
599 Minimum Index Sum of Two Lists Easy Minimum Index Sum of Two lists
606 Construct String from Binary Tree Easy Construct String from Binary Tree
进度

Github

https://github.com/eazow/leetcode

作者

Eazow

版本

0.3.0.0