XML CDATA部分

<![CDATA[<greeting>Hello, world!</greeting>]]>

Perl 清理已翻译为HTML的Word文档

#/usr/local/bin/perl    -w
use strict;

#############################################################
#                                                           #
#                                                           #
#                                                           #
#                      NOAH SUSSMAN                         #
#                                                           #
#                     clean up word                         #
#                                                           #
#                Created 5/16/01 at 02:33 PM                #
#                                                           #
# Clean up Word documents that have been translated to HTML #    
#                                                           #
#                                                           #
#############################################################

@ARGV[0] = "Macintosh HD:NOAH:2001:05-MAY 2001:3-May 15-21:3-Revisions to Corp Site:large number of Word docs:1.2 Services.html" ;

$^I=".bk";

undef $/ ;           # slurp the whole file into $_

while (<>) {

	s{<(?!/?(a|b|img|center|p|ul|ol|li|table|td|tr|html|body|head|title))\s*[^>]*>\s*}{}gi;    # Destroy all tags except A, B, IMG, CENTER, P, UL, OL, LI, TABLE, TD, TR, HTML, BODY, HEAD and TITLE

	s{<(\w+)>(.*?)<([^$1])>(.*?)<(/$1)>(.*?)<(/$2)>}{<$3>$2<$1>$4<$5>$6<$7>}gi;    #  Fix mis-nested tags, if any.

	print $_ ;
	
}

Bash 在linux系统上查找有关PCI卡的信息

lspci

JavaScript 登录Firebug

console.log(variable);

ActionScript 3 ls的bash颜色

bash$ export CLICOLOR=1

bash$ export TERM=xterm-color

DOS Batch 更改cmd shell显示模式

@ECHO OFF
REM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
REM
REM FILENAME		 : DOSMODE.BAT
REM	
REM DESCRIPTION		 : Change console mode to display as in old DOS Mode
REM 
REM AUTHOR		 : Napoleon Arouldas S. (princeofcode@gmail.com)
REM 
REM WEB                  : http://neps.in 
REM	
REM DATE WRITTEN	 : Sunday, October 07, 2007 6:10:58 PM
REM
REM COMMENTS/REMARKS	 : Use it, when you would like to have a big pretty  looking fonts for your
REM                             cmd shell in windows. Works with windows XP
REM
REM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MODE CON LINES=25 COLS=80

JavaScript Mootools:Fx.Scroll将页面移动到顶部

var scroller = new Fx.Scroll(document.body);
$('link_to_top').addEvent('click', function(){
	scroller.toTop();
}

Bash SCP

scp -r username@host:/dir

scp username@host:/file

XML Hibernate Maven项目对象模型(pom.xml)

<project xmlns="http://maven.apache.org/POM/4.0.0" 
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
           http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>uz.boo</groupId> 
  <artifactId>hibernate-test</artifactId>
  <version>1.0-SNAPSHOT</version>
  <name>Hibernate Test</name>
  <packaging>war</packaging> 
  <dependencies> 
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate</artifactId>
      <version>3.2.5.ga</version>
      <exclusions>
        <exclusion>
          <groupId>javax.transaction</groupId>
          <artifactId>jta</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>org.apache.geronimo.specs</groupId>
      <artifactId>geronimo-jta_1.1_spec</artifactId>
      <version>1.1</version>
    </dependency>
    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <version>1.2.14</version>
    </dependency>
    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-annotations</artifactId>
      <version>3.3.0.ga</version>
    </dependency>
    <dependency>
      <groupId>org.hibernate</groupId>
      <artifactId>hibernate-commons-annotations</artifactId>
      <version>3.3.0.ga</version>
    </dependency>
  </dependencies>
  <build>
    <extensions> 
      <extension>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.14</version>
      </extension>
    </extensions>
    <plugins>
      <plugin> 
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
      <plugin> 
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>hibernate3-maven-plugin</artifactId>
        <version>2.0</version>
        <executions>
          <execution>
            <id>generate-ddl</id>
            <phase>process-classes</phase>
            <goals>
              <goal>hbm2ddl</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <reporting> 
    <plugins>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>jxr-maven-plugin</artifactId>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-report-plugin</artifactId>
      </plugin>
    </plugins>
  </reporting>
</project>

ASP Sinc功能

<%
    ' Copyright (c) 2008, reusablecode.blogspot.com; some rights reserved.
    '
    ' This work is licensed under the Creative Commons Attribution License. To view
    ' a copy of this license, visit http://creativecommons.org/licenses/by/3.0/ or
    ' send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California
    ' 94305, USA.
    
    Const M_PI = 3.14159265358979323846
    
    ' Unnormalized sinc function.
    function sinc(x)
        sinc = sin(x) / x
    end function

    ' Normalized sinc function.
    ' REQUIRES: constant M_PI
    function nsinc(x)
        sinc = sin(M_PI * x) / (M_PI * x)
    end function
%>