Recent posts

Atomic Operation in C#.Net

Introduction Atomic Operation is named academic to Linearizability, Atomicity is a guarantee of isolation from concurrent processes, it can be enfored by hardware level build on Cache Coherence protocol, or software level exclusive lock. In this blog post, I am going to explore a few number of mechanisms to achieve atomic operation in .Net. What are Atomic operations and what are not? In C# Specification, the stamement about atomic operation is: “Reads and writes of the following data types shall be atomic: bool, char, byte, sbyte, short, ushort, uint, int, float, and refere...

URL Rewrite Rules used by WayneYe.com

I've successfully transferred my website to winhost, now the architecture is IIS 7.5 + ASP.NET 4.0 + SQL Server 2008 R2 + HTML5, this blog post is a summary about URL Rewrite Rules used by WayneYe.com. RESTful URL for blogs Blog posts are absolutely the soul of a blog website, comparing with blog URL format: "/yyyy/MM/{Blog_Title}", I actually prefer "/Blog/{Blog_Title}", more simpler/shorter, in additional and more important, generally speacking,valuable content is valuable no matter when it was posted, for example, a developer is searching C# covariance & contravariance articles,...

Experiencing Windows 8 Tablet

This week is a Tablet week for me, Shilpa told me the Ipad2 I won in the Codeproject HTML5 & CSS3 competition had just arrived at Cupertino office, and my boss notified me he had successfully helped me bought an HP Touchpad - $99,  and my colleague Jun Yi participated Winndows Builld event hosted on Sep 13th in Anaheim, CA, no doubt, he got a free Windows 8 Tablet, I envy him, absolutely; however this afternoon, he kindly borrowed it to me for the entire China National Day, I appreciate him. My Ipad2 and HP Touchpad will be brought by Mr.X who will visit Shanghai office recently, I...

Print partial web content

Per project needs we need print part of a web page, which I have no idea when I saw this requirement, I googled and I read this post: http://www.huntingground.freeserve.co.uk/main/mainfram.htm?../scripts/printing.htm, it basically use document.write to write the content you want to print to a new window by window.open, it works, however I really don't like the opened window. Occasionally I tried to find out whether CSS can achieve such function, seemed I was on the right way: CSS media types is to control different display settings on different "media", controled completely b...

HTML5 WebMessaging In Essence

Download HTML5_Cross-Domain_WebMessaging_Demo.zip - 2.97 KB As a web developer, sometimes we are easy to encounter one problem: Cross-Domain communication, conforming Same-Origin-Policy, JavaScript code cannot access code stay in different domain(or sub-domain) or protocol (HTTP/HTTPs) or port, so there was no direct (or I can say: simple) way to achieve Cross-Domain Communication. However, those kinds of requirements does happen: page A and page B are in different domain,  B is "embedded" in A, i.e., there is an "iframe" in page A whose "src" is page B's URL, now page A want...

nodejs+express+jade+socket.io on Ubuntu 11.04

Introduction socket.io is a brilliant project which perfectly supports HTML5 WebSocket, in additional, it can fall back to flash or long polling when the client web browser does not support WebSocket, I explored it today on Ubuntu, I summarized the process in this post.   Install nodejs I used nodejs v0.4.11, the latest stable version, by mannually compile/make/install. sudo curl http://nodejs.org/dist/node-v0.4.11.tar.gz -o ~/Desktop/WayneDevLab/node.tar sudo tar -xf node.tar cd node-v0.4.11 ./configure make sudo make install In the "./configure" step above if it prompted "lib...

HTML5 WebSocket in Essence技术分享

今天下午,我非常荣幸受邀参加HTML5兴趣小组每月一次的沙龙活动,我给大家分享了HTML5 WebSocket的特性,协议本质,以及我的Team Poker demo。 第一次做技术分享,表面“淡定“,内心紧张,因语速较快原本打算持续1个小时左右的分享,大约40分钟就结束了,囧 现场照片 在谈各种comet技巧 PPT HTML5 WebSocket in Essence on Prezi 现场视频 摄影帅哥貌似对焦不实的说 下一次,希望更好!+U!

JavaScript - Foundation of the Language

Introduction JavaScript "was born under the shadow of Java" - Brenden Eich, it is "the most misunderstood programming language in the world" - Douglas Crockford. JavaScript was used so widely nowadays, nearly everywhere as long as you are using a web browser and surfing the internet, most of the websites have JS inside, and even server side - nodejs, according to http://langpop.com/, JavaScript is the fourth popular programming language in the world.  In this post I am trying to use refined language to cover some foundation of JavaScript (many of which con...

Exception handling particulars in C#

Background Exception handling appears in most .NET applications, this post is trying to describe some  Exception handling particulars in C# which might not take enough awareness from C# developers.  Differences between throw and throw ex  I guess every C# developer has seen code snippet below: try {     // Do some work, exception occurs } catch (IOException ex) {     // Exception caught, re-throw it to bubble up     throw ex; } In the catch block, we can rethrow the caught exception instance of IOException to higher level, an...

HTML5 Web Socket in Essence

HTML5 WebSocket defines a bi-directional, full-duplex communication channel operates through a single TCP connection, this article discusses its fantastic performance, the WebSocket protocol principle and its handshake mechanism, and develop a WebSocket application in action (Team Poker). </embed> Embeded youku video link because Youtube is outside of the largest "intranet" in the entire universe!! Table of Content Introduction Background WebSocket In Essence Experimental Demos Browser Support WebSocket JavaScript API Develop WebSocket In Action - Team Poker Open Issues Conclusio...