自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 微软的垃圾Windows 10,简直就是一坨屎!!!!!!!

http://answers.microsoft.com/zh-hans/windows/forum/windows_10-start/%E5%BC%80%E5%A7%8B%E7%95%8C%E9%9D%A2%E5%92%8C/198f7ce4-120c-474e-85b4-f9e9fb856756开始界面和消息栏无法打开鲲卓 提问时间 八月 13, 2015

2016-06-28 15:01:48 11100

原创 CSS Floating:Floats and Float Shapes-O'Reilly 2016(读书笔记)

CSS Floating:Floats and Float Shapesfloat: left|right|none;不能超出其containing block的范围;也不能超过其所在行前面的line box元素的top(嗯?)冲突:如果浮动元素的宽度高度超过其containing block的范围怎么办?默认允许bottom溢出(因为规范只

2016-06-25 22:27:10 891 1

原创 单调栈:平面上N个底部对齐紧靠在一起的矩形,宽高是任意整数,求其最大内切矩形的面积(版本2)

注意,RangeItem里有了width的状态定义,实际上不需要2次遍历,新代码如下:include #include #include struct Box { int width; int height;};struct RangeItem { int start_index=-1; int end_index=-1; int widt

2016-06-25 00:38:44 650

原创 单调栈:平面上N个底部对齐紧靠在一起的矩形,宽高是任意整数,求其最大内切矩形的面积

//// acm-icpc-mono-stack.cpp#include #include #include struct Box { //Or name to Rect; int width; int height;};struct RangeItem { int start_index=-1; int end_index=-1; in

2016-06-25 00:12:04 481

原创 HTML5页面渲染性能的”程序转换“思路

做浏览器内核引擎的,一般都会考虑怎么做性能优化,这个优化实际上包括下面的内容:(1)内存占用的优化,特别是对于嵌入式设备尤其重要,chromium有个blimp thin client的模块,不知道有没有用处;(2)渲染性能的提高,注意核心就是尽量利用硬件GPU来做渲染,避免CPU计算和内存Copy的开销(3)网络IO性能的提高,改善页面加载、响应数据,乃至云加速压缩流量、广告过滤屏蔽

2016-06-22 20:43:32 1304

原创 Chromium内核net模块disk cache/index file的文件存储机制

http://localhost:8080/source/xref/greentea-7.2/net/disk_cache/simple/simple_index_file.cc (M43版本)// static// staticvoid SimpleIndexFile::Deserialize(const char* data, int data_len,

2016-06-21 16:50:05 1295

原创 Chromium的当前net/disk_cache/simple file模块没有实现缓存的原子更新

问题:当服务器端初始响应浏览器的HTTP GET请求并设置Date头部字段,浏览器缓存了cache的第一个版本;其后下一次请求revalidate时,浏览器设置If-Modified-Since,并期望得到一个304。不幸的是,浏览器却返回了200,并重新发回完整的response body响应。这种情况下,Chromium的net/disk_cache/simple file模块将尝试更新cac

2016-06-20 12:58:29 1021

原创 关于XSS和CSRF

XSS(跨站)指的是CMS/SNS类网站没有对用户输入进行安全过滤,导致用户可以上传恶意的html代码,并引诱此网站的其他用户访问包含了恶意代码的页面,导致用户信息泄露,甚至可以扩展为蠕虫病毒。CSRF(跨域)指的是在攻击者控制的A网站上制作特定的URL链接,理论上来讲,受害者(用户)如果点击这个链接,会导致对目标B网站的访问,而用户可能当前浏览器Tab页面中B网站处于登录状态,这样就会导

2016-06-17 23:22:05 526

原创 浏览器多用户Profile容器化技术

Mozilla Firefox最近推出了浏览器的多用户容器化模式。简单说来,就是创建多个隔离的用户Profile,这样就可以允许多个用户登录使用。事实上,我比较鄙视Mozilla,浏览器核心技术毫无创新,Pdf.js让人惊喜了一下,但是Asm.js这种Type Hints的编译器优化技术一个High点都没有。不过这也说明Mozilla里面有一些产品和PR做得顺溜的人,比如那个Don

2016-06-17 23:05:30 976

原创 关于“微信订阅号/制作相册”

微信订阅号/制作相册:用户上传几张图片,然后选择参数,发布为一个带有动画特效的“相册”。纯粹就是一个功能单一的web服务吧,这里主要的问题在于图片数据托管存在哪里? 其实搞个“绿茶订阅号”也没什么打不了的,不过问题是,图片存储这个网络传输过程很不可靠。可以做成本地模式。但是复杂的“个性化编辑”功能就需要较大的开发量。 这里的一个问题是:用户不满意页面上的版权性文字(XXX制

2016-06-17 22:43:05 8689

原创 Another active Homebrew process is already using mysql问题的解决方法

brew install mysqll命令执行到一半,屏幕锁屏了,结果重现打开进去后,进度不动了,Ctrl + Z结束掉,然后:chenzhixiangdeMacBook-Pro:my-yesod-project chenzhixiang$ brew install mysqlError: Operation already in progress for mysqlAnother act

2016-06-17 15:33:21 3440

原创 下一个高性能Web框架应该选择哪一个????

Phonenix(基于Erlang/Elixir语言的):Erlang虚拟机的并发、可靠性做得不错,并且它有20年的工业应用历史。JVM还没这么长呢Python 3.5 + TornadoTornado的generator用来做异步IO编程挺不错的,但是当前4.3版本老是不更新,对HTTP/2的支持也不到位。NodeJS+Express/Koa?JavaScript

2016-06-17 13:42:18 2413

原创 HTTP/2在一个TCP连接里以frame封装的数据包方式多工传输。

HTTP/2在一个TCP连接里以frame封装的数据包方式多工传输。UDP本身支持数据包,但是UDP不保证到达顺序。在一个TCP stream上传输多个虚拟流的frame,解决了顺序问题、阻塞问题,同时还避免了连接反复建立的开销。同时,HTTP/2支持https(TLS)加密,保证端到端通信的安全。不足之处:(1)对于低性能低嵌入式设备,部署http2会不会代价太大?

2016-06-17 10:56:48 1886

原创 dumpheaders_http_threading_server.py脚本的Python 3.5迁移版

该脚本的主要用处是作为http服务器使用,并且可以输出请求/响应的http头部。import http.serverimport timeimport socketserverimport osimport threadingimport socketPORT = 8000class MyThreadingHTTPServer(socketserver.ThreadingTC

2016-06-06 18:11:27 616

原创 rMBP安装日志:brew install gcc

chenzhiangdeMBP:openresty-1.9.15.1 chenzhixiang$ brew install gcc==> Installing dependencies for gcc:gmp, mpfr, libmpc, isl==> Installing gcc dependency:gmp==> Downloading https://homebrew.b

2016-06-06 18:03:05 3222

原创 Python 3.5 HTTP服务器端重定向测试脚本

#!/usr/bin/python3import sysimport socketserverimport socketimport http.serverimport threadingimport io# Use supplied portif sys.argv[1:]: port = int(sys.argv[1])else: port = 8889

2016-06-04 15:58:59 2593

原创 从支持异步并发编程的Web后端框架到数据存储服务的分布式一致性哈希路由

异步并发框架应该可以解决web后端开发的IO性能问题,比如node、go?、tornado、openresty?,剩下的就是数据存储如何做切分和LB了,当然,可以考虑使用内存数据库,这样数据存储不需要管持久化关键的持久化仍然可以使用mysql,要么做主从分离,要么做jdbc前端转发,但是mysql的水平切分仍然是个技术活(对于业务逻辑复杂的情况)假如不考虑索引需求,所有

2016-06-01 21:42:02 1026

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关注的人

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