<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ursob &#187; Others</title>
	<atom:link href="http://ursob.org/category/others/feed/" rel="self" type="application/rss+xml" />
	<link>http://ursob.org</link>
	<description>Code &#38;&#38; Riff</description>
	<lastBuildDate>Thu, 29 Jul 2010 09:37:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>wp-Syntax支持的标签</title>
		<link>http://ursob.org/2010/07/29/wp-syntax/</link>
		<comments>http://ursob.org/2010/07/29/wp-syntax/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 09:34:10 +0000</pubDate>
		<dc:creator>ripflowers</dc:creator>
				<category><![CDATA[Others]]></category>

		<guid isPermaLink="false">http://ursob.org/?p=448</guid>
		<description><![CDATA[
每次写文章都要查一次，放到这里易于查阅:

&#60;!--1，使用方法--&#62;
&#60;pre lang=&#34;bash&#34;&#62;#这里省略千行代码 &#60; /pre&#62;


/**支持的所有标签**/
'actionscript' =&#62; array&#40;'as'&#41;,
'ada' =&#62; array&#40;'a', 'ada', 'adb', 'ads'&#41;,
'apache' =&#62; array&#40;'conf'&#41;,
'asm' =&#62; array&#40;'ash', 'asm', 'inc'&#41;,
'asp' =&#62; array&#40;'asp'&#41;,
'bash' =&#62; array&#40;'sh'&#41;,
'bf' =&#62; array&#40;'bf'&#41;,
'c' =&#62; array&#40;'c', 'h'&#41;,
'c_mac' =&#62; array&#40;'c', 'h'&#41;,
'caddcl' =&#62; array&#40;&#41;,
'cadlisp' =&#62; array&#40;&#41;,
'cdfg' =&#62; array&#40;'cdfg'&#41;,
'cobol' =&#62; array&#40;'cbl'&#41;,
'cpp' =&#62; array&#40;'cpp', 'hpp', 'C', 'H', 'CPP', 'HPP'&#41;,
'csharp' =&#62; array&#40;'cs'&#41;,
'css' =&#62; array&#40;'css'&#41;,
'd' =&#62; array&#40;'d'&#41;,
'delphi' =&#62; array&#40;'dpk', 'dpr', 'pp', 'pas'&#41;,
'diff' [...]]]></description>
			<content:encoded><![CDATA[<p>
每次写文章都要查一次，放到这里易于查阅:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:Courier New, Courier;"><span style="color: #808080; font-style: italic;">&lt;!--1，使用方法--&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">pre</span> <span style="color: #000066;">lang</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;bash&quot;</span>&gt;</span>#这里省略千行代码 <span style="color: #009900;">&lt; <span style="color: #66cc66;">/</span>pre&gt;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:Courier New, Courier;"><span style="color: #009933; font-style: italic;">/**支持的所有标签**/</span>
<span style="color: #0000ff;">'actionscript'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'as'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'ada'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'a'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ada'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'adb'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'ads'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'apache'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'conf'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'asm'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ash'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'asm'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'inc'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'asp'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'asp'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'bash'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'sh'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'bf'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'bf'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'c'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'c'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'h'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'c_mac'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'c'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'h'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'caddcl'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'cadlisp'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'cdfg'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'cdfg'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'cobol'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'cbl'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'cpp'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'cpp'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'hpp'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'C'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'H'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'CPP'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'HPP'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'csharp'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'cs'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'css'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'css'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'d'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'d'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'delphi'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'dpk'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'dpr'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'pp'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'pas'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'diff'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'diff'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'patch'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'dos'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'bat'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'cmd'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'gettext'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'po'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'pot'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'gml'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'gml'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'gnuplot'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'plt'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'groovy'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'groovy'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'haskell'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'hs'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'html4strict'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'html'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'htm'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'ini'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ini'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'desktop'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'java'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'java'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'javascript'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'js'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'klonec'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'kl1'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'klonecpp'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'klx'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'latex'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tex'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'lisp'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'lisp'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'lua'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'lua'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'matlab'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'m'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'mpasm'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'mysql'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'sql'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'nsis'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'objc'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'oobas'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'oracle8'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'oracle10'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'pascal'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'pas'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'perl'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'pl'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'pm'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'php'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'php'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'php5'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'phtml'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'phps'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'povray'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'pov'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'providex'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'pvc'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'pvx'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'prolog'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'pl'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'python'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'py'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'qbasic'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'bi'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'reg'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'reg'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'ruby'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'rb'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'sas'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'sas'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'scala'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'scala'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'scheme'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'scm'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'scilab'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'sci'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'smalltalk'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'st'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'smarty'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'tcl'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'tcl'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'vb'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'bas'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'vbnet'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'visualfoxpro'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'whitespace'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ws'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'xml'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'xml'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'svg'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'z80'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'z80'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'asm'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'inc'</span><span style="color: #009900;">&#41;</span></pre></div></div>
</p>
]]></content:encoded>
			<wfw:commentRss>http://ursob.org/2010/07/29/wp-syntax/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Win下批处理部署J2EE工程</title>
		<link>http://ursob.org/2010/07/29/windows-bat-j2ee/</link>
		<comments>http://ursob.org/2010/07/29/windows-bat-j2ee/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 09:09:49 +0000</pubDate>
		<dc:creator>ripflowers</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Others]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://ursob.org/?p=406</guid>
		<description><![CDATA[
前段时间需要弄一个自动安装J2EE工程的东西，想到用installanywhere，不过还想用更简单的方法，所以就用到了用批处理文件部署J2EE项目，用到的数据库为Mysql，原理很简单就是把注册Mysql服务、启动Tomcat、配置JAVA_HOME、配置PATH这些命令都堆到了一个bat文件下，原来一牛逼哥们儿已经实现了放到硬盘的固定目录下实现这样的功能，之后在本人的狗尾续貂下已经实现放到硬盘的任务目录都能执行，下边记录一下总过程:



1，文件准备，文件目录如下图：





相信看到这几个文件都不会陌生，这几个文件的重点就在于startup.bat，这个文件中聚集了所有的命令，jdk就不说了；mysql为noinstall版本，数据库已经创建完毕，并且已经导入数据，如果noinstall-mysql还有疑问的话请参考本站的Mysql noinstall版本的配置和使用；tomcat的webapps下已经放置了将要部署的项目；index.html中的内容为：


&#60;html&#62;
  &#60;head&#62;&#60;/head&#62;
  &#60;body&#62;
    &#60;script&#62;window.location.href='http://localhost:8088/项目名称';&#60;/script&#62;
  &#60;/body&#62;
&#60;/html&#62;
&#60;!--不再赘述--&#62;





2，startup.bat详解，一下是bat文件中的全部内容，注释中会说的更明白一点：


&#160;
@echo off
rem echo off命令关闭命令在dos窗口中的显示，如果需要显示修改为echo on
rem @echo off行的上面最好空一行，因为测试发现如果它放到第一行的话有时候会失效

rem 以下两行代码的功能是获取当前路径，并把当前路径付给变量&#34;INSTALL_HOME&#34;
setlocal enabledelayedexpansion
set &#34;INSTALL_HOME=%~dp0&#34;

rem 以下三行代码的功能是清空mysql目录下my.ini中的内容，
rem 因为路径是可变的，所以需要修改my.ini中的内容，
rem 向文件中插入内容好像不是很容易实现，所以干脆全部清空，然后再向中写数据
for /f &#34;delims=&#34; %%i in &#40;'dir/b &#34;%INSTALL_HOME%\mysql\my.ini&#34;'&#41; do call :del_ &#34;%%i&#34; 
goto :eof 
:del_ 

rem 以下N行代码的功能配置my.ini
&#62;c:\tmp1.tmp &#40;
	echo &#91;WinMySQLAdmin&#93; 
	echo Server=%INSTALL_HOME%\mysql\mysqld-nt.exe
	echo &#91;mysqld&#93; 
	echo basedir=%INSTALL_HOME%\mysql
	echo datadir=%INSTALL_HOME%\mysql\data
	echo &#91;client&#93;
	echo port		= 3306
	echo socket		= /tmp/mysql.sock
	echo default-character-set=utf8
	echo &#91;mysqld&#93;
	echo port		= [...]]]></description>
			<content:encoded><![CDATA[<p>
前段时间需要弄一个自动安装J2EE工程的东西，想到用installanywhere，不过还想用更简单的方法，所以就用到了用批处理文件部署J2EE项目，用到的数据库为Mysql，原理很简单就是把注册Mysql服务、启动Tomcat、配置JAVA_HOME、配置PATH这些命令都堆到了一个bat文件下，原来一牛逼哥们儿已经实现了放到硬盘的固定目录下实现这样的功能，之后在本人的狗尾续貂下已经实现放到硬盘的任务目录都能执行，下边记录一下总过程:
</p>
<blockquote>
<p>
1，文件准备，文件目录如下图：
</p>
<p>
<a title="Image Title" rel="lightbox" href="http://ursob.org/wp-content/uploads/2010/06/files.jpg"><img src="http://ursob.org/wp-content/uploads/2010/06/files.jpg" alt="Key documents" title="Key documents" width="300" height="187" class="size-medium wp-image-364" /></a>
</p>
<p>
相信看到这几个文件都不会陌生，这几个文件的重点就在于startup.bat，这个文件中聚集了所有的命令，jdk就不说了；mysql为noinstall版本，数据库已经创建完毕，并且已经导入数据，如果noinstall-mysql还有疑问的话请参考本站的<a title="Permanent Link to Mysql noinstall版本的配置和使用" rel="bookmark" href="http://ursob.org/2009/09/30/mysql-noinstall/">Mysql noinstall版本的配置和使用</a>；tomcat的webapps下已经放置了将要部署的项目；index.html中的内容为：
</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:Courier New, Courier;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">html</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">head</span>&gt;&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">head</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span>&gt;</span>window.location.href='http://localhost:8088/项目名称';<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
  <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">body</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">html</span>&gt;</span>
<span style="color: #808080; font-style: italic;">&lt;!--不再赘述--&gt;</span></pre></div></div>

</p>
</blockquote>
<blockquote>
<p>
2，startup.bat详解，一下是bat文件中的全部内容，注释中会说的更明白一点：
</p>
<p>
<div class="wp_syntax"><div class="code"><pre class="dos" style="font-family:Courier New, Courier;">&nbsp;
<span style="color: #33cc33;">@</span><span style="color: #b1b100; font-weight: bold;">echo</span> off
<span style="color: #808080; font-style: italic;">rem echo off命令关闭命令在dos窗口中的显示，如果需要显示修改为echo on</span>
<span style="color: #808080; font-style: italic;">rem @echo off行的上面最好空一行，因为测试发现如果它放到第一行的话有时候会失效</span>
<span style="color: #808080; font-style: italic;">
rem 以下两行代码的功能是获取当前路径，并把当前路径付给变量&quot;INSTALL_HOME&quot;</span>
<span style="color: #b1b100; font-weight: bold;">setlocal</span> enabledelayedexpansion
<span style="color: #b1b100; font-weight: bold;">set</span> <span style="color: #448844;">&quot;INSTALL_HOME</span>=<span style="color: #33cc33;">%</span><span style="color: #448888;">~dp0</span>&quot;
<span style="color: #808080; font-style: italic;">
rem 以下三行代码的功能是清空mysql目录下my.ini中的内容，</span>
<span style="color: #808080; font-style: italic;">rem 因为路径是可变的，所以需要修改my.ini中的内容，</span>
<span style="color: #808080; font-style: italic;">rem 向文件中插入内容好像不是很容易实现，所以干脆全部清空，然后再向中写数据</span>
<span style="color: #00b100; font-weight: bold;">for</span> /f &quot;delims=&quot; <span style="color: #33cc33;">%%</span><span style="color: #448888;">i</span> <span style="color: #00b100; font-weight: bold;">in</span> <span style="color: #66cc66;">&#40;</span>'<span style="color: #b1b100; font-weight: bold;">dir</span>/b &quot;<span style="color: #33cc33;">%</span><span style="color: #448888;">INSTALL_HOME</span><span style="color: #33cc33;">%</span>\mysql\my.ini&quot;'<span style="color: #66cc66;">&#41;</span> <span style="color: #00b100; font-weight: bold;">do</span> <span style="color: #00b100; font-weight: bold;">call</span> :<span style="color: #b100b1; font-weight: bold;">del_ &quot;%%<span style="color: #448888;">i</span>&quot; </span>
<span style="color: #00b100; font-weight: bold;">goto</span> <span style="color: #b100b1; font-weight: bold;">:eof </span>
:<span style="color: #b100b1; font-weight: bold;">del_ </span>
<span style="color: #808080; font-style: italic;">
rem 以下N行代码的功能配置my.ini</span>
&gt;c:\tmp1.tmp <span style="color: #66cc66;">&#40;</span>
	<span style="color: #b1b100; font-weight: bold;">echo</span> <span style="color: #66cc66;">&#91;</span>WinMySQLAdmin<span style="color: #66cc66;">&#93;</span> 
	<span style="color: #b1b100; font-weight: bold;">echo</span> Server=<span style="color: #33cc33;">%</span><span style="color: #448888;">INSTALL_HOME</span><span style="color: #33cc33;">%</span>\mysql\mysqld-nt.exe
	<span style="color: #b1b100; font-weight: bold;">echo</span> <span style="color: #66cc66;">&#91;</span>mysqld<span style="color: #66cc66;">&#93;</span> 
	<span style="color: #b1b100; font-weight: bold;">echo</span> basedir=<span style="color: #33cc33;">%</span><span style="color: #448888;">INSTALL_HOME</span><span style="color: #33cc33;">%</span>\mysql
	<span style="color: #b1b100; font-weight: bold;">echo</span> datadir=<span style="color: #33cc33;">%</span><span style="color: #448888;">INSTALL_HOME</span><span style="color: #33cc33;">%</span>\mysql\data
	<span style="color: #b1b100; font-weight: bold;">echo</span> <span style="color: #66cc66;">&#91;</span>client<span style="color: #66cc66;">&#93;</span>
	<span style="color: #b1b100; font-weight: bold;">echo</span> port		= <span style="color: #cc66cc;">3306</span>
	<span style="color: #b1b100; font-weight: bold;">echo</span> socket		= /tmp/mysql.sock
	<span style="color: #b1b100; font-weight: bold;">echo</span> default-character-<span style="color: #b1b100; font-weight: bold;">set</span>=utf8
	<span style="color: #b1b100; font-weight: bold;">echo</span> <span style="color: #66cc66;">&#91;</span>mysqld<span style="color: #66cc66;">&#93;</span>
	<span style="color: #b1b100; font-weight: bold;">echo</span> port		= <span style="color: #cc66cc;">3306</span>
	<span style="color: #b1b100; font-weight: bold;">echo</span> socket		= /tmp/mysql.sock
	<span style="color: #b1b100; font-weight: bold;">echo</span> skip-locking
	<span style="color: #b1b100; font-weight: bold;">echo</span> key_buffer = 16K
	<span style="color: #b1b100; font-weight: bold;">echo</span> max_allowed_packet = 12M
	<span style="color: #b1b100; font-weight: bold;">echo</span> table_cache = <span style="color: #cc66cc;">4</span>
	<span style="color: #b1b100; font-weight: bold;">echo</span> sort_buffer_size = 64K
	<span style="color: #b1b100; font-weight: bold;">echo</span> read_buffer_size = 256K
	<span style="color: #b1b100; font-weight: bold;">echo</span> read_rnd_buffer_size = 256K
	<span style="color: #b1b100; font-weight: bold;">echo</span> net_buffer_length = 2K
	<span style="color: #b1b100; font-weight: bold;">echo</span> thread_stack = 64K
	<span style="color: #b1b100; font-weight: bold;">echo</span> default-character-<span style="color: #b1b100; font-weight: bold;">set</span>=utf8
	<span style="color: #b1b100; font-weight: bold;">echo</span> default-storage-engine=innodb
	<span style="color: #b1b100; font-weight: bold;">echo</span> server-id	= <span style="color: #cc66cc;">1</span>
	<span style="color: #b1b100; font-weight: bold;">echo</span> <span style="color: #66cc66;">&#91;</span>mysqldump<span style="color: #66cc66;">&#93;</span>
	<span style="color: #b1b100; font-weight: bold;">echo</span> quick
	<span style="color: #b1b100; font-weight: bold;">echo</span> max_allowed_packet = 16M
	<span style="color: #b1b100; font-weight: bold;">echo</span> <span style="color: #66cc66;">&#91;</span>mysql<span style="color: #66cc66;">&#93;</span>
	<span style="color: #b1b100; font-weight: bold;">echo</span> no-auto-rehash
	<span style="color: #b1b100; font-weight: bold;">echo</span> <span style="color: #66cc66;">&#91;</span>isamchk<span style="color: #66cc66;">&#93;</span>
	<span style="color: #b1b100; font-weight: bold;">echo</span> key_buffer = 8M
	<span style="color: #b1b100; font-weight: bold;">echo</span> sort_buffer_size = 8M
	<span style="color: #b1b100; font-weight: bold;">echo</span> <span style="color: #66cc66;">&#91;</span>myisamchk<span style="color: #66cc66;">&#93;</span>
	<span style="color: #b1b100; font-weight: bold;">echo</span> key_buffer = 8M
	<span style="color: #b1b100; font-weight: bold;">echo</span> sort_buffer_size = 8M
	<span style="color: #b1b100; font-weight: bold;">echo</span> <span style="color: #66cc66;">&#91;</span>mysqlhotcopy<span style="color: #66cc66;">&#93;</span>
	<span style="color: #b1b100; font-weight: bold;">echo</span> interactive-timeout
<span style="color: #66cc66;">&#41;</span>
<span style="color: #00b100; font-weight: bold;">for</span> /f &quot;tokens=* delims=&quot; <span style="color: #33cc33;">%%</span><span style="color: #448888;">i</span> <span style="color: #00b100; font-weight: bold;">in</span> <span style="color: #66cc66;">&#40;</span>'<span style="color: #b1b100; font-weight: bold;">dir</span> /b <span style="color: #33cc33;">%</span><span style="color: #448888;">INSTALL_HOME</span><span style="color: #33cc33;">%</span>\mysql\my.ini'<span style="color: #66cc66;">&#41;</span> <span style="color: #00b100; font-weight: bold;">do</span> <span style="color: #66cc66;">&#40;</span>
	<span style="color: #b1b100; font-weight: bold;">copy</span> c:\tmp1.tmp+&quot;<span style="color: #33cc33;">%</span><span style="color: #448888;">INSTALL_HOME</span><span style="color: #33cc33;">%</span>\mysql\<span style="color: #33cc33;">%%</span><span style="color: #448888;">i</span>&quot; c:\tmp2.tmp /y &gt;<span style="color: #0000ff; font-weight: bold;">nul</span>
	<span style="color: #b1b100; font-weight: bold;">copy</span> c:\tmp2.tmp &quot;<span style="color: #33cc33;">%</span><span style="color: #448888;">INSTALL_HOME</span><span style="color: #33cc33;">%</span>\mysql\<span style="color: #33cc33;">%%</span><span style="color: #448888;">i</span>&quot; /y &gt;<span style="color: #0000ff; font-weight: bold;">nul</span>
<span style="color: #66cc66;">&#41;</span>
<span style="color: #b1b100; font-weight: bold;">del</span> c:\tmp1.tmp /f /q
<span style="color: #b1b100; font-weight: bold;">del</span> c:\tmp2.tmp /f /q
<span style="color: #808080; font-style: italic;">
rem 设置PATH、CLASSPATH、CATALINA_HOME、JAVA_HOME，</span>
<span style="color: #808080; font-style: italic;">rem 其中路径都是相对于“INSTALL_HOME”的，可见获取这个路径的重要性</span>
<span style="color: #b1b100; font-weight: bold;">set</span> <span style="color: #448844;">PATH</span>=<span style="color: #33cc33;">%</span><span style="color: #448888;">INSTALL_HOME</span><span style="color: #33cc33;">%</span>\jdk\bin;<span style="color: #33cc33;">%</span><span style="color: #448888;">PATH</span><span style="color: #33cc33;">%</span>
<span style="color: #b1b100; font-weight: bold;">set</span> <span style="color: #448844;">CLASSPATH</span>=<span style="color: #33cc33;">%</span><span style="color: #448888;">INSTALL_HOME</span><span style="color: #33cc33;">%</span>\jdk\jre\lib\rt.jar;.
<span style="color: #b1b100; font-weight: bold;">set</span> <span style="color: #448844;">CATALINA_HOME</span>=<span style="color: #33cc33;">%</span><span style="color: #448888;">INSTALL_HOME</span><span style="color: #33cc33;">%</span>\tomcat
<span style="color: #b1b100; font-weight: bold;">set</span> <span style="color: #448844;">JAVA_HOME</span>=<span style="color: #33cc33;">%</span><span style="color: #448888;">INSTALL_HOME</span><span style="color: #33cc33;">%</span>\jdk
<span style="color: #808080; font-style: italic;">
rem 在测试中得知sc命令有时候在运用时，需要依赖telnet服务，</span>
<span style="color: #808080; font-style: italic;">rem 所以将telnet服务设置为自动并且启动它</span>
sc config TlntSvr start= auto 
net start telnet
<span style="color: #808080; font-style: italic;">
rem &quot;noinstallmysql&quot;是将要注册的mysql服务名称，</span>
<span style="color: #808080; font-style: italic;">rem 所以安全起见不管机器上有没有这个服务，先停掉，然后再删掉</span>
net stop noinstallmysql
sc delete noinstallmysql 
<span style="color: #808080; font-style: italic;">
rem 注册mysql服务，名称为“noinstallmysql”</span>
<span style="color: #808080; font-style: italic;">rem 以下两行在执行时请务必放到一行中，要不会执行出错</span>
<span style="color: #00b100; font-weight: bold;">Call</span> &quot;<span style="color: #33cc33;">%</span><span style="color: #448888;">INSTALL_HOME</span><span style="color: #33cc33;">%</span>/mysql/bin/mysqld-nt&quot; --install noinstallmysql 
                                  --defaults-file=<span style="color: #33cc33;">%</span><span style="color: #448888;">INSTALL_HOME</span><span style="color: #33cc33;">%</span>\mysql\my.ini
<span style="color: #808080; font-style: italic;">
rem 配置mysql服务，设置为自动</span>
sc config noinstallmysql start= auto
<span style="color: #808080; font-style: italic;">
rem 启动mysql服务</span>
net start noinstallmysql
<span style="color: #808080; font-style: italic;">
rem 进入tomcat下的bin目录，启动它，大功告成！</span>
<span style="color: #b1b100; font-weight: bold;">cd</span> <span style="color: #33cc33;">%</span><span style="color: #448888;">INSTALL_HOME</span><span style="color: #33cc33;">%</span>\tomcat\bin
<span style="color: #00b100; font-weight: bold;">call</span> <span style="color: #33cc33;">%</span><span style="color: #448888;">INSTALL_HOME</span><span style="color: #33cc33;">%</span>\tomcat\bin\startup.bat</pre></div></div>

</p>
<p>
启动成功之后，还记得那个index.html吗，直接点击就可以进入你的项目，如果启动不成功的话自己调整一下或者mail给我一起交流都可以。E-mail:ripflowers@gmail.com，OK，下班走人。
</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://ursob.org/2010/07/29/windows-bat-j2ee/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>儿子和女儿——解释器和编译器的区别与联系</title>
		<link>http://ursob.org/2010/07/12/interpreter-and-compiler/</link>
		<comments>http://ursob.org/2010/07/12/interpreter-and-compiler/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 03:31:14 +0000</pubDate>
		<dc:creator>ripflowers</dc:creator>
				<category><![CDATA[Others]]></category>

		<guid isPermaLink="false">http://ursob.org/?p=419</guid>
		<description><![CDATA[儿子和女儿——解释器和编译器的区别与联系]]></description>
			<content:encoded><![CDATA[<p>转自：http://www.cnblogs.com/sword03/archive/2010/06/27/1766147.html</p>
<p><strong style="font-size:16px;">儿子和女儿——解释器和编译器的区别与联系</strong></p>
<p>
菜鸟经常将编译器和解释器弄混淆，无奈之下，于是向高手请教。
</p>
<p>
高手说：“解释器是一条一条的解释执行源语言。比如php，postscritp，javascript就是典型的解释性语言。编译器是把源代码整个编译成目标代码，执行时不在需要编译器，直接在支持目标代码的平台上运行，这样执行效率比解释执行快很多。比如C语言代码被编译成二进制代码（exe程序），在windows平台上执行。”
</p>
<p>
菜鸟说：“我还是不明白，能给个形象的比喻么？”
</p>
<p>
高手说：“给你讲个故事。”</p>
<p>母亲打电话给儿子说：“你爸最近身体不好，家里人少不热闹”。</p>
<p>儿子想，对啊，爸年纪大了，身体不好，买点牦牛骨髓壮骨粉不错，于是儿子就去超市买了牦牛骨髓壮骨粉。</p>
<p>儿子又想啊，最近黄金搭档很火，买点给爸试试。于是儿子又去买了黄金搭档。</p>
<p>从超市回来后，儿子又寻思母亲说的“家里不热闹”，嗯，家里的小皇帝自从上寄宿学校后就比较少回来，估计是老人家想孙子了。儿子于是给上高中的儿子打了个电话，让他周末回来看看。</p>
<p>母亲打电话给女儿说：“你爸最近身体不好，家里人少不热闹”。</p>
<p>女儿就想，应该给爸做点什么呢？于是她拿出张纸开始罗列条目，先写上了壮骨粉和黄金搭档。然后，想着让老人家看看外孙应该不错，于是就在纸上加上了一句，一家人回爸妈那里看望看望。最后纸上就写着：</p>
<p>1.壮骨粉和黄金搭档</p>
<p>2.一家人去看望爸妈</p>
<p>女儿见到女婿后，就将这张纸上的信息编成短信发给了工作的女婿。</p>
<p>女婿一看就明白了，下班后先去超市买了补品，然后开车回家带着妻儿就去看望岳父岳母了。</p>
<p>想到什么了吗？
</p>
<p>
菜鸟说：</p>
<p>我这样说不知道对不对：儿子就像是解释器，是想到一点做一点。女儿就像编译器，女婿就像平台，女儿听完后，在纸上罗列出所有要做的事情，女婿就按着指示办事了。
</p>
<p>
高手说：</p>
<p>就是这样的。儿子对于母亲的话是一条一条执行，女儿是将母亲的话整个翻译成平台能理解的目标语言&#8211;短信，整个由女婿直接执行。后者的执行效率会更高。</p>
<p>从功能上看，解释器和编译器确实不一样。</p>
<p>然而，从流程和结构上看，二者却非常相似。</p>
<p>儿子和女儿听到母亲的话以后，都是从两个方面来思考：老人的身体和老人对小辈的思念。以此为据，儿子和女儿都做出了自己的决定。只不过一个直接去做了，另一个却将所要做的事情翻译成另一种载体&#8211;短信&#8211;给存储起来。</p>
<p>解释器和编译器也是如此，读入源语言后，解释器和编译器都要进行词法分析、语法分析和语义分析，之后，二者开始有所分别。解释器在语义分析后选择了直接执行语句；编译器在语义分析后选择将将语义存储成某一种中间语言，之后通过不同的后端翻译成不同的机器语言（可执行程序）。如下图所示：<br />
<a title="Image Title" rel="lightbox" href="http://ursob.org/wp-content/uploads/2010/07/untitled.bmp"><img src="http://ursob.org/wp-content/uploads/2010/07/untitled.bmp" alt="解释器和编译器的区别和联系" title="解释器和编译器的区别和联系" width="600" height="400" class="size-medium wp-image-364" /></a><br />
总之，解析器和编译器它们在功能上是不一样的，然而从结构上看却有诸多相同，而且在开发时也并没有本质上的差别，这也是很多人将二者混淆的原因之一。究竟是开发解析器还是编译器？只需要依据功能上的实际需要来做出决定就ok了。</p>
]]></content:encoded>
			<wfw:commentRss>http://ursob.org/2010/07/12/interpreter-and-compiler/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sql中split方法实现</title>
		<link>http://ursob.org/2010/06/21/sql-split/</link>
		<comments>http://ursob.org/2010/06/21/sql-split/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 08:40:53 +0000</pubDate>
		<dc:creator>ripflowers</dc:creator>
				<category><![CDATA[Others]]></category>
		<category><![CDATA[sql-split]]></category>

		<guid isPermaLink="false">http://ursob.org/?p=400</guid>
		<description><![CDATA[sqlserver中好像没有分割字符串的函数，G哥告诉我，可以自定义，以下内容为抄袭，做个笔记。]]></description>
			<content:encoded><![CDATA[<p>sqlserver中好像没有分割字符串的函数，G哥告诉我，可以自定义，以下内容为抄袭，做个笔记。<br />
第一个是根据下标返回分割结果集中的一个：</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:Courier New, Courier;"><span style="color: #808080; font-style: italic;">--用法：dbo.split(‘要分割的字符串’,’分隔字符’,返回结果集中第几个)</span>
<span style="color: #808080; font-style: italic;">--如果没有分隔的字符（第二个参数），则返回整个“要分割的字符串”。</span>
<span style="color: #808080; font-style: italic;">--如果取出的位置超出结果集的下标则返回空。</span>
&nbsp;
<span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">FUNCTION</span> <span style="color: #66cc66;">&#91;</span>dbo<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">.</span><span style="color: #66cc66;">&#91;</span>split<span style="color: #66cc66;">&#93;</span>
 <span style="color: #66cc66;">&#40;</span>@str nvarchar<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">4000</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>@code varchar<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">10</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>@no int <span style="color: #66cc66;">&#41;</span>  
RETURNS varchar<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">200</span><span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">AS</span>  
BEGIN 
&nbsp;
declare @intLen int
declare @count int
declare @indexb  int
declare @indexe  int
<span style="color: #993333; font-weight: bold;">SET</span> @intLen<span style="color: #66cc66;">=</span>len<span style="color: #66cc66;">&#40;</span>@code<span style="color: #66cc66;">&#41;</span>
<span style="color: #993333; font-weight: bold;">SET</span> @count<span style="color: #66cc66;">=</span><span style="color: #cc66cc;">0</span>
<span style="color: #993333; font-weight: bold;">SET</span> @indexb<span style="color: #66cc66;">=</span><span style="color: #cc66cc;">1</span>
&nbsp;
<span style="color: #993333; font-weight: bold;">IF</span> @no<span style="color: #66cc66;">=</span><span style="color: #cc66cc;">0</span>
  <span style="color: #993333; font-weight: bold;">IF</span> charindex<span style="color: #66cc66;">&#40;</span>@code<span style="color: #66cc66;">,</span>@str<span style="color: #66cc66;">,</span>@indexb<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&lt;&gt;</span><span style="color: #cc66cc;">0</span>
     <span style="color: #993333; font-weight: bold;">RETURN</span> <span style="color: #993333; font-weight: bold;">LEFT</span><span style="color: #66cc66;">&#40;</span>@str<span style="color: #66cc66;">,</span>charindex<span style="color: #66cc66;">&#40;</span>@code<span style="color: #66cc66;">,</span>@str<span style="color: #66cc66;">,</span>@indexb<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">-</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span> 
  else
     <span style="color: #993333; font-weight: bold;">RETURN</span> @str
&nbsp;
while charindex<span style="color: #66cc66;">&#40;</span>@code<span style="color: #66cc66;">,</span>@str<span style="color: #66cc66;">,</span>@indexb<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&lt;&gt;</span><span style="color: #cc66cc;">0</span>
  begin
       <span style="color: #993333; font-weight: bold;">SET</span> @count<span style="color: #66cc66;">=</span>@count<span style="color: #66cc66;">+</span><span style="color: #cc66cc;">1</span>
       <span style="color: #993333; font-weight: bold;">IF</span> @count<span style="color: #66cc66;">=</span>@no
         break
       <span style="color: #993333; font-weight: bold;">SET</span> @indexb<span style="color: #66cc66;">=</span>@intLen<span style="color: #66cc66;">+</span>charindex<span style="color: #66cc66;">&#40;</span>@code<span style="color: #66cc66;">,</span>@str<span style="color: #66cc66;">,</span>@indexb<span style="color: #66cc66;">&#41;</span>
  end 
&nbsp;
<span style="color: #993333; font-weight: bold;">IF</span> @count<span style="color: #66cc66;">=</span>@no
  begin
&nbsp;
     <span style="color: #993333; font-weight: bold;">SET</span> @indexe<span style="color: #66cc66;">=</span>@intLen<span style="color: #66cc66;">+</span>charindex<span style="color: #66cc66;">&#40;</span>@code<span style="color: #66cc66;">,</span>@str<span style="color: #66cc66;">,</span>@indexb<span style="color: #66cc66;">&#41;</span>
	<span style="color: #993333; font-weight: bold;">IF</span> charindex<span style="color: #66cc66;">&#40;</span>@code<span style="color: #66cc66;">,</span>@str<span style="color: #66cc66;">,</span>@indexe<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&lt;&gt;</span><span style="color: #cc66cc;">0</span>
	    <span style="color: #993333; font-weight: bold;">RETURN</span> substring<span style="color: #66cc66;">&#40;</span>@str<span style="color: #66cc66;">,</span>
	    charindex<span style="color: #66cc66;">&#40;</span>@code<span style="color: #66cc66;">,</span>@str<span style="color: #66cc66;">,</span>@indexb<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">+</span>len<span style="color: #66cc66;">&#40;</span>@code<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
	    charindex<span style="color: #66cc66;">&#40;</span>@code<span style="color: #66cc66;">,</span>@str<span style="color: #66cc66;">,</span>@indexe<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">-</span>charindex<span style="color: #66cc66;">&#40;</span>@code<span style="color: #66cc66;">,</span>@str<span style="color: #66cc66;">,</span>@indexb<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">-</span>len<span style="color: #66cc66;">&#40;</span>@code<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
	else 
	    <span style="color: #993333; font-weight: bold;">RETURN</span> <span style="color: #993333; font-weight: bold;">RIGHT</span><span style="color: #66cc66;">&#40;</span>@str<span style="color: #66cc66;">,</span>len<span style="color: #66cc66;">&#40;</span>@str<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">-</span>charindex<span style="color: #66cc66;">&#40;</span>@code<span style="color: #66cc66;">,</span>@str<span style="color: #66cc66;">,</span>@indexb<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">-</span>len<span style="color: #66cc66;">&#40;</span>@code<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">+</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>
&nbsp;
  end
&nbsp;
<span style="color: #993333; font-weight: bold;">RETURN</span> <span style="color: #ff0000;">''</span>
&nbsp;
END</pre></div></div>

<p>第二个是返回分割后的结果集：</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:Courier New, Courier;"><span style="color: #808080; font-style: italic;">--支持分割符多字节 </span>
<span style="color: #808080; font-style: italic;">--使用方法  </span>
<span style="color: #808080; font-style: italic;">--select * from dbo.split('abc-def-ghi-jkl','-')    </span>
<span style="color: #808080; font-style: italic;">--select * from dbo.split('abc----def----ghi----jkl','----')    </span>
&nbsp;
<span style="color: #993333; font-weight: bold;">ALTER</span> <span style="color: #993333; font-weight: bold;">FUNCTION</span> <span style="color: #66cc66;">&#91;</span>dbo<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">.</span><span style="color: #66cc66;">&#91;</span>split<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#40;</span>@Long_str varchar<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">8000</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>@split_str varchar<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">100</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>    
RETURNS  @tmp <span style="color: #993333; font-weight: bold;">TABLE</span><span style="color: #66cc66;">&#40;</span>        
    ID int IDENTITY <span style="color: #993333; font-weight: bold;">PRIMARY</span> <span style="color: #993333; font-weight: bold;">KEY</span><span style="color: #66cc66;">,</span>      
    short_str varchar<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">8000</span><span style="color: #66cc66;">&#41;</span>    
<span style="color: #66cc66;">&#41;</span>    
<span style="color: #993333; font-weight: bold;">AS</span>   
BEGIN   
    DECLARE @long_str_Tmp varchar<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">8000</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
			@short_str varchar<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">8000</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>
			@split_str_length int   
&nbsp;
    <span style="color: #993333; font-weight: bold;">SET</span> @split_str_length <span style="color: #66cc66;">=</span> LEN<span style="color: #66cc66;">&#40;</span>@split_str<span style="color: #66cc66;">&#41;</span>    
&nbsp;
    <span style="color: #993333; font-weight: bold;">IF</span> CHARINDEX<span style="color: #66cc66;">&#40;</span>@split_str<span style="color: #66cc66;">,</span>@Long_str<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">=</span><span style="color: #cc66cc;">1</span> 
         <span style="color: #993333; font-weight: bold;">SET</span> @long_str_Tmp<span style="color: #66cc66;">=</span>SUBSTRING<span style="color: #66cc66;">&#40;</span>@Long_str<span style="color: #66cc66;">,</span>
					@split_str_length<span style="color: #66cc66;">+</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span>
					LEN<span style="color: #66cc66;">&#40;</span>@Long_str<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">-</span>@split_str_length<span style="color: #66cc66;">&#41;</span>
&nbsp;
    ELSE
         <span style="color: #993333; font-weight: bold;">SET</span> @long_str_Tmp<span style="color: #66cc66;">=</span>@Long_str
&nbsp;
    <span style="color: #993333; font-weight: bold;">IF</span> CHARINDEX<span style="color: #66cc66;">&#40;</span>REVERSE<span style="color: #66cc66;">&#40;</span>@split_str<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span>REVERSE<span style="color: #66cc66;">&#40;</span>@long_str_Tmp<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&gt;</span><span style="color: #cc66cc;">1</span>    
        <span style="color: #993333; font-weight: bold;">SET</span> @long_str_Tmp<span style="color: #66cc66;">=</span>@long_str_Tmp<span style="color: #66cc66;">+</span>@split_str    
    ELSE   
        <span style="color: #993333; font-weight: bold;">SET</span> @long_str_Tmp<span style="color: #66cc66;">=</span>@long_str_Tmp    
&nbsp;
    WHILE CHARINDEX<span style="color: #66cc66;">&#40;</span>@split_str<span style="color: #66cc66;">,</span>@long_str_Tmp<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&gt;</span><span style="color: #cc66cc;">0</span>    
        BEGIN   
            <span style="color: #993333; font-weight: bold;">SET</span> @short_str<span style="color: #66cc66;">=</span>SUBSTRING<span style="color: #66cc66;">&#40;</span>@long_str_Tmp<span style="color: #66cc66;">,</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span>
					CHARINDEX<span style="color: #66cc66;">&#40;</span>@split_str<span style="color: #66cc66;">,</span>@long_str_Tmp<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">-</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>    
            DECLARE @long_str_Tmp_LEN INT<span style="color: #66cc66;">,</span>@split_str_Position_END int   
            <span style="color: #993333; font-weight: bold;">SET</span> @long_str_Tmp_LEN <span style="color: #66cc66;">=</span> LEN<span style="color: #66cc66;">&#40;</span>@long_str_Tmp<span style="color: #66cc66;">&#41;</span>    
            <span style="color: #993333; font-weight: bold;">SET</span> @split_str_Position_END <span style="color: #66cc66;">=</span> LEN<span style="color: #66cc66;">&#40;</span>@short_str<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">+</span>@split_str_length    
            <span style="color: #993333; font-weight: bold;">SET</span> @long_str_Tmp<span style="color: #66cc66;">=</span>REVERSE<span style="color: #66cc66;">&#40;</span>SUBSTRING<span style="color: #66cc66;">&#40;</span>REVERSE<span style="color: #66cc66;">&#40;</span>@long_str_Tmp<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">,</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">,</span>
					@long_str_Tmp_LEN<span style="color: #66cc66;">-</span>@split_str_Position_END<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
            <span style="color: #993333; font-weight: bold;">IF</span> @short_str<span style="color: #66cc66;">&lt;&gt;</span><span style="color: #ff0000;">''</span> <span style="color: #993333; font-weight: bold;">INSERT</span> <span style="color: #993333; font-weight: bold;">INTO</span> @tmp <span style="color: #993333; font-weight: bold;">SELECT</span> @short_str    
        END   
    <span style="color: #993333; font-weight: bold;">RETURN</span>     
END</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://ursob.org/2010/06/21/sql-split/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sql中触发器和游标的使用</title>
		<link>http://ursob.org/2010/06/02/sql-trigger-cursor/</link>
		<comments>http://ursob.org/2010/06/02/sql-trigger-cursor/#comments</comments>
		<pubDate>Wed, 02 Jun 2010 08:17:45 +0000</pubDate>
		<dc:creator>ripflowers</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Others]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[游标]]></category>
		<category><![CDATA[触发器]]></category>

		<guid isPermaLink="false">http://ursob.org/?p=394</guid>
		<description><![CDATA[这里说的触发器和游标的使用在sqlserver2000和sqlserver2005中测试通过，鄙人认为触发器也算是一种存储过程，触发器是在数据库中自动触发，而存储过程需要的程序中调用，语法和用法上来说应该是大同小异的，对sql的功底不深，请恕在下在此妄加揣摩，直接看代码和注释。]]></description>
			<content:encoded><![CDATA[<p>这里说的触发器和游标的使用在sqlserver2000和sqlserver2005中测试通过，鄙人认为触发器也算是一种存储过程，触发器是在数据库中自动触发，而存储过程需要的程序中调用，语法和用法上来说应该是大同小异的，对sql的功底不深，请恕在下在此妄加猜测，直接看代码和注释。</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:Courier New, Courier;"><span style="color: #993333; font-weight: bold;">CREATE</span> <span style="color: #993333; font-weight: bold;">TRIGGER</span> whenUpdate<span style="color: #808080; font-style: italic;">---触发器的名称</span>
  <span style="color: #993333; font-weight: bold;">ON</span> tableName<span style="color: #808080; font-style: italic;">--为表“tableName”创建触发器</span>
  <span style="color: #993333; font-weight: bold;">FOR</span> <span style="color: #993333; font-weight: bold;">UPDATE</span><span style="color: #808080; font-style: italic;">--为什么事件触发，这里当然就可以是增删改等操作了</span>
  <span style="color: #993333; font-weight: bold;">AS</span>        
	begin <span style="color: #808080; font-style: italic;">----------下边开始触发器要干的事情</span>
		Declare @cbid float<span style="color: #808080; font-style: italic;">-------声明的变量</span>
		Declare @cask float<span style="color: #808080; font-style: italic;">-------声明的变量</span>
		Declare @ctype varchar<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">20</span><span style="color: #66cc66;">&#41;</span><span style="color: #808080; font-style: italic;">--声明的变量</span>
		<span style="color: #808080; font-style: italic;">---下边三行代码代表了为三个变量赋值，</span>
		<span style="color: #808080; font-style: italic;">---这里要理解触发器里面的两个临时的表：Deleted , Inserted 。</span>
		<span style="color: #808080; font-style: italic;">---Deleted 与Inserted分别代表</span>
		<span style="color: #808080; font-style: italic;">---“tableName”表中“旧的一条记录” 和“新的一条记录”。	</span>
		<span style="color: #993333; font-weight: bold;">SET</span> @ctype <span style="color: #66cc66;">=</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> currencytype <span style="color: #993333; font-weight: bold;">FROM</span> Inserted<span style="color: #66cc66;">&#41;</span>
		<span style="color: #993333; font-weight: bold;">SET</span> @cbid <span style="color: #66cc66;">=</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> fex_bid <span style="color: #993333; font-weight: bold;">FROM</span> Inserted<span style="color: #66cc66;">&#41;</span>
		<span style="color: #993333; font-weight: bold;">SET</span> @cask <span style="color: #66cc66;">=</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> fex_ask <span style="color: #993333; font-weight: bold;">FROM</span> Inserted<span style="color: #66cc66;">&#41;</span>
&nbsp;
		Declare @sid numeric<span style="color: #808080; font-style: italic;">----------声明的变量</span>
		Declare @coinType varchar<span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #66cc66;">&#41;</span><span style="color: #808080; font-style: italic;">----------声明的变量</span>
		<span style="color: #808080; font-style: italic;">--声明游标，cur为游标的名称</span>
		Declare cur Cursor <span style="color: #993333; font-weight: bold;">FOR</span> 
			<span style="color: #808080; font-style: italic;">----这里就是查询一个表中的数据，然后将结果集给游标</span>
			<span style="color: #993333; font-weight: bold;">SELECT</span> id <span style="color: #993333; font-weight: bold;">AS</span> id<span style="color: #66cc66;">,</span>coinType <span style="color: #993333; font-weight: bold;">AS</span> coinType
					<span style="color: #993333; font-weight: bold;">FROM</span> shoutorder 
					<span style="color: #993333; font-weight: bold;">WHERE</span> <span style="color: #cc66cc;">1</span><span style="color: #66cc66;">=</span><span style="color: #cc66cc;">1</span>
			Open cur<span style="color: #808080; font-style: italic;">--打开游标，开始循环</span>
			<span style="color: #808080; font-style: italic;">--首先需要手动开始循环游标，</span>
			<span style="color: #808080; font-style: italic;">--并将上边查询结果集中的两个值分别赋给@sid和@coinType，</span>
			<span style="color: #808080; font-style: italic;">--主要这里的赋值是按查询字段的顺序赋值</span>
			Fetch next <span style="color: #993333; font-weight: bold;">FROM</span> cur <span style="color: #993333; font-weight: bold;">INTO</span> @sid<span style="color: #66cc66;">,</span>@coinType
			<span style="color: #808080; font-style: italic;">--------------循环体begin---------------</span>
			While @@fetch_status<span style="color: #66cc66;">=</span><span style="color: #cc66cc;">0</span> 
				Begin 
					<span style="color: #808080; font-style: italic;">---这里可有一些想要的操作判断等</span>
					<span style="color: #808080; font-style: italic;">---if和else的写法</span>
					<span style="color: #993333; font-weight: bold;">IF</span> <span style="color: #66cc66;">&#40;</span>@sid <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">3</span> <span style="color: #993333; font-weight: bold;">AND</span> @coinType <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>
						begin 
							<span style="color: #993333; font-weight: bold;">UPDATE</span><span style="color: #66cc66;">......</span><span style="color: #808080; font-style: italic;">--这里省略很多操作</span>
						end 
					else <span style="color: #993333; font-weight: bold;">IF</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>
						begin 
&nbsp;
						end
					<span style="color: #808080; font-style: italic;">--下标下移</span>
					Fetch Next <span style="color: #993333; font-weight: bold;">FROM</span> cur <span style="color: #993333; font-weight: bold;">INTO</span> @sid<span style="color: #66cc66;">,</span>@coinType
				End 
			<span style="color: #808080; font-style: italic;">--------------循环体end-----------------	</span>
		Close cur <span style="color: #808080; font-style: italic;">--关闭游标</span>
		<span style="color: #808080; font-style: italic;">--由于游标的机制是将数据全部加载到内存中然后才操作，</span>
		<span style="color: #808080; font-style: italic;">--这里请务必释放游标</span>
		Deallocate cur
	end</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://ursob.org/2010/06/02/sql-trigger-cursor/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sql中获取数据库中最近几分钟数据</title>
		<link>http://ursob.org/2010/05/26/sql-recent/</link>
		<comments>http://ursob.org/2010/05/26/sql-recent/#comments</comments>
		<pubDate>Thu, 27 May 2010 03:38:03 +0000</pubDate>
		<dc:creator>ripflowers</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Others]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[sql日期运算]]></category>

		<guid isPermaLink="false">http://ursob.org/?p=387</guid>
		<description><![CDATA[获取数据库中最近的几分钟数据，或者是最近几小时，或者是几秒钟的数据..........]]></description>
			<content:encoded><![CDATA[<p>获取数据库中最近的几分钟数据，或者是最近几小时，或者是几秒钟的数据&#8230;&#8230;&#8230;.</p>
<p><a href="http://ursob.org/wp-content/uploads/2010/05/sql-recent.bmp"><img class="alignnone size-full wp-image-388" title="sql-recent" src="http://ursob.org/wp-content/uploads/2010/05/sql-recent.bmp" alt="" /></a></p>
<p>图中查询的时候最近三分钟的数据，参数<span style="color: #800000;"><em><strong>“n”</strong></em></span>代表分钟，如果说还有别的需求，比如说不按分钟查，或者是&#8230;..，如下参数供参考：</p>
<p>日期部分                       缩写<br />
year   yy,                      yyyy<br />
quarter   qq,                  q<br />
Month   mm,                  m<br />
dayofyear   dy,              y<br />
Day   dd,                      d<br />
Week   wk,                   ww<br />
Hour                            hh<br />
minute   mi,                   n<br />
second   ss,                  s<br />
millisecond                    ms</p>
]]></content:encoded>
			<wfw:commentRss>http://ursob.org/2010/05/26/sql-recent/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sql中的排名算法</title>
		<link>http://ursob.org/2010/05/26/sqlserver2000-rank/</link>
		<comments>http://ursob.org/2010/05/26/sqlserver2000-rank/#comments</comments>
		<pubDate>Thu, 27 May 2010 00:48:44 +0000</pubDate>
		<dc:creator>ripflowers</dc:creator>
				<category><![CDATA[Others]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[排名算法]]></category>

		<guid isPermaLink="false">http://ursob.org/?p=379</guid>
		<description><![CDATA[sqlserver2005中有现成的排名函数，而2000中则还没有，用以下方法实现
]]></description>
			<content:encoded><![CDATA[<p>sqlserver2005中有现成的排名函数，而2000中则还没有，用以下方法实现</p>
<p>select balance as balance,(select count(*)+1 from member a where a.balance&gt;b.balance) as rank from member b order by rank asc;</p>
<p>附图：</p>
<p><a href="http://ursob.org/wp-content/uploads/2010/05/sql20001.bmp"><img class="alignnone size-full wp-image-385" title="sqlserver2000 rank" src="http://ursob.org/wp-content/uploads/2010/05/sql20001.bmp" alt="" /></a></p>
<p><a href="http://ursob.org/wp-content/uploads/2010/05/sql2000.bmp"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://ursob.org/2010/05/26/sqlserver2000-rank/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>连接sql server 2000服务器的解决方案（转）</title>
		<link>http://ursob.org/2010/05/18/sql-server-2000/</link>
		<comments>http://ursob.org/2010/05/18/sql-server-2000/#comments</comments>
		<pubDate>Tue, 18 May 2010 14:01:21 +0000</pubDate>
		<dc:creator>MoistRot</dc:creator>
				<category><![CDATA[Others]]></category>
		<category><![CDATA[DataBase]]></category>

		<guid isPermaLink="false">http://ursob.org/?p=369</guid>
		<description><![CDATA[远程连接sql server 2000服务器的解决方案]]></description>
			<content:encoded><![CDATA[<p>解决方案步骤：</p>
<p>
一、看ping 服务器IP能否ping通。<br />
这个实际上是看和远程sql server 2000服务器的物理连接是否存在。如果不行，请检查网络，查看配置，当然得确保远程sql server 2000服务器的IP拼写正确。
</p>
<p>
二、在Dos或命令行下输入telnet 服务器IP 端口，看能否连通。
</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:Courier New, Courier;">telnet 202.114.100.100 <span style="color: #000000;">1433</span></pre></div></div>

<p>
通常端口值是1433，因为1433是sql server 2000的对于Tcp/IP的默认侦听端口。如果有问题，通常这一步会出问题。通常的提示是“……无法打开连接,连接失败&#8221;。<br />
如果这一步有问题，应该检查以下选项。
</p>
<ul>
<li>
检查远程服务器是否启动了sql server 2000服务。如果没有，则启动。
</li>
<li>
检查服务器端有没启用Tcp/IP协议，因为远程连接（通过因特网）需要靠这个协议。检查方法是，在服务器上打开开始菜单->程序->Microsoft SQL Server->服务器网络实用工具，看启用的协议里是否有 tcp/ip协议，如果没有，则启用它。</li>
<li>检查服务器的tcp/ip端口是否配置为1433端口。仍然在服务器网络实用工具里查看启用协议里面的tcp/ip的属性，确保默认端口为1433，并且隐藏服务器复选框没有勾上。<br />
事实上，如果默认端口被修改，也是可以的，但是在客户端做telnet测试时，写服务器端口号时必须与服务器配置的端口号保持一致。如果隐藏服务器复选框被勾选，则意味着客户端无法通过枚举服务器来看到这台服务器，起到了保护的作用，但不影响连接，但是Tcp/ip协议的默认端口将被隐式修改为2433，在客户端连接时必须作相应的改变。</li>
<li>如果服务器端操作系统打过sp2补丁，则要对windows防火墙作一定的配置，要对它开放 1433端口，通常在测试时可以直接关掉windows防火墙（其他的防火墙也关掉最好）。 </li>
<li>检查服务器是否在1433端口侦听。如果服务器没有在tcp连接的1433端口侦听，则是连接不上的。检查方法是在服务器的dos或命令行下面输入 netstat -a -n 或者是netstat -an，在结果列表里看是否有类似 tcp 127.0.0.1 1433 listening 的项。如果没有，则通常需要给sql server 2000打上至少sp3的补丁。其实在服务器端启动查询分析器，输入 select @@version 执行后可以看到版本号，版本号在8.0.2039以下的都需要打补丁。</li>
</ul>
<p>
如果以上都没问题，这时你再做telnet 服务器ip 1433 测试，将会看到屏幕一闪之后光标在左上角不停闪动。恭喜你，你马上可以开始在企业管理器或查询分析器连接了。
</p>
<p>
三、检查客户端设置程序->Microsoft SQL Server-> 客户端网络使用工具。像在服务器网络实用工具里一样，确保客户端 tcp/ip协议启用，并且默认端口为1433（或其他端口，与服务器端保持一致就行）。
</p>
<p>
四、在企业管理器里或查询分析器连接测试。</p>
<blockquote><p>企业管理器->右键SQlserver组->新建 sqlserver注册->下一步->写入远程IP->下一步 -> 选Sqlserver登陆->下一 步->写入登陆名与密码（sa,password）->下一步-> 下一步->完成 。
</p></blockquote>
<blockquote><p>
查询分析器->文件->连接->写入远程IP->写入登录名和密码（sa,password）->确定。通常建议在查询分析器里做，因为默认情况下，通过企业管理器注册另外一台SQL Server的超时设置是4秒，而查询分析器是15秒。
</p></blockquote>
<p>修改默认连接超时的方法：
</p>
<blockquote><p>
企业管理器->工具->选项->在弹出的&#8221;SQL Server企业管理器属性&#8221;窗口中，点击&#8221;高级&#8221;选项卡->连接设置->在 登录超时（秒） 后面的框里输入一个较大的数字查询分析器->工具->选项->连接->在 登录超时（秒） 后面的框里输入一个较大的数字通常就可以连通了，如果提示错误，则进入下一步。
</p></blockquote>
<p>
五、错误产生的原因通常是由于SQL Server使用了&#8221;仅 Windows&#8221;的身份验证方式，因此用户无法使用SQL Server的登录帐户（如 sa ）进行连接。解决方法如下所示：
</p>
<ul>
<li>在服务器端使用企业管理器，并且选择&#8221;使用 Windows 身份验证&#8221;连接上 SQL Server。</li>
<li>展开&#8221;SQL Server组&#8221;，鼠标右键点击SQL Server服务器的名称，选择&#8221;属性&#8221;，再选择&#8221;安全性&#8221;选项卡。 </li>
<li>在&#8221;身份验证&#8221;下，选择&#8221;SQL Server和 Windows &#8220;。</li>
<li>重新启动SQL Server服务。（在dos或命令行下面net stop mssqlserver停止服务，net start mssqlserver启动服务，也是一种快捷的方法）。 注：在连接本地服务器时，通常使用的是命名管道协议（在服务器网络实用工具里可以看到启用的协议有这个），默认端口是445，因此在本地能连通是不能说明什么问题的，连接远程服务器是完全不同的协议）。 </li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://ursob.org/2010/05/18/sql-server-2000/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>林氏营养早餐、林氏养生茶、林氏排毒餐</title>
		<link>http://ursob.org/2010/05/12/good_life/</link>
		<comments>http://ursob.org/2010/05/12/good_life/#comments</comments>
		<pubDate>Wed, 12 May 2010 13:19:43 +0000</pubDate>
		<dc:creator>MoistRot</dc:creator>
				<category><![CDATA[Others]]></category>
		<category><![CDATA[养生]]></category>

		<guid isPermaLink="false">http://ursob.org/?p=353</guid>
		<description><![CDATA[林氏营养早餐、林氏养生茶、林氏排毒餐制作方法及其功用]]></description>
			<content:encoded><![CDATA[<p>一、林氏营养早餐</p>
<p>1. 原料</p>
<p>健康熟鸡蛋一个，苹果一个（香蕉一根），一把熟豆（各种豆类的集合），一袋酸奶（牛奶），一勺蛋白粉。</p>
<p>2. 制作方法</p>
<p>放入搅拌机搅碎倒入杯中即可食用。</p>
<p>3. 营养价值及作用</p>
<p>含有丰富的维生素及蛋白质，低热量。</p>
<p>制作简单、食用方便、节省时间、营养丰富，减少胃的消化负担。几乎包含人体所需的全部营养素，在现代人忙碌的生活中，营养早餐可满足一天的营养需求，让你一整天精力充沛，适宜长期食用。</p>
<p>二、林氏养生茶</p>
<p>1. 原料</p>
<p>黄豆、黑豆、芸豆、红豆、白豆、绿豆各一把。</p>
<p>小米、苡仁、黑米各一小把。</p>
<p>以上物质加水混合，浸泡一晚（6小时以上），然后加水煮熟，待用。</p>
<p>加入花生、芝麻、坚果、葡萄干等各一小勺，橄榄油一大勺，蜂蜜一勺，蛋白质粉一勺，维生素B（1.2毫克），维生素C(60毫克)各两颗。</p>
<p>2. 制作方法</p>
<p>将以上全部倒入搅拌机搅拌成奶昔状即可食用。称为茶，意思是可以随时饮用。</p>
<p>3. 营养价值及作用</p>
<p>此食物完全可以替代中餐和晚餐，营养丰富完整，不多不少，容易消化和吸收。对于亚健康及慢性疾病患者，有非常好的康复支持作用。可应用在心血管疾病、糖尿病、老年痴呆、妇女更年期症状调整、不孕、前列腺肥大、手脚冰冷等健康问题上。同时也是一种高能量的抗癌食物。</p>
<p>三、林式排毒餐</p>
<p>1.原料</p>
<p>地瓜一个，芋头少量，土豆一个，南瓜一块，菠萝半个，蛋白质粉半勺，橄榄油两勺。食用时，最好额外补充钙镁、维生素B、维生素C、维生素E及鱼油。</p>
<p>2. 制作方法</p>
<p>食用时将地瓜、芋头、土豆、南瓜、菠萝蒸熟，放入搅拌机，加水搅拌，成奶昔状。味道绝美而香，口感卓越。可以早、中、晚三餐食用，连用一周。</p>
<p>3. 营养价值及作用</p>
<p>排毒餐的制作简单、食用方便、节省时间、营养丰富，减少胃的消化负担。几乎包含人体所需的全部营养素。可作为补充食物，长期食用，对调理慢性疾病有显著的效果。</p>
<p>体内毒素的清除，是我们要做的一个重要工作。食物中有些好东西，可以长期食用，营养丰富，又同时清肠清血。它包括：地瓜、南瓜、土豆、芋头、山药。这些食物含有丰富的维生素及蛋白质，纤维含量高、热量低、营养均衡。能够彻底排除肠内垃圾，以均衡营养，达到美颜皮肤，抗衰老作用。虽然它们的淀粉含量丰富，却可以帮助减肥。<br />
<a href="http://ursob.org/wp-content/uploads/2010/05/00092950.jpg"><img src="http://ursob.org/wp-content/uploads/2010/05/00092950-239x300.jpg" alt="养生" title="养生" width="239" height="300" class="size-medium wp-image-354" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://ursob.org/2010/05/12/good_life/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>好吧，仍然继续。</title>
		<link>http://ursob.org/2010/04/16/allright_doitagian/</link>
		<comments>http://ursob.org/2010/04/16/allright_doitagian/#comments</comments>
		<pubDate>Fri, 16 Apr 2010 16:04:41 +0000</pubDate>
		<dc:creator>MoistRot</dc:creator>
				<category><![CDATA[Others]]></category>
		<category><![CDATA[且听风吟]]></category>

		<guid isPermaLink="false">http://ursob.org/?p=321</guid>
		<description><![CDATA[生活依然在继续，虽然我们如此疲惫。但，总归是要走向目的地的。
]]></description>
			<content:encoded><![CDATA[<p>生活依然在继续，虽然我们如此疲惫。但，总归是要走向目的地的。</p>
]]></content:encoded>
			<wfw:commentRss>http://ursob.org/2010/04/16/allright_doitagian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
