2012年3月

很多时候,总想一个比较有意义的div功能块始终显示在用户的眼前,也就是说当用户往下滚动网页的时候,也不会随着页面的滚动而隐藏这个div功能块.很常见的就是取得当前窗口的坐标.当页面滚动到某一个临界值的时候就给这个div添加一个css属性,然后让这个div保持到某一个坐标:

 

image

 

image

image

 

image

image

image 看看有时候完全能够让一个简单的东西看上去非常的美.整洁.而且对于每一个div都是添加了id和class还有title.这样的目的有什么呢?就是为了能够通过js来自动生成TOC也就是目录.简单美观的东西原来隐藏了很多的用心之处.

image

看看,就是这么简单.看着让人太爽!

http://torrentfreak.com/facebook-uses-bittorrent-and-they-love-it-100625/

BitTorrent设计的目的就是能够在很短的时间内传送大文件到很多个目的地.他们不仅仅只是让一般用户能够用来下载电影或者音乐,而是同样能够让企业从中获益.Facebook就在使用Bittorrent来很快的部署自己的代码到全球的服务器上.大访问量的服务提供商例如Facebook他们需要上千台的服务器来提供服务给用户.这样他们就必须在很短的时间内让用户不管是什么地方的都能够访问到最新的服务,就需要每一台服务器上面的代码都是最新的.

阅读剩余部分

前段时间接触了Mustache这个十分简单的模板系统,感觉挺不错的.正好我的那个记账的小站上还缺点功能,一直没有兴趣来实现,正好,练练手.

  • 一个htm页面.发送ajax请求.
  • 一个php文件,用来返回json数据.
  • 一个模板文件.用来和json生成页面到上面提到的主页面中.

其实之前也用到过ajax请求得到json数据.然后在js中一个个填充到页面中,只不过这样的页面代码看起来有点丑,而这个mustache正好能够帮助我们完成这个任务.

先看看这个第一个htm页面:

image

然后看看那个php代码:

image

然后这样就能够实现我对于往月花销分类的一个简单分类统计.

没有状态就靠兴趣好玩支撑了!

由Kyle Brandt发布在http://blog.serverfault.com/2011/02/11/stack-exchanges-architecture-in-bullet-points/

 

I thought as a break form the normal prose some of our readers might enjoy a short overview of the Stack Exchange Network (including Stack Overflow, Server Fault, and Super User) from a technical view:

Traffic:

  • 95 Million Page Views a Month
  • 800 HTTP requests a second
  • 180 DNS requests a second
  • 55 Megabits per second

Data Centers:

Production Servers*:

  • 12 Web Servers (Windows Server 2008 R2)
  • 2 Database Servers (Windows Server 2008 R2 and SQL Server 2008 R2)
  • 2 Load Balancers (Ubuntu Server and HAProxy)
  • 2 Caching Servers (Redis on CentOS)
  • 1 Router / Firewall (Ubuntu Server)
  • 3 DNS Servers (Bind on CentOS)

Software and Technologies Used:

Developers and System Administrators:

  • 14 Developers
  • 2 System Administrators

*(excludes fail over and management servers)

Posted by Kyle Brandt (@kylembrandt) on February 11th, 2011
Filed under Hardware, Software