关注开源代码的实际应用
Dean Edwards实现的Javascript Events管理:http://dean.edwards.name/weblog/2005/10/add-event/。特性:
addeventListener/attachEvent methodsthis keyword)
- // written by Dean Edwards, 2005
- // http://dean.edwards.name/
- function addEvent(element, type, handler) {
- // assign each event handler a unique ID
- if (!handler.$guid) handler.$guid = addEvent.guid++;
- // create a hash table of event types for the element
- if (!element.events) element.events = {};
- // create a hash table of event handlers for each element/event pair
- var handlers = element.events[type];
- if (!handlers) {
- handlers = element.events[type] = {};
- // store the existing event handler (if there is one)
- if (element["on" + type]) {
- handlers[0] = element["on" + type];
- }
- }
- // store the event handler in the hash table
- handlers[handler.$guid] = handler;
- // assign a global event handler to do all the work
- element["on" + type] = handleEvent;
- };
- // a counter used to create unique IDs
- addEvent.guid = 1;
- function removeEvent(element, type, handler) {
- // delete the event handler from the hash table
- if (element.events && element.events[type]) {
- delete element.events[type][handler.$guid];
- }
- };
- function handleEvent(event) {
- // grab the event object (IE uses a global event object)
- event = event || window.event;
- // get a reference to the hash table of event handlers
- var handlers = this.events[event.type];
- // execute each event handler
- for (var i in handlers) {
- this.$handleEvent = handlers[i];
- this.$handleEvent(event);
- }
- };
下面是一个改进版(防止内存泄漏):
- function addEvent(element, type, handler) {
- // assign each event handler a unique ID
- if (!handler.$guid) handler.$guid = addEvent.guid++;
- // assign each element a unique ID
- if (!element.$guid) element.$guid = addEvent.guid++;
- // create a hash table of event types for the element
- if (!addEvent.handlers[element.$guid]) addEvent.handlers[element.$guid] = {};
- // create a hash table of event handlers for each element/event pair
- var handlers = addEvent.handlers[element.$guid][type];
- if (!handlers) {
- handlers = addEvent.handlers[element.$guid][type] = {};
- // store the existing event handler (if there is one)
- if (element["on" + type]) {
- handlers[0] = element["on" + type];
- }
- }
- // store the event handler in the hash table
- handlers[handler.$guid] = handler;
- // assign a global event handler to do all the work
- element["on" + type] = handleEvent;
- };
- // a counter used to create unique IDs
- addEvent.guid = 1;
- // a global hash table containing all handlers
- addEvent.handlers = {};
- function removeEvent(element, type, handler) {
- // check if the element has a guid
- if (!element.$guid) return;
- // delete the event handler from the hash table
- if (addEvent.handlers[element.$guid] && addEvent.handlers[element.$guid][type]) {
- delete addEvent.handlers[element.$guid][type][handler.$guid];
- }
- };
- function handleEvent(event) {
- // grab the event object (IE uses a global event object)
- event = event || window.event;
- // get a reference to the hash table of event handlers
- var handlers = addEvent.handlers[this.$guid][event.type];
- // execute each event handler
- for (var i in handlers) {
- this.$handleEvent = handlers[i];
- this.$handleEvent(event);
- }
- };
- Blueprint CSS framework created by Olav Bjorkoy is a framework that offers an easily customizable grid, sensible typography, and even a stylesheet for printing. A lot of the CSS in this project is completely based on work by other people, like: Jeff Croft , Nathan Borror, Christian Metts, and Eric Meyer. The Blueprint CSS Framework is available for use in all personal or commercial projects, under both the MIT and the GPL license.
- YAML aka “Yet Another Multicolumn Layout”, is an (X)HTML/CSS framework for creating modern and flexible floated layouts. YAML created by Dirk Jesse fully supports all IE versions. The YAML framework is published under the Creative Commons Attribution 2.0 License, which permits both private and commercial use. YAML is also very flexible and comes with a bilingual documentation. YAML even has a layout/css builder, that allows visual configuration of the basic layout elements, that is very cool.
- 960 Grid System created by Nathan Smith is a CSS framework for grids. The 960 Grid System’s purpose is to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. The reason for 960 pixels is because 960 is divisible by 2, 3, 4, 5, 6, 8, 10, 12, 15, 16, 20, 24, 30, 32, 40, 48, 60, 64, 80, 96, 120, 160, 192, 240, 320 and 480. This makes it a highly flexible base number to work with.
- Logic CSS framework is a collection of CSS files and PHP utilities to cut development times for web-standards compliant xHTML layouts.
- ESWAT is web project framework kit that contains a folder structure and some pre-written components. The ESWAT framework is meant to remove the hassle of recreating the same folders, HTML tags, CSS rules, Photoshop guides, etc.
- Elements is a CSS Framework that was developed by Ben Henschel. It lets you write CSS easier, faster, more efficient, and allows you to organize all of your project files. Elements goes beyond being just a framework, it’s its own project workflow.YUI CSS库
http://developer.yahoo.com/yui/
YAML(Yet Another Multicolumn Layout)
http://www.yaml.de/en/
Content with Style: A CSS Framework
http://www.contentwithstyle.co.uk/Articles/17/
Blueprint
http://code.google.com/p/blueprintcss/
tripoli
http://monc.se/tripoli/
Elements
http://elements.projectdesigns.org/index.html
WYMstyle: a CSS framework
http://www.wymstyle.org/en/
taffy-css-framework
http://code.google.com/p/taffy-css-framework/
See Also:
CSS Framework CSS框架入门教程
blueprint--css framework研究
理解Web框架,和如何构建一个CSS框架
- public static bool Wildcard(string pattern, string input)
- {
- return Wildcard(pattern, 0, input, 0, false);
- }
- public static bool Wildcard(string pattern, string input, bool insensitive)
- {
- return Wildcard(pattern, 0, input, 0, insensitive);
- }
- private static bool Wildcard(string pattern, int p, string input, int i, bool insensitive)
- {
- for(; ; )
- {
- char ic = input[i];
- char pc = pattern[p];
- switch(pc)
- {
- case '?':
- break;
- case '*':
- p++;
- for(int j = i; j < input.Length; j++)
- {
- if(Wildcard(pattern, p, input, j, insensitive))
- {
- return true;
- }
- }
- return false;
- default:
- if(insensitive)
- {
- ic = char.ToLower(ic);
- pc = char.ToLower(pc);
- }
- if(ic != pc)
- {
- return false;
- }
- break;
- }
- i++;
- p++;
- if(p >= pattern.Length)
- {
- if(i >= input.Length)
- {
- return true;
- }
- return false;
- }
- else if(i >= input.Length)
- {
- return false;
- }
- }
- }
Cassini,是Asp.net上的一个项目。但是好像只有.Net 1.0 的。最新的叫 WebDev.WebServer2. 在.NET 安装包下面就有(不知道是否可以随意发布?). Codeplex 上有一个 Cassini 的包装器,支持.NET2.0, 可以让你在计算机内针对任意目录,右键支持直接将其转变为虚拟目录,进行Web服务.
以下为几个有用的链接,有心进行Asp.net程序桌面移植的朋友,可以看看.
http://www.codeplex.com/WebServiceHoster 自己在桌面程序中支持 Asp.net Host, 基于Cassini
http://www.codeplex.com/CassiniWrapper
UltiDev Cassini Web Server: 不同与微软的那个 Cassini, 但是支持 .NET 目前所有的版本(1.0-3.5)
http://ultidev.com/products/Cassini/index.htm
其他应用文章
http://zhq.ahau.edu.cn/blog/article.asp?id=288
http://zhq.ahau.edu.cn/blog/article/297.htm
http://tv9.cnblogs.com/articles/73176.html
Mono XSP
http://www.mono-project.com/ASP.NET
Small and Reliable C++ HTTP Server with Complete ASP.NET Support
1. MAD: MPEG Audio Decoder
http://www.underbit.com/products/mad/ or http://sourceforge.net/projects/mad/
MAD is a high-quality fixed-point MPEG audio decoder with 24-bit output. The implementation is entirely new, based on the ISO/IEC standards, and performs especially well on systems without native floating-point support.
2. Mpadec
http://sourceforge.net/projects/mpadec
Mpadec is a high-quality portable MPEG audio decoder library. It supports MPEG-1, MPEG-2 Layer I, Layer II and Layer III audio streams, including free-format streams.
3.MPG321
http://mpg321.sourceforge.net/
mpg321 is a Free replacement for mpg123, a very popular command-line mp3 player. mpg123 is used for frontends, as an mp3 player and as an mp3 to wave file decoder (primarily for use with CD-recording software.) In all of these capacities, mpg321 can be used as a drop-in replacement for mpg123.
4.MGP123
http://sourceforge.net/projects/mpg123
mpg123 is the fast and Free (LGPL since version 0.60) console based real time MPEG Audio Player for Layer 1, 2 and 3. It uses floating point math (unlike libmad). Starting with version 1.0, in also contains an up-to-date decoding library usable by 3rd party.
5.FOOBAR2000
http://www.foobar2000.org/
The foobar2000 SDK contains a bugfixed C++ version of the mpg123 C code
可通过System.Environment.Version.ToString()取得当前CLR版本号,然后对照下表得到Revision版本:
| .NET Framework version | Revision | Version |
|---|---|---|
| 3.5 | Original release | 3.5.21022.8 |
| 3.5 | Service Pack 1 | 3.5.30729.1 |
| 3.0 | Original release | 3.0.4506.30 |
| 3.0 | Service Pack 1 | 3.0.4506.648 |
| 3.0 | Service Pack 2 | 3.0.4506.2152 |
| 2.0 | Original release | 2.0.50727.42 |
| 2.0 | Service Pack 1 | 2.0.50727.1433 |
| 2.0 | Service Pack 2 | 2.0.50727.3053 |
| 1.1 | Original release | 1.1.4322.573 |
| 1.1 | Service Pack 1 | 1.1.4322.2032 |
| 1.1 | Service Pack 1 (Windows Server 2003 32-bit version*) | 1.1.4322.2300 |
| 1.0 | Original release | 1.0.3705.0 |
| 1.0 | Service Pack 1 | 1.0.3705.209 |
| 1.0 | Service Pack 2 | 1.0.3705.288 |
| 1.0 | Service Pack 3 | 1.0.3705.6018 |
.NET DiscUtils
纯C#实现读写ISO和VHD文件的类库,以Stream进行文件读写,无需将整个文件加载到内存中。当前支持的文件系统格式:FAT、NTFS(只读)、VHD和VDI。范例:
①、新建一个ISO文件:
- CDBuilder builder = new CDBuilder();
- builder.UseJoliet = true;
- builder.VolumeIdentifier = "A_SAMPLE_DISK";
- builder.AddFile(@"Folder\Hello.txt", Encoding.ASCII.GetBytes("Hello World!"));
- builder.Build(@"C:\temp\sample.iso");
可以像上面那样以byte数组添加文件,也可以直接从Windows文件系统中加载,或者也可以是个Stream。生成的结果保存到Stream中,也可以直接保存到Windows的文件系统中。
②、从ISO文件中读取文件
- using (FileStream isoStream = File.Open(@"C:\temp\sample.iso"))
- {
- CDReader cd = new CDReader(isoStream, true);
- Stream fileStream = cd.OpenFile(@"Folder\Hello.txt", FileMode.Open);
- // Use fileStream...
- }
目录结构以cd.Root为起点。
③、新建一个虚拟硬盘:
- long diskSize = 30 * 1024 * 1024; //30MB
- using (Stream vhdStream = File.Create(@"C:\TEMP\mydisk.vhd"))
- {
- Disk disk = Disk.InitializeDynamic(vhdStream, diskSize);
- BiosPartitionTable.Initialize(disk, WellKnownPartitionType.WindowsFat);
- using (FatFileSystem fs = FatFileSystem.FormatPartition(disk, 0, null))
- {
- fs.CreateDirectory(@"TestDir\CHILD");
- // do other things with the file system...
- }
- }
文件系统以fs.Root作为起点。
④、新建一个虚拟软盘:
- using (FileStream fs = File.Create(@"myfloppy.vfd"))
- {
- using (FatFileSystem floppy = FatFileSystem.FormatFloppy(fs, FloppyDiskType.HighDensity, "MY FLOPPY "))
- {
- using (Stream s = floppy.OpenFile("foo.txt", FileMode.Create))
- {
- // Use stream...
- }
- }
- }
Image Master
用于读写iso文件的.Net应用程序,主要特性:
* Read the contents of image files before burning them to disc.
* Extract the contents of image files without burning them to disc.
* Burn an image file to disc.
* Burn files and/or folders directly to disc.
* Supports multi-session burning.
* Create image files for archiving.
* Convert Bin Image Files (.bin), Nero Image Files (.nrg), Alcohol Image Files (.mdf), CloneCd Image Files (.img), DiscJuggler Image Files (.cdi) to iso images.


在Windows XP SP2刻录光盘需要安装Imapi v2.0,在Windows Vista默认就已经安装了。
C#实现的一个类库,用于操作ISO9660映像(.iso/.bin/.mdf...) ,主要特性:
* Read ISO9660 discs images (supported formats are .iso/.bin/.mdf and CloneCd image).
* Extract from discs images are by file or full.
* Create an iso disc image file from CD/DVD source.
* Convert from several disc image format to iso disc image file (supported formats are .bin/.mdf/.nrg/.img/.cdi).
* Create iso disc image file from a source directory (not available yet).
* Burn iso file.
1、radasm
http://www.radasm.com/
2、masm32
http://www.masm32au.com/masm32/m32v10r.zip
3、masmplus
http://www.aogosoft.com/masmplus/idesetup.exe
4、nasm
http://sourceforge.net/projects/nasm
5、TASM 5.0
http://www.programfan.com/download/down.asp?id=214&url=1
6、WINASM
http://www.winasm.net/
7、Visual ASM 6.0
http://blog.ednchina.com/visualasm/80011/message.aspx