Random Notes

Just a parking lot for some random notes.

count lines



kinit: talk to KDCkey distribution center=> kerberos use Authentication Server(AS) and Ticket Granting Server(TGS) Ticket Granting Ticket (TGT)




HATEOAS: Hypermedia As The Engine Of Application State


REST is not a protocol, a file format, or a development framework. It’s a set of design constraints: statelessness, hypermedia as the engine of application state, and so on.


hypertext = text + hyperlinks + others

Hypertext Application Language: HAL

Progressive Disclosure

Progressive Disclosure is a concept in User Interface Design which advocates only presenting to the user the information they need when they need it.


Internet Engineering Task Force

Domain Names

FQDN: Fully Qualified Domain Name: sometimes also referred as an absolute domain name is a domain name that specifies its exact location in the tree hierarchy of the Domain Name System(DNS)

TLD: Top Level Domains


MO: http://en.wikipedia.org/wiki/Modus_operandi

User Interfaces

  • service/API(REST)

probabilistically vs deterministically

data 16 bits example : RGB RGBA SHEER: xxxxxx33 OPAQUE xxxxxxFF



LIBSVM format: each line represents a labeled sparse feature vector where the indices are one-based and in ascending order. After loading, the feature indices are converted to zero-based.

label index1:value1 index2:value2 ...

Data System

  • Store data so that they, or another application, can find it again later (databases),
  • Remember the result of an expensive operation, to speed up reads (caches),
  • Allow users to search data by keyword or filter it in various ways (search indexes),
  • Send a message to another process, to be handled asynchronously (message queues),
  • Observe what is happening, and act on events as they occur (stream processing),
  • Periodically crunch a large amount of accumulated data (batch processing).


bootstrapping usually refers to a self-starting process that is supposed to proceed without external input. get (oneself or something) into or out of a situation using existing resources.


A modal window is a child window that disables parent window


因为 byte 是一个有符号的类型,所以在将 byte 数值-1 转换成 char 时,会发生

符号扩展。作为结果的 char 数值的 16 个位就都被置位了,因此它等于 216-1,

即 65535。从 char 到 int 的转型也是一个拓宽原始类型转换,所以这条规则告

诉我们,它将执行零扩展而不是符号扩展。作为结果的 int 数值也就成了 65535,

其结果没有达到两个数值之间的一半。对于 float 类型,加 1 不会产生任何效果 25 54

的最小级数是 2 ,即 33,554,432;而对于 double 类型,最小级数是 2 ,大约 16

是 1.8 × 10 。

毗邻的浮点数值之间的距离被称为一个 ulp,它是“最小单位(unit in the last

place)”的首字母缩写词。在 5.0 版中,引入了 Math.ulp 方法来计算 float

或 double 数值的 ulp。



  • SOAP: evolved as a successor of XML-RPC
  • Rewrite over Maintain: Small enough that you can throw them away
  • idempotence: the property of certain operations in mathematics and computer science, that can be applied multiple times without changing the result beyond the initial application. e.g. HTTP GET
  • abstraction

    • location transparency:
    • name transparency: Pricing Server
    • implementation transparency: JAVA/J2EE
    • access decoupling: RMI/IIOP
    • contract decoupling: (String, String)
  • ATB: Availability to business

C/C++: Null pointer is 0

Private git repo

bitbucket AWS CodeCommit

when things work fine, the less steps the better; when not, the granular the better


  • perplexity

  • zip’s law

  • maximum entropy

  • Loglog Counter or Bloom filter

  • zipfian

  • Count-Min Sketch or Stream-Summary UPnP

  • regularization( does not depend on data)

  • lasso: set weight to 0

  • ridge: almost zero

  • elastic-net: combining lass/ridge

guideline for this site

  • use only h1 and h2
  • distinguish internal links and external links
  • only 2 colors

static vs dynamic

static linking to deploy, dynamic linking to iterate

clang for testing(quick to compile, slower to run) cpp for deploy(slow to compile, quick to run)

Quantum Computing


data compression


Marker interface is an empty interface

DTO: https://en.wikipedia.org/wiki/Datatransferobject




https://www.digitalocean.com/features/one-click-apps/ app logo

layout: http://blog.visual.ly/how-to-design-transit-map-style-graphics/

background grey: #E4E7EA;

personal finance for engineers https://cs007.blog/


DSP(Demand-Side Platform) -> Ad Exchange -> SSP(Supply-Side Platform)

Most bad actors are Ads Arbitrage Businesses (AABs), who live on the thin margin between the cost of user acquisition and the ads revenue per user. They are only profitable if user acquisition is very cheap, and that leads them to take drastic action.

ubuntu ppa

Personal Package Archives


restrict HTTP referrer https://docs.aws.amazon.com/AmazonS3/latest/dev/example-bucket-policies.html#example-bucket-policies-use-case-4



Data Center

PUE: power utilization efficiency:

1.0: all power is used by servers 2.0: half of power is used by the building, half by servers


Danger Zone

Infinite Loop: https://en.wikipedia.org/wiki/Infinite_loop

Fork Bomb: https://en.wikipedia.org/wiki/Fork_bomb

Deadlock: https://en.wikipedia.org/wiki/Deadlock

Denial of Service: https://en.wikipedia.org/wiki/Denial-of-service_attack

Distributed denial-of-service (DDoS)

Classic Problems

Conway's Game of Life


Caesar Cipher









docker plumbing and porcelain pipe

I often find myself when programming hesitating to create new types. Instead I'll just use string, int, or float properties and I tell myself just use them appropriately. Sure. This almost always leads to problems. The reason I think is illustrated in the differences between Go and Chess. Go is more complex because the rules are simpler, which means almost counter-intuitively complexity increases quickly. For Chess there are 20 possible opening moves. For Go the first player has 361 possible moves. This greater degree of choice continues throughout the game. Go maps to the scenario using base types everywhere. Using a string that can be anything instead of a Date that would be more specific and a Birthday that would be even more specific. Chess maps to the using types scenario. Types reduce the number of moves your program can make, which reduces complexity, which makes it easier your program easier understand. This is why Chess was solved long ago by computers and Go only recently. So Go create types and simplify your life.

Game Theory


  • John Nash: A Beautiful Mind


  • minimax search with alpha-beta pruning: discrete state space, perfect information, turn-based game like chess and checkers
  • expectimax optimization


纳什均衡: http://36kr.com/p/5061790.html

octet stream = bytestream