<!--{{{-->
<link rel='alternate' type='application/rss+xml' title='RSS' href='index.xml' />
<!--}}}-->
Background: #fff
Foreground: #000
PrimaryPale: #8cf
PrimaryLight: #18f
PrimaryMid: #04b
PrimaryDark: #014
SecondaryPale: #ffc
SecondaryLight: #fe8
SecondaryMid: #db4
SecondaryDark: #841
TertiaryPale: #eee
TertiaryLight: #ccc
TertiaryMid: #999
TertiaryDark: #666
Error: #f88
/*{{{*/
body {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}

a {color:[[ColorPalette::PrimaryMid]];}
a:hover {background-color:[[ColorPalette::PrimaryMid]]; color:[[ColorPalette::Background]];}
a img {border:0;}

h1,h2,h3,h4,h5,h6 {color:[[ColorPalette::SecondaryDark]]; background:transparent;}
h1 {border-bottom:2px solid [[ColorPalette::TertiaryLight]];}
h2,h3 {border-bottom:1px solid [[ColorPalette::TertiaryLight]];}

.button {color:[[ColorPalette::PrimaryDark]]; border:1px solid [[ColorPalette::Background]];}
.button:hover {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::SecondaryLight]]; border-color:[[ColorPalette::SecondaryMid]];}
.button:active {color:[[ColorPalette::Background]]; background:[[ColorPalette::SecondaryMid]]; border:1px solid [[ColorPalette::SecondaryDark]];}

.header {background:[[ColorPalette::PrimaryMid]];}
.headerShadow {color:[[ColorPalette::Foreground]];}
.headerShadow a {font-weight:normal; color:[[ColorPalette::Foreground]];}
.headerForeground {color:[[ColorPalette::Background]];}
.headerForeground a {font-weight:normal; color:[[ColorPalette::PrimaryPale]];}

.tabSelected{color:[[ColorPalette::PrimaryDark]];
	background:[[ColorPalette::TertiaryPale]];
	border-left:1px solid [[ColorPalette::TertiaryLight]];
	border-top:1px solid [[ColorPalette::TertiaryLight]];
	border-right:1px solid [[ColorPalette::TertiaryLight]];
}
.tabUnselected {color:[[ColorPalette::Background]]; background:[[ColorPalette::TertiaryMid]];}
.tabContents {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::TertiaryPale]]; border:1px solid [[ColorPalette::TertiaryLight]];}
.tabContents .button {border:0;}

#sidebar {}
#sidebarOptions input {border:1px solid [[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel {background:[[ColorPalette::PrimaryPale]];}
#sidebarOptions .sliderPanel a {border:none;color:[[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel a:hover {color:[[ColorPalette::Background]]; background:[[ColorPalette::PrimaryMid]];}
#sidebarOptions .sliderPanel a:active {color:[[ColorPalette::PrimaryMid]]; background:[[ColorPalette::Background]];}

.wizard {background:[[ColorPalette::PrimaryPale]]; border:1px solid [[ColorPalette::PrimaryMid]];}
.wizard h1 {color:[[ColorPalette::PrimaryDark]]; border:none;}
.wizard h2 {color:[[ColorPalette::Foreground]]; border:none;}
.wizardStep {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];
	border:1px solid [[ColorPalette::PrimaryMid]];}
.wizardStep.wizardStepDone {background:[[ColorPalette::TertiaryLight]];}
.wizardFooter {background:[[ColorPalette::PrimaryPale]];}
.wizardFooter .status {background:[[ColorPalette::PrimaryDark]]; color:[[ColorPalette::Background]];}
.wizard .button {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::SecondaryLight]]; border: 1px solid;
	border-color:[[ColorPalette::SecondaryPale]] [[ColorPalette::SecondaryDark]] [[ColorPalette::SecondaryDark]] [[ColorPalette::SecondaryPale]];}
.wizard .button:hover {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::Background]];}
.wizard .button:active {color:[[ColorPalette::Background]]; background:[[ColorPalette::Foreground]]; border: 1px solid;
	border-color:[[ColorPalette::PrimaryDark]] [[ColorPalette::PrimaryPale]] [[ColorPalette::PrimaryPale]] [[ColorPalette::PrimaryDark]];}

.wizard .notChanged {background:transparent;}
.wizard .changedLocally {background:#80ff80;}
.wizard .changedServer {background:#8080ff;}
.wizard .changedBoth {background:#ff8080;}
.wizard .notFound {background:#ffff80;}
.wizard .putToServer {background:#ff80ff;}
.wizard .gotFromServer {background:#80ffff;}

#messageArea {border:1px solid [[ColorPalette::SecondaryMid]]; background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]];}
#messageArea .button {color:[[ColorPalette::PrimaryMid]]; background:[[ColorPalette::SecondaryPale]]; border:none;}

.popupTiddler {background:[[ColorPalette::TertiaryPale]]; border:2px solid [[ColorPalette::TertiaryMid]];}

.popup {background:[[ColorPalette::TertiaryPale]]; color:[[ColorPalette::TertiaryDark]]; border-left:1px solid [[ColorPalette::TertiaryMid]]; border-top:1px solid [[ColorPalette::TertiaryMid]]; border-right:2px solid [[ColorPalette::TertiaryDark]]; border-bottom:2px solid [[ColorPalette::TertiaryDark]];}
.popup hr {color:[[ColorPalette::PrimaryDark]]; background:[[ColorPalette::PrimaryDark]]; border-bottom:1px;}
.popup li.disabled {color:[[ColorPalette::TertiaryMid]];}
.popup li a, .popup li a:visited {color:[[ColorPalette::Foreground]]; border: none;}
.popup li a:hover {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; border: none;}
.popup li a:active {background:[[ColorPalette::SecondaryPale]]; color:[[ColorPalette::Foreground]]; border: none;}
.popupHighlight {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}
.listBreak div {border-bottom:1px solid [[ColorPalette::TertiaryDark]];}

.tiddler .defaultCommand {font-weight:bold;}

.shadow .title {color:[[ColorPalette::TertiaryDark]];}

.title {color:[[ColorPalette::SecondaryDark]];}
.subtitle {color:[[ColorPalette::TertiaryDark]];}

.toolbar {color:[[ColorPalette::PrimaryMid]];}
.toolbar a {color:[[ColorPalette::TertiaryLight]];}
.selected .toolbar a {color:[[ColorPalette::TertiaryMid]];}
.selected .toolbar a:hover {color:[[ColorPalette::Foreground]];}

.tagging, .tagged {border:1px solid [[ColorPalette::TertiaryPale]]; background-color:[[ColorPalette::TertiaryPale]];}
.selected .tagging, .selected .tagged {background-color:[[ColorPalette::TertiaryLight]]; border:1px solid [[ColorPalette::TertiaryMid]];}
.tagging .listTitle, .tagged .listTitle {color:[[ColorPalette::PrimaryDark]];}
.tagging .button, .tagged .button {border:none;}

.footer {color:[[ColorPalette::TertiaryLight]];}
.selected .footer {color:[[ColorPalette::TertiaryMid]];}

.sparkline {background:[[ColorPalette::PrimaryPale]]; border:0;}
.sparktick {background:[[ColorPalette::PrimaryDark]];}

.error, .errorButton {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::Error]];}
.warning {color:[[ColorPalette::Foreground]]; background:[[ColorPalette::SecondaryPale]];}
.lowlight {background:[[ColorPalette::TertiaryLight]];}

.zoomer {background:none; color:[[ColorPalette::TertiaryMid]]; border:3px solid [[ColorPalette::TertiaryMid]];}

.imageLink, #displayArea .imageLink {background:transparent;}

.annotation {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; border:2px solid [[ColorPalette::SecondaryMid]];}

.viewer .listTitle {list-style-type:none; margin-left:-2em;}
.viewer .button {border:1px solid [[ColorPalette::SecondaryMid]];}
.viewer blockquote {border-left:3px solid [[ColorPalette::TertiaryDark]];}

.viewer table, table.twtable {border:2px solid [[ColorPalette::TertiaryDark]];}
.viewer th, .viewer thead td, .twtable th, .twtable thead td {background:[[ColorPalette::SecondaryMid]]; border:1px solid [[ColorPalette::TertiaryDark]]; color:[[ColorPalette::Background]];}
.viewer td, .viewer tr, .twtable td, .twtable tr {border:1px solid [[ColorPalette::TertiaryDark]];}

.viewer pre {border:1px solid [[ColorPalette::SecondaryLight]]; background:[[ColorPalette::SecondaryPale]];}
.viewer code {color:[[ColorPalette::SecondaryDark]];}
.viewer hr {border:0; border-top:dashed 1px [[ColorPalette::TertiaryDark]]; color:[[ColorPalette::TertiaryDark]];}

.highlight, .marked {background:[[ColorPalette::SecondaryLight]];}

.editor input {border:1px solid [[ColorPalette::PrimaryMid]];}
.editor textarea {border:1px solid [[ColorPalette::PrimaryMid]]; width:100%;}
.editorFooter {color:[[ColorPalette::TertiaryMid]];}
.readOnly {background:[[ColorPalette::TertiaryPale]];}

#backstageArea {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::TertiaryMid]];}
#backstageArea a {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::Background]]; border:none;}
#backstageArea a:hover {background:[[ColorPalette::SecondaryLight]]; color:[[ColorPalette::Foreground]]; }
#backstageArea a.backstageSelTab {background:[[ColorPalette::Background]]; color:[[ColorPalette::Foreground]];}
#backstageButton a {background:none; color:[[ColorPalette::Background]]; border:none;}
#backstageButton a:hover {background:[[ColorPalette::Foreground]]; color:[[ColorPalette::Background]]; border:none;}
#backstagePanel {background:[[ColorPalette::Background]]; border-color: [[ColorPalette::Background]] [[ColorPalette::TertiaryDark]] [[ColorPalette::TertiaryDark]] [[ColorPalette::TertiaryDark]];}
.backstagePanelFooter .button {border:none; color:[[ColorPalette::Background]];}
.backstagePanelFooter .button:hover {color:[[ColorPalette::Foreground]];}
#backstageCloak {background:[[ColorPalette::Foreground]]; opacity:0.6; filter:'alpha(opacity=60)';}
/*}}}*/
/*{{{*/
* html .tiddler {height:1%;}

body {font-size:.75em; font-family:arial,helvetica; margin:0; padding:0;}

h1,h2,h3,h4,h5,h6 {font-weight:bold; text-decoration:none;}
h1,h2,h3 {padding-bottom:1px; margin-top:1.2em;margin-bottom:0.3em;}
h4,h5,h6 {margin-top:1em;}
h1 {font-size:1.35em;}
h2 {font-size:1.25em;}
h3 {font-size:1.1em;}
h4 {font-size:1em;}
h5 {font-size:.9em;}

hr {height:1px;}

a {text-decoration:none;}

dt {font-weight:bold;}

ol {list-style-type:decimal;}
ol ol {list-style-type:lower-alpha;}
ol ol ol {list-style-type:lower-roman;}
ol ol ol ol {list-style-type:decimal;}
ol ol ol ol ol {list-style-type:lower-alpha;}
ol ol ol ol ol ol {list-style-type:lower-roman;}
ol ol ol ol ol ol ol {list-style-type:decimal;}

.txtOptionInput {width:11em;}

#contentWrapper .chkOptionInput {border:0;}

.externalLink {text-decoration:underline;}

.indent {margin-left:3em;}
.outdent {margin-left:3em; text-indent:-3em;}
code.escaped {white-space:nowrap;}

.tiddlyLinkExisting {font-weight:bold;}
.tiddlyLinkNonExisting {font-style:italic;}

/* the 'a' is required for IE, otherwise it renders the whole tiddler in bold */
a.tiddlyLinkNonExisting.shadow {font-weight:bold;}

#mainMenu .tiddlyLinkExisting,
	#mainMenu .tiddlyLinkNonExisting,
	#sidebarTabs .tiddlyLinkNonExisting {font-weight:normal; font-style:normal;}
#sidebarTabs .tiddlyLinkExisting {font-weight:bold; font-style:normal;}

.header {position:relative;}
.header a:hover {background:transparent;}
.headerShadow {position:relative; padding:4.5em 0 1em 1em; left:-1px; top:-1px;}
.headerForeground {position:absolute; padding:4.5em 0 1em 1em; left:0px; top:0px;}

.siteTitle {font-size:3em;}
.siteSubtitle {font-size:1.2em;}

#mainMenu {position:absolute; left:0; width:10em; text-align:right; line-height:1.6em; padding:1.5em 0.5em 0.5em 0.5em; font-size:1.1em;}

#sidebar {position:absolute; right:3px; width:16em; font-size:.9em;}
#sidebarOptions {padding-top:0.3em;}
#sidebarOptions a {margin:0 0.2em; padding:0.2em 0.3em; display:block;}
#sidebarOptions input {margin:0.4em 0.5em;}
#sidebarOptions .sliderPanel {margin-left:1em; padding:0.5em; font-size:.85em;}
#sidebarOptions .sliderPanel a {font-weight:bold; display:inline; padding:0;}
#sidebarOptions .sliderPanel input {margin:0 0 0.3em 0;}
#sidebarTabs .tabContents {width:15em; overflow:hidden;}

.wizard {padding:0.1em 1em 0 2em;}
.wizard h1 {font-size:2em; font-weight:bold; background:none; padding:0; margin:0.4em 0 0.2em;}
.wizard h2 {font-size:1.2em; font-weight:bold; background:none; padding:0; margin:0.4em 0 0.2em;}
.wizardStep {padding:1em 1em 1em 1em;}
.wizard .button {margin:0.5em 0 0; font-size:1.2em;}
.wizardFooter {padding:0.8em 0.4em 0.8em 0;}
.wizardFooter .status {padding:0 0.4em; margin-left:1em;}
.wizard .button {padding:0.1em 0.2em;}

#messageArea {position:fixed; top:2em; right:0; margin:0.5em; padding:0.5em; z-index:2000; _position:absolute;}
.messageToolbar {display:block; text-align:right; padding:0.2em;}
#messageArea a {text-decoration:underline;}

.tiddlerPopupButton {padding:0.2em;}
.popupTiddler {position: absolute; z-index:300; padding:1em; margin:0;}

.popup {position:absolute; z-index:300; font-size:.9em; padding:0; list-style:none; margin:0;}
.popup .popupMessage {padding:0.4em;}
.popup hr {display:block; height:1px; width:auto; padding:0; margin:0.2em 0;}
.popup li.disabled {padding:0.4em;}
.popup li a {display:block; padding:0.4em; font-weight:normal; cursor:pointer;}
.listBreak {font-size:1px; line-height:1px;}
.listBreak div {margin:2px 0;}

.tabset {padding:1em 0 0 0.5em;}
.tab {margin:0 0 0 0.25em; padding:2px;}
.tabContents {padding:0.5em;}
.tabContents ul, .tabContents ol {margin:0; padding:0;}
.txtMainTab .tabContents li {list-style:none;}
.tabContents li.listLink { margin-left:.75em;}

#contentWrapper {display:block;}
#splashScreen {display:none;}

#displayArea {margin:1em 17em 0 14em;}

.toolbar {text-align:right; font-size:.9em;}

.tiddler {padding:1em 1em 0;}

.missing .viewer,.missing .title {font-style:italic;}

.title {font-size:1.6em; font-weight:bold;}

.missing .subtitle {display:none;}
.subtitle {font-size:1.1em;}

.tiddler .button {padding:0.2em 0.4em;}

.tagging {margin:0.5em 0.5em 0.5em 0; float:left; display:none;}
.isTag .tagging {display:block;}
.tagged {margin:0.5em; float:right;}
.tagging, .tagged {font-size:0.9em; padding:0.25em;}
.tagging ul, .tagged ul {list-style:none; margin:0.25em; padding:0;}
.tagClear {clear:both;}

.footer {font-size:.9em;}
.footer li {display:inline;}

.annotation {padding:0.5em; margin:0.5em;}

* html .viewer pre {width:99%; padding:0 0 1em 0;}
.viewer {line-height:1.4em; padding-top:0.5em;}
.viewer .button {margin:0 0.25em; padding:0 0.25em;}
.viewer blockquote {line-height:1.5em; padding-left:0.8em;margin-left:2.5em;}
.viewer ul, .viewer ol {margin-left:0.5em; padding-left:1.5em;}

.viewer table, table.twtable {border-collapse:collapse; margin:0.8em 1.0em;}
.viewer th, .viewer td, .viewer tr,.viewer caption,.twtable th, .twtable td, .twtable tr,.twtable caption {padding:3px;}
table.listView {font-size:0.85em; margin:0.8em 1.0em;}
table.listView th, table.listView td, table.listView tr {padding:0px 3px 0px 3px;}

.viewer pre {padding:0.5em; margin-left:0.5em; font-size:1.2em; line-height:1.4em; overflow:auto;}
.viewer code {font-size:1.2em; line-height:1.4em;}

.editor {font-size:1.1em;}
.editor input, .editor textarea {display:block; width:100%; font:inherit;}
.editorFooter {padding:0.25em 0; font-size:.9em;}
.editorFooter .button {padding-top:0px; padding-bottom:0px;}

.fieldsetFix {border:0; padding:0; margin:1px 0px;}

.sparkline {line-height:1em;}
.sparktick {outline:0;}

.zoomer {font-size:1.1em; position:absolute; overflow:hidden;}
.zoomer div {padding:1em;}

* html #backstage {width:99%;}
* html #backstageArea {width:99%;}
#backstageArea {display:none; position:relative; overflow: hidden; z-index:150; padding:0.3em 0.5em;}
#backstageToolbar {position:relative;}
#backstageArea a {font-weight:bold; margin-left:0.5em; padding:0.3em 0.5em;}
#backstageButton {display:none; position:absolute; z-index:175; top:0; right:0;}
#backstageButton a {padding:0.1em 0.4em; margin:0.1em;}
#backstage {position:relative; width:100%; z-index:50;}
#backstagePanel {display:none; z-index:100; position:absolute; width:90%; margin-left:3em; padding:1em;}
.backstagePanelFooter {padding-top:0.2em; float:right;}
.backstagePanelFooter a {padding:0.2em 0.4em;}
#backstageCloak {display:none; z-index:20; position:absolute; width:100%; height:100px;}

.whenBackstage {display:none;}
.backstageVisible .whenBackstage {display:block;}
/*}}}*/
/***
StyleSheet for use when a translation requires any css style changes.
This StyleSheet can be used directly by languages such as Chinese, Japanese and Korean which need larger font sizes.
***/
/*{{{*/
body {font-size:0.8em;}
#sidebarOptions {font-size:1.05em;}
#sidebarOptions a {font-style:normal;}
#sidebarOptions .sliderPanel {font-size:0.95em;}
.subtitle {font-size:0.8em;}
.viewer table.listView {font-size:0.95em;}
/*}}}*/
/*{{{*/
@media print {
#mainMenu, #sidebar, #messageArea, .toolbar, #backstageButton, #backstageArea {display: none !important;}
#displayArea {margin: 1em 1em 0em;}
noscript {display:none;} /* Fixes a feature in Firefox 1.5.0.2 where print preview displays the noscript content */
}
/*}}}*/
<!--{{{-->
<div class='header' macro='gradient vert [[ColorPalette::PrimaryLight]] [[ColorPalette::PrimaryMid]]'>
<div class='headerShadow'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
<div class='headerForeground'>
<span class='siteTitle' refresh='content' tiddler='SiteTitle'></span>&nbsp;
<span class='siteSubtitle' refresh='content' tiddler='SiteSubtitle'></span>
</div>
</div>
<div id='mainMenu' refresh='content' tiddler='MainMenu'></div>
<div id='sidebar'>
<div id='sidebarOptions' refresh='content' tiddler='SideBarOptions'></div>
<div id='sidebarTabs' refresh='content' force='true' tiddler='SideBarTabs'></div>
</div>
<div id='displayArea'>
<div id='messageArea'></div>
<div id='tiddlerDisplay'></div>
</div>
<!--}}}-->
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::ViewToolbar]]'></div>
<div class='title' macro='view title'></div>
<div class='subtitle'><span macro='view modifier link'></span>, <span macro='view modified date'></span> (<span macro='message views.wikified.createdPrompt'></span> <span macro='view created date'></span>)</div>
<div class='tagging' macro='tagging'></div>
<div class='tagged' macro='tags'></div>
<div class='viewer' macro='view text wikified'></div>
<div class='tagClear'></div>
<!--}}}-->
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::EditToolbar]]'></div>
<div class='title' macro='view title'></div>
<div class='editor' macro='edit title'></div>
<div macro='annotations'></div>
<div class='editor' macro='edit text'></div>
<div class='editor' macro='edit tags'></div><div class='editorFooter'><span macro='message views.editor.tagPrompt'></span><span macro='tagChooser excludeLists'></span></div>
<!--}}}-->
To get started with this blank [[TiddlyWiki]], you'll need to modify the following tiddlers:
* [[SiteTitle]] & [[SiteSubtitle]]: The title and subtitle of the site, as shown above (after saving, they will also appear in the browser title bar)
* [[MainMenu]]: The menu (usually on the left)
* [[DefaultTiddlers]]: Contains the names of the tiddlers that you want to appear when the TiddlyWiki is opened
You'll also need to enter your username for signing your edits: <<option txtUserName>>
These [[InterfaceOptions]] for customising [[TiddlyWiki]] are saved in your browser

Your username for signing your edits. Write it as a [[WikiWord]] (eg [[JoeBloggs]])

<<option txtUserName>>
<<option chkSaveBackups>> [[SaveBackups]]
<<option chkAutoSave>> [[AutoSave]]
<<option chkRegExpSearch>> [[RegExpSearch]]
<<option chkCaseSensitiveSearch>> [[CaseSensitiveSearch]]
<<option chkAnimate>> [[EnableAnimations]]

----
Also see [[AdvancedOptions]]
<<importTiddlers>>
!2010-11-1

{{{
1. phi的sign必须是{0, 1, -1}
测试如果只有{0, 1}是不行的,无法恢复

2. 信号源的生成已经可以仿真了

3. G和Phi的生成
按照paper生成G的方法,没有办法保证G有固定的行重和列重
不知道如何仿真?
}}}

!2010-10-31
{{{
	  						 					  		
	  						 					  		
10-31
1. shiftpdf就是在变换均值,要测试的时候需要注意:
xx的范围要大一点,如pdf是[0.1 0.2 0.4 0.2 0.1],常规是xx=-2:2就够了
但是要保证不会移出界,要先有pdf的index范围要包含offset + xx,才不会出错

2. 在上一次的小结中,x是{0 1}的信号
	这次换成{0, -1, 1}的信号
	测试数据
	[n k r]	= [400 40 20]4/400	 (iter = 10) (iter = 20时,divergence,误码率大) (l=20)
									(l=40时,无失真 => l = k最优?)
			****************验证l=k最优************
			= [500 50 25] l=50 无失真
			***************************************
			= [500 50 20] 失真大 => k : r = 2 : 1? or k : msr > or = 1 : 5?
			##################
			= [200 20 10] => k : msr = 20 : 100 = 1:5	O (有的时候会divergence)
			= [200 20 15] => k : msr = 20 : 150 = 1:7.5 O
			= [200 20 5]  => k : msr = 20 : 50  = 1:2.5 x
			##################;
			
			
3. 参考了GPSR,根据文章中的fig 1,发现它也不能恢复出0,1的幅度,只能Locate。
	但是Debias以后,这种情况能够改善。
	=>
	1) BP恢复可以用现在的方法,恢复mrecon以后用threshold判决
	2) 研究过程中,如果能找到类似GPSR中debias的方法,就更好了


小结:当前情况,能够成功的数据是:
	x {0, -1, 1} threshold = 0.1
	l = 20
	[n k r] = [400 40 20]
			= [200 20 >=10]

			 
4. <BCS via BP>再次阅读
1)
Seeger and Nickisch [26] extend these ideas to experimental design, where the encoding matrix is designed sequentially based
on previous measurements. Another Bayesian approach by Schniter et al. [27] approximates
conditional expectation by extending the maximal likelihood approach to a weighted mixture
of the most likely models. There are also many related results on application of Bayesian
methods to sparse inverse problems (c.f. [28] and references therein)
<BCS via BP>的[26]-[28],估计以后能够用到,关于encode mtx的东西

2)
搜索一下[36]这篇文章,讲得是LDLC用BP恢复的,有用!
N. Sommer, M. Feder, and O. Shalvi, “Low-density lattice codes”
讲了factor graph等


3)
M = O(K log(N)) => n = 200, k = 20 -> m = O(14*20) = O(280)?
这里能否得到一些关于M的计算方法,从而得到r的计算方法?

4)
l的取法,可以用sparsity
The row weight L can be chosen based on signal properties such as sparsity, possible measurement noise, and details of the
decoding process.

5)
记得好像说如果只要知道state会更简单,找到这个解释。
能不能用state然后模拟信号源,然后译码后由计算state?
复杂化?但是准确? -> 仿真测试
Second, if we are only interested in an estimate of the state configuration vector q but not in the coefficient
values, then less information must be extracted from the measurements. Consequently,
the number of measurements can be reduced.

6)
As long as S = K/N = Omega((sigma0/sigma1)~2) => then M = O(K log(N)) measurements are sufficient					
对K的要求,K/N = Omega((sigma0/sigma1)~2),所以仿真中有要求- -
Omega是个什么函数?

7)
文章给出了根据实验结果得到的l, k, r的设置
L ≈ S~(-1) = N/K, M = O(K log(N)), and R = LM/N = O(log(N))

}}}

!2010-10-29
{{{
1)
好像是因为norm太小,导致会Divergence- -
观测结果显示,norm(x)必须要大于4才行

2)
实验结果显示,在sigma_1 = 1, sigma_0 = 0.01时,将threshod = 0.1符合稀疏度
原因没有进行验证,但这一个结果足够仿真所需的信息

3)
n = 200
iter = 10时,k = [20 - 25], msr = 100	能够无失真恢复

			k = 30时,增大iter也无法无失真恢复,divergence
			
							msr = 200,Iter增大能使误码率降低
			
			k = 40, msr = 200 无失真恢复
小结:在Iter = 10的情况下, msr = 5 * k; 即n * r / l = 5 * k;
	  文章说l=20为最优,所以n * r = 100 * k, r = 100 * k / n;
	  测试了几组数据
	  iter = 10 => [n k r] = [200 20 10], [200 40 20] 无失真
	  iter = 20 => [n k r] = [400 20 10] 误码率1/400 
	  						 [400 40 20] 误码率41/400
	  						 => l和k保持一致是最好的?
	  						 [800 20 10] 误码率156/800 =>所以l和k不是保持一致最好;
	  						 					  	或者是因为Pdf_prior没有给对
	  						 					  		pdf_prior如果设成bernulli分布,就要去研究一下shiftpdf_fft这个函数,是以高斯来模拟从而移动均值,还是?
}}}


!2010-10-28
{{{
download 'CS via BP'的仿真源码,为了重现仿真
想要看一下这篇文章做的误码率是控制在什么范围里的

仍然会使用NBP来进行仿真,新的代码比较规范~

sims1c.m的仿真结果,即paper中的figure 3(第一幅仿真图)
1) increasing M reduces the decoding error,
until it reaches the energy level of the small coefficients
图中的两条虚线分别表示: norm(x, 2)和norm(small_coeff, 2)
2) 行重L小,会Miss some of the large coefficients -> bad for decoding
   行重L越大,得到相同precision所需的M越少
   但是,实验测得是L .= 2/S = 20时是最优的 (S=0.1稀疏度)
   L > 20时,会大致divergence, even with damping
   (说是实际上测量矩阵A和BP并不能保证收敛,而只有特定的测量矩阵才能保证收敛)
   -> 对L的要求


想法:
仍然用gen_noisy来生成x,然后给出一个阈值,使得x为二进制?
}}}

!!!2010-10-27
{{{
见周报告

plus:
【phi的问题】
l和r的设计见注释
现象:r越小,错误率越小?why?
不是应该m越大,错误率越小么?
}}}


! 2010-10-16
{{{
总结一下DCVS这个理论吧
总的来说就是结合了已有的DCS和DVC
DVC中借用他的SI的获取以及GOP等这样的模式
然后把编码方式换成CS,这样把complexity shift到Decoder
DCS这边给出的一个JSM的模型,然后可以用来建模SI?
也可以说仅仅给出了一个CS distributed的可能性
也就是说,实际上是DVC和CS的结合~~

所以基本上有几个做的方向:
1. SI的获取和应用。
	1) 获取方面去refer DVC,基本上比较成熟吧?就是SW,WZ那一套
	2) 应用方面就涉及到
		a. 建模
		b. CS的恢复算法
2. CS的恢复算法提高
	1) stop criteration
	2) converge
	3) PSNR
3. 其他
	1) block-based? 
		文章里有说不sparse的传统,sparse的CS这样的Framework
		然后记得有一篇文章讲block DCT还是WHMT类似这样的算法,就是DUKE的那个
		
-------------------------------------------------
把DUKE的BCS和STANFORD的SparseLab下下来了
}}}


! 2010-10-10
{{{
信息论角度理解不叫复杂,有一个比较奇怪的问题想不通。

设A的概率分布为[1/2 1/2]。
则A=0的信息量为I(p(A=0))=I(1/2) = -log(0.5) = 1bit
所以,A=0这个事件的信息量就是1bit
(问题1:A=0这个事件的信息量的意思是什么?是观察到A=0后,得到的信息?
那A这个事件的熵(平均信息量)是什么意思?是观察到A后,无论是什么结果,平均得到的信息量?
)

考虑AB这个联合事件
另AB的概率分布[00:1/4 10:1/8 01:1/4 11:3/8]
这个分布符合A的概率分布[1/2 1/2]

那么,我从AB=00和01这两个事件得到的信息量(分别为2bit!注,不是0.5bit,-logp)
和A=0这个事件的信息量有什么关系?
比较偏向于A=0的信息量是AB=00和01的平均信息量。
这样对这种解释能够符合。
但是,对AB=10和11时,不符合。

从公式上来推导 -logp = -(p1*logp1 + p2*logp2)是否成立(p1+p2=p)?(经验证不成立- -)

那怎么考虑?从整个事件来考虑?
A的熵是1bit,那AB的熵也不等于A的熵。

那A和AB这两个事件,联系在哪?
H(A) < H(AB)? 查信息论的书- -

其实这一点和研究的BP没有很大关系。

下面一点才是重点。

P(AB) = P(A|B)*P(B)
AB的分布[0.1875 0.8125]	
A|B的分布[A=0: 1/4 1/8
		   A=1: 3/4 7/8]
		  [pi0    pi1
		  1-pi0   1-pi1]
B的分布[1/2; 1/2]
H(AB) = H(A|B) + H(B)这一点是没错的。???
但如何对应上面这个例子?

AB的熵:0.6962bit
B的熵:1 bit

BP中的assume是
P(ABCD) = P(A)P(B|CD)P(C|D)P(D);A是独立的,B,C,D互相依赖的

不想啦-------------------------------------------换点>.<
**********************************************************
基于DUKE的那个文章做!!
其实已经做了很多工作了,只需要把模型搬到DCVS的场景。
太恶心了- -
1. 下代码
2. 仿真
3. 比较结果
	1) 和MG比较
	2) 和WHMT比较(新?单独一篇paper?)
	
创新点只是做了搬移工作,要用哪些来修饰呢?
1. BP上面,weight已经没办法了- -除非是用一个tree re-weight?MIT那篇文章?
2. 模型上面,能做小修改么?如何适应DCVS的场景?
不要只限于单张图片方面,而要知道如何建模DCVS帧间的关系
1) WHMT的模型,关键帧,有一个训练数据,非关键帧的训练数据根据关键帧进行修改?

SI只是使用一个分布,如何exploit呢?Struc?
在关键帧译码完成后,对2个关键帧的结果进行联合训练?得到新的SI?

weight上面,从关键帧可以有一个weight给非关键帧,也就是SI有两个,给weight?
或者是用weight求之后就给成SI篇
}}}

! 2010-10-2
{{{
看了DUKE的两篇,exploit structure in BCS
主要讲的是类似WHMT模型的一个模型。
可以用在DCT变换上。
并且用了VB算法和MCMC infer算法。
都是估计MAP问题。
有几个比较有价值的信息:
1. exploit struc可以减少msr的个数
2. 无论是TS还是WHMT模型,都是用类似MG模型的概率分布来拟合
3. 这两篇文章提出的算法不需要训练!而HMT需要训练
4. 其中更早的那篇对其他CS的工作讲的比较好,可以用来整理当前CS
的发展。
5. 后发的一篇给出了一些算法的代码下载地址~可以去下载
6. 前一篇给出了一些future work,可以参考

<html><b>TODO:</b></html>
1. 对训练的这个说法比较感兴趣。这个算法不用训练,能不能用BP?
如果用BP,因为是类似VB的算法,可以作哪些改进?
也就是,BP中的那些设定,可以比较特殊,与VB不一样,从而从这个点来写。
问题是,不知道BP的效果会不会比VB好。
因此,需要去了解VB算法。
2. 自己的那个weight BP似乎好难- -想从信息论的角度来理解BP,但是有困难。
可能要从其他角度来分配权值。
实际上,prior不准是肯定的,很多文章都在建模,比如HMT和这边文章的tree struc。
都是为了得到一个更加好的prior估计。
那BP这种迭代算法,应该就是可以随着迭代,从Prior给的信息量会比较没用,作用小于
从check nodes来的。那到底应该怎么分配权值?
是不是应该从更加简单的东西开始分析。
即BP的原始算法,而不是从图像入手?
可以考虑。
}}}
*Topic: Image Reconstruction/Transmission via Compressed Sampling
*Task:
*# read the paper "Imaging via Compressive Sampling"
*# search for papers about compressive sampling on image reconstruction, etc.
*# learning about Simulink: signal processing toolbox
*Next Meeting: 10-27 2:00pm
*# New ideas about compressive imaging
*# Discussion about compressive imaging
*# Draft proposal
*# Simple block diagram
*# Draft figures and tables
!!!!Title: Evaluation and Implement of compressed sensing using Simulink

We always want signals being compressed before they are stored or transmitted, considering the limitation of resources, like memory, bandwidth, etc. Traditionally, signal is compressed by sampling it at a rate higher Nyquist rate, then compressing it into a smaller size. It would waste resources and time in that we "throw away" most of componenets we acquired and only keep the essential part of it. So is there any way that we can compress the signal directly? Compressed sensing(CS) theory just provide us the solution. Compressed sensing states that "one can recover certain signals and images from far fewer samples or measurements than traditional methods use"[1].
In CS, the signal X with size N*1 is sampled by multipling a measurement matrix Φ, with size M*N, that is Y= ΦX. So the size of measurement Y would be M*1. If M < < N, then the signal is compressed. When we reconstruct the signal from Y, it becomes an under-determined problem. Fortunately, the CS theory proves that if the signal X is a sparse in some domain Ψ, we could use a measurement matrix which statisfies RIP[2], then the signal can be reconstructed by solving an min-l~~0~~ problem: min||ΨX||~~l0~~ s.t. Y=ΦX

In our project, we aim to investigate image compression and reconstruction using CS in a Simulink environment. The system constists of an encoder, a noiseless or noisy channel, and a decoder(Fig.). At the encoder side, we use measurement matrix Φ to sample the signal X, which can be either continuous or discrete. The measurement matrix Φ could be a random matrix for CS. Then we transmit the compressed measurements Y via a channel, like AWGN channel. At the decoder side, we would use a convex optmization algorithm to reconstruct the signal.

In our project, we plan to using CS theory to sample an image, and compare it with JPEG in terms of data rate, quality of the reconstruted image and PSNR.


[1]An introduction to compressive sampling
[2]Near optimal signal recovery from random projections: Universal encoding strategies

!!!!Division of Tasks
# CS system (W, H, C)
## encoder & decoder design 
## testing the system 
# JPEG system for comparison (W, C)
## encoder & decoder design
## testing the system 
# channel design for both CS system and JPEG system (H)
# written report (W, H, C)
Image reconstruction ==> Distributed video coding (different sources coding, jointly reconstruction)
#uint8 -> bits converter
#*related part: huffman encoder, WZ encoder
#*reference: [[WZ Frame Encoder Problem]]
# get to know how the motion vector generator works
# Chris finished the key frame encoder
!!!Work
# Wubshet would finish the ''side information generator'' in the weekend
# Hao would finish the reconstruction in the weekend
# Hao woul add quantization block for the WZ frame encoder
# Chris would think about the huffman coding
!!!Future
# Construct the whole system
# Implement the Turbo Coder
# Implement the Huffman coding

To realize the SW encoder for ''pixel domain dvc'', the paper suggests to use the RCPT.
However, in Simulink, it is hard, or time is limited, to implemented the RCPT encoder and decoder.
And the paper states in Section III-D, there are two drawback for these RCPT.
So currently, I prefer to ignore the feedback channel, only use the Punctured Turbo(PT) code, with a fixed rate.
In our project, we regards each 8x8 block as a symbol stream, and send it to a Punctured Turbo encoder.
We use the puncture matrix to control the rate.
For each block, we have 256 bits, if we use a 1/3 Turbo encoder (that is, two 1/2 convolution encoder), then we have 256*2=512 parity bits. We set the puncture size P = 128, then the compression is achieved. The compression ration is 128/256 = 0.5. 
The maximum punctured code rate is 1/3 (the rate of the Turbo encoder), 
The paper [[Towards Practical Wyner-Ziv Coding of Video]] simulate four kinds of encoders. We can use one of its settings.
#Abstract 
#Background (Hao Wushet -> Chris)
#System
#* Key (Chris)
#* WZ (Hao)
#* SI information (Wubshet)
#* Reconstruction (Wubshet)
#* Channel (Hao)
#Performance
#Conclusion and future work
Test Sequence: Foreman_qcif
Noiseless:
#PSNR -- frame
#PSNR for WZ frames Before use SI -- after use SI for reconstruction (not for decode)
#Compression Ratio -- PSNR (average for 10 frames)
##Key Frame
##WZ Frame
##Whole (average)
Noisy:
#Compression Ratio -- PSNR (average for 10 frames) (fixed SNR: noisy level)
##Key Frame
##WZ Frame
##Whole (average)
#SNR -- PSNR (average for 10 frames) (fixed compression ratio)
##Key Frame
##WZ Frame
##Whole (average)
#Freq., Modulation, Sample Theory
#Matched Filter
#ISI
#Definition
## Moitola's CR
### Cognition Cycle model
## Spectrum Sensing CR
### Two main tasks:
#### Cognitive Capability
#### Reconfigurability
### Spectrum Hole
### Dynamic Spectrum Access
## The capability of CR
### 频率灵敏性
### adaptive modulalation
#### 改变传输特性和波形 => 提高频谱接入和''spectrum efficiency''
####* CDMA and TDMA
### 传输功率控制
### 测定自身位置和其他发射机位置的能力
### 频谱法定用户和第三方之间的spectrum sharing
### 具备安全机制
## physical layer architecture
## tasks
## applications
#Spectrum Sensing
#[[Spectrum Management]]
#Spectrum Sharing
# RCPT
# substractive dithering by shifiting ...
# bitplane


# .... blinking pixels at random locations 
!!Abstract
Distributed Video Coding is a new video compression technology. It is based on the distributed source coding theory, that is Slepian and Wolf's distributed lossless coding theory, and Wyner and Ziv's lossy source coding with side information at the decoder. This video coding scheme exploits the relationship of signals only at the decoder. Thus, distributed video coding shifts the complexity from encoder to decoder. So the distributed video coding always has a simple encoder and a powerful decoder. Our project implements a simple version of pixel-domain distributed video coding system in Simulink. Besides the Wyner-Ziv frame encoder and decoder, we also implemented the key frame encoder and decoder. It shows that although we do not use the feedback channel in RCPT code.  

!!Conclusion and Future Work
In this project, we implemented a pixel-domain distributed video coding system with no RCPT code in Simulink. This type of codec is useful for systems which require simple encoders but with powerful decoders. We implemented both key frame codec with tranditional coding scheme, and Wyner-Ziv frame codec. We also use motion compensation to generate the side information. We analyze the PSNR with different bit rate, and under noiseless and noisy environment, showing that this codec is error-resilience. Furture work will include implement RCPT code, more accurate side information generator, and incoporating the spatial statistics to further reduce the bit rate.
step: 0.005 iter:1e4
[p q r] = [0.05 0.06 0.08] Imax = 2.8447
step:0.005 iter:1e5
[p q r] = [0.05 0.06 0.08] Imax = 2.8462
step: 0.001 iter 1e5
[p q r] = [0.048 0.061 0.08], [0.048 0.062 0.078] Imax=2.8463

[p q r] = [0.11 0.055 0.03]  step=0.01 Imax = 2.8509
!2011-3-30
L = dc + dv - 5
L的决定:
# 在A中没有度为1的列和行向量,即生成degree分布的时候需要满足2<=degree(i)<=M
## 但是由此会引发出一个问题,能保证列重都大于1,但是行重无法通过简单的方法保证,需要考虑
# 除度为1的列向量,暂时假定可以有度为M的列向量
## 初步认为,矩阵A应该是一个稀疏的,所以不应该有度为M的向量,但是稀疏到一个什么程度,还要研究
## 觉得和K有关
## 根据LDPC码校验矩阵,它里面没有row that have no 1s(这是redundant的),也没有只有一个1的(这会使得相应的码字总是0)
# 度分布和矩阵A的关系是一对多,一组度分布可以对应多个可能的矩阵A
## 不同的生成矩阵A的方法得到的矩阵A是不同的

!2011-3-25
对git的几个版本的说明
# master: 主版本,暂时不会需要变动
# experiment: 主要编写版本,常变动,先在的版本是重现文章代码的版本
# rewrite: 测试版本,不常用,是重新写了一遍文章的代码
# ddistrib: 实现度分布差分进化的代码分支

对2011-3-22的pseudo code做一些更正:
不能假设A的degree是constant的,根据文章,就是要把constant的degree变成非constant的才有性能提升
以下问题:
# 在选择随机选择一个degree vector的时候,每个element的range是什么?[0 N]?




!2011-3-22
对A的degree进行密度演进的pseudo code

假设A的degree是constant的
{{{
% Initialization
sigma_threshold = xx;
iter_max = xx;

% L = dv_max + dc_max -5; %??
% or
L = 1;
NP = 10 * L;

dv = zeros(NP, L);
dv_best = zeros(1, L);
sigma_e = zeros(1, iter_max);
sigma_v = zeros(1, iter_max);

for SNR = 30:-5:10
for ii = 1:NP
	% 从[1, dv_max]中选取L个元素作为dv
	dv(ii, :) = rand_int(1, L, 1, dv_max);
	for it = 1:iter_max
		% dv(ii, :)作为参数传入main_BP_SBL,得到sigma
	end
	sigma_e(ii) = sigma;
end
[sigma_e_best index] = min(sigma_e);
dv_best = dv(index, :);


v = zeros(NP, L);

for iter = 1:iter_max
	% 从[0, NP-1]中随机选择4个数r
	for ii = 1:NP
		r = rand_int(1, 4, 1, NP);
		% c = 0.5;
		v(ii, :) = dv_best + c * (dv(r(1), :) - dv(r(2), :) + dv(r(3), :) - dv(r(4), :));
		for it = 1:iter_max
			% v(ii, :)作为参数传入main_BP_SBL,得到sigma
		end
		sigma_v(ii) = sigma;
	end

	% 选择
	for ii = 1:NP
		if sigma_e > sigma_v
			dv_2(ii, :) = v(ii, :);
			sigma_e_2(ii) = sigma_v(ii);
		else
			dv_2(ii, :) = dv(ii, :);
			sigma_e_2(ii) = sigma_e(ii);
		end
	end
	[sigma_e_best_2 index] = min(sigma_e_2);
	dv_best_2 = dv_2(index, :);

	if sigma_e_best_2 > sigma_threshold
		continue;
	else
		flag_find = 1;
		SNR_min = SNR;
		break;
	end
end

end

if flag_find == 0
	% 未找到
else
	% 找到在SNR_min下最优的dv
end
}}}

# 原文说的信道参数sigma是否就是本场景中的SNR?
# 原文中的L维是由dv_max+dc_max-5,即从dv_max+dc_max个参数中除去
## lambda_1 = rho_1 = 0
## lambda_2, rho_2,lambda_dv 可以由其他得到
### 本场景中,如果固定dv和dc,则L应该是1(由dv可以得到dc,即P中只有lambda_dv一个元素,为1,但是不知道是哪个dv是多少),这与原文中的L的计算方法不符合
### 但是,如果不固定dv和dc,则没有此问题
### 但是还要考虑随机选取的dv能不能符合n*dv = m*dc??如果不符合,怎么办?
# 实际编程的时候,要注意在每次迭代初始是否要进行变量重置


!2011-3-21
BP_SBL.m中,不要初始化eta(1) = eta0,而是直接eta(1) = 0
会使得RE性能很好,甚至超过paper的图,但是有点奇怪...有待进一步研究

实际上,paper说译码算法不需要其他parameter,说明只需要y和测量矩阵A
在BP_SBL.m的参数中,neighbors和ln实际上可以从A得到,只有eta0不应该存在,所以说明不需要初始化eta(1)

''LDPC密度演进中,式(6.9)和(6.10)不懂''

!2011-3-15
# 将gen_phi.m修改,使用option1 而不使用原本有缺陷的option2
# 实际上,根据paper,还能修改生成A矩阵的算法,留作future work
# 使用了l1-magic,即Basis Pursuit跑仿真,Basis Pursuit的仿真曲线和paper相符=>可能BP-SBL的代码编写有问题

在跑sim2.m,sim3.m,sim4.m时,出错
{{{
??? Error using ==> linsolve
Matrix must be positive definite.

Error in ==> l1qc_newton at 92
    [dx,hcond] = linsolve(H11p, w1p, opts);

Error in ==> l1qc_logbarrier at 104
  [xp, up, ntiter] = l1qc_newton(x, u, A, At, b, epsilon, tau, newtontol,
  newtonmaxiter, cgtol, cgmaxiter);

Error in ==> sim2 at 81
        xp = l1qc_logbarrier(x0, A_full, [], y, epsilon, 1e-3);
}}}
但是sim1.m没有这个情况

!2011-3-14
注意到,paper中说BP-SBL所需要的memory是O(N),而实际仿真程序(git commit a6ccf712...)却会消耗大量Memory(zeros(N, M))
说明仿真程序并不优化
=> 实际上,传递的消息mu_n2m, var_n2m, mu_m2n, var_m2n 并不需要用N*M or M*N的矩阵来存储,由于每个variable node的degree是确定的,实际上只有col_weight * N or N * col_weight这么多数据需要存储
由此来改进程序

通过neighbors = zeros(N, col_weight)可以得到mu_m2n, mu_n2m, var_m2n, var_n2m每一个元素对应的variable node,这样减少了存储空间。
neighbors的每一行共有col_weight个元素,代表每一个variable node的col_weight个相邻factor nodes

*在此paper中,col_weight固定,因此可以这样编程,但是如果col_weight不固定,需要再进一步考虑

----
有的时候,通过gen_phi产生的phi,从而产生的A,并不是每一次都能够得到constant col_weight的A,有时候会出错,有待研究

!2011-3-13
''BP-SBL algorithm''
(My Simulation .. 2011-3-1 BP-SBL .. CS_example.m)

# N:M:K =  200:100:1 (N:M=2:1 N:K=200:1)
## N=2000 M=1000 K=10 => The performance is quite good
## N=20000 M=10000 K=100 => The performance is quite good
# N:M:K = 200:20:1 (N:M = 10:1, N:K=200:1)
## N=2000 M=200 K=10 => rather bad, even cannot locate spikes
## N=10000 M=1000 K=500 => rather bad
# N:M:K = 200:40:1 (N:M=5:1 N:K=200:1)
## N=2000 M=400 K=10 => can locate spikes, but the amplitude is not so exact
# N:M:K = 200:50:1 (N:M=4:1 N:K=200:1)
## N=2000 M=500 K=10 => can locate spikes, but the amplitude is not so exact
# N:M:K = 600:200:3 (N:M=3:1 N:K=200:1)
## N=6000 M=2000 K=30 => can locate spikes, but the amplitude is not so exact, better than N:M=4:1
* Compare this group of results, along with the decreasing of N:M, that is from 10:1 to 2:1 the result improves gradually
* Thus we can guess the performance would become better and better with the decrease of N:M
 
# N:M:K = 100:20:1 (N:M=5:1 N:K=100:1)
## N=10^4 M=2*10^3 K=100  => can locate spikes, but the amplitude is not so exact
## N=10*3 M=200 K=10 => can locate spikes, but the amplitude is not so exact
# N:M:K = 100:50:1 (N:M=2:1 N:K=100:1)
## N=10^3 M=5*10^2 K=10  => The performance is quite good
# N:M:K = 200:50:1 (N:M=4:1 N:K=100:1)
## N=2000 M=500 K=10  => can locate spikes, but the amplitude is not so exact
* This group of results enhance our assumption, that is the performance is proportional with N:M
* Another assumption is, N:K越大,N:M的最优边界比值越小 (由下一组实验看出,基本上没有太大影响,N:M=2:1应该是一个极限)

# N:M:K = 50:10:1 (N:M=5:1 N:K=50:1)
## N=2000 M=400 K=40 => quite bad
# N:M:K = 500:125:10 (N:M=4:1 N:K=50:1)
## N=5000 M=1250 K=100 => can locate spikes, but the amplitude is not so exact ..

{{{
The question is: 
1. in the paper, the author use N:M=5:1 and get rather good result, however we cannot, why
2. the simulation cannot stand with N=2*10^4 M=5*10*3 (with zeros(M,N)), it would show OUT OF MEMORY. 
However, the code from Rice Univ. (CSBP, NBP) suffers the same problem.
}}}

总结一下:
# M越大,性能越好(即N:M越小,性能越好),基本在N:M=2:1时,性能最佳,若再大,会逐渐出现“可以定位spike,但幅度不对”,甚至无法定位spike的问题出现
!2011-4-27
毕业论文架构问题:
# 论文的题目是“基于置信传播的贝叶斯压缩感知的算法研究和实现”
## 说的是贝叶斯压缩感知使用BP的算法研究
## 是不是要单独介绍CS-BP和BP-SBL两个算法的比较?
## 以及比较BCS中RVM CS-BP BP-SBL三种现有译码方法?
# 创新点是将BP-SBL应用在DCVS框架中,从而产生了SI-BP-SBL算法
## DCVS框架算是文章的创新点吗?是参考文献中提出的...
# 论文的前半段需要介绍SI-BP-SBL算法吗?还是只写对BP在BCS中的应用介绍,然后再提出应用场景DVC
## 如果是后者
### 是直接写应用场景框架DCVS还是先介绍DVC,然后说DVC和CS结合成为DCVS?
### 对改进的算法SI-BP-SBL在这里提出?会不会显得重要性很低?(感觉SI-BP-SBL的重点是DCVS框架...)

如何写Paper?
# 简介?
## 根据英文paper的Intro翻译?
## copy中文paper的简介?然后糅合?


-------------------------------
# 修改eta0的计算方法(不是除以M,而是length(measvec)
# 测试eta0 = 0的情况,即无噪的情况
## coastguard_qcif: eta0 = 0 MKP=0.9 => PSNR=32.06db
# 跑完所有的点,保存成.mat
# 不同算法间的比较
## 与GPSR算法比较
## OMP算法比较(问学姐要程序)
# 不同变换之间的比较
## DCT变换
## 小波变换
## 分析(小波和DCT哪个更适合视频)
# 论文架构(写在wiki里)
## ?是先说压缩感知,再说DVC;还是先说DVC再说压缩感知?

------------------
Fix bug in BP_SBL.m:
每次outer loop之前,对P进行处理,防止p^-1是Inf
{{{
p(p<eps) = eps;
}}}

!2011-4-26
"Computationally Efficient SBL via BP"
公式(11):文献[17]中没有这个平方
=>
去掉平方后,恢复图像的效果和之前有区别
观察恢复出来的系数,发现都是大系数- -没有小的...

恩 就是这个问题!!!!!

现在至少能恢复一些图像了...

是不是A的值要+1, -1,0,而不是0,1?

---------------------------
coastgurad_cutqcif
# threshold = 80; SNR = 20; col_weight = 3;
## Kp = 0.75 => PSNR = 19.7db
## Kp = 0.5 => PSNR = 19.23db
=> 正常,Kp越大,性能越好

# Kp = 0.75; SNR = 20; col_weight = 3;
## threshold = 80 => PSNR = 19.7db
## threshold = 40 => PSNR = 20.71db
## threshold = 30 => PSNR = 21.65db
## threshold = 20 => PSNR = 23.02db

# 不归一化; SNR = 20; Kp = 0.75 => PSNR = 28.00db
# (coastguard_qcif => 30.83db)
# 把matrix A从0,1变成0, 1, -1 (coastguard_qcif) => 
## SNR = 20 => 30.72db
## SNR=30 => 31.86db

-----------------------------------------------------
coastguard_qcif
Kp = 0.5; SNR = 30 => K_PSNR = [27.6172, 27.6781]
CSp = 0.25; SNR = 30 => CS_PSNR = [26.0909, 26.0773]
CSp = 0.5; SNR = 30 => CS_PSNR = [28.3529, 28.2566] (无SI时=> [27.8330, 27.8016])



-----------------------------------------------------
有SI的模型变化为
X|P ~ N(SI, P)
或者,根据SI来定P:
大=>sigma_1 小=>simga_0

P0 = |Xn|^2
所以有SI就是P0 = |SI|^2

!2011-4-25
是不是BP-SBL要求信号是strictly sparse的,而不能approximately sparse?

通过SBL来估计Q,而不是P
然后证明message依然是高斯分布


!2011-4-24
channel coding中的BP:
初始时,var nodes通过接受到的codeword来初始化,而check nodes没有外部信息

CS中的BP:
var nodes没有先验信息,但是check nodes有鲜艳信息

SI-BP:
var nodes和check nodes都有先验性信息
------------------------------

CS-BP中通过sigma1, sigma0, K来得到x的先验分布
BP-SBL中通过将BP用于tow-layer Bayesian model in [17],从而来Infer x的后验概率?,并且使用EM算法来update贝叶斯模型中的Hyepr param。
这样,就不需要sigma0, sigma1和K来得到x的先验分布了

在这种情况下,又可以证明message都是高斯分布的,从而只需要传递mean和var即可
--------------------------------
BP-SBL是
# 通过SBL来得到p,从而得到x|p的分布,即一个高斯分布N(0, P)
# 通过SBL来得到eta,即噪声e的方差,从而得到y|x的分布N(Ax, eta*I)
如果使用SI-BP
# x|p的分布直接使用SI来代替,成为N(SI, P)
## 这样是否会影响到EM计算P的相关内容
# y|x的分布不变
# 或者是通过在factor graph中加一个SI节点,每次迭代加入SI节点的消息
## 需要证明加入SI节点的消息后,消息是否满足高斯
## SI节点消息的方差如何选择?

-------------------------------
只是把x|p的均值从0变到SI
# 使用BP-SBL来恢复一帧数据,看效果
# 加入SI,看效果

--------------------------------
仿真结果 bp-sbl恢复图像
# 暂时知道的会影响结果的几个参数
## sigma_Z -> eta
## threshold -> K
## col_weight -> phi -> A
## Kp -> row_weight -> A
# 有噪的情况
## col_weight = 3时,效果非常不好
## 考虑是因为col_weight太小的原因
## col_weight = 20时,使用re-generating option会使得attemp次数太多
## col_weight = 10时,能够通过多次尝试得到phi,并且在同样的sigma_Z下,psnr会比col_weight=3时好8db左右
# 无噪的情况
## col_weight = 10时,PSNR也是有18.45db,效果不好
# 改变threshold,使得K/N的比例变小,即更加稀疏
## threshold = 15 -> K = 40+ 和 threshold = 40 -> K = 20+ 的结果是一样的>.<

--------------------------------
感觉是因为信号的模型不对,不能用高斯分布来表示一个稀疏信号

BP-SBL的信号模型x不是一个Fix的prior,而是通过EM计算出来的参数来得到的参数化的prior
这个Prior依然是一个高斯分布(相互独立的M个高斯分布?)

如果要将信号模型改成mix Gaussian
# 增加一个hyper parameter:q,来增强参数化的prior
# 即依然使用EM来估计Prior,但是传入一个参数q

需要注意,是否依然能够保持message都是高斯分布

!2011-4-23
将BP_SBL算法加入Side Information进行译码

研究思路:
# SI_BP算法是如何做的?
# 如何将SI应用到BP_SBL上?
# 如何获取SI?
# 应用到视频上
# 使用非规则矩阵测试SI_BP_SBL?

!2011-4-21
LDPC的密度演进中高斯近似说的是,当AWGN信道时,初始消息符合高斯分布,从而使得变量节点和校验节点处得消息(LLR)也是高斯分布的。
并且,即使输入不是高斯分布,按照中心极限定理,变量节点和校验节点的消息(LLR)也是高斯分布。
问题是,到底是变量节点i的消息(pdf)是一个高斯分布,还是所有的变量节点的值分布是高斯分布????

简化模型:
# 考虑原信号x是二进制信源,编码得到的measv经过AWGN,符合高斯分布
## 问题是...不理解LDPC和CS的区别和联系 => ask 学姐

现在要考虑,用什么作为门限值,来进行差分优化?

''创新点''
Recently, Donoho, Maleki and Montanari [35], [34] proposed an approximate message passing (AMP) algorithm for compressed sensing with dense Gaussian measurement matrices. For this algorithm, they introduced a variant of DE (known as state evolution) that provides a precise characterization of its performance.
是否可以用于WSN的sparse detection?

!2011-4-20
对于同样的信号,随机生成的度分布得到的矩阵A对恢复结果影响很大...很多时候甚至没有规则矩阵的效果好。
查阅论文,看什么样的矩阵会使得性能更优。

# Matrix A must be sparse (row/column vector be sparse)
# 文章说,we can design A with unequal column weights and unequal row weights by using density evolution

TODO:
# 研究高斯近似和BP-SBL之间的关系(相同和不同),看是否有联系 => 是否计算错误概率
# 研究为什么随机生成的非规则矩阵恢复效果不好
## 什么样的非规则矩阵才能恢复
### increase degrees of var nodes
### decrease degrees of check nodes/factor nodes
### 文章说,we could design an optimal degree distribution according to some performance metric by density evolution
### 所以,''需要知道一个performance metric'',根绝这个metric来使用density evolution从而得到最优的度分布


新想法:
# 简化irregular LDPC matrix
## 变量节点的度非均匀,校验节点的度均匀
## 变量节点的度不一定全部随机,可以规定几个可选度,如,一半的变量节点度是3,另一半是5

!2011-4-19
新想法:
# 如果不用差分优化 是否有其他简单一点的方法得到度分布?
# 不优化度分布,只是找到一个介于规则与非规则之间的度分布,来生成矩阵?

成果:
# 2011-4-19 基于差分进化的非规则LDPC码分布对优化.pdf 作为参考文献
# 差分优化要计算错误概率,在LDPC中,如果使用高斯近似,可以使用均值代替密度演进,恰好的是BP-SBL也是使用类似高斯近似的思想,使得传递的消息只要是均值就可以了,如果是这样的话,计算错误概率即计算一个高斯分布的积分即可。
# 现在有一个问题,书上写要计算变量消息均值,我不太清楚如何计算。
## 按照书上的式子,mv = lambda(2) * m(v,2) + lambda(3) * m(v, 3) + ... + lambda(dv) * m(v, dv)
## m(v, i)是度数为i的变量节点输出消息的均值
## mv是变量消息的均值
## 我不太能够理解度为i的变量节点输出消息的均值。根据我的理解,会有多个度为i的变量节点,每个变量节点都有输出消息,以及其均值。但是所有度为i的变量节点的输出消息的均值并不一样,如何能够得到所有度为i的变量节点输出消息的均值?
## 由于我现在能够得到变量节点输出的消息,所以我总觉得能够直接计算到变量消息的均值,而不用纠结在计算出每个度为i的变量节点输出消息的均值m(v, i),但是暂时不知到如何计算。
## 暂时计算变量消息均值的方法是:所有变量节点输出的消息之和除以总边数- -


!2011-4-18
Finding Generator and Parity-Check Matrices


To find a parity-check and generator matrix for a Hamming code with codeword length 2^m-1, use the hammgen function as below. m must be at least three.
[parmat,genmat] = hammgen(m); % Hamming



To find a parity-check and generator matrix for a cyclic code, use the cyclgen function. You must provide the codeword length and a valid generator polynomial. You can use the cyclpoly function to produce one possible generator polynomial after you provide the codeword length and message length. For example,
[parmat,genmat] = cyclgen(7,cyclpoly(7,4)); % Cyclic

----------------------------------------
# 要求生成随机的数都能被M整除
## 看ref paper似乎没有考虑,暂时也不考虑
# l_max不同,得到的结果也不同,可以探讨
# r_max不同,得到的结果也应该不同,但是较l_max来说应该影响更小,暂时固定

# 计算lambda(l_max)
## (1-beta) / 2 = R / 2 = (N - M) / (N  * 2)
## sum(rho(i) . * (1 / i - 0,5)); rho(r_max) = rho, rho(r_max - 1) = 1 - rho; rho(others) = 0; => =rho * (1/r_max - 0.5) + (1 - rho) * (1/(r_max-1) - 0,5)
## beta * sum(lambda(i) * (1/i - 0.5) = ...
## ....

!2011-4-17
L = l_max - 3
考虑校验节点的度平均分布,仅变量节点度随机分布

问题:
# 如何随机选取lambda_3 ~ lambda_lm-1 ?
## 先选取一个0-1之间的随机数sum_temp,然后再在0-1之间随机选取L个数字,然后归一化到sum_temp
## 然后就可以得到度分布
## 这样做的问题是,不能保证每一个变量节点的度是一个整数,如,lambda_i = 0.034,而M = 100,那么变量节点i的度0,034 * 100 = 3.4
## 这样,是否可以就是四舍五入制的,然后再修正度分布,从而进行下一步差分进化?
# 或者,生成度分布的时候直接生成整数,而不是度的比例lambda
## 即在1~M中随机选L个数字,然后换算城lambda,再得到剩下的lambda即可

* 分析错了!!见2011-4-18
!2011-5-30
# 想研究一下GPSR的各个参数
# 毕业论文:致谢,封面
# 进度卡等

!2011-5-9 毕设
把GPSR的程序跑一遍 看下效果

!2011-5-4 毕业论文问题
# 在1.1研究背景及意义部分,是否提出BCS?
!2011-6-1
毕业论文
# 如果要加,可以在第二章加SI-BP-SBL算法,然后提出运用SI的方法是使用函数F(SI)
# 仿真图错了- -... Ravg的计算方法有误!!
# Check Service Status
## Computer->Manage->Service->Print Spooler
# 无法加载acrobat PDFmaker服务器: refer to http://blog.csdn.net/zhaozhi406/archive/2009/12/25/5077610.aspx
## 在注册表的HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curr entVersion\App Paths这个位置,新建一项“AcroDist.exe”,不知道大小写有没有关系;
## 在新建的那项里面再建一个字符串值
## 在默认值那里填入“acrodist.exe”的安装位置
## 在新建的那个字符串值那里填入“acrodist.exe”的安装目录,路径最后一定要加一个“\”。
## [img[http://p.blog.csdn.net/images/p_blog_csdn_net/zhaozhi406/EntryImages/20091225/reg.PNG]]
# PDF无法找到Adobe PDF打印机驱动程序: refer to http://www.360doc.com/content/11/0423/21/358017_111836339.shtml
## 控制面板->打印机->添加打印机->添加本地打印机
## 创建新端口->Local Port->命名为Adobe PDF
## 安装驱动程序->从磁盘安装->选择目录:.../Adobe/Acrobat 8.0/Acrobat/Xtras/AdobePDF/AdboePDF.inf
## 打印机名称,重命名为Adobe PDF(否则OFFICE无法用)
## 不共享
# 无效的“Adobe PDF"打印机属性:不要更改后台打印设置。
## 控制面板->打印机->Adobe PDF->右键:打印机属性
## 高级->直接打印到打印机
# compressive sensing: sampling rate can be lower than Nyquist rate (__''[[Shannon Theorem|Nyquist Sampling Theorem]]''__)
#* For some signals, such as images that are not naturally bandlimited, the sampling rate is not dictated by the Shannon theorem, but by the desired __temporal or spatial resolution__. However, it is common in such systems to use an [[antialiasing low-pass filter]] to bandlimit the signal before sampling, and so the Shannon theorem plays an implicit role. 
#*  ([[resolution v.s. pixel]]) [[Nyquist Sampling Theorem]]
#* Despite images having these problems in relation to the sampling theorem, the theorem can be used to describe the basics of down and up sampling of images.
# signals -> samples; image -> measurements
# sparsity & incoherent 
#* Sparsity: __CT sig.__ -> bandwidth >> __information rate__; __DT sig.__ -> length >> __degree of freedom__
#* Incoherent: sparse representation in psi -- spread out in the domain in which they are acquire. E.g.: Dirac or spike in time domain -- spread out in freq. domain.
# Sampling protocol: non-adaptive, require __correlating  the signal with a small number of fixed waveform__ that are incoherent with the sparsity basis
# CS is a very simple and efficient signal acquisition protocol
## samples at low rate
## use computational power for reconstruction from what appears to be an incomplete set of measurements
!!!! The Sensing Problem
# y~~k~~=<f, phi~~k~~> (phi~~k~~ sensing waveforms>
## If the sensing wavefroms are __Dirac delta functions (spikes)__ ==> y is a vector of __sample values__ of f __in the time or space domain__
## __indicator function of pixels__ ==> __image data__ typically collected by sensors in a digital camera
## __sinusoids__ ==> __Fourier coeff.__
# ''We restrict our attention to discrete signals f∈R^^n^^.''
# Shannon theory: if f(t) is actually has very low band-width, then a small number of (uniform) samples will suffice for recovery. 
#*A signal whose band-width is B, meaning that the highest freq. component is B, thus the sampling freq. is 2B. With time duration T, which means __''in frequency domain its duration is 1/T''__, from freq. domain, the number of samples will be 2B / 1/T, while in time domain, it will be T / 1/2B. Then we apply a DFT to the discrete signal with N= 2B*T samples. The Nyquist Sampling theory is used only to determine the sampling freq. 2B. That is to say, we can also sample it at rate f~~s~~ lower or higher than 2B, the diifference is we cannot or can reconstructed the signal from a LPF (we will have T*f~~s~~ samples, if the sample is less than 2B*T, the signal cannot be perfectly reconvered)
!!!!Incoherence and The Sensing of Sparse Signals
# Sparsity
## f(t) = ∑x~~i~~psi~~i~~(t), can be expressed as psi*x
## S-sparse
## psi is orthonormal basis =>  ||f-f~~S~~||~~l2~~ =  ||x-x~~S~~||~~l2~~ 
##  if x is ''__sparse__'' or ''__compressible__'' in the sense that __the sorted magnitudes of the (x~~i~~) decay quickly__, then x is well approximated by x~~S~~ and, therefore, the error ||f-f~~S~~||~~l2~~ is small.
# Incoherent sampling
## ''__coherence__'': the largest correlation between any two elements of phi and psi, mu(phi, psi)∈[1, sqrt(n)]
##* spike basis: phi~~k~~(t) = δ(t-k) and Fourier basis: psi~~j~~(t)=n^^-1/2^^e^^i*2pi*jt/^^ => mu(phi, psi) = 1 maximal incoherence, in any dimension(one dimension, two dimensions, three dimensions, etc)
##* [[noiselets]] phi and wavelet basis psi. The coherence between noiselets and  Haar wavelets is sqrt(2), that between noiselets and Daubecies D4 and D8 wavelets is, respectively about 2.2 and 2.9 across a wide range of sample sizes n. This extends to higher dimensions as well.
#* [[noiselets]] are __maximally incoherent__ with spikes and __incoherent__ with Fourier basis.
## using noislets
### __incoherent with__ systems provideing __sparse representations__ of image data and other type of data
### very fast alg.; noiselets transform runs in O(n) time; do not need to be stored to be applied to a vector(@@??like FT??@@)
## ''__random matrices__'' are largely incoherent with any fixed basis psi.
!!!!Undersampling and Sparse Signal Recovery
# Ideally, n coeff. in f. But we only get a subset of these and collect the data. m < n
# l~~1~~-norm minimization
# greedy alg.
# f is sufficiently sparse => recovery via l~~1~~-minimization is provably exact
## m >= C*mu^^2^^(phi, psi)*S*log//n//
## prob. of success 1-δ  if m>= C*mu^^2^^(phi, psi)*S*log//(n/δ)//
##* coherent: smaller the coherent mu, the fewer samples are needed
##* no info. loss
##* exactly reconvered, minmizing a convex functional
## acquisition protocol: sample nonadaptively in an incoherent domain and invoke linear programming after the acquisition step.
# There is de facto a known four-to-one practical rule which says tha for exact recovery, one needs about four incoherent samplers per unknown nonzero term.
!!!!Robust Compressive Sampling
nearly sparse signal & signal with noise: y=Ax+z, A is m*n "sensing matrix", A=R*phi*psi
* f= psi*x (f: signal, psi: orth. basis, x: coeff.)
* y = R*phi*f (in fact it is just a m*n phi; phi is n*n, R is m*n to extracting phi from n to m)
# ''__Restrictd Isometries (RIP)__''
## isometry constant δ~~S~~ of a matrix A: smallest number such that: (1-δ~~S~~)||x||~~l2~~^^2^^ <= ||Ax||~~l2~~^^2^^ <= (1+δ~~S~~)||x||~~l2~~^^2^^ holds for all S-sparse vectors x
## loosely obeys the RIP of order S: δ~~S~~ is not too close to one
##* => //A// approximately preserves the Euclidean length of S-sparse signals
##* => S-sparse vectors cannot be in the null space of A.
## all __subsets__ of S columns taken from A are infact __nearly__ orthogonal
##* use subsets and nearly caz columns of A cannot be exactly orthogonal with more columns than rows
# General signal recovery from undersampled data
## min-l~~1~~-norm 
## Theorem 2. δ~~2S~~: isometry constant
## Stronger: (theorem 1 requires S-sparse signal)
### If x is S-sparse, the recovery is exact
### If x is not S-sparse, (but the isometry constant δ~~2S~~ < sqrt(2) - 1), the quality of the recovered signal as good as if one knew ahead of time the location of the S largest values of x and decided to measure those directly (say, x = [1 0 0 1], if we know the non-zero locations 1,4, we measure the two location directly, we can recover the signal with [x1' 0 0 x2']. We could get similar performance by CS and reconstruction with min l1 norm)
## no probability (theorem 1 is depend on a rather small probability)
##* find a sensing matrix obeying the hypothesis of the theorem, we are ''guaranteed'' to recover all sparse S-vectors exactly, without prob. of failure.
## relationship between S(the number of components one can effectively recover) and m(number of measurements). see [Random Sensing]
# Robust Signal recovery from noisy data
## noisy data, l~~1~~ minimization with __relaxed constraints__ for reconstruction ||Ax-y||~~l2~~<=epsilon
## LASSO
## Theorem 3: similar with theorem 2, except the term C~~1~~*epsilon
!!!!  Random Sensing
sensing matrix with RIP: column vectors taken from arbitrary subsets are nearly orthogonal; the larger the better
Form A by
# sampling n column vectors uniformly at random on the unit sphere of R^^m^^
# sampling i.i.d. entries from the normal distribution with mean 0 and variance 1/m
# sampling a random projection P as in "Incoherent Sampling and normalize: A=sqrt(n/m)*P
# sampling i.i.d. entries from a symmetric Bernoulli distribution (P(A~~i,j~~=±1/sqrt(m)) = 1/2) or other sub-gaussian distribution
* m >= C*Slog(n/S) where C is some constant depending on each instance
One can also establish the RIP for pairs of orthobases as in "Incoherence and the Sensing of Sparse Signals". 
# A=R*phi*psi, where R extracts m coordinates uniformly at random
# m >= C*S(logn)^^4^^
#* best known exponent is 5 instead of 4
RIP can also hod for __sensing__ matrices A=phi*psi, where psi is an arbitrary __orthobasis__ and phi is an m*n __measurement matrix__ drawn randomlly from a suitable distribution.
# the sparsity basis need not even be known when designing the measurement system (We need only design a sensing matrix phi satisfying RIP)
#* because when designing measurement system, we only design phi, do not design A. So we construct a phi satisfying RIP. Because it holds for A=phi*psi for arbitrary psi, A would satisfy RIP, which is our goal. (If RIP does not holds for A=phi*psi, we cannot guarantee A satisfying RIP if we use a phi satisfying RIP)
!!!! What is Compressive Sampling?
CS measurements protocols essentially translate ''__analog data__'' into ''__already compressed digital form__''.
# Applications
## data compression: distributed source coding in multi-signal settings such as sensor network
## channel coding
## inverse problems
## data acquisition
## A/I conversion
##* reweight the l~~1~~ norm
!!Configuration
[[Development Environment BUILD]]
[[Roges APN Settings(for Android Phones)]]
!!Basics
[[Debug an Android App]]
[[gen/R.java]]

!!Function&Class
[[Start an Activity from a Service]]
[[Intent]]

!!Demo
[[Android Demo]]
[[IBM android sensor demo]]

!!Turtorial&Study Log
[[Hello Android Log]]

!!Problem&Solution
[[Eclipse New Android Project: the system cannot find the file specified]]
[[New project, Build Path->Android : The currently displayed page contains invalid values]]
[[Caused by: java.lang.InstantiationException]]
[[Error: android.content.ActivityNotFoundException: Unable to find explicit activity class {class name}]]
[[Null Pointer Exception when set Adapter or Listener]]
[[adb shell: more than one device or emulator]]
[[WARNING: Application does not specify an API level requirement!]]
[[java.net.SocketException: Permission denied (maybe missing INTERNET permission)]]


!!Sony Ericsson X10
[[X10刷机:从国行1.6 刷到 港行2.1]]
[[X10 2.1后root]]
[[X10i 1.6 升级2.1港行失败(升成国行),再重新升级成港行2.1方法]]
[[X10 debug disable]]
[[X10 升级时按返回键无反应]]
[[X10 root 2.3.3]]
{{{
public class Sudoku extends Activity {
       @Override
       public void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                setContentView(R.layout.main);
      }
}
}}}
# R.layout.main is a resource identifiedr that refers to the main.xml file in the res/layout directory
!!! error.log: file does not exist favicon.­ico
solution:
1. create an icon using bmp format
2. rename it as favicon.ico
3. mv it to the root directory of your website


!!!htaccess
To enabler .htaccess, edit the httpd.conf
>AllowOverride None -> AllowOverride All
{{{
#
# This should be changed to whatever you set DocumentRoot to.
#
#<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs">
<Directory "C:/www">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride All

    #
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all

</Directory>
}}}

!!!Environment Configuration: Apache2.2 + PHP5.3.3 under Windows
昨天给自己配了一下PHP的环境,弄了有一会。
网上的教程也看了,还是自己写一下,以后可以参考,呵呵。
 
首先要注意的是这个教程有几个前提要求:
1. Windows; Linux下的我没配过,所以不是很清楚。
2. Apache2.2;版本比较重要,不同的版本也有可能是不一样的配法~所以,如果是要配置其他版本的话,请换关键字搜索
3.PHP5.3.3; 同样是版本的问题
 
好了,现在开始配置吧。
1. 首先,先要下Apache2.2。我下的是httpd-2.2.16-win32-x86-no_ssl.msi,安装到C:\Program Files里了
2. 然后,把PHP5.3.3也下下来,注意,要下php-5.3.3-Win32-VC6-x86.zip这个文件,不要有nts,也不要是VC9什么的。我一开始就下错了,然后缺文件之类的- -。
这个就直接解压缩就好了,放在C:\php目录下。(这个目录底下应该就直接是文件了,不是解压得到的文件夹哦)。
 
3. 装好Apache之后,可以打开Apache服务,然后访问localhost一下,看看是不是装好了。基本上这步不会出问题的。
4. 配置PHP。
关键步骤~(我引用了http://www.blogjava.net/zyw090111/archive/2010/08/07/328197.html里面的方法),不过有一些注释的地方是我做错的点。
1) 配置PHP5.3.3,打开php安装目录(C:\php)可以看到目录下有两个这样的文件 php.ini-development和php.ini-production,第一个是开发使用的配置文件,第二个是标准的生产环境的配置。
2)选择php.ini-development复制一份到同目录下,并改名为php.ini使用文本工具打开,查找extension_dir,可以看到两个,选择On windows:
下面的那个并去得前面的分号修改为extension_dir = "C:/php/ext",读者根据自己的目录结构配置,目的是找到和php.ini同目录下的ext文件夹中的扩展库。
*这里一定要注意的是,不要只改了目录,而没有把分号去掉- -分号没去掉这句话是不起作用的。
检测方法是,写一个index.php文件
<? phpinfo()?>放在Apache的访问的文件夹下(可以查看Apache22/conf/httpd.conf,搜索DocumentRoot),默认是Apache22/htdoc这个文件夹。然后访问localhost/index.php,可以看到
#log: /var/log/apache2
#www: /var/www/html
!!!!Why Read? 
想要找到LDPC使用BP算法,应用density evolution,如何得到一个阈值?MMSE Or others?  
!!!!Abstract: 
estimation: high-dimensional vector signal observation: sparse linear transformation of the signal + additive Gaussian noise 
即从一个observation估计estimation 
实例:CDMA信道 + sparse spreading mtx  BP可以达到MMSE  

!!!!Referred by “Estimation with Random Linear Mixing, Belief Propagation and Compressed Sensing" 
# present a result: the mean-squared optimality of BP could be achieved by a significantly simpler algorithm (relaxed BP)
# 应用standard BP的一个困难在于在变换矩阵上计算density的复杂度太高。
## Relaxed BP将message近似为高斯分布,从而降低了复杂度。 
## 即高斯近似。 
# 只考虑了AWGN output channels   

.... 
{{{
tail -f error.log
}}}
{{{
@cd C:/Allen/git-workspace/tiddlywiki
@git add .
@git commit -m "auto check in"
@git push
@start %COMSPEC%
}}}
start %COMPSPEC% would allow the window hold
used in sensor arrays
*directional signal transmission or reception
combine elem. in the array
!!解读Gaussian Belief Propagation Resources/NBP中gen_phi.m函数
{{{
   for gg=1:r
      nperm=[nperm randperm(n)];
   end
}}}
这一段是在生成r*n个随机排列的元素,范围是1~n,这样就生成了1~n每个元素有r个的一组随机排列。

{{{
   for measlist=1:maxphirow
      ind1=1+(measlist-1)*l;
      ind2=ind1+l-1;
      indset=nperm(ind1:ind2);
}}}
ind1:ind2恰好是l个元素,即每行非零元素的index,共l个

{{{
      indset=unique(indset);
      if (length(indset) < l) % means there are same elements in indset, e.g. [2 1 1 2]
}}}
要判断是否可能indest中有重复的元素,如果有,要做特殊处理

{{{
         %% option 1: re-generating nperm
         if (0)
            done=0;
            break;
         end
}}}
第一种方法是直接放弃这次生成的nperm序列,重新生成nperm序列。源程序没有采用此方法(if (0))

{{{
         %% option 2: ...
         %if (0)
         while (length(indset) < l)
            ll=l-length(indset);
            bigset=setdiff((1:n), indset);
            scrambleind=randperm(n-length(indset));
            bigset=bigset(scrambleind);
            indsetappend=bigset(1:ll);
            indset=[indset indsetappend];
         end
         indset=sort(indset);
}}}
第二种方法,是迭代循环。
ll=l-length(indset); 得到indset中重复的源于共有几个
bigset=setdiff((1:n), indest); 得到indset中没有的元素(即可选的用于替换的元素)
scrambleind=randperm(n-length(indset)); 得到随机一个1:ll的随机排序,用于之后得到bigset的一组随机序列
bigset=bigset(scrambleind); 得到从indset中没有的元素集中取出1:ll个元素
indsetappend=bigset(1:ll);
indset=[indset indsetappend]; 将取出的元素补在indset之后

由此可以看出,得到的bigset是不可控的,也就是说,一个元素可能已经出现了r遍了,会重新再bigset中出现
导致实际产生的A的行重和列重并不是constant的



!!2011-3-5 (for 2011-2-28: “Computationally Efficient SBL via BP”)
实现了BP-SBL的主体算法
TODO:
# 如何获得矩阵A,用和CS-BP一样的方法?
# 如何获得输入信号x,从而实现仿真场景?

!!2011-3-6 (for 2011-2-28: “Computationally Efficient SBL via BP”)
''Construction of the matrix A''
generate the matrix A with constant row weight and column weight
dv (dv1 = dv2 = ... = dvn) = constant column weight
df (df1 = df2 = ... = dfn) = constant row weight
Ndv = Mdf 
*There are totally Ndv non zero entries in A
=>connect the sockets on variable node side to the sockets on factor node side by ''using a random permutation''
{{{
ind = randperm(Ndv);
ind = ceil(ind ./ df);
for ii = 1:N
// for each column of matrix A, that is each variable node
for jj = 1:dv
A(ind(jj + (ii - 1) * dv, ii) = 1;
end
A(ii, ind(ii)) = 1;
end
}}}
* BCS-BP algorithm use LDPC matrix as matrix A, with constant row weight? (TO CHECK)

''Encode''
One way to encode is immediately calculate A*x. But when the scale is large, it would be rather costly.
BCS_BP algorithms use its own way to calculate A*x. Refer to encoder,m in NBP in Gaussian Belief Propagation Resources pacakge.

''HOW TO SET PARAMETERS in CS_example.m in BP_SBL package''
# N, M, col_weight: M must can be divided by col_weight * N

''TODO''
# Fix the bug in generatA, how to eliminate short loop
# Fix the bug in encoder, how to generate phi, or write the function A_to_phi, then check whether measvec = A * x


!!2011-3-7
TODO:
# Check the Monte Carlo trials in sim1~4.m
# The result plot is not exactly the same with the paper
!!!Abstract & Intro
# Compressed spectrum sensing
## spectrum acquisition in the wideband scenario due to the limited sampling capacity; 
## collaborate amomg the secondary users
# most: assume all secondary users experience the same occpancy of parimary users X
## => propse a probabilistic graphical model
## BP

*Thing to note:
# BCS non-informative parameter to ?
# Distributed compressed spectrum sensing
# MRF

!!!Compressed Spectrum  Sensing Model
* The model uses BCS with RVM to reconstruct each sparse spectrum signal wk
* The model need fused prior information, which is obtained through Belief Propagation, which is introduced in Section IV.

!!!Prior Information fusion via belief propagation
* Sparse spectrum signals wk have relationship with each other => Model as MRF => use BP to calculate the fused prior information

!!!Ideas
# Model for estimate prior information. Maybe used to estimate the relationship between each wavelet-tree coefficient in different sub-band.
If we know the position of the spike, can we better reconstruct the signal?
* Eg. Image=>DCT=>largest elements would concentrate on the first M value, so whether we can reconstruct the image better by knowing this?
See paper “Practical Signal Recovery from Random Projections'', it mentions how to take into account the position information as a constrain in the optimization problem.
/***
|Name|BetterTimelineMacro|
|Created by|SaqImtiaz|
|Location|http://tw.lewcid.org/#BetterTimelineMacro|
|Version|0.5 beta|
|Requires|~TW2.x|

//This version slightly modified by @cdent to support tag handling better.//

!!!Description:
A replacement for the core timeline macro that offers more features:
*list tiddlers with only specfic tag
*exclude tiddlers with a particular tag
*limit entries to any number of days, for example one week
*specify a start date for the timeline, only tiddlers after that date will be listed.

!!!Installation:
Copy the contents of this tiddler to your TW, tag with systemConfig, save and reload your TW.
Edit the ViewTemplate to add the fullscreen command to the toolbar.

!!!Syntax:
{{{<<timeline better:true>>}}}
''the param better:true enables the advanced features, without it you will get the old timeline behaviour.''

additonal params:
(use only the ones you want)
{{{<<timeline better:true  onlyTag:Tag1 excludeTag:Tag2 sortBy:modified/created firstDay:YYYYMMDD maxDays:7 maxEntries:30>>}}}

''explanation of syntax:''
onlyTag: only tiddlers with this tag will be listed. Default is to list all tiddlers.
excludeTag: tiddlers with this tag will not be listed.
sortBy: sort tiddlers by date modified or date created. Possible values are modified or created.
firstDay: useful for starting timeline from a specific date. Example: 20060701 for 1st of July, 2006
maxDays: limits timeline to include only tiddlers from the specified number of days. If you use a value of 7 for example, only tiddlers from the last 7 days will be listed.
maxEntries: limit the total number of entries in the timeline.


!!!History:
*28-07-06: ver 0.5 beta, first release

!!!Code
***/
//{{{
// Return the tiddlers as a sorted array
TiddlyWiki.prototype.getTiddlers = function(field,excludeTag,includeTag)
{
          var results = [];
          this.forEachTiddler(function(title,tiddler)
          {
          if(excludeTag == undefined || !tiddler.tags.contains(excludeTag))
                        if(includeTag == undefined || tiddler.tags.contains(includeTag))
                                      results.push(tiddler);
          });
          if(field)
                   results.sort(function (a,b) {if(a[field] == b[field]) return(0); else return (a[field] < b[field]) ? -1 : +1; });
          return results;
}



//this function by Udo
function getParam(params, name, defaultValue)
{
          if (!params)
          return defaultValue;
          var p = params[0][name];
          return p ? p[0] : defaultValue;
}

window.old_timeline_handler= config.macros.timeline.handler;
config.macros.timeline.handler = function(place,macroName,params,wikifier,paramString,tiddler)
{
          var args = paramString.parseParams("list",null,true);
          var betterMode = getParam(args, "better", "false");
          if (betterMode == 'true')
          {
          var sortBy = getParam(args,"sortBy","modified");
          var excludeTag = getParam(args,"excludeTag",undefined);
          var includeTag = getParam(args,"onlyTag",undefined);
          var tiddlers = store.getTiddlers(sortBy,excludeTag,includeTag);
          var firstDayParam = getParam(args,"firstDay",undefined);
          var firstDay = (firstDayParam!=undefined)? firstDayParam: "00010101";
          var lastDay = "";
          var field= sortBy;
          var maxDaysParam = getParam(args,"maxDays",undefined);
          var maxDays = (maxDaysParam!=undefined)? maxDaysParam*24*60*60*1000: (new Date()).getTime() ;
          var maxEntries = getParam(args,"maxEntries",undefined);
          var last = (maxEntries!=undefined) ? tiddlers.length-Math.min(tiddlers.length,parseInt(maxEntries)) : 0;
          for(var t=tiddlers.length-1; t>=last; t--)
                  {
                  var tiddler = tiddlers[t];
                  var theDay = tiddler[field].convertToLocalYYYYMMDDHHMM().substr(0,8);
                  if ((theDay>=firstDay)&& (tiddler[field].getTime()> (new Date()).getTime() - maxDays))
                     {
                     if(theDay != lastDay)
                               {
                               var theDateList = document.createElement("ul");
                               place.appendChild(theDateList);
                               createTiddlyElement(theDateList,"li",null,"listTitle",tiddler[field].formatString(this.dateFormat));
                               lastDay = theDay;
                               }
                  var theDateListItem = createTiddlyElement(theDateList,"li",null,"listLink",null);
                  theDateListItem.appendChild(createTiddlyLink(place,tiddler.title,true));
                  }
                  }
          }

          else
              {
              window.old_timeline_handler.apply(this,arguments);
              }
}
//}}}
!!Part I
!!!!! What to Review When
* a "Project" list
* a calendar
* "Next Action" lists
* a "Waiting For" list
# Calendar: most frequently review
# "Next Action" lists: after checking calendar
## orgnized by context("Home" "Computer" "Meeting with George")
# "Projects", "Waiting For" and "Someday/Maybe" lists need to be reviewed only as often as you think they have to be in order to stop you from wondering about them

Weekly Review
* Gather and process all your "stuff
* Review your system
* Update your lists
* Get clean, clear. current, and complete

!!!!!The Six-Level Model for Reviewing Your Own Work
* 50,000+ feet: Life
* 40,000 feet: Three-to-five-year vision
* 30,000 feet: One-to-two-year goals
* 20,000 feet: Areas of responsibility
* 10,000 feet: Current project
* Runway: Current actions

!!!Chapter 3 Getting Project Creatively Under Way: The Five Phases of Project Planning
#The Natural Planning Model
## Defining purpose and principles
## Outcome visioning
## Branstorming
## Organizing
## Identifying next actions
#The Unnatural Planning Model
#The Reactive Planning Model
!!!! Natural Planning Techniques: The Five Phases
# Purpose
# Principles
## as long as...
# Vision/Outcome
# Clarifying Outcomes
## View the project from beyond the completion date
## Envision "WILD SUCCESS"
## Capture features, aspects, qualities your imagine in place
# Brainstorming
#* mind-mapping
## Brainstorming Keys
### Don't judge, challenge, evaluate, or criticize
### Go for quantity, not quality
### Put analysis and organization in the background
# Organizing
#* Microsoft Project
#* GANTT-typechart
## The Basics of Organizing
### Identify the significant pieces
### Sort by (one or more):
###* components
###* sequences
###* priorities
### Detail to the required degree
# Next Actions
## Basics
### Decide on next actions for each of the current moving parts of the project
### Decide on next actions in the planning process, if necessary
# How Much Planning Do You Really Neet to Do?
## 80%, 15%, 5%
## Need More Clarity?
## Need More Actions?

!!Part 2: Practicing Stree-Free Productivity
!!! Chapter 4: Setting Up the Time, Space, and Tools
!!! Chapter 6: Processing: Getting "In" to Empty
After processing "in":
# trashed what you don't need
# completed any less-than-two-min. actions
# handed off to others anything that can be delegated
# sorted into your own organizing system reminders of actions that require more than two min.
# identified any larger commitments (projects) you now have, based on the input
!!! Chapter 7: Organizing: Setting Up the Right Buckets
The Basic Categories
# A "Project" list
# Project support material
# Calendared actions and information
# "Next Actions" lists
# A "Waiting For" list
# Reference material
# A "Someday/Maybe" list
查找目录名称是否有问题,目录名称中有 "#" 字符,去掉有 CHM 文件就显示正常了。
!!!<form> do not change line
<code css>
<form style="margin:0px;display: inline">
</form>
</code>

!!!Hidden
<code css>
style="display:none"
</code>
!!!<form> do not change line
{{{
<form style="margin:0px;display: inline">
</form>
}}}

!!!Hidden
{{{
style="display:none"
}}}
|CT, non-periodic|Fourier Transform|C, non-periodic|00->00|
|CT, periodic|Fourier Series|D, non-periodic|01->10|
|DT, non-periodic|DT Fourier Transform|C, periodic|10->01|
|DT, periodic|DT Fourier Series|D, periodic|11->11|

|CTFT|continuous time -> continuous frequency|
|DFT|discrete time -> continuous frequency (periodic)|
|DTFT|discrete time -> discrete frequency (because digital system could only process __''finite length''__ __''discrete''__ signals => time and frequency discretize)|
|Fourier Series|continuous time => discrete frequency|

FS -> (CT)FT: FS/w~~0~~ with T->∞(freq. w~~0~~->0) = (CT)FT
This behaviour requires a plugin to be installed. Install SinglePageModePlugin from http://tiddlytools.com. See [[How do I install a plugin?]] for more info.
Yes, you can change the value of a single Firefox Preference, to allow Local HTML Files to be saved without having to answer the question ever again.  There are a couple of ways of doing this.

!!! Easier, but less Secure:
Type about:config in the Address Bar (Note the necessary Colon between the words "about" and "config"). Find the Preference called "security.fileuri.strict_origin_policy". Double click on it to toggle it to a value of false. Restart Firefox to try it out.
''Be aware that this does alter the built-in security of Firefox.''

!!! More advanced, but also more secure
Permissions and privileges may be set on a file-by-file basis using the FirefoxPrivilegesPlugin, maintained by Xavier Vergés.  Each individual HTML file can be granted certain privileges and access to your system.  In this way, a user does not give an arbitrary HTML file access to the write/read file operations which could result in system damage or provide a means for hackers to gain access to their system.  The plugin can be downloaded/installed from the [[FireFoxPrivileges TiddlySpot Site|http://firefoxprivileges.tiddlyspot.com/]].  It can also be used without installing via a bookmarklet at the same site.
Yes, you can.

Here's how to do it:
* Sign up for a new Tiddlyspot site at http://tiddlyspot.com/
* (Suppose you called it yoursiteid, accessible at http://yoursiteid.tiddlyspot.com)
* Now, open your existing TW (from your local hard disk)
* Go to backstage, click import, and use http://yoursiteid.tiddlyspot.com as the "URL or path name" to import from
* Check the checkboxes next to ~UploadPlugin, ~TspotSetupPlugin, ~PasswordOptionsPlugin, ~LoadRemoteFileThroughProxy
* Uncheck the 'keep linked' option
* Click import
* Save your existing local TW (DON'T FORGET THIS STEP)
* Reload your existing local TW (DON'T FORGET THIS STEP)
* Enter your Tiddlyspot password under the options>> slider
* Click 'upload' from the right sidebar
* Check that it worked by visiting http://yoursiteid.tiddlyspot.com/ and doing a shift+reload.
Thrown when an application tries to create an instance of a class using the newInstance method in class Class, 
but the specified class object cannot be instantiated <html><b>because it is an interface or is an abstract class. </b></html>
open the file via text editor.
search: 
{{{
txtUserName: "YourName"
}}}
replace "YourName"

search
{{{
config.options.chkSaveBackups = true
}}}
replace "true"
{{{
Before we get started, install the following on your system through synaptics:

* cpp-3.4
* g++-3.4
* gcc-3.4
* gcc-3.4-base

First, let us go to the right directory

> cd /usr/bin

Let us check the default gcc version

> gcc --v

It should say 3.3.5

Now let us delete the old symbolic links

> sudo rm cpp gcc g++

Now let us change the symbolic links to 3.4

> sudo ln -s g++-3.4 g++ 
> sudo ln -s gcc-3.4 gcc
> sudo ln -s cpp-3.4 cpp 

Now we will delete the other symbolic links (THIS IS ONLY FOR x86_64 VERSION)

> sudo rm x86_64-linux-gcc x86_64-linux-g++ x86_64-linux-cpp

Again, let us change the symbolic links to 3.4

> sudo ln -s cpp-3.4 x86_64-linux-cpp
> sudo ln -s gcc-3.4 x86_64-linux-gcc
> sudo ln -s g++-3.4 x86_64-linux-g++

If you run to check the default gcc version

> gcc --v

It should now read 3.4.3

Hope this helps. If somebody could identify the x86 version of these symbolink links this would be great too.

x86_64-linux-gcc 
x86_64-linux-g++ 
x86_64-linux-cpp
}}}
*search DefaultTiddlers in the html file
*replace the Tiddler with your welcome tiddler
If the host ip changed,  your local git repos config shouldbe modified.
1. edit .git/config, 
{{{
[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@xxx.xxx.xxx.xxx
}}}
change the url
2. edit .ssh/config and know_hosts
change the ip or url
!!4-1 Multivariate prob. dist.

!!4-3 Functions of Multiple R.V.s
!!! B. $n$ Functions of $n$ R.V.s
\[{\bf z_1} = g_1({\bf x_1, x_2, ..., x_n})\]
\[{\bf z_2} = g_2({\bf x_1, x_2, ..., x_n})\]
\[{\bf z_n} = g_n({\bf x_1, x_2, ..., x_n})\]
*These funciton must be __algebraically independent__; that is, there must exist ''no'' function $H({
\bf z_1, z_2, ..., z_n})$ of the ${\bf z}$'s that is identically zero.
** This it to make the Jacobian not equal to zero!
!!!!the transformation is one-to-one
$$
\begin{align}
f_{\bf z}(z_1, z_2, ..., z_n) &= \left|\,J\left(\matrix{x_1 & x_2 & \ldots & x_n\cr
z_1 & z_2 & \ldots & z_n\cr}\right)\right| f_{\bf x}(x_1, x_2, ..., x_n) \\
&= \frac{f_{\bf x}(x_1, x_2, ..., x_n)}{\left|\,J\left(\matrix{z_1 & z_2 & \ldots & z_n\cr
x_1 & x_2 & \ldots & x_n\cr}\right)\right|}
\end{align}
$$
*If the Jacobian $\left|\,J\left(\matrix{z_1 & z_2 & \ldots & z_n\cr
x_1 & x_2 & \ldots & x_n\cr}\right)\right|$ is identically zero, the functions $g_1, g_2, ..., g_n$ are not __algebraically independent__ as required.
# Ex4.9
## ${\bf z_k} = \sum^n_{j=1}a_kj{\bf x_j}$
# Ex4.10
# Ex4.11

!!4-4 Expected Values
!!! A. Means, Variances, and Covariances
* ''__Expected Value__''
$$
\begin{align}
E[g({\bf x_1, x_2, ..., x_n})] &= \overline{g(x_1, x_2, ..., x_n)}  \\
&= E({\bf z}) = \int_{-\infty}^{\infty}zf{\bf z}(z)dz \\
&= \int_{-\infty}^{\infty}\ldots\int_{-\infty}^{\infty}g(x_1, x_2, ..., x_n) \times f_{\bf x}(x_1, x_2, \ldots, x_n)dx_1dx_2{\cdots}dx_n
\end{align}
$$
** if the R.V.s are discrete, ...
*mean  of one of the R.V.s, say ${\bf x_k}$
$$
\begin{align}
\overline{{\bf x_k}} &= E({\bf x_k}) = \int_{-\infty}^{\infty}\cdots\int_{-\infty}^{\infty}x_kf_{\bf x}(x_1, x_2, \ldots, x_n)dx_1d_x2{\cdots}dx_n \\
&= \int_{-\infty}^{\infty}x_kf_{\bf x_k}(x_k)dx_k
\end{align}
$$
* sum of $n$ r.v.s
\[E({\bf x_1 + x_2 + \cdots + x_n}) = E({\bf x_1}) + E({\bf x_2}) + \cdots + E({\bf x_n})\]
* ''__Varaiance__'' (the same as one random variables)
* ''__Correlation__''
$$
\begin{align}
Cov({\bf x_k,x_m}) &= E({\bf x_kx_m}) - \overline{x_k}\overline{x_m} \\
&= E[({\bf x_k} - \overline{x_k})({\bf x_m} - \overline{x_m})] \\
E({\bf x_kx_m}) &= \int_{-\infty}^{\infty}x_kx_mf_{\bf x}(x_1, x_2, \ldots, x_n)dx_1dx_2{\ldots}dx_n \\
&=  \int_{-\infty}^{\infty} \int_{-\infty}^{\infty}x_kx_mf_{\bf x_kx_m}(x_k, x_m)dx_kdx_m
\end{align}
$$
*__//covariance matrix// c__
\[c_{ij} = Cov ({\bf x_i, x_j}),	1\leq(i,j)\leq{n}\]
$$c_{ii} = Var {\bf x_i},		1\leq{i}\leq{n}$$
** The convariance matrix is symmetrical: $c_{ij} = c_{ji}$
* sum of $n$ r.v.s
$$
{\bf z} = a_1{\bf x_1} + a_2{\bf x_2} + \cdots + a_n{\bf x_n} = \sum^n_{k=1}a_k{\bf x_k}
$$
$$
\begin{align}
Var  {\bf z} &= \sum^n_{k=1}\sum^n_{m=1}a_ka_mE[({\bf x_k} - \overline{x_k})({\bf x_m} - \overline{x_m})] \\
&= \sum^n_{k=1}\sum^n_{m=1}a_ka_{km}a_m = {\bf a^Tca}
\end{align}
$$
** If the n r.v.s ${\bf x_k}$ are uncorrelated.
$$ Cov ({\bf x_k, x_m}) = \cases{Var{\bf x_k},&k = m\cr 0,&k\neq{m}} $$
** Thus the covariance matrix ''c'' is diagonal, and 
$$ Var {\bf z} = \sum^n_"{k=1}a^2_kVar{\bf x_k}$$
** The variance of the sum of n uncorrelated r.v.s equals the sum of their variances
$$Var({\bf x_1 + x_2 + \cdots + x_n}) = Var {\bf x_1} + Var {\bf x_2} + \cdots + Var {\bf x_n} $$
$$Cov({\bf x_i, x_j)} \equiv 0, i\neq{j}$$
# Ex 4.12
## cov of ''x'' => var of ${\bf z} = 3{\bf x_1} - {\bf x_2} + 2{\bf x_3}$
## $Var {\bf z} = {\bf A^T}{\bf c}{\bf A}$
!!!B.Characteristic Functions
*Joint Characteristic Functions (Fourier transform of joint pdf)
$$
\begin{align}
{\bf \Phi_x}(\omega_1, \omega_2, \ldots, \omega_n) &= E\{exp[j(\omega_1{\bf x_1} + \omega_2{\bf x_2} + \ldots + \omega_n{\bf x_n})]\} \\
&= \int^{\infty}_{-\infty}\cdots\int^{\infty}_{-\infty}exp[j(\omega_1{\bf x_1} + \omega_2{\bf x_2} + \ldots + \omega_n{\bf x_n})]{\times}f_{\bf x}(x_1, x_2, \ldots, x_n)dx_1dx_2{\cdots}dx_n
\end{align}
$$
** joint density function can be recovered by the inverse FT
$$
f_{\bf x}(x_1, x_2, \ldots, x_n) = \int^{\infty}_{-\infty}\cdots\int^{\infty}_{-\infty}exp[-j(\omega_1{\bf x_1} + \omega_2{\bf x_2} + \ldots + \omega_n{\bf x_n})]{\times}{\bf \Phi_x}(\omega_1, \omega_2, \ldots, \omega_n)\frac{d\omega_1d\omega_2{\cdots}d\omega_n}{(2\pi)^n}
$$
* Joint moments of the r.v.s ${\bf x_1, x_2, \ldots, x_n}$
(4.96)



** these moments can be infinite for large enough exponents $k_i$
** when they are finite, can be derived by __differentiating the characteristic function__
(4.97)

* Joint characteristic of a subset of the r.v.s
$$
{\bf \Phi_{x_1x_2x_4}}(\omega_1, \omega_2, \omega_4) = {\bf \Phi_x}(\omega_1, \omega_2, 0,  \omega_4)
$$
* independent
** Expected value
(4.98)


** joint characteristic function
$$
{\bf \Phi_x}(\omega_1, \omega_2, \ldots, \omega_n) = \prod^n_{k=1}{\bf \Phi_{x_k}}(\omega_k)
$$
** sum ${\bf z = x_1 + x_2 + \cdots + x_n}$
$${\bf \Phi_z}(\omega) = \prod^n_{k=1}{\bf \Phi_{x_k}}(\omega)$$
# Ex4.13 Sum of Possion R.V.s




!!4-5 The Multivariate Guassian Distribution
!!!A. Density Function
* If their joint prob. density funciton has the multivariate Gaussian form
$$
f_{\bf x}(x_1, x_2, \ldots, x_n) 
= (2\pi)^{-n/2}|{{\rm det}{\bf C}}|^{1/2}exp[-{1\over 2}\sum^n_{i=1}\sum^n_{j=1}C_{ij}(x_i-m_i)(x_j-m_j)]
$$
** $C_ij$ are elements of an $n \times n$ ''__positive-definite__'' matrix ${\bf C}$
** concisely wittien in the matrix notation
$$
f_{\bf x}(x_1, x_2, \ldots, x_n) 
= (2\pi)^{-n/2}|{{\rm det}{\bf c}}|^{-1/2}exp[-{1\over 2}({\bf x}^T - {\bf m}^T){\bf c}^{-1}({\bf x - m})]
$$
***${\bf c}$ and ${\bf C}$ is different: ${\bf C} = {\bf c}^{-1}$
***${\bf c}$ is covariance matrix
** if n = 2
$$
c = \pmatrix{\sigma_1^2 & r\sigma_1\sigma_2\cr
r\sigma_1\sigma_2 &\sigma_2^2}
$$
$$
c^{-1} = C = {1\over {{\rm det} c}}\pmatrix{\sigma_2^2 & -r\sigma_1\sigma_2\cr
-r\sigma_1\sigma_2 &\sigma_1^2}
$$
with det $c = \sigma_1^2\sigma_2^2(1-r^2)$
!!!B. Gaussian Characteristic Function
Joint characteristic function is
$$
\begin{align}
\Phi_{\bf x}(\omega_1, \omega_2, \ldots, \omega_n) &= E\{{\rm exp}[j(\omega_1{\bf x_1} + \omega_2{\bf x_2} + \cdots + \omega_n{\bf x_n})]\} \\
&= {\rm exp}(j{\bf m}^T{\bf \omega} - {1\over 2}{\bf \omega}^T{\bf c\omega})
\end{align}
$$
* ${\bf \omega}^T{\bf m} = {\bf m}^T{\bf \omega}$
$$
E({\bf x}_i) = {\partial\over \partial (j\omega_i)}\Phi_{\bf x}(\omega_1,\ ldots, \omega_n)\vert_{{\bf \omega} = 0} = m_i
$$
$$
\begin{align}
E({\bf x}_m{\bf x}_p) &= - {\partial^2\over {\partial \omega_m \partial \omega_p}}\Phi_{\bf x}(\omega_1, \ldots, \omega_n)\vert_{\bf \omega} = 0 \\
&= c_{mp }+ {\bf m_mm_p}
\end{align}
$$
*Uncorrelated r.v. (Gaussian) are independent
$$E({\bf x_1x_2x_3x_4}) = c_{12}c_{34} + c_{13}c_{24} + c_{14}c_{23}$$
* Power Series expansion of the Characteristic function
$$\Phi_{\bf x} (\omega_1, \omega_2, \omega_3, \omega_4) = 1-{1\over 2}{\bf \omega}^T{\bf c\omega} + {1\over 8}({\bf \omega^Tc\omega})^2 + {\bf O}\omega^6$$
!!!C. Linear Transform of Gaussian R.V.s
$${\bf z} = a{\bf x}$$
$${\bf x} = a^-1{\bf z} = b{\bf z}$$
* ${\bf m}_z = {\bf a m}$
* ${\bf c}_z = {\bf a c a}^T$
# Ex4.16
## inverse $c^{-1}$
## $f_x(x_1, x_2, x_3)$
## $c_z$
## inverse $C_z$
## $f_z(z_1, z_2)$
!!!D. Conditional Distributions and Expected Values
$${\bf x}_1^T = ({\bf x_1 x_2 \cdots x_n}$$
$${\bf x}_2^T = ({\bf x_{n+1} x_{n+2} \cdots x_{n+m}})$$
* covariance matrix $c=\pmatrix{c_{11} &c_{12} \cr c_{21} &c_{22}}$
** $c_{11}: n \times n$
** $c_{12}: n \times m $
** $c_{21} = c_{12}^T: m \times n$
** $c_{22}: m \times m$
* $c^{-1} = \pmatrix{C_{11} &C_{12} \cr C_{21} &C_{22}}$
** $C_{11} = (c_{11} - c_{12}c_{22}^{-1}c_{21})^{-1}$
** $C_{12} = -C_{11}c_{12}c_{22}^{-1}$
** $C_{21} = -C_{22}c_{12}c_{11}^{-1}$
** $C_{22} = (c_{22} - c_{21}c_{11}^{-1}c_{12})^{-1}$
* joint pdf of the $(n+m)$ r.v.s 
(4.161)


* joint pdf of the $m$ cond. variables ${\bf x_{n+1}, \ldots, x_{n+m}}$
(4.162)


* joint cond. pdf of ${\bf x_1, \ldots, x_n}$ given the observed outcome ${\bf x_{n+1}} = x_{n+1}, \ldots, {\bf x_{n+m}} = x_{n+m}$
(4.163)


** ${\bf C_{22}} - {\bf c_{22}}^{-1} = -{\bf C_{21}c_{12}C_{22}}^{-1}$
(4.164)





* cond. mean of any of the r.v.s ${\bf x}_j$
(4.167)



#Ex 4.17




!!4-6 Estimating Parameters of A distribution
!!! A. Estimators
* parameters: numbers such as the mean and the var. that characterize a pdf
* data
* estimator of parameter $\theta$: $\hat{\theta} = g({\bf x_1, \ldots, x_n})$
* estimator ${\bf \hat{m}}$ of the mean $E({\bf x})$
** //sample mean//
(4.168)


* estimator of the variance
(4.169)


* ''__bias__'' of the estimator: $b(\theta) = E({\bf \hat{\theta}}) - \theta = \overline{\hat{\theta}} - \theta$
** $\theta$ is true value
** zero => unbiased
* mean-squared error: $E[({\bf \hat{\theta}} - \theta)^2]$ is often used to express the average size of the discrepancy between estimate and true value $\theta$
$$E[({\bf \hat{\theta}} - \theta)^2] = {\rm Var} {\bf \hat{\theta}} + [b(\theta)]^2$$
** if the estimator is unbiased, the mean-squared error and the variance Var ${\bf \hat{\theta}}$ are identical
!!!B.Estimating the Mean
(4.172)


* thus the estimator ${\bf \hat{m}}$ is unbiased
Its variance is:
(4.173)

*by the Chebyshev inequality
(4.174)

!!!C. Estimating the Variance
sample variance
(4.175)


* the estimator is unbiased (the mean of the estimator ${\bf \hat{v}}$)
** $E({\bf \hat{v}}) = (n - 1)^{-1}\sum^n_{k=1}E({\bf x_k - \hat{m}})^2 = {n\over {n-1}}E({\bf x_1 - \hat{m}})^2 = {n\over {n-1}}{\rm Var}({\bf x_1 - \hat{m}})$
** $ {\bf x_1 - \hat{m}} = $

** $E({\bf \hat{v}}) = \sigma^2$
* the variance Var ${\bf \hat{v}}$
** require some assumptions about the __fourth moment__ of the r.v. ${\bf x}$ => assume ${\bf x}$ has a Gaussian distrib.
*** this assumption suffices to determine the pdf of the estimator ${\bf \hat{v}}$ as well
** (4.177)
** (4.178)
** the mean and variance of estimator ${\bf \hat{v}}$: by expanding the characteristic function $\Phi_{\hat {v}}(\omega)$ in a power series about the origin $\omega = 0$

=> (4.179)



(Derivation of (4.177))





!!!D. Estimating the Covariance
(4.180)




* unbiased: $E({\bf \hat{c}}) = {\rm Cov} ({\bf x, y})$
** proff similar to the proof that ${\bf \hat{v}}$ is an unbiased estimator of the variance Var ${\bf x}$
* correlation coefficient ${\bf \hat{r}} = {{{\bf \hat{c}}}\over {{\bf \hat{v_x}\hat{v_y}}^{1/2}}}$
** estimate of the true correlation coefficient $r = {{{\rm Cov}(x, y)}\over {\sigma_x\sigma_y}}$
!!4-7 The Central Limit Theorem
${\bf x_1, \ldots, x_n}$ is $n$ __independent and identically distributed__ r.v.s with mean $m$ and variance $\sigma^2$
''CLT'': under conditions weak enough to cover r.v. ''x'' with almost __any__ distribution likely to be encoutered in nature, the r.v.
$$ {\bf y} = n^(-1/2)\sum^n_{k=1}({\bf x}_k - m)$$
whose mean is 0, variance is $\sigma^2$, has in the limite $n\rightarrow \infty$ a __Gaussian__ pdf.
* crude proof
*# characteristic function of ''y''
*# (4.182)
''more elaborate eversion of the CLT'': it is unnecessary that the r.v. ''x'' be identically distributed, the r.v.
$$ {\bf y} = n^(-1/2)\sum^n_{k=1}({\bf x}_k - E({\bf x}_k)$$
will in the limite $n\rightarrow \infty$ have a Gaussian density function provided that the variance Var ''x''~~k~~ remain within fixed bounds,
$$ 0 < M'\leq {\rm Var } {\bf x}_k\leq M'' <\infty$$
for all k, and provided that the third absolute central moments$E(|x_k - E(x_k)|^3)$ remain bounded.
Then $E(y) = 0$ and $\sigma_y^2 = {\rm Var} y = \lim_{n\to\infty} n^{-1}\sum^n_{k=1}{\rm Var}x_k\leq M''$ is __finite, but not zero__.

*i.i.d distributed r.v. ''x'', when the number of n is large, though __finite__, the pdf of ${\bf y} = n^(-1/2)\sum^n_{k=1}({\bf x}_k - m)$ will be closely approximated by the Gaussian form. The r.v. $ s = \sum^n_{k=1}x_k$ has a pdf that is also approximately Gaussian, with mean $\overline{s} = nm$ and variance Var ${\bf s} = n\sigma^2$,
$$ f_{\bf s}(s) \simeq (2\pi{n}\sigma^2)^{-1/2}{\rm exp}\Big[\ -{{(s-nm)^2}\over {2n\sigma^2}} \Big]\$$
** the closer the value of $s$ lies to the mean $E({\bf s}) = nm$, the Gaussian approximation to the pdf $f_s(s)$ is the more accurate
*The sample mean $\hat{\bf m}$ of the i.i.d r.v.s ${\bf x_1, \ldots, x_n}$ is proportiaonal to ''s'', is therefore approximately a Gaussian r.v.

When the component variables ${\bf x_k}$ are discrete r.v.s, the integrated form of the CLT is useful.
(4.183)


Equivalently,
(4.184)



* binomial prob. -> Gaussian (Moivre-Laplace approx.) (Strirling's formula)

#EX4.18 4.19 4.20 4.21
#* (4.184)


!!4-8 Random Sum
''random sum'': a sum of a random number ''n'' of random variables ${\bf s} = \sum^n_{k=1}{\bf x}_k$
** ${\bf x}_k$ are i.i.d, and the random number ''n'' is independent of them.
*mean and variance (conditional prob.)
** $E({\bf s | n} = n) = E \sum^n_{k=1}{\bf x_k} = nE({\bf x})$  =========> $E({\bf s}) = E_{\bf n}[E({\bf s|n})] = E_{\bf n}[{\bf n}E({\bf x})] = E({\bf n})E({\bf x})$
** $E({\bf s^2 | n} = n) = E(\sum^n_{k=1}{\bf x_k})^2 = {\rm Var } ( nE(\sum^n_{k=1}{\bf x_k}) + [E(\sum^n_{k=1}{\bf x_k})]^2 = n {\rm Var }{\bf x} + n^2[E({\bf x})]^2$  =========> $E({\bf s^2}) = E_{\bf n}[E({\bf s^2|n})] = E_{\bf n} {\rm Var }{\bf x} + E({\bf n^2})[E({\bf x})]^2$
** ${\rm Var} {\bf s} = E({\bf n}) {\rm Var } {\bf x} + {\rm Var } {\bf n}[E({\bf x})]^2$
*characteristic function $\Phi_{\bf s}(\omega)$


(4.192)


(4.193)

** is the probability generating function of the distribution of the number ''n'' of terms in the sum
** if ''x'''s are discrete r.v.s taking on onlye __nonnegative integral__ values, the prob. generating function of the random sum ''s'' is,
(4.194)


#Ex4.22
## (4.194)
##prob. gen. func --> prob.





!!5-3 Poisson And Affiliated Stochastic Processes
!!!A. Poisson Counting Processes and Its Distribution
; Poisson point process
:A sequence of random points $\tau_1, \ldots, \tau_m, \ldots$ subject to these two conditions -- that //their number in any interval have a Poisson distribution// and that //their numbers in disjoint intervals be independent//
; //rate// of the process
:parameter $\lambda$
; Poisson counting process
: the stochastic process ${\bf n}(t)$
:* the instants $\tau_1, \ldots$at which the stochastic process ${\bf n}(t)$ jumps up by one unit from a Poisson point process
(5.36)


(5.37)


(5.38)


(5.39)


(5.40)



* always first-order -> cond. -> second order -> cond. -> third order -> ...






!!!B. Expected Value and Autocovariance Function of the Poisson Counting Process
*''expected value''
$$E[{\bf n}(t)] = \lambda{t}$$
*''correlation function''
(5.42)



*''autocovariance function''
$$C_{\bf n}(t_1, t_2) = {\lambda} {\rm min}(t_1, t_2)$$
!!!C. Random Telegraph Signal
;random telegraph signal
:switching times constitute a Poisson point process with rate $\lambda$
*at time t > 0, ${\bf x}(t) = +1$, the prob. of this event is 
(5.44)

(5.45)

*second order
(5.46)


(5.47)


==> (5.48)




*the random telegraph signal is also a ''Markov process''
(5.49)


*mean
(5.50)

*correlation function
(5.51)


=>(5.52)



*autocov.
(5.53)

**cond. expected value => correlation => autocov.


all these bear the tacit cond. ${\bf x}(0) = 1$, if the process has instead start at t = $-\infty$
*cond. prob.
(5.54)

*second order distrib.
(5.55)




*''y''(t) is stationary 
*correlation fucntion: $R_{\bf y}(t_1, t_2) = {\rm exp}[-2\lambda(t_2 - t_1)]$
*autocov. (5.26)


!!!D.Shot Noise
;shot noise
:${\bf y}(t) = \sum^\infty_{k=-\infty}h(t-\tau_k)$
:*$\tau_k$ is Poisson process
*the first-order pdf: difficult
*mean&autocov.
$\epsilon_m, \triangle t$ ====> $E(\epsilon_m)$ ===> $E(\tilde{y}(t))$ ===>$E[y(t)]$ ==> $R_{\tilde{y}}(t_1, t_2)$
$E(\epsilon_m, \epsilon_n)$ ==>$C_{\tilde{y}}(t_1,t_2)$ ===> $C_y(t_1, t_2)$ ==> $C_y(\tau)$
$\Phi_{\tilde{y}}(\omega)$ ==> $\Phi_y(\omega)$ ==> first order pdf $f_y(y, t)$ (h(t) rectangular => y Poisson process)









!!!E.Random Pulses of Random Amplitude
;clutter
:${\bf x}(t) = \sum^\infty_{k=-\infty}{\bf A}_kh(t-{\bf \tau}_k)$
:* h(t) represents the shape of the reflected radar pulse
:* the diff. between //Shot Noise//and //Random Noise of Random Amplitude// is the amplitude
:* $\tau_k$ constitute a Poisson point process
:* $\tau_k$ and $A_k$ are all statistically independent
:** independent for random variables, statistically independent for random processes
As in part D
$\epsilon_m, \triangle t$ ====> $E(\epsilon_m)$ ===> $E(\tilde{x}(t))$ ===>$E[x(t)]$ ==> $R_{\tilde{x}}(t_1, t_2)$
$E(\epsilon_m, \epsilon_n)$ ==>$C_{\tilde{x}}(t_1,t_2)$ ===> $C_x(t_1, t_2)$ ==> $C_x(\tau)$






















!!5-3: Transformations of Stochastic Processes
!!!Memoryless Nonlinear Transformations
Memoryless
# $y(t) = g(x(t))$
# $J \begin{pmatrix}
y_1 & y_2 & \cdots &y_n \\
x_1 & x_2 & \cdots &x_n
\end{pmatrix}
= g'(x_1)g'(x_2)\cdots g'(x_n)$
# ''monotone'':  $f_y(y_1, t_1, ; \cdots ; y_n, t_n) = {f_x(x_1, t_1; \cdots; x_n, t_n) \over |g'(x_1)\cdots g'(x_n)|}$
*Ex5.10 Quadratic Rectifier
**$f_x(x, t)$ ----> $f_y(y, t)$
**$f_x(x_1, t_1; x_2, t_2)$ ----> $f_y(y_1, t_1; y_2, t_2)$
** $\overline{y(t)}$, $R_y(t_1, t_2)$, $C_y(t_1, t_2)$

!!!Linear Filtering
*time-variable linear filter
*#$y(t) = \int_{-\infty}^{\infty}k(t,s)x(s)ds$
*#$k(t,s)$ is the impulse response of the filter
*time-invariant linear filter
*#$y(t) =\int_{-\infty}^{\infty}h(\tau)x(t-\tau)d\tau$
Expected value 
(5.92)

Autocovariance
(5.93)









*Ex 5.11 Perfect Integrator



!!!Linear Differential Equations with Random Forcing Terms
Linear, ~Time-Invariant filter (Langevin equations)
(5.104)



(5.105)



*mean & autocovariance















*Ex 5.12
!!5-5 Spectral Density of a Stationary Process
$y(t)$ --> $C_y(t_1, t_2)$ --> stationary --> $C_y(\tau)$
*$S_y(w) = \int_{-\infty}^{\infty}C_y{\tau}e^{-j\omega\tau}d\tau = |H(j\omega)|^2S_x(\omega)$
*$C_x(\tau) = C_x(-\tau)$ --> $S_x(w) = S_x(-w)$


!!5-6 Gaussian Stochastic Processes
!!!A.The Random-Pulse Process Revisited
Refer to: Sec. 5-3E
$S_x(\omega)$ --> $S_z(\omega)$ --> $h(u)$ --> $z(t)$ --> $C_z(\tau)$
* ''Poisson impulse process''
















!!!B.The Gaussian Process
*$E(A) = 0$
* $\lambda -> \infty$
*$E(A^2) --> 0$
(5.154)












* Gaussian noise

!!!C. White Noise
* $S_z(\omega) = N/2, -\infty < \omega < \infty$
* $C_z(\tau) = {N \over 2}\delta(\tau)$



!!!D. The Brownian Process
Shot-noise
considered the output of a linear filter, with Poisson impulse response
*Wiener-Levy process / Brownian process
variance,  autocovariance, joint pdf
!!5-7 Thermal Noise
!!!A. the Brownian Motion













!!!B. Thermal Noise in a Resistor

















!!!C. Thermal Noise in Linear Networks
$S_v(\omega) = 2kT{\rm Re}[Z_e(j\omega)]$

*Ex5.14~5.15 RC Circuit











*Ex.5.16 RLC Circuit









!!!D. Power Transfer Between Two Networks















!!!E. Maximum Power Transfer
















!!!F. Amplifier Noise









!!5-8 Measurement of Stochastic Processes
!!!A. Estimating the Mean of a Stationary Process
''stationary''




















!!!B. Estimating the Correlation Function of a Stationary Process















!!!C. Ergodicity











!!!D. Estimating the Spectral Density of a Stationary Process
















































!!!E. Digital Spectral Estimation


!!!Tiddlywiki
{{{
chorme.exe --enable-file-cookies 
chrome.exe --allow-file-access-from-files
}}}

!!!快捷键
老鸟用电脑都是不摸鼠标的,双手在键盘上噼啪乱响,屏幕上也跟着来回变化──他们喜欢快捷键(所以一般老鸟都反感苹果触摸板和大白肥皂鼠标的手势操作,快捷键优势荡然无存了)。下面列出10个Chrome的快捷键(Windows版),掌握之后你也可以变成老鸟了。

#Alt+F 或 Alt+E -- 打开扳手工具菜单,之后就可以用上下箭头键来进入你想要的功能了
#Ctrl+Shift+B -- 切换收藏工具条是否显示
#Ctrl+D -- 将当前标签页加入收藏
#Ctrl+Shift+D -- 将现在所有打开的标签页都放到同一个收藏夹目录里
#Ctrl+J -- 打开“下载”标签页
#Shift+Esc -- 打开“任务管理器”,在这里你可以关闭无响应的标签页
#Ctrl+Shift+J -- 打开 Chrome 开发工具
#Ctrl+L -- 选中当前标签页的URL地址,好直接输入新网址
#Ctrl+Backspace -- 删除地址栏里光标左边的一个词
#Ctrl+G -- 找到通过Ctrl+F查找的下一个词,Ctrl+Shift+G则是查找上一个词
#Ctrl+U -- 查看当前标签页的源代码
#Ctrl+R -- 跟F5一样都是刷新当前标签页
#Ctrl+1(2, 3, 4等等) -- 切换到第几个标签页(从左数)
#Ctrl+Shift+T -- 重新打开刚刚关闭的标签页

如果你用Mac OS X,将以上快捷键的Ctrl都换成Command即可,Shift不变。

!!!switch different tag
{{{
ctrl + num.
}}}
!!Personalized Services Scenarios
"understanding" of topics

!!Radio-Related Languages
#SDL
#UML
#IDL
#HDLs
#KQML
#KIF

!!Cognitive Radio as a Chess Game

!!RKRL
integrates SDL, UML, IDL, KQML
<frame> = [<handle>, <model>, <body>, <context>].

!!Knowledge about Equalizers
The natural langauage phrase reduces @@ISI@@.


!!Spatial Inferencee Hierarchy

!!Model Matching

!!The Cognition Cycle



sd
/***
|Name|CommentPlugin|
|Source|http://www.TiddlyTools.com/#CommentPlugin|
|Documentation|http://www.TiddlyTools.com/#CommentPluginInfo|
|Version|2.9.5|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Description|automatically insert formatted comments into tiddler content|
!!!!!Documentation
>see [[CommentPluginInfo]]
!!!!!Configuration
>see [[CommentPluginInfo]]
!!!!!Revisions
<<<
2011.04.27 2.9.5 merge/clone defaultCustomFields for saving on TiddlySpace
| please see [[CommentPluginInfo]] for previous revision details |
2006.04.20 1.0.0 initial release
<<<
!!!!!Code
***/
//{{{
version.extensions.CommentPlugin= {major: 2, minor: 9, revision: 5, date: new Date(2011,4,27)};

config.macros.comment= {
	marker: '/%'+'comment'+'%/',
	fmt: "__''%subject%''__\n^^posted by %who% on %when%^^\n<<<\n%message%\n<<<\n",
	datefmt: 'DDD, MMM DDth, YYYY at hh12:0mm:0ss am',
	tags: '',
	reverse: false,
	handler: function(place,macroName,params,wikifier,paramstring,tiddler) {
		var span=createTiddlyElement(place,'span');
		var here=story.findContainingTiddler(place);
		if (here) var tid=here.getAttribute('tiddler');  // containing tiddler title
		span.setAttribute('here',tid);
		var target=(params[0]&&params[0].length&&params[0]!='here')?params[0]:tid;  // target title
		span.setAttribute('target',target);
		var overwrite=(params[1]&&params[1].toLowerCase()=='overwrite'); if (overwrite) params.shift();
		span.setAttribute('overwrite',overwrite?'true':'false');
		var reverse=(params[1]&&params[1].toLowerCase()=='reverse'); if (reverse) params.shift();
		span.setAttribute('reverse',(reverse||this.reverse)?'true':'false');
		var marker=this.marker;
		if (params[1]&&params[1].substr(0,7)=='marker:') {
			var marker='/%'+params[1].substr(7)+'%/';
			params.shift();
		}
		span.setAttribute('marker',marker);
		var tags=(params[1]&&params[1].length)?params[1]:this.tags; // target tags
		span.setAttribute('tags',tags);
		var fmt=(params[2]&&params[2].length)?params[2]:this.fmt; // output format
		span.setAttribute('fmt',fmt.unescapeLineBreaks());
		var datefmt=(params[3]&&params[3].length)?params[3]:this.datefmt; // date format
		span.setAttribute('datefmt',datefmt.unescapeLineBreaks());
		var html=this.html;
		html=html.replace(/%nosubject%/g,(fmt.indexOf('%subject%')==-1)?'none':'block');
		html=html.replace(/%nomessage%/g,(fmt.indexOf('%message%')==-1)?'none':'block');
		var subjtxt=''; var msgtxt='';
		html=html.replace(/%subjtxt%/g,subjtxt);
		html=html.replace(/%msgtxt%/g,msgtxt);
		span.innerHTML=html;
	},
	html: "<form style='display:inline;margin:0;padding:0;'>\
		<div style='display:%nosubject%'>\
		subject:<br>\
		<input type='text' name='subject' title='enter subject text' style='width:100%' value='%subjtxt%'>\
		</div>\
		<div style='display:%nomessage%'>\
		message:<br>\
		<textarea name='message' rows='7' title='enter message text' \
			style='width:100%'>%msgtxt%</textarea>\
		</div>\
		<center>\
		<i>Please enter your information and then press</i>\
		<input type='button' value='post' onclick='\
			var s=this.form.subject; var m=this.form.message;\
			if (\"%nosubject%\"!=\"none\" && !s.value.length)\
				{ alert(\"Please enter a subject\"); s.focus(); return false; }\
			if (\"%nomessage%\"!=\"none\" && !m.value.length)\
				{ alert(\"Please enter a message\"); m.focus(); return false; }\
			var here=this.form.parentNode.getAttribute(\"here\");\
			var reverse=this.form.parentNode.getAttribute(\"reverse\")==\"true\";\
			var target=this.form.parentNode.getAttribute(\"target\");\
			var marker=this.form.parentNode.getAttribute(\"marker\");\
			var tags=this.form.parentNode.getAttribute(\"tags\").readBracketedList();\
			var fmt=this.form.parentNode.getAttribute(\"fmt\");\
			var datefmt=this.form.parentNode.getAttribute(\"datefmt\");\
			var overwrite=this.form.parentNode.getAttribute(\"overwrite\")==\"true\";\
			config.macros.comment.addComment(here,reverse,target,tags,fmt,datefmt,\
				s.value,m.value,overwrite,marker);'>\
		</center>\
		</form>",
	addComment: function(here,reverse,target,newtags,fmt,datefmt,subject,message,overwrite,marker) {
		var UTC=new Date().convertToYYYYMMDDHHMMSSMMM();
		var rand=Math.random().toString();
		var who=config.options.txtUserName;
		var when=new Date().formatString(datefmt);
		target=target.replace(/%tiddler%/g,here);
		target=target.replace(/%UTC%/g,UTC);
		target=target.replace(/%random%/g,rand);
		target=target.replace(/%who%/g,who);
		target=target.replace(/%when%/g,when);
		target=target.replace(/%subject%/g,subject);
		var t=store.getTiddler(target);
		var text=t?t.text:'';
		var modifier=t?t.modifier:config.options.txtUserName;
		var modified=t?t.modified:new Date();
		var tags=t?t.tags:[];
		for(var i=0; i<newtags.length; i++) tags.pushUnique(newtags[i]);
		var fields=merge(t?t.fields:{},config.defaultCustomFields,true)
		var out=fmt;
		out=out.replace(/%tiddler%/g,here);
		out=out.replace(/%UTC%/g,UTC);
		out=out.replace(/%when%/g,when);
		out=out.replace(/%who%/g,who);
		out=out.replace(/%subject%/g,subject);
		out=out.replace(/%message%/g,message);
		var pos=text.indexOf(marker);
		if (pos==-1) pos=text.length; // no marker - insert at end
		else if (reverse) pos+=marker.length; // reverse order by inserting AFTER marker
		var newtxt=overwrite?out:(text.substr(0,pos)+out+text.substr(pos));
		store.saveTiddler(target,target,newtxt,modifier,modified,tags,fields);
		autoSaveChanges();
		if (story.getTiddler(target))
			story.refreshTiddler(target,DEFAULT_VIEW_TEMPLATE,true);
		if (here!=target && story.getTiddler(here))
			story.refreshTiddler(here,DEFAULT_VIEW_TEMPLATE,true);
	}
};
//}}}
!!Source
http://www.oschina.net/question/12_49423
http://www.cnblogs.com/sn-dnv-aps/archive/2012/06/08/2542205.html

!!Complie GCC
在此之前建议更新下系统,执行如下命令:
{{{
sudo apt-get install update
sudo apt-get install upgrade
}}}
接下来我们需要安装一些所需的软件包:
{{{
sudo apt-get install g++
sudo apt-get install gawk
sudo apt-get install m4
sudo apt-get install gcc-multilib
}}}
有可能也需要
{{{
sudo apt-get install flex
}}}

然后从 GNU 网站上下载最新的 gcc-4.7 源码,请访问 http://gcc.gnu.org/mirrors.html 然后选择 gcc-4.7 的最新稳定版本,文件名是 gcc-4.7.0.tar.bz2. 将它保存到本地。

你还需要另外三个库才能成功编辑 gcc,这三个库分别是:mpc, mpfr 和 gmp. 使用链接进入下载最新版本分别是:gmp-5.0.4.tar.bz2, mpc-0.9.tar.gz 和 mpfr-3.1.0.tar.gz ,并且保存到跟 gcc 4.7 源文件所在的同一个目录。

*目录的级别如下
{{{
/home/hao/gcc_4_7/: work directory, all downloaded code
/home/hao/gcc_4_7/gcc_4.7/: source code of gcc_4.7
/home/hao/gcc_4_7/gmp*: source code for gmp
/home/hao/gcc_4_7/mprf*: source code for mprf
/home/hao/gcc_4_7/mpc*: source code for mpc
the notation * indicates some name of the directory, e.g. gmp* = gmp-5.1.0
}}}

我们先开始编译 gmp 库
{{{
cd gmp*
mkdir build && cd build
../configure --prefix=/usr/gcc_4_7 --build=x86_64-linux-gnu
* --build 指示编译的机器的类型, 这个可以说是必须要修改的 可以通过查看/usr/include/下是否有相对应的文件夹 e.g. /usr/include/x86_64-linux-gnu
* 虽然有时候cpu是i686 但是装的系统是i386 也应该制定i386-linux-gnu (因为/usr/include下没有i686相应的包)
* --prefix 指定make install时 libaray安装的位置
make
sudo make install
}}}


几分钟后你将有一个已编译好和安装好的 gmp 库,如果一切顺利,恭喜你!

使用相同的步骤来编译 MPFR:
{{{
cd ..
cd ..
cd mpfr*
mkdir build && cd build
../configure --build=x86_64-linux-gnu --prefix=/usr/gcc_4_7 --with-gmp=/usr/gcc_4_7
make
sudo make install
}}}

紧接着是 MPC:
{{{
cd ..
cd ..
cd mpc*
mkdir build && cd build
../configure --build=x86_64-linux-gnu --prefix=/usr/gcc_4_7 --with-gmp=/usr/gcc_4_7 --with-mpfr=/usr/gcc_4_7
make
sudo make install
}}}

到这一步就完成个 gcc 所需包的编译和安装,在某些机器上这三者的编译可能超过一个小时,做好心理准备。

接下来我们可以开始编译 C/C++ 和 Fortran 编译器:
{{{
cd ..
cd ..
mkdir build && cd build
export LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/
export C_INCLUDE_PATH=/usr/include/x86_64-linux-gnu
export CPLUS_INCLUDE_PATH=/usr/include/x86_64-linux-gnu

*corresponding x86_64-linux-gnu, e.g. i386-linux-gnu

../gcc-4.7.0/configure --build=x86_64-linux-gnu --prefix=/usr/gcc_4_7 --with-gmp=/usr/gcc_4_7 --with-mpfr=/usr/gcc_4_7 --with-mpc=/usr/gcc_4_7 --enable-checking=release --enable-languages=c,c++,fortran --disable-multilib --program-suffix=-4.7
make
sudo make install
}}}


下面命令可将 gcc 4.7 添加到系统路径中,或者直接编辑 .bashrc 文件并在最后添加下面一行:
{{{
export PATH=/usr/gcc_4_7/bin:$PATH
}}}
注意可能出现
{{{
fatal error: gnu/stubs-32.h: No such file or directory compilation terminated
}}}
需要
{{{
export LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/
export C_INCLUDE_PATH=/usr/include/x86_64-linux-gnu
export CPLUS_INCLUDE_PATH=/usr/include/x86_64-linux-gnu

* x86_64-linux-gnu 替换成对应i386-linux-gnu
}}}
!!!!Problem
# (1.1) Why the coefficients theta satisfies this inequality
# //Bounded Variation model for images// Why the corresponding coeff. obey ||theta^^(j)^^||~~1~~ <= 4R
# //Bump Algebra model for spectra// Refer to [33] . Why the corresponding coeff. obey ||theta^^(j)^^||~~1~~ <=c*R*2^^-j/2^^
# ? As p decreases below 1, more and more sparsity is being required. Also, from this view point, an l^^p^^ constraint based on p = 2 requires no sparsity at all.
#* why p is [0, 2]
# (1.2) Why?
# X~~p,m~~(R) = {x: ||theta(x)||~~p~~ <= R} why X is a function of R?
!!!!Project Site
http://www.cs.tut.fi/~comsens/

!!!!Contribution
replace the traditional parametric modeling used in CS by a nonparametric one
* spatially adaptive filtering (replace the global penalties based on l~~p~~-norms
!! Important Papers
#"compressive sensing a summary of reconstruction algorithms": 一篇综述CS恢复算法的硕士论文
#[[An Introduction to Compressive Sampling]]: Introduction to CS
#[[Imaging via Compressive Sampling]]: introduction to CS used in image reconstruction
!! Proposals
[[Better reconstruct signals by knowing the position of the spike]]
[[Using CS theory to hide information]]
[[SI-BP improvement]]

!!! Problem


CS-BP中通过sigma1, sigma0, K来得到x的先验分布
BP-SBL中通过将BP用于tow-layer Bayesian model in [17],从而来Infer x的后验概率?,并且使用EM算法来update贝叶斯模型中的Hyepr param。
这样,就不需要sigma0, sigma1和K来得到x的先验分布了

在这种情况下,又可以证明message都是高斯分布的,从而只需要传递mean和var即可
<<list filter [tag[Cook]]>>
*Create your own site in [[tiddlyspot|http://www.tiddlyspot.com]]
*Download the file
*Edit the SiteTitile and SiteSubTitle
**notes: do not edit the title "SiteTitle" but edit the following text block to change your site title>.<
*Save Changes
*Upload
*GettingStarted
*Edit the MainMenu, like
{{{
[[GettingStarted]]
!!Turtorial
[[TiddlyWikiLog]]
}}}
*click the new item you created and edit
*Done, Save changes and Upload
Do not forget: First, enable your project for debugging by adding the android:debuggable="true"
option in your AndroidManifest.xml file.
{{{
<application android:icon="@drawable/icon"
android:label="@string/app_name"
android:debuggable="true">
}}}

先要把sqlitejdbc-v033-nested.jar这个jar包放到工程的lib中
{{{
import java.sql.*;
import org.sqlite.JDBC;


try {
Class.forName("org.sqlite.JDBC");

Connection conn = DriverManager.getConnection("jdbc:sqlite:/c:/allen/xxx.db");
// 注意,这里的写路径的格式是jdbc:sqlite:/path
// 并且,所有的字母都要小写,不管路径是不是大写
// 我一开始就是写成C:/Allen/xxx.db,然后就一直抛出异常- -
// 但是在linux下,不能tolowerCase,晕

Statement stm = conn.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE);
} catch (SQLException e) {
stm = null;
throw e;
} catch (ClassNotFoundException e) {
throw e;
}
}}}
!!Abstract
!!!Problem
cognitive radio must detect the presence of primary users
* to avoid interfering with them
However, many devices in primary networks are passive
* the CR cannot find their locations, etc.
!!!Proposed
#use Local Oscillator(LO) leakage power
#* all RF receivers emit
#* allow CR locate thses receivers
#detection approach
#* detect the LO leakage
#new architecture :sensor node detector devices 
#* detect LO leakage
#* comm the channel usage to the CR
#compare to that of architectures assuming passive primary receivers.
1. [Setup the android SDK]
1) 下载Android SDK 2.2 
For windows 版 android-sdk_r06-windows.zip   (http://dl.google.com/android/android-sdk_r06-windows.zip)
For Mac 版 android-sdk_r06-mac_86.zip   (http://dl.google.com/android/android-sdk_r06-mac_86.zip)
For Linux 版 android-sdk_r06-linux_86.tgz   (http://dl.google.com/android/android-sdk_r06-linux_86.tgz)
 这个 zip 包并不是一个完整的软件包。Android 软件包采用“组件”的形式,用户可以根据需要选取组件。上述zip文件只包含了一个组件管理工具和一个基本的工具组件。
2)设置环境变量
解压缩上面的 zip 包,然后
      On Linux, edit your ~/.bash_profile or ~/.bashrc file. Look for a line that sets the PATH environment variable and add the full path to the tools/ directory to it. If you don't see a line setting the path, you can add one:export PATH=${PATH}:<your_sdk_dir> /tools
      On a Mac OS X, look in your home directory for .bash_profile and proceed as for Linux. You can create the .bash_profile if you haven't already set one up on your machine.
      On Windows, right-click on My Computer, and select Properties. Under the Advanced tab, hit the Environment Variables button, and in the dialog that comes up, double-click on Path (under System Variables). Add the full path to the tools/ directory to the path.
3)运行 Android SDK and AVD Manager
可以运行 SDK Setup.exe, 即启动了Andoid SDK and AVD Manager。这个工具不但对Android SDK 组件进行管理,同时也是 Android 虚拟设备管理器。(关于后者,参见后面示例)。
  然后,可以用这个工具下载完整的 Android SDK 开发包。需要注意的如果网络使用了代理服务器,则(有可能)需在这个工具里配置代理服务器域名和端口。
      并且,需要在proxy设置里把https->http打开,因为https有可能连接不上
notes: 在这里使用ADV Manager的话,可能仍会连接不上网络,don't worry, in eclipse, it would work. So after setup Eclipse, you can also use the manager to update your enviroment.

2. [安装 Eclipse]
地址:http://www.eclipse.org/downloads/ 下载Eclipse 3.5.2 ,同样,只需解压缩即可。

3. [安装 ADT]
ADT 版本:
ADT 0.9.7 (May 2010)
ADT 0.9.6 (March 2010)
ADT 0.9.5 (December 2009)
ADT 0.9.4 (October 2009)
使用 Eclipse 的升级管理器来安装ADT:
1). 启动 Eclipse, 然后进入 Help > Install New Software.
2). 在 Available Software 对话框里,点击 Add....
3). 出现 Add Site 对话框,在 Name 域里面输入一个名字 (例如, "Android Plugin") ,
在 "Location" 域里面输入 URL: http://dl-ssl.google.com/android/eclipse/
4). 注意:如果有问题,可以把 https 换成 http 试一下。点击 OK.
5). 回到 Available Software 界面,你应该看到 "Developer Tools" 。选取 checkbox 。点击 Next, 接受 license agreement, 然后点击 Finish。
6). 重起 Eclipse.
 
4. [配置 ADT]
配置 Eclipse 里的 ADT,使其指向 Android SDK 。
1). 选取 Eclipse Window > Preferences...
2). 选择 Android
3. 点击 Browse... 定位 Android SDK 目录。
4. 点击 Apply, 然后 OK.
 
5. [Use AVD Manager in Eclipse]
Window > Android SDK and AVD Manager
Update`
Then you can always connect to the network.
You can also set your proxy in Eclipse: Window > Preference > General > Network Connection

6. [创建虚拟设备]
开发环境建立好了,就可以写一个“Hello World”应用。但在之前,还需创建一个虚拟设备。
运行 Eclipse, 选取 Window > Android SDK and AVD Manager.
在左侧面板选择 Virtual Devices
点击 New.
出现 Create New AVD 对话框
输入 AVD 名字, 例如 "android_avd".
选取一个目标。目标是一个平台 (即,Android SDK 的版本,如 2.2)
暂时忽略其他设置
点击 Create AVD.
 
7. [Hello World]
1). 创建一个新的 Android project
在创建 AVD 之后, 下个步骤就是在 Eclipse 里开始一个新的 Android 项目。
运行 Eclipse, 选取 File > New > Project.
如果 ADT 插件正确安装了,应该在 "Android Project" 里面有一项:"Android" 。(在你创建了一个或多个Android 项目后,一个 "Android XML File" 入口也应该可见。)
选择 "Android Project" 并点击 Next.
填写项目信息如下:
Project name: HelloAndroid
Application name: Hello, Android
Package name: com.example.helloandroid (or your own private namespace)
Create Activity: HelloAndroid
点击 Finish.
2). 编写代码:打印 Hello Android
{{{
package com.android.helloandroid;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class HelloAndroid extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView tv = new TextView(this);
tv.setText("Hello, Android");
setContentView(tv);
}
}
}}}

3)运行
ADT 使运行非常简单:
选取 Run > Run.
选取 "Android Application".
Easy to confuse
!!!!Dirac delta function is as following
[img[http://upload.wikimedia.org/math/1/f/1/1f1103de61a5a19527e3fdceeca5ec28.png]]
and which is also constrained to satisfy the identity
[img[http://upload.wikimedia.org/math/1/4/3/14323c583ede5a758cf23c07bd85aad2.png]]
That is, when t=0, the value would be infinite.
And the integral is 1.
!!!!Kronecker delta is as following
[img[http://upload.wikimedia.org/math/4/4/1/4414b458f7fe5bb968ab94a466b0d6dc.png]]
The function is referred to as an impulse, or unit impulse. And when it stimulates a signal processing element, the output is called the impulse response of the element.
//{{{
(function(formatters) { //# set up alias
  for (var i=0; i<formatters.length; i++) {
    if (formatters[i].name == "characterFormat") {
      merge( formatters[i],
        {match: "''|//|__|\\^\\^|~~(?!\\s|$)|\\{\\{\\{"});
    } // if
  } // for
})(config.formatters); //# end of alias

//}}} 
/***
|Name|DiscussionPlugin|
|Source|http://www.TiddlyTools.com/#DiscussionPlugin|
|Documentation|http://www.TiddlyTools.com/#DiscussionPluginInfo|
|Version|1.5.7|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Requires|CommentPlugin|
|Description|display tabbed discussion summary with comment input form|
!!!!!Documentation
>see [[DiscussionPluginInfo]]
!!!!!Configuration
<<<
When installed, [[DiscussionPlugin]] can automatically modify the default shadow [[ViewTemplate]] so that all tiddlers will be rendered with two tabs: "Page", and "Discussion".  The "Page" tab displays the regular tiddler content, while the "Discussion" tab displays the summary list of comments as well as an input form to enter new comments.  You can enable/disable this action by setting/clearing the following checkbox:
><<option chkDiscussionTemplate>> Automatically modify default shadow [[ViewTemplate]]
Note: //''You must reload your document for changes to this option to take effect.''//  In addition, this option is only applied to the shadow [[ViewTemplate]].  If you are using a custom [[ViewTemplate]], you will need to manually alter that template to add the Page and Discussion tab display.

''Please see [[DiscussionPluginInfo]] for additional configuration options and instructions.''
<<<
!!!!!Revisions
<<<
2009.01.04 [1.5.7] in customized ViewTemplate, corrected 'tabs' macro to avoid error when viewing shadow tiddlers
| please see [[DiscussionPluginInfo]] for previous revision details |
2008.04.15 [1.0.0] initial prototype
<<<
!!!!!Code
***/
//{{{
version.extensions.DiscussionPlugin= {major: 1, minor: 5, revision: 7, date: new Date(2009,1,4)};

if (config.options.chkDiscussionTemplate===undefined)
	config.options.chkDiscussionTemplate=false;

config.macros.discussion= {
	reverse: // display order for summary list
		false,
	listfmt: // format for summary list items
		"#<<slider [[]] [[%tiddler%]] [[%subject%]] [[posted by %who% on %when%]]>>\n",
	tags: // tags for comment tiddlers
		"excludeLists",
	slices: // slice format included in comment tiddlers - used to create summary list display
		"/%\n|subject|%subject%|\n|byline|%who%|\n|date|%when%|\n%/",
	titlefmt: // format for dynamically generating comment tiddler title
		"_%UTC%%random%", // default: append UTC timestamp and random number
	commentfmt: // format for individual comment content
		"^^posted by %who% on %when%^^\n<<<\n%message%\n<<<\n",
	datefmt: // date format for comments
		"DDD, MMM DDth, YYYY at hh12:0mm:0ss am",
	handler: function(place,macroName,params,wikifier,paramstring,tiddler) {
		var here=story.findContainingTiddler(place);
		if (here) var tid=here.getAttribute("tiddler");  // containing tiddler title
		var listfmt=(params[0]&&params[0].length)?params[0]:this.listfmt;  // item format
		var reverse=(params[1]&&params[1].toLowerCase()=="reverse"); if (reverse) params.shift();
		var tags=params[1]?params[1]:this.tags;  // target tags
		if (!tags.readBracketedList().contains("comment")) tags+=" comment"; // must be tagged with "comment"
		var commentfmt=(params[2]&&params[2].length)?params[2]:this.commentfmt; // output format
		var datefmt=(params[3]&&params[3].length)?params[3]:this.datefmt; // date format
		var tids=store.getTaggedTiddlers("comment","created");
		if (reverse||this.reverse) tids=tids.reverse();
		var out=""; var count=0;
		for (var t=0; t<tids.length; t++) if (tids[t].title!=tid && tids[t].title.substr(0,tid.length)==tid) {
			count++;
			var title=tids[t].title;
			var subject=store.getTiddlerSlice(title,"subject");
			var byline=store.getTiddlerSlice(title,"byline");
			var when=store.getTiddlerSlice(title,"date");
			out+=listfmt;
			out=out.replace(/%tiddler%/g,title);
			out=out.replace(/%subject%/g,subject);
			out=out.replace(/%who%/g,byline);
			out=out.replace(/%when%/g,when);
		}
		out="!!!There "+(count==1?"is ":"are ")+count+" comment"+(count==1?"":"s")+":\n"+out;
		var next="%tiddler%"+this.titlefmt;
		out+="!!!Add a comment:\n";
		out+="<<comment "+next+" [["+tags+"]] [["+this.slices+commentfmt+"]] [["+datefmt+"]]>>";
		wikify(out,place);
	},
	countComments: function(tid,after) {
		var tids=store.getTaggedTiddlers("comment","created");
		var count=0;
		for (var t=0; t<tids.length; t++)
			if (tids[t].title!=tid && tids[t].title.substr(0,tid.length)==tid)
				if (!after||tid.modified>=after) count++;
		return count;
	}
};
//}}}

// // automatically add shadow tiddlers and templates for displaying page/discussion tabs
//{{{

// macro for rendering current tiddler content
config.macros.currentTiddler= {
	handler: function(place,macroName,params,wikifier,paramstring,tiddler) {
		var here=story.findContainingTiddler(place); if (!here) return;
		var txt=store.getTiddlerText(here.getAttribute("tiddler"),"");
		txt=txt.replace(/\<\<currentTiddler\>\>/g,""); // prevents infinite recursion!
		removeChildren(place); wikify(txt,createTiddlyElement(place,"div",null,"viewer"));
	}
};

// [[CurrentTiddler]] allows tab to show tiddler content
config.shadowTiddlers.CurrentTiddler="<<currentTiddler>>";

// [[DiscussionTiddler]] allows tab to show discussion panel
config.shadowTiddlers.DiscussionTiddler="<<discussion>>";

// [[NoDiscussionViewTemplate]] is an unmodified copy of the shadow [[ViewTemplate]]
config.shadowTiddlers.NoDiscussionViewTemplate=store.getTiddlerText("ViewTemplate");

// [[DiscussionViewTemplate]] is a copy of the current [[ViewTemplate]] where the 
// default viewer content ("view text wikified") is replaced with tabs for Page/Discussion
config.shadowTiddlers.DiscussionViewTemplate=store.getTiddlerText("ViewTemplate").replace(/view text wikified/,
	'tabs txtDiscussionTab Page Page CurrentTiddler {{var c=0; if(place) var h=story.findContainingTiddler(place); if(h) c=config.macros.discussion.countComments(h.getAttribute("tiddler")); "Discussion"+(c?" ("+c+")":"")}} Discussion DiscussionTiddler');

// optionally, automatically apply DiscussionViewTemplate to all tiddlers
if (config.options.chkDiscussionTemplate) config.shadowTiddlers.ViewTemplate="[[DiscussionViewTemplate]]";
//}}}
/***
|Name|DiscussionPluginInfo|
|Source|http://www.TiddlyTools.com/#DiscussionPlugin|
|Documentation|http://www.TiddlyTools.com/#DiscussionPluginInfo|
|Version|1.5.7|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|Documentation|
|Description|Documentation for DiscussionPlugin|
!!!!!Usage
<<<
syntax:
{{{
<<discussion listformat reverse tags commentformat dateformat>>
}}}
where:
*''listformat'' //(optional)//<br>specifies the display format for each item in the summary list. //Note: when specifying additional macro parameters, you can use a blank value (e.g., {{{""}}}) as a 'placeholder' to allow the default item format to be used.//
*''reverse'' //(optional)//<br>by default, the comments in the discussion summary list are shown in date/time order, with the oldest item listed first.  The ''reverse'' keyword, when present, indicates the display order should be inverted so that the most recent item is listed first.
*''tags'' //(optional)//<br>specifies one or more space-separated tags to add to the target tiddler whenever a comment is written.  Note that the list of tags should be enclosed in "..." so that it is processed as a single parameter.  If you do not want tags added to the individual comment tiddlers, use a blank value (e.g., {{{""}}}) as a 'placeholder'.  Regardless of the tags that are specified, a tag of "comment" is always added to each target tiddler.  This is required in order to locate the tiddler when generating the dicussion summary list.
*''commentformat'' //(optional)//<br>specifies a custom output format to be used when inserting comments into the target tiddler, where: %when%=formatted date/timestamp, %who%=username, %subject%=comment subject text, and %message% is the body of the comment.  When present, this parameter overrides the default output format defined via {{{config.macros.comment.fmt}}}.  See the ''Configuration'' section below and in [[CommentPluginInfo]] for additional details.
*''dateformat'' //(optional)//<br>specifies a custom date/timestamp output used within the comment format above.  When present, this parameter overrides the default date/timestamp format defined via {{{config.macros.comment.datefmt}}}.  See the ''Configuration'' section below and in [[CommentPluginInfo]] for additional details.
<<<
!!!!!Configuration
<<<
[[DiscussionPlugin]] can automatically modify the default shadow [[ViewTemplate]] so that all tiddlers will be rendered with two tabs: "Page", and "Discussion".  The "Page" tab displays the regular tiddler content, while the "Discussion" tab displays the summary list of comments as well as an input form to enter new comments.  You can enable/disable this action by setting/clearing the following checkbox:
><<option chkDiscussionTemplate>> Automatically modify default shadow [[ViewTemplate]]
>usage: {{{<<option chkDiscussionTemplate>>}}}
>^^(or place {{{config.options.chkDiscussionTemplate=true;}}} in a tiddler tagged with "systemConfig")^^
Note: //''You must reload your document for changes to this option to take effect.''//  In addition, this option is only applied to the shadow [[ViewTemplate]].  If you are using a custom [[ViewTemplate]], you will need to manually alter that template to add the Page and Discussion tab display (see below)
<<<
!!!!!Using tags to add discussion tabs to individual tiddlers
<<<
When your document is loaded, DiscussionPlugin automatically creates a shadow DiscussionViewTemplate that is copy of the current ViewTemplate, with the discussion tab syntax automatically installed.  If TiddlyTools' TaggedTemplateTweak is also installed in your document then, rather than using the checkbox option to add discussion tabs to //every// tiddler in your document, you can selectively tag individual tiddlers with "discussion" to add the discussion tabs to only those specific tiddlers.

Conversely, if you enable the checkbox option to modify the default ViewTemplate, you can selectively tag individual tiddlers with "noDiscussion" to apply a shadow NoDiscussionViewTemplate that will use an unmodified version of the current ViewTemplate, thereby preventing the discussion tabs from appearing on those specific tiddlers.
<<<
!!!!!Using a customized [[ViewTemplate]]
<<<
To enable the discussion tab display when using a custom [[ViewTemplate]], you should edit that template and change this line:
{{{
<div class='viewer' macro='view text wikified'></div>
}}}
to:
{{{
<div class='viewer' macro='tabs txtDiscussionTab
	Page Page CurrentTiddler Discussion Discussion DiscussionTiddler'></div>
}}}
>[[CurrentTiddler]] and [[DiscussionTiddler]] are special shadow tiddlers defined by the plugin.  [[CurrentTiddler]] enables the {{{<<tabs>>}}} macro used in the [[ViewTemplate]] to display the content for the current tiddler within a tab, while [[DiscussionTiddler]] simply invokes the default {{{<<discussion>>}}} macro without any extra parameters in order to render the corresponding discussion summary list and comment input form.  You can modify the these shadow definitions to add macro parameters or other custom content that will automatically appear in the discussion tab when each tiddler is rendered.
Note: if you are using a custom [[ViewTemplate]], you should also manually create custom versions of DiscussionViewTemplate and NoDiscussionViewTemplate as well, so that you can use the tagging method described above to selectively display discussion tabs for tiddlers that also apply your custom-defined templates.
<<<
!!!!!Plugin customization settings
<<<
To configure the global defaults used by [[DiscussionPlugin]], you can place one or more of the following javascript statements in a tiddler tagged with <<tag systemConfig>>: //(note: the default values for each setting are shown)//
{{{
config.macros.discussion.listfmt="#<<slider [[]] [[%tiddler%]] [[%subject%]] [[posted by %who% on %when%]]>>\n";
}}}
>defines the output format for each item in the discussion summary list, where: %tiddler%=tiddler title of the individual comment tiddler, %subject%=subject text, %who%=username, and %when% is the formatted date/time of the comment.  These values are automatically stored in each comment tiddler by using a //hidden slice table//, so that this information can be easily retrieved when generating the summary list output.
{{{
config.macros.discussion.reverse=false;
}}}
>when set to {{{true}}}, the discussion summary list is displayed in a reverse chronological order.
{{{
config.macros.discussion.titlefmt="_%UTC%%random%";
}}}
>When comments are entered, they are written into separate target tiddlers whose titles are constructed by appending a generated suffix to the title of the tiddler containing the {{{<<discussion>>}}} macro.  By default, this suffix contains the current UTC timestamp (e.g., YYYYMMDD.HHMMSSMMM) plus a randomly generated number (e.g., .123456789) to ensure that all target tiddlers have unique titles while also associating each comment with the specific discussion summary.  The suffix is specified by using //substitution markers//, where: %UTC%=the UTC timestamp, %random%=a random decimal number, %who%=username, and %subject% is the subject text entered into the comment form.
{{{
config.macros.discussion.tags="comment excludeLists";
}}}
>Target tiddlers are automatically tagged with "comment" so that the {{{<<discussion>>}}} macro can locate them when generating the summary list.  To reduce 'information clutter', target tiddlers are also tagged with "excludeLists" so that they don't automatically appear in the list of tiddlers shown in the sidebar tabs.  You can use this setting to specify an optional space-separated list of tags to be added to the target tiddler whenever a comment is written.  You can use a blank value (e.g., {{{""}}} if you do not want to add any extra tags to the target tiddler.  However, as noted above, regardless of the specified tags, target tiddlers will still be tagged with "comment" in order to ensure that the {{{<<discussion>>}}} macro includes them in the summary list.
{{{
config.macros.discussion.commentfmt="^^posted by %who% on %when%^^\n<<<\n%message%\n<<<\n";
}}}
>defines the comment output format to be inserted into the target tiddler, where: %when%=date/timestamp, %who%=username, %subject%=subject, and %message% is the body of the comment.  //Note: if you omit %subject% from the output format, the subject input field on the comment form will be automatically suppressed.  Similarly, omitting %message% from the output format suppresses the message input field.  This can be useful when using the {{{<<comment>>}}} macro to create simple activity logs that only require a short, one-line subject rather than entering extended message content.//
{{{
config.macros.comment.datefmt="DDD, MMM DDth, YYYY at hh12:0mm:0ss am";
}}}
>defines the date/timestamp output used within the comment format above.
<<<
!!!!!Revisions
<<<
2009.01.04 1.5.7 in customized ViewTemplate, corrected 'tabs' macro to avoid error when viewing shadow tiddlers
2008.10.31 1.5.6 added optional 'after' param to countComments() so 'new postings' count can be displayed (using customized DiscussionViewTemplate
2008.10.30 1.5.5 added comment count to discussion tab.  See countComments() function.
2008.05.15 1.5.0 added automatic creation of shadows for DiscussionViewTemplate and NoDiscussionViewTemplate
2008.04.21 1.4.0 replaced use of %n markers with special 'named' markers: %tiddler%, %UTC%, %random%, %who%, %when%, %subject% and %message% to avoid conflict with TW core processing of tiddler content.
2008.04.17 1.3.0 added ability to customize generated 'comment tiddler' titles by using substitution parameters.
2008.04.17 1.2.0 added ability to customize generated 'comment tiddler' titles by using substitution parameters.
2008.04.15 1.1.1 in currentTiddler.handler(), prevent infinite recursion by removing {{{<<currentTiddler>>}}} from content being wikified.
2008.04.15 1.1.0 added parameters for reverse, listformat, tags, commentformat, dateformat
2008.04.14 1.0.0 initial prototype
<<<
$$x_t = x_C + x_{t\_U}$$
$$x_{t+1} = x_C + x_{t+1\_U}$$
*conventional video coding: $x_t$ as ref. frame for $x_{t+1}$, encoder motion est., encode diff. between $x_{t+1}$ and predictor

!!Notes
Key Frame: CS -> GPSR
CS Frame: CS -> use SI as init. cond. -> GPSR
!!!! Abstract
based on Slepian and Wolf's and Wyner and Ziv's infromation-theoretic results
review recent development of practical DVC schemes
~Wyner-Ziv coding enable low-complexity video encoding, computation is shifted to the decoder
Interframe decoder & Interframe encoder
Rate-distortion performance:
# superior to conventional intraframe coding
# a gap relative to conventional motion-compensated interframe coding
~Wyner-Ziv coding 
# natrually robust against transmission errors
# can be used for joint source-channel coding

!!!!Introduction
Sec. II: understanding the foundations of distributed coding and compression techniques that exploit receiver side information
Sec. III: show how video compression with low encoder complexity is enabled by distributed coding
Sec. IV: inherent robustness of distributed coding schemes and then review unequal error protection for video that protects the video waveform (rather than the compressed bit-stream) with a lossy source-channel code

!!!! II. Foundations of Distributed Coding
!!!!! A. ~Slepian-Wolf Theorem for Lossless Distributed Coding
Distributed compression
With separate conventional entropy encoders and decoders: 
* R~~X~~ >= H(X) and R~~Y~~>=H(Y)

!!!!! B.


!!!!III. Low-complexity video encoding
!!!!!A. Pixel-Domain Encoding
For a Wwyner-Ziv frame S, (see [[Towards Practical Wyner-Ziv Coding of Video]])
* each pixel value is uniformly quantized with 2^^M^^ intervals.
** incoporate substractive dithering to avoid contouring and improve  the subjective quality of the reconstructed image
* The SW coder is implemented using a __rate-compatiable punctured turbo code(RCPT)__
** The rate of the RCPT is chosen by the decoder and relayed to the encoder through feedback(see Section III-D)(see [[On the Performance of Hybrid FEC ARQ System Using Rate Compatible Punctured]])
* for each WZ frame, the decoder ''generate the SI'' by __interpolation or extropolation__ of previously decoded key frames and possibly, previously decoded WZ frames
** correlation channel
** Laplacian distribution of the dif. between the individual pixel values
* turbo decoder: combines the SI and received parity bits to recover the symbol stream q'
** request-and-decode
* after the receiver decodes the quantizer index q', it calculates the min-MSE recon. of the orginal frame
** if the SI is within the recon. bin, ---> the recon. pixel will take a value close to the SI value
** if the SI and the decoded quantizer index q' disagree ---> the reconstruction function forces $\hat{S}$ to lie within the bin.
!!!!!Basic idea
$\Psi$ is not fixed and orthnormal basis, but rather an ''adaptive and redundant dictionary'' of signals.
$\Phi$ must be the same in all blocks (low complexity), incoherent with all $\Psi$. (entries draw randomly from a distribution)
!!!!!~CS-based video coding
#divided into non-overlapping square blocks
#vectorizing
#$\Phi$ n x n (not m x n, but then select m msrs is just the same with use m x n $\Phi$)
#quantize the measurements (uniform quantizer)
#store in buffer
#select m quantized msrs from the buffer and sends to decoder (similar to puncture turbo coder)
*Build $\Psi$ (on the decoder side)
**Encoder side needs not to know the $\Psi$
** p x n $\Psi$, whose rows are vectors of a dic.
**dic is a set of p previously decoded blocks
**pick blocks from recently decoded frames whose positions lie in a square window of w x w pixels, centered in pos. of x
@@Probelm: is the $\Phi$ a sparse basis?@@
Different Mode: SKIP mode, SINGLE mode

!!Note
Build $\Psi$ from K-frames
private: http://funny.tiddlyspot.com
public: http://hfang.tiddlyspot.com
GSD: http://hfanggsd.tiddlyspot.com
Tiddlyspace: http://hao.tiddlyspace.com
Blogger: http://hao1990.blogspot.com
!!!Infinite Reroute Bug
* Problem: in error log "infinite route_to reroute throwheader"
* Analysis: 
# cannot find the source file like global/message.cn.js
# no implement of /error page
* Solution:
# Remove or Add corresponding files
# Implement the error index page in protected/controller/ErrorController.php
{{{
<?php
/**
 * ErrorController
 * Feel free to change this and customize your own error message
 *
 * @author darkredz
 */
class ErrorController extends DooController{

    public function index(){
        echo '<h1>ERROR 404 not found</h1>';
        echo '<p>This is handler by an internal Route as defined in common.conf.php $config[\'ERROR_404_ROUTE\']</p>
                
<p>Your error document needs to be more than 512 bytes in length. If not IE will display its default error page.</p>

<p>Give some helpful comments other than 404 :(
Also check out the links page for a list of URLs available in this demo.</p>';
    }
	

}
?>
}}}
and Set corresponding route in protected/config/route.conf.php
{{{
$route['*']['/error'] = array('ErrorController', 'index');
}}}

!!!DOO:db()
to use the db, must enabler PHP_PDO.dll
in php.ini
uncomment (rm the ";")
{{{
;extension=php_pdo_mysql.dll
}}}
otherwise, connect to db would be failed.
!!Chapter 4: Multiple Random Variables
[[Chapter 4: Multiple Random Variables (4-1 to 4-4)]]
[[Chapter 4: Multiple Random Variables (4-5 to 4-6)]]
[[Chapter 4: Multiple Random Variables (4-7 to 4-8)]]
!!Chapter 5: Stochastic Processes
[[Chapter 5: Stochastic Process (5-3)]]
[[Chapter 5: Stochastic Process (5-4)]]
[[Chapter 5: Stochastic Process (5-5)]]
[[Chapter 5: Stochastic Process (5-6)]]
[[Chapter 5: Stochastic Process (5-7)]]
[[Chapter 5: Stochastic Process (5-8)]]
!!Background
[[Dirac delta function δ(t) and Kronecker delta δ(n)]]
[[Unit Step function u(t) & Unit Step Sequence u(n)]]

*Midterm Average: 86

!!Project
[[Project Topic for ECE541]]
[[2011-10-25#Discussion on Topic]]
[[2011-10-28#Proposal Paper]]
[[2011-11-1#Options that can be added in the project proposal]]
[[Turbo Coder]]
[[2011-11-17#Questions for next meeting]]
[[2011-11-18#Group Meeting]]
[[2011-11-19#About Implemented RCPT encoder and decoder]]
[[2011-11-23#Report Outline]]
[[2011-11-24#Figures for DVC]]
[[WZ Frame Encoder Problem]]


!!Course Note
[[Lecture 19 Simulink, Matlab and FDA Tool]]


!!Report
[[Wyner-Ziv Frame Encoder and Decoder]]
[[ECE541: Repport -- Performance Analysis]]
[[2011-12-2#Comparision with papers]]
[[2011-12-3#Abstract and Conclusion]]

!!Remaining problem
According to the paper 'Wyner-Ziv Coding for Video: Applications to Compression and Error Resilience', the zero-rate point corresponds to using the side information as the decoded frame.
So does it means, the only input of the turbo decoder is only side information, with no parity bits.
However, in our scenario, we use zeros sequence to stand for the parity bits.
''The reason may lay in RCPT''. The decoding for punctured turbo code may not insert zero.
We use the standart video sequence foreman_qcif as our test video.
For the key frames, there is no compression but quantization. For the WZ frames, the quantization interval is 32, the generator vector of the convolution encoder in the turbo encoder is $(1, G1/G2) =(1, 1+D+D^2+D^3+D^4/1+D^4)$. The simulation results are shown in Fig. [xxx]. In Fig. [xxx], the quality of side information is approximating the WZ frame. Before using the MMSE reconstruction, we can see there are obviously gradius caused by the quantization. However, after using the MMSE reconstruction, the gradius is reduced sginificantly. The black and white dots result from the decoding error of turbo decoder due to the difference between the side information and exact Wyner-Ziv frame. In general, the reconstruction is acceptable.

In the following analysis, we use 16 as the quantization interval, no punctured turbo code. We also assume a perfect channel.
The PSNR(Peak Signal-to-Noise Ratio) for each frame is shown in Fig. [xxx]. Beacuse the key frames are almost lossless encoded and transmitted, thus the PSNR is relatively higher than the Wyner-Ziv frames. The figure tells us that the PSNR for Wyner-Ziv frame nearly keeps the same for different frames. Thus the pixel-domain distributed video coding is stable for different frames.

The comparision of PSNR for WZ frames before and after using side information is given in Fig. [xxx]. The MMSE reconstruction increase almost 0.5 dB for each frames. 

With different puncture map, we will get different compression ratio. For example, the puncture map is [1 1 1 0 1 0 0 1], that is for every 8 bits, we only transmit 5 bits, thus, the compression ratio is 5/8. As shown in Fig. [xxx], the average PSNR for 10 frames would increase with the compression ratio. This is because with fewer parity bits, the error rate of turbo decoder would increase, thus decreasing the average PSNR.

Meanwhile, we consider an AWGN channel with noisy power $/simga^2=1$. Fig. [xxx] shows the the average PSNR for WZ frame under different compression ratio. The result is quite similar with noiseless channel. Less than 0.5dB for average PSNR is reduced, showing that the Slepian-Wolf codec can resist some noise.

At last, we get the average PSNR under different SNR in Fig. [xxx]. With SNR ranging from 10dB to 30dB, the PSNR level changes less than 0.1dB. This result also proves that the Slepian-Wolf codec is error-resilient.
!!Background
[[sampling function Sa(t)]]
[[Fourier Transform]]
[[CTFT, DTFT, DFT & Fourier Series]]
[[Z transform]]
[[Nyquist Rate v.s. Nyquist Frequency]]
[[Spectral Efficiency]]
[[The Whole Communication System]]

!!Study Project
[[2011-11-26#Related Topics]]
[[2011-11-27#Reading ”认知无线电原理及应用"]]
[[Detecting Primary Receivers for Cognitive Radio Applications]]

!!Design Project
[[Exercise 1: Information conveyed by a discrete Gaussian channel -- WRONG]]
[[Exercise 1: Information conveyed by a discrete Gaussian channel]]
[[Exercise 1: Information conveyed by a discrete Gaussian channel -- d)]]
[[2011-12-3#Bug in max_mutual_info]]
!Around Matrix
[[Matrix Inverse/Least Square Solution]]

这可能是sdk更新不完全造成的,需要重新手动更新一下。
{{{
1、Eclipse--->Window--->Android SDK And AVD Manager(或者直接在Android解压目录底下运行SDK Setup.exe)
2、选择installed packages,在右边列表中选择SDK tools ,点击 update all
等待更新完毕就OK了!
}}}
!!!org.apache.log4j
download log4j.jar
(Or search in MyEclipse folder)
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::EditToolbar]]' >
<span class='toolbar' macro='toolbar previewTiddler'></span>
</div>
<div class='title' macro='view title'></div>
<div class='editor' macro='edit title'></div>
<div macro='annotations'></div>
<div class='editor' macro='edit text'></div>
<div class='editor' macro='edit tags'></div><div class='editorFooter'><span macro='message views.editor.tagPrompt'></span><span macro='tagChooser excludeLists'></span></div>
<span macro='preview hide fieldname 20'></span>

<!--}}}-->
To enabler .htaccess, edit the httpd.conf
>AllowOverride None -> AllowOverride All
{{{
#
# This should be changed to whatever you set DocumentRoot to.
#
#<Directory "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs">
<Directory "C:/www">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
    AllowOverride All

    #
    # Controls who can get stuff from this server.
    #
    Order allow,deny
    Allow from all

</Directory>
}}}
昨天给自己配了一下PHP的环境,弄了有一会。
网上的教程也看了,还是自己写一下,以后可以参考,呵呵。
 
首先要注意的是这个教程有几个前提要求:
1. Windows; Linux下的我没配过,所以不是很清楚。
2. Apache2.2;版本比较重要,不同的版本也有可能是不一样的配法~所以,如果是要配置其他版本的话,请换关键字搜索
3.PHP5.3.3; 同样是版本的问题
 
好了,现在开始配置吧。
1. 首先,先要下Apache2.2。我下的是httpd-2.2.16-win32-x86-no_ssl.msi,安装到C:\Program Files里了
2. 然后,把PHP5.3.3也下下来,注意,要下php-5.3.3-Win32-VC6-x86.zip这个文件,不要有nts,也不要是VC9什么的。我一开始就下错了,然后缺文件之类的- -。
这个就直接解压缩就好了,放在C:\php目录下。(这个目录底下应该就直接是文件了,不是解压得到的文件夹哦)。
 
3. 装好Apache之后,可以打开Apache服务,然后访问localhost一下,看看是不是装好了。基本上这步不会出问题的。
4. 配置PHP。
关键步骤~(我引用了http://www.blogjava.net/zyw090111/archive/2010/08/07/328197.html里面的方法),不过有一些注释的地方是我做错的点。
1) 配置PHP5.3.3,打开php安装目录(C:\php)可以看到目录下有两个这样的文件 php.ini-development和php.ini-production,第一个是开发使用的配置文件,第二个是标准的生产环境的配置。
2)选择php.ini-development复制一份到同目录下,并改名为php.ini使用文本工具打开,查找extension_dir,可以看到两个,选择On windows:
下面的那个并去得前面的分号修改为extension_dir = "C:/php/ext",读者根据自己的目录结构配置,目的是找到和php.ini同目录下的ext文件夹中的扩展库。
*这里一定要注意的是,不要只改了目录,而没有把分号去掉- -分号没去掉这句话是不起作用的。
检测方法是,写一个index.php文件
<? phpinfo()?>放在Apache的访问的文件夹下(可以查看Apache22/conf/httpd.conf,搜索DocumentRoot),默认是Apache22/htdoc这个文件夹。然后访问localhost/index.php,可以看到
!Chrome
add parameter --allow-file-access-from-files
!Firefox
Enter the URL or pathname here: file:///E:/Wiki/funny.html
*should not be undefined
Each activity should be declared in AndroidManifest.xml
And you should note the package name and which package the acitivity class located.
a)
$y_k = \sqrt{SNR}x_k + n_k$
1) for a real constellation, the noise power is $\sigma^2 = 1$, so 
$\begin{align}
p_{Y|X}(y|x) &= p_{Y|X}(\sqrt{{\rm SNR}}x + n|x) \\
&= p_N(y-\sqrt{\rm SNR}x) \\
&= (2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x)^2}\over2\sigma^2}]\\
&=(2\pi)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x)^2}\over2}]
\end{align}
$
2) for a complex constellation, Both real part and imaginary part are Gaussian distribution with noise power $\sigma^2_{\rm Re}=\sigma^2_{\rm Im} = 1/2 = \sigma^2$.
$\begin{align}
p_{Y|X}(y|x) &= p_{Y|X}(\sqrt{\rm SNR}x + n|x) \\
&=p_N(y-\sqrt{\rm SNR}x) \\
&= p_N({\rm Re}\{y\} - \sqrt{\rm SNR}{\rm Re}\{x\}){\times}p_N({\rm Im}\{y\} - \sqrt{\rm SNR}{\rm Im}\{x\}) \\
&= {1\over{\sqrt{2\pi}\sigma_{\rm Re}}}e^{-{({\rm Re}\{y\}-\sqrt{\rm SNR}{\rm Re}\{x\})^2}\over2\sigma^2_{\rm Re}}{\times}{1\over{\sqrt{2\pi}\sigma_{\rm Im}}}e^{-{({\rm Im}\{y\}-\sqrt{\rm SNR}{\rm Im}\{x\})^2}\over2\sigma^2_{\rm Im}}\\
&=(2\pi\sigma^2)^{-1}{\rm exp}[-{({\rm Re}\{y\}-\sqrt{\rm SNR}{\rm Re}\{x\})^2+({\rm Im}\{y\}-\sqrt{\rm SNR}{\rm Im}\{x\})^2)\over2\sigma^2}]\\
&=(2\pi\sigma^2)^{-1}{\rm exp}[-{|y-\sqrt{SNR}x|^2\over2\sigma^2}]\\
&=(2\pi\times{1\over2})^{-1}{\rm exp}[-{|y-\sqrt{SNR}x|^2\over2\times{1\over2}}]\\
&=(\pi)^{-1}{\rm exp}[-|y-\sqrt{SNR}x|^2]
\end{align}
$

b)
1) for a real constellation (e.g. N-AM)
$\begin{align}
I(X;Y) &= {\rm E}_{X; Y}\big(log_2{p_{X,Y}(x,y)\over{p_X(x)p_Y(y)}}\big) \\
&=\sum_{k=0}^{N-1}\int_{-\infty}^{\infty}p_{Y|X}(y|x_k)p_X(x_k)log_2\Big\{{p_{Y|X}(y|x_k)p_X(x_k)\over p_X(x_k)\sum_{i=0}^{N-1}p_X(x_i)p_{Y|X}(y|x_i)}\Big\}dy \\
&=\sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}p_{Y|X}(y|x_k)log_2\Big\{{p_{Y|X}(y|x_k)\over\sum_{i=0}^{N-1}p_X(x_i)p_{Y|X}(y|x_i)}\Big\}dy \\
&= \sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]log_2\Big\{{(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]\over\sum_{i=0}^{N-1}p_X(x_i)(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_i)^2}\over2\sigma^2}]}\Big\} dy\\
&= \sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]\\
&\times\Bigg[log_2\Big\{{(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}}]\Big\} - log_2\Big\{\sum_{i=0}^{N-1}p_X(x_i)(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_i)^2}\over2\sigma^2}]\Big\}\Bigg] dy\\
&= \sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]\Bigg[log_2\Big\{{(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}}]\Big\}\Bigg]dy \\
&-  \sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]\Bigg[log_2\Big\{\sum_{i=0}^{N-1}p_X(x_i)(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_i)^2}\over2\sigma^2}]\Big\}\Bigg] dy\\
&= A - B
\end{align}
$

So 
$A = \sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]\Bigg[{\rm log_2}\Big\{{(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}}]\Big\}\Bigg]dy $
$B =  \sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]\Bigg[{\rm log_2}\Big\{\sum_{i=0}^{N-1}p_X(x_i)(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_i)^2}\over2\sigma^2}]\Big\}\Bigg] dy$
Thus,
$
\begin{align}
A &=  \sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]\Bigg[{\rm log_2}{(2\pi\sigma^2)^{-1/2}+{\rm log_2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}}]\Big\}\Bigg]dy \\
&= \sum_{k=0}^{N-1}p_X(x_k)\Big[{\rm log_2}(2\pi\sigma^2)^{-1/2}\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]dy 
+ \int_{-\infty}^{\infty}\{(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]\}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]{\rm log_2}edy\Big] \\
&= \sum_{k=0}^{N-1}p_X(x_k)\Big[{\rm log_2}(2\pi\sigma^2)^{-1/2} 
+ {\rm log_2}e\int_{-\infty}^{\infty}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}](2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]dy\Big] \\
&= \sum_{k=0}^{N-1}p_X(x_k)\Big[{\rm log_2}(2\pi\sigma^2)^{-1/2} 
+ {\rm log_2}e\int_{-\infty}^{\infty}[{-{(y^2 + {\rm SNR}x_k^2-2\sqrt{\rm SNR}x_ky)}\over2\sigma^2}](2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]dy\Big] \\
&= \sum_{k=0}^{N-1}p_X(x_k)\Big[{\rm log_2}(2\pi\sigma^2)^{-1/2} 
-{1\over2\sigma^ 2}{\rm log_2}e\Big\{\int_{-\infty}^{\infty}y^2(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]dy \\
&+ {\rm SNR}x_k^2\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]dy-2\sqrt{\rm SNR}x_k\int_{-\infty}^{\infty}y(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]dy\Big\}\Big] \\
&=\sum_{k=0}^{N-1}p_X(x_k)\Big[{\rm log_2}(2\pi\sigma^2)^{-1/2} 
-{1\over2\sigma^ 2}{\rm log_2}e\Big\{ (\sigma^2+{\rm SNR}x_k^2) + {\rm SNR}x_k^2-2\sqrt{\rm SNR}x_k\sqrt{{\rm SNR}}x_k\Big\}\Big] \\
&=\sum_{k=0}^{N-1}p_X(x_k)\Big[{\rm log_2}(2\pi\sigma^2)^{-1/2} - {1\over2}{\rm log_2}e\Big] \\
&=\sum_{k=0}^{N-1}p_X(x_k){\rm log_2}(2\pi\sigma^2e)^{-1/2} \\
&={\rm log_2}(2\pi\sigma^2e)^{-1/2} \\

\end{align}
$


$
\begin{align}
B &=  \sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]
\Bigg[{\rm log_2}\Big\{\sum_{i=0}^{N-1}p_X(x_i)(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_i)^2}\over2\sigma^2}]\Big\}\Bigg] dy \\
&= \sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]
\Bigg[{\rm log_2}\Big\{(2\pi\sigma^2)^{-1/2}\sum_{i=0}^{N-1}p_X(x_i){\rm exp}[{-{(y-\sqrt{\rm SNR}x_i)^2}\over2\sigma^2}]\Big\}\Bigg] dy \\
&= \sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]\Bigg[{\rm log_2}
\Big\{(2\pi\sigma^2)^{-1/2}\sum_{i=0}^{N-1}p_X(x_i){\rm exp}[{-{(y-\sqrt{\rm SNR}x_i)^2}\over2\sigma^2}]\Big\}\Bigg] dy \\
&= \sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]\Bigg[
{\rm log_2}(2\pi\sigma^2)^{-1/2}+
{\rm log_2}\sum_{i=0}^{N-1}p_X(x_i){\rm exp}[{-{(y-\sqrt{\rm SNR}x_i)^2}\over2\sigma^2}]\Big\}\Bigg] dy \\
&= \sum_{k=0}^{N-1}p_X(x_k)\Bigg[
{\rm log_2}(2\pi\sigma^2)^{-1/2}\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]dy \\ 
&+ \int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]{\rm log_2}\sum_{i=0}^{N-1}p_X(x_i){\rm exp}[{-{(y-\sqrt{\rm SNR}x_i)^2}\over2\sigma^2}]\Bigg]  \\
&= \sum_{k=0}^{N-1}p_X(x_k)\Bigg[
{\rm log_2}(2\pi\sigma^2)^{-1/2} + \int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[-{{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]{\rm log_2}\sum_{i=0}^{N-1}p_X(x_i){\rm exp}(-{{(y-\sqrt{\rm SNR}x_i)^2}\over2\sigma^2}]dy\Bigg]  \\
&={\rm log_2}(2\pi\sigma^2)^{-1/2} +\sum_{k=0}^{N-1}p_X(x_k) \Bigg[
 \int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[-{{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]{\rm log_2}\sum_{i=0}^{N-1}p_X(x_i){\rm exp}(-{{(y-\sqrt{\rm SNR}x_i)^2}\over2\sigma^2})dy\Bigg]  \\
\end{align}
$

Thus,
$
\begin{align}
I(X; Y) &= A - B \\
&={\rm log_2}(2\pi\sigma^2e)^{-1/2} -  {\rm log_2}(2\pi\sigma^2)^{-1/2} - \sum_{k=0}^{N-1}p_X(x_k) \Bigg[
 \int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[-{{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]{\rm log_2}\sum_{i=0}^{N-1}p_X(x_i){\rm exp}(-{{(y-\sqrt{\rm SNR}x_i)^2}\over2\sigma^2})dy\Bigg]  \\
&= {\rm log_2}e^{-1/2}- \sum_{k=0}^{N-1}p_X(x_k) \Bigg[
 \int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[-{{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]{\rm log_2}\sum_{i=0}^{N-1}p_X(x_i){\rm exp}(-{{(y-\sqrt{\rm SNR}x_i)^2}\over2\sigma^2})dy\Bigg]  \\
\end{align}
$

2) for a complex constellation (e.g. N-QAM)
$\begin{align}
I(X;Y) &= {\rm E}(X; Y)\big({\rm log_2}{p_{X,Y}(x,y)\over{p_X(x)p_Y(y)}}\big) \\
&=\sum_{k=0}^{N-1}\int_{-\infty}^{\infty}p_{Y|X}(y|x_k)p_X(x_k){\rm log_2}\Big\{{p_{Y|X}(y|x_k)p_X(x_k)\over p_X(x_k)\sum_{i=0}^{N-1}p_X(x_i)p_{Y|X}(y|x_i)}\Big\}dy \\
&=\sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}p_{Y|X}(y|x_k){\rm log_2}\Big\{{p_{Y|X}(y|x_k)\over\sum_{i=0}^{N-1}p_X(x_i)p_{Y|X}(y|x_i)}\Big\}dy \\
&= \sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[-{{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]{\rm log_2}\Big\{{(2\pi\sigma^2)^{-1}{\rm exp}[-{{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]\over\sum_{i=0}^{N-1}p_X(x_i)(2\pi\sigma^2)^{-1}{\rm exp}[-{{|y-\sqrt{\rm SNR}x_i|^2}\over2\sigma^2}]}\Big\} dy\\
&= \sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]\\
&\times\Bigg[{\rm log_2}\Big\{{(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}}]\Big\} - {\rm log_2}\Big\{\sum_{i=0}^{N-1}p_X(x_i)(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_i|^2}\over2\sigma^2}]\Big\}\Bigg] dy\\
&= \sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]\Bigg[{\rm log_2}\Big\{{(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}}]\Big\}\Bigg]dy \\
&-  \sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]\Bigg[{\rm log_2}\Big\{\sum_{i=0}^{N-1}p_X(x_i)(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_i|^2}\over2\sigma^2}]\Big\}\Bigg] dy\\
&= A - B
\end{align}
$



So 
$A = \sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]\Bigg[{\rm log_2}\Big\{{(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}}]\Big\}\Bigg]dy $
$B =  \sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]\Bigg[{\rm log_2}\Big\{\sum_{i=0}^{N-1}p_X(x_i)(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_i|^2}\over2\sigma^2}]\Big\}\Bigg] dy$
Thus,
$
\begin{align}
A &=  \sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]\Bigg[{\rm log_2}{(2\pi\sigma^2)^{-1}+{\rm log_2}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}}]\Big\}\Bigg]dy \\
&= \sum_{k=0}^{N-1}p_X(x_k)\Big[{\rm log_2}(2\pi\sigma^2)^{-1}\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]dy 
+ \int_{-\infty}^{\infty}\{(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]\}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]{\rm log_2}edy\Big] \\
&= \sum_{k=0}^{N-1}p_X(x_k)\Big[{\rm log_2}(2\pi\sigma^2)^{-1} 
+ {\rm log_2}e\int_{-\infty}^{\infty}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}](2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]dy\Big] \\
&= \sum_{k=0}^{N-1}p_X(x_k)\Big[{\rm log_2}(2\pi\sigma^2)^{-1} 
+ {\rm log_2}e\int_{-\infty}^{\infty}[{-{(|y|^2 + {\rm SNR}|x_k|^2-\sqrt{\rm SNR}x_ky^* - \sqrt{\rm SNR}x_k^*y)}\over2\sigma^2}](2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]dy\Big] \\
&= \sum_{k=0}^{N-1}p_X(x_k)\Big[{\rm log_2}(2\pi\sigma^2)^{-1} 
-{1\over2\sigma^ 2}{\rm log_2}e\Big\{\int_{-\infty}^{\infty}|y|^2(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]dy \\
&+ {\rm SNR}|x_k|^2\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]dy \\
&-\sqrt{\rm SNR}x_k\int_{-\infty}^{\infty}y^*(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]dy\\
&-\sqrt{\rm SNR}x_k^*\int_{-\infty}^{\infty}y(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]dy\Big\}\Big] \\
&=\sum_{k=0}^{N-1}p_X(x_k)\Big[{\rm log_2}(2\pi\sigma^2)^{-1} 
-{1\over2\sigma^ 2}{\rm log_2}e\Big\{ (2\sigma^2+{\rm SNR}|x_k|^2) + {\rm SNR}|x_k|^2-\sqrt{\rm SNR}x_k\sqrt{{\rm SNR}}x_k^*-\sqrt{\rm SNR}x_k^*\sqrt{{\rm SNR}}x_k\Big\}\Big] \\
&=\sum_{k=0}^{N-1}p_X(x_k)\Big[{\rm log_2}(2\pi\sigma^2)^{-1} 
-{1\over2\sigma^2}{\rm log_2}e\Big\{ (2\sigma^2+{\rm SNR}|x_k|^2) + {\rm SNR}|x_k|^2-2\sqrt{\rm SNR}|x_k|^2\Big\}\Big] \\
&=\sum_{k=0}^{N-1}p_X(x_k)\Big[{\rm log_2}(2\pi\sigma^2)^{-1} - {\rm log_2}e\Big] \\
&=\sum_{k=0}^{N-1}p_X(x_k){\rm log_2}(2\pi\sigma^2e)^{-1} \\
&={\rm log_2}(2\pi\sigma^2e)^{-1} \\
\end{align}
$


$
\begin{align}
B &=  \sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]
\Bigg[{\rm log_2}\Big\{\sum_{i=0}^{N-1}p_X(x_i)(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_i|^2}\over2\sigma^2}]\Big\}\Bigg] dy \\
&= \sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]
\Bigg[{\rm log_2}\Big\{(2\pi\sigma^2)^{-1}\sum_{i=0}^{N-1}p_X(x_i){\rm exp}[{-{|y-\sqrt{\rm SNR}x_i|^2}\over2\sigma^2}]\Big\}\Bigg] dy \\
&= \sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]\Bigg[
{\rm log_2}(2\pi\sigma^2)^{-1}+
{\rm log_2}\sum_{i=0}^{N-1}p_X(x_i){\rm exp}[{-{|y-\sqrt{\rm SNR}x_i|^2}\over2\sigma^2}]\Bigg] dy \\
&= \sum_{k=0}^{N-1}p_X(x_k)\Bigg[
{\rm log_2}(2\pi\sigma^2)^{-1}\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]dy \\
&+ \int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]{\rm log_2}\sum_{i=0}^{N-1}p_X(x_i){\rm exp}[{-{|y-\sqrt{\rm SNR}x_i|^2}\over2\sigma^2}]dy\Bigg]  \\
&= \sum_{k=0}^{N-1}p_X(x_k)\Bigg[
{\rm log_2}(2\pi\sigma^2)^{-1} + \int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]{\rm log_2}\sum_{i=0}^{N-1}p_X(x_i){\rm exp}[{-{|y-\sqrt{\rm SNR}x_i|^2}\over2\sigma^2}]dy\Bigg]  \\
&= {\rm log_2}(2\pi\sigma^2)^{-1} + \sum_{k=0}^{N-1}p_X(x_k)\Bigg[
\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]{\rm log_2}\sum_{i=0}^{N-1}p_X(x_i){\rm exp}[{-{|y-\sqrt{\rm SNR}x_i|^2}\over2\sigma^2}]dy\Bigg]  \\
\end{align}
$

Thus,
$
\begin{align}
I(X; Y) &= A - B \\
&={\rm log_2}(2\pi\sigma^2e)^{-1} - {\rm log_2}(2\pi\sigma^2)^{-1} - \sum_{k=0}^{N-1}p_X(x_k)\Bigg[
\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]{\rm log_2}\sum_{i=0}^{N-1}p_X(x_i){\rm exp}[{-{|y-\sqrt{\rm SNR}x_i|^2}\over2\sigma^2}]dy\Bigg]  \\
&={\rm log_2}e^{-1} - \sum_{k=0}^{N-1}p_X(x_k)\Bigg[
\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]{\rm log_2}\sum_{i=0}^{N-1}p_X(x_i){\rm exp}[{-{|y-\sqrt{\rm SNR}x_i|^2}\over2\sigma^2}]dy\Bigg]  \\
\end{align}
$

c) 
1) for a real constellation
$
\begin{align}
I(X; Y) &= {\rm log_2}e^{-1/2} - \sum_{k=0}^{N-1}p_X(x_k) \Bigg[
 \int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[-{{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]{\rm log_2}\sum_{i=0}^{N-1}p_X(x_i){\rm exp}(-{{(y-\sqrt{\rm SNR}x_i)^2}\over2\sigma^2})dy\Bigg] \\
&= {\rm log_2}e^{-1/2}  - \sum_{k=0}^{N-1}{1\over N} \Bigg[
 \int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[-{{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]{\rm log_2}\sum_{i=0}^{N-1}{1\over N}{\rm exp}(-{{(y-\sqrt{\rm SNR}x_i)^2}\over2\sigma^2})dy\Bigg] \\
&= {\rm log_2}e^{-1/2}  - \sum_{k=0}^{N-1}{1\over N} \Bigg[
 \int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[-{{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}][{\rm log_2}{1\over N} + {\rm log_2}\sum_{i=0}^{N-1}{\rm exp}(-{{(y-\sqrt{\rm SNR}x_i)^2}\over2\sigma^2})dy]\Bigg] \\
&= {\rm log_2}e^{-1/2}  - \sum_{k=0}^{N-1}{1\over N} \Bigg[
 {\rm log_2}{1\over N}\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[-{{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]dy \\
&+ \int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[-{{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]{\rm log_2}\sum_{i=0}^{N-1}{\rm exp}(-{{(y-\sqrt{\rm SNR}x_i)^2}\over2\sigma^2})dy\Bigg] \\
&= {\rm log_2}e^{-1/2}  - \sum_{k=0}^{N-1}{1\over N} \Bigg[
 {\rm log_2}{1\over N} + \int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[-{{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]{\rm log_2}\sum_{i=0}^{N-1}{\rm exp}(-{{(y-\sqrt{\rm SNR}x_i)^2}\over2\sigma^2})dy\Bigg] \\
&= {\rm log_2}e^{-1/2} + {\rm log_2}N - {1\over N}\sum_{k=0}^{N-1}\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[-{{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]{\rm log_2}\sum_{i=0}^{N-1}{\rm exp}(-{{(y-\sqrt{\rm SNR}x_i)^2}\over2\sigma^2})dy\\
&= {\rm log_2}e^{-1/2} + {\rm log_2}N - {1\over N}\sum_{k=0}^{N-1}\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[-{{n^2}\over2\sigma^2}]{\rm log_2}\sum_{i=0}^{N-1}{\rm exp}(-{{(n + \sqrt{\rm SNR}x_k -\sqrt{\rm SNR}x_i)^2}\over2\sigma^2})dy\\
&= {\rm log_2}e^{-1/2} + {\rm log_2}N - {1\over N}\sum_{k=0}^{N-1}E_n({\rm log_2}\sum_{i=0}^{N-1}{\rm exp}(-{{(n + \sqrt{\rm SNR}x_k -\sqrt{\rm SNR}x_i)^2}\over2\sigma^2})dy \\
\end{align}
$

2) for a complex constellation
$
\begin{align}
I(X; Y)
&={\rm log_2}e^{-1}  - \sum_{k=0}^{N-1}p_X(x_k)\Bigg[
\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]{\rm log_2}\sum_{i=0}^{N-1}p_X(x_i){\rm exp}[{-{|y-\sqrt{\rm SNR}x_i|^2}\over2\sigma^2}]dy\Bigg]  \\
&={\rm log_2}e^{-1}  - \sum_{k=0}^{N-1}{1\over N}\Bigg[
\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]{\rm log_2}\sum_{i=0}^{N-1}{1\over N}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_i|^2}\over2\sigma^2}]dy\Bigg]  \\
&={\rm log_2}e^{-1}  - \sum_{k=0}^{N-1}{1\over N}\Bigg[
\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]
\{{\rm log_2}{1\over N} + {\rm log_2}\sum_{i=0}^{N-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_i|^2}\over2\sigma^2}]\}dy\Bigg]  \\
&={\rm log_2}e^{-1}  - \sum_{k=0}^{N-1}{1\over N}\Bigg[
{\rm log_2}{1\over N}\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]dy \\
&+ \int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]{\rm log_2}\sum_{i=0}^{N-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_i|^2}\over2\sigma^2}]dy\Bigg]  \\
&={\rm log_2}e^{-1}  - \sum_{k=0}^{N-1}{1\over N}\Bigg[
{\rm log_2}{1\over N}+ \int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|n|^2}\over2\sigma^2}]{\rm log_2}\sum_{i=0}^{N-1}{\rm exp}[{-{|n+\sqrt{\rm SNR}x_k-\sqrt{\rm SNR}x_i|^2}\over2\sigma^2}]dy\Bigg]  \\
&={\rm log_2}e^{-1}  - {\rm log_2}{1\over N}
- {1\over N}\sum_{k=0}^{N-1}E_n({\rm log_2}\sum_{i=0}^{N-1}{\rm exp}[{-{|n+\sqrt{\rm SNR}x_k-\sqrt{\rm SNR}x_i|^2}\over2\sigma^2}] \\
&={\rm log_2}e^{-1} + {\rm log_2}N
- {1\over N}\sum_{k=0}^{N-1}E_n({\rm log_2}\sum_{i=0}^{N-1}{\rm exp}[{-{|n+\sqrt{\rm SNR}x_k-\sqrt{\rm SNR}x_i|^2}\over2\sigma^2}] \\
\end{align}
$



a)
$y_k = \sqrt{SNR}x_k + n_k$
1) for a real constellation, the noise power is $\sigma^2 = 1$, so (@@noise power is 1 or 1/2?@@)
$\begin{align}
p_{Y|X}(y|x) &= p_{Y|X}(\sqrt{{\rm SNR}}x + n|x) \\
&= p_N(y-\sqrt{\rm SNR}x) \\
&= (2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x)^2}\over2\sigma^2}]\\
&=(2\pi)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x)^2}\over2}]
\end{align}
$
2) for a complex constellation, Both real part and imaginary part are Gaussian distribution with noise power $\sigma^2_{\rm Re}=\sigma^2_{\rm Im} = 1/2 = \sigma^2$.
$\begin{align}
p_{Y|X}(y|x) &= p_{Y|X}(\sqrt{\rm SNR}x + n|x) \\
&=p_N(y-\sqrt{\rm SNR}x) \\
&= p_N({\rm Re}\{y\} - \sqrt{\rm SNR}{\rm Re}\{x\}){\times}p_N({\rm Im}\{y\} - \sqrt{\rm SNR}{\rm Im}\{x\}) \\
&= {1\over{\sqrt{2\pi}\sigma_{\rm Re}}}e^{-{({\rm Re}\{y\}-\sqrt{\rm SNR}{\rm Re}\{x\})^2}\over2\sigma^2_{\rm Re}}{\times}{1\over{\sqrt{2\pi}\sigma_{\rm Im}}}e^{-{({\rm Im}\{y\}-\sqrt{\rm SNR}{\rm Im}\{x\})^2}\over2\sigma^2_{\rm Im}}\\
&=(2\pi\sigma^2)^{-1}{\rm exp}[-{({\rm Re}\{y\}-\sqrt{\rm SNR}{\rm Re}\{x\})^2-({\rm Im}\{y\}-\sqrt{\rm SNR}{\rm Im}\{x\})^2)\over2\sigma^2}]\\
&=(2\pi\sigma^2)^{-1}{\rm exp}[-{|y-\sqrt{SNR}x|^2\over2\sigma^2}]\\
&=(2\pi\times{1\over2})^{-1}{\rm exp}[-{|y-\sqrt{SNR}x|^2\over2\times{1\over2}}]\\
&=(\pi)^{-1}{\rm exp}[-|y-\sqrt{SNR}x|^2]
\end{align}
$

b)
1) for a real constellation (e.g. N-AM)
$\begin{align}
I(X;Y) &= {\rm E}_{X; Y}\big(log_2{p_{X,Y}(x,y)\over{p_X(x)p_Y(y)}}\big) \\
&=\sum_{k=0}^{N-1}\int_{-\infty}^{\infty}p_{Y|X}(y|x_k)p_X(x_k)log_2\Big\{{p_{Y|X}(y|x_k)p_X(x_k)\over p_X(x_k)\sum_{i=0}^{N-1}p_X(x_i)p_{Y|X}(y|x_i)}\Big\}dy \\
&=\sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}p_{Y|X}(y|x_k)log_2\Big\{{p_{Y|X}(y|x_k)\over\sum_{i=0}^{N-1}p_X(x_i)p_{Y|X}(y|x_i)}\Big\}dy \\
&= \sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]log_2\Big\{{(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]\over\sum_{i=0}^{N-1}p_X(x_i)(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_i)^2}\over2\sigma^2}]}\Big\} dy\\
&= \sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]\\
&\times\Bigg[log_2\Big\{{(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}}]\Big\} - log_2\Big\{\sum_{i=0}^{N-1}p_X(x_i)(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_i)^2}\over2\sigma^2}]\Big\}\Bigg] dy\\
&= \sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]\Bigg[log_2\Big\{{(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}}]\Big\}\Bigg]dy \\
&-  \sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]\Bigg[log_2\Big\{\sum_{i=0}^{N-1}p_X(x_i)(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_i)^2}\over2\sigma^2}]\Big\}\Bigg] dy\\
&= A - B
\end{align}
$

So 
$A = \sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]\Bigg[{\rm log_2}\Big\{{(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}}]\Big\}\Bigg]dy $
$B =  \sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]\Bigg[{\rm log_2}\Big\{\sum_{i=0}^{N-1}p_X(x_i)(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_i)^2}\over2\sigma^2}]\Big\}\Bigg] dy$
Thus,
$
\begin{align}
A &=  \sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]\Bigg[{\rm log_2}{(2\pi\sigma^2)^{-1/2}+{\rm log_2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}}]\Big\}\Bigg]dy \\
&= \sum_{k=0}^{N-1}p_X(x_k)\Big[{\rm log_2}(2\pi\sigma^2)^{-1/2}\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]dy 
+ \int_{-\infty}^{\infty}\{(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]\}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]{\rm log_2}edy\Big] \\
&= \sum_{k=0}^{N-1}p_X(x_k)\Big[{\rm log_2}(2\pi\sigma^2)^{-1/2} 
+ {\rm log_2}e\int_{-\infty}^{\infty}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}](2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]dy\Big] \\
&= \sum_{k=0}^{N-1}p_X(x_k)\Big[{\rm log_2}(2\pi\sigma^2)^{-1/2} 
+ {\rm log_2}e\int_{-\infty}^{\infty}[{-{(y^2 + {\rm SNR}x_k^2-2\sqrt{\rm SNR}x_ky)}\over2\sigma^2}](2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]dy\Big] \\
&= \sum_{k=0}^{N-1}p_X(x_k)\Big[{\rm log_2}(2\pi\sigma^2)^{-1/2} 
-{1\over2\sigma^ 2}{\rm log_2}e\Big\{\int_{-\infty}^{\infty}y^2(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]dy \\
&+ {\rm SNR}x_k^2\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]dy-2\sqrt{\rm SNR}x_k\int_{-\infty}^{\infty}y(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]dy\Big\}\Big] \\
&=\sum_{k=0}^{N-1}p_X(x_k)\Big[{\rm log_2}(2\pi\sigma^2)^{-1/2} 
-{1\over2\sigma^ 2}{\rm log_2}e\Big\{ (\sigma^2+{\rm SNR}x_k^2) + {\rm SNR}x_k^2-2\sqrt{\rm SNR}x_k\sqrt{{\rm SNR}}x_k\Big\}\Big] \\
&=\sum_{k=0}^{N-1}p_X(x_k)\Big[{\rm log_2}(2\pi\sigma^2)^{-1/2} - {1\over2}{\rm log_2}e\Big] \\
&=\sum_{k=0}^{N-1}p_X(x_k){\rm log_2}(2\pi\sigma^2e)^{-1/2} \\
&={\rm log_2}(2\pi\sigma^2e)^{-1/2} \\

\end{align}
$

$
\begin{align}
B &=  \sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]
\Bigg[{\rm log_2}\Big\{\sum_{i=0}^{N-1}p_X(x_i)(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_i)^2}\over2\sigma^2}]\Big\}\Bigg] dy \\
&= \sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]
\Bigg[{\rm log_2}\Big\{(2\pi\sigma^2)^{-1/2}\sum_{i=0}^{N-1}p_X(x_i){\rm exp}(-{{y^2}\over2\sigma^2}){\rm exp}(-{{\rm SNR}x_i^2\over2\sigma^2}){\rm exp}({2\sqrt{{\rm SNR}}x_iy\over2\sigma^2})\Big\}\Bigg] dy \\
&= \sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]\Bigg[{\rm log_2}
\Big\{(2\pi\sigma^2)^{-1/2}{\rm exp}(-{{y^2}\over2\sigma^2})\sum_{i=0}^{N-1}p_X(x_i){\rm exp}(-{{\rm SNR}x_i^2-2\sqrt{{\rm SNR}}x_iy\over2\sigma^2})\Big\}\Bigg] dy \\
&= \sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]\Bigg[
{\rm log_2}(2\pi\sigma^2)^{-1/2}+
{\rm log_2}{\rm exp}(-{{y^2}\over2\sigma^2}) +
{\rm log_2}\sum_{i=0}^{N-1}p_X(x_i){\rm exp}(-{{\rm SNR}x_i^2-2\sqrt{{\rm SNR}}x_iy\over2\sigma^2})\Bigg] dy \\
&= \sum_{k=0}^{N-1}p_X(x_k)\Bigg[
{\rm log_2}(2\pi\sigma^2)^{-1/2}\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]dy \\
&+ {{\rm log_2}e\over2\sigma^2}\int_{-\infty}^{\infty}(-y^2)(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]dy 
+ \int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]{\rm log_2}\sum_{i=0}^{N-1}p_X(x_i){\rm exp}(-{{\rm SNR}x_i^2-2\sqrt{{\rm SNR}}x_iy\over2\sigma^2})dy\Bigg]  \\
&= \sum_{k=0}^{N-1}p_X(x_k)\Bigg[
{\rm log_2}(2\pi\sigma^2)^{-1/2} - {{\rm log_2}e\over2\sigma^2}(\sigma^2+{\rm SNR}x_k^2) + \int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]{\rm log_2}\sum_{i=0}^{N-1}p_X(x_i){\rm exp}(-{{\rm SNR}x_i^2-2\sqrt{{\rm SNR}}x_iy\over2\sigma^2})dy\Bigg]  \\
&= \sum_{k=0}^{N-1}p_X(x_k)\Bigg[
{\rm log_2}(2\pi\sigma^2)^{-1/2} - {{\rm log_2}e\over2}-{{\rm SNR}{\rm log_2}e\over2\sigma^2}x_k^2 + \int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]{\rm log_2}\sum_{i=0}^{N-1}p_X(x_i){\rm exp}(-{{\rm SNR}x_i^2-2\sqrt{{\rm SNR}}x_iy\over2\sigma^2})dy\Bigg]  \\
&={\rm log_2}(2\pi\sigma^2e)^{-1/2} -{{\rm SNR}{\rm log_2}e\over2\sigma^2}\sum_{k=0}^{N-1}p_X(x_k)x_k^2 +\sum_{k=0}^{N-1}p_X(x_k) \Bigg[
 \int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]{\rm log_2}\sum_{i=0}^{N-1}p_X(x_i){\rm exp}(-{{\rm SNR}x_i^2-2\sqrt{{\rm SNR}}x_iy\over2\sigma^2})dy\Bigg]  \\
&={\rm log_2}(2\pi\sigma^2e)^{-1/2} -{{\rm SNR}{\rm log_2}e\over2\sigma^2} +\sum_{k=0}^{N-1}p_X(x_k) \Bigg[
 \int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]{\rm log_2}\sum_{i=0}^{N-1}p_X(x_i){\rm exp}(-{{\rm SNR}x_i^2-2\sqrt{{\rm SNR}}x_iy\over2\sigma^2})dy\Bigg]  \\
\end{align}
$

Thus,
$
\begin{align}
I(X; Y) &= A - B \\
&={\rm log_2}(2\pi\sigma^2e)^{-1/2} -  {\rm log_2}(2\pi\sigma^2e)^{-1/2} +{{\rm SNR}{\rm log_2}e\over2\sigma^2} -\sum_{k=0}^{N-1}p_X(x_k) \Bigg[
 \int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]{\rm log_2}\sum_{i=0}^{N-1}p_X(x_i){\rm exp}(-{{\rm SNR}x_i^2-2\sqrt{{\rm SNR}}x_iy\over2\sigma^2})dy\Bigg]  \\
&= {{\rm SNR}{\rm log_2}e\over2\sigma^2} -\sum_{k=0}^{N-1}p_X(x_k) \Bigg[
 \int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]{\rm log_2}\sum_{i=0}^{N-1}p_X(x_i){\rm exp}(-{{\rm SNR}x_i^2-2\sqrt{{\rm SNR}}x_iy\over2\sigma^2})dy\Bigg]  \\
\end{align}
$

2) for a complex constellation (e.g. N-QAM)
$\begin{align}
I(X;Y) &= {\rm E}(X; Y)\big({\rm log_2}{p_{X,Y}(x,y)\over{p_X(x)p_Y(y)}}\big) \\
&=\sum_{k=0}^{N-1}\int_{-\infty}^{\infty}p_{Y|X}(y|x_k)p_X(x_k){\rm log_2}\Big\{{p_{Y|X}(y|x_k)p_X(x_k)\over p_X(x_k)\sum_{i=0}^{N-1}p_X(x_i)p_{Y|X}(y|x_i)}\Big\}dy \\
&=\sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}p_{Y|X}(y|x_k){\rm log_2}\Big\{{p_{Y|X}(y|x_k)\over\sum_{i=0}^{N-1}p_X(x_i)p_{Y|X}(y|x_i)}\Big\}dy \\
&= \sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[-{{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]{\rm log_2}\Big\{{(2\pi\sigma^2)^{-1}{\rm exp}[-{{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]\over\sum_{i=0}^{N-1}p_X(x_i)(2\pi\sigma^2)^{-1}{\rm exp}[-{{|y-\sqrt{\rm SNR}x_i|^2}\over2\sigma^2}]}\Big\} dy\\
&= \sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]\\
&\times\Bigg[{\rm log_2}\Big\{{(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}}]\Big\} - {\rm log_2}\Big\{\sum_{i=0}^{N-1}p_X(x_i)(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_i|^2}\over2\sigma^2}]\Big\}\Bigg] dy\\
&= \sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]\Bigg[{\rm log_2}\Big\{{(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}}]\Big\}\Bigg]dy \\
&-  \sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]\Bigg[{\rm log_2}\Big\{\sum_{i=0}^{N-1}p_X(x_i)(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_i|^2}\over2\sigma^2}]\Big\}\Bigg] dy\\
&= A - B
\end{align}
$



So 
$A = \sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]\Bigg[{\rm log_2}\Big\{{(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}}]\Big\}\Bigg]dy $
$B =  \sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]\Bigg[{\rm log_2}\Big\{\sum_{i=0}^{N-1}p_X(x_i)(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_i|^2}\over2\sigma^2}]\Big\}\Bigg] dy$
Thus,
$
\begin{align}
A &=  \sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]\Bigg[{\rm log_2}{(2\pi\sigma^2)^{-1}+{\rm log_2}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}}]\Big\}\Bigg]dy \\
&= \sum_{k=0}^{N-1}p_X(x_k)\Big[{\rm log_2}(2\pi\sigma^2)^{-1}\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]dy 
+ \int_{-\infty}^{\infty}\{(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]\}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]{\rm log_2}edy\Big] \\
&= \sum_{k=0}^{N-1}p_X(x_k)\Big[{\rm log_2}(2\pi\sigma^2)^{-1} 
+ {\rm log_2}e\int_{-\infty}^{\infty}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}](2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]dy\Big] \\
&= \sum_{k=0}^{N-1}p_X(x_k)\Big[{\rm log_2}(2\pi\sigma^2)^{-1} 
+ {\rm log_2}e\int_{-\infty}^{\infty}[{-{(|y|^2 + {\rm SNR}|x_k|^2-\sqrt{\rm SNR}x_ky^* - \sqrt{\rm SNR}x_k^*y)}\over2\sigma^2}](2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]dy\Big] \\
&= \sum_{k=0}^{N-1}p_X(x_k)\Big[{\rm log_2}(2\pi\sigma^2)^{-1} 
-{1\over2\sigma^ 2}{\rm log_2}e\Big\{\int_{-\infty}^{\infty}|y|^2(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]dy \\
&+ {\rm SNR}|x_k|^2\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]dy \\
&-\sqrt{\rm SNR}x_k\int_{-\infty}^{\infty}y^*(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]dy\\
&-\sqrt{\rm SNR}x_k^*\int_{-\infty}^{\infty}y(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]dy\Big\}\Big] \\
&=\sum_{k=0}^{N-1}p_X(x_k)\Big[{\rm log_2}(2\pi\sigma^2)^{-1} 
-{1\over2\sigma^ 2}{\rm log_2}e\Big\{ (\sigma^2+{\rm SNR}|x_k|^2) + {\rm SNR}|x_k|^2-\sqrt{\rm SNR}x_k\sqrt{{\rm SNR}}x_k^*-\sqrt{\rm SNR}x_k^*\sqrt{{\rm SNR}}x_k\Big\}\Big] \\
&=\sum_{k=0}^{N-1}p_X(x_k)\Big[{\rm log_2}(2\pi\sigma^2)^{-1} 
-{1\over2\sigma^ 2}{\rm log_2}e\Big\{ (\sigma^2+{\rm SNR}|x_k|^2) + {\rm SNR}|x_k|^2-2\sqrt{\rm SNR}|x_k|^2\Big\}\Big] \\
&=\sum_{k=0}^{N-1}p_X(x_k)\Big[{\rm log_2}(2\pi\sigma^2)^{-1} - {1\over2}{\rm log_2}e\Big] \\
&=\sum_{k=0}^{N-1}p_X(x_k){\rm log_2}(2\pi\sigma^2e^{1/2})^{-1} \\
&={\rm log_2}(2\pi\sigma^2e^{1/2})^{-1} \\
\end{align}
$


$
\begin{align}
B &=  \sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]
\Bigg[{\rm log_2}\Big\{\sum_{i=0}^{N-1}p_X(x_i)(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_i|^2}\over2\sigma^2}]\Big\}\Bigg] dy \\
&= \sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]
\Bigg[{\rm log_2}\Big\{(2\pi\sigma^2)^{-1}\sum_{i=0}^{N-1}p_X(x_i){\rm exp}(-{{|y|^2}\over2\sigma^2}){\rm exp}(-{{\rm SNR}|x_i|^2\over2\sigma^2}){\rm exp}({\sqrt{{\rm SNR}}x_iy^*+\sqrt{{\rm SNR}}x_i^*y\over2\sigma^2})\Big\}\Bigg] dy \\
&= \sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]\Bigg[{\rm log_2}
\Big\{(2\pi\sigma^2)^{-1}{\rm exp}(-{|y|^2\over2\sigma^2})\sum_{i=0}^{N-1}p_X(x_i){\rm exp}(-{{\rm SNR}|x_i|^2-\sqrt{{\rm SNR}}x_iy^*-\sqrt{{\rm SNR}}x_i^*y\over2\sigma^2})\Big\}\Bigg] dy \\
&= \sum_{k=0}^{N-1}p_X(x_k)\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]\Bigg[
{\rm log_2}(2\pi\sigma^2)^{-1}+
{\rm log_2}{\rm exp}(-{|y|^2\over2\sigma^2}) +
{\rm log_2}\sum_{i=0}^{N-1}p_X(x_i){\rm exp}(-{{\rm SNR}|x_i|^2-\sqrt{{\rm SNR}}x_iy^*-\sqrt{{\rm SNR}}x_i^*y\over2\sigma^2})\Bigg] dy \\
&= \sum_{k=0}^{N-1}p_X(x_k)\Bigg[
{\rm log_2}(2\pi\sigma^2)^{-1}\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]dy + {{\rm log_2}e\over2\sigma^2}\int_{-\infty}^{\infty}(-|y|^2)(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]dy \\
&+ \int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]{\rm log_2}\sum_{i=0}^{N-1}p_X(x_i){\rm exp}(-{{\rm SNR}|x_i|^2-\sqrt{{\rm SNR}}x_iy^*-\sqrt{{\rm SNR}}x_i^*y\over2\sigma^2})dy\Bigg]  \\
&= \sum_{k=0}^{N-1}p_X(x_k)\Bigg[
{\rm log_2}(2\pi\sigma^2)^{-1} - {{\rm log_2}e\over2\sigma^2}(\sigma^2+{\rm SNR}|x_k|^2) + \int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]{\rm log_2}\sum_{i=0}^{N-1}p_X(x_i){\rm exp}(-{{\rm SNR}|x_i|^2-\sqrt{{\rm SNR}}x_iy^*-\sqrt{{\rm SNR}}x_i^*y\over2\sigma^2})dy\Bigg]  \\
&= {\rm log_2}(2\pi\sigma^2)^{-1} - {{\rm log_2}e\over2\sigma^2}(\sigma^2+{\rm SNR}) +  \sum_{k=0}^{N-1}p_X(x_k)\Bigg[
\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]{\rm log_2}\sum_{i=0}^{N-1}p_X(x_i){\rm exp}(-{{\rm SNR}|x_i|^2-\sqrt{{\rm SNR}}x_iy^*-\sqrt{{\rm SNR}}x_i^*y\over2\sigma^2})dy\Bigg]  \\
&= {\rm log_2}(2\pi\sigma^2)^{-1} + {\rm log_2}e^{-1/2} - {{\rm SNR}\over2\sigma^2}{\rm log_2}e +  \sum_{k=0}^{N-1}p_X(x_k)\Bigg[
\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]{\rm log_2}\sum_{i=0}^{N-1}p_X(x_i){\rm exp}(-{{\rm SNR}|x_i|^2-\sqrt{{\rm SNR}}x_iy^*-\sqrt{{\rm SNR}}x_i^*y\over2\sigma^2})dy\Bigg]  \\
&= {\rm log_2}(2\pi\sigma^2e^{1/2})^{-1} - {{\rm SNR}\over2\sigma^2}{\rm log_2}e +  \sum_{k=0}^{N-1}p_X(x_k)\Bigg[
\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]{\rm log_2}\sum_{i=0}^{N-1}p_X(x_i){\rm exp}(-{{\rm SNR}|x_i|^2-\sqrt{{\rm SNR}}x_iy^*-\sqrt{{\rm SNR}}x_i^*y\over2\sigma^2})dy\Bigg]  \\
\end{align}
$

Thus,
$
\begin{align}
I(X; Y) &= A - B \\
&={\rm log_2}(2\pi\sigma^2e^{1/2})^{-1} -  {\rm log_2}(2\pi\sigma^2e^{1/2})^{-1} + {{\rm SNR}\over2\sigma^2}{\rm log_2}e  -  \sum_{k=0}^{N-1}p_X(x_k)\Bigg[
\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]{\rm log_2}\sum_{i=0}^{N-1}p_X(x_i){\rm exp}(-{{\rm SNR}|x_i|^2-\sqrt{{\rm SNR}}x_iy^*-\sqrt{{\rm SNR}}x_i^*y\over2\sigma^2})dy\Bigg]  \\
&= {{\rm SNR}\over2\sigma^2}{\rm log_2}e  -  \sum_{k=0}^{N-1}p_X(x_k)\Bigg[
\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]{\rm log_2}\sum_{i=0}^{N-1}p_X(x_i){\rm exp}(-{{\rm SNR}|x_i|^2-\sqrt{{\rm SNR}}x_iy^*-\sqrt{{\rm SNR}}x_i^*y\over2\sigma^2})dy\Bigg]  \\
\end{align}
$

c) 
1) for a real constellation
$
\begin{align}
I(X; Y) &= {{\rm SNR}\over2\sigma^2}{\rm log_2}e -  \sum_{k=0}^{N-1}p_X(x_k)\Bigg[
\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]{\rm log_2}\sum_{i=0}^{N-1}p_X(x_i){\rm exp}(-{{\rm SNR}x_i^2-2\sqrt{{\rm SNR}}x_iy\over2\sigma^2})dy\Bigg]  \\
&= {{\rm SNR}\over2\sigma^2}{\rm log_2}e -  \sum_{k=0}^{N-1}{1\over N}\Bigg[
\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]{\rm log_2}\sum_{i=0}^{N-1}{1\over N}{\rm exp}(-{{\rm SNR}x_i^2-2\sqrt{{\rm SNR}}x_iy\over2\sigma^2})dy\Bigg]  \\
&= {{\rm SNR}\over2\sigma^2}{\rm log_2}e -  {1\over N}\sum_{k=0}^{N-1}\Bigg[
\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]{\rm log_2}{1\over N}{\sum_{i=0}^{N-1}\rm exp}(-{{\rm SNR}x_i^2-2\sqrt{{\rm SNR}}x_iy\over2\sigma^2})dy\Bigg]  \\
&= {{\rm SNR}\over2\sigma^2}{\rm log_2}e -  {1\over N}\sum_{k=0}^{N-1}\Bigg[
\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]{\rm log_2}{1\over N}({2\pi\sigma^2\over {\rm SNR}})^{1/2}{\rm exp}({y^2\over2\sigma^2})dy\Bigg]  \\
&= {{\rm SNR}\over2\sigma^2}{\rm log_2}e -  {1\over N}\sum_{k=0}^{N-1}\Bigg[
\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}][{\rm log_2}{1\over N}({2\pi\sigma^2\over {\rm SNR}})^{1/2}+{y^2\over2\sigma^2}{\rm log_2}e]dy\Bigg]  \\
&= {{\rm SNR}\over2\sigma^2}{\rm log_2}e -  {1\over N}\sum_{k=0}^{N-1}\Bigg[
{\rm log_2}{1\over N}({2\pi\sigma^2\over {\rm SNR}})^{1/2}\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]dy +{{\rm log_2}e\over2\sigma^2} \int_{-\infty}^{\infty}y^2(2\pi\sigma^2)^{-1/2}{\rm exp}[{-{(y-\sqrt{\rm SNR}x_k)^2}\over2\sigma^2}]dy\Bigg]  \\
&= {{\rm SNR}\over2\sigma^2}{\rm log_2}e -  {1\over N}\sum_{k=0}^{N-1}\Bigg[
{\rm log_2}{1\over N}({2\pi\sigma^2\over {\rm SNR}})^{1/2}+{{\rm log_2}e\over2\sigma^2} (\sigma^2+{\rm SNR}x_k^2)\Bigg]  \\
&= {{\rm SNR}\over2\sigma^2}{\rm log_2}e -  {1\over N}\sum_{k=0}^{N-1}\Bigg[
{\rm log_2}{1\over N}({2\pi\sigma^2\over {\rm SNR}})^{1/2} + {{\rm log_2}e\over2} + {{\rm SNR}{\rm log_2}e\over2\sigma^2}x_k^2)\Bigg]  \\
&= {{\rm SNR}\over2\sigma^2}{\rm log_2}e -  {1\over N}\Bigg[
N{\rm log_2}{1\over N}({2\pi\sigma^2\over {\rm SNR}})^{1/2}+{N{\rm log_2}e\over2} + {{\rm SNR}{\rm log_2}e\over2\sigma^2}\sum_{k=0}^{N-1}x_k^2)\Bigg]  \\
\end{align}
$
Because $E|X|^2 = \sum^{N-1}_{k=0}{1\over N}x_k^2 = 1$, thus $ \sum^{N-1}_{k=0}x_k^2=N$
Thus,
$
\begin{align}
I(X; Y) &= {{\rm SNR}\over2\sigma^2}{\rm log_2}e -  {1\over N}\Bigg[
N{\rm log_2}{1\over N}({2\pi\sigma^2\over {\rm SNR}})^{1/2}+{N{\rm log_2}e\over2} +{{\rm SNR}{\rm log_2}e\over2\sigma^2}N\Bigg]  \\
&= {{\rm SNR}\over2\sigma^2}{\rm log_2}e - {\rm log_2}{1\over N}({2\pi\sigma^2\over {\rm SNR}})^{1/2} - {{\rm log_2}e\over2} - {{\rm SNR}{\rm log_2}e\over2\sigma^2}  \\
&= {\rm log_2}N - {\rm log_2}({2\pi\sigma^2e\over {\rm SNR}})^{1/2}\\
&= {\rm log_2}N - {\rm log_2}(2\pi\sigma^2e)^{1/2} + {\rm log_2} ({\rm SNR})^{1/2}\\
\end{align}
$


2) for a complex constellation
$
\begin{align}
I(X; Y)
&= {{\rm SNR}\over2\sigma^2}{\rm log_2}e  -  \sum_{k=0}^{N-1}p_X(x_k)\Bigg[
\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]{\rm log_2}\sum_{i=0}^{N-1}p_X(x_i){\rm exp}(-{{\rm SNR}|x_i|^2-\sqrt{{\rm SNR}}x_iy^*-\sqrt{{\rm SNR}}x_i^*y\over2\sigma^2})dy\Bigg]  \\
&={{\rm SNR}\over2\sigma^2}{\rm log_2}e  -  \sum_{k=0}^{N-1}{1\over N}\Bigg[
\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]{\rm log_2}\sum_{i=0}^{N-1}{1\over N}{\rm exp}(-{{\rm SNR}|x_i|^2-\sqrt{{\rm SNR}}x_iy^*-\sqrt{{\rm SNR}}x_i^*y\over2\sigma^2})dy\Bigg]  \\
&={{\rm SNR}\over2\sigma^2}{\rm log_2}e  -  \sum_{k=0}^{N-1}{1\over N}\Bigg[
\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]{\rm log_2}{1\over N}\sum_{i=0}^{N-1}{\rm exp}(-{|\sqrt{{\rm SNR}}x_i-y|^2\over2\sigma^2}){\rm exp}({|y|^2\over2\sigma^2})dy\Bigg]  \\
&={{\rm SNR}\over2\sigma^2}{\rm log_2}e  -  \sum_{k=0}^{N-1}{1\over N}\Bigg[
\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}][{\rm log_2}{1\over N}+{\rm log_2}{\rm exp}({|y|^2\over2\sigma^2})+{\rm log_2}\sum_{i=0}^{N-1}{\rm exp}(-{|\sqrt{{\rm SNR}}x_i-y|^2\over2\sigma^2})dy\Bigg]  \\
&={{\rm SNR}\over2\sigma^2}{\rm log_2}e  -  \sum_{k=0}^{N-1}{1\over N}\Bigg[
\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}][{\rm log_2}{1\over N}+{|y|^2\over2\sigma^2}{\rm log_2}e+{\rm log_2}({2\pi\sigma^2\over {\rm SNR}})dy\Bigg]  \\
&={{\rm SNR}\over2\sigma^2}{\rm log_2}e  -  \sum_{k=0}^{N-1}{1\over N}\Bigg[
{\rm log_2}{1\over N}{2\pi\sigma^2\over {\rm SNR}}\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]dy+{{\rm log_2}e\over2\sigma^2}\int_{-\infty}^{\infty}|y|^2(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]dy\Bigg]  \\
&={{\rm SNR}\over2\sigma^2}{\rm log_2}e  -  \sum_{k=0}^{N-1}{1\over N}\Bigg[
{\rm log_2}{1\over N}{2\pi\sigma^2\over {\rm SNR}}+{{\rm log_2}e\over2\sigma^2}(\sigma^2+{\rm SNR}|x_k|^2)\Bigg]  \\
&={{\rm SNR}\over2\sigma^2}{\rm log_2}e  -  {1\over N}\Bigg[
N{\rm log_2}{1\over N}{2\pi\sigma^2\over {\rm SNR}}+N{{\rm log_2}e\over2}+{{\rm SNR}{\rm log_2}e\over 2\sigma^2}\sum^{N-1}_{k=0}|x_k|^2\Bigg]  \\
&={{\rm SNR}\over2\sigma^2}{\rm log_2}e  -  {1\over N}\Bigg[
N{\rm log_2}{1\over N}{2\pi\sigma^2\over {\rm SNR}}+N{{\rm log_2}e\over2}+N{{\rm SNR}{\rm log_2}e\over 2\sigma^2}\Bigg]  \\
&={{\rm SNR}\over2\sigma^2}{\rm log_2}e  - {\rm log_2}{1\over N}{2\pi\sigma^2\over {\rm SNR}} - {{\rm log_2}e\over2}-{{\rm SNR}{\rm log_2}e\over 2\sigma^2} \\
&= {\rm log_2}N - {\rm log_2}(2\pi\sigma^2) + {\rm log_2}{\rm SNR}
\end{align}
$

Because the totoal probability is 1, so $4p+8q+4r = 1$
Thus,
$p + 2q + r = 1/4$
$0 \leq p \leq 1/4$
$0 \leq q \leq 1/8$
$0 \leq r \leq 1/4$

$
\begin{align}
I(X; Y) &={\rm log_2}e^{-1} - \sum_{k=0}^{N-1}p_X(x_k)\Bigg[
\int_{-\infty}^{\infty}(2\pi\sigma^2)^{-1}{\rm exp}[{-{|y-\sqrt{\rm SNR}x_k|^2}\over2\sigma^2}]{\rm log_2}\sum_{i=0}^{N-1}p_X(x_i){\rm exp}[{-{|y-\sqrt{\rm SNR}x_i|^2}\over2\sigma^2}]dy\Bigg] \\
&={\rm log_2}e^{-1} - \sum_{k=0}^{N-1}p_X(x_k)E_n[{\rm log_2}\sum_{i=0}^{N-1}p_X(x_i){\rm exp}[{-{|y-\sqrt{\rm SNR}x_i|^2}\over2\sigma^2}]\\
\end{align}
$

The optimal (p*, q*, r*) is (0.05, 0.60, 0.08).
a)
The root-raised-cosine pulse g(t) is shown in Fig. [xxx].

The transmitted signal is conv.... shown in Fig. [XXX].


To make $y_k = \sqrt{\rm SNR}x_k + n_k$, n(t) must be with the power $\sqrt{\rm SNR}$.

y = s * f ./ sampes_per_symbol = \sqrt{\rm SNR}x_k

@@need derivation@@
\end{align}
$

!!! command
FTP的命令行格式为: ftp -v -d -i -n -g [主机名] , 
其中 -v 显示远程服务器的所有响应信息; 
-n 限制ftp的自动登录,即不使用;.n etrc文件; 
-d 使用调试方式; 
-g 取消全局文件名。 
FTP使用的内部命令如下(中括号表示可选项): 
1.![cmd[args>:在本地机中执行交互shell,exit回到ftp环境,如:!ls*.zip 
2.$ macro-ame[args]: 执行宏定义macro-name。 
3.account[password]: 提供登录远程系统成功后访问系统资源所需的补充口令。 
4.append local-file[remote-file]:将本地文件追加到远程系统主机,若未指定远程系统文件名,则使用本地文件名。 
5.ascii:使用ascii类型传输方式。 
6.bell:每个命令执行完毕后计算机响铃一次。 
7.bin:使用二进制文件传输方式。 
8.bye:退出ftp会话过程。 
9.case:在使用mget时,将远程主机文件名中的大写转为小写字母。 
10.cd remote-dir:进入远程主机目录。 
11.cdup:进入远程主机目录的父目录。 
12.chmod mode file-name:将远程主机文件file-name的存取方式设置为mode,如:chmod 777 a.out。 
13.close:中断与远程服务器的ftp会话(与open对应)。 
14.cr:使用asscii方式传输文件时,将回车换行转换为回行。 
15.delete remote-file:删除远程主机文件。 
16.debug[debug-value]:设置调试方式, 显示发送至远程主机的每条命令,如:deb up 3,若设为0,表示取消debug。 
17.dir[remote-dir][local-file]:显示远程主机目录,并将结果存入本地文件 
18.disconnection:同close。 
19.form format:将文件传输方式设置为format,缺省为file方式。 
20.get remote-file[local-file]: 将远程主机的文件remote-file传至本地硬盘的local-file。 
21.glob:设置mdelete,mget,mput的文件名扩展,缺省时不扩展文件名,同命令行的-g参数。 
22.hash:每传输1024字节,显示一个hash符号(#)。 
23.help[cmd]:显示ftp内部命令cmd的帮助信息,如:help get。 
24.idle[seconds]:将远程服务器的休眠计时器设为[seconds]秒。 
25.image:设置二进制传输方式(同binary)。 
26.lcd[dir]:将本地工作目录切换至dir。 
27.ls[remote-dir][local-file]:显示远程目录remote-dir, 并存入本地文件local-file。 
28.macdef macro-name:定义一个宏,遇到macdef下的空行时,宏定义结束。 
29.mdelete[remote-file]:删除远程主机文件。 
30.mdir remote-files local-file:与dir类似,但可指定多个远程文件,如 :mdir *.o.*.zipoutfile 。 
31.mget remote-files:传输多个远程文件。 
32.mkdir dir-name:在远程主机中建一目录。 
33.mls remote-file local-file:同nlist,但可指定多个文件名。 
34.mode[modename]:将文件传输方式设置为modename, 缺省为stream方式。 
35.modtime file-name:显示远程主机文件的最后修改时间。 
36.mput local-file:将多个文件传输至远程主机。 
37.newer file-name: 如果远程机中file-name的修改时间比本地硬盘同名文件的时间更近,则重传该文件。 
38.nlist[remote-dir][local-file]:显示远程主机目录的文件清单,并存入本地硬盘的local-file。 
39.nmap[inpattern outpattern]:设置文件名映射机制, 使得文件传输时,文件中的某些字符相互转换, 如:nmap $1.$2.$3[$1,$2].[$2,$3],则传输文件a1.a2.a3时,文件名变为a1,a2。 该命令特别适用于远程主机为非UNIX机的情况。 
40.ntrans[inchars[outchars>:设置文件名字符的翻译机制,如ntrans1R,则文件名LLL将变为RRR。 
41.open host[port]:建立指定ftp服务器连接,可指定连接端口。 
42.passive:进入被动传输方式。 
43.prompt:设置多个文件传输时的交互提示。 
44.proxy ftp-cmd:在次要控制连接中,执行一条ftp命令, 该命令允许连接两个ftp服务器,以在两个服务器间传输文件。第一条ftp命令必须为open,以首先建立两个服务器间的连接。 
45.put local-file[remote-file]:将本地文件local-file传送至远程主机。 
46.pwd:显示远程主机的当前工作目录。 
47.quit:同bye,退出ftp会话。 
48.quote arg1,arg2...:将参数逐字发至远程ftp服务器,如:quote syst. 
49.recv remote-file[local-file]:同get。 
50.reget remote-file[local-file]:类似于get, 但若local-file存在,则从上次传输中断处续传。 
51.rhelp[cmd-name]:请求获得远程主机的帮助。 
52.rstatus[file-name]:若未指定文件名,则显示远程主机的状态, 否则显示文件状态。 
53.rename[from][to]:更改远程主机文件名。 
54.reset:清除回答队列。 
55.restart marker:从指定的标志marker处,重新开始get或put,如:restart 130。 
56.rmdir dir-name:删除远程主机目录。 
57.runique:设置文件名只一性存储,若文件存在,则在原文件后加后缀.1, .2等。 
58.send local-file[remote-file]:同put。 
59.sendport:设置PORT命令的使用。 
60.site arg1,arg2...:将参数作为SITE命令逐字发送至远程ftp主机。 
61.size file-name:显示远程主机文件大小,如:site idle 7200。 
62.status:显示当前ftp状态。 
63.struct[struct-name]:将文件传输结构设置为struct-name, 缺省时使用stream结构。 
64.sunique:将远程主机文件名存储设置为只一(与runique对应)。 
65.system:显示远程主机的操作系统类型。 
66.tenex:将文件传输类型设置为TENEX机的所需的类型。 
67.tick:设置传输时的字节计数器。 
68.trace:设置包跟踪。 
69.type[type-name]:设置文件传输类型为type-name,缺省为ascii,如:type binary,设置二进制传输方式。 
70.umask[newmask]:将远程服务器的缺省umask设置为newmask,如:umask 3 
71.user user-name[password][account]:向远程主机表明自己的身份,需要口令时,必须输入口令,如:user anonymous my@email。 
72.verbose:同命令行的-v参数,即设置详尽报告方式,ftp 服务器的所有响 应都将显示给用户,缺省为on. 
73.?[cmd]:同help.
[[为Foobar 2000增加歌曲评级]]
*
|CT, non-periodic|Fourier Transform|C, non-periodic|00->00|
|CT, periodic|Fourier Series|D, non-periodic|01->10|
|DT, non-periodic|DT Fourier Transform|C, periodic|10->01|
|DT, periodic|DT Fourier Series|D, periodic|11->11|
** Note: Actually, by introducing dirac function, periodic functions have their Fourier Transform. e.g. sinuous function.
*Inverse FT: do not miss the 1/2π
*F(u(t)) = F(1/2 + 1/2*sgn(t)) = πδ(t) + 1/jw
*
|!f(t)|!R(w)|!Im(w)|
|Real|Even|Odd|
|Image|Odd|Even|
!!Configuration
[[Windows下安装Git后文件夹右键菜单失效的修复]]
[[Change the hosts of current git repos]]
[[SSH config]]
[[I don’t want to enter a long passphrase every time I use the key]]
[[Under windows cmd, cannot find public key]]

!!Basics
[[how to use Git with remote repository]]
[[git ignore]]
[[If you have some bad commit in the remote repos]]
[[git branch&checkout]]
[[git rebase -i master~5]]


!!Problem&Solution
[[git pull -> error: permission denied]]
[[error: bad config value for core.hidedotfiles]]
[[merge failed because of .gitignore]]
[[This private key will be ignored]]
[[merge failed]]
[[Book Review -- Get Things Done]]
[[mGSD]]
''Solution 1''
Get rid of all the {{{\[}}} and {{{\]}}}, and add some space between them:
{{{
\begin{equation}
P^+= \left( \begin{array}{ccc}
1 & 0\\
0 & 0\end{array} \right)\qquad
P^-= \left( \begin{array}{ccc}
0 & 0\\
0 & 1\end{array} \right)
\end{equation}
}}}

''Solution 2''
With the AMS-LaTeX package, you can accomplish this task more conveniently with the align and pmatrix environments:
{{{
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align}
P^+ &= \begin{pmatrix}
    1 & 0 \\
    0 & 0
\end{pmatrix}
&
P^- &= \begin{pmatrix}
    0 & 0 \\
    0 & 1
\end{pmatrix}
\end{align}
\end{document}
}}}
!! 写作教程
[[理工科本科毕业生怎样写毕业论文——本科毕业论文辅导]]
[[开题报告的写法]]
[[参考文献标准格式]]

!!毕业论文结构
# 绪论
## 研究背景及意义
### 当今的Video Coding模式
### 引出DVC
### 引出压缩感知
### 引出DVCS
## 压缩感知理论简介
## 分布式视频编码技术简介
## 研究工作概要及论文章节安排
### 研究工作概要及创新点
### 论文章节安排
# 压缩感知理论的基本原理与应用
## 引言
## 问题的引入
## 压缩感知的基本原理
### Case 1:时空域系数
### Case 2:变换域系数
## 压缩感知的理论框架
### 信号的稀疏性表示
### 信号的测量
### 信号的重构(恢复算法?)
## 贝叶斯压缩感知
### 贝叶斯压缩感知理论框架
### 贝叶斯压缩感知的恢复算法
#### RVM
#### CS-BP
#### BP-SBL
## 压缩感知的应用
## 本章小结
# 基于压缩感知的分布式视频编码
## 引言 —— 引出DCVS,以及本文使用的算法
## 基于贝叶斯压缩感知的分布式视频编码算法
### Separate Compression
### DCVS via SI-BP-SBL
## 算法复杂度分析
## 实验结果和分析
### 复原结果主观评价
### PSNR比较
### 算法复杂度比较?
## 本章小结
# 结束语



!!2011-3-14
题目:基于置信传播的贝叶斯压缩感知的算法研究和实现


!!Abstract
dictionary
*text doc.: easy
*image/video: no simple mapping from raw image/videos to dic. terms.
classical approach
*vector quant
*visual descriptors (training set)
*nearest-neighbor alg. (occurrences)
==> 
*sparse visual descriptors
* ''not ensure sparse representation''
This paper
* Mix-norm reg.
* sparsity at the image level and dic.
* better mean ave. precision in classification
!!Basics
[[Page design|HTML Page Design]]
[[POST form|HTML POST form]]
[[CSS|HTML CSS]]
[[Media Type]]
[[Source File's Path]]
[[iframe 标签自动换行]]

!!Questions
[[Page Design|HTML Page Design]]
!!!CSS重载顺序
CSS的重载顺序是根据<link>标签的顺序,越后写的越后载入,也就是最终表现出来的CSS
the POST paremeter is {name, value}
so
{{{
<input type="text" id="test">
}}}
cannot be POST
* Correct Format:
{{{
<input type="text" name="test">
}}}
*So it is highly recommended that id and name keep the same in a tag
to create a page, the first thing is design the layout, 
use <div>.
{{{
height, width, overflow, title
}}}

Question:
> overflow: hidden;
when there is space between word, it would change line instead of hidden?
!!About Me
Research Assistant 
Dept. Electrical and Computer Engineering
9107-116 St., University of Alberta
Edmonton, Alberta, ~T6G 2V4, Canada
Email: hfang2@ualberta.ca

!!!Curriculum Vita
[[LinkedIn|http://www.linkedin.com/pub/hao-fang/25/78b/997]]
[[PDF|https://docs.google.com/viewer?a=v&pid=explorer&chrome=true&srcid=0B_0uIFhB364MMGYwYjAxOWQtY2YyZS00ZmMyLWJkYmYtNjhhYjNlMGYyNjAz&hl=en_US]]

!!Education
''University of Alberta''
Msc, Electrical Engineering
09/2011-Present

''Beijing University of Posts and Telecommunications''
~BEng, Information Engineering
09/2007-06/2011

!! Research
*Research interests
**Compressed Sensing
**Signal Processing
**Distributed Video Coding
*[[Publications/Software]]
*[[Research Projects]]

!!Homepage
http://hfang.tiddlyspot.com
!!Notes:
The tutorial is extracted from "Hello, Android (Introductin Google's Mobile Development Platform)" (pdf format).

!!Adding a Menu
Android supports two kinds of menus. 
1. First, there is the menu you get when you press the physical Menu button. 
1) Define strings in res/value/string.xml
{{{
<string name="xxx_title">xxx</string>
<string name="xxx_label">xxx</string>
<string name="xxx_shortcut">xxx</string>
<string name="xxx_summary">xxx</string>
}}}
2) Define the menu in res/menu/menu.xml
{{{
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/xxx"
android:title="@string/xxx_label"
android:alphabeticShortcut="@string/xxx_shortcut" />
</menu>
}}}
3) override methos
{{{
@Override
public boolean onCreateOptionsMenu(Menu menu) {
super.onCreateOptionsMenu(menu);
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menu, menu);
return true;
}
}}}
getMenuInflater( ) returns an instance of MenuInflater that we use to read
the menu definition from XML and turns it into a real view.
4) When the user selects any menu item, onOptionsItemSelected( ) will be
called. Here’s the definition for that method:
{{{
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.settings:
startActivity(new Intent(this, Settings.class));
return true;
// More items go here (if any) ...
}
return false;
}
}}}

2. Second, there is a context menu that pops up when you press and hold your finger on the screen
(or press and hold the trackball or the D-pad center button).
http://www.mathworks.com/support/solutions/en/data/1-6IJJ3L/?solution=1-6IJJ3L
Date Last Modified: Wednesday, January 12, 2011
Solution ID:	 	 1-6IJJ3L
Product:	 	MATLAB
Reported in Release:	 	 R2008b+
Platform:	 	 Windows
Operating System:	 	 Windows Any
 
Subject:

How can I set up Microsoft Visual Studio 2008 Express Edition for use with MATLAB 7.7 (R2008b) on 64-bit Windows?

Problem Description:

I would like to set up Microsoft Visual Studio 2008 Express Edition for use with MATLAB 7.7 (R2008b) on 64-bit Windows.

Solution:

The support for Microsoft Visual Studio 2008 Express Edition to create MEX files has been added in MATLAB 7.7 (R2008b). On 64-bit Windows, Visual Studio 2008 Express Edition support requires you to install some optional components as detailed below. Note that in some cases, the configuration steps described below are known to work with MATLAB 7.8 (R2009a), MATLAB 7.9 (R2009b) and MATLAB 7.10 (R2010a) as well.

When using 64-bit MATLAB on 64-bit Windows, you must use a 64-bit compiler to build MEX-files, MATLAB Compiler & Builder components, Simulink S-functions, RTW models, etc. The full list of supported products is available at:

http://www.mathworks.com/support/compilers/current_release/

The default installation of Visual Studio 2008 Express is only capable of building 32-bit binaries, and will not work with MATLAB.

In order to build 64-bit binaries, the "x64 Compilers and Tools" and Microsoft Windows Software Development Kit (SDK) must both be installed. The x64 Compilers and Tools are not installed by default.

Without these packages, Visual Studio can build simple C/C++ applications as 32-bit binaries --- "Hello World" type programs compile and execute as expected. However, Visual Studio cannot build the 64-bit binaries MATLAB requires.

To install Visual Studio 2008 Express Edition with all required components:
1. Install Microsoft Visual Studio 2008 Express Edition. The main Visual Studio 2008 Express installer is available from (the C++ installer name is vcsetup.exe):

http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=a22341ee-21db-43aa-8431-40be78461ee0


This package can be installed using the default options.

2. Install the Microsoft Windows SDK. The Microsoft Windows SDK is available by searching Microsoft's download site, or by going directly to:
http://msdn.microsoft.com/en-us/windowsserver/bb980924.aspx
or
http://www.microsoft.com/downloads/details.aspx?FamilyId=F26B1AA4-741A-433A-9BE5-FA919850BDBF&displaylang=en

Download the Windows Server 2008 & .NET 3.5 SDK. Do not install beta or 'Release Candidate' (RC) versions. Also do NOT install "Microsoft Windows SDK for Windows 7 and .NET Framework 4" (version 7.1); if you want to use a 7.x version choose the "Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1".

2.1. While installing the SDK, you must select "x64 Compilers and Tools". For example, in the SDK installer above:
On screen "Installation Options"
Select "Developer Tools"->"Visual C++ Compilers".
This item has the Feature Description "Install the Visual C++ 9.0 Compilers. These compilers allow you to target x86, x64, IA64 processor architectures."

3. To verify that you have all installed components, check that the Microsoft SDK contains the "amd64" version of the C/C++ compiler "cl.exe". This is usually installed into


C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64\cl.exe

4. At this point you should be able to proceed and compile code as usual.

For example, to select the compiler and build the YPRIME.C example MEX-file,
mex -setup % Select Visual Studio 2008 Express Edition
copyfile(fullfile(matlabroot,'extern','examples','mex','yprime.c'))
mex -v yprime.c
yprime(1,1:4)
The final line should execute the MEX-file, and calculate the following output:

ans =
    2.0000    8.9685    4.0000   -1.0947
If you are unable to select your compiler, compile the MEX-file, or execute the MEX-file, consult the Troubleshooting section below.

5. Troubleshooting
If the "x64 Compilers and Tools" are not installed properly, MATLAB might display one of the following messages:

*****************************************************************************
  Error: Could not find the 64-bit compiler.  This may indicate that the
         "X64 Compilers and Tools" or the Microsoft Windows Software
         Development Kit (SDK) is not installed.  To build 64-bit MEX-files
         Microsoft Visual C++ 2008 Express Edition requires that these two
         packages are installed properly.
*****************************************************************************

*****************************************************************************
  Error: Could not find the Microsoft Windows Software Development Kit (SDK).
         This may indicate that the Microsoft Windows SDK or the
         "X64 Compilers and Tools" is not installed.  To build 64-bit
         MEX-files Microsoft Visual C++ 2008 Express Edition requires that
         these two packages are installed properly.
*****************************************************************************
If you see these messages, you may not have the SDK or x64 Compilers and Tools installed properly, or MATLAB may not be able to locate them on your system. Verify that you have installed these packages as described above. For additional assistance, contact MathWorks Technical Support.

For information on which MathWorks products support Visual Studio 2008 Express Edition in your release, see the Supported Compiler List:
http://www.mathworks.com/support/compilers/current_release/
use " to comment one line
customize your settings in the [[StyleSheetPrint]].
choose what you want to display and not display.
e.g. 
{{{
ErrorController.php
}}}
the page shows 
*ErrorController.php

Solution: Use
{{{
~ErrorController.php
}}}
~ErrorController.php
command line or in vimrc
{{{
set nobackup
set backup
}}}
http://help.github.com/ssh-key-passphrases/

Auto-launching ssh-agent on msysgit

You can run ssh-agent automatically when you open bash by adding the following to your ~/.profile or ~/.bashrc file:
(In Windows, it located in \....\Git\etc\profile )
{{{
SSH_ENV="$HOME/.ssh/environment"

# start the ssh-agent
function start_agent {
    echo "Initializing new SSH agent..."
    # spawn ssh-agent
    ssh-agent | sed 's/^echo/#echo/' > "$SSH_ENV"
    echo succeeded
    chmod 600 "$SSH_ENV"
    . "$SSH_ENV" > /dev/null
    ssh-add
}

# test for identities
function test_identities {
    # test whether standard identities have been added to the agent already
    ssh-add -l | grep "The agent has no identities" > /dev/null
    if [ $? -eq 0 ]; then
        ssh-add
        # $SSH_AUTH_SOCK broken so we start a new proper agent
        if [ $? -eq 2 ];then
            start_agent
        fi
    fi
}

# check for running ssh-agent with proper $SSH_AGENT_PID
if [ -n "$SSH_AGENT_PID" ]; then
    ps -ef | grep "$SSH_AGENT_PID" | grep ssh-agent > /dev/null
    if [ $? -eq 0 ]; then
	test_identities
    fi
# if $SSH_AGENT_PID is not properly set, we might be able to load one from
# $SSH_ENV
else
    if [ -f "$SSH_ENV" ]; then
	. "$SSH_ENV" > /dev/null
    fi
    ps -ef | grep "$SSH_AGENT_PID" | grep -v grep | grep ssh-agent > /dev/null
    if [ $? -eq 0 ]; then
        test_identities
    else
        start_agent
    fi
fi
}}}
Note: If you don’t use the default key names, or store your keys in a different path, you will need to add the path to the /usr/bin/ssh-add line so that ssh knows where to find your key.

Now when you first run git bash, you will be prompted for your passphrase.
Refer: http://www.ibm.com/developerworks/cn/opensource/os-android-sensor/#N10076
IBMEyes.Eye
# download the Eye's source code.
# Unzip the package.
# Import the project into Eclipse.
# Copy deafult.properties(created it) to the project root directory
# Build Path-> Configure Build Path -> 
## Libraries -> Add -> android.jar
## Android -> Google APIs (instead of Android 2.2)
# Remove the src/com.msi.ibm.eyes/R.java (R.java is in gen directory, which is auto generated after build project) or Cut R.java to gen/com.msi.ibm.eyes
# Build Project
# Run
If you just use
{{{
git push
}}}
you cannot push the change to the remote repos
You have to use this
{{{
git reset --hard tag
git push --force origin
}}}
Refer to [[计算机图形处理——容观澳|http://books.google.com/books?id=d8VY0w6cTHkC&pg=PA1&dq=%E8%AE%A1%E7%AE%97%E6%9C%BA%E5%9B%BE%E5%BD%A2%E5%A4%84%E7%90%86+%E5%AE%B9%E8%A7%82&hl=zh-CN&ei=d_uqTvDRL8GciAK77uH1Cg&sa=X&oi=book_result&ct=result&resnum=3&ved=0CDsQ6AEwAg#v=onepage&q&f=false]] Page 43-49
!!!!One dimension sampling analysis
# f(x) x is from -∞ to +∞
##sampling interval △x <= 1/(2w~~c~~)
##sampling rate u~~s~~ >= 2w~~c~~
# g(x) x is from x~~1~~ to x~~2~~ (Refer to 《数字信号处理》Page 123 & Page 149)
## equal to g(x) = f(x)h(x), h(x) is to select f(x) from (-∞. +∞) to (x~~1~~, x~~2~~)
## g~~s~~(x) = s(x)g(x) = s(x)f(x)h(x) = h(x)[s(x)f(x)] <==> conv(H(u), conv(S(u), F(u))
## In this way, we will see in frequency domain, the peak of the signal is connected with each other, is hard to use a LPF to seperate them. (In freq. domain cannot seperate => In space domain cannot separate)
## To solve this problem, assume g~~T~~(x) is a periodic signal with period is X=T, with each period is g(x). Then it can be proved that the signal can be reconstructed.
## g~~T~~(x) can be viewd as conv(g(x), s~~T~~(x)), s~~T~~(x) is some sampling function, so in freq. domain, it is G~~T~~(u)=G(u)S~~T~~(u), which is also periodic with period F.
## The realization is as follows:
##* select N samples of g(x) and G(u) (N samples is just a cover period T~~T~~ or u~~T~~), thus in space domain, N△x =T~~0~~(In fact, it should be N△x = T~~T~~ >= T~~0~~), in freq. domain N△u~~T~~=△u=1/△x (In fact, it should be N△u~~T~~=△u=1/△x <= N/T~~0~~) in freq. domain, which is to satisfy Nyquist Sampling theorem), Thus △u~~T~~ = 1/(N△x) = 1/T~~0~~ = u~~0~~ (it should be △u~~T~~ <= 1/(N△x) = (1/N)△u <=  u~~0~~ <= △u/2). @@DO NOT BE CONFUSED!@@
##* T~~0~~, u~~0~~: the limited domain of g(x); 
##* T, u(△u), x(△x): the sampling function; 
##* T~~T~~(△x~~T~~), u~~T~~(△u~~T~~): the convolution function. 
##* T~~T~~ >= T~~0~~ >= 2T; u <= 2u~~0~~<=2u~~c~~
##* N=T~~T~~/T = △u/△u~~T~~
## So the conclusion is that △u~~T~~ <= 1/N△x, which means, the samling freq. of  freq. domain should be less than or equal to 1/N of the  sampling freq. of time domain. If we use a freq. sampling function(time conv. function s~~T~~(x)) with T~~T~~ = T~~0~~, then △u~~T~~ = 1/N△x <= 2/NT~~0~~ <= 1/T~~0~~
## To sample a band-limited signal, on one hand, we use Nyq. Sampling theory in time domain that u~~s~~ >= 2u~~0~~; on the other hand, we need to sample in frequency domain with rate u~~c~~ = (1/N)u~~s~~ (N is the samples in one period, can be acuqired by T~~0~~/T~~s~~ = u~~s~~/u~~0~~ >=2 )
!!!!Two dimension Image Sampling
# It just using the conclusion above, with two dimensions x, y; in freq. domain u, v. Image size is M * N.
# so for space domain sampling, u~~s~~ >= 2u~~0~~, v~~s~~ >= 2v~~0~~; for freq. domain sampling, u~~c~~ = (1/M)u~~s~~, v~~c~~ = (1/N)v~~s~~
# In realization, we are fixed on M, N, an sampling rate u~~s~~, v~~s~~ (then we can know u~~c~~ and v~~c~~), so what we don't know is the frequency f~~0~~={u~~0~~, v~~0~~} of the image. So we are assuming that the image is at first passing an antiliasing low-pass filter with freq, f~~0~~ ={M*u~~s~~, N*v~~s~~}. If the f~~0~~ is enough large that there is no antiliase. However, in reality, it is not always that. However, Nyquist Sampling theory can still be used. And if we want to sample a higher frequency compoenent in the image, we need to either increase the sampling rate to the image-acquiring size.
!!!!Abstract
a novel wavelet-domain image upsampling alg. based on ''iterative spatially adaptive filtering''
*reconstructed by alternating two procedures:
##spatially adaptive filtering
##projection on the observation constrained subspace
~BM3D alg.
!!!!Intro.
!!!! Image compression
# transform image into an appropriate basis
#* wavelet transform:sinusoid-based representations (classical JPEG) -> wavelet (JPEG-2000)
# code only the important expansion coefficients
!!!! Sampling an image
* inner product against a different //test function φ~~k~~// 
** --collect pint evaluations of the image X at distinct locations/average over small areas(pixel)--
* discretization space (make the transition to acquisition of continuous-time/-space signals
* φ~~k~~: which domain we gather information about the image.
*# sinusoids at different frequencies => Fourier coefficients (as in MRI)
*# delta ridges => line integrals (as in tomography)
*# indicator functions on squares => collecting pixels (as in standard digital camera)
** 1.2.3 ..... : //coded imaging system//: measurements are in some sense a coded version of image X, rather than direct observations
* To minimize the number of measurements m we need to reconstruct X faithfully
*# match these test functions to the image structure (eg. DCT: using least squares, [[adjoint]])
*** shortcoming: 
***# cannot //adapt// to the  changes in structure from one image to the next
***# recording the same m transform coefficients for every image
*# exact opposite: completely unstructured and look more like random noise than any feature we would expect to see in our image

!!!!Simulation Codes
# Fig 2: SPmag-CS-Code (http://users.ece.gatech.edu/~justin/spmag/)
!语音识别应用在游戏
# 对战类游戏,如星际,魔兽争霸: 可以通过语音进行和鼠标的平行控制(语音辅助功能on/off)
# 网络RPG游戏,如剑侠,魔兽世界:可以通过语音进行同步控制,如对分身,宠物等

!Tree
一开始先应用在paper sns上,之后可研究独立发展。
对于research,如果你想整理某个领域的paper,可以建一个tree,在这个tree里面,paper会有上下的层级关系。
这里的tree一般是专注一个specific topic,如block cs on video compression这样的。
也可以建一个大tree来描述大的领域,那atom可能就是area/field而不是paper了

* 最小的atom应该是paper的某个section
** 这是因为很多paper的background/introduction部分,特别是trans.的,更容易让人理解一个topic
** 一般不会考虑到paper的某一个句话再tree中,这种东西应该是作为tree node的note


!网站的发展道路
app on existing SNS + server  -> new SNS website + server -> mobile app

!梦买
记录每日一梦
收集端可以叫做梦买 用户发布一个梦 就获得一个气球
用户购买对方的梦 消耗一个气球

或者用户之间交易 卖梦

可以做成微博app或者人人app
或者直接一个社交网站

!给家里装修+企业 研究机构白板
就是一块玻璃,可以用画笔在上面写字
E.g.在冰箱旁边放一块 可以随时记录神马菜神马时候过期;在家门放一块,可以记录要带的东西;工作室肯定要的...
对于改进,希望
笔的末端(就是不写字的那端)作为选取工具,可以选取一个矩形区域,完成选取后,可以显示:发送到mail,printer.
就可以打印出来了
再改进 就是可以组合不同的快然后打印
通信应该使用wifi
实现方法有两种:
*发明玻璃板终端,可实现用笔激活选取,并扫描,以及发送。
*笔具有显示功能,扫描功能,以及发送功能

!类似WikiCFP的网站,用于发布各类竞赛信息
似乎可以直接copy整个
(人工收集)(用户上传+自动收集)
貌似可以直接做微博应用or人人应用
或者先做网站 再整合在微博or人人里面
(可通过微博搜索数据->发布 直接创建微博账号/人人主页 发布消息)

!一个网站
可以写创意
然后可以发现有同样创意的人
交友 or 寻找伙伴共同开发-。-
* can be an extension project of Paper Wiki (use the same core)
整合人人or微博app
创意的默认权限是:公开给有类似创意的人 (可指定相似度)
也可以公开给所有人 也可公开给指定人 也可只能自己看
对于用户数据,全部加密(防止隐私透露)

!KTV二维码
在移动设备上选取好歌 (可连接KTV后台数据库) 生成二维码
到KTV后扫描二维码直接点歌
可适用于餐厅点菜(加快点餐进度,减少服务员工作量,同时点菜时可以看网友评论)
整合在人人or微博app中

!One way may be useful for CS
对于一个信号的一部分,如DCT2 coeff的前半部分,大多数都是large coeff. 少数是small coeff.,显然这不是个sparse signal。
但是如果取倒数,则很容易就将它变成了sparse了。所以对于mix gaussian model,大信号的部分是否可以考虑取倒数来cs?


!中国古代八卦易经用于research
这个八卦易经啊 有很多数学的奇特
所以可以考虑怎么用到research来
可能要到老才能想出哇 哈哈

!~Paper-Read Wiki
目的:可以索引大家写的关于Paper read的记录 类似一个百科 这样减少研究者对paper阅读的工作 提供讨论paper中问题的平台
http://papers.tiddlyspace.com

* 对paper进行综述 类别选择(可以自己创建类 但是先给定几个类)
** 应该需要plugin支持
* 初步计划用tiddlyspace 多人合作模式的wiki
* 可能需要制定一个写的格式
* 可以对Paper进行评论 评分(类似豆瓣) (需要Plugin支持)
* 需要有索引信息 (类似mendeley 应该需要Plugin支持 从网上爬数据)
* 对每篇paper都有一个FAQ 或者讨论组 供大家讨论 (需要plugin支持) 即索引问题
* 根据用户情况推荐paper (推荐系统)  (可能需要从wiki转移 或者使用服务器计算 再用plugin返回结果)

* www.paperwiki.com
* 读paper / paper百科

*整合人人or微博app
*参考资料:
*# 师兄帮帮忙

!Siri transplantation to PC
* 类似360助手一样的小人
* 输入类似(可以是语音 也可以使文字):打开QQ,浏览器,天气怎么样.... 均可以回复
* 旨在让电脑用自然语言交流 而不是电脑语言
* 联网识别 减少本机的计算量和数据库
* 无网络时 使用本机更弱的数据库进行识别操作
!Powerpoint Assistant
# 能够读懂powerpoint (制定powerpoint语法,如标题,第一点等等)
# 能够根据规范提醒现有的警告
# 能够根据规范修改powerpoint


!Android Application for ~ECE502
# Destination: guess the words
# First, according to the length of the words, give a max. prob. letter.
# Complete the word letter by letter, showing result each time
# Sort according to the relative to the probability course

!Software for dinner
#存储已有的菜,以及其购买日期,有效日期
#根据过期日期排序
#自动生成每日的菜谱
#可以根据已有的菜 搜索网上的菜谱 按一定频率推荐菜谱,如周末的时候推荐一套菜
#可以根据用户习惯 推荐一周可购买的菜
#可移植到手机上
名字:今天吃什么~?

!Recording video
爷爷说 录像有一个缺点 需要一个人拿着照相机录
如果能够遥控录像 会很好

!Application -- Location Reminder
使用GPS定位信息,设置到达某个地方触发闹钟提醒,如设置到某个market附近提醒要买xxx之类的
1. 下载matlab iso镜像文件(可以从verycd上下载,搜索matlab unix版可得到,我下的是2010a)

2. 打开终端,输入sudo mkdir /mnt/temp (建立临时文件夹存放装载后的iso文件);
    再输入 sudo mount -o loop /路径/Matlab.R2010a.UNIX.ISO-TBE.iso /mnt/temp (绿色路径为matlab iso文件所在位置),回车后装载镜像文件完成。

3. 创建安装matlab的文件夹(可以自己决定位置,但是要记住,后面会用到,eg: /usr/local/matlab)。创建命令为 sudo mkdir /usr/local/matlab

4. 开始安装sudo /mnt/temp/install 此时会弹出类似于windows下安装的图形化安装界面,选择不联网安装,会提示输入序列号,序列号在 /mnt/temp/crack 文件夹下的install文件里。选择安装路径为你在第三步创建的文件夹。安装接近最后 会问你是不是需要激活,选择不联网激活,选择 /mnt/temp/crack 文件夹下的lic_standalone.dat文件即可。激活成功!

5. 安装完成后卸载镜像文件。sudo umount /mnt/temp

> 至此安装部分顺利完成,接下来是如何启动

1. 在终端启动,进入安装matlab的路径并进入bin文件夹,在终端输入./matlab -desktop

2. 这样启动比较麻烦,可以在桌面或者panel建立快捷方式,桌面右键选择create launcher...(第二项),类型(type)选择Application in Terminal,命令(command)选择为bin下的matlab那个文件。桌面快捷方式创建成功。

双击运行,此时在打开的窗口可能会看到

Cannot write to preference file “matlab.prf” in “home/user/.matlab/R2010a”
The desktop configuration was not saved successfully.
解决方法:终端输入 sudo chmod 777 /home/user(自己的登录用户名)/.matlab/R2010a/matlab.prf

                            和 sudo chomd 777 /home/user/.matlab/R2010a
Refer to 
http://forum.ubuntu.org.cn/viewtopic.php?f=77&t=170091

Attention:
edit menu.lst change initrd.gz to initrd.lz when installing Ubuntu 10.10
{{{
Intent 应该算是Android中特有的东西。你可以在Intent中指定程序 要执行的动作(比如:view,edit,dial),以及程序执行到该动作时所需要的资料 。都指定好后,只要调用startActivity(),Android系统 会自动寻找最符合你指定要求的应用程序,并执行该程序。

下面是转载来的其他的一些Intent用法实例(转自javaeye) 

显示网页 
Java代码
1. Uri uri = Uri.parse("http://google.com");    
   2. Intent it = new Intent(Intent.ACTION_VIEW, uri);    
   3. startActivity(it);   

   
显示地图 
Java代码
1. Uri uri = Uri.parse("geo:38.899533,-77.036476");    
   2. Intent it = new Intent(Intent.ACTION_VIEW, uri);     
   3. startActivity(it);     
   4. //其他 geo URI 範例    
   5. //geo:latitude,longitude    
   6. //geo:latitude,longitude?z=zoom    
   7. //geo:0,0?q=my+street+address    
   8. //geo:0,0?q=business+near+city    
   9. //google.streetview:cbll=lat,lng&cbp=1,yaw,,pitch,zoom&mz=mapZoom   

   

路径规划 
Java代码
1. Uri uri = Uri.parse("http://maps.google.com/maps?f=d&saddr=startLat%20startLng&daddr=endLat%20endLng&hl=en");    
   2. Intent it = new Intent(Intent.ACTION_VIEW, uri);    
   3. startActivity(it);    
   4. //where startLat, startLng, endLat, endLng are a long with 6 decimals like: 50.123456    

   
打电话 
Java代码
1. //叫出拨号程序   
   2. Uri uri = Uri.parse("tel:0800000123");    
   3. Intent it = new Intent(Intent.ACTION_DIAL, uri);    
   4. startActivity(it);    
   1. //直接打电话出去    
   2. Uri uri = Uri.parse("tel:0800000123");    
   3. Intent it = new Intent(Intent.ACTION_CALL, uri);    
   4. startActivity(it);    
   5. //用這個,要在 AndroidManifest.xml 中,加上    
   6. //<uses-permission id="android.permission.CALL_PHONE" />    

   

传送SMS/MMS 
Java代码
1. //调用短信程序   
   2. Intent it = new Intent(Intent.ACTION_VIEW, uri);    
   3. it.putExtra("sms_body", "The SMS text");     
   4. it.setType("vnd.android-dir/mms-sms");    
   5. startActivity(it);   
   1. //传送消息   
   2. Uri uri = Uri.parse("smsto://0800000123");    
   3. Intent it = new Intent(Intent.ACTION_SENDTO, uri);    
   4. it.putExtra("sms_body", "The SMS text");    
   5. startActivity(it);   
   1. //传送 MMS    
   2. Uri uri = Uri.parse("content://media/external/images/media/23");    
   3. Intent it = new Intent(Intent.ACTION_SEND);     
   4. it.putExtra("sms_body", "some text");     
   5. it.putExtra(Intent.EXTRA_STREAM, uri);    
   6. it.setType("image/png");     
   7. startActivity(it);    

   

传送 Email 
Java代码
1. Uri uri = Uri.parse("mailto:xxx@abc.com");    
  2. Intent it = new Intent(Intent.ACTION_SENDTO, uri);    
  3. startActivity(it);    
  
  
  1. Intent it = new Intent(Intent.ACTION_SEND);    
  2. it.putExtra(Intent.EXTRA_EMAIL, "me@abc.com");    
  3. it.putExtra(Intent.EXTRA_TEXT, "The email body text");    
  4. it.setType("text/plain");    
  5. startActivity(Intent.createChooser(it, "Choose Email Client"));    
  
  
  1. Intent it=new Intent(Intent.ACTION_SEND);      
  2. String[] tos={"me@abc.com"};      
  3. String[] ccs={"you@abc.com"};      
  4. it.putExtra(Intent.EXTRA_EMAIL, tos);      
  5. it.putExtra(Intent.EXTRA_CC, ccs);      
  6. it.putExtra(Intent.EXTRA_TEXT, "The email body text");      
  7. it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text");      
  8. it.setType("message/rfc822");      
  9. startActivity(Intent.createChooser(it, "Choose Email Client"));  

   


   传送附件 
  
Java代码
Intent it = new Intent(Intent.ACTION_SEND);    
   it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text");    
   it.putExtra(Intent.EXTRA_STREAM, "file:///sdcard/mysong.mp3");    
   sendIntent.setType("audio/mp3");    
   startActivity(Intent.createChooser(it, "Choose Email Client"));   

   

播放多媒体 
Java代码
Uri uri = Uri.parse("file:///sdcard/song.mp3");    
      Intent it = new Intent(Intent.ACTION_VIEW, uri);    
      it.setType("audio/mp3");    
      startActivity(it);   
      Uri uri = Uri.withAppendedPath(MediaStore.Audio.Media.INTERNAL_CONTENT_URI, "1");    
      Intent it = new Intent(Intent.ACTION_VIEW, uri);    
      startActivity(it);   

      

Market 相关 
        //寻找某个应用 
Java代码
Uri uri = Uri.parse("market://search?q=pname:pkg_name");   
     Intent it = new Intent(Intent.ACTION_VIEW, uri);    
     startActivity(it);    

     
     
  //where pkg_name is the full package path for an application 
Java代码
显示某个应用的相关信息   
       Uri uri = Uri.parse("market://details?id=app_id");    
      Intent it = new Intent(Intent.ACTION_VIEW, uri);   
       startActivity(it);    
       //where app_id is the application ID, find the ID     
       //by clicking on your application on Market home     
       //page, and notice the ID from the address bar   

       


Uninstall 应用程序 
Java代码
Uri uri = Uri.fromParts("package", strPackageName, null);   
       Intent it = new Intent(Intent.ACTION_DELETE, uri);     
        startActivity(it);    
        

返回桌面 
Java代码
Intent unMyIntent = new Intent(Intent.ACTION_MAIN);  
            unMyIntent.addCategory(Intent.CATEGORY_HOME);  
            startActivity(unMyIntent);  


发邮件 
Java代码
Uri uri = Uri.parse("mailto:fengsheng.studio@hotmail.com");           
Intent it = new Intent(Intent.ACTION_SENDTO, uri);  


发送文件 
Java代码
Intent intent = new Intent();  
intent.setAction(Intent.ACTION_SEND);  
intent.setType(mimeType);  
intent.putExtra(Intent.EXTRA_STREAM, uri);  
 startActivity(intent);  
  
以上有两个变量需要说明:  
1. mimeType: 如果是图片,则为"image/*",如果是音频,则为"audio/*",如果是视频,则为"video/*"  
2. uri:如果是直接读取到文件路径并发送,则为Uri.fromFile(new File(filePath));  
         如果是从数据库中查循出来的uri,则直接传入即可.  
Intent 模糊匹配:

1、指定activity匹配的Uri类型

<activity android:anme="HelloWord"

               android:label="@string/app_name">

            <intent-filter>

                     <action android:name="android.intent.action.VIEW" />

                      <category android:name="android.intent.category.DEFAULT" />

                      <category android:name="android.intent.category.BROWSABLE" />

                      <data android:scheme="http" android:host="www.google.com " />

            </intent-filter>

 </activity>

Intent intent = new Intent(Intent.ACTION_VIEW,Uri.parse("http://www.google.com"));

startActivity(intent);
}}}
!!!Abstract&Intro.
coding MRI unsuccessful:
# unsuitable inter-frame estimation models => 
## continuous affine mapping based on (&opt. by) ''deforming triangles''. 
## motion model: warping (CGI)
# thermal noise inherent in  MRI => median filter within the estimation loop

residue frames => zero-tree wavelet coder

Contrib.: wraping motion estimation be employed with zerotree wavelet quantization


!!! Inter-Frame Estimation
*Based on an affine spatial transform
*#空间变换 考虑几何上的关系
*#大都数都可以用3*3的matrix T1表示
*#*可以只考虑2D的形式(T1(3, :) = [0 0 1])
*#six degrees of freedom (up down left right front back)
*#preserve straight lines and parallelism
*# <=3 points to specify an affine mapping
*# be parameterized by the differential positions of three non-colinear(非相干的) points, that is Pi = [xi yi 1], i = 0, 1, 2.
*Interdependencies of the frames => a continuous correspondence(motion) field 
*#each affine transform ~ a continuous correspondence
*#but a single affine transform not appropriate throughout a given frame
*#=> partition the frame, separate transform for each region
*#char. of signal => transforms do well to preserve continuity across region boundaries
*#enforcing continuity is very nature when representing the transforms with a 3-point formulation
*continuity => implementation
*#partitioned into triangular patches
*#estimated by corresponding position in the corresponding triangle in the past frame`
*#由于相邻triangles共享顶点=>这种partition给出一个continuous motion field
*displacement vectors of vertices & pel(picture element)
*#dr can be computed using linear interpolation (其实也是affine transform)
*#参数p,q与individual affine maps相互独立,并且只和pixel in triangle的位置有关 => 可以offline, stored in a look-up table 但要求triangle grid是regular的
*=>interframe estimation = finding optimal locations for the triangle vertices
*#coder: iterative optimization strategy to compute the displacement of the vertices
*#*each step calculates the best local deformation for a given triangle
*#displacement vectors & estimation error (residue frame) -> decoder
*#=>can be considered in the class of forward motion compensated coders
*each step of optimization
*# all nodes except one: keep stationary
*# that one node: computed according to a minimum mean absolute error criterion, updated
*# repeated for the next node in the ''raster scan order'' (from left to right, from up to down)
*# to avoid cross-overs&degenerate cases:
*## new position are within the inverse map of a hexagon in the present frame => error calculations can be limited to this area
* => a local optimum => good starting point will reduce the eventual estimation error.
*# here use a conventional block-based motion compensation method.
* repeated until stop criterion is achieved or a preset maximum num. is exceeded
* displaced pos. of the vertices is coded with a Huffman code.

!!! Questions?
# 整个coder是传两部分
## 一是使用wavelet decomposition & zero-tree coding quantization 得到的F(2i)的信息(可以看成是常规处理)
## 一是使用triangular motion estimation得到关于F(2i+1)的displacement of the vertices of triangles

所以,问题是,displacement of the vertices of triangles是一个什么样的东西?

Additional question See [[Research Diary]] -- 2011-9-20

!!! Re-Read
* the author's early experiments with ''displacement-based (motion) coding'' was less than encouraging.
** the paradigm of displacement-based (motion) estimation is built on the assumption that 
>energy of displaced frame diff.  < energy of original frame

!!! Conclusion
The purpose of introducing inter-frame coding in this paper is to code the MRI, considering its difference with most video sequences, whose interframe dependencies can often be characterized by a simple translational model. However, the MR data consists of consective spatial slices of an object, where a large amount of deformation is present from frame to frame.
So the possible thing we can learn from this paper to the Parallel CS Reconstruction is whether the interframe coding or sth. similar to it can make each column of the matrix with the same sparsity.
... to analyze

!!! Report
Unfortunately, I think it can hardly be employed to the problem of parallel reconstruction in CS.
In the interframe coding, it codes the #k-1 frame using zero-tree wavelet coder, which means it would generate N*N matrix in wavelet domain.
And it would code the #k frame using affine mapping, that is block the matrix into M triangle grids, then calculating the displacement vectors of triangle vertex between #k-1 and #k frame. And each triangle block would generate a 3*3 matrix that represents the displacement vector.
Thus, for #k frame, we would get a 3M*3M matrix. The two matrix (N*N and 3M*3M) can hardly be merged in one matrix like 2N*N, which is essential in the model we want to use.
Accordingly, I currently think it is difficult for us to use the interframe coding in this paper to our CS model.
[[JQuery Validate Guide]]
[[Dialog|JQuery Dialog]]
[[多个Ajax 在一个function中的执行顺序]]
[[jQuery 等待多個 Ajax 請求完成]]
[[Questions|JQuery Questions]]
[[用jQuery postMessage: Cross-domain scripting goodness解决iframe跨网域问题]]
!!When press down the button, no dialog open
Problem: 
# "无法使用 'keydown' 事件的 charCode 属性,值无意义"
# When press down the button, no dialog open
Code:
{{{
	$("div#" + adid + " #" + item + " #more-industry-panel").dialog({		
			title: 'More Industry',
			width: 800,
			height: 'auto',
			resizable: false,
			autoOpen: false,
			modal: true,
			buttons: {
				"Ok": function(){
					$(this).dialog("close");
				}
			}
		});

		$("div#" + adid + " #" + item + " #more-industry-panel").dialog('open');
}}}
Analysis & Solution:
>autoOpen: false
when comment up the line, no error occurred
!!.submit()
{{{
<form id="target" action="destination.html">
  <input type="text" value="Hello there" />
  <input type="submit" value="Go" />
</form>
<div id="other">
  Trigger the handler
</div>
}}}
{{{
$('#other').click(function() {
  $('#target').submit();
});
}}}

However, when set an id for "submit"
{{{
  <input type="submit" id="submit" value="Go" />
}}}
It would throw an error in js.
why?

On the other hand
in html
{{{
form name="modify-adword<?php echo $v1['ad_id']; ?>-form" action="/admin/admin/adword/modify/<?php echo $v1['ad_id']; ?>" method="post">
		<input type="text" id="modAdword<?php echo $v1['ad_id']; ?>" name="modAdword<?php echo $v1['ad_id']; ?>" style="display:none;">
		<br>
		<button id="modAdword<?php echo $v1['ad_id']; ?>Btn" style="display:none;" class="confirm-modify-adword-btn"></button>
		</form>
}}}
in js
{{{
   $(".confirm-modify-adword-btn").button({
	    icons: {
			   primary:"ui-icon-plusthick"
		   }
    }).click(function(){
	    var adid = $(this).parent().parent().parent().attr("id");
	    //$("#modify-adword" + adid + "-form").submit();
    })
}}}
No matter in js, comment the .submit() or not, the form would be posted after click the button.
Why?
{{{
名称                              返回类型                描述

validate(options)          返回:Validator       验证所选的FORM

valid()                           返回:Boolean        检查是否验证通过

rules()                           返回:Options         返回元素的验证规则

rules(add,rules)            返回:Options         增加验证规则

rules(remove,rules)

  
jquery.validate是一个基于jquery的非常优秀的验证框架,我们可以通过它迅速验证一些常见的输入,并且可以自己扩充自己的验证方法,而且对国际化也有非常好的支持。

jquery.validate 官方网址:http://bassistance.de/jquery-plugins/jquery-plugin-validation/

使用用法:
1、首先下载jquery.js和jquery.validate.js并引入js文件(注意:jquery必须在jquery.validate.js之前被引入,否则会报错)

<script type="text/javascript" src="jquery.js"></script>        
<script type="text/javascript" src="jquery.validate.js"></script>

2、编写需要验证的表单代码及编写验证代码(编写验证代码有两种方式,首先使用普通方式)

var validator = $("formId").validate({// #formId为需要进行验证的表单ID
   errorElement :"div",// 使用"div"标签标记错误, 默认:"label"
   wrapper:"li",// 使用"li"标签再把上边的errorELement包起来
   errorClass :"validate-error",// 错误提示的css类名"error"
   onsubmit:true,// 是否在提交是验证,默认:true
   onfocusout:true,// 是否在获取焦点时验证,默认:true
   onkeyup :true,// 是否在敲击键盘时验证,默认:true
   onclick:false,// 是否在鼠标点击时验证(一般验证checkbox,radiobox)
   focusCleanup:false,// 当未通过验证的元素获得焦点时,并移除错误提示
       rules: {
                    loginName: {// 需要进行验证的输入框name
                        required: true// 验证条件:必填
                    },
                    loginPassword: {// 需要进行验证的输入框name
                        required: true,// 验证条件:必填
                        minlength: 5// 验证条件:最小长度为5
                    },
                    email: {// 需要进行验证的输入框name
                        required: true,// 验证条件:必填
                        email: true// 验证条件:格式为email
                    }
                },
                messages: {
                    loginName: {
                        required: "用户名不允许为空!"// 验证未通过的消息
                    },
                    loginPassword: {
                        required: "密码不允许为空!",
                        minlength: jQuery.format("密码至少输入 {0} 字符!")
                    },
                    email: {
                        required: "email不允许为空",
                        email: "邮件地址格式错误!"
                    }
                }

2、使用meta String方式进行验证,即验证内容与写入class中(注意meta String方式需要引入jquery.metadata.js文件)

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="jquery.metadata.js"></script>
<script type="text/javascript" src="jquery.validate.js"></script>

<form id="validate" action="admin/transfer!save.action" method="post">
<input type="text" class="required" name="entity.name" />
<input type="text" class="email" name="entity.email" />
<input type="submit" class="button" value="提 交" />
</form>
<script type="text/javascript">
$(document).ready(
function() {
$("#formId").validate({// #formId为需要进行验证的表单ID
   meta :"validate"// 采用meta String方式进行验证(验证内容与写入class中)
   errorElement :"div",// 使用"div"标签标记错误, 默认:"label"
   wrapper:"li",// 使用"li"标签再把上边的errorELement包起来
   errorClass :"validate-error",// 错误提示的css类名"error"
   onsubmit:true,// 是否在提交是验证,默认:true
   onfocusout:true,// 是否在获取焦点时验证,默认:true
   onkeyup :true,// 是否在敲击键盘时验证,默认:true
   onclick:false,// 是否在鼠标点击时验证(一般验证checkbox,radiobox)
   focusCleanup:false,// 当未通过验证的元素获得焦点时,并移除错误提示
});
})
</script>


注意:在Struts2应用中经常用遇到name="entity.name"形式的input表单(即name中包含逗号或其它特殊符号时),我们可以将上述名称以引号("")括起即可,如:

   rules: {
                    "entity.loginName": {// 需要进行验证的输入框name
                        required: true// 验证条件:必填
                    }
                },
                messages: {
                    "entity.loginName": {
                        required: "用户名不允许为空!"// 验证未通过的消息
                    }
                }

可给我email:happyczx@126.com 欢迎一起探讨有关java技术的问题
以上部分代码来源于payj开源支付系统,这个java开源项目里面有很多优秀的Struts2 spring hibernate jquery 等框架的应用源码,值得一看。在这里先推荐一下,呵呵。。。

。


附:

内置验证方式:
required() 返回:Boolean 必填验证元素
required(dependency-expression) 返回:Boolean 必填元素依赖于表达式的结果
required(dependency-callback) 返回:Boolean 必填元素依赖于回调函数的结果
remote(url) 返回:Boolean 请求远程校验。url通常是一个远程调用方法
minlength(length) 返回:Boolean 设置最小长度
maxlength(length) 返回:Boolean 设置最大长度
rangelength(range) 返回:Boolean 设置一个长度范围[min,max]
min(value) 返回:Boolean 设置最大值
max(value) 返回:Boolean 设置最小值
email() 返回:Boolean 验证电子邮箱格式
range(range) 返回:Boolean 设置值的范围
url() 返回:Boolean 验证URL格式
date() 返回:Boolean 验证日期格式(类似30/30/2008的格式,不验证日期准确性只验证格式)
dateISO() 返回:Boolean 验证ISO类型的日期格式
dateDE() 返回:Boolean 验证德式的日期格式(29.04.1994 or 1.1.2006)
number() 返回:Boolean 验证十进制数字(包括小数的)
digits() 返回:Boolean 验证整数
creditcard() 返回:Boolean 验证信用卡号
accept(extension) 返回:Boolean 验证相同后缀名的字符串
equalTo(other) 返回:Boolean 验证两个输入框的内容是否相同
phoneUS() 返回:Boolean 验证美式的电话号码


validate ()的可选项:
debug:进行调试模式(表单不提交): $(".selector").validate
({
   debug:true
})
把调试设置为默认: $.validator.setDefaults({
   debug:true
})
submitHandler:
通过验证后运行的函数,里面要加上表单提交的函数,否则表单不会提交 $(".selector").validate({
   submitHandler:function(form) {
$(form).ajaxSubmit();
   }
})
ignore:
对某些元素不进行验证 $("#myform").validate({
   ignore:".ignore"
})
rules:
自定义规则,key:value的形式,key是要验证的元素,value可以是字符串或对象 $(".selector").validate({
   rules:{
     name:"required",
     email:{
       required:true,
       email:true
     }
   }
})
messages:
自定义的提示信息key:value的形式key是要验证的元素,值是字符串或函数 $(".selector").validate({
   rules:{
     name:"required",
     email:{
       required:true,
       email:true
     }
   },
   messages:{
     name:"Name不能为空",
     email:{
       required:"E-mail不能为空",
       email:"E-mail地址不正确"
     }
   }
})
groups:
对一组元素的验证,用一个错误提示,用error Placement控制把出错信息放在哪里 $("#myform").validate({
groups:{
    username:"fname lname"
},
errorPlacement:function(error,element) {
     if (element.attr("name") == "fname" || element.attr("name") == "lname")
       error.insertAfter("#lastname");
     else
       error.insertAfter(element);
   },
   debug:true
})
Onubmit Boolean 默认:true
是否提交时验证 $(".selector").validate({
   onsubmit:false
})
onfocusout Boolean 默认:true 
是否在获取焦点时验证 $(".selector").validate({
   onfocusout:false
})
onkeyup Boolean 默认:true 
是否在敲击键盘时验证 $(".selector").validate({
   onkeyup:false
})
onclick Boolean 默认:true
是否在鼠标点击时验证(一般验证checkbox,radiobox) $(".selector").validate({
   onclick:false
})
focusInvalid Boolean 默认:true
提交表单后,未通过验证的表单(第一个或提交之前获得焦点的未通过验证的表单)会获得焦点 $(".selector").validate({
   focusInvalid:false
})
focusCleanup Boolean 默认:false
当未通过验证的元素获得焦点时,并移除错误提示(避免和 focusInvalid.一起使用) $(".selector").validate({
   focusCleanup:true
})
errorClass String 默认:"error"
指定错误提示的css类名,可以自定义错误提示的样式 $(".selector").validate({
   errorClass:"invalid"
})
errorElement String 默认:"label"
使用什么标签标记错误 $(".selector").validate
   errorElement:"em"
})
wrapper String
使用什么标签再把上边的errorELement包起来 $(".selector").validate({
   wrapper:"li"
})
errorLabelContainer Selector
把错误信息统一放在一个容器里面 $("#myform").validate({
   errorLabelContainer:"#messageBox",
   wrapper:"li",
   submitHandler:function() { alert("Submitted!") }
})

showErrors:
跟一个函数,可以显示总共有多少个未通过验证的元素 $(".selector").validate({
   showErrors:function(errorMap,errorList) {
        $("#summary").html("Your form contains " + this.numberOfInvalids() + " errors,see details below.");
        this.defaultShowErrors();
   }
})
errorPlacement:
跟一个函数,可以自定义错误放到哪里 $("#myform").validate({
rrorPlacement:function(error,element) { error.appendTo(element.parent("td").next("td"));
   },
   debug:true

})
success:
要验证的元素通过验证后的动作,如果跟一个字符串,会当做一个css类,也可跟一个函数 $("#myform").validate({
        success:"valid",
        submitHandler:function() { alert("Submitted!") }
})
highlight:
可以给未通过验证的元素加效果,闪烁等


addMethod(name,method,message)方法:
参数name是添加的方法的名字
参数method是一个函数,接收三个参数(value,element,param) value是元素的值,element是元素本身 param是参数,我们可以用addMethod来添加除built-in Validation methods之

外的验证方法 比如有一个字段,只能输一个字母,范围是a-f,写法如下:

$.validator.addMethod("af",function(value,element,params){
   if(value.length>1){
    return false;
   }
   if(value>=params[0] && value<=params[1]){
    return true;
   }else{
    return false;
   }
},"必须是一个字母,且a-f");
用的时候,比如有个表单字段的id="username",则在rules中写
username:{
   af:["a","f"]
}

addMethod的第一个参数,就是添加的验证方法的名子,这时是af
addMethod的第三个参数,就是自定义的错误提示,这里的提示为:"必须是一个字母,且a-f"
addMethod的第二个参数,是一个函数,这个比较重要,决定了用这个验证方法时的写法
如果只有一个参数,直接写,如果af:"a",那么a就是这个唯一的参数,如果多个参数,用在[]里,用逗号分开
}}}
!!Basics
[[Extends&Implements|Java Extends&Implements]]

!!Database
[[Demo: connect to SQLite in JAVA]]

!!Class&Function
[[ByteBuffer|Java ByteBuffer]]
[[Enum|Java Enum]]
!!Read from ByteBuffer
{{{
ByteBuffer buf = ByteBuffer.allocate(MAX_BYTES);

// put bytes into buffer
buf.put(bytes);

// read from buffer
byte[] dst = new byte[bufferSize];
buf.flip();
buf.get(dst, 0, bufferSize);

// move the left bytes in the buffer to the head
buf.compact();
}}}
# buf.position() can set current position
# both buf.put() and buf.get() read/write from current position
!!Pass the numerical values to the constructor for the enum
{{{
enum Ids {
  OPEN(100),
  CLOSE(200);

  private int value;    

  private Ids(int value) {
    this.value = value;
  }

  public int getValue() {
    return value;
  }
}
}}}
See the <html><a href="http://java.sun.com/j2se/1.5.0/docs/guide/language/enums.html">Sun Java Language Guide</a></html> for more information.
!!!difference between extends and implements
{{{
extends: only one
implements: more than one
}}}
!Functions
[[addEventListener]]

!Attrirbute
[[contentWindow]]

!Tools
[[format downloaded js codes -- js-beautify]]
!!! LDPC-2006-02-08 package
!!!! Creating a Parity Check Matrix
# pchk mtx对一个given code不是Unique的
# pchk mtx用sparse的格式存储在文件中,不是人可读的...但是可以用print-pchk程序读取

生成LDPC matrices
# 使用任意一种简单的方法生成一个初步的pchk mtx
# 向pchk mtx中add 1s,防止
## redundant:没有1的Row
## corresponding codeword bits always be zero:只有一个1的Row
# 如果初步的pchk mtx在每一列有偶数个1,则add further 1s
## 防止偶数个1的情况会使得rows加上0,从而至少有一个check会是冗余的@@(??)@@
## 至少会加上两个1(因为Rows的和只有1个1的情况也是undesirable),加的位置是在整个mtx中随机选取的
## 但是,在这一步加入的1的个数会被已经在第2步中加入的个数减少@@(??)@@
# 如果有需要,尽可能减少一对列再某一对行中有1,这将导致cycle
## 当出现这种情况,其中的一个1会在他所在的列中随机的移动到另一个位置。
## 这个过程会持续到没有这样的情况出现,或者10次移动后仍无法避免这种情况

evencol method:可以允许非规则码
evenboth mothod:...

make-pchk: 可以指定row:col的地方为1
make-ldpc: 随机生成,需要研究

使用make-ldpc程序,可以使用类似example2中的命令
{{{
Example 2: The two make-ldpc commands below both create a 20 by 40 low density parity check matrix with 30% of columns with two 1s, 60% of columns with three 1s, and 10% of columns with seven 1s. The transpose of the parity check matrix is then printed in sparse format.

make-ldpc ldpc.pchk 20 40 1 evenboth 0.3x2/0.6x3/0.1x7 
make-ldpc ldpc.pchk 20 40 1 evenboth 3x2/6x3/1x7
print-pchk -t ldpc.pchk

Transpose of parity check matrix in ldpc.pchk (sparse format):

 0: 13 16
 1:  9 18
 2:  1 10
 3:  3 15
 4:  4 14
 5: 14 17
 6:  4  5
 7:  1  8
 8:  0  4
 9:  9 14
10:  5  8
11:  6 16
12:  2 12 19
13:  3 17 18
14:  2 16 17
15:  2 11 18
16: 12 13 19
17:  7 13 18
18:  2  5 11
19: 10 12 14
20:  1  8 16
21: 10 18 19
22:  3  6 17
23:  7 11 12
24:  1  2 19
25:  0  6  7
26:  5  8 15
27:  1  4  7
28:  6 13 19
29:  3  4 11
30:  3  8 17
31:  4  5  9
32:  0 10 15
33:  7 11 13
34:  8 12 19
35:  0  2 10
36:  0  5  9 11 15 17 18
37:  0  1  2  6  7 14 16
38:  0  1  3  9 12 13 15
39:  3  6  9 10 14 15 16
}}}

!!! 规则LDPC码和非规则LDPC码
规则码即所有的var node有相同的degree
非规则码即degree不同

非规则码的性能优于规则码

!!!! LDPC的译码
从var node来看,degree越大越好,能从更多的相邻check node处得到更多的置信信息,从而更加准确的判断出它的正确值。
从check node来看,degree越小越好,能给相邻的var node提供的消息置信度越高。

因此,非规则码可以更灵活的实现折中。
在非规则码的译码中,degree高的var node接收到的置信消息多,迅速实现正确译码,他们可以给相邻的check node传送更加有效的信息,而这些check node有可以给与它们相邻的degree更小的var node更多的信息,从而产生波浪效应。

!!! LDPC码的性能分析
# Density Evolution: 迭代计算节点间传递信息的概率密度函数的方法
# Gaussian Approximation: 迭代计算节点间传递信息的pdf符合高斯分布->传递均值即可
# EXIT (Extrinsic Information Transform Chart)
!TexMaker
<<slider chkTexMakerCompile  [[TexMaker编译顺序]] 编译顺序>>
<<slider chkTexMakerCompile1 [[TexMaker设置主文档]] 设置主文档>>

!Grammar
[[Latex空格]]


!!Questions
[[Getting two matrices in one line]]
!!!Latex Wiki
http://en.wikibooks.org/wiki/LaTeX
http://www.artofproblemsolving.com/Wiki/index.php/LaTeX:Commands

!!!Latex Math Symbols
http://www.math.union.edu/~dpvc/jsMath/symbols/welcome.html
|!Source|!Output|h
|{{{\[\alpha\]}}}|\[\alpha\]|
|{{{\[\sum\]}}}|\[\sum\]|
|{{{\[x^2\]}}}|\[x^2\]|
|{{{\[x_2\]}}}|\[x^2\]|
*use {{{\[ \]}}} to centralize
*use {{{$ $}}} to be in a line
{{{
\alpha		\iota		\varrho
\beta		\kappa 	  	\sigma
\gamma		\lambda		\varsigma
\delta		\mu		 \tau
\epsilon	\nu		\upsilon
\varepsilon	\xi 		\phi
\zeta		o		\varphi
\eta		\pi		\chi
\theta		\varpi 		\psi
\vartheta	\rho 		\omega
\Gamma		\Xi 		\Phi
\Delta		\Pi 		\Psi
\Theta		\Sigma 		\Omega
\Lambda		\Upsilon
}}}
!!Math Formula
{{{
$$
{\bf y} = {\bf x} + a_1{\bf n} + a_2{\bf b}
$$
}}}
$$
{\bf y} = {\bf x} + a_1{\bf n} + a_2{\bf b}
$$
{{{
两个quad空格	a \qquad b		两个m的宽度
quad空格	        a \quad b		一个m的宽度
大空格	        a\ b		1/3m宽度
中等空格	        a\;b		2/7m宽度
小空格	        a\,b		1/6m宽度
没有空格	        ab		
紧贴	        a\!b		缩进1/6m宽度
}}}
For our communication system model, tested with noise: Y~~n~~=AX~~n-a~~+B+E~~n~~.
The signal-to-noise ratio is: SNR = Var{AX~~n~~+B}/Var{E~~n~~} = |A|^^2^^Var{X~~n-a~~}/Var{E~~n~~} = A^^2^^σ~~x~~^^2^^/σ~~e~~^^2^^ ≈ Ahat^^2^^ * σhat~~x~~^^2^^/σhat~~e~~^^2^^
where 
σ~~x~~^^2^^=<x[n]-mu~~x~~>^^2^^ = <x^^2^^[n]> (mu~~x~~=0)
σ~~e~~^^2^^=<e^^2^^[n]>
and σhat~~x~~^^2^^ and σhat~~e~~^^2^^ are finite-duration time averages.
SNR is an appropriate figure of merit (FOM) for the design.
There is a flaw in our numerical characterization method:
{{{
x[n](white noise) ----------> |Communication System| --------->y[n]
}}}
We should really test with band-limited white noise (colored noise) as the message:
{{{
w[n] -------------> |hlp[n]|--------------->|Communication System| --------->y[n]
                                  x[n]
                             BL white noise
______________________            ___________________________________________
         MATLAB                                          Simulink
}}}
Previously:
Cov{Y~~n+m~~, X~~n~~} = Aσ~~x~~^^2^^δ[m-a]=γ~~yx~~[m]
i.e. Γ~~yx~~(e^^jw^^) = Aσ~~x~~^^2^^e^^-jwa^^=Ae^^-jwa^^Γ~~xx~~(e^^jw^^)     Γ~~xx~~(e^^jw^^) =σ~~x~~^^2^^
Band-limited:
H~~lp~~(e^^jw^^) = 1, |w| < w~~c~~
                                   0, w~~c~~<|w|<=pi
====> Γ~~yx~~(e^^jw^^) =Ae^^-jwa^^Γ~~xx~~(e^^jw^^) = Ae^^-jwa^^|H~~lp~~(e^^jw^^)|^^2^^σ~~w~~^^2^^ = Aσ~~w~~^^2^^|H~~lp~~(e^^jw^^)|^^2^^
γ~~yx~~[m] = Aσ~~w~~^^2^^(w~~c~~/pi)sinc((w~~c~~/pi)(n-a))
Once again, there will be a peak at n=a. We can do the linear regression as before to compute Ahat, Bhat, ehat[n], and σhat~~e~~^^2^^. We can compute the SNR. But ideal ~LPFs are unrealizable. We use the Filter Design and Analysis Tool in the Signal Processing Toolbox to approximate an idea LPF.
# 之前需要先create recovery disk
# 重装系统后 用ImageX得到recovburncd.exe
{{{
提取 cdrivebackup.wim 的1号镜像,假设目标为D盘:

  ImageX /apply /verify Q:\factoryrecovery\cdrivebackup.wim 1 d:\

  网上还提到过下面这个,不过实际上没有效到过,里面有一个winPE系统,似乎是引导CD?

  ImageX /apply /verify Q:\factoryrecovery\sdrivebackup.wim 1 s:\

  经过实验,d盘下的\Program Files\Lenovo\factory recovery\recovburncd.exe直接拿出来到C就可以用

  不过要是已刻过盘了,那就会在Q里面留下记录,解决方法我还不知道,不过可以通过新增启动参量到BCD文件,变为双系统,不过意义半大也
}}}
# 复制到相应文件夹即可
/***
|''Name:''|LoadRemoteFileThroughProxy (previous LoadRemoteFileHijack)|
|''Description:''|When the TiddlyWiki file is located on the web (view over http) the content of [[SiteProxy]] tiddler is added in front of the file url. If [[SiteProxy]] does not exist "/proxy/" is added. |
|''Version:''|1.1.0|
|''Date:''|mar 17, 2007|
|''Source:''|http://tiddlywiki.bidix.info/#LoadRemoteFileHijack|
|''Author:''|BidiX (BidiX (at) bidix (dot) info)|
|''License:''|[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D ]]|
|''~CoreVersion:''|2.2.0|
***/
//{{{
version.extensions.LoadRemoteFileThroughProxy = {
 major: 1, minor: 1, revision: 0, 
 date: new Date("mar 17, 2007"), 
 source: "http://tiddlywiki.bidix.info/#LoadRemoteFileThroughProxy"};

if (!window.bidix) window.bidix = {}; // bidix namespace
if (!bidix.core) bidix.core = {};

bidix.core.loadRemoteFile = loadRemoteFile;
loadRemoteFile = function(url,callback,params)
{
 if ((document.location.toString().substr(0,4) == "http") && (url.substr(0,4) == "http")){ 
 url = store.getTiddlerText("SiteProxy", "/proxy/") + url;
 }
 return bidix.core.loadRemoteFile(url,callback,params);
}
//}}}
!!!2011-4-30
{{{
选择恐惧症 这是他说的一个词
我也不知道自己是不是有同样的恐惧

发现自己很懦弱 一旦遇到不想面对的事情
就像逃避 
不想改变现状
心里却有一个声音喊着 要改变
然后也不知道 到底是要改变哪个现状
是在一起的现状 还是要分开的现状
可笑的人

不够了解自己的欲望
不知道欲望是从哪里来的
不知道排除欲望应该怎么做
未来是怎么样的规划
没有主见
容易被说服
凭着感觉做决定
看起来会调研很多
最后做决定的时候 还是感觉

因为不想直面 所以用很多隐晦的词
用很多隐晦的语句
也不是说不过去了

加拿大 还是 美国
Alberta 还是 CMU
工学 还是 工程
移民 还是 工作
钱 还是 名声
感情 还是 理性

我要好好考虑

如果只说学校,CMU和UA,肯定是CMU。
CMU的优势在于,名声大,在美国,工作更加好找,劣势仅仅是读PHD可能不是很现实
UA的优势在于,是工学硕士,读PHD比较方便;劣势就是名声小,工作机会没有美国多。
名声小,限于回国来说。
在这一点上,CMU胜出。

最重要的一点,是以后的打算。
如果是去CMU,那么就是1年半读完,然后工作,赚钱,还小姨钱,回国。
好处是,
以INI的名气,在美国找到工作应该不难。
问题就在于,
2-3年之后回国,肯定没有绿卡,户口怎么办?
国内认不认可也需要考量
还有要还钱,钱的事情单独考虑
如果是去UA,那么就是2年读完,然后工作,赚钱,得到绿卡,然后回国发展or去美国发展。
好处是,
可以拿到加拿大的绿卡(拿到绿卡的好处福利更好,如果有可能,可以让爸妈和小姨家一起在加拿大)
不用背负债务(家里的钱可以作为一笔资金,投资或者其他)
问题也是
国内认不认可,而且肯定是比CMU的认可度小
这一点上,可能去加拿大比较好。
但是,家里关心的是回国,回国的话,CMU肯定比UA好听,但是从CMU回来就只能带一身技术回来,没有绿卡
绿卡的好处就是有很好的福利

钱的问题
CMU的话
总共学费是56k刀,住宿费算600刀*24 = 14.4k刀,其他费用算10k,总共下来就是80k刀,也就是56W,算60W。
家里的钱是65W + 35W
如果是去CMU,家里可以剩5W,但是以后要还小姨40W+,算45W。
那么算年薪8W刀,可能需要2-3年还清。
那在美国工作赚的钱就花完了。再回国?
UA的话,基本上不用钱,花个15W差不多了,生活得很富裕。所以也不需要小姨的钱,所以家里还剩65-15W = 50W
50W加贷款可以在上海买套房子,出租之类的。或者存着。
那么之后在UA的工作,算年薪是4W刀,2-3年可以赚12W刀,除去生活费,算存款5W刀,也就是30W RMB了。
这样看来,肯定是UA了

所以 和家里的对话基本上是这样
--介绍OFFER
F:有一个学校给全奖了,UA,加拿大排第5的学校
--
F:我想去
M:不好,别去。1)没听过,国内不认;2)钱不是问题;3)不需要移民;4)不如美国的其他学校
F:1)国内认不认,都一样;CMU的确名气大一些,但是回国内找工作,是凭能力了,因为已经在国外工作过,所以不可能只看学校;
2)钱虽然不是问题,(计算一下),生活压力小很多;而且,已经20多岁了,不想总花家里的钱
3)移民,的确不移民,但是绿卡的福利的确诱人,而且可以来加拿大和小姨他们一起生活
4)第一,美国的其他学校和CMU一样,也要钱,所以回到问题2)上;第二,美国的其他学校虽然名气大,但是在本土找工作的话,还不如CMU,而在加拿大本土找工作的话,UA名气很大,要考虑location,要考虑竞争,就比如说,在北京找工作,可能北邮的只能去在北京的小公司,但是在江西找工作,因为北邮没有人去的,所以本土的学校招很多人。要考虑竞争因素。
总结一下就是,去CMU,花钱,不一定真的能找到很好的工作,还有债务,有风险;去UA,不花钱,生活压力小,也是读研,以后还可以读好一点的PHD,自己的规划。
--
M:和小姨商量
--补充(虚夸)
F:那个教授很厉害,招的人很少,很想要我,研究方向和我吻合,读博士比较方便(有研究,而美国都是by course,没有研究)


其实 还是要考虑自己 到底想去哪里
CMU是真的dream school 真的很希望去美国的名校生活
但是如果考虑到未来的发展和生活 应该是UA才是更加对的选择
背负债务的责任的确很大 家里的钱 以后可以用来投资什么的 不想一下子这么花完

即使没有他的因素 理性的考虑是不是也应该是UA?

总会觉得 去UA是感情的因素
但是呢?
我只是在逃避而已 只想去一个dream school而已
只是有诱惑而已
满足诱惑的背后 生活压力很大 很大
那么
分不清 哪个决定 才是理性的 哪个 才是带有感情因素的

希望明天的自己能有答案

}}}

!!!2011-4-28
{{{
在清华没有事情做的时候 翻出来以前的照片
竟会感慨 四年的变化

还翻到 在同一个场景 时隔2年照过的相
那个时候 我们还未相识

每做一件事情 就感觉离得远了一点
所以总不愿去做这些事情
可是却被push着一件件的完成
然后感觉一点点离开

单独相处 还会很尴尬
没有话想说
但是总觉得不应该是这样
才发现
自己是多么不适应交朋友
就连见过这么多次面 在一起相处这么久
一旦离开了中介体 就好像陌生人一样

有一些不愿意被人发现的地方总会被发现
既然发现了 就发现了吧
}}}


!!!2011-4-24 迷藏
{{{
因为熄灯后上不了网 连接不到吾志
有写东西的冲动 找不到地方
于是想起来这里

即使没有网络 也能够一直存在的地方
这样 也会让心里感觉到温暖

开始希望通宵供电
头脑里开始回忆起夏天
有微风的晚上 周围黑暗 很安静的晚上
却依然可以连接到网络

网络 真的成为了生命中离不开的东西了

有一个不想被人发现的地方 被发现了
于是删除了所有奇怪的话
包括那一句 永远都不要有人发现这里

最终还是发现了
不过找到了新的地方 也算是一种交换吧

有的时候发现自己是个矛盾的人
心里似乎有一个声音说 快来找到我吧
却表现出来的却是 不要找到我 不要发现我

就像捉迷藏
即不想被找到 又不想永远不被找到
这么说来 捉迷藏这个游戏 竟然会让人觉得有一些恐怖呢
费劲心思的躲起来 明明是希望最后被找到
却要在找到的时候叹气说 居然被找到了
要是永远都没有找到
是不是就代表放弃了 不要了 分开了

所以说 总是矛盾的存在
心理 和 行为

最后竟然决定去了CMU
代表着就要分开了
无论如何 都要分开了
就和自己曾经预想的一样
说不出心里面的感受
就和捉迷藏的心情 是一样的
对未来的恐惧 和 希望

其实 想说 迷藏 的意思
不只是捉迷藏
还有 迷失的宝藏
迷失
和
宝藏
都是很重要的意思
只是 似乎连自己都不是很懂其中的意思

记忆力减退 算术能力降低 心不在焉
会突然一下难过
会让自己处于神经失常的状态 嘻嘻哈哈 胡言乱语
控制不了自己
好像 有一个人格会占有现在的自己
就像每次周围很黑暗很安静的时候 只能听见自己敲击键盘的声音的时候
总会有一个和白天很不同的人格 接管自己的身体和思想
不过 并不是人格分裂
只是感觉 是另一个自己而已

所以说
未来 总是令人生畏的
}}}



!!!2010-12-6
{{{
The way you choose
The way you go

Two options
and choose one

do not try to avoid it
do not try to flee away

face it
and say out
what u r thinking
How did u feel like

Then terminate it
and
restart

-- for future after application
}}}

!!!2010-12-1
{{{
CAPTCHA finished~~
BlueSense Start~
Begin to learn sensor in Android
}}}


!!!2010-11-21 aM
{{{
am
v.s
Am
v.s
aM
}}}

!!2010-11-21 是谁说 梦是记不住的
{{{
Another dream.
好奇怪 居然能够把梦记下来
而且这几天的梦 都能记下来
不是说 梦 都是记不住的么

那记下来的 是梦么
还是 真正的梦 就真的不记得了 自己却都不知道

梦见已经到了USA上学 课上在学好像是信息隐藏之类的课程
Prof讲的很好,但很严厉

上课的时候,一个娃在玩一个类似iPad的 游戏机
可以投影出3D画面 被老师抓到了 嘲笑了一下- -
然后继续讲课

我好像是第一次来听课 没有选这门课 但是因为喜欢 所以来听

后来老师点名 很多人代答
老师却都发现了 说 不要以为你们换了件衣服代答我就不认识了
我瞬间觉得这个Prof好厉害 好BT- -
但是仍然很崇敬他 因为他确实 讲的课很好

然后开始想 国外的Edu就是不一样
YY了- -

后来梦见坐bus 不知道做哪一辆回去
好不容易上了一辆车 问司机
司机是个小MM
然后告诉我在某个站换6路 可是我却没有告诉她全部的计划
只是说要去XXX 却没说 还没决定是去A还是去B
所以觉得应该在一个十字路口下 比较好做选择 而不是在这个地方下
没有选择 只能去A了

选择 这种让步 是不是一种 退缩

后来梦见在下车的地方 有一群人上去那个bus
然后又有一个人 以奇怪的姿势走了下来
像是低着头 一边给AK47类似的枪上膛 一边走 很滑稽的样子

可是突然 他就开枪 把一个人射杀了
嘴里一直念着 女王 你是否给予我权利?

我开始不知道 他这句话的意思 后来居然就明白了
这个国家有女王 和 政府 互不相干 但都有至高的权利
那个人的意思 是在向女王请示 是否能射杀这个人
估计女王用类似脑电波的方法 告诉他 可以

那个人的口中 仍然继续念着 女王 你是否给予我权利
我觉得不能让他继续射杀了
于是想要 集合很多人 挡在他前面 用群众的力量 维护生命

后来?
后来就不记得了 不知道是自己起床了 还是忘记了

不知道是 故事结束了 还是 自己忘记了

Aaaaaa~估计是昨天写PS的框架写到3点让自己神经错乱了- -
}}}

!!2010-11-17
{{{
music
流着泪说分手
}}}

{{{
[[recent life]]
ipod里放五月天的演唱会,听着听着居然笑了起来

php jQuery

PS框架 飞跃

gmail很好用 越来越爱google

公司的事情只有一件 却忙了两天

Panamanian 想要调通jSocket 然后从晚上一直调到深夜
失败告终>.<

早上起床太晚 急忙中觉得少带了什么 扯下U盘 收起书 就急忙走了
后来发现没带手机和学生卡
还好门禁卡在

越来越喜欢tiddlywiki git也很好用

比较高强度的工作了两天吧 感觉全身都很疼 不过还好
说不出心情是好还是不好
估计是不错吧
要不也不会听歌听到笑出来

在和平东桥的时候听到店里在放一首歌 感觉很好听
然后看见车已经来了 急忙中记下两句歌词 准备回来baidu~
 
想把手机刷到android 2.1
好好学jQuery

最近财政比较紧张 还要准备合寄

明天可以去拿护照了 还在考虑明天是不是请假不去上班

想起来前段时间超级想写《匆匆》的书评 最后也因为太多事情没有写成

到现在已经没有欲望了- -

最近又开始看《橙》
喜欢名字 喜欢书皮 也喜欢里面的文字
很自由 很松散
是生活

最近过的还不错
感冒也好了
希望申请顺利吧~

Fighting~
}}}

!!2010-11-15
{{{
Wow, the tiddlywiki is cool.
I heard it from my boss in Ericsson, and found it rather useful, esp with git.
I can write something done on it and put it on the website~
Greate~
}}}
通过把耗时长的函数用c语言实现,并编译成mex函数可以加快执行速度。

Matlab本身是不带c语言的编译器的,所以要求你的机器上已经安装有VC,BC或Watcom C中的一种。
如果你在安装Matlab时已经设置过编译器,那么现在你应该就可以使用mex命令来编译c语言的程序了。
如果当时没有选,就在Matlab里键入mex -setup,下面只要根据提示一步步设置就可以了。
需要注意的是,较低版本的在设置编译器路径时,只能使用路径名称的8字符形式。比如我用的VC装在路径C:\PROGRAM FILES\DEVSTUDIO下,那在设置路径时就要写成:“C:\PROGRA~1”这样设置完之后,mex就可以执行了。

为了测试你的路径设置正确与否,把下面的程序存为hello.c。
{{{
/*hello.c*/
#include "mex.h" 
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) 
{ mexPrintf("hello,world!\n"); 
} 
}}}

假设你把hello.c放在了C:\TEST\下,在Matlab里用CD C:\TEST\ 将当前目录改为C:\ TEST\(注意,仅将C:\TEST\加入搜索路径是没有用的)。现在敲:
mex hello.c 
如果一切顺利,编译应该在出现编译器提示信息后正常退出。如果你已将C:\TEST\加
入了搜索路径,现在键入hello,程序会在屏幕上打出一行:
hello,world! 

看看C\TEST\目录下,你会发现多了一个文件:HELLO.DLL。
* 在R2009b之后是hello.mexw32 不使用dll作为后缀名了

这样,第一个mex函数就算完成了。分析hello.c,可以看到程序的结构是十分简单的,整个程序由一个接口子过程 mexFunction构成。
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) 
前面提到过,Matlab的mex函数有一定的接口规范,就是指这
{{{
nlhs:输出参数数目 
plhs:指向输出参数的指针 
nrhs:输入参数数目 
}}}

例如,使用
[a,b]=test(c,d,e)
调用mex函数test时,传给test的这四个参数分别是
      2,plhs,3,prhs
其中: 
prhs[0]=c 
prhs[1]=d 
prhs[2]=e 

当函数返回时,将会把你放在plhs[0],plhs[1]里的地址赋给a和b,达到返回数据的目的。  
细心的你也许已经注意到,prhs[i]和plhs[i]都是指向类型mxArray类型数据的指针。 这个类型是在mex.h中定义的,事实上,在Matlab里大多数数据都是以这种类型存在。当然还有其他的数据类型,可以参考Apiguide.pdf里的介绍。 

为了让大家能更直观地了解参数传递的过程,我们把hello.c改写一下,使它能根据输入参数的变化给出不同的屏幕输出:
{{{
//hello.c 2.0 
#include "mex.h" 
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) 
{
int i; 
i=mxGetScalar(prhs[0]); 
if(i==1) 
  mexPrintf("hello,world!\n"); 
else 
  mexPrintf("大家好!\n"); 
}
}}}

将这个程序编译通过后,执行hello(1),屏幕上会打出: 
          hello,world! 
而hello(0)将会得到: 
           大家好! 

现在,程序hello已经可以根据输入参数来给出相应的屏幕输出。
在这个程序里,除了用到了屏幕输出函数mexPrintf(用法跟c里的printf函数几乎完全一样)外,还用到了一个函数:mxGetScalar,调用方式如下: 
   i=mxGetScalar(prhs[0]); 

"Scalar"就是标量的意思。在Matlab里数据都是以数组的形式存在的,mxGetScalar的作用就是把通过prhs[0]传递进来的mxArray类型的指针指向的数据(标量)赋给C程序里的变量。
这个变量本来应该是double类型的,通过强制类型转换赋给了整形变量i。既然有标量,显然还应该有矢量,否则矩阵就没法传了。看下面的程序: 
{{{
//hello.c 2.1 
#include "mex.h" 
void mexFunction(int nlhs, mxArray *plhs[], 
int nrhs, const mxArray *prhs[]) 
{ 
int *i; 
i=mxGetPr(prhs[0]); 
if(i[0]==1) 
  mexPrintf("hello,world!\n"); 
else 
  mexPrintf("大家好!\n"); 
}  
}}}

这样,就通过mxGetPr函数从指向mxArray类型数据的prhs[0]获得了指向double类型的指针。

但是,还有个问题,如果输入的不是单个的数据,而是向量或矩阵,那该怎么处理呢 ?
通过mxGetPr只能得到指向这个矩阵的指针,如果我们不知道这个矩阵的确切大小,就 
没法对它进行计算。 
为了解决这个问题,Matlab提供了两个函数mxGetM和mxGetN来获得传进来参数的行数 和列数。
下面例程的功能很简单,就是获得输入的矩阵,把它在屏幕上显示出来: 
{{{
//show.c 1.0 
#include "mex.h" 
#include "mex.h" 
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) 
{ 
double *data; 
int M,N; 
int i,j; 
data=mxGetPr(prhs[0]); //获得指向矩阵的指针 
M=mxGetM(prhs[0]); //获得矩阵的行数 
N=mxGetN(prhs[0]); //获得矩阵的列数 
for(i=0;i<M;i++) 
{   for(j=0;j<N;j++) 
     mexPrintf("%4.3f  ",data[j*M+i]); 
     mexPrintf("\n"); 
  }
} 
}}}

编译完成后,用下面的命令测试一下: 
  a=1:10; 
  b=[a;a+1]; 
  show(a) 
  show(b) 

需要注意的是,在Matlab里,矩阵第一行是从1开始的,而在C语言中,第一行的序数为零,Matlab里的矩阵元素b(i,j)在传递到C中的一维数组大data后对应于data[j*M+i] 。 
输入数据是在函数调用之前已经在Matlab里申请了内存的,由于mex函数与Matlab共用同一个地址空间,因而在prhs[]里传递指针就可以达到参数传递的目的。但是,输出参数却需要在mex函数内申请到内存空间,才能将指针放在plhs[]中传递出去。由于返回指针类型必须是mxArray,所以Matlab专门提供了一个函数:mxCreateDoubleMatrix来实现内存的申请,函数原型如下: 
{{{
   mxArray *mxCreateDoubleMatrix(int m, int n, mxComplexity ComplexFlag) 
   m:待申请矩阵的行数 
   n:待申请矩阵的列数 
}}}

为矩阵申请内存后,得到的是mxArray类型的指针,就可以放在plhs[]里传递回去了。
但是对这个新矩阵的处理,却要在函数内完成,这时就需要用到前面介绍的mxGetPr。
使用 mxGetPr获得指向这个矩阵中数据区的指针(double类型)后,就可以对这个矩阵进行各种操作和运算了。
下面的程序是在上面的show.c的基础上稍作改变得到的,功能是将输  
{{{
//reverse.c 1.0 
#include "mex.h" 
void mexFunction(int nlhs, mxArray *plhs[], 
    int nrhs, const mxArray *prhs[]) 
{ 
double *inData; 
double *outData; 
int M,N; 
int i,j; 
inData=mxGetPr(prhs[0]); 
M=mxGetM(prhs[0]); 
N=mxGetN(prhs[0]); 
plhs[0]=mxCreateDoubleMatrix(M,N,mxREAL); 
outData=mxGetPr(plhs[0]); 
for(i=0;i<M;i++) 
  for(j=0;j<N;j++) 
   outData[j*M+i]=inData[(N-1-j)*M+i]; 
} 
}}}

当然,Matlab里使用到的并不是只有double类型这一种矩阵,还有字符串类型、稀疏矩阵、结构类型矩阵等等,并提供了相应的处理函数。本文用到编制mex程序中最经常遇到的一些函数,其余的详细情况清参考Apiref.pdf。 
通过前面两部分的介绍,大家对参数的输入和输出方法应该有了基本的了解。具备了这些知识,就能够满足一般的编程需要了。但这些程序还有些小的缺陷,以前面介绍的re由于前面的例程中没有对输入、输出参数的数目及类型进行检查,导致程序的容错性很差,以下程序则容错性较好
{{{
#include "mex.h" 
void mexFunction(int nlhs, mxArray *plhs[],  int nrhs, const mxArray *prhs[]) 
{ 
double *inData; 
double *outData; 
int M,N; 
//异常处理 
//异常处理 
if(nrhs!=1) 
    mexErrMsgTxt("USAGE: b=reverse(a)\n"); 
  if(!mxIsDouble(prhs[0])) 
   mexErrMsgTxt("the Input Matrix must be double!\n"); 
   inData=mxGetPr(prhs[0]); 
   M=mxGetM(prhs[0]); 
   N=mxGetN(prhs[0]); 
   plhs[0]=mxCreateDoubleMatrix(M,N,mxREAL); 
   outData=mxGetPr(plhs[0]); 
   for(i=0;i<M;i++) 
     for(j=0;j<N;j++) 
     outData[j*M+i]=inData[(N-1-j)*M+i]; 
  } 
}}}

在上面的异常处理中,使用了两个新的函数:mexErrMsgTxt和mxIsDouble。MexErrMsgTxt在给出出错提示的同时退出当前程序的运行。MxIsDouble则用于判断mxArray中的数据是否double类型。当然Matlab还提供了许多用于判断其他数据类型的函数,这里不加详述。 
需要说明的是,Matlab提供的API中,函数前缀有mex-和mx-两种。带mx-前缀的大多是对mxArray数据进行操作的函数,如mxIsDouble,mxCreateDoubleMatrix等等。而带mx前缀的则大多是与Matlab环境进行交互的函数,如mexPrintf,mxErrMsgTxt等等。了解了这一点,对在Apiref.pdf中查找所需的函数很有帮助。

至此为止,使用C编写mex函数的基本过程已经介绍完了
[[TiddlyWiki|TiddlyWikiHelp]]
[[LatexHelp]]
[[MainMenu]]
![[Research|research.html]]
[[Research Diary]]
[[希腊字母读音表]]
[[Notes for Papers]]
[[Research Topics]]
!Project
[[Past Projects]]
!Course
[[ECE502|ECE502: Probability, Random Variables and Stochastic Processess]]
[[ECE541|ECE541: Digital Signal Processing]]
[[ECE583|ECE583: Digital Communications]]
[[ECE740|ECE740: Convex Optimization for Engineers]]
[[ECE780|ECE780: Wireless Communication Networks]]
!Langauge
[[Matlab]]
[[PHP]]
[[Java]]
[[Javascript]]
[[JQuery]]
[[HTML]]
[[CSS]]
!Platform
[[Apache]]
!Tool
[[VIM]]
[[UltraEdit]]
[[SVN]]
[[GIT]]
[[MySQL]]
[[FTP]]
[[Word]]
[[Tiddlywiki]]
[[GTD]]
[[Latex]]
!Software
[[Eclipse&MyEclipse]]
[[Chrome]]
[[Visio]]
[[SPlayer]]
[[FooBar]]
[[MindManager]]
!System
[[Windows]]
[[Ubuntu]]
[[Android]]
!My Life
[[Photography]]
[[Cook]]
[[Others]]
![[Inspiration]]
<!--{{{-->
<script src="jsMath/jsMath.js"></script>
<!--}}}-->
/***
|Name|MatchTagsPlugin|
|Source|http://www.TiddlyTools.com/#MatchTagsPlugin|
|Documentation|http://www.TiddlyTools.com/#MatchTagsPluginInfo|
|Version|2.0.6|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Description|'tag matching' with full boolean expressions (AND, OR, NOT, and nested parentheses)|
!!!!!Documentation
> see [[MatchTagsPluginInfo]]
!!!!!Revisions
<<<
2011.10.28 2.0.6 added .matchTags CSS class to popups to enable custom styling via StyleSheet
2011.01.23 2.0.5 fix core tweak for TW262+: adjust code in config.filters['tag'] instead of filterTiddlers()
2010.08.11 2.0.4 in getMatchingTiddlers(), fixed sorting for descending order (e.g, "-created")
| please see [[MatchTagsPluginInfo]] for additional revision details |
2008.02.28 1.0.0 initial release
<<<
!!!!!Code
***/
//{{{
version.extensions.MatchTagsPlugin= {major: 2, minor: 0, revision: 6, date: new Date(2011,10,28)};

// store.getMatchingTiddlers() processes boolean expressions for tag matching
//    sortfield (optional) sets sort order for tiddlers - default=title
//    tiddlers (optional) use alternative set of tiddlers (instead of current store)
TiddlyWiki.prototype.getMatchingTiddlers = function(tagexpr,sortfield,tiddlers) {

	var debug=config.options.chkDebug; // abbreviation
	var cmm=config.macros.matchTags; // abbreviation
	var r=[]; // results are an array of tiddlers
	var tids=tiddlers||store.getTiddlers();
	if (tids && sortfield) tids=store.sortTiddlers(tids,sortfield);
	if (debug) displayMessage(cmm.msg1.format([tids.length]));

	// try simple lookup to quickly find single tags or tags that
	// contain boolean operators as literals, e.g. "foo and bar"
	for (var t=0; t<tids.length; t++)
		if (tids[t].isTagged(tagexpr)) r.pushUnique(tids[t]);
	if (r.length) {
		if (debug) displayMessage(cmm.msg4.format([r.length,tagexpr]));
		return r;
	}
	
	// convert expression into javascript code with regexp tests,
	// so that "tag1 AND ( tag2 OR NOT tag3 )" becomes
	// "/\~tag1\~/.test(...) && ( /\~tag2\~/.test(...) || ! /\~tag3\~/.test(...) )"

	// normalize whitespace, tokenize operators, delimit with "~"
	var c=tagexpr.trim(); // remove leading/trailing spaces
	c = c.replace(/\s+/ig," "); // reduce multiple spaces to single spaces
	c = c.replace(/\(\s?/ig,"~(~"); // open parens
	c = c.replace(/\s?\)/ig,"~)~"); // close parens
	c = c.replace(/(\s|~)?&&(\s|~)?/ig,"~&&~"); // &&
	c = c.replace(/(\s|~)AND(\s|~)/ig,"~&&~"); // AND
	c = c.replace(/(\s|~)?\|\|(\s|~)?/ig,"~||~"); // ||
	c = c.replace(/(\s|~)OR(\s|~)/ig,"~||~"); // OR
	c = c.replace(/(\s|~)?!(\s|~)?/ig,"~!~"); // !
	c = c.replace(/(^|~|\s)NOT(\s|~)/ig,"~!~"); // NOT
	c = c.replace(/(^|~|\s)NOT~\(/ig,"~!~("); // NOT(
	// change tag terms to regexp tests
	var terms=c.split("~"); for (var i=0; i<terms.length; i++) { var t=terms[i];
		if (/(&&)|(\|\|)|[!\(\)]/.test(t) || t=="") continue; // skip operators/parens/spaces
		if (t==config.macros.matchTags.untaggedKeyword)
			terms[i]="tiddlertags=='~~'"; // 'untagged' tiddlers
		else
			terms[i]="/\\~"+t+"\\~/.test(tiddlertags)";
	}
	c=terms.join(" ");
	if (debug) { displayMessage(cmm.msg2.format([tagexpr])); displayMessage(cmm.msg3.format([c])); }

	// scan tiddlers for matches
	for (var t=0; t<tids.length; t++) {
	 	// assemble tags from tiddler into string "~tag1~tag2~tag3~"
		var tiddlertags = "~"+tids[t].tags.join("~")+"~";
		try { if(eval(c)) r.push(tids[t]); } // test tags
		catch(e) { // error in test
			displayMessage(cmm.msg2.format([tagexpr]));
			displayMessage(cmm.msg3.format([c]));
			displayMessage(e.toString());
			break; // skip remaining tiddlers
		}
	}
	if (debug) displayMessage(cmm.msg4.format([r.length,tagexpr]));
	return r;
}
//}}}
//{{{
config.macros.matchTags = {
	msg1: "scanning %0 input tiddlers",
	msg2: "looking for '%0'",
	msg3: "using expression: '%0'",
	msg4: "found %0 tiddlers matching '%1'",
	noMatch: "no matching tiddlers",
	untaggedKeyword: "-",
	untaggedLabel: "no tags",
	untaggedPrompt: "show tiddlers with no tags",
	defTiddler: "MatchingTiddlers",
	defTags: "",
	defFormat: "[[%0]]",
	defSeparator: "\n",
	reportHeading: "Found %0 tiddlers tagged with: '{{{%1}}}'\n----\n",
	handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		var mode=params[0]?params[0].toLowerCase():'';
		if (mode=="inline")
			params.shift();
		if (mode=="report" || mode=="panel") {
			params.shift();
			var target=params.shift()||this.defTiddler;
		}
		if (mode=="popup") {
			params.shift();
			if (params[0]&&params[0].substr(0,6)=="label:") var label=params.shift().substr(6);
			if (params[0]&&params[0].substr(0,7)=="prompt:") var prompt=params.shift().substr(7);
		} else {
			var fmt=(params.shift()||this.defFormat).unescapeLineBreaks();
			var sep=(params.shift()||this.defSeparator).unescapeLineBreaks();
		}
		var sortBy="+title";
		if (params[0]&&params[0].substr(0,5)=="sort:") sortBy=params.shift().substr(5);
		var expr = params.join(" ");
		if (mode!="panel" && (!expr||!expr.trim().length)) return;
		if (expr==this.untaggedKeyword)
			{ var label=this.untaggedLabel; var prompt=this.untaggedPrompt };
		switch (mode) {
			case "popup": this.createPopup(place,label,expr,prompt,sortBy); break;
			case "panel": this.createPanel(place,expr,fmt,sep,sortBy,target); break;
			case "report": this.createReport(target,this.defTags,expr,fmt,sep,sortBy); break;
			case "inline": default: this.createInline(place,expr,fmt,sep,sortBy); break;
		}
	},
	formatList: function(tids,fmt,sep) {
		var out=[];
		for (var i=0; i<tids.length; i++) { var t=tids[i];
			var title=t.title;
			var who=t.modifier;
			var when=t.modified.toLocaleString();
			var text=t.text;
			var first=t.text.split("\n")[0];
			var desc=store.getTiddlerSlice(t.title,"description");
			desc=desc||store.getTiddlerSlice(t.title,"Description");
			desc=desc||store.getTiddlerText(t.title+"##description");
			desc=desc||store.getTiddlerText(t.title+"##Description");
			var tags=t.tags.length?'[['+t.tags.join(']] [[')+']]':'';
			out.push(fmt.format([title,who,when,text,first,desc,tags]));
		}
		return out.join(sep);
	},
	createInline: function(place,expr,fmt,sep,sortBy) {
		wikify(this.formatList(store.sortTiddlers(store.getMatchingTiddlers(expr),sortBy),fmt,sep),place);
	},
	createPopup: function(place,label,expr,prompt,sortBy) {
		var btn=createTiddlyButton(place,
			(label||expr).format([expr]),
			(prompt||config.views.wikified.tag.tooltip).format([expr]),
			function(ev){ return config.macros.matchTags.showPopup(this,ev||window.event); });
		btn.setAttribute("sortBy",sortBy);
		btn.setAttribute("expr",expr);
	},
	showPopup: function(here,ev) {
		var p=Popup.create(here,null,"matchTags popup"); if (!p) return false;
		var tids=store.getMatchingTiddlers(here.getAttribute("expr"));
		store.sortTiddlers(tids,here.getAttribute("sortBy"));
		var list=[]; for (var t=0; t<tids.length; t++) list.push(tids[t].title);
		if (!list.length) createTiddlyText(p,this.noMatch);
		else {
			var b=createTiddlyButton(createTiddlyElement(p,"li"),
				config.views.wikified.tag.openAllText,
				config.views.wikified.tag.openAllTooltip,
				function() {
					var list=this.getAttribute("list").readBracketedList();
					story.displayTiddlers(null,tids);
				});
			b.setAttribute("list","[["+list.join("]] [[")+"]]");
			createTiddlyElement(p,"hr");
		}
		var out=this.formatList(tids," &nbsp;[[%0]]&nbsp; ","\n"); wikify(out,p);
		Popup.show();
		ev.cancelBubble=true;
		if(ev.stopPropagation) ev.stopPropagation();
		return false;
	},
	createReport: function(target,tags,expr,fmt,sep,sortBy) {
		var tids=store.sortTiddlers(store.getMatchingTiddlers(expr),sortBy);
		if (!tids.length) { displayMessage('no matches for: '+expr); return false; }
		var msg=config.messages.overwriteWarning.format([target]);
		if (store.tiddlerExists(target) && !confirm(msg)) return false;
		var out=this.reportHeading.format([tids.length,expr])
		out+=this.formatList(tids,fmt,sep);
		store.saveTiddler(target,target,out,config.options.txtUserName,new Date(),tags,{});
		story.closeTiddler(target); story.displayTiddler(null,target);
	},
	createPanel: function(place,expr,fmt,sep,sortBy,tid) {
		var s=createTiddlyElement(place,"span"); s.innerHTML=store.getTiddlerText("MatchTagsPlugin##html");
		var f=s.getElementsByTagName("form")[0];
		f.expr.value=expr; f.fmt.value=fmt; f.sep.value=sep.escapeLineBreaks();
		f.tid.value=tid; f.tags.value=this.defTags;
	}
};
//}}}
/***
//{{{
!html
<form style='display:inline;white-space:nowrap'>
<input type='text'    name='expr' style='width:50%' title='tag expression'><!--
--><input type='text'    name='fmt'  style='width:10%' title='list item format'><!--
--><input type='text'    name='sep'  style='width:5%'  title='list item separator'><!--
--><input type='text'    name='tid'  style='width:12%' title='target tiddler title'><!--
--><input type='text'    name='tags' style='width:10%' title='target tiddler tags'><!--
--><input type='button'  name='go'   style='width:8%'  value='go' onclick="
	var expr=this.form.expr.value;
	if (!expr.length) { alert('Enter a boolean tag expression'); return false; }
	var fmt=this.form.fmt.value;
	if (!fmt.length) { alert('Enter the list item output format'); return false; }
	var sep=this.form.sep.value.unescapeLineBreaks();
	var tid=this.form.tid.value;
	if (!tid.length) { alert('Enter a target tiddler title'); return false; }
	var tags=this.form.tags.value;
	config.macros.matchTags.createReport(tid,tags,expr,fmt,sep,'title');
	return false;">
</form>
!end
//}}}
***/
//{{{
// SHADOW TIDDLER for displaying default panel input form
config.shadowTiddlers.MatchTags="<<matchTags panel>>";
//}}}
//{{{
// TWEAK core filterTiddlers() or config.filters['tag'] (in TW262+)
// to use getMatchingTiddlers instead getTaggedTiddlers
// for enhanced boolean matching in [tag[...]] syntax
var TW262=config.filters && config.filters['tag']; // detect TW262+
var fname=TW262?"config.filters['tag']":"TiddlyWiki.prototype.filterTiddlers";
var code=eval(fname).toString().replace(/getTaggedTiddlers/g,'getMatchingTiddlers');
eval(fname+'='+code);
//}}}
//{{{
// REDEFINE core handler for enhanced boolean matching in tag:"..." paramifier
// use filterTiddlers() instead of getTaggedTiddlers() to get list of tiddlers.
config.paramifiers.tag = {
	onstart: function(v) {
		var tagged = store.filterTiddlers("[tag["+v+"]]");
		story.displayTiddlers(null,tagged,null,false,null);
	}
};
//}}}
!!!General Issue
[[Install Matlab on Ubuntu]]
[[Matlab for LINUX -- keyboard shortcut]]
[[Matlab for LINUX -- symbol link&shortcut]]
[[MATLAB与C/C++混合编程之MATLAB调用C程序]]
[[Warning: Name is nonexistent or not a directory]]

!!!Functions
[[删除全零的行/列]]
[[用Matlab求集合的交集、并集、差集和补集]]
[[计算矩阵大小和元素个数等]]
[[高斯分布]]
[[取整函数]]
[[如何去除矩阵中重复元素]]
[[如何抽取元素的位置序号]]
[[升序/降序排列]]
[[复制一个1*N数组成M*N的矩阵]]
[[数组移位]]
[[对一组数据画出其概率分布]]
[[计算eigenvalue和eigenvector]]
[[Matlab 保存随机数状态]]

!!!Problems
[[Simulink -- Unable to locate 'mexopts.bat']]
[[How can I set up Microsoft Visual Studio 2008 Express Edition for use with MATLAB 7.7 (R2008b) on 64-bit Windows?]]
matlab for linux装好以后,默认的是快捷键都是与Emacs一致的,对我这个刚刚从Win平台上迁移过来的人来说,极不习惯,而且就是按照这些默认的快捷键,也老是出问题,比如保存文档。不过好在可以更改,把Matlab的快捷键都和Windows平台上的保持一致。

设置方法:
{{{
[File]->[Preferences]->[Keyboard]->[Shortcuts]
or [File]->[Preferences]->[Command Window]->[Keyboard & indenting]->[command line key bindings]
or [File]->[Preferences]->[Editor/Debugger]->[Keyboard & indenting]->[key bindings]
}}}
安装完成Matlab R2010b后

前面提到过,由于没有出现建立符号链接选项框,
所以这时候你在终端中输入$matlab,可能会提示找不到matlab可执行程序,这就需要手动添加,假设你matlab安装在 /opt/matlab 下,这个命令就是,
{{{
  $sudo ln -s /opt/matlab/bin/matlab /usr/bin
}}}

这时,你就可以在终端中调用matlab了,但是这样很不方便,因为每次打开matlab你还必须打开一个终端窗口.
所以需要建立一个程序链接,在 Application menu 上点击右键,选择 Edit Menu –> New Item ,然后在命令框里,填写:matlab -desktop。
注意要用 -desktop option 来调用matlab,不然你将看不到matlab的GUI。 Good Luck!
关于matlab本身的配置以后介绍,例如修改启动目录,相应的需要修改 ~/.matlab 文件。
 
如果是root user安装,那么直接用matlab命令启动时,在command window中会有警告信息提示:
对~/.matlab目录下某些文件没有权限读写。
这是由于root user安装时,该目录也被设定为root才能访问。
所以你或者用 sudo matlab 来启动,或者手动修改这个目录的owner及permission,例如,如下命令:
{{{
sudo chown system_username /location_of_files_or_folders
sudo chmod 777 /location_of_files_or_folders
}}}
另外你也可以以root用户login你的Ubuntu,然后利用图形界面的属性菜单,直接修改。关于如何以root登录,参见[[这里|http://www.xxlinux.com/linux/article/accidence/technique/20070430/8333.html]]。
Matlab启动目录的设定,在matlabroot/toolbox/local 目录下,修改startup.m文件(如果没有,就创建一个),添加
{{{
cd user_defined_startup_folder
}}}
这样就可以设定起始目录了。
如果希望自动载入用户定义的目录,可以添加如下的语句
{{{
addpath user_defined_path
}}}
具体可以参考[[这里|http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_env/f8-10506.html]],[[这里|http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_env/f8-4994.html]],以及[[这里|http://blogs.mathworks.com/loren/2009/03/03/whats-in-your-startupm/]]。
{{{
rand_state = rand('state'); % get current state
rand('state', rand_state); % set state
A = rand(1, 4);
rand('state', rand_state); % set state
B = rand(1, 4);
}}}

{{{
randn_state = randn('state'); % get current state
randn('state', randn_state); % set state
A = randn(1, 4);
randn('state', randn_state); % set state
B = randn(1, 4);
}}}


!!Research History

10-16
<Universal Distributed Sensing via random projection>
JSM-3: 
Consider, for example, a computer vision-based verification system in 
a device production plant. Cameras acquire snapshots of
components in the production line; a computer system then
checks for failures in the devices for quality control purposes.
While each image could be extremely complicated, the ensemble
of images will be highly correlated, since each camera
observes the same device with minor (sparse) variations.
用到现在的模型中?
不同相机拍摄出来的现在是用一个tau来做偏移。
如果不用tau作偏移,用JSM来联合,会不会有另外的情况?
但是,JSM-3因为没有sparse的分量,所以很难用cs.
而JSM-1和JSM-3的不同就在于他的分量都时sparse的,所以可以用CS.

*所以JSM + Matrix Completion,应该木有人用过。

-------
<Image Super-Resolution by TV-Regularization and ..>
1. model
high res and low res images are typically related through
a conv operator and a down-sampling operator.
(有很多model,但是conv是最好的)

2. algorithm
1)
classical models and algor: LE, FS, l2-norm
他们都用了priori knowledge, using constrained reconstruction algor
constrained recon algor是什么?
文章说是用不同的预处理方法来达到decrease stepsize delta(x)的目的
在频域和时域都有相应的算法
2)
TV的引入,是为了解决1)中方法的Gibb Pheno
3)
式(9)可以用l1-magic程序里tvqc来解
(TVQC: min TV(u) s.t. ||Ax-b|| < epsilon)
改动:
Ax -> Doh conv (x)
b -> f
epsilon -> sigma~2

而真正要解的式子(11)不好那么对应
min TV(u)
s.t. ||A(k)*x - b(k)|| < eps(k)
就是有多个约束
这个文章是用的bregman iter
找下代码 
-> 参考<An interative regularization method for total variation-based image restoration>
###从这个式子的解法里面,有用的信息
###如何解一个有多个约束的最优化问题

iH propsed a model(refer to Yi Ma)
min 1/2*sum(||I(i) - DBF(i)Ih||f~2
s.t. Ih = Sx~l * Sy~m * I(i)	
很像<Fast and Robust multiframe super res>中的式(21)
只是把(21)中的一范式变成了F范式的平方

---------------------------
<An interative regularization method for total variation-based image restoration>
1. 解决的问题模型是
f = u + v
从f得到u,v是Noise

(对比,在super res里提出的是f = h*u + v)
ROF算法用的是
u = argmin{|u|bv + lambda*||f-u||L~2} 
即 min |u|bv s.t. f = u ?? or f = u + v??
而TV算法用的是
a. 先用ROF的算法得到u1,然后	并不停止,而是继续b
b.
u = argmin{D(u, u(k-1)) + lambda*||f-u||L~2}
即 min |u|bv改成了min D(u, u(k-1))
D就是Bregman distance
(实际上是一样的吧,貌似是,之前就只算一次这个优化,但是现在是不断的算下去)
这个算法得到的序列{uk}是单调收敛于f的(但咱是要得到u不是f- -)
所以呢,文章又说了
随着k增加,如果把lambda变小,小到足够的时候,uk会单调的越来越接近u,
直到达到某个条件

2. 文章在后面提出了一个更加general的说明
也就是说,算法可以用于解 argmin {J(u) + lambda*H(u, f)}问题



10.21
<Fast and Robust multiframe super res>
iH的模型就是文中的式(21),使用了另一种Norm
(min 1/2*sum(||I(i) - DBF(i)Ih||f~2
s.t. Ih = Sx~l * Sy~m * I(i)	)

文中先给出信号模型:
x = min{sum(||DHFX-Y||2~2)}
根据(11),可以知道其梯度
(note:这只是提出的模型中的第一部分,还有一个penalty,或者说constrain)

式子(14)

------------------------------------
10-24
准备用RPCA来进行改进,使其能够优化多个constrain的问题

step 1:
The least square solution for Ax = b is $x_{ls} = (A^TA)^{-1}A^Tb$.
* Be careful it is not $x_{ls} = A^{-1}b$ because A may have no inverse. But $A^TA$ must have its inverse.
Refer: http://www.w3.org/TR/CSS2/media.html
In a word, it is a way to specify how a document is to be presented on different media: on the screen, on paper, with a speech synthesizer, with a braille device, etc.
!!Installation
MindManager S/N: ~MP10-284-EP12-CAMC-186A
{{{
multiline styled contents...
#{{block{
!heading
still bullet1
 }}}
#bullet2
}}}
multiline styled contents...
#{{block{
!heading
still bullet1
 }}}
#bullet2
!!Functions&Command
[[add unique key]]
[[alter column type]]
[[create new user]]
[[在MySql 5.0 的表里同时添加两个自动更新的timestamp字段]]
Solution:
All the baseline default.properties needs is a line like:
{{{
target=android-8
}}}
You can most likely copy another projects' default.properties into this project. A (not-so-)quick restart of Eclipse, a rebuilding of the workspace, and you're off to the races.
!!!Intensive Reading
[[Segmented Compressed Sampling for Analog-to-Information Conversion]]
[[Sparse Bayesian Learning for Basis Selection]]
[[Asymptotic mean-square optimality of belief propagation for sparse linear systems]]
[[Interframe Coding of Magnetic Resonance Images]]
[[Belief Propagation based Cooperative Compressed Spectrum Sensing in Wideband Cognitive Radio Networks]]
[[Imaging via Compressive Sampling]]
[[Compressed Sensing Image Reconstruction Via Recursive Spatially Adaptive Filtering]]
[[An Introduction to Compressive Sampling]]
[[Detecting Primary Receivers for Cognitive Radio Applications]]

!!!Extensive Reading
[[Computationally Efficient Sparse Bayesian Learning via Belief Propagation]]
[[Image Upsampling via Spatially Adaptive Block-Matching Filtering]]
[[The Design of Compressive Sensing Filter]]
[[Compressed Sensing -- D.Donoho]]
[[Distributed Video Coding]]
[[Optimal Reconstruction in Wyner-Ziv Video Coding with Multiple Side Information]]
[[On the Performance of Hybrid FEC ARQ System Using Rate Compatible Punctured]]
[[Towards Practical Wyner-Ziv Coding of Video]]
[[Cognitive Radio: Making Software Radios More Personal]]
[[Group Sparse Coding]]
[[Distributed Video Coding using Compressive Sampling]]
[[Distributed Compressive Video Sensing]]
Analysis: layout maybe not well load
(no such View in such layout R.id)
Check setContentView(R.layout.xx);
To see whether it has load a correct layout xml.
The ''__Nyquist frequency__'', named after the ~Swedish-American engineer Harry Nyquist or the Nyquist–Shannon sampling theorem, is ''half the sampling frequency of a discrete signal processing system''. It is sometimes known as the ''folding frequency'' of a sampling system.
*The sampling theorem shows that aliasing can be avoided if the Nyquist frequency is greater than the bandwidth, or maximum component frequency, of the signal being sampled.

''__Nyquist rate__'' is the lower bound of the sampling frequency that satisfies the Nyquist sampling criterion for a given signal or family of signals. This lower bound is ''twice the bandwidth or maximum component frequency of the signal''. 

''Nyquist rate'', as commonly used with respect to sampling, is ''a property of a continuous-time signal'', not of a system, whereas ''Nyquist frequency'' is ''a property of a discrete-time system'', not of a signal. While the domain of the signals is commonly time, leading to a Nyquist frequency in Hertz, this does not have to be the case; for example, an image sampling system has a Nyquist frequency expressed in units of reciprocal length, such as cycles per meter.



Read more: http://www.answers.com/topic/nyquist-frequency-in-math#ixzz1c3Ikrmvo
Sampling a sound (using a microphone) or image (using a CCD camera) can introduce a distortion into the signal called ”aliasing.” Aliasing takes many forms; for example the apparent backward motion of wagon wheels in western movies, which occurs because the movie is actually a sequence of still frames. 
Nyquist showed that if the sampling rate is ''twice the highest frequency component'', then the original information can be reconstructed without aliasing.
In the case of a CCD image, you need to have a __pixel density__ twice the highest __spatial frequency__ in the image. In practice 2.5X is used to compensate for the distance across the diagonal of the pixel. 
Note that proper display of a ”critically sampled” image requires a reconstruction filter - interpolation to a higher sample rate - for proper image display. Also oversampling may be desirable because interpolation during image alignment can degrade resolution. Oversampling is also required if you intend to use deconvolution to increase resolution; the final deconvolved image must also meet the Nyquist Sampling Criterion.

!!!!Application to multivariable signals and images 
Refer to http://en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampling_theorem
The sampling theorem is usually formulated for functions of a single variable. Consequently, the theorem is directly applicable to ''time-dependent signals'' and is normally formulated in that context. However, the sampling theorem can be ''extended in a straightforward way to functions of arbitrarily __many variables__''. 
# Grayscale images, for example, are often represented as __two-dimensional arrays (or matrices)__ of real numbers representing the relative intensities of pixels (picture elements) located at the intersections of row and column sample locations. As a result, images require two independent variables, or indices, to specify each pixel uniquely — one for the row, and one for the column.
# Color images typically consist of a composite of __three separate grayscale images__, one to represent each of the three primary colors — red, green, and blue, or RGB for short. Other colorspaces using 3-vectors for colors include HSV, LAB, XYZ, etc. 
# Some colorspaces such as cyan, magenta, yellow, and black (CMYK) may represent color by __four dimensions__. All of these are treated as vector-valued functions over a two-dimensional sampled domain.
Similar to one-dimensional discrete-time signals, images can also suffer from aliasing if the sampling resolution, or pixel density, is inadequate. For example, a digital photograph of a striped shirt with ''__high frequencies__'' (in other words, ''__the distance between the stripes is small__''), can cause aliasing of the shirt when it is sampled by the camera's image sensor. The aliasing appears as a moiré pattern. ''__The "solution" to higher sampling in the spatial domain for this case would be to move closer to the shirt, use a higher resolution sensor, or to optically blur the image before acquiring it with the sensor.__''

The application of the sampling theorem to images should be made with care. For example, the sampling process in any standard image sensor (CCD or CMOS camera) is relatively far from the ideal sampling which would measure the image intensity at a single point. Instead these devices have a relatively large sensor area at each sample point in order to obtain sufficient amount of light. In other words, any detector has a finite-width point spread function. The analog optical image intensity function which is sampled by the sensor device is not in general bandlimited, and the non-ideal sampling is itself a useful type of low-pass filter, though not always sufficient to remove enough high frequencies to sufficiently reduce aliasing. When the area of the sampling spot (the size of the pixel sensor) is not large enough to provide sufficient anti-aliasing, a separate anti-aliasing filter (optical low-pass filter) is typically included in a camera system to further blur the optical image. ''__Despite images having these problems in relation to the sampling theorem, the theorem can be used to describe the basics of down and up sampling of images.__''

More refer to [[Image Sampling]]
!!I. Introduction
RCPC codes are constructed from a signle rate 1/M convolutional code, wherein a family of higher rate codes is formulated by puncturing successively greater numbers of code symbols.
* the system requires a single rate 1/M convolutional encoder and Viterbi decoder.
The tansmitter and receiver need only share a puncturing table to determine which coe symbos to transmit at given time, and the receiver may simply instert eratsures for all code symbols that have not yet been received.
!!!I. Introduction
The rate of the SW coder (here a turbo coder) is controlled via a feedback channel: 
*when the residual error rate at the output of the turbo decoder exceeds a given threshold, more bits are requested from the encoder via the feedback channel.
Once the index of the quantisation interval is decoded, the reconsruction is performed, taking into account the side information.
Reconstruction: 
* if the side information sample falls into the quantisation interval -----> taking the corresponding side  information sample 
*  otherwise -------> taking one of the borders of the interval
~UofA udisk (Friends)
~UofA 裤子 (CH)
[[Social Network]]
[[Optional Gift Lists]]
[[Domain Name]]
DooPHP
PHP5
!!!Template
In a project, there would have several php files that have the common head such as
{{{
<html xmln="xxx">
<head>
</head>
....
}}}
so we can include it into a header.php, then we just need to include a php file
{{{
<?php include "header.php" ?>
}}}

!!!check either $_POST or $_GET is set
use $_REQUEST
{{{
isset($_REQUEST['xxx']);
}}}
[[PVZ JS CODE Review]]
[[PVZ Matlab Realization]]
!!!!~ImZombie1.js
line 19
<code javascript>
  var a = 6;
  while (--a) {
       CustomSpecial(oBrains, a, -1)
  }
</code>
#~CustomSpecial
##Refer Cfunction.js: line 1468
##生成特殊项
#*~CustomPlants 生成植物
#*~CustomAuto Sun 自动生成sun
#oBrains
##Refer CPlants.js: line 206
这个步骤是在初始化brain,假定5格(a=6, {{{--}}}a)都是brain

line 22
<code javascript>
    ArP: {
        ArC: [1, 4],
        ArR: [1, 5],
        Auto: 1,
        P: [0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 3, 3, 3]
    },
</code>
这个结构体是植物的分布
# ArC指植物的列(竖着的)
# ArR指植物的行 (横着的)
# Auto 是指植物是否自动攻击?
# P是植物的种类
## 0是豌豆射手
## 1是向日葵
## 2是蓝色豌豆射手
## 3是冬瓜
共4*5=20颗植物,分别是P中的。。

line 28
<code javascript>
RiddleAutoGrow: function () {
        var k = oS.ArP,
            f = k.ArC,
            j = k.ArR,
            e = k.P,
            d = oS.PName,
            c, g = f[0],
            b = f[1],
            i = j[0],
            h = j[1],
            a;
        if (k.Auto) {
            while (i <= h) {
                CustomSpecial(oBrains, i, 0);
                for (a = g; a <= b; a++) {
                    CustomSpecial(d[e[c = Math.floor(Math.random() * e.length)]], i, a);
                    e.splice(c, 1)
                }++i
            }
        }
        NewImg("iStripe", "images/interface/Stripe.png", "left:" + (GetX1X2(5)[0] - 11) + "px;top:65px", EDAll)
    },
</code>
这一段代码是在自动生成植物,每行随机从P中抽取一种植物种在某一格上
最后NewImg 是生成一条红线

BeginCool()
line 1254 in Cfunction.js
dFlagMeter 就是右下角的flag进度条



!!!!1.js
第一关
InitLawnMower 是初始化小车的函数
<code javascript>
CustomSpecial(oLawnCleaner, 3, -1);
</code>
放置LawnCleaner,位于(3,-1) (3是纵坐标,从上到下为1,2,3,4,5,-1是横坐标,左起-1,0,1....)
!!!!PVZ.m
<code java>
row = 5;
col = 10;
map = zeros(row, col);
zombie = zeros(row, col);
bullet = zeros(row, col);

%grow plant
GrowPlant(plant_row, plant_col);

%PVZ
flag = 1;
while (flag) {
	MoveZombie();
	MoveBullet();
	Process();
	if (eatBrain) {
		flag = 0;
	}
}
</code>

map = [0 0 0 0 0]
plant = [0 0 0 0 0]
bullet = [0 0 0 0 0]
zombie = [0 0 0 0 0 | 0 0 0]

GrowPlant()
[-5 0 0 0 0]
SetZombie()
[0 0 0 0 0 0 | 0 0 8]
 ********************************
MoveZombie()  %velocity = 1
[0 0 0 0 0 | 0 8 0]
MoveBullet()
[0 0 0 0 0]
Process()
zombie = [0 0 0 0 0 | 0 8 0]
bullet = [0 0 0 0 0]
plant = [-5 0 0 0 0]

MoveZombie()
[0 0 0 0 0 | 8 0 0]
MoveBullet()
[0 0 0 0 0]
Process()
zombie = [0 0 0 0 0 | 8 0 0]
bullet = [0 0 0 0 0]
plant = [-5 0 0 0 0]

MoveZombie()
[0 0 0 0 8 | 0 0 0]
MoveBullet()
[0 -1 0 0 0]
Process()
zombie = [0 0 0 0 8 | 0 0 0]
bullet = [0 -1 0 0 0]
plant = [-5 0 0 0 0]

MoveZombie()
[0 0 0 8 0 | 0 0 0]
MoveBullet()
[0 -1 -1 0 0 0]
Process()
zombie = [0 0 0 8 0]
bullet = [0 -1 -1 0 0]
plant = [-5 0 0 0 0]

MoveZombie()
[0 0 8 0 0 | 0 0 0]
MoveBullet()
[0 -1 -1 -1 0]
Process()
bullet = [0 -1 -2 0 0]
zombie = [0 0 6 0 0]
bullet = [0 -1 0 0 0]
plant = [-5 0 0 0 0]


MoveZombie()
[0 6 0 0 0 | 0 0 0]
MoveBullet()
[0 -1 -1 0 0]
Process()
bullet = [0 -2 0 0 0]
zombie = [0 4 0 0 0]
bullet = [0 0 0 0 0]
plant = [-5 0 0 0 0]


MoveZombie()
% check if there is plant in front of zombie
[0 4 0 0 0 | 0 0 0]
MoveBullet()
[0 -1 0 0 0]
Process()
bullet = [0 -1 0 0 0]
zombie = [0 3 0 0 0]
bullet = [0 0 0 0 0]
% assume zombie's attack is 1
plant = [-4 0 0 0 0]

MoveZombie()
% check if there is plant in front of zombie
[0 3 0 0 0 | 0 0 0]
MoveBullet()
[0 -1 0 0 0]
Process()
bullet = [0 -1 0 0 0]
zombie = [0 2 0 0 0]
bullet = [0 0 0 0 0]
% assume zombie's attack is 1
plant = [-3 0 0 0 0]

MoveZombie()
% check if there is plant in front of zombie
[0 2 0 0 0 | 0 0 0]
MoveBullet()
[0 -1 0 0 0]
Process()
bullet = [0 -1 0 0 0]
zombie = [0 1 0 0 0]
bullet = [0 0 0 0 0]
% assume zombie's attack is 1
plant = [-2 0 0 0 0]

MoveZombie()
% check if there is plant in front of zombie
[0 1 0 0 0 | 0 0 0]
MoveBullet()
[0 -1 0 0 0]
Process()
bullet = [0 -1 0 0 0]
zombie = [0 0 0 0 0]
bullet = [0 0 0 0 0]
% assume zombie's attack is 1
plant = [-1 0 0 0 0]

....
 ***********************************

......


!!!!Plant.m
<code java>
% plant attribute
</code>
!!!!Zombie.m
<code java>
% zombie attribute
</code>

!!!! Struct
zombie_map =  zombie_row * zombie_col
for MoveZombie()
zombie_map(ii, :) 1*col
zombie_map(ii, jj)
type: 1*n
hp: 1*n
speed: 1*n
resistance: 1*n
attack: 1*n
distance: 1*n


plant_map = row * col
each row plant_map(ii, :) 1*col
type: 1*1
hp: 1*1
attack: 1*1
cooltime: 1*1
cooltimeleft: 1*1



/***
|''Name:''|PasswordOptionPlugin|
|''Description:''|Extends TiddlyWiki options with non encrypted password option.|
|''Version:''|1.0.2|
|''Date:''|Apr 19, 2007|
|''Source:''|http://tiddlywiki.bidix.info/#PasswordOptionPlugin|
|''Author:''|BidiX (BidiX (at) bidix (dot) info)|
|''License:''|[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D ]]|
|''~CoreVersion:''|2.2.0 (Beta 5)|
***/
//{{{
version.extensions.PasswordOptionPlugin = {
	major: 1, minor: 0, revision: 2, 
	date: new Date("Apr 19, 2007"),
	source: 'http://tiddlywiki.bidix.info/#PasswordOptionPlugin',
	author: 'BidiX (BidiX (at) bidix (dot) info',
	license: '[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D]]',
	coreVersion: '2.2.0 (Beta 5)'
};

config.macros.option.passwordCheckboxLabel = "Save this password on this computer";
config.macros.option.passwordInputType = "password"; // password | text
setStylesheet(".pasOptionInput {width: 11em;}\n","passwordInputTypeStyle");

merge(config.macros.option.types, {
	'pas': {
		elementType: "input",
		valueField: "value",
		eventName: "onkeyup",
		className: "pasOptionInput",
		typeValue: config.macros.option.passwordInputType,
		create: function(place,type,opt,className,desc) {
			// password field
			config.macros.option.genericCreate(place,'pas',opt,className,desc);
			// checkbox linked with this password "save this password on this computer"
			config.macros.option.genericCreate(place,'chk','chk'+opt,className,desc);			
			// text savePasswordCheckboxLabel
			place.appendChild(document.createTextNode(config.macros.option.passwordCheckboxLabel));
		},
		onChange: config.macros.option.genericOnChange
	}
});

merge(config.optionHandlers['chk'], {
	get: function(name) {
		// is there an option linked with this chk ?
		var opt = name.substr(3);
		if (config.options[opt]) 
			saveOptionCookie(opt);
		return config.options[name] ? "true" : "false";
	}
});

merge(config.optionHandlers, {
	'pas': {
 		get: function(name) {
			if (config.options["chk"+name]) {
				return encodeCookie(config.options[name].toString());
			} else {
				return "";
			}
		},
		set: function(name,value) {config.options[name] = decodeCookie(value);}
	}
});

// need to reload options to load passwordOptions
loadOptionsCookie();

/*
if (!config.options['pasPassword'])
	config.options['pasPassword'] = '';

merge(config.optionsDesc,{
		pasPassword: "Test password"
	});
*/
//}}}
[[Grad. Thesis@BUPT|Graduation Thesis@BUPT]]
[[PVZ]]
[[相机购买]]
[[摄影基础]]
/***
|Name|Plugin: Scientific Notation|
|Created by|BobMcElrath|
|Email|my first name at my last name dot org|
|Location|http://bob.mcelrath.org/tiddlyjsmath-2.0.3.html|
|Version|1.0|
|Requires|[[TiddlyWiki|http://www.tiddlywiki.com]] &ge; 2.0.3, [[jsMath|http://www.math.union.edu/~dpvc/jsMath/]] &ge; 3.0, [[Plugin: jsMath]]|
!Description
This plugin will render numbers expressed in scientific notation, such as {{{3.5483e12}}} using the jsMath plugin to display it in an intuitive way such as 3.5483e12.  You may customize the number of significant figures displayed, as well as "normalize" numbers so that {{{47392.387e9}}} is displayed as 47392.387e9.
!Installation
Install the Requirements, above, add this tiddler to your tiddlywiki, and give it the {{{systemConfig}}} tag.
!History
* 1-Feb-06, version 1.0, Initial release
!Code
***/
//{{{
config.formatters.push({
  name: "scientificNotation",
  match: "\\b[0-9]+\\.[0-9]+[eE][+-]?[0-9]+\\b",
  element: "span",
  className: "math",
  normalize: true,                          // set to 'true' to convert numbers to X.XXX \times 10^{y}
  sigfigs: 3,                               // with this many digits in the mantissa
  handler: function(w) {
    var snRegExp = new RegExp("\\b([0-9]+(?:\\.[0-9]+)?)[eE]([-0-9+]+)\\b");
    var mymatch = snRegExp.exec(w.matchText);
    var mantissa = mymatch[1];
    var exponent = parseInt(mymatch[2]);
    // normalize the number.
    if(this.normalize) {
      mantissa = parseFloat(mantissa);
      while(mantissa > 10.0) {
        mantissa = mantissa / 10.0;
        exponent++; 
      }
      while(mantissa < 1.0) {
        mantissa = mantissa * 10.0;
        exponent--;
      }
      var sigfigsleft = this.sigfigs;
      mantissa = parseInt(mantissa) + "." + (Math.round(Math.pow(10,this.sigfigs-1)*mantissa)+"").substr(1,this.sigfigs-1);
    }
    var e = document.createElement(this.element);
    e.className = this.className;
    if(exponent == 0) {
      e.appendChild(document.createTextNode(mantissa));
    } else {
      e.appendChild(document.createTextNode(mantissa + "\\times 10^{" + exponent + "}"));
    }
    w.output.appendChild(e);
  }
});
//}}}
/***
|Name|Plugin: jsMath|
|Created by|BobMcElrath|
|Email|my first name at my last name dot org|
|Location|http://bob.mcelrath.org/tiddlyjsmath.html|
|Version|1.6|
|Requires|[[TiddlyWiki|http://www.tiddlywiki.com]] &ge; 2.0.3, [[jsMath|http://www.math.union.edu/~dpvc/jsMath/]] &ge; 3.0|
!Description
LaTeX is the world standard for specifying, typesetting, and communicating mathematics among scientists, engineers, and mathematicians.  For more information about LaTeX itself, visit the [[LaTeX Project|http://www.latex-project.org/]].  This plugin typesets math using [[jsMath|http://www.math.union.edu/~dpvc/jsMath/]], which is an implementation of the TeX math rules and typesetting in javascript, for your browser.  Notice the small button in the lower right corner which opens its control panel.
!Installation
In addition to this plugin, you must also [[install jsMath|http://www.math.union.edu/~dpvc/jsMath/download/jsMath.html]] on the same server as your TiddlyWiki html file.  If you're using TiddlyWiki without a web server, then the jsMath directory must be placed in the same location as the TiddlyWiki html file.

I also recommend modifying your StyleSheet use serif fonts that are slightly larger than normal, so that the math matches surrounding text, and \\small fonts are not unreadable (as in exponents and subscripts).
{{{
.viewer {
  line-height: 125%;
  font-family: serif;
  font-size: 12pt;
}
}}}

You may also optionally add the following code to load jsMath in [[MarkupPostHead]] if you desire.
{{{
<!--{{{-->
<script src="jsMath/jsMath.js"></script>
<!--}}}-->
}}}
[[Plugin: jsMath]] will normally load jsMath dynamically using AJAX, but adding the above in [[MarkupPostHead]] may be useful if you have jsMath stored in a non-standard location, or if your browser's cross-site origin policy forbids loading files from file URL's using AJAX.  (e.g. Google Chrome)  
!History
* 11-Nov-05, version 1.0, Initial release
* 22-Jan-06, version 1.1, updated for ~TW2.0, tested with jsMath 3.1, editing tiddlywiki.html by hand is no longer necessary.
* 24-Jan-06, version 1.2, fixes for Safari, Konqueror
* 27-Jan-06, version 1.3, improved error handling, detect if ajax was already defined (used by ZiddlyWiki)
* 12-Jul-06, version 1.4, fixed problem with not finding image fonts
* 26-Feb-07, version 1.5, fixed problem with Mozilla "unterminated character class".
* 27-Feb-07, version 1.5.1, Runs compatibly with TW 2.1.0+, by Bram Chen
* 5-May-11, version 1.6, Use a script tag to load in Chrome, use jQuery for ajax
!Examples
|!Source|!Output|h
|{{{The variable $x$ is real.}}}|The variable $x$ is real.|
|{{{The variable \(y\) is complex.}}}|The variable \(y\) is complex.|
|{{{This \[\int_a^b x = \frac{1}{2}(b^2-a^2)\] is an easy integral.}}}|This \[\int_a^b x = \frac{1}{2}(b^2-a^2)\] is an easy integral.|
|{{{This $$\int_a^b \sin x = -(\cos b - \cos a)$$ is another easy integral.}}}|This $$\int_a^b \sin x = -(\cos b - \cos a)$$ is another easy integral.|
|{{{Block formatted equations may also use the 'equation' environment \begin{equation}  \int \tan x = -\ln \cos x \end{equation} }}}|Block formatted equations may also use the 'equation' environment \begin{equation}  \int \tan x = -\ln \cos x \end{equation}|
|{{{Equation arrays are also supported \begin{eqnarray} a &=& b \\ c &=& d \end{eqnarray} }}}|Equation arrays are also supported \begin{eqnarray} a &=& b \\ c &=& d \end{eqnarray} |
|{{{I spent \$7.38 on lunch.}}}|I spent \$7.38 on lunch.|
|{{{I had to insert a backslash (\\) into my document}}}|I had to insert a backslash (\\) into my document|
!Code
***/
//{{{

// Load jsMath
if(typeof jsMath == 'undefined') {
  jsMath = {
    Setup: {inited: 1},          // don't run jsMath.Setup.Body() yet
    Autoload: {root: new String(document.location).replace(/[^\/]*$/,'jsMath/')}  // URL to jsMath directory, change if necessary
  };
  try {
    jQuery.ajax({url: jsMath.Autoload.root+"jsMath.js", dataType: 'script',
                 async: false, error: function(j, s, e) { throw(e); } });
    jsMath.Setup.inited=0;  //  allow jsMath.Setup.Body() to run again
  } catch(e) {
    if(navigator.userAgent.toLowerCase().indexOf('chrome') > -1
        && document.location.toString().indexOf('file') == 0) {
      var jsMathScript = '<!--{{{-->\n<script src="jsMath/jsMath.js"></script>\n<!--}}}-->';
      var MarkupPostHead = store.fetchTiddler("MarkupPostHead");
      if(MarkupPostHead && !MarkupPostHead.match(jsMathScript)) {
        MarkupPostHead.text += jsMathScript;
      } else {
        MarkupPostHead = store.createTiddler("MarkupPostHead");
        MarkupPostHead.text = jsMathScript;
      }
      throw("jsMath added to MarkupPostHead: now save and reload (Google Chrome cross origin file:/// URL workaround)");
    } else {
      alert("jsMath was not found: you must place the 'jsMath' directory in the same place as this file.  "
           +"The error was:\n"+e.name+": "+e.message);
      throw(e);  // abort eval
    }
  }
}

// Define wikifers for latex
config.formatterHelpers.mathFormatHelper = function(w) {
    var e = document.createElement(this.element);
    e.className = this.className;
    var endRegExp = new RegExp(this.terminator, "mg");
    endRegExp.lastIndex = w.matchStart+w.matchLength;
    var matched = endRegExp.exec(w.source);
    if(matched) {
        var txt = w.source.substr(w.matchStart+w.matchLength, 
            matched.index-w.matchStart-w.matchLength);
        if(this.keepdelim) {
          txt = w.source.substr(w.matchStart, matched.index+matched[0].length-w.matchStart);
        }
        e.appendChild(document.createTextNode(txt));
        w.output.appendChild(e);
        w.nextMatch = endRegExp.lastIndex;
    }
}

config.formatters.push({
  name: "displayMath1",
  match: "\\\$\\\$",
  terminator: "\\\$\\\$\\n?", // 2.0 compatability
  termRegExp: "\\\$\\\$\\n?",
  element: "div",
  className: "math",
  handler: config.formatterHelpers.mathFormatHelper
});

config.formatters.push({
  name: "inlineMath1",
  match: "\\\$", 
  terminator: "\\\$", // 2.0 compatability
  termRegExp: "\\\$",
  element: "span",
  className: "math",
  handler: config.formatterHelpers.mathFormatHelper
});

var backslashformatters = new Array(0);

backslashformatters.push({
  name: "inlineMath2",
  match: "\\\\\\\(",
  terminator: "\\\\\\\)", // 2.0 compatability
  termRegExp: "\\\\\\\)",
  element: "span",
  className: "math",
  handler: config.formatterHelpers.mathFormatHelper
});

backslashformatters.push({
  name: "displayMath2",
  match: "\\\\\\\[",
  terminator: "\\\\\\\]\\n?", // 2.0 compatability
  termRegExp: "\\\\\\\]\\n?",
  element: "div",
  className: "math",
  handler: config.formatterHelpers.mathFormatHelper
});

backslashformatters.push({
  name: "displayMath3",
  match: "\\\\begin\\{equation\\}",
  terminator: "\\\\end\\{equation\\}\\n?", // 2.0 compatability
  termRegExp: "\\\\end\\{equation\\}\\n?",
  element: "div",
  className: "math",
  handler: config.formatterHelpers.mathFormatHelper
});

// These can be nested.  e.g. \begin{equation} \begin{array}{ccc} \begin{array}{ccc} ...
backslashformatters.push({
  name: "displayMath4",
  match: "\\\\begin\\{eqnarray\\}",
  terminator: "\\\\end\\{eqnarray\\}\\n?", // 2.0 compatability
  termRegExp: "\\\\end\\{eqnarray\\}\\n?",
  element: "div",
  className: "math",
  keepdelim: true,
  handler: config.formatterHelpers.mathFormatHelper
});

// The escape must come between backslash formatters and regular ones.
// So any latex-like \commands must be added to the beginning of
// backslashformatters here.
backslashformatters.push({
    name: "escape",
    match: "\\\\.",
    handler: function(w) {
        w.output.appendChild(document.createTextNode(w.source.substr(w.matchStart+1,1)));
        w.nextMatch = w.matchStart+2;
    }
});

config.formatters=backslashformatters.concat(config.formatters);

window.wikify = function(source,output,highlightRegExp,tiddler)
{
    if(source && source != "") {
        if(version.major == 2 && version.minor > 0) {
            var wikifier = new Wikifier(source,getParser(tiddler),highlightRegExp,tiddler);
            wikifier.subWikifyUnterm(output);
        } else {
            var wikifier = new Wikifier(source,formatter,highlightRegExp,tiddler);
            wikifier.subWikify(output,null);
        }
        jsMath.ProcessBeforeShowing();
    }
}
//}}}
/***
|Name|PreviewPlugin|
|Source|http://www.TiddlyTools.com/#PreviewPlugin|
|Documentation|http://www.TiddlyTools.com/#PreviewPluginInfo|
|Version|1.8.1|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Description|add key-by-key wikified preview to any textarea input field|
Provides key-by-key ''LIVE PREVIEW'' of //formatted// tiddler content as you type input into a textarea (multi-line) edit field.
!!!!!Documentation
>see [[PreviewPluginInfo]]
!!!!!Configuration
<<<
Automatically freeze preview updates when a tiddler takes more than <<option txtPreviewAutoFreeze>> milliseconds to render.
<<<
!!!!!Revisions
<<<
2008.01.08 [*.*.*] plugin size reduction: documentation moved to ...Info tiddler
2007.12.04 [*.*.*] update for TW2.3.0: replaced deprecated core functions, regexps, and macros
2007.11.18 [1.8.1] in config.commands.previewTiddler, changed alt command text to use character-based "psuedo-checkbox" instead of embedded html fragment
2007.09.27 [1.8.0] split TidIDE preview functionality into separate stand-alone plugin (see [[TidIDEPlugin]]).  
|please see [[TidIDEPluginInfo]] for additional revision details|
2006.04.15 [0.5.0] Initial ALPHA release. Converted from inline script.
<<<
!!!!!Code
***/
// // version info
//{{{
version.extensions.PreviewPlugin= {major: 1, minor: 8, revision: 1, date: new Date(2007,11,18)};
//}}}

// //  macro definition
//{{{
if (config.options.txtPreviewAutoFreeze==undefined)
	config.options.txtPreviewAutoFreeze=250; // limit (in milliseconds) for auto-freezing preview display

config.macros.preview = {
	renderMsg: "rendering preview...",
	timeoutMsg: " (> %0ms)",
	freezeMsg: " - preview is frozen.  Press [refresh] to re-display.",
	handler: function(place,macroName,params) {
		var hide=params[0]=="hide"; if (hide) params.shift();
		var field=params[0];
		var height=params[1]; if (!height) height=15;
		var here=this.findContainingForm(place);
		if (!here) here=story.findContainingTiddler(place);
		if (!here) here=place.parentNode;
		if (!here) here=place;
		var elems=here.getElementsByTagName("textarea");
		if (field) for (var e=0; e<elems.length; e++)  // find matching textarea (by fieldname)
			if (elems[e].getAttribute("edit")==field) var ta=elems[e];
		else
			if (elems.length) var ta=elems[elems.length-1]; // default to last rendered text area
		if (!ta) {
			var elems=here.getElementsByTagName("input");
			if (field) for (var e=0; e<elems.length; e++)  // find matching input field (by fieldname)
				if (elems[e].getAttribute("edit")==field) var ta=elems[e];
			else
				if (elems.length) var ta=elems[elems.length-1]; // default to last rendered input field
		}
		if (!ta) return false; // no textarea or input field found... do nothing...
		var id=(new Date().getTime()).toString()+Math.random(); // unique instance ID
		ta.id=id+"_edit";
		ta.setAttribute("previewid",id+"_preview");
		ta.saved_onkeyup=ta.onkeyup;
		ta.onkeyup=function(ev) {
			if (this.saved_onkeyup) this.saved_onkeyup.apply(this,arguments);
			config.macros.preview.render(this.id,this.getAttribute("previewid"));
		}
		var html=this.html.replace(/%previd%/g,id+"_preview")
		html=html.replace(/%srcid%/g,id+"_edit");
		html=html.replace(/%hide%/g,hide?"none":"block");
		html=html.replace(/%limit%/g,config.options.txtPreviewAutoFreeze);
		html=html.replace(/%frozen%/g,hide?"checked":"");
		html=html.replace(/%height%/g,height);
		html=html.replace(/%halfheight%/g,height/2);
		createTiddlyElement(place,"span").innerHTML=html;
		this.render(id+"_edit",id+"_preview");
	},
	findContainingForm: function(e) {
		while (e && e.nodeName.toLowerCase()!="form") e=e.parentNode;
		return e;
	},
	render: function(srcid,previd,force) {
		var value=document.getElementById(srcid).value;
		var panel=document.getElementById(previd);
		var f=this.findContainingForm(panel);
		if (!f || (f.freeze.checked && !force)) return;
		var p=panel.firstChild; var d=f.domview; var h=f.htmlview; if (!p||!d||!h) return;
		p.innerHTML="";
		f.status.value=this.renderMsg;
		var start=new Date();
		wikify(value.replace(/\r/g,''),p);
		var end=new Date();
		this.renderDOM(previd);
		this.renderHTML(previd);
		f.status.value="elapsed: "+(end-start+1)+"ms";
		// automatically suspend preview updates for slow rendering tiddlers
		if (end-start+1>config.options.txtPreviewAutoFreeze) {
			f.freeze.checked=true;
			f.status.value+=this.timeoutMsg.format([config.options.txtPreviewAutoFreeze]);
		}
		if (f.freeze.checked) f.status.value+=this.freezeMsg;
	},
	renderDOM: function(id) {
		var panel=document.getElementById(id);
		var f=this.findContainingForm(panel); if (!f) return;
		var p=panel.firstChild; var d=f.domview; var h=f.htmlview; if (!p||!d||!h) return;
		var height=p.getAttribute("height");
		p.style.height=((f.dom.checked||f.html.checked)?height/2:height)+"em";
		if (f.dom.checked) d.value=this.getNodeTree(p,"|  ");
		if (!d.style||!h.style) return;
		d.style.height=height/2+"em";
		d.style.display=f.dom.checked?"inline":"none";
		d.style.width=f.html.checked?"49.5%":"100%";
		h.style.width=f.dom.checked?"49.5%":"100%";
	},
	renderHTML: function(id) {
		var panel=document.getElementById(id);
		var f=this.findContainingForm(panel); if (!f) return;
		var p=panel.firstChild; var d=f.domview; var h=f.htmlview; if (!p||!d||!h) return;
		var height=p.getAttribute("height");
		p.style.height=((f.dom.checked||f.html.checked)?height/2:height)+"em";
		if (f.html.checked) h.value=this.formatHTML(p.innerHTML);
		if (!h.style||!d.style) return;
		h.style.height=height/2+"em";
		h.style.display=f.html.checked?"inline":"none";
		h.style.width=f.dom.checked?"49.5%":"100%";
		d.style.width=f.html.checked?"49.5%":"100%";
	},
	formatHTML: function(txt) {
		if (config.browser.isIE) return txt; // BYPASS - 4/24/2006 due to IE hang problem.  Will fix later...
		var out="";
		var indent="";
		var level=0;
		for (var i=0;i<txt.length;i++) {
			var c=txt.substr(i,1);
			if (c=="<") {
					if (txt.substr(i+1,1)=="/")  indent=indent.substr(0,indent.length-2);
				out+="\n"+indent;
				if (txt.substr(i+1,1)!="/" && txt.substr(i+1,3)!="br>" && txt.substr(i+1,2)!="p>" && txt.substr(i+1,3)!="hr>")  indent+="  ";
			}
			out+=c;
				if (c=="\n")
				out+=indent;
			if (c==">" && txt.substr(i+1,1)!="<")
				out+="\n"+indent;
		}
		return out;
	},
	getNodeTree: function(theNode,theIndent,showPath,inline,thePrefix,thePath)
	{
		if (!theNode) return "";
		if (!thePrefix) thePrefix="";
		if (!thePath) thePath="";
		var mquote='"'+(inline?"{{{":"");
		var endmquote=(inline?"}}}":"")+'"';
		// generate output for this node
		var out = thePrefix;
		if (showPath && thePath.length)
				out += (inline?"//":"")+thePath.substr(1)+":"+(inline?"//":"")+"\r\n"+thePrefix;
		if (theNode.className=="DOMViewer")
			return out+'[DOMViewer]\r\n'; // avoid self-referential recursion
		out += (inline?"''":"")+theNode.nodeName.toUpperCase()+(inline?"''":"");
		if (theNode.nodeName=="#text")
			out += ' '+mquote+theNode.nodeValue.replace(/\n/g,'\\n')+endmquote;
		if (theNode.className)
			out += ' class='+mquote+theNode.className+endmquote;
		if (theNode.type)
			out += ' type='+mquote+theNode.type+endmquote;
		if (theNode.id)
			out += ' id='+mquote+theNode.id+endmquote;
		if (theNode.name)
			out += " "+theNode.name+(theNode.value?"="+mquote+theNode.value+endmquote:"");
		if (theNode.href)
			out += ' href='+mquote+theNode.href+endmquote;
		if (theNode.src)
			out += ' src='+mquote+theNode.src+endmquote;
		if (theNode.attributes && theNode.getAttribute("tiddlyLink")!=undefined)
			out += ' tiddler='+mquote+theNode.getAttribute("tiddlyLink")+endmquote;
		out += "\r\n";
		// recursively generate output for child nodes
		thePath=thePath+"."+theNode.nodeName.toLowerCase();
		thePrefix=theIndent+thePrefix;
		for (var i=0;i<theNode.childNodes.length;i++)
		{
			var thisChild=theNode.childNodes.item(i);
			var theNum=(inline?"~~":"(")+(i+1)+(inline?"~~":")");
			out += this.getNodeTree(thisChild,theIndent,showPath,inline,thePrefix,thePath+theNum);
		}
		return out;
	},
	html: " <form style='width:100%'><span id='%previd%' editID='%srcid%' style='display:%hide%'><div class='viewer' \
			height='%height%' style='margin:0;margin-top:.5em;height:%height%em;overflow:auto;white-space:normal'> \
			&nbsp; \
			</div> \
		<!-- DOM and HTML viewers --> \
		<textarea name=domview cols=60 rows=12 wrap=off \
			onfocus='this.select()' style='display:none;width:100%;height:%halfheight%em;'></textarea><!-- \
		--><textarea name=htmlview cols=60 rows=12 wrap=off \
			onfocus='this.select()' style='display:none;width:100%;height:%halfheight%em;'></textarea> \
		<!-- status line, preview option checkboxes, run/refresh buttons --> \
		<table width='100%' style='border:0;padding:0;margin:0'><tr style='border:0;padding:0;margin:0'> \
		<td style='border:0;padding:0;margin:0'><!-- \
			--><input type=text name=status style='padding:0;width:100%;' \
				title='ELAPSED: time (in milliseconds) used to render tiddler content in preview display'><!-- \
		--></td><td style='width:1%;border:0;padding:0;margin:0;'><!-- \
			--><input type=text name=limit size='6' maxlength='6' style='padding:0;width:5em;text-align:center' \
				value='%limit%ms' title='TIME LIMIT: maximum rendering time (in milliseconds) before auto-freezing preview' \
				onfocus='this.select()' \
				onchange='var val=this.value.replace(/[^0-9]/g,\"\"); if (!val.length) val=this.defaultValue; \
					this.value=val+\"ms\"; config.options.txtPreviewAutoFreeze=val; saveOptionCookie(\"txtPreviewAutoFreeze\"); \
					this.form.freeze.checked=false; config.macros.preview.render(\"%srcid%\",\"%previd%\",true);'><!-- \
		--></td><td style='width:1%;border:0;padding:0;margin:0;'><!-- \
			--><input type=text name=height size='4' maxlength='4' style='padding:0;width:4em;text-align:center' \
				value='%height%em' title='HEIGHT: size (in \"ems\") of preview area, including controls' \
				onfocus='this.select()' \
				onchange='var val=this.value.replace(/[^0-9]/g,\"\");  if (!val.length) val=this.defaultValue; \
					this.value=val+\"em\"; document.getElementById(\"%previd%\").firstChild.setAttribute(\"height\",val); \
					config.macros.preview.render(\"%srcid%\",\"%previd%\",true)'><!-- \
		--></td><td style='width:1%;border:0;padding:0;margin:0;text-align:right;white-space:nowrap'> \
			<input type=checkbox name=dom style='display:inline;width:auto;margin:1px;' \
				title='show Document Object Model (DOM) information' \
				onclick='config.macros.preview.renderDOM(\"%previd%\");'>DOM \
			<input type=checkbox name=html style='display:inline;width:auto;margin:1px;' \
				title='show rendered HTML' \
				onclick='config.macros.preview.renderHTML(\"%previd%\");'>HTML \
			<input type=checkbox name=freeze style='display:inline;width:auto;margin:1px;' %frozen% \
				title='do not update preview display as changes are made' \
				onclick='var p=document.getElementById(\"%previd%\");  \
					if (this.checked) this.form.status.value+=config.macros.preview.freezeMsg; \
					else config.macros.preview.render(\"%srcid%\",\"%previd%\",true);'>freeze \
			<input type=button style='display:inline;width:auto;' value='refresh' \
				title='update preview display' \
				onclick='config.macros.preview.render(\"%srcid%\",\"%previd%\",true)'> \
		</td></tr></table> \
		</span></form>"
}
//}}}

// // toolbar definition
//{{{
config.commands.previewTiddler = {
	text: 'preview',
	tooltip: 'show key-by-key preview',
	text_alt: '\u221Apreview',
	handler: function(event,src,title) {
		var here=story.findContainingTiddler(src); if (!here) return;
		var elems=here.getElementsByTagName("span");
		for (var e=0; e<elems.length; e++) {
			if (elems[e].getAttribute("editid")) {
				var show=elems[e].style.display=="none";
				src.innerHTML=show?this.text_alt:this.text;
				elems[e].style.display=show?"block":"none";
				config.macros.preview.findContainingForm(elems[e]).freeze.checked=!show;
				if (show) config.macros.preview.render(elems[e].getAttribute("editid"),elems[e].id);
			}
		}
		return false;
	}
};
//}}}
/***
|Name|PreviewPluginInfo|
|Source|http://www.TiddlyTools.com/#PreviewPlugin|
|Documentation|http://www.TiddlyTools.com/#PreviewPluginInfo|
|Version|1.8.1|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|documentation|
|Description|documentation for PreviewPlugin|
Provides key-by-key ''LIVE PREVIEW'' of //formatted// tiddler content as you type input into a textarea (multi-line) edit field.
!!!!!Usage
<<<
Syntax: (in tiddler content)
{{{
<<preview hide fieldname height>>
}}}
//OR// (in [[EditTemplate]])
{{{
<span macro='preview hide fieldname height'></span>
}}}
where:
* 'hide' (optional)<br>is a keyword that causes the preview display to be initially hidden when created.  This is typically used in an [[EditTemplate]] definition, in conjunction with the 'previewTiddler' toolbar syntax (see below).
* fieldname (optional)<br>specifies the name of the tiddler field that is being previewed.  It corresponds to the fieldname specified in the {{{<span class='editor' macro='edit fieldname height'></span>}}} syntax used to define the textarea edit field, and is used to locate and access the source content that is to be previewed.  When omitted, the previewer will automatically associate itself with the last textarea control that precedes it in the rendered tiddler editor display.
* height (optional)<br>defines the total height of the previewer display (including the status line and controls), using CSS "em" (line height) measurements.  The default height value is "15em" (i.e., approximately 15 lines of standard-sized text)

In addition to the preview macro itself, you can place the following in your [[EditTemplate]] to add a tiddler toolbar command that enables you to toggle the preview display once it has been created:
{{{
<span class='toolbar' macro='toolbar previewTiddler'></span>
}}}
when clicked, this command will show/hide ALL preview controls that are displayed in the current tiddler.  Note that, when desired, you can also embed this toolbar command directly into a tiddler by entering the "{{{<<toolbar previewTiddler>>}}}" syntax in the tiddler source.
<<<
!!!!!Examples
<<<
in [[EditTemplate]]:
{{{
<div class='editor' macro='edit foobar 5'></div>
<div class='editor' macro='preview hide foobar 10'></div>
}}}
OR, embedded in tiddler content:
{{{
<<edit foobar 5>><<preview foobar 10>>
}}}
{{smallform{
<<edit foobar 5>><<preview foobar 10>>}}}
By default, the preview display is automatically rendered each time a key is typed into the tiddler content edit field.  As soon as changes are entered, they will be instantly visible within the preview display.  Unfortunately, the partial tiddler source definitions that occur //during// editing may somtimes cause rendering problems, and some exceptionally complex tiddlers make take an unusually long amount of time to completely render their content.   In such cases, key-by-key display updates are undesirable or impractical.

You can select the ''freeze'' checkbox to suspend automatic key-by-key preview display updates.  The preview display will not be re-rendered again until you press the ''refresh'' button or clear the 'freeze' checkbox.  The preview display will also automatically freeze whenever the //rendering time// exceeds a pre-determined time limit (see configuration section), specified in milliseconds.  Note: the ''actual elapsed time'' used to process and render any given content is reported in the preview "status bar" whenever that content is previewed.

In addition to a 'wikified' preview, the previewer display can show a ''DOM viewer'' and/or an ''HTML viewer'' that are also updated with each keystroke.  These text-based displays can be helpful while attempting to correct or enhance the formatting of tiddler content, especially when complex combinations of wiki-syntax produce unexpected or undesired results.
<<<
# Image/Signal Reconstruction using Compressed Sensing
##Inverse Problem
##Use filters in decoder
##Problem:
##* Encoder Design using Simulink
##** Filter? or just Matrix Multiple
##* Decoder Design using Simulink
##** Filter? or like Belief Propagation, RVM algo.
##** How to employ filters in decoder to improve performance
#locate a position in 3D place using CS
## Can CS be used in this settings?
Reference: http://technet.microsoft.com/en-us/library/cc731131%28WS.10%29.aspx
>netsh winhttp ''command''
{{{
netsh winhttp import proxy source=ie
}}}
!!Conference Publications
*X. Wang, ''H. Fang'', X. Zhu, B. Li, Y. Liu, "Sparse filter correlation model based joint reconstruction in distributed compressive video sensing", //IEEE Inter. Conf. on Network Infrastructure and Digital Content//, Beijing, China, pp. 483-487, Sept. 2010.
[[2011-9-5#Video Compression Using Sparsity of The Diff. Between Consecutive Frames]]
[[2011-9-6#Parallel recon. in CS]]
[[2011-9-8#Learning from interframe coding to parallel recon. in CS]]
[[2011-9-20#Question about interframe coding]]
[[2011-9-25#Thinking about Parallel recon. in CS]]
[[2011-9-26#Thinking about Parallel recon. in CS -- Cont.]]
[[2011-9-29#Review of talk about Parallel recon. in CS]]
[[2011-9-30#Test the sparsity level]]
[[2011-10-5#Average the column sparsity]]
[[2011-10-5#General Form of Parallel recon. in CS]]
[[2011-10-10#Think about general form of Parallel recon. in CS]]
[[2011-10-19#The Real Problem in parallel recon. in CS]]
[[2011-10-24#Test the sparsity level -- Cont.]]
[[2011-10-25#Test the sparsity level -- Cont.]]
[[2011-10-27#Idea about Parallel recon. in CS]]
[[2012-1-2#Meeting for the research topic]]
[[2012-1-11#Meeting with Dr. Vorobyov and Dr. Jiang]]
[[2012-1-12#Try BCS code]]
[[2012-1-19#Understanding SPmag-CS-Code]]
[[2012-1-20#Try CS methods for images]]
[[2012-1-24#CS summary]]
[[2012-1-26#Block CS of images Summary]]
[[2012-1-26#l1magic tveq]]
[[2012-1-28#Block CS-TV implementation]]
[[2012-1-28#Next Actions]]
[[2012-1-28#Try Block CS-SPL]]
[[2012-1-30#Summary min l1norm Toolbox]]
[[2012-1-30#Try Block CS-L1-DCT]]
[[2012-2-2#ZIGZAG Permutation for video]]
[[2012-2-3#Question to Study]]
[[2012-2-4#Review of the size of Measurement Matrix in Compressed Sensing]]
[[2012-2-5#Discussion about sparsity level for image/video]]
[[2012-2-15#BCS extended frame reconstruction]]
!!! @Beijing University of Posts and Telecommunications
[[2010]]
[[2011-3]]
[[2011-4]]
[[2011-5]]
[[2011-6]]
!!Current Research Topics
[[Compressive Sensing]]
[[Topic Review]]

!!Previous Research Topics
[[Belief Propagation]]
[[LDPC]]
[[WSN]]
[[Matrix Completion]]
[[SVC-H.264 MPEG]]

!!Resources
[[Test Video Sequences]]

Rogers APN Settings (for Android phones)
by ZANDER KIDD on MAY 26, 2011
These settings will allow you to use a non-Rogers phone on the Rogers network. They should work for any phone but I’ll focus on how to configure things in Android.

To get to the configuration screen go to:
{{{
Settings > Wireless & Networks > Mobile Networks > Access Point Names
*menu button* > New APN

Data Configuration

Name: Rogers
APN: internet.com
Password: wap
MCC: 302
MNC: 720
APN Type: default,supl
*all other settings left blank*
}}}
MMS Configuration

Then if you need support for picture and video texts also add the following APN.
{{{
Name: Rogers MMS
APN: rogers-core-appl1.apn
MMSC: http://mms.grps.rogers.com
MMS Proxy: 10.128.1.69
MMS Port: 80
MCC: 302
MNC: 720
APN Type: mms
*all other settings left blank*
}}}
!!!! 1. createQVGAOriginals.sh
{{{
./bin/DownConvertStatic 640 480 org/640x480@30_Crew.yuv     320 240 org/320x240@15_Crew.yuv       0 1
./bin/DownConvertStatic 640 480 org/640x480@30_Soccer.yuv   320 240 org/320x240@15_Soccer.yuv     0 1
./bin/DownConvertStatic 640 480 org/640x480@25_CrowdRun.yuv 320 240 org/320x240@12.5_CrowdRun.yuv 0 1
./bin/DownConvertStatic 640 480 org/640x480@25_Seeking.yuv  320 240 org/320x240@12.5_Seeking.yuv  0 
}}}

DownConvertStatic: resampler
The resampler can be used for spatial/temporal resampling (up-sampling or down-sampling) 
of video sequences. More information on using the resampler are provided in section 2.1.
{{{
DownConvertStatic <win> <hin> <in>  <wout> <hout> <out>
                      [<method> [<t> [<skip> [<frms> ]]]]
                      [[-crop <args>] [-phase <args>]]

  win     : input width  (luma samples)
  hin     : input height (luma samples)
  in      : input file
  wout    : output width  (luma samples)
  hout    : output height (luma samples)
  out     : output file
--------------------------- OPTIONAL ---------------------------
  method  : rescaling methods (default: 0)
            0: normative upsampling
               non-normative downsampling (JVT-R006)
            1: dyadic upsampling (AVC 6-tap (1/2 pel) on odd luma samples 
               dyadic downsampling (MPEG-4 downsampling filter)
            2: crop only
            3: upsampling (Three-lobed Lanczos-windowed sinc)
            4: upsampling (JVT-O041: AVC 6-tap (1/2 pel) + bilinear 1/4 pel)
  t       : number of temporal downsampling stages (default: 0)
  skip    : number of frames to skip at start (default: 0)
  frms    : number of frames wanted in output file (default: max)

-------------------------- OVERLOADED --------------------------
 -crop  <type> <parameters>
   type      : 0: Sequence level,    1: Picture level
   params    : IF Sequence level: <x_orig> <y_orig> <crop_width> <crop_height>
               cropping window origin (x,y) and dimensions (width and height)
               IF Picture level: <crop_file>
                 input file containing cropping window parameters.
                 each line has four integer numbers separated by a comma
                 as following: "x_orig, y_orig, crop_width, crop_height"
                 for each picture to be resampled;

-phase <in_uv_ph_x> <in_uv_ph_y> <out_uv_ph_x> <out_uv_ph_y>
   in_uv_ph_x : input  chroma phase shift in horizontal direction (default:-1)
   in_uv_ph_y : input  chroma phase shift in vertical   direction (default: 0)
   out_uv_ph_x: output chroma phase shift in horizontal direction (default:-1)
   out_uv_ph_y: output chroma phase shift in vertical   direction (default: 0)

-resample_mode <resample_mode> (default: 0)
       0: low-res-frm  = progressive, 
          high-res-frm = progressive
       1: low-res-frm  = interlaced, 
          high-res-frm = interlaced
       2: low-res-frm  = progressive  (top-coincided),
          high-res-frm = interlaced
       3: low-res-frm  = progressive  (bot-coincided),
          high-res-frm = interlaced
       4: low-res-frm  = interlaced   (top-first)
          high-res-frm = progressive  (double frm rate),
       5: low-res-frm  = interlaced   (bot-first),
          high-res-frm = progressive  (double frm rate)

}}}

!!!! 2. encodeAVC.sh
{{{
screen -d -m ./scr/encAVC-BP.sh  Crew      30 192 36    36 35 35 35
screen -d -m ./scr/encAVC-BP.sh  Soccer    30 192 35    35 35 34 34
screen -d -m ./scr/encAVC-BP.sh  CrowdRun  25 384 38    38 38 39 39
screen -d -m ./scr/encAVC-BP.sh  Seeking   25 384 34    34 35 35 35

screen -d -m ./scr/encAVC-HP.sh  Crew      30 384 30 -1 30 29 29 29
screen -d -m ./scr/encAVC-HP.sh  Soccer    30 384 28 +1 27 27 27 27
screen -d -m ./scr/encAVC-HP.sh  CrowdRun  25 768 32 -1 33 33 33 33
screen -d -m ./scr/encAVC-HP.sh  Seeking   25 768 28 -1 29 29 29 29
}}}

screen -d -m: 启动一个开始就处于断开模式的会话

encACV-HP.sh (1:seq) (2:fps) (3:SVC-rate) (4:QP) (5:scale offset) (6:MQP0) (7:MQP1) (8:MQP2) (9:MQP3)
@@''????Unkown Parameter: ''@@
# SVC-rate
# QP
# scale offset
# MQP0-3

encACV-HP.sh
{{{
# (1:seq) (2:fps) (3:SVC-rate) (4:QP) (5:scale offset) (6:MQP0) (7:MQP1) (8:MQP2) (9:MQP3)
FPS=$2
if(( ${FPS} % 2 == 1 ))
then
FPS2=$((${FPS}/2)).5
else
FPS2=$((${FPS}/2))
fi
FRM=$(($2*10))
FMT="320x240@${FPS2}"
RAT=$(($3*10/11))
NAM="$1_AVC_${FMT}@${RAT}"
ORG="org/${FMT}_$1.yuv"
STR="str/${NAM}.264"
REC="tmp/${NAM}.rec"

./bin/H264AVCEncoderLibTestStatic -pf cfg/AVC_${FMT}-HP.cfg -bf ${STR} -org 0 ${ORG} -rec 0 ${REC} -frms ${FRM} -lqp 0 $4 -sofs 0 $5 -mqp 0 0 $6 -mqp 0 1 $7 -mqp 0 2 $8 -mqp 0 3 $9
rm -f ${REC}
}}}

FPS2: 应该是新的FPS,即原来FPS的一半(if then else部分是因为整数除以整数会自动变成整数,如25/2 = 12,所以为了保证是原来FPS的一半,作了一个判断)
RAT: = SVC-rate*10/11
生成的名字NAM是:原seq名字_AVC_${FMT}@${RAT}
源文件ORG是=>文件目录是org,后缀名是.yuv
????@@STR@@ => 文件目录是STR,后缀名是.264
重建REC => 文件目录是tmp,后缀名是.rec


!!!! 3. H264AVCEncoderLibTestStatic: AVC/SVC encoder
The encoder can be used for generating single-layer (AVC) or scalable (SVC) bit-streams. More information on using the encoder are provided in section 2.2.
{{{
H264AVCEncoderLibTestStatic.exe –pf <mcfg> [command line options]
}}}
# 使用这个encoder不能保证rate-distortion efficient coding
# 在scalable mode下使用这个encoder要十分小心 (在supported scalability options, coding efficieny会下降)
# @@目前encoder的实现不能提供rate-control@@ => bit rate需要通过选择合适的量化参数来控制

这个encoder可以在两种coding模式下跑:single-layer mode,scalable coding mode
{{{
signal-layer coding mode: more flexibility
scalable coding mode: 用来生成scalable bit-stream
}}}
选择mode:在main config file@@????I cannot find the main config file@@里的AVCMode参数来修改mode
# scalable coding mode: @@????not present@@ or equal to 0
# single-layer coding mode: otherwise
# NOTE: 在.cfg中,AVCMode default是0,即scalable coding mode

具体的Config File见2.2.1.1

小波树模型的BP改进(系数节点之间有相关性,需要消息传递)
!!!修改射手影音播放器字幕保存路径的两种方法
http://joys.name/2010/11/how-to-modify-splayer-subtitle-save-path.html
*use different ssh private key to manage different projects
edit ~/.ssh/config
{{{
Host github.com
User Allen
Hostname github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa_tiddlywiki

Host labschina
User Allen
Hostname 221.2.105.30
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
}}}
!! Introduction
Refert to: http://www.52video.net/art_view5680.html

# SVC: Scalable Video Coding,可分级视频编码
# H.264 SVC是传统H.264 AVC的扩展
# 为了适应不同设备不同网络情况下的编码
# 从时间(temporal),空间(spatial),质量(quality)上进行分层
# 分层编码,网络情况好,使用基本层+增强层,情况差,使用基本层
# <html><a href="http://www.52video.net/UserFiles/Image/2008-03/sh5.gif">分层结构</a></html>
<html><img src="http://www.52video.net/UserFiles/Image/2008-03/sh5.gif" /></html>

!! Source Code
Refer to: 2011-1-14 SVC-H.264 MPEG/SoftwareManual.doc 
!!! SBB-SNR-Encoding
# Main encoder configuration file: .cfg
# Layer configuration file: .sl
# 在cmd line中
## 可以指定main configuration file
## 似乎是只在scalable mode下才有用
## 会overwritten在main cfg file中的parameters
!!!! How to use the code
# Resample the video sequence: 
## file: createQVGAOriginals.sh
## from 640*480 to 320*240
## can designate the sequence name
# Encode:
## file: encodeAVC.sh
## ''NOTE:'' the config files is in cfg/ folder
### Name: AVC_${FMT}-HP.cfg 
### FMT = 320x240@${FPS2}
### FPS2 = FPS/2 (eg. FPS=30, FPS2 = 15; FPS=25, FPS2=12.5)
## How to define the file refer to 2.2.1.1 Configuration file
## ''NOTE:'' the parameter in the configuration file would be overwritten by the command line options.<br>So the final result is controlled by both the configuration file and command line parameters.
## In fact, the encodeAVC.sh is just mean to call H264AVCEncoderLibTestStatic, so more information can be found in chapter about H264AVCEncoderLibTestStatic in SoftManual.doc
## designate parameters: (1:seq) (2:fps) (3:SVC-rate) (4:QP) (5:scale offset) (6:MQP0) (7:MQP1) (8:MQP2) (9:MQP3)
## sequence name, refer to createQVGAOriginals.sh
## frame per secondes, such as 640x320@ @@30@@_Crew.yuv is 30
## SVC-rate, @@what rate????@@, new rate is SVC-rate * 10 / 11
## QP: Quantization parameter @@????don't know why 36 35 ... in encodeAVC.sh@@
### used in H264AVCEncoderLibTestStatic: 
### -lqp (layer) (lQP): Specifies the basis quantization parameter and the Lagrangian parameters for the layer given by layer, including MeQPLP
## scale offset: @@????cannot find@@
## MQP0-3
### -mqp (layer) (stage) (mQP)
### Specifies the Lagrangian parameter for the temporal level stage of the layer layer. Overwrites the parameters MeQPX of the corresponding layer configuration file with X being equal to stage. The Lagragian parameter is specified by a quantization parameter mQP as specified in the description of the parameters MeQPX.

See the last but two line(倒数第二行) in encAVC-HP.sh
{{{
./bin/H264AVCEncoderLibTestStatic -pf cfg/AVC_${FMT}-HP.cfg -bf ${STR} -org 0 ${ORG} 
-rec 0 ${REC} -frms ${FRM} -lqp 0 $4 -sofs 0 $5 -mqp 0 0 $6 -mqp 0 1 $7 
-mqp 0 2 $8 -mqp 0 3 $9
}}}
It is the core of the encode process.
Here it defines 
## the configuration file: -pf (config)
## the org file: -org (layer) (original)<br>The parameter original overwrites the parameter InputFile of the layer configuration file for the layer given by layer.<br>Thus in the file cfg/AVC_320x240@12.5-HP.cfg file, there is no InputFile item.
## the reconstruction file: -rec (layer) (reconstructed)<br>The parameter reconstructed overwrites the parameter ReconFile of the layer configuration file for the layer given by layer.
## -frms (frames) <br>The parameter frames specifies the number of frames of the input sequence to be encoded. The number of frames to be encoded is specified at the frame rate given by the parameter FrameRate in the main configuration file.<br>即这个参数是定义要编码的输入序列的帧的数目,而这个数目与.cfg文件里FrameRate有关系,@@????什么关系还没弄清楚@@
## -lqp (layer) (lQP): Specifies the basis quantization parameter and the Lagrangian parameters for the layer given by layer, including MeQPLP
## -sofs: @@????unknown@@
## -mqp (layer) (stage) (mQP)
### Specifies the Lagrangian parameter for the temporal level stage of the layer layer. Overwrites the parameters MeQPX of the corresponding layer configuration file with X being equal to stage. The Lagragian parameter is specified by a quantization parameter mQP as specified in the description of the parameters MeQPX.

See the last two lines in .cfg file, it is the layer definition
Here it defines the layer configuration file, .sl.


!!! SBB-SNR-Decoding


!!! PSNR tool
see SoftManual.doc 2.8
PSNRStatic
{{{
PSNRStatic <w> <h> <org> <rec> [<t> [<skip> [<strm> <fps>]]]

    w: original width  (luma samples)
    h: original height (luma samples)
  org: original file
  rec: reconstructed file
    t: number of temporal downsampling stages (default: 0)
 skip: number of frames to skip at start      (default: 0)
 strm: coded stream
 frms: frames per second
}}}

!! Goal
# 原始和编码后的视频序列 (OK, in org/xxx, name format has been listed above)
# 压缩率:指的什么和什么的比?fps?
# 输出的PSNR:see PSNR tool, after reconstructing the video sequence, use PSNRStatic to get the PSNR.
# scalable如何设置
# 其他各种参数


!!!Proxy Setting
The svn command-line client never attempts to write to the Windows Registry and will not attempt to create a default configuration area there. You can create the keys you need using the REGEDIT program. Alternatively, you can create a .reg file (such as the one in Example 7.1, “Sample registration entries (.reg) file”), and then double-click on that file's icon in the Explorer shell, which will cause the data to be merged into your Registry.

Example 7.1. Sample registration entries (.reg) file
{{{
REGEDIT4

[HKEY_LOCAL_MACHINE\Software\Tigris.org\Subversion\Servers\global]
"http-proxy-host"="www-proxy.xxx.com"
"http-proxy-port"="8080"
"http-proxy-username"=""
"http-proxy-password"=""
"http-proxy-exceptions"=""
"http-timeout"="0"
"http-compression"="yes"
"neon-debug-mask"=""
"ssl-authority-files"=""
"ssl-trust-default-ca"=""
"ssl-client-cert-file"=""
"ssl-client-cert-password"=""
}}}

!!!! Abstract
# AIC: Analog-to-Information Conversion
# 信号先被segmented,然后通过AIC,产生一组incomplete measurements,然后重建

!!!! Introduction
# new CS method for AIC: reuse已经获得的measurements来获得新的一组相关的measurements
# 提出了extends the original CS meas. mtx to a larger mtx的步骤
# 证明了extended meas mtx满足RIP

!!!! Segmented Compressed Sampling
# 传统的,CS中的采样方式是一个采样和压缩的连续结合
## 因此,对于宽带信号,需要一个高速的ADC
# 但是,可以使用RMPI系统
## 不再是用Nyquist Rate采样信号然后pass it through meas mtx
## RMPI系统是为AIC提出的,refer to [8]
## Fig 1是采样框架
### x(t)是模拟信号 -> 卷积phi(t) -> 在一个周期T内积分得到yi(一个值)
### ''review 信号采样...''
## Parallel branches of mixer and integrators
### mixer?卷积器? Integrator?积分器?
# 使用parallel AIC的好处是不需要告诉的ADC了
## 但是仍需要many practical applications to collect a large number of meas for 连续的信号处理和恢复?
## 信号恢复直接影响AIC的复杂度:因为collect more samples in parallel需要增加branches
## 所以,要在不影响恢复准确率的情况下降低branches数(这样就能降低复杂度)
### by 分割每个分支的积分时间,然后得到一系列不完整的meas.,而不是从整个积分区间得到一个meas,即
#### segmented       积分时间: 一段一段的,N段  => meas:每段对应一个,N个
#### 传统                 积分时间:整个            => meas:一个值
### 这样,由于原始的积分时间被分为许多小去接,因此meas没有关于信号的完整信息 => incomplete meas
#### complete meas => samples V.S. incomplete meas => sub-samples
# 重点来了,再与Reuse这些sub-samples
## K1个采样waveforms phi
## M个sub-intervals
## 所以总共有MK1个sub-samples(原本只有K1个)
### 可以用K1*M的矩阵表示
### 原始的sample可以通过对M个sub-sample求和得到(积分的意义)
# 得到第(K1 + 1)个sample
## ??这个sample用来干啥?
## 在主对角线上选取M个sub-samples,把他们相加
# 得到第(K1 + 2)个sample
## 在第二条对角线桑的M个sub-samples相加
# repeat...K2次,K2 <= K1
# 这种获取K1+K2个sample的方法,也可以通过用一个新的矩阵phi来得到
## 文章给出了新矩阵phi的构成方法
# 这样获得的新的sample是和actual samples有相关性的,但是,这能够显著提高恢复准确率

!!!!Analysis
# 证明phi是满足RIP的,从而可以用作CS的meas mtx
## phi1是符合RIP的
## Lemma1 => Theorem 1:phi以高概率满足RIP

!!!! Notes
# 还有一篇Segmented Compressed Sampling for Analog-to-Information Conversion:Method and Performance Analysis 更加详细的提出了这个理论

!!!! 想法
# 把矩阵用到BCS中,或者CS-BP中,替换原来的LDPC矩阵,对extended mtx进行改进...
<<tabs txtMainTab "Timeline" "Timeline" TabTimeline "All" "All tiddlers" TabAll "Tags" "All tags" TabTags "More" "More lists" TabMore>>
Unable to locate 'mexopts.bat' and therefore cannot determine which compiler to use for simulation builds.
Use 'mex -setup' to select a supported compiler.
Matlab requires compiler to compile this project.
See
http://www.mathworks.com/support/compilers/R2009b/win64.html

* Microsoft Visual C++ Express Edition is a free version, downloadable at http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express
powered by [[TiddlyWiki|http://www.tiddlywiki.com]] and [[github.com|http://www.github.com]]
Hao's ~TiddlyWiki
!!!! Domain Name
# haospace
# fangspace
# haozone
# fangzone
# hfang
# haolive
# haolife
# haoblog
# haowiki
*Tiddlyspace (hao.tiddlyspace.com)
* relative path
{{{
<img src="global/edalogo.png">
}}}
* abstract path
{{{
<img src="/admin/global/edalogo.png">
}}}
It is not recommended to use the whole path of the url, such as http://hello.com/admin/global/edalogo.png.
Because once the domain name changed, the code would be invalid.
Usually, we should use abstract path excluding the domain to refer a source file or an action
!!!! Referred by "Computationlly Efficient Sparse Bayesian Learning via Belief Propagation"
# 仅使用了[10]中三层贝叶斯模型中的前两层
# 将EM-based SBL算法用于sparse signal recovery
# EM-based SBL算法的local minima都在sparse solution处得到
# 给出了various interpretation来解释为什么这个SBL方法能够给出sparse solution

!!!!Introduction
# Sparse signal representation
## t = phi * w + epsilon
### w是需要得到的vector
### epsilon是噪声
### 寻找大部分元素是0的w,使得等式依然能够近似满足
### 这等价于适用最小数目的basis vector来表示t
# SBL算法用来解决这种问题
## 这和basis selection的密切关系在于合并了在weights上的参数化先验信息,使得representation变得稀疏

!!!!Sparse Bayesian Learning
# 使用高斯模型
## t|w ~ N(phi*w, sigma)
# 在这种模型下,得到w的maximum likelihood estimates等价于t=phi*w+epsilon的min l2-norm solution
## 这种solution常常产生非稀疏的解
## 为了解决这个问题,需要给出weight的某种先验信息,从而保证解的稀疏性
## modern Bayesian方法既不会尝试选择正确的先验信息,也不会使用FOUSS/Basis Pursuit方法来选择一个固定的,导致稀疏的先验信息
## 但是,可以根据不同的对与underlying truth的假设来使用很多不同的先验
### 可以通过评价每个先验模型的Bayesian evidence来比较这些假设
#### 假设有两个不同的假设H1, H2
#### 我们需要根据observed data t来比较这两个假设
#### 计算p(t; H, sigma),即积分,见(7)
### @@在BP-SBL中,对w的先验模型是高斯分布,是否能够评价一下高斯分布和混合高斯分布这两种先验的好坏?@@
### 这个步骤也可以用来估计噪声方差sigma
# Model Prior Formulation
## 和FOCUSS和Basis Pursuit不同的(他们给出一个确定的prior),SBL通过数据来估计一个参数化的prior
## 公式(8)
# Algorithm Development
## w|t ~ N(mu, sigma_w)

.....
!!!!Spectral Efficiency
v = R~~s~~/B, Baud/Hz, specified for Baseband System
v = R~~b~~/B, bits/s/Hz, not specified

!!!!Bandwidth
1) Baseband
baseband signal rate: R (bps)
Ideal LPF: B=R/2 (Hz)
Raised-cosine Pulses: B=R(1+a)/2 (Hz)
2) Passband
Modulation: DSB, SSB, VSB
DSB: BPSK, QPSK
*Baseband: B => Passband: 2B
SSB: 
*Baseband: B => Passband: B

bit-stream -> Constellation Mapper -> I, Q -> g~~I~~(t), g~~Q~~(t) -> Modulator(I, Q) -> Modulated Signal

M = 2^^k^^
R~~b~~=kR~~s~~
MPSK/MQAM:
k = log~~2~~M
Baseband BW: B~~BB~~ = R~~s~~(1+a)/2
Passband BW: (DSB) B~~PB~~ = 2B~~BB~~
''v = R~~b~~/B~~PB~~ =(log~~2~~M)/(1+a)''

let a = 1
16QAM: v = 2 bits/s/Hz
64QAM: v = 3 bits/s/Hz

~M-AM(SSB)
''v = 2log~~2~~M/(1+a)''
Primary roles of spectrum management
*Radio frequency (RF) spectrum access
*interference management

!!Why is Spectrum Management required?
CR需要在所有可用的频带中判决出条件最好的频带以满足QoS要求
!!Main tasks
Design an adaptvie scheme with high sepctrum efficiency
*E.g. a set of spectrum holes, DFM cannot meet user's requirement, like FER(Frame Error Rate) req., a more eff. modulation or other available spectrum holes, to improve the comm. reliability
!!Outline
# Spectrum Analysis
# Spectrum Decision
!!Spectrum Analysis -- Task
* Task
** 归纳可用spectrum hole在不同的时间段内的频谱特性
** 使认知无线电能够做出最符合用户要求的判决
!!Spectrum Analysis -- Quality of Spectrum Holes
Quality of Spectrum Holes
*interference
*路径损失
*无线链路的错误
*链路层延迟
*占用时间
!!@@Spectrum Analysis -- Channel Capacity@@
Channel capacity is the most important charactereristic of 频谱特性
*can be derived from 上述parameters
*usually, use SNR at receiver side to calculate the channel capacity
[12] proposed a way to estimate spectrum capacity
* considering bandwidth and 可允许的transmission power
*$C= B{\rm log}\bigg(1+{S\over{N+I}}\bigg)$
** B is bandwidth
** S is the power of received CR signal
** N is noise power
** I is the interference at radio receiver caused by the primary user transmitter
[7] the estimation of spectrum capacity based on OFDM
*$C=\int_\Omega{1\over2}log_2\big(1+{G(f)S_0\over N_0}\big)df$
** $\Omega$ is the unused spectrum 集合
** $G(f)$ is the channel power gain at frequency $f$
** $S_0$ and $N_0$ is the power of signal and noise at unit frequency, respectively
!!!Channel Status estimation and prediction model
Traditional Channel State Estimation
* Differential Detection
**advantages
***强壮性
***简洁性
**disadvantages
***帧误码率
* Pilot transmission
**advantages
***receiver's performance
** disadvantages (periodicly send training sequence)
***transmission power
***bandwidth
Semi-Blind Training [34]
*监视训练模式
*跟踪模式
!!!@@State-Space Model@@
用于进行信道跟踪
*状态方程
**$x_{j_k, t+1} = \sum^p_{l=1}\beta_{l,t}x{j_k, t-l} + d_{j_k, t}$
***$\beta_{l,t}$ is the AR coeff. at time t
***$d_{j_k,t}$ is the corresponding dynamic noise
!!!速率反馈
*对接受机来说,必须知道channel satus informaiton才能对transmitted signal进行相关解调
*对transmitter来说,需要知道channel capacity来控制transmission power
** need CSI
#receiver calculate the 瞬时capacity C
#quantize
#* predefined quantisation table
#把量化的传输速率反馈给transmitter (速率反馈)

在无线通信中,传输速率经常产生很大的波动。在任何时候,发射机都想知道波动的情况。
*如果transmission power超过了channel capacity,通信就会outage
中断capacity:在规定的中断概率下,信道能维持的最大比特率

feedback -> delay
during the delay, C is changing, potentially increase the outage prob.
-> prediction model
*一阶Markov Model

!!@@Spetrum Decision@@
transmission rate
acceptable error rate
maxium delay
transmission mode
transmission bandwidth
=> decision

!!Challenge
#decision model
#multi-spectrum decision
#re-configuration cooperation
#spectrum decision in diff. spectrum









android.app.Service is descendant of android.app.Context so you can use startActivity directly. However since you start this outside any activity you need to set FLAG_ACTIVITY_NEW_TASK flag on the intent.

For example:
<code java>
Intent i = new Intent();
i.setClass(this, MyActivity.class);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(i);       
where this is your service.
</code>
[[StyleSheetSyntaxHighlighter]]
.viewer {
  line-height: 125%;
  font-family: calibri;
  font-size: 12pt;
}
/*{{{*/
@media print {
#mainMenu, #sidebar, #messageArea, .toolbar, #backstageButton, #backstageArea, .headerShadow {display: none !important;}
#displayArea {margin: 1em 1em 0em;}
noscript {display:none;} /* Fixes a feature in Firefox 1.5.0.2 where print preview displays the noscript content */
}
/*}}}*/
/***
StyleSheet for ~SyntaxHighlighter
***/

/*{{{*/
.dp-highlighter
{
	font-family: "Consolas", "Courier New", Courier, mono, serif;
	font-size: 12px;
	background-color: #E7E5DC;
	width: 99%;
	overflow: auto;
	margin: 18px 0 18px 0 !important;
	padding-top: 1px; /* adds a little border on top when controls are hidden */
}

/* clear styles */
.dp-highlighter ol,
.dp-highlighter ol li,
.dp-highlighter ol li span 
{
	margin: 0;
	padding: 0;
	border: none;
}

.dp-highlighter a,
.dp-highlighter a:hover
{
	background: none;
	border: none;
	padding: 0;
	margin: 0;
}

.dp-highlighter .bar
{
	padding-left: 45px;
}

.dp-highlighter.collapsed .bar,
.dp-highlighter.nogutter .bar
{
	padding-left: 0px;
}

.dp-highlighter ol
{
	list-style: decimal; /* for ie */
	background-color: #fff;
	margin: 0px 0px 1px 45px !important; /* 1px bottom margin seems to fix occasional Firefox scrolling */
	padding: 0px;
	color: #5C5C5C;
}

.dp-highlighter.nogutter ol,
.dp-highlighter.nogutter ol li
{
	list-style: none !important;
	margin-left: 0px !important;
}

.dp-highlighter ol li,
.dp-highlighter .columns div
{
	list-style: decimal-leading-zero; /* better look for others, override cascade from OL */
	list-style-position: outside !important;
	border-left: 3px solid #6CE26C;
	background-color: #F8F8F8;
	color: #5C5C5C;
	padding: 0 3px 0 10px !important;
	margin: 0 !important;
	line-height: 14px;
}

.dp-highlighter.nogutter ol li,
.dp-highlighter.nogutter .columns div
{
	border: 0;
}

.dp-highlighter .columns
{
	background-color: #F8F8F8;
	color: gray;
	overflow: hidden;
	width: 100%;
}

.dp-highlighter .columns div
{
	padding-bottom: 5px;
}

.dp-highlighter ol li.alt
{
	background-color: #FFF;
	color: inherit;
}

.dp-highlighter ol li span
{
	color: black;
	background-color: inherit;
}

/* Adjust some properties when collapsed */

.dp-highlighter.collapsed ol
{
	margin: 0px;
}

.dp-highlighter.collapsed ol li
{
	display: none;
}

/* Additional modifications when in print-view */

.dp-highlighter.printing
{
	border: none;
}

.dp-highlighter.printing .tools
{
	display: none !important;
}

.dp-highlighter.printing li
{
	display: list-item !important;
}

/* Styles for the tools */

.dp-highlighter .tools
{
	padding: 3px 8px 3px 10px;
	font: 9px Verdana, Geneva, Arial, Helvetica, sans-serif;
	color: silver;
	background-color: #f8f8f8;
	padding-bottom: 10px;
	border-left: 3px solid #6CE26C;
}

.dp-highlighter.nogutter .tools
{
	border-left: 0;
}

.dp-highlighter.collapsed .tools
{
	border-bottom: 0;
}

.dp-highlighter .tools a
{
	font-size: 9px;
	color: #a0a0a0;
	background-color: inherit;
	text-decoration: none;
	margin-right: 10px;
}

.dp-highlighter .tools a:hover
{
	color: red;
	background-color: inherit;
	text-decoration: underline;
}

/* About dialog styles */

.dp-about { background-color: #fff; color: #333; margin: 0px; padding: 0px; }
.dp-about table { width: 100%; height: 100%; font-size: 11px; font-family: Tahoma, Verdana, Arial, sans-serif !important; }
.dp-about td { padding: 10px; vertical-align: top; }
.dp-about .copy { border-bottom: 1px solid #ACA899; height: 95%; }
.dp-about .title { color: red; background-color: inherit; font-weight: bold; }
.dp-about .para { margin: 0 0 4px 0; }
.dp-about .footer { background-color: #ECEADB; color: #333; border-top: 1px solid #fff; text-align: right; }
.dp-about .close { font-size: 11px; font-family: Tahoma, Verdana, Arial, sans-serif !important; background-color: #ECEADB; color: #333; width: 60px; height: 22px; }

/* Language specific styles */

.dp-highlighter .comment, .dp-highlighter .comments { color: #008200; background-color: inherit; }
.dp-highlighter .string { color: blue; background-color: inherit; }
.dp-highlighter .keyword { color: #069; font-weight: bold; background-color: inherit; }
.dp-highlighter .preprocessor { color: gray; background-color: inherit; }

/*}}}*/
/***
!Metadata:
|''Name:''|SyntaxHighlighterPlugin|
|''Description:''|Code Syntax Highlighter Plugin for TiddlyWiki.|
|''Version:''|1.1.3|
|''Date:''|Oct 24, 2008|
|''Source:''|http://www.coolcode.cn/show-310-1.html|
|''Author:''|Ma Bingyao (andot (at) ujn (dot) edu (dot) cn)|
|''License:''|[[GNU Lesser General Public License|http://www.gnu.org/licenses/lgpl.txt]]|
|''~CoreVersion:''|2.4.1|
|''Browser:''|Firefox 1.5+; InternetExplorer 6.0; Safari; Opera; Chrome; etc.|

!Syntax:
{{{
<code options>
codes
</code>
}}}

!Examples:
{{{
<code java>
public class HelloWorld {
    public static void main(String args[]) {
        System.out.println("HelloWorld!");
    }
}
</code>
}}}


!Code section:
***/
//{{{
var dp={sh:{Toolbar:{},Utils:{},RegexLib:{},Brushes:{},Strings:{AboutDialog:"<html><head><title>About...</title></head><body class=\"dp-about\"><table cellspacing=\"0\"><tr><td class=\"copy\"><p class=\"title\">dp.SyntaxHighlighter</div><div class=\"para\">Version: {V}</p><p><a href=\"http://www.dreamprojections.com/syntaxhighlighter/?ref=about\" target=\"_blank\">http://www.dreamprojections.com/syntaxhighlighter</a></p>&copy;2004-2007 Alex Gorbatchev.</td></tr><tr><td class=\"footer\"><input type=\"button\" class=\"close\" value=\"OK\" onClick=\"window.close()\"/></td></tr></table></body></html>"},ClipboardSwf:null,Version:"1.5.1"}};dp.SyntaxHighlighter=dp.sh;dp.sh.Toolbar.Commands={ExpandSource:{label:"+ expand source",check:function($){return $.collapse},func:function($,_){$.parentNode.removeChild($);_.div.className=_.div.className.replace("collapsed","")}},ViewSource:{label:"view plain",func:function($,_){var A=dp.sh.Utils.FixForBlogger(_.originalCode).replace(/</g,"&lt;"),B=window.open("","_blank","width=750, height=400, location=0, resizable=1, menubar=0, scrollbars=0");B.document.write("<textarea style=\"width:99%;height:99%\">"+A+"</textarea>");B.document.close()}},CopyToClipboard:{label:"copy to clipboard",check:function(){return window.clipboardData!=null||dp.sh.ClipboardSwf!=null},func:function($,A){var B=dp.sh.Utils.FixForBlogger(A.originalCode).replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&");if(window.clipboardData)window.clipboardData.setData("text",B);else if(dp.sh.ClipboardSwf!=null){var _=A.flashCopier;if(_==null){_=document.createElement("div");A.flashCopier=_;A.div.appendChild(_)}_.innerHTML="<embed src=\""+dp.sh.ClipboardSwf+"\" FlashVars=\"clipboard="+encodeURIComponent(B)+"\" width=\"0\" height=\"0\" type=\"application/x-shockwave-flash\"></embed>"}alert("The code is in your clipboard now")}},PrintSource:{label:"print",func:function($,B){var _=document.createElement("IFRAME"),A=null;_.style.cssText="position:absolute;width:0px;height:0px;left:-500px;top:-500px;";document.body.appendChild(_);A=_.contentWindow.document;dp.sh.Utils.CopyStyles(A,window.document);A.write("<div class=\""+B.div.className.replace("collapsed","")+" printing\">"+B.div.innerHTML+"</div>");A.close();_.contentWindow.focus();_.contentWindow.print();alert("Printing...");document.body.removeChild(_)}},About:{label:"?",func:function(_){var A=window.open("","_blank","dialog,width=300,height=150,scrollbars=0"),$=A.document;dp.sh.Utils.CopyStyles($,window.document);$.write(dp.sh.Strings.AboutDialog.replace("{V}",dp.sh.Version));$.close();A.focus()}}};dp.sh.Toolbar.Create=function(B){var A=document.createElement("DIV");A.className="tools";for(var _ in dp.sh.Toolbar.Commands){var $=dp.sh.Toolbar.Commands[_];if($.check!=null&&!$.check(B))continue;A.innerHTML+="<a href=\"#\" onclick=\"dp.sh.Toolbar.Command('"+_+"',this);return false;\">"+$.label+"</a>"}return A};dp.sh.Toolbar.Command=function(_,$){var A=$;while(A!=null&&A.className.indexOf("dp-highlighter")==-1)A=A.parentNode;if(A!=null)dp.sh.Toolbar.Commands[_].func($,A.highlighter)};dp.sh.Utils.CopyStyles=function(A,_){var $=_.getElementsByTagName("link");for(var B=0;B<$.length;B++)if($[B].rel.toLowerCase()=="stylesheet")A.write("<link type=\"text/css\" rel=\"stylesheet\" href=\""+$[B].href+"\"></link>")};dp.sh.Utils.FixForBlogger=function($){return(dp.sh.isBloggerMode==true)?$.replace(/<br\s*\/?>|&lt;br\s*\/?&gt;/gi,"\n"):$};dp.sh.RegexLib={MultiLineCComments:new RegExp("/\\*[\\s\\S]*?\\*/","gm"),SingleLineCComments:new RegExp("//.*$","gm"),SingleLinePerlComments:new RegExp("#.*$","gm"),DoubleQuotedString:new RegExp("\"(?:\\.|(\\\\\\\")|[^\\\"\"\\n])*\"","g"),SingleQuotedString:new RegExp("'(?:\\.|(\\\\\\')|[^\\''\\n])*'","g")};dp.sh.Match=function(_,$,A){this.value=_;this.index=$;this.length=_.length;this.css=A};dp.sh.Highlighter=function(){this.noGutter=false;this.addControls=true;this.collapse=false;this.tabsToSpaces=true;this.wrapColumn=80;this.showColumns=true};dp.sh.Highlighter.SortCallback=function($,_){if($.index<_.index)return-1;else if($.index>_.index)return 1;else if($.length<_.length)return-1;else if($.length>_.length)return 1;return 0};dp.sh.Highlighter.prototype.CreateElement=function(_){var $=document.createElement(_);$.highlighter=this;return $};dp.sh.Highlighter.prototype.GetMatches=function(_,B){var $=0,A=null;while((A=_.exec(this.code))!=null)this.matches[this.matches.length]=new dp.sh.Match(A[0],A.index,B)};dp.sh.Highlighter.prototype.AddBit=function($,A){if($==null||$.length==0)return;var C=this.CreateElement("SPAN");$=$.replace(/ /g,"&nbsp;");$=$.replace(/</g,"&lt;");$=$.replace(/\n/gm,"&nbsp;<br>");if(A!=null){if((/br/gi).test($)){var _=$.split("&nbsp;<br>");for(var B=0;B<_.length;B++){C=this.CreateElement("SPAN");C.className=A;C.innerHTML=_[B];this.div.appendChild(C);if(B+1<_.length)this.div.appendChild(this.CreateElement("BR"))}}else{C.className=A;C.innerHTML=$;this.div.appendChild(C)}}else{C.innerHTML=$;this.div.appendChild(C)}};dp.sh.Highlighter.prototype.IsInside=function(_){if(_==null||_.length==0)return false;for(var A=0;A<this.matches.length;A++){var $=this.matches[A];if($==null)continue;if((_.index>$.index)&&(_.index<$.index+$.length))return true}return false};dp.sh.Highlighter.prototype.ProcessRegexList=function(){for(var $=0;$<this.regexList.length;$++)this.GetMatches(this.regexList[$].regex,this.regexList[$].css)};dp.sh.Highlighter.prototype.ProcessSmartTabs=function(E){var B=E.split("\n"),$="",D=4,A="\t";function _(A,E,_){var B=A.substr(0,E),C=A.substr(E+1,A.length),$="";for(var D=0;D<_;D++)$+=" ";return B+$+C}function C(B,C){if(B.indexOf(A)==-1)return B;var D=0;while((D=B.indexOf(A))!=-1){var $=C-D%C;B=_(B,D,$)}return B}for(var F=0;F<B.length;F++)$+=C(B[F],D)+"\n";return $};dp.sh.Highlighter.prototype.SwitchToList=function(){var C=this.div.innerHTML.replace(/<(br)\/?>/gi,"\n"),B=C.split("\n");if(this.addControls==true)this.bar.appendChild(dp.sh.Toolbar.Create(this));if(this.showColumns){var A=this.CreateElement("div"),_=this.CreateElement("div"),E=10,G=1;while(G<=150)if(G%E==0){A.innerHTML+=G;G+=(G+"").length}else{A.innerHTML+="&middot;";G++}_.className="columns";_.appendChild(A);this.bar.appendChild(_)}for(var G=0,D=this.firstLine;G<B.length-1;G++,D++){var $=this.CreateElement("LI"),F=this.CreateElement("SPAN");$.className=(G%2==0)?"alt":"";F.innerHTML=B[G]+"&nbsp;";$.appendChild(F);this.ol.appendChild($)}this.div.innerHTML=""};dp.sh.Highlighter.prototype.Highlight=function(C){function A($){return $.replace(/^\s*(.*?)[\s\n]*$/g,"$1")}function $($){return $.replace(/\n*$/,"").replace(/^\n*/,"")}function _(B){var E=dp.sh.Utils.FixForBlogger(B).split("\n"),C=new Array(),D=new RegExp("^\\s*","g"),$=1000;for(var F=0;F<E.length&&$>0;F++){if(A(E[F]).length==0)continue;var _=D.exec(E[F]);if(_!=null&&_.length>0)$=Math.min(_[0].length,$)}if($>0)for(F=0;F<E.length;F++)E[F]=E[F].substr($);return E.join("\n")}function D(A,$,_){return A.substr($,_-$)}var F=0;if(C==null)C="";this.originalCode=C;this.code=$(_(C));this.div=this.CreateElement("DIV");this.bar=this.CreateElement("DIV");this.ol=this.CreateElement("OL");this.matches=new Array();this.div.className="dp-highlighter";this.div.highlighter=this;this.bar.className="bar";this.ol.start=this.firstLine;if(this.CssClass!=null)this.ol.className=this.CssClass;if(this.collapse)this.div.className+=" collapsed";if(this.noGutter)this.div.className+=" nogutter";if(this.tabsToSpaces==true)this.code=this.ProcessSmartTabs(this.code);this.ProcessRegexList();if(this.matches.length==0){this.AddBit(this.code,null);this.SwitchToList();this.div.appendChild(this.bar);this.div.appendChild(this.ol);return}this.matches=this.matches.sort(dp.sh.Highlighter.SortCallback);for(var E=0;E<this.matches.length;E++)if(this.IsInside(this.matches[E]))this.matches[E]=null;for(E=0;E<this.matches.length;E++){var B=this.matches[E];if(B==null||B.length==0)continue;this.AddBit(D(this.code,F,B.index),null);this.AddBit(B.value,B.css);F=B.index+B.length}this.AddBit(this.code.substr(F),null);this.SwitchToList();this.div.appendChild(this.bar);this.div.appendChild(this.ol)};dp.sh.Highlighter.prototype.GetKeywords=function($){return"\\b"+$.replace(/ /g,"\\b|\\b")+"\\b"};dp.sh.BloggerMode=function(){dp.sh.isBloggerMode=true};dp.sh.HighlightAll=function(N,B,K,I,O,E){function A(){var $=arguments;for(var _=0;_<$.length;_++){if($[_]==null)continue;if(typeof($[_])=="string"&&$[_]!="")return $[_]+"";if(typeof($[_])=="object"&&$[_].value!="")return $[_].value+""}return null}function J($,_){for(var A=0;A<_.length;A++)if(_[A]==$)return true;return false}function L(A,B,C){var _=new RegExp("^"+A+"\\[(\\w+)\\]$","gi"),$=null;for(var D=0;D<B.length;D++)if(($=_.exec(B[D]))!=null)return $[1];return C}function C(B,A,_){var $=document.getElementsByTagName(_);for(var C=0;C<$.length;C++)if($[C].getAttribute("name")==A)B.push($[C])}var T=[],P=null,M={},$="innerHTML";C(T,N,"pre");C(T,N,"textarea");if(T.length==0)return;for(var R in dp.sh.Brushes){var F=dp.sh.Brushes[R].Aliases;if(F==null)continue;for(var G=0;G<F.length;G++)M[F[G]]=R}for(G=0;G<T.length;G++){var _=T[G],U=A(_.attributes["class"],_.className,_.attributes["language"],_.language),Q="";if(U==null)continue;U=U.split(":");Q=U[0].toLowerCase();if(M[Q]==null)continue;P=new dp.sh.Brushes[M[Q]]();_.style.display="none";P.noGutter=(B==null)?J("nogutter",U):!B;P.addControls=(K==null)?!J("nocontrols",U):K;P.collapse=(I==null)?J("collapse",U):I;P.showColumns=(E==null)?J("showcolumns",U):E;var D=document.getElementsByTagName("head")[0];if(P.Style&&D){var S=document.createElement("style");S.setAttribute("type","text/css");if(S.styleSheet)S.styleSheet.cssText=P.Style;else{var H=document.createTextNode(P.Style);S.appendChild(H)}D.appendChild(S)}P.firstLine=(O==null)?parseInt(L("firstline",U,1)):O;P.Highlight(_[$]);P.source=_;_.parentNode.insertBefore(P.div,_)}};version.extensions.SyntaxHighLighterPlugin={major:1,minor:1,revision:3,date:new Date(2008,10,24)};dp.sh.ClipboardSwf="clipboard.swf";dp.sh.Highlight=function(_,Q,B,J,H,M,D){function A(){var $=arguments;for(var _=0;_<$.length;_++){if($[_]==null)continue;if(typeof($[_])=="string"&&$[_]!="")return $[_]+"";if(typeof($[_])=="object"&&$[_].value!="")return $[_].value+""}return null}function I($,_){for(var A=0;A<_.length;A++)if(_[A]==$)return true;return false}function K(A,B,C){var _=new RegExp("^"+A+"\\[(\\w+)\\]$","gi"),$=null;for(var D=0;D<B.length;D++)if(($=_.exec(B[D]))!=null)return $[1];return C}var N=null,$="innerHTML";if(this.registered==undefined){var L={};for(var O in dp.sh.Brushes){var E=dp.sh.Brushes[O].Aliases;if(E==null)continue;for(var F=0;F<E.length;F++)L[E[F]]=O}this.registered=L}Q=Q.split(":");language=Q[0].toLowerCase();if(this.registered[language]==null)return;N=new dp.sh.Brushes[this.registered[language]]();_.style.display="none";N.noGutter=(B==null)?I("nogutter",Q):!B;N.addControls=(J==null)?!I("nocontrols",Q):J;N.collapse=(H==null)?I("collapse",Q):H;N.showColumns=(D==null)?I("showcolumns",Q):D;var C=document.getElementsByTagName("head")[0],P=document.getElementById(N.CssClass);if(N.Style&&C&&!P){P=document.createElement("style");P.setAttribute("id",N.CssClass);P.setAttribute("type","text/css");if(P.styleSheet)P.styleSheet.cssText=N.Style;else{var G=document.createTextNode(N.Style);P.appendChild(G)}C.appendChild(P)}N.firstLine=(M==null)?parseInt(K("firstline",Q,1)):M;N.Highlight(_[$]);N.source=_;_.parentNode.insertBefore(N.div,_)};config.formatters.push({name:"SyntaxHighlighter",match:"^<code[\\s]+[^>]+>\\n",element:"pre",handler:function(_){this.lookaheadRegExp=/<code[\s]+([^>]+)>\n((?:^[^\n]*\n)+?)(^<\/code>$\n?)/mg;this.lookaheadRegExp.lastIndex=_.matchStart;var $=this.lookaheadRegExp.exec(_.source);if($&&$.index==_.matchStart){var C=$[1],B=$[2];if(config.browser.isIE)B=B.replace(/\n/g,"\r");var A=createTiddlyElement(_.output,this.element,null,null,B);dp.sh.Highlight(A,C);_.nextMatch=$.index+$[0].length}}});config.formatterHelpers.enclosedTextHelper=function(_){this.lookaheadRegExp.lastIndex=_.matchStart;var $=this.lookaheadRegExp.exec(_.source);if($&&$.index==_.matchStart){var B=$[1];if(config.browser.isIE)B=B.replace(/\n/g,"\r");var A=createTiddlyElement(_.output,this.element,null,null,B);switch(_.matchText){case"/*{{{*/\n":dp.sh.Highlight(A,"css");break;case"//{{{\n":dp.sh.Highlight(A,"js");break;case"<!--{{{-->\n":dp.sh.Highlight(A,"xml");break}_.nextMatch=$.index+$[0].length}};dp.sh.Brushes.AS3=function(){var _="class interface package",$="Array Boolean Date decodeURI decodeURIComponent encodeURI encodeURIComponent escape "+"int isFinite isNaN isXMLName Number Object parseFloat parseInt "+"String trace uint unescape XML XMLList "+"Infinity -Infinity NaN undefined "+"as delete instanceof is new typeof "+"break case catch continue default do each else finally for if in "+"label return super switch throw try while with "+"dynamic final internal native override private protected public static "+"...rest const extends function get implements namespace set "+"import include use "+"AS3 flash_proxy object_proxy "+"false null this true "+"void Null";this.regexList=[{regex:dp.sh.RegexLib.SingleLineCComments,css:"comment"},{regex:dp.sh.RegexLib.MultiLineCComments,css:"blockcomment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("^\\s*#.*","gm"),css:"preprocessor"},{regex:new RegExp(this.GetKeywords(_),"gm"),css:"definition"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"},{regex:new RegExp("var","gm"),css:"variable"}];this.CssClass="dp-as";this.Style=".dp-as .comment { color: #009900; font-style: italic; }"+".dp-as .blockcomment { color: #3f5fbf; }"+".dp-as .string { color: #990000; }"+".dp-as .preprocessor { color: #0033ff; }"+".dp-as .definition { color: #9900cc; font-weight: bold; }"+".dp-as .keyword { color: #0033ff; }"+".dp-as .variable { color: #6699cc; font-weight: bold; }"};dp.sh.Brushes.AS3.prototype=new dp.sh.Highlighter();dp.sh.Brushes.AS3.Aliases=["as","actionscript","ActionScript","as3","AS3"];dp.sh.Brushes.Bash=function(){var _="alias bg bind break builtin cd command compgen complete continue "+"declare dirs disown echo enable eval exec exit export fc fg "+"getopts hash help history jobs kill let local logout popd printf "+"pushd pwd read readonly return set shift shopt source "+"suspend test times trap type typeset ulimit umask unalias unset wait",$="case do done elif else esac fi for function if in select then "+"time until while";this.regexList=[{regex:dp.sh.RegexLib.SingleLinePerlComments,css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("[()[\\]{}]","g"),css:"delim"},{regex:new RegExp("\\$\\w+","g"),css:"vars"},{regex:new RegExp("\\w+=","g"),css:"vars"},{regex:new RegExp("\\s-\\w+","g"),css:"flag"},{regex:new RegExp(this.GetKeywords(_),"gm"),css:"builtin"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"}];this.CssClass="dp-bash";this.Style=".dp-bash .builtin {color: maroon; font-weight: bold;}"+".dp-bash .comment {color: gray;}"+".dp-bash .delim {font-weight: bold;}"+".dp-bash .flag {color: green;}"+".dp-bash .string {color: red;}"+".dp-bash .vars {color: blue;}"};dp.sh.Brushes.Bash.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Bash.Aliases=["bash","sh"];dp.sh.Brushes.Batch=function(){var _="APPEND ATTRIB CD CHDIR CHKDSK CHOICE CLS COPY DEL ERASE DELTREE "+"DIR EXIT FC COMP FDISK FIND FORMAT FSUTIL HELP JOIN "+"LABEL LOADFIX MK MKDIR MEM MEMMAKER MORE MOVE MSD PCPARK "+"PRINT RD RMDIR REN SCANDISK SHARE SORT SUBST SYS "+"TIME DATE TREE TRUENAME TYPE UNDELETE VER XCOPY",$="DO ELSE FOR IN CALL CHOICE GOTO SHIFT PAUSE ERRORLEVEL "+"IF NOT EXIST LFNFOR START SETLOCAL ENDLOCAL ECHO SET";this.regexList=[{regex:new RegExp("REM.*$","gm"),css:"comment"},{regex:new RegExp("::.*$","gm"),css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("[()[\\]{}]","g"),css:"delim"},{regex:new RegExp("%\\w+%","g"),css:"vars"},{regex:new RegExp("%%\\w+","g"),css:"vars"},{regex:new RegExp("\\w+=","g"),css:"vars"},{regex:new RegExp("@\\w+","g"),css:"keyword"},{regex:new RegExp(":\\w+","g"),css:"keyword"},{regex:new RegExp("\\s/\\w+","g"),css:"flag"},{regex:new RegExp(this.GetKeywords(_),"gm"),css:"builtin"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"}];this.CssClass="dp-batch";this.Style=".dp-batch .builtin {color: maroon; font-weight: bold;}"+".dp-batch .comment {color: gray;}"+".dp-batch .delim {font-weight: bold;}"+".dp-batch .flag {color: green;}"+".dp-batch .string {color: red;}"+".dp-batch .vars {color: blue;font-weight: bold;}"};dp.sh.Brushes.Batch.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Batch.Aliases=["batch","dos"];dp.sh.Brushes.ColdFusion=function(){this.CssClass="dp-coldfusion";this.Style=".dp-coldfusion { font: 13px \"Courier New\", Courier, monospace; }"+".dp-coldfusion .tag, .dp-coldfusion .tag-name { color: #990033; }"+".dp-coldfusion .attribute { color: #990033; }"+".dp-coldfusion .attribute-value { color: #0000FF; }"+".dp-coldfusion .cfcomments { background-color: #FFFF99; color: #000000; }"+".dp-coldfusion .cfscriptcomments { color: #999999; }"+".dp-coldfusion .keywords { color: #0000FF; }"+".dp-coldfusion .mgkeywords { color: #CC9900; }"+".dp-coldfusion .numbers { color: #ff0000; }"+".dp-coldfusion .strings { color: green; }";this.mgKeywords="setvalue getvalue addresult viewcollection viewstate";this.keywords="var eq neq gt gte lt lte not and or true false "+"abs acos addsoaprequestheader addsoapresponseheader "+"arrayappend arrayavg arrayclear arraydeleteat arrayinsertat "+"arrayisempty arraylen arraymax arraymin arraynew "+"arrayprepend arrayresize arrayset arraysort arraysum "+"arrayswap arraytolist asc asin atn binarydecode binaryencode "+"bitand bitmaskclear bitmaskread bitmaskset bitnot bitor bitshln "+"bitshrn bitxor ceiling charsetdecode charsetencode chr cjustify "+"compare comparenocase cos createdate createdatetime createobject "+"createobject createobject createobject createobject createodbcdate "+"createodbcdatetime createodbctime createtime createtimespan "+"createuuid dateadd datecompare dateconvert datediff dateformat "+"datepart day dayofweek dayofweekasstring dayofyear daysinmonth "+"daysinyear de decimalformat decrementvalue decrypt decryptbinary "+"deleteclientvariable directoryexists dollarformat duplicate encrypt "+"encryptbinary evaluate exp expandpath fileexists find findnocase "+"findoneof firstdayofmonth fix formatbasen generatesecretkey "+"getauthuser getbasetagdata getbasetaglist getbasetemplatepath "+"getclientvariableslist getcontextroot getcurrenttemplatepath "+"getdirectoryfrompath getencoding getexception getfilefrompath "+"getfunctionlist getgatewayhelper gethttprequestdata gethttptimestring "+"getk2serverdoccount getk2serverdoccountlimit getlocale "+"getlocaledisplayname getlocalhostip getmetadata getmetricdata "+"getpagecontext getprofilesections getprofilestring getsoaprequest "+"getsoaprequestheader getsoapresponse getsoapresponseheader "+"gettempdirectory gettempfile gettemplatepath gettickcount "+"gettimezoneinfo gettoken hash hour htmlcodeformat htmleditformat "+"iif incrementvalue inputbasen insert int isarray isbinary isboolean "+"iscustomfunction isdate isdebugmode isdefined isk2serverabroker "+"isk2serverdoccountexceeded isk2serveronline isleapyear islocalhost "+"isnumeric isnumericdate isobject isquery issimplevalue issoaprequest "+"isstruct isuserinrole isvalid isvalid isvalid iswddx isxml "+"isxmlattribute isxmldoc isxmlelem isxmlnode isxmlroot javacast "+"jsstringformat lcase left len listappend listchangedelims listcontains "+"listcontainsnocase listdeleteat listfind listfindnocase listfirst "+"listgetat listinsertat listlast listlen listprepend listqualify "+"listrest listsetat listsort listtoarray listvaluecount "+"listvaluecountnocase ljustify log log10 lscurrencyformat lsdateformat "+"lseurocurrencyformat lsiscurrency lsisdate lsisnumeric lsnumberformat "+"lsparsecurrency lsparsedatetime lsparseeurocurrency lsparsenumber "+"lstimeformat ltrim max mid min minute month monthasstring now "+"numberformat paragraphformat parameterexists parsedatetime pi "+"preservesinglequotes quarter queryaddcolumn queryaddrow querynew "+"querysetcell quotedvaluelist rand randomize randrange refind "+"refindnocase releasecomobject removechars repeatstring replace "+"replacelist replacenocase rereplace rereplacenocase reverse right "+"rjustify round rtrim second sendgatewaymessage setencoding "+"setlocale setprofilestring setvariable sgn sin spanexcluding "+"spanincluding sqr stripcr structappend structclear structcopy "+"structcount structdelete structfind structfindkey structfindvalue "+"structget structinsert structisempty structkeyarray structkeyexists "+"structkeylist structnew structsort structupdate tan timeformat "+"tobase64 tobinary toscript tostring trim ucase urldecode urlencodedformat "+"urlsessionformat val valuelist week wrap writeoutput xmlchildpos "+"xmlelemnew xmlformat xmlgetnodetype xmlnew xmlparse xmlsearch xmltransform "+"xmlvalidate year yesnoformat";this.stringMatches=new Array();this.attributeMatches=new Array()};dp.sh.Brushes.ColdFusion.prototype=new dp.sh.Highlighter();dp.sh.Brushes.ColdFusion.Aliases=["coldfusion","cf"];dp.sh.Brushes.ColdFusion.prototype.ProcessRegexList=function(){function B(_,$){_[_.length]=$}function A(A,$){for(var _=0;_<A.length;_++)if(A[_]==$)return _;return-1}var _=null,$=null;this.GetMatches(new RegExp("\\b(\\d+)","gm"),"numbers");this.GetMatches(new RegExp(this.GetKeywords(this.mgKeywords),"igm"),"mgkeywords");this.GetMatches(dp.sh.RegexLib.SingleLineCComments,"cfscriptcomments");this.GetMatches(dp.sh.RegexLib.MultiLineCComments,"cfscriptcomments");this.GetMatches(new RegExp("(&lt;|<)!---[\\s\\S]*?---(&gt;|>)","gm"),"cfcomments");$=new RegExp("(cfset\\s*)?([:\\w-.]+)\\s*=\\s*(\".*?\"|'.*?')*","gm");while((_=$.exec(this.code))!=null){if(_[1]!=undefined&&_[1]!="")continue;if(_[3]!=undefined&&_[3]!=""&&_[3]!="\"\""&&_[3]!="''"){B(this.matches,new dp.sh.Match(_[2],_.index,"attribute"));B(this.matches,new dp.sh.Match(_[3],_.index+_[0].indexOf(_[3]),"attribute-value"));B(this.stringMatches,_[3]);B(this.attributeMatches,_[2])}}this.GetMatches(new RegExp("(&lt;|<)/*\\?*(?!\\!)|/*\\?*(&gt;|>)","gm"),"tag");$=new RegExp("(?:&lt;|<)/*\\?*\\s*([:\\w-.]+)","gm");while((_=$.exec(this.code))!=null)B(this.matches,new dp.sh.Match(_[1],_.index+_[0].indexOf(_[1]),"tag-name"));$=new RegExp(this.GetKeywords(this.keywords),"igm");while((_=$.exec(this.code))!=null)if(A(this.attributeMatches,_[0])==-1)B(this.matches,new dp.sh.Match(_[0],_.index,"keywords"));$=new RegExp("cfset\\s*.*(\".*?\"|'.*?')","gm");while((_=$.exec(this.code))!=null)if(_[1]!=undefined&&_[1]!=""){B(this.matches,new dp.sh.Match(_[1],_.index+_[0].indexOf(_[1]),"strings"));B(this.stringMatches,_[1])}while((_=dp.sh.RegexLib.DoubleQuotedString.exec(this.code))!=null)if(A(this.stringMatches,_[0])==-1)B(this.matches,new dp.sh.Match(_[0],_.index,"strings"));while((_=dp.sh.RegexLib.SingleQuotedString.exec(this.code))!=null)if(A(this.stringMatches,_[0])==-1)B(this.matches,new dp.sh.Match(_[0],_.index,"strings"))};dp.sh.Brushes.Cpp=function(){var _="ATOM BOOL BOOLEAN BYTE CHAR COLORREF DWORD DWORDLONG DWORD_PTR "+"DWORD32 DWORD64 FLOAT HACCEL HALF_PTR HANDLE HBITMAP HBRUSH "+"HCOLORSPACE HCONV HCONVLIST HCURSOR HDC HDDEDATA HDESK HDROP HDWP "+"HENHMETAFILE HFILE HFONT HGDIOBJ HGLOBAL HHOOK HICON HINSTANCE HKEY "+"HKL HLOCAL HMENU HMETAFILE HMODULE HMONITOR HPALETTE HPEN HRESULT "+"HRGN HRSRC HSZ HWINSTA HWND INT INT_PTR INT32 INT64 LANGID LCID LCTYPE "+"LGRPID LONG LONGLONG LONG_PTR LONG32 LONG64 LPARAM LPBOOL LPBYTE LPCOLORREF "+"LPCSTR LPCTSTR LPCVOID LPCWSTR LPDWORD LPHANDLE LPINT LPLONG LPSTR LPTSTR "+"LPVOID LPWORD LPWSTR LRESULT PBOOL PBOOLEAN PBYTE PCHAR PCSTR PCTSTR PCWSTR "+"PDWORDLONG PDWORD_PTR PDWORD32 PDWORD64 PFLOAT PHALF_PTR PHANDLE PHKEY PINT "+"PINT_PTR PINT32 PINT64 PLCID PLONG PLONGLONG PLONG_PTR PLONG32 PLONG64 POINTER_32 "+"POINTER_64 PSHORT PSIZE_T PSSIZE_T PSTR PTBYTE PTCHAR PTSTR PUCHAR PUHALF_PTR "+"PUINT PUINT_PTR PUINT32 PUINT64 PULONG PULONGLONG PULONG_PTR PULONG32 PULONG64 "+"PUSHORT PVOID PWCHAR PWORD PWSTR SC_HANDLE SC_LOCK SERVICE_STATUS_HANDLE SHORT "+"SIZE_T SSIZE_T TBYTE TCHAR UCHAR UHALF_PTR UINT UINT_PTR UINT32 UINT64 ULONG "+"ULONGLONG ULONG_PTR ULONG32 ULONG64 USHORT USN VOID WCHAR WORD WPARAM WPARAM WPARAM "+"char bool short int __int32 __int64 __int8 __int16 long float double __wchar_t "+"clock_t _complex _dev_t _diskfree_t div_t ldiv_t _exception _EXCEPTION_POINTERS "+"FILE _finddata_t _finddatai64_t _wfinddata_t _wfinddatai64_t __finddata64_t "+"__wfinddata64_t _FPIEEE_RECORD fpos_t _HEAPINFO _HFILE lconv intptr_t "+"jmp_buf mbstate_t _off_t _onexit_t _PNH ptrdiff_t _purecall_handler "+"sig_atomic_t size_t _stat __stat64 _stati64 terminate_function "+"time_t __time64_t _timeb __timeb64 tm uintptr_t _utimbuf "+"va_list wchar_t wctrans_t wctype_t wint_t signed",$="break case catch class const __finally __exception __try "+"const_cast continue private public protected __declspec "+"default delete deprecated dllexport dllimport do dynamic_cast "+"else enum explicit extern if for friend goto inline "+"mutable naked namespace new noinline noreturn nothrow "+"register reinterpret_cast return selectany "+"sizeof static static_cast struct switch template this "+"thread throw true false try typedef typeid typename union "+"using uuid virtual void volatile whcar_t while";this.regexList=[{regex:dp.sh.RegexLib.SingleLineCComments,css:"comment"},{regex:dp.sh.RegexLib.MultiLineCComments,css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("^ *#.*","gm"),css:"preprocessor"},{regex:new RegExp(this.GetKeywords(_),"gm"),css:"datatypes"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"}];this.CssClass="dp-cpp";this.Style=".dp-cpp .datatypes { color: #2E8B57; font-weight: bold; }"};dp.sh.Brushes.Cpp.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Cpp.Aliases=["cpp","c","c++"];dp.sh.Brushes.CSharp=function(){var $="abstract as base bool break byte case catch char checked class const "+"continue decimal default delegate do double else enum event explicit "+"extern false finally fixed float for foreach get goto if implicit in int "+"interface internal is lock long namespace new null object operator out "+"override params private protected public readonly ref return sbyte sealed set "+"short sizeof stackalloc static string struct switch this throw true try "+"typeof uint ulong unchecked unsafe ushort using virtual void while";this.regexList=[{regex:dp.sh.RegexLib.SingleLineCComments,css:"comment"},{regex:dp.sh.RegexLib.MultiLineCComments,css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("^\\s*#.*","gm"),css:"preprocessor"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"}];this.CssClass="dp-c";this.Style=".dp-c .vars { color: #d00; }"};dp.sh.Brushes.CSharp.prototype=new dp.sh.Highlighter();dp.sh.Brushes.CSharp.Aliases=["c#","c-sharp","csharp"];dp.sh.Brushes.CSS=function(){var _="ascent azimuth background-attachment background-color background-image background-position "+"background-repeat background baseline bbox border-collapse border-color border-spacing border-style border-top "+"border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color "+"border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width "+"border-bottom-width border-left-width border-width border cap-height caption-side centerline clear clip color "+"content counter-increment counter-reset cue-after cue-before cue cursor definition-src descent direction display "+"elevation empty-cells float font-size-adjust font-family font-size font-stretch font-style font-variant font-weight font "+"height letter-spacing line-height list-style-image list-style-position list-style-type list-style margin-top "+"margin-right margin-bottom margin-left margin marker-offset marks mathline max-height max-width min-height min-width orphans "+"outline-color outline-style outline-width outline overflow padding-top padding-right padding-bottom padding-left padding page "+"page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position "+"quotes richness size slope src speak-header speak-numeral speak-punctuation speak speech-rate stemh stemv stress "+"table-layout text-align text-decoration text-indent text-shadow text-transform unicode-bidi unicode-range units-per-em "+"vertical-align visibility voice-family volume white-space widows width widths word-spacing x-height z-index",$="above absolute all always aqua armenian attr aural auto avoid baseline behind below bidi-override black blink block blue bold bolder "+"both bottom braille capitalize caption center center-left center-right circle close-quote code collapse compact condensed "+"continuous counter counters crop cross crosshair cursive dashed decimal decimal-leading-zero default digits disc dotted double "+"embed embossed e-resize expanded extra-condensed extra-expanded fantasy far-left far-right fast faster fixed format fuchsia "+"gray green groove handheld hebrew help hidden hide high higher icon inline-table inline inset inside invert italic "+"justify landscape large larger left-side left leftwards level lighter lime line-through list-item local loud lower-alpha "+"lowercase lower-greek lower-latin lower-roman lower low ltr marker maroon medium message-box middle mix move narrower "+"navy ne-resize no-close-quote none no-open-quote no-repeat normal nowrap n-resize nw-resize oblique olive once open-quote outset "+"outside overline pointer portrait pre print projection purple red relative repeat repeat-x repeat-y rgb ridge right right-side "+"rightwards rtl run-in screen scroll semi-condensed semi-expanded separate se-resize show silent silver slower slow "+"small small-caps small-caption smaller soft solid speech spell-out square s-resize static status-bar sub super sw-resize "+"table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group teal "+"text-bottom text-top thick thin top transparent tty tv ultra-condensed ultra-expanded underline upper-alpha uppercase upper-latin "+"upper-roman url visible wait white wider w-resize x-fast x-high x-large x-loud x-low x-slow x-small x-soft xx-large xx-small yellow",A="[mM]onospace [tT]ahoma [vV]erdana [aA]rial [hH]elvetica [sS]ans-serif [sS]erif";this.regexList=[{regex:dp.sh.RegexLib.MultiLineCComments,css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("\\#[a-zA-Z0-9]{3,6}","g"),css:"value"},{regex:new RegExp("(-?\\d+)(.\\d+)?(px|em|pt|:|%|)","g"),css:"value"},{regex:new RegExp("!important","g"),css:"important"},{regex:new RegExp(this.GetKeywordsCSS(_),"gm"),css:"keyword"},{regex:new RegExp(this.GetValuesCSS($),"g"),css:"value"},{regex:new RegExp(this.GetValuesCSS(A),"g"),css:"value"}];this.CssClass="dp-css";this.Style=".dp-css .value { color: black; }"+".dp-css .important { color: red; }"};dp.sh.Highlighter.prototype.GetKeywordsCSS=function($){return"\\b([a-z_]|)"+$.replace(/ /g,"(?=:)\\b|\\b([a-z_\\*]|\\*|)")+"(?=:)\\b"};dp.sh.Highlighter.prototype.GetValuesCSS=function($){return"\\b"+$.replace(/ /g,"(?!-)(?!:)\\b|\\b()")+":\\b"};dp.sh.Brushes.CSS.prototype=new dp.sh.Highlighter();dp.sh.Brushes.CSS.Aliases=["css"];dp.sh.Brushes.Delphi=function(){var $="abs addr and ansichar ansistring array as asm begin boolean byte cardinal "+"case char class comp const constructor currency destructor div do double "+"downto else end except exports extended false file finalization finally "+"for function goto if implementation in inherited int64 initialization "+"integer interface is label library longint longword mod nil not object "+"of on or packed pansichar pansistring pchar pcurrency pdatetime pextended "+"pint64 pointer private procedure program property pshortstring pstring "+"pvariant pwidechar pwidestring protected public published raise real real48 "+"record repeat set shl shortint shortstring shr single smallint string then "+"threadvar to true try type unit until uses val var varirnt while widechar "+"widestring with word write writeln xor";this.regexList=[{regex:new RegExp("\\(\\*[\\s\\S]*?\\*\\)","gm"),css:"comment"},{regex:new RegExp("{(?!\\$)[\\s\\S]*?}","gm"),css:"comment"},{regex:dp.sh.RegexLib.SingleLineCComments,css:"comment"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("\\{\\$[a-zA-Z]+ .+\\}","g"),css:"directive"},{regex:new RegExp("\\b[\\d\\.]+\\b","g"),css:"number"},{regex:new RegExp("\\$[a-zA-Z0-9]+\\b","g"),css:"number"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"}];this.CssClass="dp-delphi";this.Style=".dp-delphi .number { color: blue; }"+".dp-delphi .directive { color: #008284; }"+".dp-delphi .vars { color: #000; }"};dp.sh.Brushes.Delphi.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Delphi.Aliases=["delphi","pascal"];dp.sh.Brushes.Java=function(){var $="abstract assert boolean break byte case catch char class const "+"continue default do double else enum extends "+"false final finally float for goto if implements import "+"instanceof int interface long native new null "+"package private protected public return "+"short static strictfp super switch synchronized this throw throws true "+"transient try void volatile while";this.regexList=[{regex:dp.sh.RegexLib.SingleLineCComments,css:"comment"},{regex:dp.sh.RegexLib.MultiLineCComments,css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("\\b([\\d]+(\\.[\\d]+)?|0x[a-f0-9]+)\\b","gi"),css:"number"},{regex:new RegExp("(?!\\@interface\\b)\\@[\\$\\w]+\\b","g"),css:"annotation"},{regex:new RegExp("\\@interface\\b","g"),css:"keyword"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"}];this.CssClass="dp-j";this.Style=".dp-j .annotation { color: #646464; }"+".dp-j .number { color: #C00000; }"};dp.sh.Brushes.Java.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Java.Aliases=["java"];dp.sh.Brushes.JScript=function(){var $="abstract boolean break byte case catch char class const continue debugger "+"default delete do double else enum export extends false final finally float "+"for function goto if implements import in instanceof int interface long native "+"new null package private protected public return short static super switch "+"synchronized this throw throws transient true try typeof var void volatile while with";this.regexList=[{regex:dp.sh.RegexLib.SingleLineCComments,css:"comment"},{regex:dp.sh.RegexLib.MultiLineCComments,css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("^\\s*#.*","gm"),css:"preprocessor"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"}];this.CssClass="dp-c"};dp.sh.Brushes.JScript.prototype=new dp.sh.Highlighter();dp.sh.Brushes.JScript.Aliases=["js","jscript","javascript"];dp.sh.Brushes.Lua=function(){var $="break do end else elseif function if local nil not or repeat return and then until while this",_="math\\.\\w+ string\\.\\w+ os\\.\\w+ debug\\.\\w+ io\\.\\w+ error fopen dofile coroutine\\.\\w+ arg getmetatable ipairs loadfile loadlib loadstring longjmp print rawget rawset seek setmetatable assert tonumber tostring";this.regexList=[{regex:new RegExp("--\\[\\[[\\s\\S]*\\]\\]--","gm"),css:"comment"},{regex:new RegExp("--[^\\[]{2}.*$","gm"),css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"},{regex:new RegExp(this.GetKeywords(_),"gm"),css:"func"},];this.CssClass="dp-lua"};dp.sh.Brushes.Lua.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Lua.Aliases=["lua"];dp.sh.Brushes.Mxml=function(){this.CssClass="dp-mxml";this.Style=".dp-mxml .cdata { color: #000000; }"+".dp-mxml .tag { color : #0000ff; }"+".dp-mxml .tag-name { color: #0000ff; }"+".dp-mxml .script { color: green; }"+".dp-mxml .metadata { color: green; }"+".dp-mxml .attribute { color: #000000; }"+".dp-mxml .attribute-value { color: #990000; }"+".dp-mxml .trace { color: #cc6666; }"+".dp-mxml .var { color: #6699cc; }"+".dp-mxml .comment { color: #009900; }"+".dp-mxml .string { color: #990000; }"+".dp-mxml .keyword { color: blue; }"};dp.sh.Brushes.Mxml.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Mxml.Aliases=["mxml"];dp.sh.Brushes.Mxml.prototype.ProcessRegexList=function(){function H(_,$){_[_.length]=$}function B(B,_){var A=0,$=false;for(A=0;A<B.length;A++)if(_.index>B[A].firstIndex&&_.index<B[A].lastIndex)$=true;return $}var $=0,F=null,D=null,A=null,C="",E=new Array(),_="abstract boolean break byte case catch char class const continue debugger "+"default delete do double else enum export extends false final finally float "+"for function goto if implements import in instanceof int interface long native "+"new null package private protected public return short static super switch "+"synchronized this throw throws transient true try typeof var void volatile while with",G=[{regex:dp.sh.RegexLib.SingleLineCComments,css:"comment"},{regex:dp.sh.RegexLib.MultiLineCComments,css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("^\\s*#.*","gm"),css:"preprocessor"},{regex:new RegExp(this.GetKeywords("trace"),"gm"),css:"trace"},{regex:new RegExp(this.GetKeywords(_),"gm"),css:"keyword"}];A=new RegExp("&lt;\\!\\[CDATA\\[(.|\\s)*?\\]\\]&gt;","gm");while((F=A.exec(this.code))!=null){C=F[0].substr(0,12);H(this.matches,new dp.sh.Match(C,F.index,"cdata"));C=F[0].substr(12,F[0].length-12-6);for(var I=0;I<G.length;I++)while((D=G[I].regex.exec(C))!=null)H(this.matches,new dp.sh.Match(D[0],F.index+12+D.index,G[I].css));C=F[0].substr(F[0].length-6,6);H(this.matches,new dp.sh.Match(C,F.index+F[0].length-6,"cdata"));E.push({firstIndex:F.index,lastIndex:F.index+F[0].length-1})}this.GetMatches(new RegExp("(&lt;|<)!--\\s*.*?\\s*--(&gt;|>)","gm"),"comments");A=new RegExp("([:\\w-.]+)\\s*=\\s*(\".*?\"|'.*?'|\\w+)*|(\\w+)","gm");while((F=A.exec(this.code))!=null){if(F[1]==null)continue;if(B(E,F))continue;H(this.matches,new dp.sh.Match(F[1],F.index,"attribute"));if(F[2]!=undefined)H(this.matches,new dp.sh.Match(F[2],F.index+F[0].indexOf(F[2]),"attribute-value"))}A=new RegExp("(?:&lt;|<)/*\\?*\\s*([:\\w-.]+)","gm");while((F=A.exec(this.code))!=null){if(B(E,F))continue;C=F[0].substr(4,F[0].length-4);switch(C){case"mx:Script":case"/mx:Script":H(this.matches,new dp.sh.Match(F[0]+"&gt;",F.index,"script"));break;case"mx:Metadata":case"/mx:Metadata":H(this.matches,new dp.sh.Match(F[0]+"&gt;",F.index,"metadata"));break;default:H(this.matches,new dp.sh.Match(F[0],F.index,"tag-name"));break}}A=new RegExp("\\?&gt;|&gt;|/&gt;","gm");while((F=A.exec(this.code))!=null){if(B(E,F))continue;H(this.matches,new dp.sh.Match(F[0],F.index,"tag"))}};dp.sh.Brushes.Perl=function(){var _="abs accept alarm atan2 bind binmode bless caller chdir chmod chomp chop chown chr chroot close closedir connect cos crypt dbmclose dbmopen defined delete dump each endgrent endhostent endnetent endprotoent endpwent endservent eof exec exists exp fcntl fileno flock fork format formline getc getgrent getgrgid getgrnam gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr getnetbyname getnetent getpeername getpgrp getppid getpriority getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid getservbyname getservbyport getservent getsockname getsockopt glob gmtime grep hex import index int ioctl join keys kill lc lcfirst length link listen localtime lock log lstat m map mkdir msgctl msgget msgrcv msgsnd no oct open opendir ord pack pipe pop pos print printf prototype push q qq quotemeta qw qx rand read readdir readline readlink readpipe recv ref rename reset reverse rewinddir rindex rmdir scalar seek seekdir semctl semget semop send setgrent sethostent setnetent setpgrp setpriority setprotoent setpwent setservent setsockopt shift shmctl shmget shmread shmwrite shutdown sin sleep socket socketpair sort splice split sprintf sqrt srand stat study sub substr symlink syscall sysopen sysread sysseek system syswrite tell telldir tie tied time times tr truncate uc ucfirst umask undef unlink unpack unshift untie utime values vec waitpid wantarray warn write qr",$="s select goto die do package redo require return continue for foreach last next wait while use if else elsif eval exit unless switch case",A="my our local";this.regexList=[{regex:dp.sh.RegexLib.SingleLinePerlComments,css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("(\\$|@|%)\\w+","g"),css:"vars"},{regex:new RegExp(this.GetKeywords(_),"gmi"),css:"func"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"},{regex:new RegExp(this.GetKeywords(A),"gm"),css:"declarations"}];this.CssClass="dp-perl"};dp.sh.Brushes.Perl.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Perl.Aliases=["perl"];dp.sh.Brushes.Php=function(){var _="abs acos acosh addcslashes addslashes "+"array_change_key_case array_chunk array_combine array_count_values array_diff "+"array_diff_assoc array_diff_key array_diff_uassoc array_diff_ukey array_fill "+"array_filter array_flip array_intersect array_intersect_assoc array_intersect_key "+"array_intersect_uassoc array_intersect_ukey array_key_exists array_keys array_map "+"array_merge array_merge_recursive array_multisort array_pad array_pop array_product "+"array_push array_rand array_reduce array_reverse array_search array_shift "+"array_slice array_splice array_sum array_udiff array_udiff_assoc "+"array_udiff_uassoc array_uintersect array_uintersect_assoc "+"array_uintersect_uassoc array_unique array_unshift array_values array_walk "+"array_walk_recursive atan atan2 atanh base64_decode base64_encode base_convert "+"basename bcadd bccomp bcdiv bcmod bcmul bindec bindtextdomain bzclose bzcompress "+"bzdecompress bzerrno bzerror bzerrstr bzflush bzopen bzread bzwrite ceil chdir "+"checkdate checkdnsrr chgrp chmod chop chown chr chroot chunk_split class_exists "+"closedir closelog copy cos cosh count count_chars date decbin dechex decoct "+"deg2rad delete ebcdic2ascii echo empty end ereg ereg_replace eregi eregi_replace error_log "+"error_reporting escapeshellarg escapeshellcmd eval exec exit exp explode extension_loaded "+"feof fflush fgetc fgetcsv fgets fgetss file_exists file_get_contents file_put_contents "+"fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype "+"floatval flock floor flush fmod fnmatch fopen fpassthru fprintf fputcsv fputs fread fscanf "+"fseek fsockopen fstat ftell ftok getallheaders getcwd getdate getenv gethostbyaddr gethostbyname "+"gethostbynamel getimagesize getlastmod getmxrr getmygid getmyinode getmypid getmyuid getopt "+"getprotobyname getprotobynumber getrandmax getrusage getservbyname getservbyport gettext "+"gettimeofday gettype glob gmdate gmmktime ini_alter ini_get ini_get_all ini_restore ini_set "+"interface_exists intval ip2long is_a is_array is_bool is_callable is_dir is_double "+"is_executable is_file is_finite is_float is_infinite is_int is_integer is_link is_long "+"is_nan is_null is_numeric is_object is_readable is_real is_resource is_scalar is_soap_fault "+"is_string is_subclass_of is_uploaded_file is_writable is_writeable mkdir mktime nl2br "+"parse_ini_file parse_str parse_url passthru pathinfo readlink realpath rewind rewinddir rmdir "+"round str_ireplace str_pad str_repeat str_replace str_rot13 str_shuffle str_split "+"str_word_count strcasecmp strchr strcmp strcoll strcspn strftime strip_tags stripcslashes "+"stripos stripslashes stristr strlen strnatcasecmp strnatcmp strncasecmp strncmp strpbrk "+"strpos strptime strrchr strrev strripos strrpos strspn strstr strtok strtolower strtotime "+"strtoupper strtr strval substr substr_compare",$="and or xor __FILE__ __LINE__ array as break case "+"cfunction class const continue declare default die do else "+"elseif empty enddeclare endfor endforeach endif endswitch endwhile "+"extends for foreach function include include_once global if "+"new old_function return static switch use require require_once "+"var while __FUNCTION__ __CLASS__ "+"__METHOD__ abstract interface public implements extends private protected throw";this.regexList=[{regex:dp.sh.RegexLib.SingleLineCComments,css:"comment"},{regex:dp.sh.RegexLib.MultiLineCComments,css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp("\\$\\w+","g"),css:"vars"},{regex:new RegExp(this.GetKeywords(_),"gmi"),css:"func"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"}];this.CssClass="dp-c"};dp.sh.Brushes.Php.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Php.Aliases=["php"];dp.sh.Brushes.Python=function(){var $="and assert break class continue def del elif else "+"except exec finally for from global if import in is "+"lambda not or pass print raise return try yield while",_="None True False self cls class_";this.regexList=[{regex:dp.sh.RegexLib.SingleLinePerlComments,css:"comment"},{regex:new RegExp("^\\s*@\\w+","gm"),css:"decorator"},{regex:new RegExp("(['\"]{3})([^\\1])*?\\1","gm"),css:"comment"},{regex:new RegExp("\"(?!\")(?:\\.|\\\\\\\"|[^\\\"\"\\n\\r])*\"","gm"),css:"string"},{regex:new RegExp("'(?!')*(?:\\.|(\\\\\\')|[^\\''\\n\\r])*'","gm"),css:"string"},{regex:new RegExp("\\b\\d+\\.?\\w*","g"),css:"number"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"},{regex:new RegExp(this.GetKeywords(_),"gm"),css:"special"}];this.CssClass="dp-py";this.Style=".dp-py .builtins { color: #ff1493; }"+".dp-py .magicmethods { color: #808080; }"+".dp-py .exceptions { color: brown; }"+".dp-py .types { color: brown; font-style: italic; }"+".dp-py .commonlibs { color: #8A2BE2; font-style: italic; }"};dp.sh.Brushes.Python.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Python.Aliases=["py","python"];dp.sh.Brushes.Ruby=function(){var $="alias and BEGIN begin break case class def define_method defined do each else elsif "+"END end ensure false for if in module new next nil not or raise redo rescue retry return "+"self super then throw true undef unless until when while yield",_="Array Bignum Binding Class Continuation Dir Exception FalseClass File::Stat File Fixnum Fload "+"Hash Integer IO MatchData Method Module NilClass Numeric Object Proc Range Regexp String Struct::TMS Symbol "+"ThreadGroup Thread Time TrueClass";this.regexList=[{regex:dp.sh.RegexLib.SingleLinePerlComments,css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp(":[a-z][A-Za-z0-9_]*","g"),css:"symbol"},{regex:new RegExp("(\\$|@@|@)\\w+","g"),css:"variable"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"},{regex:new RegExp(this.GetKeywords(_),"gm"),css:"builtin"}];this.CssClass="dp-rb";this.Style=".dp-rb .symbol { color: #a70; }"+".dp-rb .variable { color: #a70; font-weight: bold; }"};dp.sh.Brushes.Ruby.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Ruby.Aliases=["ruby","rails","ror"];dp.sh.Brushes.Sql=function(){var _="abs avg case cast coalesce convert count current_timestamp "+"current_user day isnull left lower month nullif replace right "+"session_user space substring sum system_user upper user year",$="absolute action add after alter as asc at authorization begin bigint "+"binary bit by cascade char character check checkpoint close collate "+"column commit committed connect connection constraint contains continue "+"create cube current current_date current_time cursor database date "+"deallocate dec decimal declare default delete desc distinct double drop "+"dynamic else end end-exec escape except exec execute false fetch first "+"float for force foreign forward free from full function global goto grant "+"group grouping having hour ignore index inner insensitive insert instead "+"int integer intersect into is isolation key last level load local max min "+"minute modify move name national nchar next no numeric of off on only "+"open option order out output partial password precision prepare primary "+"prior privileges procedure public read real references relative repeatable "+"restrict return returns revoke rollback rollup rows rule schema scroll "+"second section select sequence serializable set size smallint static "+"statistics table temp temporary then time timestamp to top transaction "+"translation trigger true truncate uncommitted union unique update values "+"varchar varying view when where with work",A="all and any between cross in join like not null or outer some";this.regexList=[{regex:new RegExp("--(.*)$","gm"),css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:dp.sh.RegexLib.SingleQuotedString,css:"string"},{regex:new RegExp(this.GetKeywords(_),"gmi"),css:"func"},{regex:new RegExp(this.GetKeywords(A),"gmi"),css:"op"},{regex:new RegExp(this.GetKeywords($),"gmi"),css:"keyword"}];this.CssClass="dp-sql";this.Style=".dp-sql .func { color: #ff1493; }"+".dp-sql .op { color: #808080; }"};dp.sh.Brushes.Sql.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Sql.Aliases=["sql"];dp.sh.Brushes.Vb=function(){var $="AddHandler AddressOf AndAlso Alias And Ansi As Assembly Auto "+"Boolean ByRef Byte ByVal Call Case Catch CBool CByte CChar CDate "+"CDec CDbl Char CInt Class CLng CObj Const CShort CSng CStr CType "+"Date Decimal Declare Default Delegate Dim DirectCast Do Double Each "+"Else ElseIf End Enum Erase Error Event Exit False Finally For Friend "+"Function Get GetType GoSub GoTo Handles If Implements Imports In "+"Inherits Integer Interface Is Let Lib Like Long Loop Me Mod Module "+"MustInherit MustOverride MyBase MyClass Namespace New Next Not Nothing "+"NotInheritable NotOverridable Object On Option Optional Or OrElse "+"Overloads Overridable Overrides ParamArray Preserve Private Property "+"Protected Public RaiseEvent ReadOnly ReDim REM RemoveHandler Resume "+"Return Select Set Shadows Shared Short Single Static Step Stop String "+"Structure Sub SyncLock Then Throw To True Try TypeOf Unicode Until "+"Variant When While With WithEvents WriteOnly Xor";this.regexList=[{regex:new RegExp("'.*$","gm"),css:"comment"},{regex:dp.sh.RegexLib.DoubleQuotedString,css:"string"},{regex:new RegExp("^\\s*#.*","gm"),css:"preprocessor"},{regex:new RegExp(this.GetKeywords($),"gm"),css:"keyword"}];this.CssClass="dp-vb"};dp.sh.Brushes.Vb.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Vb.Aliases=["vb","vb.net"];dp.sh.Brushes.Xml=function(){this.CssClass="dp-xml";this.Style=".dp-xml .cdata { color: #ff1493; }"+".dp-xml .tag, .dp-xml .tag-name { color: #069; font-weight: bold; }"+".dp-xml .attribute { color: red; }"+".dp-xml .attribute-value { color: blue; }"};dp.sh.Brushes.Xml.prototype=new dp.sh.Highlighter();dp.sh.Brushes.Xml.Aliases=["xml","xhtml","xslt","html","xhtml"];dp.sh.Brushes.Xml.prototype.ProcessRegexList=function(){function B(_,$){_[_.length]=$}var $=0,A=null,_=null;this.GetMatches(new RegExp("(&lt;|<)\\!\\[[\\w\\s]*?\\[(.|\\s)*?\\]\\](&gt;|>)","gm"),"cdata");this.GetMatches(new RegExp("(&lt;|<)!--\\s*.*?\\s*--(&gt;|>)","gm"),"comments");_=new RegExp("([:\\w-.]+)\\s*=\\s*(\".*?\"|'.*?'|\\w+)*|(\\w+)","gm");while((A=_.exec(this.code))!=null){if(A[1]==null)continue;B(this.matches,new dp.sh.Match(A[1],A.index,"attribute"));if(A[2]!=undefined)B(this.matches,new dp.sh.Match(A[2],A.index+A[0].indexOf(A[2]),"attribute-value"))}this.GetMatches(new RegExp("(&lt;|<)/*\\?*(?!\\!)|/*\\?*(&gt;|>)","gm"),"tag");_=new RegExp("(?:&lt;|<)/*\\?*\\s*([:\\w-.]+)","gm");while((A=_.exec(this.code))!=null)B(this.matches,new dp.sh.Match(A[1],A.index+A[0].indexOf(A[1]),"tag-name"))}
//}}}
<<timeline better:true excludeTag:excludeLists maxDays:30>>
/***
|Name|TaggedTemplateTweak|
|Source|http://www.TiddlyTools.com/#TaggedTemplateTweak|
|Documentation|http://www.TiddlyTools.com/#TaggedTemplateTweakInfo|
|Version|1.6.1|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Description|use alternative ViewTemplate/EditTemplate for specific tiddlers|
This plugin extends the core function, story.chooseTemplateForTiddler(), so that any given tiddler can be viewed and/or edited using alternatives to the standard tiddler templates.
!!!!!Documentation
>see [[TaggedTemplateTweakInfo]]
!!!!!Revisions
<<<
2009.09.02 [1.6.1] apply field-based template (if any) *before* tag-based template
| please see [[TaggedTemplateTweakInfo]] for previous revision details |
2007.06.11 [1.0.0] initial release
<<<
!!!!!Code
***/
//{{{
version.extensions.TaggedTemplateTweak= {major: 1, minor: 6, revision: 1, date: new Date(2009,9,2)};

if (!config.options.txtTemplateTweakFieldname)	
	config.options.txtTemplateTweakFieldname='template';

Story.prototype.taggedTemplate_chooseTemplateForTiddler = Story.prototype.chooseTemplateForTiddler
Story.prototype.chooseTemplateForTiddler = function(title,template)
{
	// get core template and split into theme and template name
	var coreTemplate=this.taggedTemplate_chooseTemplateForTiddler.apply(this,arguments);
	var theme=""; var template=coreTemplate;
	var parts=template.split(config.textPrimitives.sectionSeparator);
	if (parts[1]) { theme=parts[0]; template=parts[1]; }
	else theme=config.options.txtTheme||""; // if theme is not specified
	theme+=config.textPrimitives.sectionSeparator;

	// look for template using title as prefix
	if (!store.getTaggedTiddlers(title).length) { // if tiddler is not a tag
		if (store.getTiddlerText(theme+title+template))
			{ return theme+title+template; } // theme##TitleTemplate
		if (store.getTiddlerText(title+template))
			{ return title+template; }	 // TitleTemplate
	}

	// look for templates using custom field value as prefix
	var v=store.getValue(title,config.options.txtTemplateTweakFieldname);
	if (store.getTiddlerText(theme+v+template))
		{ return theme+v+template; }	// theme##valueTemplate
	if (store.getTiddlerText(v+template))
		{ return v+template; }		// valueTemplate

	// look for template using tags as prefix
	var tiddler=store.getTiddler(title);
	if (!tiddler) return coreTemplate; // tiddler doesn't exist... use core result
	for (i=0; i<tiddler.tags.length; i++) {
		var t=tiddler.tags[i]+template; // add tag prefix to template
		var c=t.substr(0,1).toUpperCase()+t.substr(1); // capitalized for WikiWord title
		if (store.getTiddlerText(theme+t))	{ return theme+t; } // theme##tagTemplate
		if (store.getTiddlerText(theme+c))	{ return theme+c; } // theme##TagTemplate
		if (store.getTiddlerText(t)) 		{ return t; }	    // tagTemplate
		if (store.getTiddlerText(c))		{ return c; }	    // TagTemplate
	}
	
	// no match... use core result
	return coreTemplate;
}
//}}}
常用的测试序列选择:
Coastguard     :为物体的相对运动和镜头移动
flower         :为物体的剧烈运动和镜头的快速移动
garphone       :为物体的快速转换
foreman            :为物体转换和镜头移动
mobile&calendar :为物体的多种运动和镜头移动
1. Latex -> Bitex -> Latex -> Quick Build
如果要including graphics,有两种选择:
2.用.eps的image,然后用latex编译,然后用dvips -Ppdf生成一个ps文档,再用ps2pdf或者dvipdf转换成PDF文档
3. 用pdf, png, jpg等image,latex无法直接编译,可以直接用pdflatex来编译生成PDF文档。 (pdflatex不支持.eps的image,需要用epstopdf将eps的image转换成pdf格式)。
Refer: http://amath.colorado.edu/documentation/LaTeX/reference/figures.html
以前compile TexMaker 的文档的时候,总要返回到主文档document.tex下来编译。要不就会以为当前的tex文档是主文档,出错。
今天发现TexMaker可以设置主文档 Option -> 定义当前文档为'主文档'
!!!!Abstract
#based on normal filters including lowpass, highpass, bandpass and bandstop filters with different cutoff freq. or b.w.
#control flexibly the size and the coherence of the cs filter

!!!!Intro
Design the universal CS measurement instruments: 
#the chip-level ~A-to-I converter: Ragheb, Baraniuk et al.
#the signal-shot compressive spectral imager: M. E. Gehm et al
@@time-consuming computation@@ @@difficulty of physical realization@@
===>sampling signal with finite rate of innovation: Vertterli et al
*sampling rate for a sparse signal can be significantly reduced by first convolving with a kernel that spread it out
universal CS measurement by using a special random convolution: Romberg
*through CS filter, the signal frequency-domain phase is modulated by random waveform while the signal frequency-domain amplitude is not distorted;
*consequently, the resulting signal will be spread out in time domain
===>CMOS compressed imaging by a shift register set in a pseudo-random configuration: L. Jacques et al

!!!!The Deisgn of Compressive Sensing Filter
by using the normal microwave filters, the plasma with different electron density ....
To modulate the signal frequency-domain phase by random waveform, while the amplitude is kept => the signal components corresponding to diff. freq. should be extracted from the time-domain sig. & be modulated
===>a series of filters with diff. cutoff freq. followed by transmission line with random length ===> compressive sensing filter
#''Cont. Signal $c(t)$ '' __Nyqusit Sampling__ ''Discrete Signal $c_n$''
#''Discrete Signal'' __Source Coding & Channel Coding__ $b_i$
# $b_i$ __Mapper__ $a_k$
# $a_k$ __PAM g(t)__ x(t)
#* Constellation
#* Prob. of error
# x(t) __Channel b(t)__ s(t)
# s(t) __Modulation FM/AM/DSB/SSB/VSB__ $s_{mod}(t)$
# AWGN n(t)
# $r_{mod}(t)$ __Demodulation__ r(t)
# r(t) __Matched Filter f(t)__ y(t)
# Sample at T
#.... Decision...
# LPF...
Refer: http://www.thinkplexx.com/learn/howto/security/ssh/fix-permissions-are-too-open-private-key-will-be-ignored
Permissions 0644 for 'xxx' are too open
{{{
chmod 600 id_rsa
}}}
/***
|Name|TiddlerTweakerPlugin|
|Source|http://www.TiddlyTools.com/#TiddlerTweakerPlugin|
|Version|2.4.5|
|Author|Eric Shulman|
|License|http://www.TiddlyTools.com/#LegalStatements|
|~CoreVersion|2.1|
|Type|plugin|
|Description|select multiple tiddlers and modify author, created, modified and/or tag values|
~TiddlerTweaker is a 'power tool' for TiddlyWiki authors.  Select multiple tiddlers from a listbox and 'bulk modify' the creator, author, created, modified and/or tag values of those tiddlers using a compact set of form fields.  The values you enter into the fields simultaneously overwrite the existing values in all tiddlers you have selected.
!!!!!Usage
<<<
{{{<<tiddlerTweaker>>}}}
{{smallform{<<tiddlerTweaker>>}}}
By default, any tags you enter into the TiddlerTweaker will //replace// the existing tags in all the tiddlers you have selected.  However, you can also use TiddlerTweaker to quickly filter specified tags from the selected tiddlers, while leaving any other tags assigned to those tiddlers unchanged:
>Any tag preceded by a '+' (plus) or '-' (minus), will be added or removed from the existing tags //instead of replacing the entire tag definition// of each tiddler (e.g., enter '-excludeLists' to remove that tag from all selected tiddlers.  When using this syntax, care should be taken to ensure that //every// tag is preceded by '+' or '-', to avoid inadvertently overwriting any other existing tags on the selected tiddlers.  (note: the '+' or '-' prefix on each tag value is NOT part of the tag value, and is only used by TiddlerTweaker to control how that tag value is processed)
Important Notes:
* TiddlerTweaker is a 'power user' tool that can make changes to many tiddlers at once.  ''You should always have a recent backup of your document (or 'save changes' just *before* tweaking the tiddlers), just in case you accidentally 'shoot yourself in the foot'.''
* The date and author information on any tiddlers you tweak will ONLY be updated if the corresponding checkboxes have been selected.  As a general rule, after using TiddlerTweaker, always ''//remember to save your document//'' when you are done, even though the tiddler timeline tab may not show any recently modified tiddlers.
* Selecting and updating all tiddlers in a document can take a while.  Your browser may warn about an 'unresponsive script'.  Usually, if you allow it to continue, it should complete the processing... eventually.  Nonetheless, be sure to save your work before you begin tweaking lots of tiddlers, just in case something does get stuck.
<<<
!!!!!Revisions
<<<
2011.01.21 2.4.5 auto-selection: use "-" for untagged tiddlers.  Also, added 'opened', 'invert'
2009.09.15 2.4.4 added 'edit' button. moved html definition to separate section
2009.09.13 2.4.3 in settiddlers(), convert backslashed chars (\n\b\s\t) in replacement text
2009.06.26 2.4.2 only add brackets around tags containing spaces
2009.06.22 2.4.1 in setFields(), add brackets around all tags shown tweaker edit field
2009.03.30 2.4.0 added 'sort by modifier'
2009.01.22 2.3.0 added support for text pattern find/replace
2008.10.27 2.2.3 in setTiddlers(), fixed Safari bug by replacing static Array.concat(...) with new Array().concat(...)
2008.09.07 2.2.2 added removeCookie() function for compatibility with [[CookieManagerPlugin]]
2008.05.12 2.2.1 replace built-in backstage tweak task with tiddler tweaker control panel (moved from BackstageTweaks)
2008.01.13 2.2.0 added 'auto-selection' links: all, changed, tags, title, text
2007.12.26 2.1.0 added support for managing 'creator' custom field (see [[CoreTweaks]])
2007.11.01 2.0.3 added config.options.txtTweakerSortBy for cookie-based persistence of list display order preference setting.
2007.09.28 2.0.2 in settiddlers() and deltiddlers(), added suspend/resume notification handling (improves performance when operating on multiple tiddlers)
2007.08.03 2.0.1 added shadow definition for [[TiddlerTweaker]] tiddler for use as parameter references with {{{<<tiddler>>, <<slider>> or <<tabs>>}}} macros.
2007.08.03 2.0.0 converted from inline script
2006.01.01 1.0.0 initial release
<<<
!!!!!Code
***/
//{{{
version.extensions.TiddlerTweakerPlugin= {major: 2, minor: 4, revision: 5, date: new Date(2011,1,21)};

// shadow tiddler
config.shadowTiddlers.TiddlerTweaker='<<tiddlerTweaker>>';

// defaults
if (config.options.txtTweakerSortBy==undefined) config.options.txtTweakerSortBy='modified';

// backstage task
if (config.tasks) { // for TW2.2b3 or above
	config.tasks.tweak.tooltip='review/modify tiddler internals: dates, authors, tags, etc.';
	config.tasks.tweak.content='{{smallform small groupbox{<<tiddlerTweaker>>}}}';
}

// if removeCookie() function is not defined by TW core, define it here.
if (window.removeCookie===undefined) {
	window.removeCookie=function(name) {
		document.cookie = name+'=; expires=Thu, 01-Jan-1970 00:00:01 UTC; path=/;'; 
	}
}

config.macros.tiddlerTweaker = {
	handler: function(place,macroName,params,wikifier,paramString,tiddler) {
		var span=createTiddlyElement(place,'span');
		span.innerHTML=store.getTiddlerText('TiddlerTweakerPlugin##html');
		this.init(span.getElementsByTagName('form')[0],config.options.txtTweakerSortBy);
	},
	init: function(f,sortby) { // set form controls
		if (!f) return; // form might not be rendered yet...
		while (f.list.options[0]) f.list.options[0]=null; // empty the list
		var tids=store.getTiddlers(sortby);
		if (sortby=='size') // descending order
			tids.sort(function(a,b) {return a.text.length > b.text.length ? -1 : (a.text.length == b.text.length ? 0 : +1);});
		var who='';
		for (i=0; i<tids.length; i++) { var t=tids[i];
			var label=t.title; var value=t.title;
			switch (sortby) {
				case 'modified':
				case 'created':
					var t=tids[tids.length-i-1]; // reverse order
					var when=t[sortby].formatString('YY.0MM.0DD 0hh:0mm ');
					label=when+t.title;
					value=t.title;
					break;
				case 'size':
					label='['+t.text.length+'] '+label;
					break;
				case 'modifier':
				case 'creator':
					if (who!=t[sortby]) {
						who=t[sortby];
						f.list.options[f.list.length]=new Option('by '+who+':','',false,false);
					}
					label='\xa0\xa0\xa0'+label; // indent
					break;
			}
			f.list.options[f.list.length]=new Option(label,value,false,false);
		}
		f.title.value=f.who.value=f.creator.value=f.tags.value='';
		f.cm.value=f.cd.value=f.cy.value=f.ch.value=f.cn.value='';
		f.mm.value=f.md.value=f.my.value=f.mh.value=f.mn.value='';
		f.stats.disabled=f.set.disabled=f.del.disabled=f.edit.disabled=f.display.disabled=true;
		f.settitle.disabled=false;
		config.options.txtTweakerSortBy=sortby;
		f.sortby.value=sortby; // sync droplist
		if (sortby!='modified') saveOptionCookie('txtTweakerSortBy');
		else removeCookie('txtTweakerSortBy');
	},
	enablefields: function(here) { // enables/disables inputs based on #items selected
		var f=here.form; var list=f.list;
		var c=0; for (i=0;i<list.length;i++) if (list.options[i].selected) c++;
		if (c>1) f.title.disabled=true;
		if (c>1) f.settitle.checked=false;
		f.set.disabled=(c==0);
		f.del.disabled=(c==0);
		f.edit.disabled=(c==0);
		f.display.disabled=(c==0);
		f.settitle.disabled=(c>1);
		f.stats.disabled=(c==0);
		var msg=(c==0)?'select tiddlers':(c+' tiddler'+(c!=1?'s':'')+' selected');
		here.previousSibling.firstChild.firstChild.nextSibling.innerHTML=msg;
		if (c) clearMessage(); else displayMessage('no tiddlers selected');
	},
	setfields: function(here) { // set fields from first selected tiddler
		var f=here.form;
		if (!here.value.length) {
			f.title.value=f.who.value=f.creator.value=f.tags.value='';
			f.cm.value=f.cd.value=f.cy.value=f.ch.value=f.cn.value='';
			f.mm.value=f.md.value=f.my.value=f.mh.value=f.mn.value='';
			return;
		}
		var tid=store.getTiddler(here.value); if (!tid) return;
		f.title.value=tid.title;
		f.who.value=tid.modifier;
		f.creator.value=tid.fields['creator']||''; // custom field - might not exist
		f.tags.value=tid.tags.map(function(t){return String.encodeTiddlyLink(t)}).join(' ');
		var c=tid.created; var m=tid.modified;
		f.cm.value=c.getMonth()+1;
		f.cd.value=c.getDate();
		f.cy.value=c.getFullYear();
		f.ch.value=c.getHours();
		f.cn.value=c.getMinutes();
		f.mm.value=m.getMonth()+1;
		f.md.value=m.getDate();
		f.my.value=m.getFullYear();
		f.mh.value=m.getHours();
		f.mn.value=m.getMinutes();
	},
	selecttiddlers: function(here,callback) {
		var f=here; while (f&&f.nodeName.toLowerCase()!='form')f=f.parentNode;
		for (var t=f.list.options.length-1; t>=0; t--)
			f.list.options[t].selected=callback(f.list.options[t]);
		config.macros.tiddlerTweaker.enablefields(f.list);
		return false;
	},
	settiddlers: function(here) {
		var f=here.form; var list=f.list;
		var tids=[];
		for (i=0;i<list.length;i++) if (list.options[i].selected) tids.push(list.options[i].value);
		if (!tids.length) { alert('please select at least one tiddler'); return; }
		var cdate=new Date(f.cy.value,f.cm.value-1,f.cd.value,f.ch.value,f.cn.value);
		var mdate=new Date(f.my.value,f.mm.value-1,f.md.value,f.mh.value,f.mn.value);
		if (tids.length>1 && !confirm('Are you sure you want to update these tiddlers:\n\n'+tids.join(', '))) return;
		store.suspendNotifications();
		for (t=0;t<tids.length;t++) {
			var tid=store.getTiddler(tids[t]); if (!tid) continue;
			var title=!f.settitle.checked?tid.title:f.title.value;
			var who=!f.setwho.checked?tid.modifier:f.who.value;
			var text=tid.text;
			if (f.replacetext.checked) {
				var r=f.replacement.value.replace(/\\t/mg,'\t').unescapeLineBreaks();
				text=text.replace(new RegExp(f.pattern.value,'mg'),r);
			}				
			var tags=tid.tags;
			if (f.settags.checked) { 
				var intags=f.tags.value.readBracketedList();
				var addtags=[]; var deltags=[]; var reptags=[];
				for (i=0;i<intags.length;i++) {
					if (intags[i].substr(0,1)=='+')
						addtags.push(intags[i].substr(1));
					else if (intags[i].substr(0,1)=='-')
						deltags.push(intags[i].substr(1));
					else
						reptags.push(intags[i]);
				}
				if (reptags.length)
					tags=reptags;
				if (addtags.length)
					tags=new Array().concat(tags,addtags);
				if (deltags.length)
					for (i=0;i<deltags.length;i++)
						{ var pos=tags.indexOf(deltags[i]); if (pos!=-1) tags.splice(pos,1); }
			}
			if (!f.setcdate.checked) cdate=tid.created;
			if (!f.setmdate.checked) mdate=tid.modified;
			store.saveTiddler(tid.title,title,text,who,mdate,tags,tid.fields);
			if (f.setcreator.checked) store.setValue(tid.title,'creator',f.creator.value); // set creator
			if (f.setcdate.checked) tid.assign(null,null,null,null,null,cdate); // set create date
		}
		store.resumeNotifications();
		this.init(f,f.sortby.value);
	},
	displaytiddlers: function(here,edit) {
		var f=here.form; var list=f.list;
		var tids=[];
		for (i=0; i<list.length;i++) if (list.options[i].selected) tids.push(list.options[i].value);
		if (!tids.length) { alert('please select at least one tiddler'); return; }
		story.displayTiddlers(story.findContainingTiddler(f),tids,edit?DEFAULT_EDIT_TEMPLATE:null);
	},
	deltiddlers: function(here) {
		var f=here.form; var list=f.list;
		var tids=[];
		for (i=0;i<list.length;i++) if (list.options[i].selected) tids.push(list.options[i].value);
		if (!tids.length) { alert('please select at least one tiddler'); return; }
		if (!confirm('Are you sure you want to delete these tiddlers:\n\n'+tids.join(', '))) return;
		store.suspendNotifications();
		for (t=0;t<tids.length;t++) {
			var tid=store.getTiddler(tids[t]); if (!tid) continue;
			if (tid.tags.contains('systemConfig')) {
				var msg=tid.title+' is tagged with systemConfig.'
					+'\n\nRemoving this tiddler may cause unexpected results.  Are you sure?';
				if (!confirm(msg)) continue;
			}
			store.removeTiddler(tid.title);
			story.closeTiddler(tid.title);
		}
		store.resumeNotifications();
		this.init(f,f.sortby.value);
	},
	stats: function(here) {
		var f=here.form; var list=f.list; var tids=[]; var out=''; var tot=0;
		var target=f.nextSibling;
		for (i=0;i<list.length;i++) if (list.options[i].selected) tids.push(list.options[i].value);
		if (!tids.length) { alert('please select at least one tiddler'); return; }
		for (t=0;t<tids.length;t++) {
			var tid=store.getTiddler(tids[t]); if (!tid) continue;
			out+='[['+tid.title+']] '+tid.text.length+'\n'; tot+=tid.text.length;
		}
		var avg=tot/tids.length;
		out=tot+' bytes in '+tids.length+' selected tiddlers ('+avg+' bytes/tiddler)\n<<<\n'+out+'<<<\n';
		removeChildren(target);
		target.innerHTML="<hr><font size=-2><a href='javascript:;' style='float:right' "
			+"onclick='this.parentNode.parentNode.style.display=\"none\"'>close</a></font>";
		wikify(out,target);
		target.style.display='block';
	}
};
//}}}
/***
//{{{
!html
<style>
.tiddlerTweaker table,
.tiddlerTweaker table tr,
.tiddlerTweaker table td
	{ padding:0;margin:0;border:0;white-space:nowrap; }
</style><form class='tiddlerTweaker'><!--
--><table style="width:100%"><tr valign="top"><!--
--><td style="text-align:center;width:99%;"><!--
	--><font size=-2><div style="text-align:left;"><span style="float:right"><!--
	-->&nbsp; <a href="javascript:;" 
		title="select all tiddlers"
		onclick="return config.macros.tiddlerTweaker.selecttiddlers(this,function(opt){
			return opt.value.length;
		});">all</a><!--
	-->&nbsp; <a href="javascript:;" 
		title="select tiddlers currently displayed in the story column"
		onclick="return config.macros.tiddlerTweaker.selecttiddlers(this,function(opt){
			return story.getTiddler(opt.value);
		});">opened</a><!--
	-->&nbsp; <a href="javascript:;" 
		title="select tiddlers that are new/changed since the last file save"
		onclick="var lastmod=new Date(document.lastModified);
			return config.macros.tiddlerTweaker.selecttiddlers(this,function(opt){
				var tid=store.getTiddler(opt.value);
				return tid&&tid.modified>lastmod;
			});
		">changed</a><!--
	-->&nbsp; <a href="javascript:;" 
		title="select tiddlers with at least one matching tag"
		onclick="var t=prompt('Enter space-separated tags (match one or more).  Use \x22-\x22 to match untagged tiddlers');
			if (!t||!t.length) return false;
			var tags=t.readBracketedList();
			return config.macros.tiddlerTweaker.selecttiddlers(this,function(opt){
				var tid=store.getTiddler(opt.value);
				return tid&&tags[0]=='-'?!tid.tags.length:tid.tags.containsAny(tags);
			});
		">tags</a><!--
	-->&nbsp; <a href="javascript:;" 
		title="select tiddlers whose titles include matching text"
		onclick="var t=prompt('Enter a title (or portion of a title) to match');
			if (!t||!t.length) return false;
			return config.macros.tiddlerTweaker.selecttiddlers(this,function(opt){
				return opt.value.indexOf(t)!=-1;
			});
		">titles</a><!--
	-->&nbsp; <a href="javascript:;" 
		title="select tiddlers containing matching text"
		onclick="var t=prompt('Enter tiddler text (content) to match');
			if (!t||!t.length) return false;
			return config.macros.tiddlerTweaker.selecttiddlers(this,function(opt){
				var tt=store.getTiddlerText(opt.value,'');
				return tt.indexOf(t)!=-1;
			});
		">text</a><!--
	-->&nbsp; <a href="javascript:;" 
		title="reverse selection of all list items"
		onclick="return config.macros.tiddlerTweaker.selecttiddlers(this,function(opt){
			return !opt.selected;
		});">invert</a><!--
	--></span><span>select tiddlers</span><!--
	--></div><!--
	--></font><select multiple name=list size="11" style="width:99.99%" 
		title="use click, shift-click and/or ctrl-click to select multiple tiddler titles" 
		onclick="config.macros.tiddlerTweaker.enablefields(this)" 
		onchange="config.macros.tiddlerTweaker.setfields(this)"><!--
	--></select><br><!--
	-->show<input type=text size=1 value="11" 
		onchange="this.form.list.size=this.value; this.form.list.multiple=(this.value>1);"><!--
	-->by<!--
	--><select name=sortby size=1 
		onchange="config.macros.tiddlerTweaker.init(this.form,this.value)"><!--
	--><option value="title">title</option><!--
	--><option value="size">size</option><!--
	--><option value="modified">modified</option><!--
	--><option value="created">created</option><!--
	--><option value="modifier">modifier</option><!--
	--></select><!--
	--><input type="button" value="refresh" 
		onclick="config.macros.tiddlerTweaker.init(this.form,this.form.sortby.value)"<!--
	--> <input type="button" name="stats" disabled value="totals..." 
		onclick="config.macros.tiddlerTweaker.stats(this)"><!--
--></td><td style="width:1%"><!--
	--><div style="text-align:left"><font size=-2>&nbsp;modify values</font></div><!--
	--><table style="width:100%;"><tr><!--
	--><td style="padding:1px"><!--
		--><input type=checkbox name=settitle unchecked 
			title="allow changes to tiddler title (rename tiddler)" 
			onclick="this.form.title.disabled=!this.checked">title<!--
	--></td><td style="padding:1px"><!--
		--><input type=text name=title size=35 style="width:98%" disabled><!--
	--></td></tr><tr><td style="padding:1px"><!--
		--><input type=checkbox name=setcreator unchecked 
			title="allow changes to tiddler creator" 
			onclick="this.form.creator.disabled=!this.checked">created by<!--
	--></td><td style="padding:1px;"><!--
		--><input type=text name=creator size=35 style="width:98%" disabled><!--
	--></td></tr><tr><td style="padding:1px"><!--
		--><input type=checkbox name=setwho unchecked 
			title="allow changes to tiddler author" 
			onclick="this.form.who.disabled=!this.checked">modified by<!--
	--></td><td style="padding:1px"><!--
		--><input type=text name=who size=35 style="width:98%" disabled><!--
	--></td></tr><tr><td style="padding:1px"><!--
		--><input type=checkbox name=setcdate unchecked 
			title="allow changes to created date" 
			onclick="var f=this.form;
				f.cm.disabled=f.cd.disabled=f.cy.disabled=f.ch.disabled=f.cn.disabled=!this.checked"><!--
		-->created on<!--
	--></td><td style="padding:1px"><!--
		--><input type=text name=cm size=2 style="width:2em;padding:0;text-align:center" disabled><!--
		--> / <input type=text name=cd size=2 style="width:2em;padding:0;text-align:center" disabled><!--
		--> / <input type=text name=cy size=4 style="width:3em;padding:0;text-align:center" disabled><!--
		--> at <input type=text name=ch size=2 style="width:2em;padding:0;text-align:center" disabled><!--
		--> : <input type=text name=cn size=2 style="width:2em;padding:0;text-align:center" disabled><!--
	--></td></tr><tr><td style="padding:1px"><!--
		--><input type=checkbox name=setmdate unchecked 
			title="allow changes to modified date" 
			onclick="var f=this.form;
				f.mm.disabled=f.md.disabled=f.my.disabled=f.mh.disabled=f.mn.disabled=!this.checked"><!--
		-->modified on<!--
	--></td><td style="padding:1px"><!--
		--><input type=text name=mm size=2 style="width:2em;padding:0;text-align:center" disabled><!--
		--> / <input type=text name=md size=2 style="width:2em;padding:0;text-align:center" disabled><!--
		--> / <input type=text name=my size=4 style="width:3em;padding:0;text-align:center" disabled><!--
		--> at <input type=text name=mh size=2 style="width:2em;padding:0;text-align:center" disabled><!--
		--> : <input type=text name=mn size=2 style="width:2em;padding:0;text-align:center" disabled><!--
	--></td></tr><tr><td style="padding:1px"><!--
		--><input type=checkbox name=replacetext unchecked
			title="find/replace matching text" 
			onclick="this.form.pattern.disabled=this.form.replacement.disabled=!this.checked">replace text<!--
	--></td><td style="padding:1px"><!--
		--><input type=text name=pattern size=15 value="" style="width:40%" disabled 
			title="enter TEXT PATTERN (regular expression)"> with<!--
		--><input type=text name=replacement size=15 value="" style="width:40%" disabled 
			title="enter REPLACEMENT TEXT"><!--
	--></td></tr><tr><td style="padding:1px"><!--
		--><input type=checkbox name=settags checked 
			title="allow changes to tiddler tags" 
			onclick="this.form.tags.disabled=!this.checked">tags<!--
	--></td><td style="padding:1px"><!--
		--><input type=text name=tags size=35 value="" style="width:98%" 
			title="enter new tags or use '+tag' and '-tag' to add/remove tags from existing tags"><!--
	--></td></tr></table><!--
	--><div style="text-align:center"><!--
	--><nobr><input type=button name=display disabled style="width:24%" value="display" 
		title="show selected tiddlers"
		onclick="config.macros.tiddlerTweaker.displaytiddlers(this,false)"><!--
	--> <input type=button name=edit disabled style="width:23%" value="edit" 
		title="edit selected tiddlers"
		onclick="config.macros.tiddlerTweaker.displaytiddlers(this,true)"><!--
	--> <input type=button name=del disabled style="width:24%" value="delete" 
		title="remove selected tiddlers"
		onclick="config.macros.tiddlerTweaker.deltiddlers(this)"><!--
	--> <input type=button name=set disabled style="width:24%" value="update" 
		title="update selected tiddlers"
		onclick="config.macros.tiddlerTweaker.settiddlers(this)"></nobr><!--
	--></div><!--
--></td></tr></table><!--
--></form><span style="display:none"><!--content replaced by tiddler "stats"--></span>
!end
//}}}
***/
 
!Inline Formatting
|!Option|!Syntax|!Output|
|bold font|{{{''bold''}}}|''bold''|
|italic type|{{{//italic//}}}|//italic//|
|underlined text|{{{__underlined__}}}|__underlined__|
|strikethrough text|{{{--strikethrough--}}}|--strikethrough--|
|superscript text|{{{^^super^^script}}}|^^super^^script|
|subscript text|{{{~~sub~~script}}}|~~sub~~script|
|highlighted text|{{{@@highlighted@@}}}|@@highlighted@@|
|preformatted text|<html><code>{{{preformatted}}}</code></html>|{{{preformatted}}}|
!Block Elements
!!Headings
{{{
!Heading 1
!!Heading 2
!!!Heading 3
!!!!Heading 4
!!!!!Heading 5
}}}
<<<
!Heading 1
!!Heading 2
!!!Heading 3
!!!!Heading 4
!!!!!Heading 5
<<<
!!Lists
{{{
* unordered list, level 1
** unordered list, level 2
*** unordered list, level 3

# ordered list, level 1
## ordered list, level 2
### ordered list, level 3

; definition list, term
: definition list, description
}}}
<<<
* unordered list, level 1
** unordered list, level 2
*** unordered list, level 3

# ordered list, level 1
## ordered list, level 2
### ordered list, level 3

; definition list, term
: definition list, description
<<<
!!Blockquotes
{{{
> blockquote, level 1
>> blockquote, level 2
>>> blockquote, level 3

<<<
blockquote
<<<
}}}
<<<
> blockquote, level 1
>> blockquote, level 2
>>> blockquote, level 3

> blockquote
<<<
!!Preformatted Text
<html><pre>
{{{
preformatted (e.g. code)
}}}
</pre></html>
<<<
{{{
preformatted (e.g. code)
}}}
<<<
!!Tables
{{{
|CssClass|k
|!heading column 1|!heading column 2|
|row 1, column 1|row 1, column 2|
|row 2, column 1|row 2, column 2|
|>|COLSPAN|
|ROWSPAN| … |
|~| … |
|CssProperty:value;…| … |
|caption|c
}}}
''Annotation:''
* The {{{>}}} marker creates a "colspan", causing the current cell to merge with the one to the right.
* The {{{~}}} marker creates a "rowspan", causing the current cell to merge with the one above.
<<<
|CssClass|k
|!heading column 1|!heading column 2|
|row 1, column 1|row 1, column 2|
|row 2, column 1|row 2, column 2|
|>|COLSPAN|
|ROWSPAN| … |
|~| … |
|CssProperty:value;…| … |
|caption|c
<<<
!!Images /% TODO %/
cf. [[TiddlyWiki.com|http://www.tiddlywiki.com/#EmbeddedImages]]
!Hyperlinks
* [[WikiWords|WikiWord]] are automatically transformed to hyperlinks to the respective tiddler
** the automatic transformation can be suppressed by preceding the respective WikiWord with a tilde ({{{~}}}): {{{~WikiWord}}}
* [[PrettyLinks]] are enclosed in square brackets and contain the desired tiddler name: {{{[[tiddler name]]}}}
** optionally, a custom title or description can be added, separated by a pipe character ({{{|}}}): {{{[[title|target]]}}}<br>''N.B.:'' In this case, the target can also be any website (i.e. URL).
!Custom Styling
* {{{@@CssProperty:value;CssProperty:value;…@@}}}<br>''N.B.:'' CSS color definitions should use lowercase letters to prevent the inadvertent creation of WikiWords.
* <html><code>{{customCssClass{…}}}</code></html>
* raw HTML can be inserted by enclosing the respective code in HTML tags: {{{<html> … </html>}}}
!Special Markers
* {{{<br>}}} forces a manual line break
* {{{----}}} creates a horizontal ruler
* [[HTML entities|http://www.tiddlywiki.com/#HtmlEntities]]
* {{{<<macroName>>}}} calls the respective [[macro|Macros]]
* To hide text within a tiddler so that it is not displayed, it can be wrapped in {{{/%}}} and {{{%/}}}.<br/>This can be a useful trick for hiding drafts or annotating complex markup.
* To prevent wiki markup from taking effect for a particular section, that section can be enclosed in three double quotes: e.g. {{{"""WikiWord"""}}}.

!!Image Formatting
!Simple Images
{{{
[img[http://wikitext.tiddlyspace.com/fractalveg.jpg]]
}}}
Displays as:
[img[http://wikitext.tiddlyspace.com/fractalveg.jpg]]
!Tooltips for Images
{{{
[img[tooltip|http://wikitext.tiddlyspace.com/fractalveg.jpg]]
}}}
Displays as:
[img[tooltip|http://wikitext.tiddlyspace.com/fractalveg.jpg]]
!Image Links
{{{
[img[http://wikitext.tiddlyspace.com/fractalveg.jpg][http://www.flickr.com/photos/jermy/10134618/]]
}}}
Displays as:
[img[http://wikitext.tiddlyspace.com/fractalveg.jpg][http://www.flickr.com/photos/jermy/10134618/]]
!Floating Images with Text
{{{
[<img[http://wikitext.tiddlyspace.com/fractalveg.jpg]]
}}}
[<img[http://wikitext.tiddlyspace.com/fractalveg.jpg]]Displays as.
{{{
@@clear:both;display:block; @@
}}}
Will then clear the float.
@@clear:both;display:block;Like this@@
{{{
[>img[http://wikitext.tiddlyspace.com/fractalveg.jpg]]
}}}
[>img[http://wikitext.tiddlyspace.com/fractalveg.jpg]]Displays as.@@clear:both;display:block; @@
!See Also
[[Image Macro]]
!!Basics
[[Create Your Own TiddlyWiki Online]]
[[Create new Menu Items and new Tiddlers]]
[[Change the Welcome page]]
[[use html tag in tiddlywiki]]
[[Change default config about "SaveBackups" and username]]

!!Formatting
[[Multiline styled contents]]

!!Plugin
[[jsMath Plugin: enable Latex in tiddlwiki]]

!!Problem&Solution
[[How to differentiate tiddler(link) and common text]]
[[Can I stop the Confirmation (Allow/Deny) required to Save my file in Firefox 3?]]
[[Turn off StrikeThrough Features]]
[[Error retrieving tiddlers from url, please ensure this url exists and is CORS enabled]]
[[Can I upload an existing TiddlyWiki to a tiddlyspot.com site?]]
[[Can I make it only show one tiddler at a time like a regular wiki?]]
[[How to customize the print outcome?]]

*[[Unsolved Problem|Unsolved Problem for Tiddlywiki]]

!!FAQ
http://tiddlywiki.org/
|~ViewToolbar|closeTiddler closeOthers +editTiddler > fields syncing permalink references jump|
|~EditToolbar|+saveTiddler -cancelTiddler deleteTiddler|
*[[Beamforming]]
*WSN
*MIMO
*Nash
*CR Networks
*
!!2. Wyner-Ziv Codec
A Wyner-Ziv frame, S, is encoded as follows:
#quantize each pixel value of the frame using a uniform scalar quantizer with 2^^M^^ levels to form the quantized symbol stream q
#take these symbols, form a long symbol block, snd it to the SW encoder
#*SW coder is implemented using a RCPT code.
#q is fed into two constituent convolutional encoder of a turbo encoder
#the parity bits produced by the turbo encoder are stored in a buffer
#the buffer transimits a subset of these parity bits to the decoder upon request
For each Wyner-Ziv frame, the decoder:
# takes adjacent previously decoded key frames, and possibly, previously decoded WZ frames, to form the side information $\hat{S}$
#use the SI and received subset of parity bits to form the decoded symbol stream q'
#If the decoder cannot reliably decode the symbols, it requests additional parity bits from the encoder buffer through feedback.
#The request and decode process is repeated until an acceptable probability of symbol error is guaranteed.
By using the SI, the decoder needs to request k <= M bits (for each pixel) to decode which of the 2^^M^^ bins a pixel belongs to and so compression is achieved.
* each pixel needs M bits to represent it, if request bit k is less than M, then compression is achieved.
/***
Description: Contains the stuff you need to use Tiddlyspot
Note, you also need UploadPlugin, PasswordOptionPlugin and LoadRemoteFileThroughProxy
from http://tiddlywiki.bidix.info for a complete working Tiddlyspot site.
***/
//{{{

// edit this if you are migrating sites or retrofitting an existing TW
config.tiddlyspotSiteId = 'funny';

// make it so you can by default see edit controls via http
config.options.chkHttpReadOnly = false;
window.readOnly = false; // make sure of it (for tw 2.2)
window.showBackstage = true; // show backstage too

// disable autosave in d3
if (window.location.protocol != "file:")
	config.options.chkGTDLazyAutoSave = false;

// tweak shadow tiddlers to add upload button, password entry box etc
with (config.shadowTiddlers) {
	SiteUrl = 'http://'+config.tiddlyspotSiteId+'.tiddlyspot.com';
	SideBarOptions = SideBarOptions.replace(/(<<saveChanges>>)/,"$1<<tiddler TspotSidebar>>");
	OptionsPanel = OptionsPanel.replace(/^/,"<<tiddler TspotOptions>>");
	DefaultTiddlers = DefaultTiddlers.replace(/^/,"[[WelcomeToMyWiki]] ");
	MainMenu = MainMenu.replace(/^/,"[[WelcomeToTiddlyspot]] ");
}

// create some shadow tiddler content
merge(config.shadowTiddlers,{

'TspotOptions':[
 "tiddlyspot password:",
 "<<option pasUploadPassword>>",
 ""
].join("\n"),

'TspotControls':[
 "| tiddlyspot password:|<<option pasUploadPassword>>|",
 "| site management:|<<upload http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/store.cgi index.html . .  " + config.tiddlyspotSiteId + ">>//(requires tiddlyspot password)//<br>[[control panel|http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/controlpanel]], [[download (go offline)|http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/download]]|",
 "| links:|[[tiddlyspot.com|http://tiddlyspot.com/]], [[FAQs|http://faq.tiddlyspot.com/]], [[blog|http://tiddlyspot.blogspot.com/]], email [[support|mailto:support@tiddlyspot.com]] & [[feedback|mailto:feedback@tiddlyspot.com]], [[donate|http://tiddlyspot.com/?page=donate]]|"
].join("\n"),

'WelcomeToTiddlyspot':[
 "This document is a ~TiddlyWiki from tiddlyspot.com.  A ~TiddlyWiki is an electronic notebook that is great for managing todo lists, personal information, and all sorts of things.",
 "",
 "@@font-weight:bold;font-size:1.3em;color:#444; //What now?// &nbsp;&nbsp;@@ Before you can save any changes, you need to enter your password in the form below.  Then configure privacy and other site settings at your [[control panel|http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/controlpanel]] (your control panel username is //" + config.tiddlyspotSiteId + "//).",
 "<<tiddler TspotControls>>",
 "See also GettingStarted.",
 "",
 "@@font-weight:bold;font-size:1.3em;color:#444; //Working online// &nbsp;&nbsp;@@ You can edit this ~TiddlyWiki right now, and save your changes using the \"save to web\" button in the column on the right.",
 "",
 "@@font-weight:bold;font-size:1.3em;color:#444; //Working offline// &nbsp;&nbsp;@@ A fully functioning copy of this ~TiddlyWiki can be saved onto your hard drive or USB stick.  You can make changes and save them locally without being connected to the Internet.  When you're ready to sync up again, just click \"upload\" and your ~TiddlyWiki will be saved back to tiddlyspot.com.",
 "",
 "@@font-weight:bold;font-size:1.3em;color:#444; //Help!// &nbsp;&nbsp;@@ Find out more about ~TiddlyWiki at [[TiddlyWiki.com|http://tiddlywiki.com]].  Also visit [[TiddlyWiki.org|http://tiddlywiki.org]] for documentation on learning and using ~TiddlyWiki. New users are especially welcome on the [[TiddlyWiki mailing list|http://groups.google.com/group/TiddlyWiki]], which is an excellent place to ask questions and get help.  If you have a tiddlyspot related problem email [[tiddlyspot support|mailto:support@tiddlyspot.com]].",
 "",
 "@@font-weight:bold;font-size:1.3em;color:#444; //Enjoy :)// &nbsp;&nbsp;@@ We hope you like using your tiddlyspot.com site.  Please email [[feedback@tiddlyspot.com|mailto:feedback@tiddlyspot.com]] with any comments or suggestions."
].join("\n"),

'TspotSidebar':[
 "<<upload http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/store.cgi index.html . .  " + config.tiddlyspotSiteId + ">><html><a href='http://" + config.tiddlyspotSiteId + ".tiddlyspot.com/download' class='button'>download</a></html>"
].join("\n")

});
//}}}
!!Encoding
* use two __convolutional codes__ in parallel with some kind of __interleaving__ in between
* finite blocks -- corresponding to the interleaver size
* termination tail is then appended to the encoded information and used in the decoder

See DisableStrikeThroughPlugin
import the tiddler
or 
copy it to a new tiddlyer and tag systemConfig
!!Configuration
[[切换ubuntu的文件夹为英文]]
[[Change default gcc version]]
[[Install Ubuntu in Portable Disk]]
[[screen bash]]
[[安装nvidia后 无法进入系统]]

!!Grub
[[进系统出现grub rescue]]
[[双系统 grub引导]]

!!Command
[[ln]]
[[tar gz]]
[[grep]]

!!GCC
[[Complie GCC]]
http://www.360doc.com/content/10/0523/15/387330_29089758.shtml
Sometimes, the cmd expects the location of .ssh is the same directory with Git.
But the git bash expects it located in C:/Users/../.ssh.

Solution:
Put the same file in both directories.
u(t) = 1 for t > 0, u(t) = 0 for t <0, u(t) undefined or = 1/2 for t = 0
u(n) = 1 for n >=0, u(n) = 0 for n < 0
!!![Question]order list
e.g
{{{
#hello
{ { {
abc
} } }
#hey
}}}
the page shows:
#hello
{{{
abc
}}}
#hey

use {{{//}}}
{{{
#hello//
{ { {
abc
} } }
//
#hey
}}}

#hello//
{{{
abc
}}}
//
#hey
| !date | !user | !location | !storeUrl | !uploadDir | !toFilename | !backupdir | !origin |
| 04/01/2012 20:48:34 | Hao | [[funny.html|file:///E:/Wiki/funny.html]] | [[store.cgi|http://funny.tiddlyspot.com/store.cgi]] | . | [[index.html | http://funny.tiddlyspot.com/index.html]] | . | ok |
| 27/06/2012 14:11:03 | Hao | [[funny.html|file:///E:/Wiki/funny.html]] | [[store.cgi|http://funny.tiddlyspot.com/store.cgi]] | . | [[index.html | http://funny.tiddlyspot.com/index.html]] | . |
| 27/06/2012 14:13:16 | Hao | [[funny.html|file:///E:/Wiki/funny.html]] | [[|file:///E:/Wiki/]] | . | [[funny.html | file:///E:/Wiki/funny.html]] |  | failed |
| 31/01/2013 14:22:21 | Hao | [[funny.html|file:///E:/SkyDrive/Wiki/funny.html]] | [[store.cgi|http://funny.tiddlyspot.com/store.cgi]] | . | [[index.html | http://funny.tiddlyspot.com/index.html]] | . |
/***
|''Name:''|UploadPlugin|
|''Description:''|Save to web a TiddlyWiki|
|''Version:''|4.1.3|
|''Date:''|Feb 24, 2008|
|''Source:''|http://tiddlywiki.bidix.info/#UploadPlugin|
|''Documentation:''|http://tiddlywiki.bidix.info/#UploadPluginDoc|
|''Author:''|BidiX (BidiX (at) bidix (dot) info)|
|''License:''|[[BSD open source license|http://tiddlywiki.bidix.info/#%5B%5BBSD%20open%20source%20license%5D%5D ]]|
|''~CoreVersion:''|2.2.0|
|''Requires:''|PasswordOptionPlugin|
***/
//{{{
version.extensions.UploadPlugin = {
	major: 4, minor: 1, revision: 3,
	date: new Date("Feb 24, 2008"),
	source: 'http://tiddlywiki.bidix.info/#UploadPlugin',
	author: 'BidiX (BidiX (at) bidix (dot) info',
	coreVersion: '2.2.0'
};

//
// Environment
//

if (!window.bidix) window.bidix = {}; // bidix namespace
bidix.debugMode = false;	// true to activate both in Plugin and UploadService
	
//
// Upload Macro
//

config.macros.upload = {
// default values
	defaultBackupDir: '',	//no backup
	defaultStoreScript: "store.php",
	defaultToFilename: "index.html",
	defaultUploadDir: ".",
	authenticateUser: true	// UploadService Authenticate User
};
	
config.macros.upload.label = {
	promptOption: "Save and Upload this TiddlyWiki with UploadOptions",
	promptParamMacro: "Save and Upload this TiddlyWiki in %0",
	saveLabel: "save to web", 
	saveToDisk: "save to disk",
	uploadLabel: "upload"	
};

config.macros.upload.messages = {
	noStoreUrl: "No store URL in parmeters or options",
	usernameOrPasswordMissing: "Username or password missing"
};

config.macros.upload.handler = function(place,macroName,params) {
	if (readOnly)
		return;
	var label;
	if (document.location.toString().substr(0,4) == "http") 
		label = this.label.saveLabel;
	else
		label = this.label.uploadLabel;
	var prompt;
	if (params[0]) {
		prompt = this.label.promptParamMacro.toString().format([this.destFile(params[0], 
			(params[1] ? params[1]:bidix.basename(window.location.toString())), params[3])]);
	} else {
		prompt = this.label.promptOption;
	}
	createTiddlyButton(place, label, prompt, function() {config.macros.upload.action(params);}, null, null, this.accessKey);
};

config.macros.upload.action = function(params)
{
		// for missing macro parameter set value from options
		if (!params) params = {};
		var storeUrl = params[0] ? params[0] : config.options.txtUploadStoreUrl;
		var toFilename = params[1] ? params[1] : config.options.txtUploadFilename;
		var backupDir = params[2] ? params[2] : config.options.txtUploadBackupDir;
		var uploadDir = params[3] ? params[3] : config.options.txtUploadDir;
		var username = params[4] ? params[4] : config.options.txtUploadUserName;
		var password = config.options.pasUploadPassword; // for security reason no password as macro parameter	
		// for still missing parameter set default value
		if ((!storeUrl) && (document.location.toString().substr(0,4) == "http")) 
			storeUrl = bidix.dirname(document.location.toString())+'/'+config.macros.upload.defaultStoreScript;
		if (storeUrl.substr(0,4) != "http")
			storeUrl = bidix.dirname(document.location.toString()) +'/'+ storeUrl;
		if (!toFilename)
			toFilename = bidix.basename(window.location.toString());
		if (!toFilename)
			toFilename = config.macros.upload.defaultToFilename;
		if (!uploadDir)
			uploadDir = config.macros.upload.defaultUploadDir;
		if (!backupDir)
			backupDir = config.macros.upload.defaultBackupDir;
		// report error if still missing
		if (!storeUrl) {
			alert(config.macros.upload.messages.noStoreUrl);
			clearMessage();
			return false;
		}
		if (config.macros.upload.authenticateUser && (!username || !password)) {
			alert(config.macros.upload.messages.usernameOrPasswordMissing);
			clearMessage();
			return false;
		}
		bidix.upload.uploadChanges(false,null,storeUrl, toFilename, uploadDir, backupDir, username, password); 
		return false; 
};

config.macros.upload.destFile = function(storeUrl, toFilename, uploadDir) 
{
	if (!storeUrl)
		return null;
		var dest = bidix.dirname(storeUrl);
		if (uploadDir && uploadDir != '.')
			dest = dest + '/' + uploadDir;
		dest = dest + '/' + toFilename;
	return dest;
};

//
// uploadOptions Macro
//

config.macros.uploadOptions = {
	handler: function(place,macroName,params) {
		var wizard = new Wizard();
		wizard.createWizard(place,this.wizardTitle);
		wizard.addStep(this.step1Title,this.step1Html);
		var markList = wizard.getElement("markList");
		var listWrapper = document.createElement("div");
		markList.parentNode.insertBefore(listWrapper,markList);
		wizard.setValue("listWrapper",listWrapper);
		this.refreshOptions(listWrapper,false);
		var uploadCaption;
		if (document.location.toString().substr(0,4) == "http") 
			uploadCaption = config.macros.upload.label.saveLabel;
		else
			uploadCaption = config.macros.upload.label.uploadLabel;
		
		wizard.setButtons([
				{caption: uploadCaption, tooltip: config.macros.upload.label.promptOption, 
					onClick: config.macros.upload.action},
				{caption: this.cancelButton, tooltip: this.cancelButtonPrompt, onClick: this.onCancel}
				
			]);
	},
	options: [
		"txtUploadUserName",
		"pasUploadPassword",
		"txtUploadStoreUrl",
		"txtUploadDir",
		"txtUploadFilename",
		"txtUploadBackupDir",
		"chkUploadLog",
		"txtUploadLogMaxLine"		
	],
	refreshOptions: function(listWrapper) {
		var opts = [];
		for(i=0; i<this.options.length; i++) {
			var opt = {};
			opts.push();
			opt.option = "";
			n = this.options[i];
			opt.name = n;
			opt.lowlight = !config.optionsDesc[n];
			opt.description = opt.lowlight ? this.unknownDescription : config.optionsDesc[n];
			opts.push(opt);
		}
		var listview = ListView.create(listWrapper,opts,this.listViewTemplate);
		for(n=0; n<opts.length; n++) {
			var type = opts[n].name.substr(0,3);
			var h = config.macros.option.types[type];
			if (h && h.create) {
				h.create(opts[n].colElements['option'],type,opts[n].name,opts[n].name,"no");
			}
		}
		
	},
	onCancel: function(e)
	{
		backstage.switchTab(null);
		return false;
	},
	
	wizardTitle: "Upload with options",
	step1Title: "These options are saved in cookies in your browser",
	step1Html: "<input type='hidden' name='markList'></input><br>",
	cancelButton: "Cancel",
	cancelButtonPrompt: "Cancel prompt",
	listViewTemplate: {
		columns: [
			{name: 'Description', field: 'description', title: "Description", type: 'WikiText'},
			{name: 'Option', field: 'option', title: "Option", type: 'String'},
			{name: 'Name', field: 'name', title: "Name", type: 'String'}
			],
		rowClasses: [
			{className: 'lowlight', field: 'lowlight'} 
			]}
};

//
// upload functions
//

if (!bidix.upload) bidix.upload = {};

if (!bidix.upload.messages) bidix.upload.messages = {
	//from saving
	invalidFileError: "The original file '%0' does not appear to be a valid TiddlyWiki",
	backupSaved: "Backup saved",
	backupFailed: "Failed to upload backup file",
	rssSaved: "RSS feed uploaded",
	rssFailed: "Failed to upload RSS feed file",
	emptySaved: "Empty template uploaded",
	emptyFailed: "Failed to upload empty template file",
	mainSaved: "Main TiddlyWiki file uploaded",
	mainFailed: "Failed to upload main TiddlyWiki file. Your changes have not been saved",
	//specific upload
	loadOriginalHttpPostError: "Can't get original file",
	aboutToSaveOnHttpPost: 'About to upload on %0 ...',
	storePhpNotFound: "The store script '%0' was not found."
};

bidix.upload.uploadChanges = function(onlyIfDirty,tiddlers,storeUrl,toFilename,uploadDir,backupDir,username,password)
{
	var callback = function(status,uploadParams,original,url,xhr) {
		if (!status) {
			displayMessage(bidix.upload.messages.loadOriginalHttpPostError);
			return;
		}
		if (bidix.debugMode) 
			alert(original.substr(0,500)+"\n...");
		// Locate the storeArea div's 
		var posDiv = locateStoreArea(original);
		if((posDiv[0] == -1) || (posDiv[1] == -1)) {
			alert(config.messages.invalidFileError.format([localPath]));
			return;
		}
		bidix.upload.uploadRss(uploadParams,original,posDiv);
	};
	
	if(onlyIfDirty && !store.isDirty())
		return;
	clearMessage();
	// save on localdisk ?
	if (document.location.toString().substr(0,4) == "file") {
		var path = document.location.toString();
		var localPath = getLocalPath(path);
		saveChanges();
	}
	// get original
	var uploadParams = new Array(storeUrl,toFilename,uploadDir,backupDir,username,password);
	var originalPath = document.location.toString();
	// If url is a directory : add index.html
	if (originalPath.charAt(originalPath.length-1) == "/")
		originalPath = originalPath + "index.html";
	var dest = config.macros.upload.destFile(storeUrl,toFilename,uploadDir);
	var log = new bidix.UploadLog();
	log.startUpload(storeUrl, dest, uploadDir,  backupDir);
	displayMessage(bidix.upload.messages.aboutToSaveOnHttpPost.format([dest]));
	if (bidix.debugMode) 
		alert("about to execute Http - GET on "+originalPath);
	var r = doHttp("GET",originalPath,null,null,username,password,callback,uploadParams,null);
	if (typeof r == "string")
		displayMessage(r);
	return r;
};

bidix.upload.uploadRss = function(uploadParams,original,posDiv) 
{
	var callback = function(status,params,responseText,url,xhr) {
		if(status) {
			var destfile = responseText.substring(responseText.indexOf("destfile:")+9,responseText.indexOf("\n", responseText.indexOf("destfile:")));
			displayMessage(bidix.upload.messages.rssSaved,bidix.dirname(url)+'/'+destfile);
			bidix.upload.uploadMain(params[0],params[1],params[2]);
		} else {
			displayMessage(bidix.upload.messages.rssFailed);			
		}
	};
	// do uploadRss
	if(config.options.chkGenerateAnRssFeed) {
		var rssPath = uploadParams[1].substr(0,uploadParams[1].lastIndexOf(".")) + ".xml";
		var rssUploadParams = new Array(uploadParams[0],rssPath,uploadParams[2],'',uploadParams[4],uploadParams[5]);
		var rssString = generateRss();
		// no UnicodeToUTF8 conversion needed when location is "file" !!!
		if (document.location.toString().substr(0,4) != "file")
			rssString = convertUnicodeToUTF8(rssString);	
		bidix.upload.httpUpload(rssUploadParams,rssString,callback,Array(uploadParams,original,posDiv));
	} else {
		bidix.upload.uploadMain(uploadParams,original,posDiv);
	}
};

bidix.upload.uploadMain = function(uploadParams,original,posDiv) 
{
	var callback = function(status,params,responseText,url,xhr) {
		var log = new bidix.UploadLog();
		if(status) {
			// if backupDir specified
			if ((params[3]) && (responseText.indexOf("backupfile:") > -1))  {
				var backupfile = responseText.substring(responseText.indexOf("backupfile:")+11,responseText.indexOf("\n", responseText.indexOf("backupfile:")));
				displayMessage(bidix.upload.messages.backupSaved,bidix.dirname(url)+'/'+backupfile);
			}
			var destfile = responseText.substring(responseText.indexOf("destfile:")+9,responseText.indexOf("\n", responseText.indexOf("destfile:")));
			displayMessage(bidix.upload.messages.mainSaved,bidix.dirname(url)+'/'+destfile);
			store.setDirty(false);
			log.endUpload("ok");
		} else {
			alert(bidix.upload.messages.mainFailed);
			displayMessage(bidix.upload.messages.mainFailed);
			log.endUpload("failed");			
		}
	};
	// do uploadMain
	var revised = bidix.upload.updateOriginal(original,posDiv);
	bidix.upload.httpUpload(uploadParams,revised,callback,uploadParams);
};

bidix.upload.httpUpload = function(uploadParams,data,callback,params)
{
	var localCallback = function(status,params,responseText,url,xhr) {
		url = (url.indexOf("nocache=") < 0 ? url : url.substring(0,url.indexOf("nocache=")-1));
		if (xhr.status == 404)
			alert(bidix.upload.messages.storePhpNotFound.format([url]));
		if ((bidix.debugMode) || (responseText.indexOf("Debug mode") >= 0 )) {
			alert(responseText);
			if (responseText.indexOf("Debug mode") >= 0 )
				responseText = responseText.substring(responseText.indexOf("\n\n")+2);
		} else if (responseText.charAt(0) != '0') 
			alert(responseText);
		if (responseText.charAt(0) != '0')
			status = null;
		callback(status,params,responseText,url,xhr);
	};
	// do httpUpload
	var boundary = "---------------------------"+"AaB03x";	
	var uploadFormName = "UploadPlugin";
	// compose headers data
	var sheader = "";
	sheader += "--" + boundary + "\r\nContent-disposition: form-data; name=\"";
	sheader += uploadFormName +"\"\r\n\r\n";
	sheader += "backupDir="+uploadParams[3] +
				";user=" + uploadParams[4] +
				";password=" + uploadParams[5] +
				";uploaddir=" + uploadParams[2];
	if (bidix.debugMode)
		sheader += ";debug=1";
	sheader += ";;\r\n"; 
	sheader += "\r\n" + "--" + boundary + "\r\n";
	sheader += "Content-disposition: form-data; name=\"userfile\"; filename=\""+uploadParams[1]+"\"\r\n";
	sheader += "Content-Type: text/html;charset=UTF-8" + "\r\n";
	sheader += "Content-Length: " + data.length + "\r\n\r\n";
	// compose trailer data
	var strailer = new String();
	strailer = "\r\n--" + boundary + "--\r\n";
	data = sheader + data + strailer;
	if (bidix.debugMode) alert("about to execute Http - POST on "+uploadParams[0]+"\n with \n"+data.substr(0,500)+ " ... ");
	var r = doHttp("POST",uploadParams[0],data,"multipart/form-data; ;charset=UTF-8; boundary="+boundary,uploadParams[4],uploadParams[5],localCallback,params,null);
	if (typeof r == "string")
		displayMessage(r);
	return r;
};

// same as Saving's updateOriginal but without convertUnicodeToUTF8 calls
bidix.upload.updateOriginal = function(original, posDiv)
{
	if (!posDiv)
		posDiv = locateStoreArea(original);
	if((posDiv[0] == -1) || (posDiv[1] == -1)) {
		alert(config.messages.invalidFileError.format([localPath]));
		return;
	}
	var revised = original.substr(0,posDiv[0] + startSaveArea.length) + "\n" +
				store.allTiddlersAsHtml() + "\n" +
				original.substr(posDiv[1]);
	var newSiteTitle = getPageTitle().htmlEncode();
	revised = revised.replaceChunk("<title"+">","</title"+">"," " + newSiteTitle + " ");
	revised = updateMarkupBlock(revised,"PRE-HEAD","MarkupPreHead");
	revised = updateMarkupBlock(revised,"POST-HEAD","MarkupPostHead");
	revised = updateMarkupBlock(revised,"PRE-BODY","MarkupPreBody");
	revised = updateMarkupBlock(revised,"POST-SCRIPT","MarkupPostBody");
	return revised;
};

//
// UploadLog
// 
// config.options.chkUploadLog :
//		false : no logging
//		true : logging
// config.options.txtUploadLogMaxLine :
//		-1 : no limit
//      0 :  no Log lines but UploadLog is still in place
//		n :  the last n lines are only kept
//		NaN : no limit (-1)

bidix.UploadLog = function() {
	if (!config.options.chkUploadLog) 
		return; // this.tiddler = null
	this.tiddler = store.getTiddler("UploadLog");
	if (!this.tiddler) {
		this.tiddler = new Tiddler();
		this.tiddler.title = "UploadLog";
		this.tiddler.text = "| !date | !user | !location | !storeUrl | !uploadDir | !toFilename | !backupdir | !origin |";
		this.tiddler.created = new Date();
		this.tiddler.modifier = config.options.txtUserName;
		this.tiddler.modified = new Date();
		store.addTiddler(this.tiddler);
	}
	return this;
};

bidix.UploadLog.prototype.addText = function(text) {
	if (!this.tiddler)
		return;
	// retrieve maxLine when we need it
	var maxLine = parseInt(config.options.txtUploadLogMaxLine,10);
	if (isNaN(maxLine))
		maxLine = -1;
	// add text
	if (maxLine != 0) 
		this.tiddler.text = this.tiddler.text + text;
	// Trunck to maxLine
	if (maxLine >= 0) {
		var textArray = this.tiddler.text.split('\n');
		if (textArray.length > maxLine + 1)
			textArray.splice(1,textArray.length-1-maxLine);
			this.tiddler.text = textArray.join('\n');		
	}
	// update tiddler fields
	this.tiddler.modifier = config.options.txtUserName;
	this.tiddler.modified = new Date();
	store.addTiddler(this.tiddler);
	// refresh and notifiy for immediate update
	story.refreshTiddler(this.tiddler.title);
	store.notify(this.tiddler.title, true);
};

bidix.UploadLog.prototype.startUpload = function(storeUrl, toFilename, uploadDir,  backupDir) {
	if (!this.tiddler)
		return;
	var now = new Date();
	var text = "\n| ";
	var filename = bidix.basename(document.location.toString());
	if (!filename) filename = '/';
	text += now.formatString("0DD/0MM/YYYY 0hh:0mm:0ss") +" | ";
	text += config.options.txtUserName + " | ";
	text += "[["+filename+"|"+location + "]] |";
	text += " [[" + bidix.basename(storeUrl) + "|" + storeUrl + "]] | ";
	text += uploadDir + " | ";
	text += "[[" + bidix.basename(toFilename) + " | " +toFilename + "]] | ";
	text += backupDir + " |";
	this.addText(text);
};

bidix.UploadLog.prototype.endUpload = function(status) {
	if (!this.tiddler)
		return;
	this.addText(" "+status+" |");
};

//
// Utilities
// 

bidix.checkPlugin = function(plugin, major, minor, revision) {
	var ext = version.extensions[plugin];
	if (!
		(ext  && 
			((ext.major > major) || 
			((ext.major == major) && (ext.minor > minor))  ||
			((ext.major == major) && (ext.minor == minor) && (ext.revision >= revision))))) {
			// write error in PluginManager
			if (pluginInfo)
				pluginInfo.log.push("Requires " + plugin + " " + major + "." + minor + "." + revision);
			eval(plugin); // generate an error : "Error: ReferenceError: xxxx is not defined"
	}
};

bidix.dirname = function(filePath) {
	if (!filePath) 
		return;
	var lastpos;
	if ((lastpos = filePath.lastIndexOf("/")) != -1) {
		return filePath.substring(0, lastpos);
	} else {
		return filePath.substring(0, filePath.lastIndexOf("\\"));
	}
};

bidix.basename = function(filePath) {
	if (!filePath) 
		return;
	var lastpos;
	if ((lastpos = filePath.lastIndexOf("#")) != -1) 
		filePath = filePath.substring(0, lastpos);
	if ((lastpos = filePath.lastIndexOf("/")) != -1) {
		return filePath.substring(lastpos + 1);
	} else
		return filePath.substring(filePath.lastIndexOf("\\")+1);
};

bidix.initOption = function(name,value) {
	if (!config.options[name])
		config.options[name] = value;
};

//
// Initializations
//

// require PasswordOptionPlugin 1.0.1 or better
bidix.checkPlugin("PasswordOptionPlugin", 1, 0, 1);

// styleSheet
setStylesheet('.txtUploadStoreUrl, .txtUploadBackupDir, .txtUploadDir {width: 22em;}',"uploadPluginStyles");

//optionsDesc
merge(config.optionsDesc,{
	txtUploadStoreUrl: "Url of the UploadService script (default: store.php)",
	txtUploadFilename: "Filename of the uploaded file (default: in index.html)",
	txtUploadDir: "Relative Directory where to store the file (default: . (downloadService directory))",
	txtUploadBackupDir: "Relative Directory where to backup the file. If empty no backup. (default: ''(empty))",
	txtUploadUserName: "Upload Username",
	pasUploadPassword: "Upload Password",
	chkUploadLog: "do Logging in UploadLog (default: true)",
	txtUploadLogMaxLine: "Maximum of lines in UploadLog (default: 10)"
});

// Options Initializations
bidix.initOption('txtUploadStoreUrl','');
bidix.initOption('txtUploadFilename','');
bidix.initOption('txtUploadDir','');
bidix.initOption('txtUploadBackupDir','');
bidix.initOption('txtUploadUserName','');
bidix.initOption('pasUploadPassword','');
bidix.initOption('chkUploadLog',true);
bidix.initOption('txtUploadLogMaxLine','10');


// Backstage
merge(config.tasks,{
	uploadOptions: {text: "upload", tooltip: "Change UploadOptions and Upload", content: '<<uploadOptions>>'}
});
config.backstageTasks.push("uploadOptions");


//}}}

Key words: Belief Propagation, prior knowledge, complexity
Use a algorithm to retrieve the watermarks.
With precise prior knowledge, the algorithm would be fast and have ideal performance.
However, with illegal prior knowledge, the performance turns down.
In this way, we can add watermark using such algorithms.


Eg. 如果是需要知道Phi才能重建,那对于未授权者,我不告诉Phi,对授权者,告诉phi就能够解密了
!!Configuration
[[VIM右键多标签编辑配置]]

!!Command
[[Block Edit|VIM Block Edit]]
[[Copy&Paste|VIM Copy&Paste]]
[[Delete|VIM Delete]]
[[Encoding|VIM Encoding]]
[[Find and Replace|VIM Find and Replace]]
[[Format|VIM Format]]
[[Foward|VIM Forward]]
[[Search|VIM Search]]
[[Split screen|VIM Split Screen]]
[[Undo&Redo|VIM Undo&Redo]]
[[Compare Files|VIM Compare Files]]

!!Resources
[[VIM正则表达式]]

!!FAQ
[[What does ^->CTRL in VIM mean?]]
[[How to Comment up in vimrc?]]
[[How to turn off/on the backup function (~ file)?]]
在命令模式下,输入v 进入块编辑状态
#移动光标选定操作快
#c(cut), y(copy)
#p or P.
1. 使用vim的比较模式打开两个文件:
   vim -d file1 file2
或
   vimdiff file1 file2

2. 如果已经打开了文件file1,再打开另一个文件file2进行比较:
   :vert diffsplit file2
如果没有用vert命令,diffsplit则会分上下两个窗口。

3. 如果已经用split方式打开了两个文件file1,file2,又想比较两文件的不同。
   分别在两个窗口里面输入命令:
   :diffthis

4. 如果更改了某个窗口的内容,vim又没有自动更新diff检查,可以使用如下命令更新:
   :diffupdate

5. 定位到不同点:
   [c     跳到前一个不同点
   ]c     跳到后一个不同点

6. 在窗口间跳转:
   ctrl-w w    跳到下一个窗口
   ctrl-w h    跳到左侧窗口
   ctrl-w l    跳到右侧窗口
   ctrl-w j    跳到下方的窗口
   ctrl-w k    跳到上方的窗口

7. 合并文档:
   dp          将差异点的当前文档内容应用到另一文档(diff put)
   do          将差异点的另一文档的内容拷贝到当前文档(diff get)

8. 上下文的展开和查看
    比较和合并文件的时候经常需要结合上下文来确定最终要采取的操作。Vimdiff 缺省是会把不同之处上下各 6 行的文本都显示出来以供参考。其他的相同的文本行被自动折叠。如果希望修改缺省的上下文行数为3行,可以这样设置:
    :set diffopt=context:3

可以用简单的折叠命令来临时展开被折叠的相同的文本行:

    zo          (folding open, z这个字母看上去比较像折叠的纸)

然后可以用下列命令来重新折叠:

    zc          (folding close)
>yy
>p
{{{
    yy : copy 光标所在的行
  nyy: copy n line
    yw: copy 光标所在的单词
  nyw: copy 光标所在位置到其后的n 个单词(未必是同一行)
    y$:  copy 光标所在位置到行尾($是行尾的标示)
  ny$:  copy 光标所在位置之后的n行(包括当前行,当前行=y$)
      p:  paste 在光标所在位置之右
      P: --------------------------------左
}}}

任务:将第9行至第15行的数据,复制到第16行
方法1:(强烈推荐)
:9,15 copy 16  或 :9,15 co 16
由此可有:
:9,15 move 16  或 :9,15 m 16 将第9行到第15行的文本内容到第16行的后面  

方法2:
光标移动到结束行,ma
光标移动到起始行,输入y'a
光标移动到需要复制的行,输入p,行前复制则输入大写P

方法3:
把光标移到第9行 shift + v (enter VISUAL mode)
再把光标移动到第15行 (hold shift) 
ctrl + c
move the 光标 to line 16:  p mysql

方法4:
光标移动到起始行,输入ma
光标移动到结束行,输入mb
光标移动到粘贴行,输入mc
然后输入:'a,'b, co 'c   把co换成m就是剪切
若要删除多行,则输入:'a,'b de
delete, 和[[copy|VIM Copy&Paste]] 类似
{{{
    dd : delete current line
  ndd:  delete n line
    dw: delete current word
  ndw: delete n word
    d$ : delete to the end of line.
  nd$ : delete n line. (current line = d$)
       x: delete one character(无论是ascii 还是unicode)
     nx: delete n characters.
}}}
Ref: http://blog.yzlin.org/2007/12/12/3/
{{{
set encoding = utf-8
}}}
Ref: http://wdicc.com/search-in-vim/
eg. Replace abc with 123
> %s/abc/123/g
gg=G
foward by word: w
foward to [X]: fX
delete from here to [X]: dfX
copy from here to [X]: yfX
cut from here to [X]: xfX
Find Next(down): n
Find Next(up): N
> :sp
use ctrl+tab to switch screen
    u: undo
    U: 取消最近一行的改动
    crtl +r: redo
    e!: 放弃所有改动,重新编辑
gvim能否只开一个窗口,每次在终端“gvim 文件名”的时候就自动在这个窗口新开一个tab page来打开文件? 
这样桌面简洁很多,就像windows下用UltraEdit一样。可以在gvim中用:tabnew :e,但太麻烦了。 

这样做: 
{{{
gvim   --remote-tab-silent  filename
}}}

linux下 
为了方便可以在.bashrc中加入
{{{
alias vim='gvim --remote-tab-silent'
alias gvim='gvim --remote-tab-silent'
}}}

windows 下要分2步: 
    1) 双击时打开标签页 
{{{
修改注册表:/HKEY_CLASSES_ROOT/Applications/gvim.exe/shell/edit/command的值 
C:\Program Files\Vim\vim70\gvim.exe -p --remote-tab-silent "%1"
}}}
    2)鼠标右键时打开标签页 
             打开注册表,添加以下项:
{{{
[HKEY_CLASSES_ROOT\*\]下添加Shell项      
[HKEY_CLASSES_ROOT\*\Shell] 下添加Edit with &Vim项
[HKEY_CLASSES_ROOT\*\Shell\Edit with &Vim] 添加command项
[HKEY_CLASSES_ROOT\*\Shell\Edit with &Vim\command]修改默认值
为"D:\Program Files\Vim\vim73\gvim.exe" -p --remote-tab-silent "%1"
}}}
退出注册表,右键显示Edit with Vim
元字符 说明 
. 匹配任意一个字符 
[abc] 匹配方括号中的任意一个字符。可以使用-表示字符范围,
      如[a-z0-9]匹配小写字母和阿拉伯数字。 
[^abc] 在方括号内开头使用^符号,表示匹配除方括号中字符之外的任意字符。 
/d 匹配阿拉伯数字,等同于[0-9]。 
/D 匹配阿拉伯数字之外的任意字符,等同于[^0-9]。 
/x 匹配十六进制数字,等同于[0-9A-Fa-f]。 
/X 匹配十六进制数字,等同于[^0-9A-Fa-f]。 
/w 匹配单词字母,等同于[0-9A-Za-z_]。 
/W 匹配单词字母之外的任意字符,等同于[^0-9A-Za-z_]。 
/t 匹配<TAB>字符。 
/s 匹配空白字符,等同于[ /t]。 
/S 匹配非空白字符,等同于[^ /t]。 
/a 所有的字母字符. 等同于[a-zA-Z]
/l 小写字母 [a-z]
/L 非小写字母 [^a-z]
/u 大写字母 [A-Z]
/U 非大写字母 [^A-Z]
 
表示数量的元字符 
元字符 说明 
* 匹配0-任意个 
/+ 匹配1-任意个 
/? 匹配0-1个 
/{n,m} 匹配n-m个 
/{n} 匹配n个 
/{n,} 匹配n-任意个 
/{,m} 匹配0-m个 
/_. 匹配包含换行在内的所有字符
/{-} 表示前一个字符可出现零次或多次,但在整个正则表达式可以匹配成功的前提下,匹配的字符数越少越好
/= 匹配一个可有可无的项
/_s 匹配空格或断行
/_[]
 
元字符 说明 
/* 匹配 * 字符。 
/. 匹配 . 字符。 
// 匹配 / 字符。 
// 匹配 / 字符。 
/[ 匹配 [ 字符。 
 
表示位置的符号 
元字符 说明 
$ 匹配行尾 
^ 匹配行首 
/< 匹配单词词首 
/> 匹配单词词尾 
 
替换变量 
在正规表达式中使用 /( 和 /) 符号括起正规表达式,即可在后面使用/1、/2等变量来访问 /( 和 /) 中的内容。
 
懒惰模式
/{-n,m} 与/{n,m}一样,尽可能少次数地重复
/{-} 匹配它前面的项一次或0次, 尽可能地少
/| "或"操作符
/& 并列
 
 
函数式
:s/替换字符串//=函数式
在函数式中可以使用 submatch(1)、submatch(2) 等来引用 /1、/2 等的内容,而submatch(0)可以引用匹配的整个内容。
 
与Perl正则表达式的区别 ?
元字符的区别
Vim语法 Perl语法 含义 
/+       +       1-任意个 
/?       ?       0-1个 
/{n,m}   {n,m}   n-m个 
/(和/)   (和)    分组 
 
例如:
1,去掉所有的行尾空格:“:%s//s/+$//”。“%”表示在整个文件范围内进行替换,“/s”表示空白字符(空格和制表符),“/+”对前面的字符匹配一次或多次(越多越好),“___FCKpd___0rdquo;匹配行尾(使用“/___FCKpd___0rdquo;表示单纯的“___FCKpd___0rdquo;字符);被替换的内容为空;由于一行最多只需替换一次,不需要特殊标志。这个还是比较简单的。(/<Space><Tab>) 
2,去掉所有的空白行:“:%s//(/s*/n/)/+//r/”。这回多了“/(”、“/)”、“/n”、“/r”和 “*”。“*”代表对前面的字符(此处为“/s”)匹配零次或多次(越多越好;使用“/*”表示单纯的“*”字符),“/n”代表换行符,“/r”代表回车符,“/(”和“/)”对表达式进行分组,使其被视作一个不可分割的整体。因此,这个表达式的完整意义是,把连续的换行符(包含换行符前面可能有的连续空白字符)替换成为一个单个的换行符。唯一很特殊的地方是,在模式中使用的是“/n”,而被替换的内容中却不能使用“/n”,而只能使用“/r”。原因是历史造成的,详情如果有兴趣的话可以查看“:help NL-used-for-Nul”。 
3,去掉所有的“//”注释:“:%s!/ s*//.*!!”。首先可以注意到,这儿分隔符改用了“!”,原因是在模式或字符串部分使用了“/”字符,不换用其他分隔符的话就得在每次使用“/”字符本身时写成“//”,上面的命令得写成“:%s//s*////.*//”,可读性较低。命令本身倒是相当简单,用过正则表达式的人估计都知道“.”匹配表示除换行符之外的任何字符吧。 
4,去掉所有的“/* */”注释:“:%s!/s*//*/_./{-}/*//s*! !g”。这个略有点复杂了,用到了几个不太常用的 Vim 正则表达式特性。“/_.”匹配包含换行在内的所有字符;“/{-}”表示前一个字符可出现零次或多次,但在整个正则表达式可以匹配成功的前提下,匹配的字符数越少越好;标志“g”表示一行里可以匹配和替换多次。替换的结果是个空格的目的是保证像“int/* space not necessary around comments */main()”这样的表达式在替换之后仍然是合法的。 
 
:g/^/s*$/d    删除只有空白的行
:s//(/w/+/)/s/+/(/w/+/)//2/t/1   将 data1 data2 修改为 data2 data1
:%s//(/w/+/), /(/w/+/)//2 /1/    将 Doe, John 修改为 John Doe
:%s//<id/>//=line(".")   将各行的 id 字符串替换为行号
:%s//(^/</w/+/>/)//=(line(".")-10) .".". submatch(1)    
    将每行开头的单词替换为(行号-10).单词的格式,如第11行的word替换成1. word
排序 :/OB/+1,$!sort
<!--{{{-->
<div class='toolbar' macro='toolbar [[ToolbarCommands::ViewToolbar]]'></div>
<div class='title' macro='view title'></div>
<div class='subtitle'><span macro='view modifier link'></span>, <span macro='view modified date'></span> (<span macro='message views.wikified.createdPrompt'></span> <span macro='view created date'></span>)</div>
<div class='tagged' macro='tags'></div>
<div class='viewer' macro='view text wikified'></div>
<div class='tagging' macro='tagging'></div>
<div class='tagClear'></div>
<!--}}}-->
!save as eps
[[Visio: save as eps]]

!!! big bracket
{{{
形状:其他visio方案—>标注
}}}
#install PDFCreator
#In Visio 2003, print your illustration to the PDFCreator, but first remember to click on the “Properties” button on the print dialog, then “Advanced”, “PostScript Options”, set “PostScript Output Option” to “Encapsulated PostScript (EPS)”.
#In the PDFCreator dialog that appears after you’ve clicked on “print”, select “Options” then section “Ghostscript” and UNcheck the “Use Windows fonts” checkbox.
#Save as EPS (and not PDF).
Solution:AndroidManifest.xml:
add between <manifest> </manifest>
{{{
<uses-sdk android:minSdkVersion="3"></uses-sdk>
}}}
!!!History Report
10-27
见周报告

plus:
【phi的问题】
l和r的设计见注释
现象:r越小,错误率越小?why?
不是应该m越大,错误率越小么?


10-28
download 'CS via BP'的仿真源码,为了重现仿真
想要看一下这篇文章做的误码率是控制在什么范围里的

仍然会使用NBP来进行仿真,新的代码比较规范~

sims1c.m的仿真结果,即paper中的figure 3(第一幅仿真图)
1) increasing M reduces the decoding error,
until it reaches the energy level of the small coefficients
图中的两条虚线分别表示: norm(x, 2)和norm(small_coeff, 2)
2) 行重L小,会Miss some of the large coefficients -> bad for decoding
   行重L越大,得到相同precision所需的M越少
   但是,实验测得是L .= 2/S = 20时是最优的 (S=0.1稀疏度)
   L > 20时,会大致divergence, even with damping
   (说是实际上测量矩阵A和BP并不能保证收敛,而只有特定的测量矩阵才能保证收敛)
   -> 对L的要求


想法:
仍然用gen_noisy来生成x,然后给出一个阈值,使得x为二进制?

10-29
1)
好像是因为norm太小,导致会Divergence- -
观测结果显示,norm(x)必须要大于4才行

2)
实验结果显示,在sigma_1 = 1, sigma_0 = 0.01时,将threshod = 0.1符合稀疏度
原因没有进行验证,但这一个结果足够仿真所需的信息

3)
n = 200
iter = 10时,k = [20 - 25], msr = 100	能够无失真恢复

			k = 30时,增大iter也无法无失真恢复,divergence
			
							msr = 200,Iter增大能使误码率降低
			
			k = 40, msr = 200 无失真恢复
小结:在Iter = 10的情况下, msr = 5 * k; 即n * r / l = 5 * k;
	  文章说l=20为最优,所以n * r = 100 * k, r = 100 * k / n;
	  测试了几组数据
	  iter = 10 => [n k r] = [200 20 10], [200 40 20] 无失真
	  iter = 20 => [n k r] = [400 20 10] 误码率1/400 
	  						 [400 40 20] 误码率41/400
	  						 => l和k保持一致是最好的?
	  						 [800 20 10] 误码率156/800 =>所以l和k不是保持一致最好;
	  						 					  	或者是因为Pdf_prior没有给对
	  						 					  		pdf_prior如果设成bernulli分布,就要去研究一下shiftpdf_fft这个函数,是以高斯来模拟从而移动均值,还是?
	  						 					  		
	  						 					  		
10-31
1. shiftpdf就是在变换均值,要测试的时候需要注意:
xx的范围要大一点,如pdf是[0.1 0.2 0.4 0.2 0.1],常规是xx=-2:2就够了
但是要保证不会移出界,要先有pdf的index范围要包含offset + xx,才不会出错

2. 在上一次的小结中,x是{0 1}的信号
	这次换成{0, -1, 1}的信号
	测试数据
	[n k r]	= [400 40 20]4/400	 (iter = 10) (iter = 20时,divergence,误码率大) (l=20)
									(l=40时,无失真 => l = k最优?)
			****************验证l=k最优************
			= [500 50 25] l=50 无失真
			***************************************
			= [500 50 20] 失真大 => k : r = 2 : 1? or k : msr > or = 1 : 5?
			##################
			= [200 20 10] => k : msr = 20 : 100 = 1:5	O (有的时候会divergence)
			= [200 20 15] => k : msr = 20 : 150 = 1:7.5 O
			= [200 20 5]  => k : msr = 20 : 50  = 1:2.5 x
			##################;
			
			
3. 参考了GPSR,根据文章中的fig 1,发现它也不能恢复出0,1的幅度,只能Locate。
	但是Debias以后,这种情况能够改善。
	=>
	1) BP恢复可以用现在的方法,恢复mrecon以后用threshold判决
	2) 研究过程中,如果能找到类似GPSR中debias的方法,就更好了


小结:当前情况,能够成功的数据是:
	x {0, -1, 1} threshold = 0.1
	l = 20
	[n k r] = [400 40 20]
			= [200 20 >=10]

			 
4. <BCS via BP>再次阅读
1)
Seeger and Nickisch [26] extend these ideas to experimental design, where the encoding matrix is designed sequentially based
on previous measurements. Another Bayesian approach by Schniter et al. [27] approximates
conditional expectation by extending the maximal likelihood approach to a weighted mixture
of the most likely models. There are also many related results on application of Bayesian
methods to sparse inverse problems (c.f. [28] and references therein)
<BCS via BP>的[26]-[28],估计以后能够用到,关于encode mtx的东西

2)
搜索一下[36]这篇文章,讲得是LDLC用BP恢复的,有用!
N. Sommer, M. Feder, and O. Shalvi, “Low-density lattice codes”
讲了factor graph等


3)
M = O(K log(N)) => n = 200, k = 20 -> m = O(14*20) = O(280)?
这里能否得到一些关于M的计算方法,从而得到r的计算方法?

4)
l的取法,可以用sparsity
The row weight L can be chosen based on signal properties such as sparsity, possible measurement noise, and details of the
decoding process.

5)
记得好像说如果只要知道state会更简单,找到这个解释。
能不能用state然后模拟信号源,然后译码后由计算state?
复杂化?但是准确? -> 仿真测试
Second, if we are only interested in an estimate of the state configuration vector q but not in the coefficient
values, then less information must be extracted from the measurements. Consequently,
the number of measurements can be reduced.

6)
As long as S = K/N = Omega((sigma0/sigma1)~2) => then M = O(K log(N)) measurements are sufficient					
对K的要求,K/N = Omega((sigma0/sigma1)~2),所以仿真中有要求- -
Omega是个什么函数?

7)
文章给出了根据实验结果得到的l, k, r的设置
L ≈ S~(-1) = N/K, M = O(K log(N)), and R = LM/N = O(log(N))



11-1
1. phi的sign必须是{0, 1, -1}
测试如果只有{0, 1}是不行的,无法恢复

2. 信号源的生成已经可以仿真了

3. G和Phi的生成
按照paper生成G的方法,没有办法保证G有固定的行重和列重
不知道如何仿真?
!!!uint8 -> bits in Simulink
Caz the turbo encoder require binary inputs, the input sequence should in bits form.
But the Simulink cannot convert the uint8 to bits by any exisiting block.
The video compression demo uses a Matlab function to generate bits stream.
However, the project cannot use Matlab function.
Three possible solutions:
#Use matlab functions to generate bits as in the video compression demo
#Ignore the Turbo coder
#Use blocks to construct a uint8->bits block
The first choice is the easiest.
The second and the third choice are depend on whether Chris implemented the Huffman coding block. If so, it can be done in similarily way. If not, we may need to ignore the bit stream converter portion.

For the first solution, I use bitpack and bitunpack block in "vidoe compression" demo.
However, it requires Microsoft Visual 2008 to support the compiler. (64 bits)
To troubleshoot this issue, please type 'which –all pathdef.m' at the MATLAB prompt. The topmost line of the output represents the 'pathdef.m' file which is used by MATLAB.

If the topmost line in the output is NOT \$matlabroot\toolbox\local\pathdef.m (where \$matlabroot is the output of typing 'matlabroot' at the MATLAB prompt), then it means that the 'pathdef.m' which is being used by MATLAB was not updated by the installer and the directory structure of MATLAB-code was changed since the previous version of MATLAB. 
This document is a ~TiddlyWiki from tiddlyspot.com.  A ~TiddlyWiki is an electronic notebook that is great for managing todo lists, personal information, and all sorts of things.


exit: ^C represent CTRL+C
<<tiddler SiteTitle>> - <<tiddler SiteSubtitle>>
!!Problem&Solution
[[光驱盘符不显示]]
[[Lenovo Thinkpad 重装系统后无法一键还原(创建恢复介质)]]
[[CHM无法显示页面]]
[[Adobe Acrobat, cannot create PDF from files]]
[[怎样清除Windows 7系统搜索记录?]]

!!Configuration&Command
[[视频网站]]
[[Auto git bat]]
[[Proxy Setting Command Line]]
[[眼睛保护色]]
[[在右键菜单中添加“在此处打开命令行”]]
升级到 Git-1.7.4-preview20110204.exe 后,文件夹的右键菜单“Git Bash Here”变成了"git_shell",
而且点击后总报无法找到关联的程序错误,无法直接进入当前文件夹的git控制台,使用起来觉得很不方便,修正方法如下: 
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\git_shell]
"Git Ba&sh Here"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\git_shell\command]
wscript "d:\Git\Git Bash.vbs" "%1"
如果你的右键菜单中的"Git GUI Here"也出现问题,可以参考如下方法修正:
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\git_gui]
"Git &GUI Here"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell\git_gui\command]
"d:\Git\bin\wish.exe" "d:\Git\libexec\git-core\git-gui" "--working-dir" "%1"
注:上述修正方法中的Git安装路径需要修改为你自己实际的安装路径。
!! 加载项
[[Word中acrobat转Pdf文件标签丢失COM加载项被卸载]]

!! 分隔符 页码
[[尾注后面加正文]]
[[Word 2007中添加分节符位置]]
[[设置不同分节的页码]]


!! 编号
[[公式编号]]
[[图的编号自动更改题注章节编号格式“图一.1”为“图1.1”]]

!! 页面显示
[[显示/隐藏 分页符等特殊符号]]

!! 论文参考文献的操作
[[Word 2007中的论文参考文献的操作]] Refer to http://www.zhixing123.cn/Word/7673.html
[[给尾注编号加方括号的简单方法]]
操作步骤如下:  

    (1)启动Word 2007,在工具栏上单击鼠标右键。 
  
    (2)在弹出的快捷菜单中选择“自定义快速访问工具栏……”。  

    (3)在打开的对话框中,选择左边的“自定义”,在“从下列位置选择命令”下拉列表中选择“常用命令”。  

    (4)用鼠标双击“插入分页符和分节符”,添加到快速工具栏中, 设置完后单击“确定”按钮即可。
''第一步:''
[img[http://www.zhixing123.cn/uploads/allimg/100930/2156005951-0.jpg]]


''第二步:''
[img[http://www.zhixing123.cn/uploads/allimg/100930/215600F46-1.jpg]]

''第三步:''
[img[http://www.zhixing123.cn/uploads/allimg/100930/2156003D6-2.jpg]]

插入参考文献之后会发现没有 [ ] ,
用word的特殊字符将尾注编号替换为带方括号格式的[1],[2],[3]即可,当然也可以替换为:<>{}《》等格式。
具体操作办法如下:
如果用了尾注就查找尾注标记^e,然后全部替换为[^&]即可;
如果用了脚注就查找脚注标记^f ,再全部替换为[^&]便可以了(注意查找时让“不限定格式”按钮为灰色)。
OR
会发现尾注中序号是上标,网上我找到2中方法:
1、选中序号按快捷键“ctrl+shift+=”就可以使序号不再是上标;
2、用鼠标右击,出现一菜 单,选择“字体”,在第二张菜单中去掉“效果”栏中“上标”前面的“√”。我用的方法是删除之后统一加编号,比较整洁:

''第四步:''
[img[http://www.zhixing123.cn/uploads/allimg/100930/215600N19-4.jpg]]

现在参考文献就弄好了,但是论文格式要求参考文献在正文之后,参考文献后还有发表论文情况说明、附录和致谢,而Word的尾注要么在文档的结尾,要么在“节”的结尾,这两种都不符合我们的要求。 怎么办?

''第五步:''
选中尾注→
[img[http://www.zhixing123.cn/uploads/allimg/100930/215600J07-7.jpg]]

''第六步:把光标放在要插入参考文献的位置''
[img[http://www.zhixing123.cn/uploads/allimg/100930/21560030c-8.jpg]]

''第七步:''
[[Word2007删除尾注分隔线]]
Word 2007尾注上面的横线叫“××分隔符”,去掉的步骤是:

1. 先“视图”? “普通视图”;

2. 进入“引用”?“脚注”?“显示备注”;

3. 窗口下面出现了“尾注”,点击下拉菜单“所有尾注”那里;

4. 选“尾注分隔符”,删掉那个横线;

5. 选“尾注延续分隔符”,再删掉那个横线,搞定。

对于脚注上面的横线也这么删。
# 在word选项里查看加载项,在“管理”框中,单击“com加载项”,
# 然后单击“转到…”,在弹出的“com加载项”中
## 如果列出了“acrobat pdfmaker office com addin”项就先“删除”它,
## 如果没有就直接“添加”,
# 在“添加加载项”的打开对话框中定位到c:\\program files\\adobe\\acrobat 9.0\\pdfmaker\\office\\pdfmofficeaddin.dll,
# 然后单击“确定”。
到此,应该就能够在工具栏最后看到acrobat工具栏了。尝试直接使用此工具栏进行导出pdf,成功。
Let $F_1, F_2, \ldots, F_N$ be the frames of the video sequences. We consider the even frame, $F_{2i}$, as the Wyner-Ziv frame, which is encoded independently of the key frames and the other Wyner-Ziv frames. The pixel-domain Wyner-Ziv video codec with intraframe encoder and intrerframe decoder is shown in Fig.4.1[Ref: DVC]. It consists of: 1) scalar quantizer, 2) Slepian-Wolf Codec with Turbo encoder, buffer, and Turbo decoder, 3) reconstruction. We leave the third part, reconstruction, for the next section.
The Wyner-Ziv frames proposed in [Ref: DVC]are encoded as follows:
# uniformly quantize the frame in pixel domain, with $2^M$ levels, to form the quantized symbols stream $q_{2i}$
# each symbol block is then sent to the Slepian-Wolf encoder
# the Slepian-Wolf coder uses a rate compatible punctured turbo(RCPT) code
# the RCPT encoder stores the punctured parity bits with different puncture map in the buffer, and send a subset of these parity bits
# the RCPT decoder uses the received parity bits and side information from Side Information Generator(will be discussed in next section) to decode the Wyner-Ziv frame
# if the error rate is beyond the threshold, request more parity bits from RCPT encoder via a feedback channel
# repeat step4-6 until an acceptable probability of symbol error is guaranteed
However, the feedback channel would result in a higher latency. And the decode-and-request process has to be performed while the video is being encoded. Thus, in our system, we use a simple version of the Slepian-Wolf coder. That is, we use a punctured turbo code, instead of RCPT. We use a fixed punctured map, and send the parity bits only once, no matter the decoded error rate. On the other hand, our system uses bit plane to encode each frame, instead of directly encoding the whole frame. This would reduce the time and improve the performance of the decoder. And we process each 8x8 block in one frame, instead of the whole frame.

1. Scalar Quantizer
The Simulink model of scalar quantizer is shown in Fig. 4.2. The quantization interval in our system is 16. Since the pixel value ranges from 0 to 255, so the quantized index ranges from 0 to 15. In this way, we need 4 bits to represents each value.
2. Slepian-Wolf Encoder
The Simulink model of Slepian-Wolf encoder is shown in Fig. 4.3. 
2.1 Bit Plane
"A bit plane is a digital discrete signal is a set of bits having the same position in the respective binary numbers."[Ref. http://en.wikipedia.org/wiki/Bit_plane]. For example, a 8-bit data representation has 8 bit-planes: the first bit-plane contains the set of the most significant bit and the last bit-plane contains the least significant bit. In our system, for each block, we have 4 bit planes. Each bit plane would be sent to a punctured turbo encoder indepently.
2.2 Punctured Turbo Encoder
We use punctured turbo coder to encode each bit plane. The turbo encoder consists of two 1/2 convolution encoder, with one encoding the orignial bit stream, and the other one encoding the bit stream after random interleaver. Then we only use the parity bits. Since each bit plane has 64 elements, so the length of the parity bits before puncture is 128. Then we use a puncture map to get the punctured parity bits. The puncture process is actually get a subset of the parity bits. Then the punctured parity bits are sent to the receiver via the channel.
3. Slepian-Wolf Decoder
The Slepian-Wolf decoder first do the same thing on the side information with the Slepian-Wolf encoder. That is, uniformly scalar quantization, and translate the symbols to bits. Then the turbo decoder the the received parity bits and side information to decode the Wyner-Ziv frame. The APP decoder is used to perform a MAP decoding. After that, the Slepian-Wolf decoder convert the bits stream into symbols. And send it to the reconstruction block. The Simulink block is shown in FIg. 4.4.
refer: http://bbs.gfan.com/android-288313-1-1.html
1. 下载SuperOneClickv1.5.5-ShortFuse (我用1.5.1版本的不行好像。。用1.5.5版本的成功了~)
2. 
1) (对VISTA系统)解压以后,点击右键,管理员获得所有权限
2)SuperOneClick.exe adb.exe两个文件,点右键,属性,兼容性,用兼容模式XP SP2;
然后还有显示所有用户设置,兼容模式XP SP2
3)右键SuperOneClick.exe,以管理员身份运行。
3. 
去掉USB调试
开启电脑里的 SuperOneClick 1.5.5, 按ROOT
当它显示:Waiting for Device, 勾起 USB调试
它会显示: RTAC(r........cage)
当它显示:Starting ADB Server...
马上去掉USB调试
马上勾起USB调试
马上去掉USB调试
全部都要在它显示“Waiting for device..." 之前弄好
note:这个步骤很重要。。反正一开始我弄了很久,都没在waiting for device之前弄好,然后不断重新重复3(重开软件),
然后一下就ok了
No driver- -
Download: http://developer.sonyericsson.com/wportal/devworld/downloads/download/dw-x10drivers?cc=gb&lc=en
系统要求:
android 2.3.3

准备工作:
下载 [[Flashtool0.4.2.0.rar|http://115.com/file/dneeme71#]]

Root
# 安装驱动 
## 解压缩 flashtool/drivers 中的~X10_ADB_drivers.zip
## 设备管理器-> X10 (未知USB设备)-> 更新驱动 (选择文件夹 Flashtool -> drivers)
# 打开~X10FlashTool.exe
# 手机设置 未知来源 (设置->应用程序)和 USB调试,保持唤醒(设置->应用程序->开发)
# 连接手机
# 等待Root图标亮起 点击ROOT
# 期间会重启 
# 显示'root access allowed',表示root成功

图文教程可以参考:http://sebbs.cnmo.com/thread-10614705-1-1.html

FAQ:
*Root图标不亮起是为什么?
检查驱动是否安装成功(按照步骤1)
*刷机失败 启动时一直卡在开机画面
如果驱动没有安装正确,或者没有开启未知来源和USB调试,或者使用低版本的~FlashTool,都有可能出现该情况
可以用update service(SE提供的更新软件 升级过系统的人应该都知道)重新更新一遍就好了

关机后按住返回键连接电脑时 设备管理器无法检测到设备
原因:PC Companion的驱动未完全装好
解决:
安装update service (Android 2.3暂时不提供X10下载update service 可以使用以前版本的update service)
待其装好驱动后 再使用pc companion升级即可
refer: http://bbs.gfan.com/android-302047-1-1.html 论坛账号:wingwings
1. 按照上面的步骤ROOT一下
2.打开R.E浏览器
3.进入/system/build.prop
4.点击右上角的只读,变为可写.
5.长按build.prop.拖动菜单到下方选择文本编辑器打开打开
6.修改如下图红色文本为你要升级的版本号.
修改红色方框里的2个内容为6286(港版号).
即ro.product.name=X10i_1234-xxxx
ro,semc.version.cust=1234-xxxx
把xxxx改成6286
绿色方框内可改可不改.没改一样成功
即ro.build.fingerprint=SEMC/X10i_1234-xxxx
修改完后切记点MENU-保存更改.
7.退回到"/"文件夹 (就左上角的按钮按一下)
8.进入\etc\customization\settings
9.同上,用文本编辑器打开cust.prop,修改里头的唯一一行数字为港版6286.如上图.
10. 完成后重启手机.重启完成后再关机 note:要关机->开机->关机 这样的步骤
11.打开US.一路点下一步到X10提示插入手机 (提示最新版本依旧不理他.选择右下角的开始)
请备份好手机里头的联系人号码.
12.点住返回键不放,然后插入USB线(依提示做)
13.提示升级.
总的步骤 Root权限->改default.prop ->用US升级

1. Root 权限
下载UniversalAndroot,安装
Refer: http://bbs.gfan.com/android-187541-1-1.html
打开软件,root后,看到有个新图标superpermission,表示安装好了
之后要使用root权限的时候,手机会自己跳个ALLOW的确认框

2. 改default.prop
下载rootexplorer.2.12.4H,安装
Refer:http://www.hiapk.com/thread-604264-1-1.html
修改system/default.prop(切换到读写模式,然后长按,选择编辑模式)
ro.semc.version.cust=XXXX-XXXX
以及ro.product.name=X10_XXXX-XXXX
两行中的XXXX-XXXX改成你需要区域代码(CDA)然后关机重启 就会出现升级提示了
(港行CDA1234-6286)
note: 必须关机重启,然后确认一下刚才两个地方是否修改该成功,然后再关机。
若不重启,会升级失败,即升级到国行。。 

3.用官网的US(update service)更新
网速慢的话会很慢。。
先要同步,然后是下载。
但是支持断点哦~这个还是不错的。。不用重新来。。
然后根据提示就好了~

升级后就是港行的啦,哈哈,有GOOGLE的服务,也有新浪微博啥的~超爽啊~
;ROC(Region of Convergence)
:to ensure the inverse Z transform unique, the ROC must be given. E.g. X(z) = z/(z-a), if |z|>|a| => x(n) = (a^n)u(n); if |z|<|a|, x(n) = -(a^n)u(-n-1)
!!!!Relationship between FT and ZT
For Z Transform, z can be valued from its ROC. For DTFT, z can only be valued on the unit circle.
* Thus,if ROC doesn't include the unit circle, the FT does not exist.
use 'adb devices' to get a list of devices connected
then 'adb -s devicename shell'
{{{
ALTER TABLE adword ADD CONSTRAINT uc_adword UNIQUE (user_id);
}}}
addEventListener的参数一共有三个,语法为:
element.addEventListener(type,listener,useCapture)
下面是详解
其中element是要绑定函数的对象。
type是事件名称,要注意的是"onclick"要改为"click","onblur"要改为"blur",也就是说事件名不要带"on"。
listener当然就是绑定的函数了,记住不要跟括号
最后一个参数是个布尔值,表示该事件的响应顺序,下面重点介绍一下addEventListener的第3个参数(useCapture)。

userCapture若为true,则浏览器采用Capture,若为false则采用bubbing方式。建议用false,看个例子吧。
html代码
<div id="div_test"> <input type="button" id="btn_test" value="se4.cn技术基地" /> </div>
js代码
window.onload=function(){ document.getElementById("div_test").addEventListener("click",test1,false); document.getElementById("btn_test").addEventListener("click",test2,false); } function test1(){ alert("外层div触发") } function test2(){ alert("内层input触发") }
自己体验一下,如果userCapture是true则test1先触发,如果userCapture是false则test2先触发。
In linear algebra, the adjugate or classical adjoint of a square matrix is a matrix that plays a role similar to the inverse of a matrix; it can however be defined for any square matrix without the need to perform any divisions. http://en.wikipedia.org/wiki/Adjugate_matrix
{{{
ALTER TABLE adword MODIFY adid INT(11);
}}}
#An anti-aliasing filter is a filter used before a signal sampler, to restrict the bandwidth of a signal to approximately satisfy the sampling theorem. 
#The sampling theorem states that ''__unambiguous interpretation__'' of the signal from its samples is possible when ''__the power of frequencies above the Nyquist frequency is zero__''
# A real anti-aliasing filter can generally not completely satisfy the theorem. A realizable anti-aliasing filter will typically permit some aliasing to occur; the amount of aliasing that does occur depends on how good the filter is and what the frequency content of the input signal is.
#Anti-aliasing filters are commonly used at the input of digital signal processing systems, for example in sound digitization systems; similar filters are used as reconstruction filters at the output of such systems, for example in music players. 
# In the later case, the filter is to prevent aliasing in the conversion of samples back to a continuous signal, where again perfect stop-band rejection would be required to guarantee zero aliasing.
#The theoretical impossibility of realizing perfect filters is not much an impediment in practice, though practical considerations do lead to system design choices such as oversampling to make it easier to realize "good enough" anti-aliasing filters.
在IE中iframe或者frame的contentWindow属性可以省略,但在Firefox中如果要对iframe对象进行编辑则

必须指定contentWindow属性。
//{{{
function EnableEdit()
{
     var editor;
     editor = document.getElementById("HtmlEdit").contentWindow;
  // 针对IE浏览器, make it editable
     editor.document.designMode = 'On';
     editor.document.contentEditable = true;
  // For compatible with FireFox, it should open and write something to make it work
 editor.document.open();
 editor.document.writeln('<html><head>');
 editor.document.writeln('<style>body {background: white;font-size:9pt;margin: 2px; padding: 0px;}</style>');
 editor.document.writeln('</head><body></body></html>');
 editor.document.close();

}

<iframe  ID="HtmlEdit" MARGINHEIGHT="1" MARGINWIDTH="1" width="100%" height="312">
</iframe>
//}}}
 

 
//{{{
<html>
<body>
<script>
var ifr = document.createElement("iframe");
document.body.appendChild(ifr);
var ifrdoc = ifr.contentWindow.document;
var s = fixingHTB.innerHTML;  //进入可编辑模式前存好
ifrdoc.designMode = "on";    //文档进入可编辑模式
ifrdoc.open();                       //打开流
ifrdoc.write(s); 
ifrdoc.close();                       //关闭流
ifrdoc.designMode ="off";    //文档进入非可编辑模式
</script>
</body>
</html>
//}}}
{{{
mysql -uroot -p /mysql -uroot
create user captcha;
grant all on *.* to captcha@localhost identified by 'password';
}}}

grant 权限 on 数据库.* to 用户名@登录主机 identified by "密码" 
增加一个用户user1密码为password1,让其可以在本机上登录, 
并对所有数据库有查询、插入、修改、删除的权限。
#首先用以root用户连入mysql
#然後键入以下命令:
{{{
grant select,insert,update,delete on *.* to user1@localhost Identified by "password1";
}}}
如果希望该用户能够在任何机器上登陆mysql,则将localhost改为"%"。 
如果你不想user1有密码,可以再打一个命令将密码去掉。
{{{
grant select,insert,update,delete on mydb.* to user1@localhost identified by "";
}}}
solution:
1. create an icon using bmp format
2. rename it as favicon.ico
3. mv it to the root directory of your website
when cp one repos to another directory or PC, the error occured.
solution: setting the config option "core.hideDotFiles = false" in .git/config
More discussion: 
http://git.661346.n2.nabble.com/BUG-Bad-msysgit-egit-interaction-over-dotfiles-td4132418.html
http://code.google.com/p/msysgit/issues/detail?id=288
http://jsbeautifier.org/
目前很多Javascript代码都已经进行过了加密和格式压缩处理,例如以下代码:

<code javascript>
if('this_is'==/an_example/){do_something();}else{var a=b?(c%d):e[f];}
</code>

这是一段没有格式的JS代码,我们阅读这种无格式的代码会觉得很吃力,同样的,我们将上面一段Js代码加个格式化处理:
<code javascript>
if ('this_is' == /an_example/) {
    do_something();
} else {
    var a = b ? (c % d) : e[f];
}
</code>

这样代码就很容易阅读,因此我在这里推荐一个我经常使用的一个Javascript格式化利器:js-beautify,方便大家在阅读一些被去格式的JS代码的时候进行格式化阅读,它是在学习Js的过程中必不可少的一个工具
situation: two packages in the project, to change auto generated java files R.java, avoid import xxx.R;
edit AndroidManifest.xml
Manifest->Manifest General Attributes -> Package
*modify codes
{{{
git branch experiment
git add .
git commit -m
}}}
In this way, the code would be checked in the experiment repos.
*Then
{{{
git checkout master
}}}
You would get the code in the master repos.
**notes: it just means commit the changes to the corresponding repos

* delete branch
{{{
git branch -d experiment
}}}
* checkout version
{{{
git checkout experiment tag
}}}
create file .gitignore in your project root directory
e.g.
{{{
*.swp
*~
.gitignore
}}}
git pull -> error: permission denied; give another user right to git
(to test)
{{{
ls -al .git
drwxrwxr-x  8 ehjlnox git  4096 2010-11-24 03:07 .
drwxrwxr-x  6 ehjlnox git  4096 2010-11-23 15:14 ..
drwxrwxr-x  2 ehjlnox git  4096 2010-11-16 08:43 branches
-rw-rw-r--  1 ehjlnox git     9 2010-11-24 03:07 COMMIT_EDITMSG
-rw-rw-r--  1 ehjlnox git   258 2010-11-16 08:44 config
-rw-rw-r--  1 ehjlnox git    73 2010-11-16 08:43 description
-rw-rw-r--  1 ehjlnox git     0 2010-12-10 04:18 FETCH_HEAD
-rw-rw-r--  1 ehjlnox git    23 2010-11-16 08:44 HEAD
drwxrwxr-x  2 ehjlnox git  4096 2010-11-16 08:43 hooks
-rw-rw-r--  1 ehjlnox git 11336 2010-11-24 03:07 index
drwxrwxr-x  2 ehjlnox git  4096 2010-11-16 08:43 info
drwxrwxr-x  3 ehjlnox git  4096 2010-11-16 08:44 logs
drwxrwxr-x 66 ehjlnox git  4096 2010-11-24 03:07 objects
-rw-rw-r--  1 ehjlnox git    41 2010-11-24 03:05 ORIG_HEAD
-rw-rw-r--  1 ehjlnox git    94 2010-11-16 08:44 packed-refs
drwxrwxr-x  5 ehjlnox git  4096 2010-11-16 08:44 refs

ehjlnox: user
git: group

1. to add the group git
> chgrp -r * git
2. create write authorization for group
> chmod g+w *
}}}
这个是找出master分支最近5次的commit,看见那个写错的了吧?把pick改成edit,保存退出。
此时工作目录已经变成这次commit的样子了,不要慌,然后:
{{{
git commit --amend -m "message"
}}}
修改这次的message。最后:
{{{
git rebase --continue
}}}
利用这个方法也可以修改commit的文件。
1. history grep
{{{
ctrl + r
}}}
1. copy the RSA private key to your HOME_DIR/.ssh/, eg. C:\Users\efanhao\.ssh 
(if you don't know where is your HOME_DIR, try to use "ssh -v git@xxx.xxx.xxx", then you will see one line in the following 
info
>Trying private key: /h/.ssh/id_rsaThus H:\ is is your HOME_DIR
)
If you cannot create the folder .ssh, please try to use cmd line "mkdir .ssh" to create it.
2. run the git-cmd.bat
3. cd your local workspace
git clone git@221.2.105.30:labs_xxx.git
4. Copy your own code to the directory, and replace the original source code in the folder.
5. git add .
6. git commit -m "your work log such as version 2.0"
7. git push
示例:豆瓣的“想读” 标签换行
注意:只需要在每个span后加一个" "
//{{{
$('[name=tags]dd').append(" ");
//}}}
jQuery1.5版本起新加了jQuery.when函数,jQuery源码本省并不用到此函数,相当于插件形式,但却直接拿到jquery core中了。 

jQuery.when函数确实非常不错. 

jQuery.when:Deferred helper [ "when"为Deferred物件辅助函数] 

Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events. 
提供一种基于 监听多个异步事件 执行回调的方式。 

例如: 
Execute a function after +1 ajax requests are successful.  
在同时存在多个ajax请求,在都成功后执行一个函数: 
//{{{
var ajax0 = $.ajax("/page0.php"); 
var ajax1 = $.ajax("/page1.php"); 
var ajax2 = $.ajax("/page2.php"); 
//... 
//单独page0请求成功后执行fnajax0函数 
ajax0.success(fnajax0); 

//在page0,1,2都成功能后执行函数fnall 
var der = $.when(ajax0, ajax1, ajax2 / , ... / ); 
der.done(fnall); 
function fnall(a1, a2, a3 / , ... / ) { 
        /* a1 a2 a3.. 为page1 page2... 为请求成功后对应ajax返回的参数*/ 
        /*  a1[2] 为 [ "success", statusText, jqXHR ] */ 
} 

//在page0,1,2其中某一个请求出错时执行函数fnfali 
der.fail(fnfali);
//}}}

源码: 

jQuery.when( deferreds ) 
参数为一个或多个 Deferred物件, 或其他非Deferred物件. 

//{{{
when: function(object) { 

        var lastIndex = arguments.length, 

        //根据参数确定deferred物件 
        deferred = lastIndex <= 1 && object && jQuery.isFunction(object.promise) ? object: jQuery.Deferred(), 

        //得到deferred物件的Promise(Promise翻译成中文是什么?) 
        promise = deferred.promise(); 

        if (lastIndex > 1) { 

                //多个参数时,将各存于数组内。 
                var array = slice.call(arguments, 0), 

                //count值参数的数量 
                count = lastIndex, 

                iCallback = function(index) { 

                        //单独deferred物件参数成功后执行iCallback 
                        return function(value) { 

                                //array变量这时用来传递done绑定函数的参数。 
                                array[index] = arguments.length > 1 ? slice.call(arguments, 0) : value; 

                                //count计数减1,即任然没有resolve的deferred物件的个数。 
                                if (! (--count)) { 

                                        //在其为1时,执行deferred.resolveWith函数,开始执行done绑定的函数 
                                        deferred.resolveWith(promise, array); 
                                } 
                        }; 
                }; 

                //遍历传进的参数列表,在其为deferred物件时then(S, F),即done(S),fail(F) 
                while ((lastIndex--)) { 
                        object = array[lastIndex]; 
                        if (object && jQuery.isFunction(object.promise)) { 

                                object.promise().then(iCallback(lastIndex), deferred.reject); 
                        } else { 
                                //得到实际的deferred物件参数个数 
                                --count; 
                        } 
                } 

                //如果不存在deferred物件参数,执行deferred.resolveWith函数,开始执行done绑定的函数 
                if (!count) { 
                        deferred.resolveWith(promise, array); 
                } 
        } else if (deferred !== object) { 
                deferred.resolve(object); 
        } 

        //when函数返回deferred的Promise物件,该物件具有then, done, fail, isResolved,  isRejected等方法。 
        return promise; 
}
//}}}



最近在找等待多個 Ajax 完成的方法,找到 jQuery.when函数分析這篇文章中有處理多個 Ajax 的方法,但對於數量不固定的狀況,jQuery.when 輸入參數的方式實在有點討厭,必須要指定 Ajax 的數量,還好想起有 apply 這個方法可以用,可以將 array 轉換成呼叫 function 的參數,這樣不管有多少數量,都可以很輕鬆的帶入到 jQuery.when 中。
//{{{
/*將多個 Ajax 加到 array 中*/  
var ajaxRequest=[];  
for (var i=0; i<10; i++){  
   ajaxRequest.push(  
       $.ajax({  
           data: {'a':i},  
           success: function(data) {  
               console.log(data);  
           }  
       })  
   );  
};  
  
/*利用 apply 將 ajaxRequest 帶入 jQuery.when*/  
var der=$.when.apply( $, ajaxRequest )  
  
der.always(function() {  
   console.log(arguments);  
   alert('全部結束');  
});          
der.done(function() {  
   console.log(arguments);  
   alert('全部成功');  
});          
//}}}
Add the INTERNET permission to your manifest file.

You have to add this line:
{{{
<uses-permission android:name="android.permission.INTERNET" /> 
}}}
outside the application tag in your AndroidManifest.xml
The jsMath Plugin enable Latex in tiddlywiki, thus we can input formula, special symbols, etc., using Latex format.

To install the jsMath Plugin, 
#import the tiddlyer [[Plugin:jsMath]], or copy the content to a new tiddler, and tagged systemConfig.
#download jsMath lib, put it in the directory the same with the wiki.
#Download Tex font and install it.
#*Firefox requires the Tex font to open the wiki, otherwise, it couldn't show any content.
{{{
ln -s src des
}}}
!!!Problem & Solution
[[mGSD become quite slow]]
mGSD becomes quite slow in Firefox when creating actions, selecting context ....

Environment:
mGSD version: 3.1.8c
Firefox version: 8.0

My solution:
shut down the plugin "Firebug"
when auto merge failed, you can fix it manually
{{{
1. search <<<<<<<< HEAD (or just <<<<) in your code (means conflict occurred, added by git merge)
2. check the conflic and resolve it, from <<<<<<<< HEAD to ======= to >>>>>>>> xxxxxxxxxxxxxxxxxxx
(for tiddlywiki: 1. delete from <<<<<<<< HEAD to ===========; 2. delete >>>>>> xxxxxxx)
3. commit your change
4. pull or merge
}}}
delete .gitignore
(because git would load .gitignore to ignore files)
then pull
The term noiselet refers to a family of functions which are related to wavelets, analogously to the way that the Fourier basis is related to a time domain signal. In other words, if a signal is compact in the wavelet domain then it will be spread out in the noiselet domain, and vice versa.

noiselet 可以认为就是一个噪声产生的 wavelet,其重要性是在于它做measurement 和 Fourier 的那组基做 representation 互补(这样 Fourier 的表示是稀疏的)。[[各种lets介绍|http://remonstrate.wordpress.com/2009/04/04/%e5%90%84%e7%a7%8d-lets/]]
分辨率指的是''单位长度中,所表达或撷取的像素数目''。和像素一样,分辨率也分为很多种。 

# 影响分辨率: 通常说的数码相机输出照片最大分辨率,指的就是影像分辨率,单位是ppi(Pixel per Inch) 
# 打印分辨率: 打印机或者冲印设备的输出分辨率,单位是dpi(dot per inch) 
# 显示器分辨: 就是Windows桌面的大小。常见的设定有640x480、800x600、1024x768…等。屏幕字型分辨率:PC的字型分辨率是96dpi,Mac的字型分辨率是72dpi。

!!!!影像分辨率和像素的关系 
像素和分辨率是成正比的,像素越大,分辨率也越高。
#通常来说200万像素的数码相机,最大影像分辨率是1600×1200=192万像素,也就是说,实际的有效像素就是192万。 
#通常所说的300万像素的数码相机,最大影像分辨率是2048×1536=3145728像素,也就是说有效像素为314万。 
!!!!打印分辨率和像素的关系 
#200万像素的数码相机,有效像素192万,最大输出1600×1200的相片. 
##宽:1600 Pixels/300 dpi=5.3" 
##高:1200 Pixels/300 dpi=4" 
##也就是说如果用300dpi输出分辨率冲印,最多能冲印5.3×4英寸的照片,而通常照片的尺寸是: 5寸:5×3.5  6寸:6×4. 很明显的看出,200万像素能以300dpi的效果冲印最大5寸的照片。 
*(注:人眼能分辨出的最大分辨率是300dpi,超过这个分辨率,人的眼睛是无法看出差别的,也就是说300dpi和600dpi在人眼看来是没有差别的,所以现在的冲印设备最大的设计输出分辨率,就是300dpi,当然每个人对于清晰度的要求是不一样的,一般来说能达到200dpi就能让大部分人满意,所以200万像素冲印6寸的照片,在大部分人看来还是很清晰的。) 

总结:如上所述,“打印尺寸”与影像分辨率有莫大的关系,只要影像分辨率改变了,打印的尺寸便会跟着变化,而像素和影像分辨率又有直接的关系,所以三者可以互相转换的。而其中最根本的就是像素。
;Sa(t) = sin(t) / t
:integral from -∞ to ∞ is π, from 0 to ∞ is π/2.
;sinc(t) = sin(πt) / πt
:integral from -∞ to ∞ is 1, from 0 to ∞ is 1/2.
:The normalized sinc function has a simple representation as the infinite product
:[img[http://upload.wikimedia.org/math/0/c/b/0cbded4b63d978ec6e0511199268e2f6.png]]
:Euler discovered that
:[img[http://upload.wikimedia.org/math/0/d/7/0d744fc2bfd30c6bfeb052a9c296b481.png]]
:The continuous Fourier transform of the normalized sinc (to ordinary frequency) is rect(f),
:[img[http://upload.wikimedia.org/math/8/e/7/8e7fbcdec296420dfeceb48bd65dd706.png]]
:where the rectangular function is 1 for argument between −1/2 and 1/2, and zero otherwise. This corresponds to the fact that the sinc filter is the ideal (brick-wall, meaning rectangular frequency response) low-pass filter. This Fourier integral, including the special case
:[img[http://upload.wikimedia.org/math/8/4/3/843cee0cba0063925fbdc969da0c051e.png]]
create the .screenrc in /home/username/
{{{
#
# ~/.sCreenrc
#

# setup shell title
#shelltitle '$ |bash'

# close welcome screen
startup_message off

#  redefine screen function key to Ctrl-Z. If you want to input Ctrl-Z, press Ctrl-Z z
escape ^Zz

# screen buffer 1024 lines
defscrollback 1024

# status bar: list of windows, clock
hardstatus on
hardstatus alwayslastline
hardstatus string "%{.bW}%-w%{.rY}%n %t%{-}%+w %=%{..G} %H(%l) %{..Y} %Y/%m/%d %c "
##hardstatus string "%{.bW}%-w%{.rY}%n %t%{-}%+w %=%{..G} %H(%l) %{..Y} %Y/%m/%d %c:%s "

# shutdown error bell
vbell off

# escapekey l to show window list
bind l windowlist -b
defutf8 on

}}}

usage:
(ctrl + z + ...)
1. to create a screen in terminal
{{{ 
screen
}}}
2. to create a screen bash when already in a screen 
{{{ 
ctrl + z + c
}}}
3. to switch bash
{{{
ctrl + z + z
ctrl + z + p
ctrl + z + h
}}}
4. exit but not close screen
{{{
ctrl + d
}}}
5. return to the screen 
{{{
screen -x[tag]
}}}
create tar
{{{
tar -zcvf pic.tar.gz /home/user/pic
}}}
raw HTML can be inserted by enclosing the respective code in HTML tags:
{{{
<html> … </html>
}}}
such as: 
{{{
hello <html><a href="www.sina.com">sina</a></html>
}}}
the outcome would be
hello <html><a href="www.sina.com">sina</a></html>
步骤1,用{ SEQ seq \c}替换所有的{ STYLEREF 1 \S }。
步骤2,有图表的每一章开始位置插入域代码{ SEQ seq \h }。
步骤3,更新所有域。

seq和MTChap相当于是同一个人的两个名字而已,所以在此你也可以继续使用MTChap


!!!! 具体实施方法一:

1,文档空白处CTRL+F9出现{ },在光标处输入引号里的字符“SEQ空格seq空格\c”。选中整个{ SEQ seq \c},Ctrl+C。
2,ALT+F9显示域代码,CTRL+H弹出“替换”选项卡,在“查找内容”中输入引号中的字符“^d空格STYLEREF空格1空格\s”。在“替换为”框中输入^c即剪贴板内容。点击“全部替换”后关闭即可。
3,回到先前输入{ SEQ seq \c }的地方,将c换为h。选中整个{ SEQ seq \h },Ctrl+x。
4,在有图表的每一章的开始位置只需用一次Ctrl+v。
5,最后更新域即可。

具体实施方法一的注意事项:
1,空格即是让你输入半角状态下的空格。
2,“选中整个{ SEQ seq \c}”意思是{}外面的一切哪怕是空格都不要选,但{}要选中。
3,在“替换为”框里键入^c,不能直接用CTRL+v,否则你将会看见对人类贡献最大的数字0而已。
4,这里只是很仔细地说明了如何替换的步骤,并不是非要按说明的步骤去替换,根据自己的喜好合理安排,找到适合自己的方法即可。比如对于第1步,你可以选择在第一章同行处或者第一章的第1个图出现之前的任意位置Ctrl+F9,然后输入域代码,如果你这样做,那么后面Ctrl+x“{ SEQ seq \h }”就得改用Ctrl+v了。然后从第二章开始每一章进行一次Ctrl+v。

!!!! 具体实施方法二:(相对于方法一,省去查找内容框手动输入)

1,光标定位“图 一.1”图和一的中间,ALT+F9。移动鼠标进入第一个域记号{},复制{}里面的所有内容包括空格。
2,CTRL+H后,在“查找内容”框里输入^d,然后Ctrl+v。
3,激活文档,在任意空白处Ctrl+F9,在{}内输入“SEQ seq \c”。选中整个{ SEQ seq \c},Ctrl+C。
4,回到“替换”选项卡,在“替换为”框里输入^c,点击全部替换后关闭。
5,然后回到先前输入{ SEQ seq \c }的地方,将c换为h。选中{ SEQ seq \h },Ctrl+x。
6,在有图表的每一章的开始位置只需用一次Ctrl+v。
7,最后更新域即可。

具体实施方法二的注意事项:
1,“光标定位“图 一.1”图和一的中间”主要是让你能直接定位{ STYLEREF 1 \S },方便复制{ }内的代码。也可以定位于任何形如“图 一.1”,比如“图 一.3”等。
2,“复制{}里面的所有内容”的意思是位于{}外所有内容都不要复制包括{}在内。
其它注意事项请参照法一。

如果修改完成后,有时又在文档中插入新的图表,这时候文档中的图表编号会是一团糟,但是不着急。具体修改步骤见本章最后即可。再次修改的思想:删除所有“{ SEQ seq \c }”,再用“{ SEQ seq \c }”去替换所有{ STYLEREF 1 \S }。


!!! 更改的思想及无MathType时的具体实现。
#在每一章的某个位置(只要位于各章第一个图之前,前一章最后一个图的编号之后即可。为安全起见还是位于章标题处)键入“CTRL+F9”出现域记号。
#在每一个域记号的两空格中间依次输入“SEQ空格seq空格\h”,也可复制粘贴。第1个域结果为1,依次类推。非域代码下不显示,也就是说这是隐藏的编号。相当于在每一章开始定义一个用于图编号的章号。空格为半角状态。
#复制一个域代码到剪贴板
# “Ctrl+H”弹出“替换”选项卡。“查找内容”框输入“^d空格STYLEREF空格1空格\s可有可无空格”即“^d STYLEREF 1 \s”。在“替换”框直接用“^c”即可。
#“Alt+F9”后“Ctrl+A”再“F9”完成修改,所有形如“图 一.1”变为“图 1.1”,包括插入的交叉引用。

有时认为论文已经完成,但却需要再插入一些图表时。
之前更新后的规范形式“图3.4”就会跟着变成“图 3.三.4”非规范形式,而新插入的图标依旧按照非规范形式“图 一.2”。
文中又是乱成一团,但是不急,只要按如下步骤即可完成自动更新。

再次插入图片时,修改编号具体步骤:
#删除之前的替换内容“{ SEQ seq \c }”
# “ALT+F9”后“CTRL+H”弹出替换对话框。在查找内容框输入“{ SEQ seq \c }”,“替换为”框不输入任何符号即可完成删除。
#以后步骤同3,4,5。其实就是再次用{ SEQ seq \c }去替换。

*TIPS: 我们只需要等到文档不再修改时,再按照“更改步骤”进行编号的更新,以免去再次修改的麻烦。
点击MathType常用工具栏上的章节分段按钮,或者MathType菜单项中的“Insert Chapter/Section Break”和“Insert Next Chapter Break”即可完成步骤2的插入章节分段。
有MathType时就不需要我们再手动插入域代码{ SEQ MTChap \c },另外记住每一章只能插入一次章节分段按钮,如果之前编辑公式时你已经插入,就不必也不准再次插入。

在章的开始位置插入MathType章节分段或者插入域代码{ SEQ seq \h },因此统一为都在章标题同行处插入。
(其实每一章第1个图之前,前一章最后一个图编号之后,只要符合要求都可以)

如果修改完成后,有时又在文档中插入新的图表,这时候文档中的图表编号会是一团糟,但是不着急。
具体修改步骤见MathType自动更改题注章节编号格式“图一.1”为“图1.1”中最后“再次插入图片时,修改编号具体步骤”或者借鉴本章的最后“再次插入图片时,修改编号具体步骤”。再次修改的思想简单:删除所有{ SEQ MTChap \c},然后用它再去替换所有{ STYLEREF 1 \S }。

要了解具体利用MathType更改编号请查看MathType自动更改题注章节编号格式“图一.1”为“图1.1”有图示步骤
Ref:http://shiqianlu.yo2.cn/articles/%E4%B8%BAfoobar-2000%E5%A2%9E%E5%8A%A0%E6%AD%8C%E6%9B%B2%E8%AF%84%E7%BA%A7.html
用Foobar的好处就是你可以随心所欲的订制界面与功能,不过缺点也在这里,就像Chrome与FireFox原始版不提供Flash插件一样,一些看似常见的功能也得你自己动手提供,就比如歌曲评级功能。

之前我用Last Fm的“喜爱”操作来标记喜欢的歌曲,可是在收集的时候就极为不方便,这就逼我想到为Foobar添加评级。

说明:我用的是Foobar2000 v0.9.6.4 Final 汉化版+分栏界面
汉化版下载|分栏界面介绍|分栏界面插件下载

首先下载Quick Tagger这个插件,放入Foobar安装目录的components文件夹里,重启Foobar。

1.选择”文件“->“参数选项”,“工具”->“标签”->“快速标签”,新增一个字段,名称设为”rating",值就已你想要的效果而定,如分为五级,就设为“1级;2级;3级;4级;5级",中间用英文符号;分开;
下面的”Require confirmation before processing more than ... tracks"表示一次评分几首歌时需要确认。推荐填2。
11

2.“显示”->“分栏用户界面”->“播放列表视图”,选择“分栏”选项卡,新增一个栏位”分级“(标题设置在右边的”选项“选项卡中),在”脚本”->"显示“选项卡中,填入这样一段代码:
$repeat($char(9733),%rating%)
char(9733)为★的图案,此代码用来在播放列表中显示相应的星星数目。点击“应用”。
注意在”评级“的”选项“卡下的”显示分栏“前一定要勾上对号。点击“应用”。
21

3.这时你就可以对歌曲进行分级了。在列表中的歌曲中点右键,“标签”->“快速标签“->”设置为“,再选择相应的级数即可,这时列表的分级栏中就会显示此歌曲的相应的星星数目。

4.但是这样操作太麻烦,可以到“参数选项”中的“上下文菜单”里把“快速标签”从“标签”里拖出来,以减少鼠标点击量。
也可以到“常规”->“快捷键”里设置相应操作的快捷键,如我设置的"*"级的快捷键就是"ctrl+*"。(强烈推荐用快捷键!)
这样就可以在听歌过程中随时对喜欢的歌曲进行分级操作了,特别是,如果设置了快捷键,操作就更简单了,可以不用打开Foobar界面进行操作。

成品图:
3
在HOSTS文件中加入 127.0.0.1 mcfg.sandai.net 即可 保存。

HOSTS文件在目录 C:\windows\system32\drivers\etc 里

打开方式:用记事本打开 加入保存就可以了!

去除迅雷看看暂停广告方法:

最近看优酷和看看实在忍不住了,换个片还要等一段广告!。

测试前请先清下ie缓存。大家测试看看有无效果。

修改 c:\windows\system32\drivers\etc\hosts 文件添加如下

迅雷看看屏蔽:
{{{
0.0.0.0 mcfg.sandai.net

0.0.0.0 biz5.sandai.net

0.0.0.0 server1.adpolestar.net

0.0.0.0 advstat.xunlei.com

0.0.0.0 mpv.sandai.net
}}}
优酷屏蔽:
{{{
0.0.0.0 vid.atm.youku.com

0.0.0.0 valo.atm.youku.com

0.0.0.0 valf.atm.youku.com

0.0.0.0 walp.atm.youku.com

0.0.0.0 static.atm.youku.com
}}}
问题描述:
# 安装完Daemon Tools提示出错 盘符消失
# 设备管理器中光驱设备感叹号
# 重装光驱驱动无效

解决方案:
Ref: http://zhidao.baidu.com/question/271524426.html?fr=qrl&cid=74&index=3 
# 修改注册表 
## 展开到 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E965-E325-11CE-BFC1-08002BE10318} 
## 在右边视图中找到 UpperFilters或LowerFilters ,然后将其删除, (或者将{4D36E965-E325-11CE-BFC1-08002BE10318}这一项删除 
#然后打开设备管理器,将光驱卸载掉,重新启动计算机,系统将提示找到新的光驱. 

参考资料:http://wenda.tianya.cn/wenda/thread?tid=7fdf9fb606f5456f&clk=wttpcts&exp=1
!!!! 设置公式自动编号
#首先,显示标尺。视图-显示/隐藏-标尺 打上钩。
#单击“全部清除”按钮删除所有不需要的制表位。
#光标停在公式所在的行,不要求行中的具体位置。
#选择标尺左端的制表符格式。
#选择居中式制表符,然后在标尺中间点击鼠标左键,即出现一个居中式制表符。可以拖动制表符到任意位置。
#选择右对齐式制表符,然后在标尺末端点击鼠标左键,即出现一个右对齐式制表符。可以拖动制表符到任意位置。
#为样式指定一个名字。按住Ctrl+Shift+S调用“应用样式”对话框。键入公式样式的名称(还没有采用公式编号),按下Enter键将它应用于当前段落中。关闭“应用样式”对话框。

!!!! 设置自动图文集
如果使用这种方法,则设置公式自动编号的最后一步可以省略,即不用创建样式
#按下Ctrl+Tab键插入一个制表符,然后键入()。
#将插入点放到括号内,并按下Ctrl+F9键,插入域括号。
#在域括号中,键入seq公式并按下F9键来更新域。如:{ SEQ 公式 \* ARABIC \s 1 }。
# 如有必要。按下Ctrl+Shift+8来显示制表位和段落标记以便能看到它们。
#选择整行,包括该制表位、(1)和行尾的段落标记。选择“插入”-“文档部件”-“将所选内容保存到文档部件库”。
#将“名称”替换为能记住的内容。设置“库”为“自动图文集”。设置一个“类别”,如果有需要可键入“说明”。设置“选项”为“仅插入内容”,然后单击“确定”按钮。

可以删除被保存为“自动图文集”项目的那行了。现在,可以给哪些公式编号了!请按如下步骤操作:
#单击公式的最右端的箭头;如有必要,单击“更改为内嵌”选项。
#在行开始处(在公式容器外面),按下Ctrl+Tab键。
#在行尾(在公式容器外面),键入与上面第五步使用的名称并按下F3键。

现在应该有了已编号的公式。如果插入或删除公式,可能需要选择整个组并且按下F9键来更新编号。

*为了防止忘记,可以创建一个空的但那是已经带格式和随时能用的已编号的公式“外壳”,并将其添加到“公式库”。为了设置编号,不过用新的随时能用的公式容器替换实际的公式。将其保存到库,或许可以称它为“新编号公式”。在探索Word2007的这个新功能时,记住保存工作成果以便将来使用。无疑你还会发现一些使用创建和应用公式更容易的诀窍。
{{{
ubuntu在中文界面下面,自动创建了“桌面”,“文档”,图片 、公共的 、下载、 音乐、 视频等中文目录。

在命令行下操作的时候,要么切换到中文输入法,要么粘贴。如果在没有输入法的环境,可能操作这些目录都存在困难。

总觉得很别扭。我用Linux是为了提高效率,可是总是为了操作这些目录多按几个键甚至中断操作,得不偿失嘛。

windows操作系统虽然也有桌面,文档,图片,音乐之类的文件夹。但windows体贴的地方是,看到的是中文,而目录其实是英文。这样在没有中文环境下也可以进入。这就是所说的虚拟目录。

忍无可忍,无须再忍。放狗一找,原来这东西还有些来历,此前也并不是这样的。并且有很多人为此而苦恼,甚至干脆用英文系统,眼不见心不烦。

原来这是freedesktop.org为了方便群众搞的xgd-users-dirs ,在不同的语言下自动创建一些经常用到的目录。

xdg-user-dirs-update 这个工具会在系统登录阶段运行,它读取配置文件和用户目录信息,并创建用户本地语言版本的常用目录。设置 到$(XDG_CONFIG_HOME)/user-dirs.dirs (XDG_CONFIG_HOME defaults to ~/.config),以便应用程序读取和使用这些目录。

1. 我们可以先将目录都改成英文的。
export LANG=en_US

执行

xdg-user-dirs-gtk-update

这时会弹出一个配置界面,将所有中文的用户目录切换到英文。选中不再提示,确定。

这时,会删除没有内容的用户目录,但有内容的用户目录会保持。并创建相应的英文目录:

Desktop/Download/Templates/Public/Documents/Music/Pictures/Videos

此时,在位置里看到的常用中文目录已经换成英文目录。只需将原中文目录的内容拷贝到相应英文目录,并删除中文目录即可。

然后再执行
export LANG=zh_CN.UTF-8

以显示中文。

如果记不住该命令,很简单。注销。在登录界面选英语,进来后该对话框就会弹出来提示你是否切换用户目录了。切换完了注销,再切换成中文界面,但这时不要切换用户目录了。

2.显示中文,但实际是英文目录
这时,桌面也对应/home/zhouhh/Desktop,但“位置”里面,“主文件夹”,“桌面”点开都对应英文目录。

理想化的解决方案,是看到的目录是中文,但打开的目录是英文。和Windows操作系统一致。这样免得中英夹杂,影响视觉和心情。

其实这也是可以办到的。

点“位置”->"主文件夹",打开文件浏览器(Nautilus),

在书签菜单,选编辑书签

这时,可以将各英文用户目录的显示改成中文对应的“桌面”,“文档”,图片 、公共的 、下载、 音乐、 视频等。

改完,在任务栏的“位置”,看到也变成了中文。而打开的目录,却是英文。

这样,终于舒坦了。

3.相关配置 cd /etc/xdg

zhouhh@zhh64:/etc/xdg$ ls user*

user-dirs.conf user-dirs.defaults

zhouhh@zhh64:/etc/xdg$ vi user-dirs.defaults



# Default settings for user directories

#

# The values are relative pathnames from the home directory and

# will be translated on a per-path-element basis into the users locale

DESKTOP=Desktop

DOWNLOAD=Downloads

TEMPLATES=Templates

PUBLICSHARE=Public

DOCUMENTS=Documents

MUSIC=Music

PICTURES=Pictures

VIDEOS=Videos

# Another alternative is:

#MUSIC=Documents/Music

#PICTURES=Documents/Pictures

#VIDEOS=Documents/Videos



该文件是xdg-user-dirs-update工具在用户登录时需要读取的目录配置。并根据user-dirs.conf决定如何翻译。

zhouhh@zhh64:/etc/xdg$ vi user-dirs.conf



# This controls the behaviour of xdg-user-dirs-update which is run on user login

# You can also have per-user config in ~/.config/user-dirs.conf, or specify

# the XDG_CONFIG_HOME and/or XDG_CONFIG_DIRS to override this

#



enabled=True



# This sets the filename encoding to use. You can specify an explicit

# encoding, or "locale" which means the encoding of the users locale

# will be used

filename_encoding=UTF-8



这是系统的缺省编码设置和是否启用设置。用户的在/home/zhouhh/.config下面。

可以由XDG_CONFIG_HOME  XDG_CONFIG_DIRS 指定路径来读取配置。

zhouhh@zhh64:~$ vi .config/user-dirs.dirs



# This file is written by xdg-user-dirs-update

# If you want to change or add directories, just edit the line you're

# interested in. All local changes will be retained on the next run

# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped

# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an

# absolute path. No other format is supported.

# 

XDG_DESKTOP_DIR="$HOME/Desktop"

XDG_DOWNLOAD_DIR="$HOME/Downloads"

XDG_TEMPLATES_DIR="$HOME/Templates"

XDG_PUBLICSHARE_DIR="$HOME/Public"

XDG_DOCUMENTS_DIR="$HOME/Documents"

XDG_MUSIC_DIR="$HOME/Music"

XDG_PICTURES_DIR="$HOME/Pictures"

XDG_VIDEOS_DIR="$HOME/Videos"



可以看到我的配置都已经是英文了。
 

PS:原始设置如下:
# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
# 
XDG_DESKTOP_DIR="$HOME/桌面"
XDG_DOWNLOAD_DIR="$HOME/下载"
XDG_TEMPLATES_DIR="$HOME/模板"
XDG_PUBLICSHARE_DIR="$HOME/公共的"
XDG_DOCUMENTS_DIR="$HOME/文档"
XDG_MUSIC_DIR="$HOME/音乐"
XDG_PICTURES_DIR="$HOME/图片"
XDG_VIDEOS_DIR="$HOME/视频"

更改相应项即可:

# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
# 
XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_TEMPLATES_DIR="$HOME/Templates"
XDG_PUBLICSHARE_DIR="$HOME/Publicshare"
XDG_DOCUMENTS_DIR="$HOME/Documents"
XDG_MUSIC_DIR="$HOME/Music"

XDG_PICTURES_DIR="$HOME/Pictures"

XDG_VIDEOS_DIR="$HOME/Videos"
}}}
删除全0的行
{{{
GetA_NoZero=A(any(A, 2), :);
}}}
删除全0的列
{{{
A = A';
GetA_NoZero=A(any(A, 2), :);
GetA_NoZero=GetA_NoZero';
}}}
升序
{{{
sort(A);
}}}

降序
{{{
sort(A, 'descend');
}}}
或者
{{{
flipr(sort(A));
}}}
{{{
参考文献类型:专著[M],论文集[C],报纸文章[N],期刊文章[J],
学位论文[D],报告[R],标准[S],专利[P],论文集中的析出文献[A]

电子文献类型:数据库[DB],计算机[CP],电子公告[EB]

电子文献的载体类型:互联网[OL],光盘[CD],磁带[MT],磁盘[DK]

A:专著、论文集、学位论文、报告

[序号]主要责任者.文献题名[文献类型标识].出版地:出版者,出版年.起止页码(可选)

[1]刘国钧,陈绍业.图书馆目录[M].北京:高等教育出版社,1957.15-18.

 

B:期刊文章

[序号]主要责任者.文献题名[J].刊名,年,卷(期):起止页码

[1]何龄修.读南明史[J].中国史研究,1998,(3):167-173.

[2]OU J P,SOONG T T,et al.Recent advance in research on applications of
passive energy dissipation systems[J].Earthquack Eng,1997,38(3):358-361.

 

C:论文集中的析出文献

[序号]析出文献主要责任者.析出文献题名[A].原文献主要责任者(可选).
原文献题名[C].出版地:出版者,出版年.起止页码

[7]钟文发.非线性规划在可燃毒物配置中的应用[A].赵炜.运筹学的理论
与应用——中国运筹学会第五届大会论文集[C].西安:西安电子科技大学出版社,1996.468.

 

D:报纸文章

[序号]主要责任者.文献题名[N].报纸名,出版日期(版次)

[8]谢希德.创造学习的新思路[N].人民日报,1998-12-25(10).

 

E:电子文献

[文献类型/载体类型标识]:[J/OL]网上期刊、[EB/OL]网上电子公告、

[M/CD]光盘图书、[DB/OL]网上数据库、[DB/MT]磁带数据库

[序号]主要责任者.电子文献题名[电子文献及载体类型标识].电子文献的出版或获得地址,发表更新日期/引用日期

[12]王明亮.关于中国学术期刊标准化数据库系统工程的进展[EB/OL].
http://www.cajcd.edu.cn/pub/wml.html,1998-08-16/1998-10-01.

[8]万锦.中国大学学报文摘(1983-1993).英文版[DB/CD].北京:中国大百科全书出版社,1996.
}}}
我自己今天试了一下,用命令行引导UBUNTU成功;
1,引导进入安全模式
{{{
>root (hd0,7)
>kernel /boot/vmlinuz-2.6.24-23-generic root=/dev/hda8 ro quiet splash
>initrd /boot/initrd.img-2.6.24-23-generic
>savedefault
>boot 
}}}
这个中这一句>root (hd0,7)的 hd0是第一个硬盘,7是UBUNTU安装的那个区,具体机子安装位置有可能不同,可以在>root (hd0,时按TAB可以看出来UBUNTU的安装的分区,root=/dev/hda8这一句中的8=前边的7+1,
2,进入普通模式的不要>savedefault,我进的产普通模式,安全模式没试
3,引导进入XP
{{{
>root (hd0,0)
>chainloader +1
>boot
}}}
floor 是向下取整,即往负方向取整
ceil 是向上取整,即往正方向取整
fix 是向0取整,即往0的方向取整
round 是四舍五入,大于5的往绝对值大的方向取,小于5的往绝对值小的方向取
http://hi.baidu.com/yybear505/blog/item/04508e9810be07026f068c24.html
http://hi.baidu.com/yybear505/blog/item/9e84b403dcf5f5054bfb51be.html

基本的思路如下:
1,用{ SEQ MTChap \c }替换所有{ STYLEREF 1 \S }
2,在每一章开始位置插入章节分段按钮(有MT);插入域代码{ SEQ MTChap \c }(无MT)
3,更新所有域:ALT+F9返回域结果,CTRL+A后F9更新所有域

[[word有MathType]]
[[word无MathType]]

*TIPS: 我们只需要等到文档不再修改时,再按照“更改步骤”进行编号的更新,以免去再次修改的麻烦。
有时我们需要在一张表里实现两种timestamp属性的字段,一种是在insert的时候自动赋值,另一种是在update时候赋值,但是在,mysql5.0里面这两种字段无法共存,比如你在创建者张表时:
{{{
CREATE TABLE blog_entries (
`published` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
`updated` TIMESTAMP DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
`title` VARCHAR(128)
);
}}}
数据库会报错: ERROR 1293 (HY000): Incorrect table definition; there can be only one
TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause

解决办法是使用trigger,首先将上面新建表格的语句改成以下内容:
{{{
CREATE TABLE blog_entries (
`published` TIMESTAMP DEFAULT '0000-00-00 00:00:00',
`updated` TIMESTAMP DEFAULT '0000-00-00 00:00:00',
`title` VARCHAR(128)
);
}}}
然后写两个trigger:
{{{
CREATE TRIGGER blog_entries_publish BEFORE INSERT ON `blog_entries`
FOR EACH ROW SET NEW.published = NOW(), NEW.updated = '0000-00-00 00:00:00';
}}}
{{{
CREATE TRIGGER blog_entries_update BEFORE UPDATE ON `blog_entries`
FOR EACH ROW SET NEW.updated = NOW(), NEW.published = OLD.published;
}}}
这样子似乎可以了,但是问题却随之而来了,如果你想手动更改updated的值怎么办?没错你改不了,为了解决这个问题我们在此作如下改动:
java 代码
{{{
CREATE TABLE blog_entries (
`published` TIMESTAMP NULL DEFAULT NULL,
`updated` TIMESTAMP NULL DEFAULT NULL,
`title` VARCHAR(128)
);

CREATE TRIGGER blog_entries_publish BEFORE INSERT ON `blog_entries` FOR EACH ROW SET
NEW.published = IFNULL(NEW.published, NOW()),
NEW.updated = IFNULL(NEW.updated, '0000-00-00 00:00:00');

CREATE TRIGGER blog_entries_update BEFORE UPDATE ON `blog_entries` FOR EACH ROW SET
NEW.updated = IF(NEW.updated = OLD.updated OR NEW.updated IS NULL, NOW(), NEW.updated),
NEW.published = IFNULL(NEW.published, OLD.published);
}}}
好了,现在你可以随意改动update,但是如果你没有传值给update会怎么样呢?这时NEW.updated 默认等于OLD.update值,如果你传NULL给update无效,所以你必须再做一点改动,判断这个条件:
{{{
CREATE TRIGGER blog_entries_update BEFORE UPDATE ON `blog_entries` FOR EACH ROW SET
NEW.updated = CASE
WHEN NEW.updated IS NULL THEN OLD.updated
WHEN NEW.updated = OLD.updated THEN NOW()
ELSE NEW.updated
END,
NEW.published = IFNULL(NEW.published, OLD.published);
}}}
<code java>
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT/Folder/shell/cmdhere]
@="Open cmd &shell here"

[HKEY_CLASSES_ROOT/Folder/shell/cmdhere/command]
@="cmd.exe /k cd /D %1"
</code>
<code java>
a = [1 2 3];
b = repmat(a, 2, 1);
c = repmat(a, 2, 2);

b = 
[ 1 2 3
  1 2  3]

c =
[ 1 2 3 1 2 3
  1 2 3 1 2 3]
</code>
多个Ajax 在一个function中的执行顺序
   由于Jquery中的Ajax的async默认是true(异步请求),如果想一个Ajax执行完后再执行另一个Ajax, 需要把async=false就可以了.
//{{{
function TestAjax(){

            var UserName = $("#txtUserName").val();

            $.ajax(

            {

                url: "AjaxCheckUserName.htm",

                async: false,

                success: function (data) {

                    alert(data);

                }

            });

            alert('Test');

            $.ajax({

                url: "AjaxHandler.ashx",

                async: false,

                data: "UserName=" + UserName,

                success: function (data) {

                    $("#divAjax").html(data);

                },

                error: function (msg) {

                    alert(msg.responseText);

                }

            });

        }
//}}}
方法1:

sort() 排列; diff() 做差分; find() 找出相同数据的点; 再删除重复数据或者其它操作,精度较高

方法2:

AA = 该数组;
aaa=unique(AA,'rows');
精度相对较低,但是快捷方便!

如需要统计相同元素的个数可以参考一下代码:
{{{
>> a=[1 1 2 3 4 10 10 11 11 13]
a =
     1     1     2     3     4    10    10    11    11    13
>> b=unique(a)
b =
     1     2     3     4    10    11    13
>> c=sum(a.'*ones(1,length(b))==ones(length(a),1)*b,1) 
c =
     2     1     1     1     2     2     1
}}}
有两个向量 A  B,A包含B中的所有元素,而且这两个向量中的元素都不是按大小排序的,现要求得与B中元素在A中的依次位置序号,该怎么写语言最好呢?
若A=[3,5,7,2,1,9,8,7,6]
B=[7,6,5,1,9]
现要求得B中元素在A中对应位置的序号C=[3,9,2,5,6]

如果是B和A是一对一的话,可根据下面的方法去实现
{{{
A=[3,5,7,2,1,9,8,6]
B=[7,6,5,1,9]
[a,b]=size(B)
C = zeros(size(B))
for i =1:b
    C(i)=find(A==B(i))
end
}}}
如果是B和A是一对多的话就根据情况去写。
似乎是因为/etc/X11/xorg.conf的问题
使用Live CD进入系统
获得su权限
{{{
# sudo -i
}}}
mount ubuntu系统盘(此处为sda7) 然后删除xorg.conf文件,系统重启后会自动重新生成
{{{
# mount /dev/sda7 /mnt
# cd /mnt/etc/X11
# rm xorg.conf
}}}
然后重启就好了
如果你有统计工具箱的话
用
probplot()
normplot()
没有的话,我还在想。 

hist()可以显示数据的分布(频率)。频率/总数可以计算概率,你这个里面就这么点儿数,没法用这个来显示了。 
a = hist(AverL)
b = a / length(AverL);
bar(b)
或者plot(b)
# 将尾注类型选择为“节的结尾”(点击尾注/脚注的工具栏出右下角的箭头)
# 插入分节符
<html>
<table align="center" border="1" cellpadding="4" cellspacing="0" width="60%"><tbody><tr> 
<td width="10%">大写</td> 
<td width="10%">小写</td> 
<td>英文注音</td> 
<td>国际音标注音</td> 
<td>中文注音</td></tr> 
<tr> 
<td>Α</td> 
<td>α</td> 
<td>alpha </td> 
<td>alfa</td> 
<td>阿耳法</td></tr> 
<tr> 
<td>Β</td> 
<td>β</td> 
<td>beta</td> 
<td>beta</td> 
<td>贝塔</td></tr> 
<tr> 
<td>Γ</td> 
<td>γ</td> 
<td>gamma</td> 
<td>gamma</td> 
<td>伽马</td></tr> 
<tr> 
<td>Δ</td> 
<td>δ</td> 
<td>deta</td> 
<td>delta</td> 
<td>德耳塔</td></tr> 
<tr> 
<td>Ε</td> 
<td>ε</td> 
<td>epsilon</td> 
<td>epsilon</td> 
<td>艾普西隆</td></tr> 
<tr> 
<td>Ζ</td> 
<td>ζ</td> 
<td>zeta</td> 
<td>zeta</td> 
<td>截塔</td></tr> 
<tr> 
<td>Η</td> 
<td>η</td> 
<td>eta</td> 
<td>eta</td> 
<td>艾塔</td></tr> 
<tr> 
<td>Θ</td> 
<td>θ</td> 
<td>theta</td> 
<td>θita</td> 
<td>西塔</td></tr> 
<tr> 
<td>Ι</td> 
<td>ι</td> 
<td>iota</td> 
<td>iota</td> 
<td>约塔</td></tr> 
<tr> 
<td>Κ</td> 
<td>κ</td> 
<td>kappa</td> 
<td>kappa</td> 
<td>卡帕</td></tr> 
<tr> 
<td>Λ</td> 
<td>λ</td> 
<td>lambda</td> 
<td>lambda</td> 
<td>兰姆达</td></tr> 
<tr> 
<td>Μ</td> 
<td>μ</td> 
<td>mu</td> 
<td>miu</td> 
<td>缪</td></tr> 
<tr> 
<td>Ν</td> 
<td>ν</td> 
<td>nu</td> 
<td>niu</td> 
<td>纽</td></tr> 
<tr> 
<td>Ξ</td> 
<td>ξ</td> 
<td>xi</td> 
<td>ksi</td> 
<td>可塞</td></tr> 
<tr> 
<td>Ο</td> 
<td>ο</td> 
<td>omicron</td> 
<td>omikron</td> 
<td>奥密可戎</td></tr> 
<tr> 
<td>Π</td> 
<td>π</td> 
<td>pi</td> 
<td>pai</td> 
<td>派</td></tr> 
<tr> 
<td>Ρ</td> 
<td>ρ</td> 
<td>rho</td> 
<td>rou</td> 
<td>柔</td></tr> 
<tr> 
<td>Σ</td> 
<td>σ</td> 
<td>sigma </td> 
<td>sigma</td> 
<td>西格马</td></tr> 
<tr> 
<td>Τ</td> 
<td>τ</td> 
<td>tau</td> 
<td>tau</td> 
<td>套</td></tr> 
<tr> 
<td>Υ</td> 
<td>υ</td> 
<td>upsilon</td> 
<td>jupsilon</td> 
<td>衣普西隆</td></tr> 
<tr> 
<td>Φ</td> 
<td>φ</td> 
<td>phi</td> 
<td>fai</td> 
<td>斐</td></tr> 
<tr> 
<td>Χ</td> 
<td>χ</td> 
<td>chi</td> 
<td>khai</td> 
<td>喜</td></tr> 
<tr> 
<td>Ψ</td> 
<td>ψ</td> 
<td>psi</td> 
<td>psai</td> 
<td>普西</td></tr> 
<tr> 
<td>Ω</td> 
<td>ω</td> 
<td>omega</td> 
<td>omiga</td> 
<td>欧米伽</td></tr></tbody></table> 
</html>
开题报告主要包括以下几个方面:

(一)论文名称

论文名称就是课题的名字

第一,名称要准确、规范。准确就是论文的名称要把论文研究的问题是什么,研究的对象是什么交待清楚,论文的名称一定要和研究的内容相一致,不能太大,也不能太小,要准确地把你研究的对象、问题概括出来。

第二,名称要简洁,不能太长。不管是论文或者课题,名称都不能太长,能不要的字就尽量不要,一般不要超过20个字。

(二) 论文研究的目的、意义

研究的目的、意义也就是为什么要研究、研究它有什么价值。这一般可以先从现实需要方面去论述,指出现实当中存在这个问题,需要去研究,去解决,本论文的研究有什么实际作用,然后,再写论文的理论和学术价值。这些都要写得具体一点,有针对性一点,不能漫无边际地空喊口号。主要内容包括:⑴ 研究的有关背景(课题的提出): 即根据什么、受什么启发而搞这项研究。 ⑵ 通过分析本地(校) 的教育教学实际,指出为什么要研究该课题,研究的价值,要解决的问题。

(三) 本论文国内外研究的历史和现状(文献综述)。

 规范些应该有,如果是小课题可以省略。一般包括:掌握其研究的广度、深度、已取得的成果;寻找有待进一步研究的问题,从而确定本课题研究的平台(起点)、研究的特色或突破点。

(四)论文研究的指导思想

指导思想就是在宏观上应坚持什么方向,符合什么要求等,这个方向或要求可以是哲学、政治理论,也可以是政府的教育发展规划,也可以是有关研究问题的指导性意见等。

(五) 论文写作的目标

论文写作的目标也就是课题最后要达到的具体目的,要解决哪些具体问题,也就是本论文研究要达到的预定目标:即本论文写作的目标定位,确定目标时要紧扣课题,用词要准确、精练、明了。

常见存在问题是:不写研究目标;目标扣题不紧;目标用词不准确; 目标定得过高, 对预定的目标没有进行研究或无法进行研究。

确定论文写作目标时,一方面要考虑课题本身的要求,另一方面要考率实际的工作条件与工作水平。

(六)论文的基本内容

研究内容要更具体、明确。并且一个目标可能要通过几方面的研究内容来实现,他们不一定是一一对应的关系。大家在确定研究内容的时候,往往考虑的不是很具体,写出来的研究内容特别笼统、模糊,把写作的目的、意义当作研究内容。

基本内容一般包括:⑴对论文名称的界说。应尽可能明确三点:研究的对象、研究的问题、研究的方法。⑵本论文写作有关的理论、名词、术语、概念的界说。

(七)论文写作的方法

具体的写作方法可从下面选定: 观察法、调查法、实验法、经验总结法、 个案法、比较研究法、文献资料法等。

(八)论文写作的步骤

论文写作的步骤,也就是论文写作在时间和顺序上的安排。论文写作的步骤要充分考虑研究内容的相互关系和难易程度,一般情况下,都是从基础问题开始,分阶段进行,每个阶段从什么时间开始,至什么时间结束都要有规定。课题研究的主要步骤和时间安排包括:整个研究拟分为哪几个阶段;各阶段的起止时间
http://www.lan99.com/Html/system/html/system_2542.html
Win7的搜索功能非常强大,也很智能,在搜索资料后,在搜索栏中会留下记录,这样就有可能会泄露个人隐私,因此搜索后,最好不要保留搜索记录,以免留下后患。

*查看搜索记录
**删除搜索记录
**在资源管理器的搜索窗口中并没有关于清除搜索记录的设置,控制面板中也没有删除的相关选项,有时候使用优化软件也无法删除,那么如何来删除搜索记录呢?
**还是需要在注册表中来进行操作,在开始菜单的搜索栏中输入“regedit”进入注册表,依次找到如下键值:
{{{
HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Explorer/WordWheelQuery
}}}
**删除右边子项中除了名为默认的项即可。如果怕删错可以先选择上方工具栏的“导出”功能来备份注册表,有问题时再恢复即可。
**删除注册表相关项

*通过组策略禁留搜索记录
**当然要彻底地让搜索记录消失无踪影,我们还是需要在组策略中进行一番限制,毕竟每次进入注册表删除太麻烦了。
**第一步:按【Win键+R】打开运行窗口(或者直接在“搜索”框里)输入gpedit.msc后按回车键,打开组策略设置窗口。
**组策略中禁止保存记录 第二步:打开“用户配置→管理模板→Windows组件→Windows资源管理器”,选择右侧窗格中的“在Windows资源管理器搜索框中关闭最近搜索条目的显示”项目,双击该项目打开属性窗口,在这里选择“已启用”,最后单击“确定”即可启用该功能,这样以后就不会自动保存搜索记录了。
**小贴士:如何提高搜索速度
>把硬盘分区添加到索引会大大提高搜索速度,虽然在第一次进行索引的时候速度会比较慢,但是在索引完成之后,搜索文件基本上就是一秒钟就搞定。可以在控制面板的“索引选项”中进行详细设置。

*设置文件索引
**在Windows系统中,很多设置都可以在组策略中修改,有兴趣研究Windows的朋友可以多看看组策略中的各种选项和设置,收获一定不会校其实组策略和注册表是有联系的,系统的注册表保存系统软件和应用软件配置的数据库,而随着Windows功能越来越丰富,注册表里的配置项目也越来越多,很多配置都可以自定义设置,但这些配置分布在注册表的各个角落,如果是手工配置,是非常麻烦的。而组策略则将系统重要的配置功能汇集成各种配置模块,供用户直接使用,从而达到方便管理计算机的目的。
! 快门
# 快门速度越快,影像就越清晰
# 一般来说,所谓安全快门速度,就是在平稳手持的情况下,基本不会造成影像模糊的快门速度,一般是‘’焦距的倒数‘’
## 比如20mm焦距的镜头,安全快门速度是1/20,200mm的安全快门速度,是1/200秒
# 但这样还是不够安全,最好是‘’两倍这样的数值以上‘’更可靠,特别是长焦。
# 同时要保证被拍摄对象的运动速度不能太快,否则也会造成影像模糊。

! 景深
光圈大,焦距长,景深小;——拍特写、微距适用;
光圈小,焦距短,景深大。——拍风景、建筑适用。
假设左移三位:
(1)空位补0
a=1:10
a =
1 2 3 4 5 6 7 8 9 10
n=3;
b=[a(n+1:end),zeros(1,n)]
b =
4 5 6 7 8 9 10 0 0
(2)循环移位
a=1:10
a =
1 2 3 4 5 6 7 8 9 10
n=3;
b=[a(n+1:end),a(1:n)]
b =
4 5 6 7 8 9 10 1 2 3
如果是数组移位
circshift

Shift array circularly
Syntax

B = circshift(A,shiftsize)
''in OFFICE 2007''
{{{
windows按钮—> word option -> display ->...
}}}
油菜炒虾仁对虾肉50克,油菜250克,姜、葱适量。将虾肉洗净切成薄片,虾片用酱油。料酒、淀粉拌好;油菜梗叶分开,洗净后切成3厘米长段;锅中加入食油,烧热后先下虾片煸几下即起出,再把油锅熬热加盐,先煸炒油菜梗,再煸油菜叶,至半熟时倒入虾片,并加入佐料姜、葱等,用旺火快炒几下即可起锅装盘。此菜具有营养强壮身体的作用,可提高机体抗病能力。老年体弱者可常食。
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>理工科本科毕业生怎样写毕业论文</title>

<style>

<!--

 p.MsoNormal

	{mso-style-parent:"";

	margin-bottom:.0001pt;

	text-align:justify;

	text-justify:inter-ideograph;

	font-size:10.5pt;

	font-family:"Times New Roman";

	margin-left:0cm; margin-right:0cm; margin-top:0cm}

-->

</style>

</head>



<body>



<blockquote>

  <p class="MsoNormal" align="center" style="text-align: center">

  <font color="#0000FF" size="6"><b><span style="font-family: 隶书">

  <a name="top"></a>理工科本科毕业生怎样写毕业论文</span></b></font></p>

  <p class="MsoNormal" align="center" style="text-align: center">

  <font color="#0000FF" size="6">

  <span style="font-family: 隶书; font-weight: 700">本科毕业论文辅导</span></font></p>

  <p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p>

  <p class="MsoNormal" align="right" style="text-align: right">

  <span style="font-family: 宋体">××大学计算机系</span> <span style="font-family: 宋体">

  ×××</span></p>

  <p class="MsoNormal"><span style="font-family: 宋体"> </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span style="font-family: 宋体">

  目录</span><span lang="EN-US">:</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; 

  <a href="#lwlx">1 </a> </span>

  <a href="#lwlx">

  <span style="font-family: 宋体">论文类型</span>&nbsp;&nbsp;</a>&nbsp;&nbsp;&nbsp;

  <a href="#xt">

  <span lang="EN-US">2 </span><span style="font-family: 宋体">选题</span></a><span style="font-family: 宋体"> </span>&nbsp;

  <a href="#lwgsh">

  <span lang="EN-US">3 </span><span style="font-family: 宋体">论文格式</span></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

  <a href="#lwzz">

  <span lang="EN-US">4 </span><span style="font-family: 宋体">论文的组织安排</span></a><span style="font-family: 宋体">&nbsp;&nbsp;

  <a href="#xzjq">&nbsp;</a></span><a href="#xzjq"><span lang="EN-US">5 </span><span style="font-family: 宋体">写作技巧和注意事项</span></a><span lang="EN-US">&nbsp;&nbsp;&nbsp; 

  <a href="#ckwx">6</a></span><span style="font-family: 宋体"><a href="#ckwx">参考文献及引用</a> 

  </span>&nbsp;<a href="#zyyb"><span lang="EN-US">7</span><span style="font-family: 宋体">摘要样板</span></a><span style="font-family: 宋体"> </span>&nbsp;<span lang="EN-US">&nbsp;</span></p>

  <p class="MsoNormal" style="line-height: 200%">&nbsp; <span style="font-family: 宋体">&nbsp;<a href="#ppt">8 怎样作答辩用</a></span><a href="#ppt"><span lang="EN-US">PowerPoint</span></a>&nbsp;&nbsp;

  <a href="#sjb">

  <span style="font-family: 宋体">9</span><span lang="EN-US"> 200</span>4<span style="font-family: 宋体">本科论文时间表

  及附加要求</span>

  <span style="font-family: 宋体">格式</span> <span style="font-family: 宋体">字体规定</span></a><span style="font-family: 宋体">&nbsp;

  <a href="#zx">10 致谢</a>&nbsp; </span><a href="#fy">11<span style="font-family: 宋体"> 关于译文和文献综述的新规定</span></a></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp; </span>

  <span style="font-family: 宋体">

  毕业设计和毕业论文是本科生培养方案中的重要环节。学生通过毕业论文,综合性地运用几年内所学知识去分析、解决一个问题,在作毕业论文的过程中,所学知识得到疏理和运用,它既是一次检阅,又是一次锻炼。不少学生在作完毕业设计后,感到自己的实践动手、动笔能力得到锻炼,增强了即将跨入社会去竞争,去创造的自信心。这里仅将我们教研室老师近年指导本科毕业生论文中的体会整理出来,希望能对学生毕业论文有所帮助。</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">

  <a name="lwlx"></a>1</span><span style="font-family: 宋体">.论文类型</span> </p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体">

  不同的院系,不同的指导教师对本科毕业论文有不同的指导方法,在计算机系,本科毕业论文通常以下面四种类型:</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">1.1 </span>

  <span style="font-family: 宋体">

  完成一个不太大的实际项目或在某一个较大的项目中设计并完成一个模块(如应用软件、工具软件或自行设计的板卡、接口等等),然后以工程项目总结或科研报告、或已发表的论文的综合扩展等形式完成论文。</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">1.2 </span>

  <span style="font-family: 宋体">

  对一个即将进行的项目的一部份进行系统分析(需求分析,平台选型,分块,设计部分模块的细化)。例如对一个大中型企业管理信息系统中的财务部分进行调研,分析和设计等,这类工作可以没有具体编程,但应得到有关方面的初步认可,有一定的工作量。例如打印后有</span><span lang="EN-US">30</span><span style="font-family: 宋体">页以上的报告。</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">1.3 </span>

  <span style="font-family: 宋体">对某一项计算机领域的先进技术或成熟软件进行分析、比较,进而能提出自己的评价和有针对性创见。例如</span><span lang="EN-US">XML</span><span style="font-family: 宋体">目前是因特网上新涌现的标记语言,它较</span><span lang="EN-US">HTML</span><span style="font-family: 宋体">有许多无可比拟的优点,其中</span><span lang="EN-US">XML-QL</span><span style="font-family: 宋体">是基于</span><span lang="EN-US">XML</span><span style="font-family: 宋体">提出的一种新型查询语言,分析总结这一新型查询语言并探索它的实现途径是十分有意义的工作。再如对自由软件数据库系统</span><span lang="EN-US">MySQL</span><span style="font-family: 宋体">,分析总结其在</span><span lang="EN-US">Web</span><span style="font-family: 宋体">应用上的特色,并能将有关技术用于自己研制的系统中。这类工作要注意把分析和实验相结合,不要只停留在消化上。消化是前提,吸收和转化才是工作的重点。</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">1.4 </span>

  <span style="font-family: 宋体">

  对某一个计算机科学中的理论问题有一定见解,接近或达到了在杂志上发表的水平。例如,解决了一个众所周知的问题,纠正了某杂志上理论的错误且提出解决修正方案,或自己提出有意义的模型,定义,且有定理、命题、或性能比较、分析、测试报告等。</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体">

  一般而言,第四种较难,在若干年指导本科生毕业论文经验中,只有两位学生采用此形式写出了好的论文,据悉,这两位学生都顺利进入了博士生序列。</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span style="font-family: 宋体"> </span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%; text-align:right">

  <a href="#top"><span style="font-family: 宋体">

  返回目录</span><span lang="EN-US"> </span></a></p>

  <p class="MsoNormal" style="line-height: 200%"><span style="font-family: 宋体"> </span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">

  <a name="xt"></a>2</span><span style="font-family: 宋体">.选题</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">2.1 </span>

  <span style="font-family: 宋体">

  有科研项目的老师通常愿意从项目中选取本科生能完成的模块,交给学生作,然后以第一种形式写成论文。教师熟悉项目,项目有实用背景,一般而言,多数学生经过努力都能完成。但有些科研项目太难,或涉及保密内容,或本科生不容易完成,在这种情况下,教师可能会让已保送为研究生,或确定留校的学生作这类题目。</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">2.2 </span>

  <span style="font-family: 宋体">

  学生自选题目,有些学生已联系好毕业后的工作单位,工作单位要求学生作某方面的项目,或已交给学生某方面的项目,经过指导教师认可,认为可作出合格的毕业论文,则可作这方面题目。这种方式下,学生积极性高,责任心较强,学以致用,一般论文的质量较好且成文后篇幅较大。</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">2.3 </span>

  <span style="font-family: 宋体">

  教师根据社会需求,选择题目。例如,院系行政需要教学,科研和研究生信息管理系统,有的教师指导几位学生分别作大学院系行政管理子系统,博士生硕士生学籍管理子系统等等,有可能开始作出的软件还不很完善,但有了雏形,经过修改后,一般是能够应用的。有的系统经过下一届本科生毕业实习的改进,就可以实用了。一些对路的、有用户的软件还有可能进一步发展为产品</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;</span></p>

  <p class="MsoNormal" style="line-height: 200%; text-align:right">

  <a href="#top"><span style="font-family: 宋体">

  返回目录</span><span lang="EN-US"> </span></a></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">

  <a name="lwzz"></a>3 </span><span style="font-family: 宋体">论文的组织安排</span><span lang="EN-US">&nbsp;&nbsp;

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体">

  依据上述的论文类型,由于各类工作特点的不同,在搜集整理论文的素材、组织安排论文的结构方面,应有所不同,做到有的放矢。</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">3.1 </span>

  <span style="font-family: 宋体">

  系统实现型论文:重点收集整理系统体系结构,程序模块调用关系,数据结构,算法,实验或测试等内容,论文结构一般安排如下:</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; (1)</span><span style="font-family: 宋体">引言或背景</span>

  <span style="font-family: 宋体">(概述题目背景,实现情况,自己开发的内容或模块)</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体">

  一般谈课题意义,综述已有成果,如”谁谁在文献某某中做了什么工作,谁谁在文献某某中有什么突出贡献“,用“但是”一转,分析存在问题,引出自己工作必要性、意义和价值、创新点和主要思想、方法和结果。然后用“本文组织如下:第二节第三节</span><span lang="EN-US">....&nbsp;

  </span><span style="font-family: 宋体">,第四节</span><span lang="EN-US">.....&quot;

  </span><span style="font-family: 宋体">作为这段结束。</span><span lang="EN-US"> </span>

  </p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; (2)</span><span style="font-family: 宋体">系统体系结构(强调系统的整体性,突出自己工作在整体中的位置)</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; (3)</span><span style="font-family: 宋体">主要实现功能的描述(包括模块调用关系,数据结构,算法说明,依据内容多少此部分可安排两到三节)</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp; &nbsp;&nbsp;(4)</span><span style="font-family: 宋体">实验或测试</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp; &nbsp;&nbsp;(5)</span><span style="font-family: 宋体">总结</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp; </span>

  <span style="font-family: 宋体"> </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">3.2 </span>

  <span style="font-family: 宋体">

  应用开发型论文:重点收集整理应用项目的背景分析,需求分析,平台选型,分块,设计部分模块的细化,使用的开发工具的内容。论文结构一般安排如下:</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体">引言(重点描述应用项目背景,项目开发特色,工作难度等)</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp; &nbsp;&nbsp;</span><span style="font-family: 宋体">项目分析设计(重点描述项目的整体框架,功能说明,开发工具简介等)</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp; &nbsp;&nbsp;</span><span style="font-family: 宋体">项目实现(重点描述数据库设计结果,代码开发原理和过程,实现中遇到和解决的主要问题,项目今后的维护和改进等,此部分可安排两到三节)</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp; &nbsp;&nbsp;</span><span style="font-family: 宋体">总结</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">3.3 </span>

  <span style="font-family: 宋体">

  分析比较型论文:重点收集整理有关的最新论文或软件,分析比较心得,实验数据等内容。论文结构一般安排如下:</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体">引言(重点描述分析对象的特点,分析比较工作的意义,主要结果等)</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体">分析对象的概括性描述</span><span lang="EN-US"> </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体">分析比较的主要结果(如果是技术分析,给出主要数据,如果是软件分析,给出代码分析结果,实验过程等)</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp; &nbsp;&nbsp;</span><span style="font-family: 宋体">分析比较的评价和系统应用(可以给出基于分析比较的结果,提出某些设计实现方案,和进行一些实验工作</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体">结论</span><span lang="EN-US"> </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">3.4 </span>

  <span style="font-family: 宋体">

  理论探索型论文:重点收集整理问题的发现,解决问题所用到的基本知识,解决问题的独特方法,定理证明,算法设计和分析。论文结构一般安排如下:</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; (1)</span><span style="font-family: 宋体">引言(重点描述要解决的问题的来源,难度,解决问题的主要方法等)</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp; &nbsp;&nbsp;(2)</span><span style="font-family: 宋体">基本知识(解决问题涉及的基本定义,定理,及自己提出的概念等)</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp; &nbsp;&nbsp;(3)</span><span style="font-family: 宋体">推理结论(给出问题解决方案,包括定理证明,算法设计,复杂性分析等)</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp; &nbsp;&nbsp;(4)</span><span style="font-family: 宋体">结论</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp; &nbsp;</span><span style="font-family: 宋体">上述论文结构的安排和划分不是绝对,可依据各自工作的实际情况,采用某一种或某几种混合的方式指导自己论文的写作。但无论采用什么样的结构,一定要作到心中有数,贯穿一条逻辑线索,切不可泛论成文或堆砌成文,时刻突出自己的工作内容。</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>

  </p>

  <p class="MsoNormal" style="line-height: 200%; text-align:right">

  <a href="#top"><span style="font-family: 宋体">

  返回目录</span><span lang="EN-US"> </span></a></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp; </span>

  <span style="font-family: 宋体"> </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">

  <a name="lwgsh"></a>4 </span><span style="font-family: 宋体">.论文格式及</span>

  <span style="font-family: 宋体">目录系统</span><span lang="EN-US"> </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体">

  每个作者有自己的风格,格式不必强求一致,但科技论文不能象写小说剧本那样,一般不能用倒叙,插叙,不设悬念,不用意识流,多线索方式等。例如,可在下列格式基础上适当修改:</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体">科技论文目录体系一般不用中文的</span>

  <span style="font-family: 宋体">“一</span> <span style="font-family: 宋体">二</span>

  <span style="font-family: 宋体">三”,而用下列的编排方式</span><span lang="EN-US"> </span>

  </p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体">题目</span><span lang="EN-US"> </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体">扉页</span><span lang="EN-US"> </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; |___

  </span><span style="font-family: 宋体">摘要(中英文,</span><span lang="EN-US">200-300</span><span style="font-family: 宋体">字为限)</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; |___

  </span><span style="font-family: 宋体">正文</span> <span style="font-family: 宋体">

  目录</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1</span><span style="font-family: 宋体">.前言(背景,动机,前人工作)</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 

  |___1.1&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-family: 宋体">。。。。</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 

  |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ( 1)&nbsp; </span><span style="font-family: 宋体">(</span><span lang="EN-US">a</span><span style="font-family: 宋体">)</span>

  <span style="font-family: 宋体">(</span><span lang="EN-US">b</span><span style="font-family: 宋体">)</span>

  <span style="font-family: 宋体">(</span><span lang="EN-US">c</span><span style="font-family: 宋体">)</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 

  |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (2)&nbsp;&nbsp; </span><span style="font-family: 宋体">(</span><span lang="EN-US">a</span><span style="font-family: 宋体">)</span>

  <span style="font-family: 宋体">(</span><span lang="EN-US">b</span><span style="font-family: 宋体">)(</span><span lang="EN-US">c</span><span style="font-family: 宋体">)</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 

  |___1.2&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="font-family: 宋体">。。。。</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2</span><span style="font-family: 宋体">.项目框图</span>

  <span style="font-family: 宋体">及</span> <span style="font-family: 宋体">

  本工作在项目中的地位</span><span lang="EN-US"> </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3</span><span style="font-family: 宋体">.项目特色(特殊功能,困难)</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4</span><span style="font-family: 宋体">.方案选择(前人方案,现可选方案,为什么</span>

  <span style="font-family: 宋体">选这一方案)</span><span lang="EN-US"> </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 5</span><span style="font-family: 宋体">.实现技术</span>

  <span style="font-family: 宋体">数据结构</span> <span style="font-family: 宋体">程序片段</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6</span><span style="font-family: 宋体">.特殊问题解决方法</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | 

  __6.1 </span><span style="font-family: 宋体">问题</span><span lang="EN-US">1

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 

  |__ 6.2 </span><span style="font-family: 宋体">问题</span><span lang="EN-US">2

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 

  |__ ...... </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7</span><span style="font-family: 宋体">.结果测试,性能分析(图表等)</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8</span><span style="font-family: 宋体">.结束语(或结论、小结)</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体">参考文献</span><span lang="EN-US"> </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体">附录</span><span lang="EN-US"> </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体">致谢</span><span lang="EN-US"> </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体"> </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体">目录可以用Word</span> <span style="font-family: 宋体">

  插入—目录功能</span> <span style="font-family: 宋体">实现,可自动编页自动更新</span></p>

  <p class="MsoNormal" style="line-height: 200%; text-align:right"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <a href="#top"><span style="font-family: 宋体">

  返回目录</span><span lang="EN-US"> </span></a></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体"> </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">

  <a name="xzjq"></a>5&nbsp; </span><span style="font-family: 宋体">.写作技巧和注意事项</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">5.1 </span>

  <span style="font-family: 宋体">

  学术论文要求文字流畅,层次清晰,词藻不能过分华丽,近年国内外在计算机方面的论文的语言较以前生动,但用词都以准确,不过分夸张为度。</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">5.2 </span>

  <span style="font-family: 宋体">

  标题要能反映内容。如有新意更好。例如,下面题目是个不好的题目:“图像处理的某些问题的研究”,论防火墙技术”等,其中的“某些问题”不如换成最中心的词汇。论防火墙技术题目太大,不适合本科生作。</span>

  </p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">5.3 </span>

  <span style="font-family: 宋体">学术刊物上论文摘要一般</span><span lang="EN-US">300</span><span style="font-family: 宋体">字左右,需要较高的综合能力。而学生毕业论文摘要可以写一页(</span><span lang="EN-US">1000</span><span style="font-family: 宋体">字左右),因此活动空间较大,要好写一些。</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体">摘要可以在全文写完后再写。要简明,</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp; &nbsp;&nbsp;</span><span style="font-family: 宋体">中英文摘要</span>

  <span style="font-family: 宋体">应一致,要突出自己的工作,要提供几个</span><span lang="EN-US">key 

  words</span><span style="font-family: 宋体">。</span><span lang="EN-US"> </span>

  </p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp; &nbsp;&nbsp;</span><span style="font-family: 宋体">写英文摘要时,可先用英文的习惯和用语写摘要</span><span lang="EN-US">(</span><span style="font-family: 宋体">可以借助于电子词典),然后英译汉</span><span lang="EN-US">,</span><span style="font-family: 宋体">用中文摘要去将就英文摘要。反过来,如果先写好中文摘要,再汉译英,则很难把英文摘要写得地道。</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体">为了使得英文表达地道、准确,可以读十几篇相关研究方向的论文的摘要,注意一些表达词的使用,如</span><span lang="EN-US">present, 

  implementation, propose, give, argue</span><span style="font-family: 宋体">等。</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体">平行的内容宜用平行的句型。例如下面的例子中,一句主动,一句被动,语感就非常糟糕:</span><span lang="EN-US">&quot;This 

  paper proposes a new algorithm and a prototype is presented.....&quot;. </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">5.4 </span>

  <span style="font-family: 宋体">

  前言部分要写问题背景,动机,要说明自己工作的工作有用,有意义(才能鼓励读者读下去),通常在介绍国内外工作后,用“但是”一转,指出前人工作的不足,引出自己的工作。在前言中简述自己作的主要结果,(例如明确地列出几条,说明本文的主要工作,主要成果)。前言部分的末尾介绍文章的组织情况,各节内容。</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">5.5 </span>

  <span style="font-family: 宋体">

  突出特色,一个项目中工作很多,有些是同行皆知,自己也无创新的,可以略写,要多写自己遇到的特殊困难和创造的特殊解决方法。使人家读了能学到东西,看到作者的创意。为了突出特色,还可以在一节中分成小标题写,一个问题一小段,与计算机相关的论文中还可以把数据结构和程序片段夹叙夹议呈现出来,比只用汉字解释得更清楚。</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">5.6 </span>

  <span style="font-family: 宋体">

  上升到理论,一般硕士论文会要求这一点。如果本科生能够在毕业论文中得出有意义的定理或命题,一般会认为是好成果。可能会被推荐到杂志上发表,或在考研、求职中得到承认。</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">5.7 </span>

  <span style="font-family: 宋体">各部分应详略得当。</span> <span style="font-family: 宋体">

  一般地,毕业论文应该主要写作者的见解和工作,</span><span lang="EN-US">&nbsp; </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span style="font-family: 宋体">

  把自己的创新写深写透。综述要有述有评有比较。只要是作了实验,写了程序,一般是想写的太多,写不完。反之,会感到空虚,没有写的,有的学生抄书来充篇幅,效果不好。一般地介绍相关工作(前人的成果)部分不应该超过总篇幅的</span><span lang="EN-US">1/6</span><span style="font-family: 宋体">。</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">5.8 </span>

  <span style="font-family: 宋体">完整的论文应包括测试、运行结果及分析(图表或曲线)。</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">5.9&nbsp; </span>

  <span style="font-family: 宋体">结论,小结。说明解决了什么问题,有什么创新,下一步工作主要内容等。</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%; text-align:right">

  <a href="#top"><span style="font-family: 宋体">

  返回目录</span><span lang="EN-US"> </span></a></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">

  <a name="ckwx"></a>6</span><span style="font-family: 宋体">、参考文献及引用</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体">

  参考文献是论文写作中的重要一环,带着问题读文献或杂志上的论文,不但注意学习学术内容,同时也注意学习选题方法、格式、标准的套话、起承转合的语言和方式,参考文献的写法,字体的运用等等。在论文中明确给出参考文献的出处,既代表着对前人成果的继承,也代表了对他人研究成果的尊崇,是科学研究中应培养的正确的科学态度和做人准则。</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体">参考文献的写法:按参考文献在论文中出现的顺序,用编码的方式给出,如</span><span lang="EN-US">[1]</span><span style="font-family: 宋体">,</span><span lang="EN-US">[2]</span><span style="font-family: 宋体">,等。参考文献包括专著、学术期刊、学术会议、技术报告等。详见范本示例。</span></p>

  <p class="MsoNormal" style="line-height: 200%; text-align:right"><span lang="EN-US">&nbsp;</span><a href="#top"><span style="font-family: 宋体">返回目录</span><span lang="EN-US"> </span>

  </a></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;</span><span style="font-family: 宋体"> </span><span lang="EN-US">

  </span><span style="font-family: 宋体"> </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;<a name="zyyb"></a> 

  7&nbsp; </span><span style="font-family: 宋体">摘要样板</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体">学术刊物上论文摘要一般</span><span lang="EN-US">300</span><span style="font-family: 宋体">字左右,需要较高的综合能力。而学生毕业论文摘要可以写到</span><span lang="EN-US">1000</span><span style="font-family: 宋体">字,因此活动空间较大,要好写一些。下面是可行写法之一。</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; 1.</span><span style="font-family: 宋体">介绍项目意义背景,</span><span lang="EN-US">100-200</span><span style="font-family: 宋体">字。</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; 2.</span><span style="font-family: 宋体">本文作的主要工作,</span>

  <span style="font-family: 宋体">(</span><span lang="EN-US">1</span><span style="font-family: 宋体">),</span>

  <span style="font-family: 宋体">(</span><span lang="EN-US">2</span><span style="font-family: 宋体">),</span>

  <span style="font-family: 宋体">(</span><span lang="EN-US">3</span><span style="font-family: 宋体">)</span><span lang="EN-US">,..... 

  ,&nbsp; 400</span><span style="font-family: 宋体">—</span><span lang="EN-US">600</span><span style="font-family: 宋体">字</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; 3.</span><span style="font-family: 宋体">本文组织</span>

  <span style="font-family: 宋体">第一章</span><span lang="EN-US">..</span><span style="font-family: 宋体">第二章</span><span lang="EN-US">..</span><span style="font-family: 宋体">第</span><span lang="EN-US">j</span><span style="font-family: 宋体">三章</span><span lang="EN-US">,.....

  </span><span style="font-family: 宋体">。</span><span lang="EN-US"> (&nbsp;&nbsp; 200</span><span style="font-family: 宋体">字</span><span lang="EN-US">)</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp; &nbsp;&nbsp;</span><span style="font-family: 宋体">下面是一个篇学生写的论文摘要</span><span lang="EN-US">(</span><span style="font-family: 宋体">中英文)样例</span><span lang="EN-US">..</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span style="font-family: 宋体"> </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span style="font-family: 宋体">

  拟周期及其关联规则采掘的研究与实现</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">XXX </span>

  <span style="font-family: 宋体">专业</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体">学生</span><span lang="EN-US"> XXX&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体">指导教师</span><span lang="EN-US"> YYY</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体">

  数据采掘是数据库技术、人工智能、机器学习、统计分析、模糊逻辑、模式识别、人工神经网络等多个学科相结合的产物。其中的时序数据(</span><span lang="EN-US">Time 

  Series</span><span style="font-family: 宋体">)采掘因其广泛的应用性与极高的商业价值成为了当前数据采掘研究的热点之一。</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体">本文的主要工作集中在:</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp; &nbsp;1.

  </span><span style="font-family: 宋体">述了当今国际上的一些成熟的时序采掘的产品和时序采掘的研究现状并提出了自己的看法。</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; 2.

  </span><span style="font-family: 宋体">

  针对以上的工作盲点提出拟周期等六个概念、抗干扰势态等五个算法和两个定理,建立了拟周期及其关联规则的采掘模型。在此模型上进行拟周期及其关联规则采掘系统</span><span lang="EN-US">RPMiner</span><span style="font-family: 宋体">的结构和模块设计。</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; 3.

  </span><span style="font-family: 宋体">使用</span><span lang="EN-US">Visual C ++

  </span><span style="font-family: 宋体">中的</span><span lang="EN-US">ODBC</span><span style="font-family: 宋体">技术实现了</span><span lang="EN-US">RPMiner</span><span style="font-family: 宋体">的各个功能模块。自行设计的源程序共有</span><span lang="EN-US">850K</span><span style="font-family: 宋体">。</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; 4.

  </span><span style="font-family: 宋体">

  对安宁河断裂带地震数据库数据进行试采掘,分析其采掘结果得出了两个出人意外的结果,一个是∶安宁河断裂带以</span><span lang="EN-US">5</span><span style="font-family: 宋体">周为小活动周期,而</span><span lang="EN-US">5</span><span style="font-family: 宋体">个月为较大的活动周期;另一个是∶在安宁河断裂带的北南方向,地形形变与地震的同步性比较明显。</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体">本文组织如下:</span><span lang="EN-US"> </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体">

  第一章介绍了数据采掘的基本概念和有关技术。第二章介绍了在数据采掘中当今时序采掘的产品方面和研究方面的情况,并总结了其特点与盲点。第三章,介绍了</span><span lang="EN-US">RPMiner</span><span style="font-family: 宋体">系统的设计,包括要实现的目标和提出来的基本概念。第四章,介绍了</span><span lang="EN-US">RPMiner</span><span style="font-family: 宋体">的实现,包括用以实现</span><span lang="EN-US">RPMiner</span><span style="font-family: 宋体">的</span><span lang="EN-US">Visual

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; C++</span><span style="font-family: 宋体">的关于</span><span lang="EN-US">ODBC</span><span style="font-family: 宋体">的一些技术,以及</span><span lang="EN-US">PRMiner</span><span style="font-family: 宋体">的使用介绍。第五章给出了对安宁河地震断裂带的地震数据库数据的试采掘结果分析。最后在第六章浅谈了我对数据采掘的发展趋势的一些看法。</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体">关键词:数据采掘</span> <span style="font-family: 宋体">

  时序采掘</span> <span style="font-family: 宋体">拟周期</span>

  <span style="font-family: 宋体">关联规则</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体"> </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; Research 

  and Implementation of Mining Relaxed Periods and their Association </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; Rules</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; 

  Specialty of Computer Science</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; 

  graduate: XXX&nbsp; Supervisor: YYY</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; Data 

  Mining is the main step in KDD process, it draws upon many techniques </span>

  </p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; from 

  diverse fields, such as database technology, artificial intelligence, machine 

  learning, statistics, fussy logic, pattern recognition, and artificial neural 

  network, etc. Mining on Time Series is a hot area of Data Mining due to its 

  widely used applications and its high commercial value.</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体"> </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; The main 

  contribution of this paper includes:</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; 1 Survey 

  the current mature products and research harvests </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">

  internationally;</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; 2 

  Propose six concepts of “Relaxed-Period” etc, five algorithms of &nbsp;“anti-noise 

  tendency” etc. and two theorems to fill the blind spot of the above 

  researches, forming the model of Mining Relaxed Periods and their Association 

  Rules;</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; 3 Based 

  on the previous model, design the system structure and all the sub-models of 

  RPMiner; A prototype called RPMiner is implemented based on ODBC and Visual C 

  ++. All the codes written by myself are almost 850K.</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; 4&nbsp; 

  Mining the seismic data of the fault belt along the River ANNING and analyzing 

  the results, two surprising results are uncovered, one is that 5 weeks is the 

  shorter periodicity while 5 months is the longer periodicity, the other one is 

  that the reform in the North-South direction gives a remarkable contribution 

  the earthquake magnitude..</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; The 

  theses is organized as follows: Section 1 introduces some basic concepts and 

  technology about data mining. Section 2 gives the survey on currently 

  international products and research harvests, summarizing their characters and 

  blind spots. Section3 is all about the design of the system RPMiner, including 

  the actualization goals and the basic concepts. Section 4 tells the whole 

  procedure of actualizing the RPMiner, including the synopsis of the Visual C++ 

  ODBC technology and the overlook of RPMiner. Section5 gives the background of 

  the mining data of the fracture belt along the River ANNING as well as the 

  analysis of the mining results. At last, in Section 6, some of my personal 

  opinions of the developing trend of data mining are&nbsp;&nbsp;&nbsp;&nbsp; proposed. </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; 

  Keywords: Data Mining, Time Series, Relaxed Period, Association Rule</span></p>

  <p class="MsoNormal" style="line-height: 200%; text-align:right">

  <a href="#top"><span style="font-family: 宋体">

  返回目录</span><span lang="EN-US"> </span></a></p>

  <p class="MsoNormal" style="line-height: 200%"><span style="font-family: 宋体"> </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp; &nbsp;<a name="ppt"></a></span>8<span style="font-family: 宋体">.怎样作答辩用</span><span lang="EN-US">PowerPoint</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp; </span>

  </p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体">答辩时间一般</span><span lang="EN-US">10-20</span><span style="font-family: 宋体">分钟,把自己的工作在10分钟内讲出来,是对综合能力、表达能力的挑战。这种能力在学生的一生中非常重要。(求职,面试,申请项目,总结等等)。作好</span><span lang="EN-US">PowerPoint</span><span style="font-family: 宋体">幻灯片是答辩好的重要环节。一般有下列要点:</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; (1)</span><span style="font-family: 宋体">每页8—10行字</span>

  <span style="font-family: 宋体">或</span> <span style="font-family: 宋体">

  一幅图。只列出要点,关键技术。</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp; &nbsp;&nbsp;(2)</span><span style="font-family: 宋体">毕业论文要突出自己的工作,不要在背景,前人工作上花过多时间。篇幅可以大致分配如下:</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体">提纲:1页,</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp; &nbsp;</span><span style="font-family: 宋体">背景:</span>

  <span style="font-family: 宋体">1—2页,</span><span lang="EN-US"> </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体">提出问题,分析问题:5页,</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp; &nbsp;&nbsp;</span><span style="font-family: 宋体">解决问题,</span>

  <span style="font-family: 宋体">10—15页,</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp; &nbsp;</span><span style="font-family: 宋体">小结:1</span>

  <span style="font-family: 宋体">页,主要成果,工作,程序量,效益等等。</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp; &nbsp;&nbsp;(3)

  </span><span style="font-family: 宋体">演讲者</span> <span style="font-family: 宋体">

  大约一分钟讲2页。听众一分钟可以看完4—5页。因此不能完全照着念。要用口语化的语言</span><span lang="EN-US">,</span><span style="font-family: 宋体">讲演式的语言。</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp; &nbsp;(4)</span><span style="font-family: 宋体">充分利用图形,可以在较短时间内传递较多信息。</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp; &nbsp;(5)

  </span><span style="font-family: 宋体">

  有些细节,如算法,可以全部用小字写在一页上,用红色标出特别重要的几个句子,讲解时可以快速</span><span lang="EN-US">&quot;</span><span style="font-family: 宋体">闪</span><span lang="EN-US">&quot;</span><span style="font-family: 宋体">过</span><span lang="EN-US">(20</span><span style="font-family: 宋体">秒),</span><span lang="EN-US">&quot;</span><span style="font-family: 宋体">算法如此页</span><span lang="EN-US">&quot;</span><span style="font-family: 宋体">,</span><span lang="EN-US">&quot;</span><span style="font-family: 宋体">要点是</span><span lang="EN-US">...&quot;,,</span><span style="font-family: 宋体">讲思想,介绍方法,讲关键。听众可以在较短时间内了解大意。</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp; &nbsp;&nbsp;(6)

  </span><span style="font-family: 宋体">10—15分钟的报告,准备20—22页</span>

  <span style="font-family: 宋体">即可。</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span style="font-family: 宋体"> </span></p>

  <p class="MsoNormal" style="line-height: 200%; text-align:right"><span lang="EN-US">&nbsp;</span><a href="#top"><span style="font-family: 宋体">返回目录</span><span lang="EN-US"> </span>

  </a></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;

  <a name="sjb"></a>&nbsp;200</span>4<span style="font-family: 宋体">本科论文时间表</span><span lang="EN-US">(</span><span style="font-family: 宋体">参考去年时间表暂定,稍后会有确切时间)</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp; &nbsp;5.10

  </span><span style="font-family: 宋体">交毕业设计任务书(可下载空白任务书)</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp; &nbsp;5.24

  </span><span style="font-family: 宋体">交论文最后版本</span>

  <span style="font-family: 宋体">给指导教师。</span><span lang="EN-US"> </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp; 

  &nbsp;5.27--6.1 </span><span style="font-family: 宋体">轮换或交叉评审,</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp; 

  &nbsp;6.3--6.7&nbsp;&nbsp; </span><span style="font-family: 宋体">答辩,分组进行。</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span style="font-family: 宋体"> </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; 

  200</span>4<span style="font-family: 宋体">本科论文附加要求</span>

  <span style="font-family: 宋体">格式</span> <span style="font-family: 宋体">字体规定</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体">1</span> <span style="font-family: 宋体">

  论文必须打印,A4纸</span><span lang="EN-US"> (</span><span style="font-family: 宋体">目前硕士论文规定用16开,近似于B5)</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体">2</span> <span style="font-family: 宋体">

  暂用硕士论文字体与字号(如以后学校有字体标准,以学校规定为准)</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp; &nbsp;</span><span style="font-family: 宋体">字体宋体</span><span lang="EN-US">

  </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp; &nbsp;</span><span style="font-family: 宋体">正文中</span>

  <span style="font-family: 宋体">论文标题:3号,标题1:小3,</span>

  <span style="font-family: 宋体">标题2:4号,标题3:小4</span>

  <span style="font-family: 宋体">标题加粗,</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体">正文:小4,</span><span lang="EN-US">&nbsp; </span>

  <span style="font-family: 宋体">参考文献:5号。</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体">英文摘要</span> <span style="font-family: 宋体">标题:小3,</span>

  <span style="font-family: 宋体">正文:小4,字体</span> <span style="font-family: 宋体">:</span><span lang="EN-US">Times 

  New Roman</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp; &nbsp;</span><span style="font-family: 宋体">在上述格式下,总篇幅控制在30页—</span><span lang="EN-US">4</span><span style="font-family: 宋体">0页。</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体">3</span> <span style="font-family: 宋体">

  用学校规定的封面(可下载</span> <span style="font-family: 宋体">待填写</span>

  <span style="font-family: 宋体">封面)。</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体">4</span> <span style="font-family: 宋体">

  附件中应有相关外文文献原文及其翻译(汉字5000字以上)。</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体">5</span> <span style="font-family: 宋体">

  本科学生答辩时,原则上要求作</span><span lang="EN-US">PowerPoint</span><span style="font-family: 宋体">幻灯片。</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span style="font-family: 宋体"> </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp;<a name="zx"></a> </span>

  10<span style="font-family: 宋体">致谢</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp; &nbsp;&nbsp;</span><span style="font-family: 宋体">中国人民大学数据库库与知识工程研究所孟晓峰博士对本指南提出了很好的修改意见,并介绍给人民大学的学生,特此致谢。</span></p>

  <p class="MsoNormal" style="line-height: 200%; text-align:right"><span lang="EN-US">&nbsp;&nbsp;&nbsp; </span>

  <span style="font-family: 宋体"><a href="#top">返回目录</a></span></p>

  <p class="MsoNormal" style="line-height: 200%"><span style="font-family: 宋体"> </span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; 

  <a name="fy"></a> </span>

  11<span style="font-family: 宋体"> 关于译文和文献综述的新规定</span></p>

  <p class="MsoNormal" style="line-height: 200%"><span lang="EN-US">&nbsp;&nbsp;&nbsp; 2001</span><span style="font-family: 宋体">年</span><span lang="EN-US">5</span><span style="font-family: 宋体">月,学校规定本科毕业生</span>

  <span style="font-family: 宋体">还要做与论文题目的文献综述和英译汉。文献综述可以在引言中叙述,英译汉可以在</span><span lang="EN-US">WEB</span><span style="font-family: 宋体">上下载相关英文文献,阅读后翻译。教师鼓励学生利用先进技术(如电子词典)辅助翻译。最后应该整理打印,装订在论文后面,一起上交,要求以后汉字5000字以上。</span></p>

</blockquote>



</body>



</html>
union(A,B):求集合A和B的并集
intersect(A,B):求集合A和B的交集
setdiff(A,B):求集合A和B的差集A-B
setdiff(U,A):求集合A关于全集U的补集
http://ckwsteven.pixnet.net/blog/post/29247996-%E7%94%A8jquery-postmessage%3A-cross-domain-scripting-goodness-%E8%A7%A3
http://www.dsw8.cn/caipu/jiachangcaipu/jiachangcaipuzhisushipian/163577.html
!相机
# 机身:Canon 7D
# 镜头:佳能EF-S 18-200/3.5-5.6 IS 镜头 

!购买
# 机身:10299~10799
## 新蛋:10399
## 锐意:10799
# 镜头:3900~4219 (3900的店暂时没货)
## 新蛋:4219
## 锐意:4219(带票4369)
# UV镜:
## B+W 72mm:799
## Hoya 72mm:180
## Kenko 72mm:86
# 液晶屏保护膜(新蛋):
## GGS 金钢III代 液晶屏保护膜 日本进口玻材 防爆层/防雾镜片: 95
## GGS 金钢 液晶屏保护膜 日本进口玻材 For Canon 7D: 88
# 清洁套装
## ERMA 爱尔玛 全效7合1清洁套装: 99
# 遮光罩
# 电池
## 佳能 LP-E6 电池:499
## 哈里通/桑格:159~169
# 存储卡(京东&新蛋)
## SanDisk 8GB UltraII 30MB/S CF:199
## 45MB/S:269
# 包?
## 三角包:乐摄宝TLZ1 TLZ2 
## 腰 包:乐摄宝PHOTORUNNER 乐摄宝Inverse100aw 200aw 
## 双 肩:乐摄宝Compu trekker AW  赛富图M17NXL 
# 三脚架?
## 500以内:维特利 3010B 3080B,3080B架子稍大,云台一样。 伟峰 FT-682T+6663H 
## 500元左右:百诺A127-n6+KB0套装 
## 800元左右:百诺旅游天使系列 A1681+B0 A2681+B1 
## 1000元+:可以考虑碳纤维的 

!购买策略
# 去之前要带的东西:
## 笔记本。里面必须装四个软件:Exiftool GUI(用来查新机的快门数)、Dead Pixel Test(用来检测CCD或COMS坏点),ACDSee 10(浏览RAW),Photoshop 
## 没有笔记本的,带一个优盘,带好上面四个软件的安装程序,届时可用JS的电脑
# 锐意/艺联
# 问机身和镜头的价格
# 谈价格
# 问配件,根据需求配置
# 谈总价格
# 验机之前,跟JS先把丑话说在前面(下面这些条件是我的一般做法,仅供参考):
## CCD若有任何一个坏点,不要
## LCD屏上若有超过三个亮点(包括三个),不要
## 镜头上有明显灰尘、手印、甚至其他印痕的,不要
## 机身LCD屏上有明显手印的,不要
## 电池触点明显发亮的,电池不要
## 机身反光板上有手印,或者明显异样痕迹的,不要
## 快门数超过300的,不要(此条仅对宾得机器有效)
## 若我可提出明显证据,证明此机为水货的(如箱内保修卡编号与机身编号不吻合),不要
### 如所有配件都需要有包装
# 验机
## 箱子拿过来,简略检查机箱包装,主要看是否有拆过的痕迹
## 封条,防伪标签
## 不要让JS拆,让JS站远点,自己动手拆箱。
## 箱子拆开,逐一检查里面的文档、保修卡、配件等等杂七杂八一大堆的东西。机身和镜头暂时不要动
## 检查Canon三号符合(机身 保修卡 包装盒)
## 戴手套,检查机身。主要看LCD上是否有手印,取景器、电池仓、卡仓是否有明显进灰。
### 边角是否有使用过的痕迹
### 热靴
### LCD
### 单反相机的镜头卡口,使用过一定会留有痕迹,购买新机的时候仔细检查,同时检查镜头触点表面有无污损
### 全新的佳能7D模式转盘处于P档,其他产品在全自动档。
### 佳能7D的录像选择键的初始状态在实时取景位置,买新机的时候注意查看
### 电池仓
## 打开机身盖,迅速查看一下反光板和镜头卡口,确定没啥问题,把机身盖盖上(注意这个动作要尽量快一点,因为长时间暴露反光板,机身内容易进灰,JS不干的。另外,不要用手或者其他东西去抠反光板。估计JS也不干)
# 镜头
## 拆开镜头包装,主要检查镜面、镜筒是否有明显痕迹(全新镜头的镜面,是相当干净的),把镜头对准光源看一下,检查内部是否有明显异物。轻轻晃动镜头两下,听一下是否有明显松动的声音。检查镜头卡口,看卡口触点是否有明显使用过的痕迹。
## 检查镜头序列号
## 主要检查镜片是否完整,对光检查前镜片有无污损毁坏,是否有镀膜脱落的现象
## 镜头后组除了要检查后镜片是否完整以外,还应该留意一下镜头的触点,新镜头的触点是没有使用痕迹的,如果触点表面不光洁,应该就是被使用过的。
## 佳能18-135mm镜头的按键初始位置如上,镜头处于自动对焦,防抖功能打开。
## 佳能18-135mm镜头前组:转动变焦环和对焦环,检查镜头运作是否正常,通上电源后检查各个焦段是否都能进行自动对焦。
# 检查电池,主要看触点是否有明显亮痕。若有明显亮点,可以怀疑不是全新电池
# 下面开始装电池,开机,检查CCD亮点
## 开机,随便乱拍几张,让机器预热2-3分钟。
## 盖上镜头盖,调成全手动模式。
## 机器调成最大光圈,快门数2秒,机内降噪关闭,防抖关闭。
## 从ISO800开始,一直到最高ISO(一般到ISO1600即可),每个ISO值下拍一张。保存成RAW最大格式。
## 将全黑图导入电脑,转JPG格式,用Dead Pixel Test软件,每张照片测一遍。
## 如果测试结果有坏点(注意,不是噪点。噪点无所谓),记下每个坏点的坐标。看看是不是每张图的坏点显示都是一个坐标。
## 把Dead Pixel Test里面“坏点界限数值”分别调成200、150,再重复5、6的过程。
## 在光线良好的环境下,对着一张白纸,曝光补偿+1,然后重复3、4步骤
## 全白图导入电脑,在Photoshop里,将百图反色显示成黑图,保存。再重复5、6、7过程。
## 使用Exiftool GUI 来查相机的快门数
### 运行ExifToolGUI,
### 找到并点击要查看快门次数的照片(应当用相机照的最后一张照片,照了几张就是几)
### 从右上角点击“Maker”,
### 从右侧列表中找到ShutterCount。
# 下面开始检查LCD亮点(这个比较简单)
## 盖上镜头盖,照一张全黑图
## 在LCD上放大浏览一遍,用肉眼观测有无亮点即可
# 上述过程若都没问题:
## 再乱拍几张
## 先把所有的东西(注意,所有的东西)装进箱内封好,再去交钱(避免JS在你交钱时调包配件)
## 交钱
## 开发票
## 要店家的名片
## 走人

把窗口设成绿色
#桌面空白处点击右键,选择“外观” 然后点击“高级”按钮
#选择“项目”列表里面的窗口(windows)
#再点颜色(color)  -其它颜色(others),
## 然后把Hue(色调)设为85,Sat(饱和度)设为90,Lum(亮度)设为205。
## 然后单击添加到自定义颜色(Add to custom colors),按"确定"...一直确定。   
 
把IE的网页背景变成绿色
#打开IE,点击工具(TOOLS)
#点INTERNET选项(INTERNET OPTIONS)
#点右下角的辅助功能(Assessibility)
#然后勾选不使用网页中指定的颜色(ignore colors specified on web pages),然后点"确定"退出
# 用默认的1,2,3插入尾注
# 等做完了所有工作,再用word的特殊字符将尾注编号替换为带方括号格式的[1],[2],[3]即可,当然也可以替换为:<>{}《》等格式。
# 具体操作办法如下:
## 如果用了尾注就查找尾注标记^e,然后全部替换为[^&]即可;
## 如果用了脚注就查找脚注标记^f,再全部替换为[^&]便可以了
* 注意查找时让“不限定格式”按钮为灰色

以此类推有很多特殊字符可以轻松替换,抛砖引玉,大家慢慢琢磨其中的奥秘吧。

* office2007只能替换正文中的序号。解决此问题的简单方法:只要将docx文档另存为doc文档,即可全部替换。
原料:白萝卜、牛腩、葱姜、花椒、干红椒、草果、香叶。

调味料:盐、老抽、糖、鸡精、料酒。

做法:

1、牛腩切块焯水后洗净,白萝卜切滚刀块,葱挽结、姜拍松。

2、锅内热油,七分热后放入葱姜煸出香味后,下入牛腩,炒至变色后,依次调入料酒、老抽、糖,煸炒上色。

3、往锅内放适量的水,烧开后炖二小时(高压锅25分钟)后,加入萝卜,调入适量的盐、鸡精,再炖至萝卜酥烂即可。
材料
油豆腐(真空包装)一袋,虾仁30G,牛角青椒半只,盐 香油 蒜末。
做法
1,油豆腐开封切三角块,虾仁过料酒码10分钟,青椒切成圈; 
2,热锅热油,先把虾仁炒一炒,稍稍变红色起盘待用; 
3,余油入蒜末稍稍爆香,入油豆腐和青椒炒,最后入虾仁翻炒; 
4,起锅前滴香油。
# [[优酷/迅雷看看去广告]]
# 严禁迅雷偷偷上传方法:
{{{
删除 c:\windows\system32\cid-store.dat 文件,然后在C;\windows\system32\目录下,新建一个文件夹,名称为cid-store.dat,就可以啦!
}}}
注意,eig默认计算的是right eigenvector,也就是说计算的是[V D] = eig(A) 是计算 A*V = V*D
如果要就算left eigenvector,需要用[W D] = eig(A.'); W=conj(W),这个计算的是W'*A = D*W'
# [a b c ...] = size(A)
# 计算矩阵中元素的个数:numel(A) 
设置不同分节的页码
# 跳到要开始插入页码的页面上,选取菜单"视图/页眉和页脚"
## 这时候会出现"页眉/页脚"工具条
## 而且你会发现这一页的页眉/页脚上多了几个字"页眉-第2节""页脚-第2节",右侧有"与上一节相同"字样,"页眉/页脚"工具条上的"链接到前一个"按钮是自动选中的。
## 而在插入"分节符 下一页"之前的页显示为"页眉-第1节""页脚-第1节"。
# 关键就在于此,WORD对第1节,第2节的定义实际上是让这2节可以定义不同的页眉和页角的,只要让第二节的"与上一节相同"字样消失就可以了
## 让它消失的方法就是点一下第2节的页眉和页角的"链接到前一个"按钮",就可以使第2节的页眉,页角设置与第1节不同了。
## 这时,单独设置第2节的页眉/页角,选择工具条上的"插入自动图文集/页码"即可。

以此类推,可以在一篇文档中任意插入多段不同的连续的页码,选取“设置页码格式”,还可以指定从任意数字开始计页码
ubuntu grub 引导程序
{{{
首先:ls
查看硬盘分区情况,如果你知道grub安装在哪儿了(比如我的在(hd1,3)/grub/,这个要记住,后面/grub的地方都要改成你对应的),那么就直接进行下一步。
如果不知道,那就ls每个分区,如:ls (hd1,3)/ ,如果正确就会显示里面到内容,直到找到grub
第二:set 
直接输入set可以查看root和prefix的配置,这步需要将它给成你找到到地方
例如我的如下:

代码: 
grub rescue>set root=(hd0,9)
grub rescue>set prefix=(hd0,9)/boot/grub
//上面是设置的,然后set查看下
grub rescue>set
grub rescue>root=root=(hd0,9)
grub rescue>prefix=(hd0,9)/boot/grub

第三:insmod 
这时继续如下输入就可以,会进入grub的菜单。
grub rescue>insmod (hd0,9)/boot/grub/normal.mod
第四:normal 
直接输入normal进入普通模式
rescue:grub>normal
看到你期盼的系统菜单了吧,终于可以进入系统了,哈哈哈
第五:update 
进入系统后,首先
sudo update-grub

將選單修正,再
sudo grub-install /dev/sda
sda是你的启动磁盘~
}}}
香肠炒油菜 原料 
香肠50克,油菜200克,植物油15克,盐10克,酱油5克,料酒2.5克,味精1.5克,姜末、葱花各少许。

香肠炒油菜 做法 
1、将香肠切成薄片;将油菜洗净切成短段,梗、叶分置。

2、锅内入油烧热,下姜末、葱花煸炒,先放油菜梗炒,再下油菜叶炒至半熟,倒入切好的香肠,并加入酱油,用旺火快炒几下,即成。
香肠炒油菜 特点 
# 计算高斯分布的积分: normcdf(x, mu, sigma) 即从负无穷积分到x