自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(12)
  • 资源 (2)
  • 收藏
  • 关注

原创 论经济学、宗教及人类的社会生活

经济学不仅仅要保证效率也要保证公平。譬如过去利用民劳力贱而征过去开运河,到老了这群人必然得腰肌劳损、关节炎类风湿而死。现在则是虽然民工的工价高了,但这群人也没有什么社保,荒谬的是他们现在还要交钱。老了必然也没有什么好下场。何况价高卖苦力赚来的纸币最终也会随着货币滥发通货膨胀一文不值。说白了,经济学只是政府及其官-僚-系-统奴-役-劳动人民的工具。同样,就算劳动人民觉悟了,起来革

2016-05-29 16:06:33 581

原创 阅读王垠《怎样写一个解释器》一文后的一些体会

http://www.yinwang.org/blog-cn/2012/08/01/interpreter 怎样写一个解释器R2语言实现了表达式解释器,支持单变量let绑定、函数调用、函数作为参数传递(对于FP解释器而言这实际上不是问题),讲解了文法作用域与闭包的概念。缺点:直接利用了Racket语言的match语言,这有点偷懒,不过作者确实也说了不考虑parser的一些琐碎问题,

2016-05-27 12:30:39 2518

原创 React.js Essentials - Packt 2015(读书笔记)

React.js Essentials目录1安装开发环境2创建你的第一个React Element3React组件(状态机)4使React组件变成响应式的5React组件里使用其他库6更新React组件7创建复杂的React组件8Jest测试9Flux10Flux无痛项目维护安装开发环境Tw

2016-05-26 12:47:40 1153

原创 租房签合同之前的注意事项

租房签合同之前的注意事项0、确认房间内是否有异味1、确认房间面积2、确认是否南北通透(白天的通风)3、确认窗帘是否不透光(睡眠时的光线污染影响睡眠质量)4、确认床的大小(越大越好)5、谨记一条:签合同交钱之前,你是老大;签合同之后,房东是老大6、确认合同签几年,若要求必须签一年,可能哪里有问题  强势的房东可能是因为房源紧张,但也有可能表面房屋哪里存在问题,

2016-05-20 13:37:48 1605

原创 最近在上海浦东新区的租房经历

最近在上海浦东新区的租房经历缘起:我原来租住在张江镇的古桐五村,和一对房东老夫妻合住,租金从一开始的1600涨到1900(包水电)。一个月前房东老太突然说不租了,但是之前由于没有续签正式的合同,导致我很被动。3天前房东老汉却又说可以涨到2200续租。这2人表里不一,一个唱红脸一个唱黑脸的行为深深令我厌恶。再加上之前他们表现出的精明铿吝,我决心搬家。听公司的HR胖姐说川沙那边

2016-05-17 11:27:01 4761

原创 基于node-http-proxy的脚本:功能更新,现在支持把GFW屏蔽的URL作快速404失败返回处理;支持把墙外的CDN url映射为本地host

"use strict";//to support let-of syntax;var ProxyPort = 8888;var http = require('http'), net = require('net'), url = require('url'), httpProxy = require('http-proxy'); //需要安装Node 5.0,

2016-05-15 20:00:25 1554 1

原创 Pragmatic Scala:Create Expressive, Concise, and Scalable Applications (读书笔记)

Pragmatic Scala:Create Expressive, Concise, and Scalable Applications目录1From Java to Scala2Objects3Types4Function Values and Closures5Traits6Collections7模式匹配与正则

2016-05-11 18:55:01 991

原创 阅读WebKit最近搞的一个存储开销小的、快速自适应的Locking机制

https://webkit.org/blog/6161/locking-in-webkit/主要受Linux内核futex设计的启发:https://www.kernel.org/doc/ols/2002/ols2002-pages-479-495.pdf Fuss, Futexes and Furwocks: Fast Userlevel Locking in Linux

2016-05-08 17:51:00 594

原创 Mozilla Rust最近发布的MIR的一个评论

原来Rust似乎是直接从AST翻译到LLVM IR,现在则拆分为HIR和MIR了。什么是MIR呢?仔细看了原始的blog文章和RFC,可以认为MIR其实就是对CFG的一种抽象,只有内存结构,没有线性化的序列化反序列化表示。这里要理解的一个核心概念是:AST只是高级层面的对原始语言的文法结构抽象,直接对应于前端parser的处理结果。而这个AST下降到MIR要做一系列的程序转换:这里

2016-05-08 16:19:35 1232

原创 基于DevTools协议+Chromium headless的客户端爬虫框架

之前的做法是使用PhantomJS以及一个html+嵌套iframe包含目标网站URL+跨域dom操作的简单性能优化。PhantomJS实现下面的核心需求:(1)无头模式,然而PhantomJS内核基于老版本的QtWebKit,与最新版本的Chromium代码相比,版本太老了,很多特性用不了(虽然目前国内网站应该也还没开始用上这些?比如ServiceWorker、CSS Custo

2016-05-08 16:08:04 6161

原创 经典的基于图着色模型的寄存器分配

经典的基于图着色模型的寄存器分配:1、如果变量(在指令/语句序列中,或称程序“基本块”?)不再被use(def也是use),则它dead2、否则变量live(活着)3、如果2个变量在一个block/program中都是live,则不能赋以相同的寄存器,在对应的RIG(register inference graph)中,在这2个变量节点之间连接一条边由上面的描述

2016-05-07 14:58:24 6208

转载 增加人口的好办法

增加人口的好办法:(1)允许一夫多妻制(2)每一个妻子只要有娃生,就直接分走富人财产的一部分,不需要等到遗产继承若富人不生娃,最终的结果就是财产充公。

2016-05-05 22:13:47 705

TCP/IP Sockets in Java, 2rd Edition

Contents Preface xi 1 Introduction 1 1.1 Networks, Packets, and Protocols 1 1.2 About Addresses 4 1.3 About Names 6 1.4 Clients and Servers 6 1.5 What Is a Socket? 7 1.6 Exercises 8 2 Basic Sockets 9 2.1 Socket Addresses 9 2.2 TCP Sockets 15 2.2.1 TCP Client 16 2.2.2 TCP Server 21 2.2.3 Input and Output Streams 25 2.3 UDP Sockets 26 2.3.1 DatagramPacket 27 2.3.2 UDP Client 29 2.3.3 UDP Server 34 2.3.4 Sending and Receiving with UDP Sockets 36 2.4 Exercises 38 3 Sending and Receiving Data 39 3.1 Encoding Information 40 3.1.1 Primitive Integers 40 3.1.2 Strings and Text 45 3.1.3 Bit-Diddling: Encoding Booleans 47 3.2 Composing I/O Streams 48 3.3 Framing and Parsing 49 3.4 Java-Specific Encodings 55 3.5 Constructing and Parsing Protocol Messages 55 3.5.1 Text-Based Representation 58 3.5.2 Binary Representation 61 3.5.3 Sending and Receiving 63 3.6 Wrapping Up 71 3.7 Exercises 71 4 Beyond the Basics 73 4.1 Multitasking 73 4.1.1 Java Threads 74 4.1.2 Server Protocol 76 4.1.3 Thread-per-Client 80 4.1.4 Thread Pool 82 4.1.5 System-Managed Dispatching: The Executor Interface 84 4.2 Blocking and Timeouts 86 4.2.1 accept(), read(), and receive() 87 4.2.2 Connecting and Writing 87 4.2.3 Limiting Per-Client Time 87 4.3 Multiple Recipients 89 4.3.1 Broadcast 90 4.3.2 Multicast 90 4.4 Controlling Default Behaviors 95 4.4.1 Keep-Alive 96 4.4.2 Send and Receive Buffer Size 96 4.4.3 Timeout 97 4.4.4 Address Reuse 97 4.4.5 Eliminating Buffering Delay 98 4.4.6 Urgent Data 98 4.4.7 Lingering after Close 99 4.4.8 Broadcast Permission 99 4.4.9 Traffic Class 100 4.4.10 Performance-Based Protocol Selection 100 4.5 Closing Connections 101 4.6 Applets 107 4.7 Wrapping Up 107 4.8 Exercises 108 5 NIO 109 5.1 Why Do We Need This? 109 5.2 Using Channels with Buffers 112 5.3 Selectors 115 5.4 Buffers in Detail 121 5.4.1 Buffer Indices 121 5.4.2 Buffer Creation 122 5.4.3 Storing and Retrieving Data 124 5.4.4 Preparing Buffers: clear(), flip(), and rewind() 126 5.4.5 Compacting Data in a Buffer 128 5.4.6 Buffer Perspectives: duplicate(), slice(), etc. 129 5.4.7 Character Coding 131 5.5 Stream (TCP) Channels in Detail 132 5.6 Selectors in Detail 135 5.6.1 Registering Interest in Channels 135 5.6.2 Selecting and Identifying Ready Channels 138 5.6.3 Channel Attachments 140 5.6.4 Selectors in a Nutshell 140 5.7 Datagram (UDP) Channels 141 5.8 Exercises 145 6 Under the Hood 147 6.1 Buffering and TCP 150 6.2 Deadlock Danger 152 6.3 Performance Implications 155 6.4 TCP Socket Life Cycle 155 6.4.1 Connecting 156 6.4.2 Closing a TCP Connection 160 6.5 Demultiplexing Demystified 163 6.6 Exercises 165 Bibliography 167 Index 169

2008-11-28

Advanced Data Structures

里面讲述了许多特殊的索引树结构,推荐! Preface page xi 1 Elementary Structures 1 1.1 Stack 1 1.2 Queue 8 1.3 Double-Ended Queue 16 1.4 Dynamical Allocation of Nodes 16 1.5 Shadow Copies of Array-Based Structures 18 2 Search Trees 23 2.1 Two Models of Search Trees 23 2.2 General Properties and Transformations 26 2.3 Height of a Search Tree 29 2.4 Basic Find, Insert, and Delete 31 2.5 Returning fromLeaf to Root 35 2.6 Dealing with Nonunique Keys 37 2.7 Queries for the Keys in an Interval 38 2.8 Building Optimal Search Trees 40 2.9 Converting Trees into Lists 47 2.10 Removing a Tree 48 3 Balanced Search Trees 50 3.1 Height-Balanced Trees 50 3.2 Weight-Balanced Trees 61 3.3 (a, b)- and B-Trees 72 3.4 Red-Black Trees and Trees of Almost Optimal Height 89 3.5 Top-Down Rebalancing for Red-Black Trees 101 3.6 Trees with Constant Update Time at a Known Location 111 3.7 Finger Trees and Level Linking 114 vii 3.8 Trees with Partial Rebuilding: Amortized Analysis 119 3.9 Splay Trees: Adaptive Data Structures 122 3.10 Skip Lists: Randomized Data Structures 135 3.11 Joining and Splitting Balanced Search Trees 143 4 Tree Structures for Sets of Intervals 148 4.1 Interval Trees 148 4.2 Segment Trees 154 4.3 Trees for the Union of Intervals 162 4.4 Trees for Sums of Weighted Intervals 169 4.5 Trees for Interval-Restricted Maximum Sum Queries 174 4.6 Orthogonal Range Trees 182 4.7 Higher-Dimensional Segment Trees 196 4.8 Other Systems of Building Blocks 199 4.9 Range-Counting and the Semigroup Model 202 4.10 kd-Trees and Related Structures 204 5 Heaps 209 5.1 Balanced Search Trees as Heaps 210 5.2 Array-Based Heaps 214 5.3 Heap-Ordered Trees and Half-Ordered Trees 221 5.4 Leftist Heaps 227 5.5 Skew Heaps 235 5.6 Binomial Heaps 239 5.7 Changing Keys in Heaps 248 5.8 Fibonacci Heaps 250 5.9 Heaps of Optimal Complexity 262 5.10 Double-Ended Heap Structures and Multidimensional Heaps 267 5.11 Heap-Related Structures with Constant-Time Updates 271 6 Union-Find and Related Structures 278 6.1 Union-Find: Merging Classes of a Partition 279 6.2 Union-Find with Copies and Dynamic Segment Trees 293 6.3 List Splitting 303 6.4 Problems on Root-Directed Trees 306 6.5 Maintaining a Linear Order 317 7 Data Structure Transformations 321 7.1 Making Structures Dynamic 321 7.2 Making Structures Persistent 330 8 Data Structures for Strings 335 8.1 Tries and Compressed Tries 336 8.2 Dictionaries Allowing Errors in Queries 356 8.3 Suffix Trees 360 8.4 Suffix Arrays 367 9 Hash Tables 374 9.1 Basic Hash Tables and Collision Resolution 374 9.2 Universal Families of Hash Functions 380 9.3 Perfect Hash Functions 391 9.4 Hash Trees 397 9.5 Extendible Hashing 398 9.6 Membership Testers and Bloom Filters 402 10 Appendix 406 10.1 The Pointer Machine and Alternative Computation Models 406 10.2 External Memory Models and Cache-Oblivious Algorithms 408 10.3 Naming of Data Structures 409 10.4 Solving Linear Recurrences 410 10.5 Very Slowly Growing Functions 412 11 References 415 Author Index 441 Subject Index 455

2008-11-28

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除