The motivation of ebp register

The ebp (base pointer) register is associated with the stack primarily by software convention. On entry to a C function, the function’s prologue code normally saves the previous function’s base pointer by pushing it onto the stack, and then copies the current esp value into ebp for the duration of the function. If all the functions in a program obey this convention, then at any given point during the program’s execution, it is possible to trace back through the stack by following the chain of saved ebp pointers and determining exactly what nested sequence of function calls caused this particular point in the program to be reached. This capability can be particularly useful, for example, when a particular function causes an assert failure or panic because bad arguments were passed to it, but you aren’t sure who passed the bad arguments. A stack backtrace lets you find the offending function.

ANSI escape code

在linux console显示各种颜色的信息可以使用特殊的符号串:escape sequence code.通过使用escape sequence code可以在linux终端以高亮,粗体,闪烁、多种颜色等方式展示消息。

Carbon: Create and share beautiful images of your source code



现在的互联网充满了一个又一个信息孤岛和大量的碎片化的数据,用户想知道一些资讯,必须在不同的网站上跑来跑去.比如看电影,首先去google map查看周围的电影院,然后去大众点评网查看对这家电影院的评论,然后去电影院的网站上看看今天有什么电影上映。然后支付网站进行电子购票.整个过程非常繁琐,数据之间没有关联.充斥着大量的异构系统.

如果google,大众点评网,电影院,支付宝均开放自己的openapi.然后有一个mashup程序将他们整合起来.那么用户就能体验一站式购物.进这个网站,找到电影院,查看电影院评价,如果评价好,查看电影院上映什么节目。电子订票.然后就能直接杀过去了。省时省力 。

Linux containers in a few lines of code





Every operating system ever created tends to have its own boot loader. Installing a new operating system on a machine generally involves installing a whole new set of boot mechanisms, each with completely different install-time and boot-time user interfaces. Getting multiple operating systems to coexist reliably on one machine through typical chaining mechanisms can be a nightmare. There is little or no choice of boot loaders for a particular operating system — if the one that comes with the operating system doesn’t do exactly what you want, or doesn’t work on your machine, you’re screwed.

While we may not be able to fix this problem in existing proprietary operating systems, it shouldn’t be too difficult for a few people in the free operating system communities to put their heads together and solve this problem for the popular free operating systems. That’s what this specification aims for. Basically, it specifies an interface between a boot loader and a operating system, such that any complying boot loader should be able to load any complying operating system. This specification does not specify how boot loaders should work — only how they must interface with the operating system being loaded.


OAuth 2.0 的一个简单解释