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

<channel>
	<title>Kiss Note</title>
	<atom:link href="http://kissnote.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://kissnote.com</link>
	<description>Keep IT Simple and Stupid</description>
	<lastBuildDate>Tue, 28 Jul 2009 15:31:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>J2EE &#8211; JNDI</title>
		<link>http://kissnote.com/2009/07/27/j2ee-jndi/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://kissnote.com/2009/07/27/j2ee-jndi/#comments</comments>
		<pubDate>Mon, 27 Jul 2009 23:53:45 +0000</pubDate>
		<dc:creator>shengjie</dc:creator>
				<category><![CDATA[J2EE]]></category>

		<guid isPermaLink="false">http://kissnote.com/?p=180</guid>
		<description><![CDATA[To understand JNDI, the only thing you need to learn is naming.
Very simply example,
DNS is a naming convention which is used to map the domain to IP. Such as www.test.com &#8211; 9.161.142.75.
Another difficult thing to understand is LDAP (Lightweight Directory Access Protocol). most likely you will see it from the product where you have database [...]]]></description>
			<content:encoded><![CDATA[<p>To understand <em><strong>JNDI</strong></em>, the only thing you need to learn is <strong>naming</strong>.</p>
<p>Very simply example,</p>
<p><em><strong>DNS </strong></em>is a naming convention which is used to map the domain to IP. Such as www.test.com &#8211; 9.161.142.75.</p>
<p>Another difficult thing to understand is <em><strong>LDAP </strong></em>(Lightweight Directory Access Protocol). most likely you will see it from the product where you have database storing all the users and you also have a LDAP server mapping all ther users as well (very popular usage).</p>
<p>Thus the LDAP name fn=Shengjie Min, p=SiChuan, c=CN names an LDAP entry fn=Shengjie Min, relative to the entry P=SiChuan,which in turn, is relative to C= CN.</p>
<p>So , back to the JNDI topic. JNDI allows us to look up any java object or LDAP directory based on the context. Hmm&#8230; not following..</p>
<p>Ok, one step by another,</p>
<h3>1. Bindings</h3>
<p>The association of a name with an object is called a <em>binding</em>. For example, a file name is <em>bound</em> to a file.</p>
<p>The DNS contains bindings that map machine names to IP addresses. An LDAP name is bound to an LDAP entry.</p>
<h3>2. Context</h3>
<p>A <em>context</em> is a set of name-to-object bindings</p>
<p>Examples are better than anything <img src='http://kissnote.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  That&#8217;s why i like them.</p>
<p>eg. you have a few database source(JDBC), let&#8217;s say they are a few databases. The context would be those databases entries. And to find one of the specific data source out of them, you will need to do a look up among those entries(context).</p>
<p>Given a code snippet to help out:</p>
<p><em><span style="color: #808080;">Context initCtx = new InitialContext();<span style="color: #ff00ff;"> // actually, to create a brand new initialContext, which can take hashmap as argument, you construct the hashmap to contain name-value pair. Just think of it as defining the scope of the look up</span><br />
</span></em></p>
<p><em><span style="color: #808080;">Context envCtx = (Context) initCtx.lookup(&#8221;java:comp/env&#8221;);</span></em></p>
<p><em><span style="color: #808080;">DataSource ds = (DataSource) envCtx.lookup(&#8221;jdbc/raDataSource&#8221;); </span><br />
</em></p>
]]></content:encoded>
			<wfw:commentRss>http://kissnote.com/2009/07/27/j2ee-jndi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>J2EE &#8211; structure</title>
		<link>http://kissnote.com/2009/07/27/j2ee-structure/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://kissnote.com/2009/07/27/j2ee-structure/#comments</comments>
		<pubDate>Mon, 27 Jul 2009 22:55:04 +0000</pubDate>
		<dc:creator>shengjie</dc:creator>
				<category><![CDATA[J2EE]]></category>

		<guid isPermaLink="false">http://kissnote.com/?p=162</guid>
		<description><![CDATA[J2EE components:
Application clients and applests components run on the client.
Servlet &#38; JSP are web components run on the server
EJB components are business components run on the server
Generally, J2EE server is in Pink   
Client &#60;&#8211;&#62; web tier(JSP/Servlet/Java Bean) &#60;&#8211;&#62;Business tier
More precisely,
Client &#60;&#8211;&#62; web tier(JSP/Servlet/Java Bean) &#60;&#8211;&#62;Business tier (Entity Bean/Session Bean/Message-Driven Bean) &#60;&#8211;&#62; DB Level
J2EE [...]]]></description>
			<content:encoded><![CDATA[<h2>J2EE components:</h2>
<p>Application clients and applests components run on the client.</p>
<p>Servlet &amp; JSP are web components run on the server</p>
<p>EJB components are business components run on the server</p>
<p>Generally, J2EE server is in <span style="color: #ff00ff;">Pink </span> <img src='http://kissnote.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><span style="color: #000080;">Client &lt;&#8211;&gt; <span style="color: #ff00ff;">web tier(JSP/Servlet/Java Bean) &lt;&#8211;&gt;Business tier</span></span></p>
<p>More precisely,</p>
<p><span style="color: #000080;">Client &lt;&#8211;&gt; <span style="color: #ff00ff;">web tier(JSP/Servlet/Java Bean) &lt;&#8211;&gt;Business tier (Entity Bean/Session Bean/Message-Driven Bean) <span style="color: #000080;">&lt;&#8211;&gt; DB Level</span></span></span></p>
<h2><span style="color: #000080;"><span style="color: #ff00ff;"><span style="color: #000080;"><span style="color: #000000;">J2EE Containers:</span><br />
</span></span></span></h2>
<p>Containers, no need to spend too much time here. Easy and Stupid.</p>
<ul>
<li>Application client container</li>
<li>web container</li>
<li>EJB container</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://kissnote.com/2009/07/27/j2ee-structure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>J2EE &#8211; Http Session</title>
		<link>http://kissnote.com/2009/07/27/j2ee-http-session/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://kissnote.com/2009/07/27/j2ee-http-session/#comments</comments>
		<pubDate>Mon, 27 Jul 2009 20:31:28 +0000</pubDate>
		<dc:creator>shengjie</dc:creator>
				<category><![CDATA[J2EE]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[servlet]]></category>
		<category><![CDATA[session]]></category>

		<guid isPermaLink="false">http://kissnote.com/?p=157</guid>
		<description><![CDATA[Very Simple Example。Http Session is stateless, keep track what user is doing.
SessionServlet
public class SersionServlet extends HttpServlet implements Servlet {
 HttpSerssions session = request.getSession(false);  //takes any two params, false, if user has session, give it to me; true, if user has no session, create one
 if(session == null) {
 session = reuqest.getSession(true);
 session.setAttribute(&#8221;count&#8221;, hitCount);
 }
 [...]]]></description>
			<content:encoded><![CDATA[<p>Very Simple Example。Http Session is stateless, keep track what user is doing.</p>
<p>SessionServlet</p>
<p><span style="color: #808080;"><em>public class SersionServlet extends HttpServlet implements Servlet {</em></span></p>
<p><span style="color: #c0c0c0;"><em><span style="color: #808080;"> HttpSerssions session = request.getSession(false); </span> <span style="color: #0000ff;">//takes any two params, false, if user has session, give it to me; true, if user has no session, create one</span></em></span></p>
<p><span style="color: #c0c0c0;"><em> <span style="color: #808080;">if(session == null) {</span></em></span></p>
<p><span style="color: #808080;"><em> session = reuqest.getSession(true);</em></span></p>
<p><span style="color: #808080;"><em> session.setAttribute(&#8221;count&#8221;, hitCount);</em></span></p>
<p><span style="color: #808080;"><em> }</em></span></p>
<p><span style="color: #808080;"><em> Integer hitCount = (Integer)session.getAttribte(&#8221;count&#8221;);</em></span></p>
<p><span style="color: #808080;"><em> hitCount = new Integer(hitCount.intValue()) + 1;</em></span></p>
<p><span style="color: #808080;"><em> response.getWriter().print(&#8221;Number of times at this page &#8221; + hitCount.intValue() );</em></span></p>
<p><span style="color: #808080;"><em>}</em></span></p>
<p>So, when user hit this servlet, it will be increased by 1 everytime user refreshes the page.</p>
]]></content:encoded>
			<wfw:commentRss>http://kissnote.com/2009/07/27/j2ee-http-session/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jar command</title>
		<link>http://kissnote.com/2009/06/29/jar-command/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://kissnote.com/2009/06/29/jar-command/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 15:05:21 +0000</pubDate>
		<dc:creator>shengjie</dc:creator>
				<category><![CDATA[Tips Everyday]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[jar]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://kissnote.com/?p=151</guid>
		<description><![CDATA[//create Jar file
jar -cmf 
c:create
f:file
m:manifast
eg. jar -cmf -C ./workspace/jar-test/classes myJarTest.jar *.class
//Extract Jar file
jar -xf
x:extract
f:file
eg. jar -xf myJarTest.jar
// update jar file
jar -uf
u: update

eg. jar uf foo.jar foo.class
//list jar file content as a table
jar -tf
t:table
eg. jar -tf myJarTest.jar
]]></description>
			<content:encoded><![CDATA[<p>//create Jar file</p>
<p><strong>jar -cmf </strong></p>
<p>c:create</p>
<p>f:file</p>
<p>m:manifast</p>
<p>eg. jar -cmf -C ./workspace/jar-test/classes myJarTest.jar *.class</p>
<p>//Extract Jar file</p>
<p><strong>jar -xf</strong></p>
<p>x:extract</p>
<p>f:file</p>
<p>eg. jar -xf myJarTest.jar</p>
<p>// update jar file</p>
<p><strong>jar -uf</strong></p>
<p>u: update<strong><br />
</strong></p>
<p>eg. jar uf foo.jar foo.class</p>
<p>//list jar file content as a table</p>
<p><strong>jar -tf</strong></p>
<p>t:table</p>
<p>eg. jar -tf myJarTest.jar</p>
]]></content:encoded>
			<wfw:commentRss>http://kissnote.com/2009/06/29/jar-command/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>db2 geeks &#8211; we do everything by typing commands</title>
		<link>http://kissnote.com/2009/06/15/db2-geeks-we-do-everything-by-typing-commands/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://kissnote.com/2009/06/15/db2-geeks-we-do-everything-by-typing-commands/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 21:50:45 +0000</pubDate>
		<dc:creator>shengjie</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[db2]]></category>

		<guid isPermaLink="false">http://kissnote.com/?p=140</guid>
		<description><![CDATA[Catalog remote node
catalog tcpip node db2node remote hostname server service_name
uncatalog node db2node

Catalog remote DB2 databases
catalog database db_name as alias_name at node db2node
uncatalog database dbname
List all odbc data sources
list system/user odbc data sources
catalog/uncatalog system/user odbc data source &#60;data source name&#62;
connect to database user name using password
Run sql scripts
To run a script, enter the following command:
db2 -f [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Catalog remote node</strong></p>
<p>catalog tcpip node db2node remote hostname server service_name</p>
<p>uncatalog node db2node<br />
<strong><br />
Catalog remote DB2 databases</strong></p>
<p>catalog database db_name as alias_name at node db2node</p>
<p>uncatalog database dbname</p>
<p><strong>List all odbc data sources</strong></p>
<p>list system/user odbc data sources</p>
<p>catalog/uncatalog system/user odbc data source &lt;data source name&gt;</p>
<p>connect to database user name using password</p>
<p><strong>Run sql scripts</strong></p>
<p>To run a script, enter the following command:</p>
<p>db2 -f script_name -o -t -z log_name</p>
<p>db2 –tvf script_name</p>
<p><strong>Describe Table Schema</strong></p>
<p>Describe table &lt;table_name&gt;</p>
<p><strong>Describe Table Indexes</strong></p>
<p>Describe indexes for table &lt;table_name&gt;</p>
<p><strong>Create Index</strong></p>
<p>Create index &lt;index_name&gt; on &lt;table_name&gt;(field1, field2….)</p>
<p>Create unique index &lt;index_name&gt; on &lt;table_name&gt;(field1, field2….) include (field3, field4….) ALLOW REVERSE SCANS COLLECT SAMPLED DETAILED STATISTICS</p>
<p><strong>Drop Index</strong></p>
<p>Drop index &lt;index_name&gt;</p>
<p><strong>Instance-level commands(CREATE DATABASE and FORCE APPLICATION)</strong></p>
<p>Eg.Reslove the table lock</p>
<p>attach to nodename user user name using password</p>
<p>list applications</p>
<p>force application (appid1, appid2)</p>
<p>OR</p>
<p>db2 attach to $DB2INSTANCE</p>
<p>db2 force application all</p>
<p>db2 detach</p>
]]></content:encoded>
			<wfw:commentRss>http://kissnote.com/2009/06/15/db2-geeks-we-do-everything-by-typing-commands/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>最简单的dojo学习笔记 &#8211; Part 2(create a widget)</title>
		<link>http://kissnote.com/2009/05/19/%e6%9c%80%e7%ae%80%e5%8d%95%e7%9a%84dojo%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b0-part-2create-a-widget/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://kissnote.com/2009/05/19/%e6%9c%80%e7%ae%80%e5%8d%95%e7%9a%84dojo%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b0-part-2create-a-widget/#comments</comments>
		<pubDate>Tue, 19 May 2009 15:41:46 +0000</pubDate>
		<dc:creator>shengjie</dc:creator>
				<category><![CDATA[Dojo]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://kissnote.com/?p=116</guid>
		<description><![CDATA[&#60;Create Your Own Widget Class/&#62;
Creating a Widget Programmatically
var button1 = new dijit.form.Button(params, srcNodeRef);
eg.
new dijit.form.Button({ &#8220;class&#8221;: &#8220;large&#8221;, style: &#8220;color: red&#8221; }, dojo.byId(&#8221;someDiv&#8221;));
&#60;div id=&#8221;someDiv&#8221; class=&#8221;large&#8221; style=&#8221;color:red&#8221;&#62;&#60;/div&#62;
Creating a Widget declaratively
eg.
&#60;div dojoType=&#8221;dijit.TitlePane&#8221; title=&#8221;Outer Pane&#8221;&#62;&#60;/div&#62;
IMPORTANT:
startup()
Certain widgets require a startup() method to be called. Haha, java is here again   just like GUI, rite?
accordion = new dijit.layout.AccordionContainer({}, dojo.byId(&#8221;accordionShell&#8221;));
accordion.addChild(new dijit.layout.ContentPane());
accordion.addChild(new dijit.layout.ContentPane());
accordion.addChild(new [...]]]></description>
			<content:encoded><![CDATA[<p><strong>&lt;Create Your Own Widget Class/&gt;</strong><br />
Creating a Widget Programmatically<br />
var button1 = new dijit.form.Button(params, srcNodeRef);<br />
eg.<br />
new dijit.form.Button({ &#8220;class&#8221;: &#8220;large&#8221;, style: &#8220;color: red&#8221; }, dojo.byId(&#8221;someDiv&#8221;));<br />
&lt;div id=&#8221;someDiv&#8221; class=&#8221;large&#8221; style=&#8221;color:red&#8221;&gt;&lt;/div&gt;</p>
<p>Creating a Widget declaratively<br />
eg.<br />
&lt;div dojoType=&#8221;dijit.TitlePane&#8221; title=&#8221;Outer Pane&#8221;&gt;&lt;/div&gt;</p>
<p>IMPORTANT:<br />
startup()<br />
Certain widgets require a startup() method to be called. Haha, java is here again <img src='http://kissnote.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  just like GUI, rite?</p>
<p>accordion = new dijit.layout.AccordionContainer({}, dojo.byId(&#8221;accordionShell&#8221;));<br />
accordion.addChild(new dijit.layout.ContentPane());<br />
accordion.addChild(new dijit.layout.ContentPane());<br />
accordion.addChild(new dijit.layout.ContentPane());<br />
accordion.startup(); //after all the elements added, start up</p>
<p>Interacting with Widgets<br />
Obtaining a Widget Reference<br />
dijit.byId(&#8221;idOfWidget&#8221;)</p>
<p><strong>&lt;Write Your Own Widget Class/&gt;</strong><br />
IMPORTANT: I know it&#8217;s cool hack the source code is cool, but that should be last thing you want to do if there is no suitable widget.</p>
<p>WHY the dojo div i put in is so different from what ends up in &#8220;view page source&#8221;?<br />
Dojo replaces the simple nodes of our example with groups of HTML elements. That&#8217;s one of the jobs of the Dojo parser.</p>
<p>eg.</p>
<p>&lt;div dojoType=&#8221;dijit.layout.AccordionPane&#8221; title=&#8221;pane 1&#8243;&gt;<br />
Text of Pane 1<br />
&lt;/div&gt;</p>
<p>dijit/layout/templates/AccordionPane.html:<br />
&lt;div class=&#8217;dijitAccordionPane&#8217;<br />
&gt;&lt;div dojoAttachPoint=&#8217;titleNode,focusNode&#8217; dojoAttachEvent=&#8217;ondijitclick:_onTitleClick,onkeypress:_onKeyPress&#8217;<br />
class=&#8217;dijitAccordionTitle&#8217; wairole=&#8221;tab&#8221;<br />
&gt;&lt;div class=&#8217;dijitAccordionArrow&#8217;&gt;&lt;/div<br />
&gt;&lt;div class=&#8217;arrowTextUp&#8217; waiRole=&#8221;presentation&#8221;&gt;?&lt;/div<br />
&gt;&lt;div class=&#8217;arrowTextDown&#8217; waiRole=&#8221;presentation&#8221;&gt;?&lt;/div<br />
&gt;&lt;span dojoAttachPoint=&#8217;titleTextNode&#8217;&gt;${title}&lt;/span&gt;&lt;/div<br />
&gt;&lt;div&gt;&lt;div dojoAttachPoint=&#8217;containerNode&#8217; style=&#8217;overflow: hidden; height: 1px; display: none&#8217;<br />
dojoAttachEvent=&#8217;onkeypress:_onKeyPress&#8217;<br />
class=&#8217;dijitAccordionBody&#8217; waiRole=&#8221;tabpanel&#8221;<br />
&gt;&lt;/div&gt;&lt;/div&gt;<br />
&lt;/div&gt;</p>
<p>${title}<br />
is replaced with the title=&#8221;&#8230;&#8221; attribute sent to the widget<br />
dojoAttachPoint=&#8217;containerNode&#8217;<br />
An attachPoint is a tag merged with user-provided HTML. It&#8217;s like a substitution variable for HTML.<br />
what is attachPoint</p>
<p>//hm?? what the ** ??</p>
<p>eg.<br />
sepecify dojoAttachPoint=&#8217;titleNode,focusNode&#8217; so that you can use the reference in the widget (this.titleNode).</p>
<p>dojoAttachEvent=&#8217;onkeypress:_onKeyPress&#8217;<br />
Connects an event to an event handler at that node.</p>
<p>Dijit.Declaration</p>
<p>declaratively create a widget<br />
eg1.<br />
&lt;div dojoType=&#8221;dijit.Declaration&#8221;<br />
widgetClass=&#8221;dojoc.widget.ImageAccordion&#8221;<br />
mixins=&#8221;dijit.layout.AccordionPane&#8221;<br />
&gt;&lt;div class=&#8217;dijitAccordionPane&#8217;<br />
&gt;&lt;div dojoAttachPoint=&#8217;titleNode,focusNode&#8217;<br />
dojoAttachEvent=&#8217;ondijitclick:_onTitleClick,onkeypress:_onKeyPress&#8217;<br />
class=&#8217;dojocAccordionTitle&#8217; wairole=&#8221;tab&#8221;<br />
&gt;&lt;div class=&#8217;dijitAccordionArrow&#8217;&gt;&lt;/div<br />
&gt;&lt;div class=&#8217;arrowTextUp&#8217; waiRole=&#8221;presentation&#8221;&gt;?&lt;/div<br />
&gt;&lt;div class=&#8217;arrowTextDown&#8217; waiRole=&#8221;presentation&#8221;&gt;?&lt;/div<br />
&gt;&lt;span dojoAttachPoint=&#8217;titleTextNode&#8217;&gt;&lt;img alt=&#8221;${title}&#8221; src=&#8221;${src}&#8221;<br />
&gt;&lt;/span&gt;&lt;/div<br />
&gt;&lt;div&gt;&lt;div dojoAttachPoint=&#8217;containerNode&#8217;<br />
style=&#8217;overflow: hidden; height: 1px; display: none&#8217;<br />
dojoAttachEvent=&#8217;onkeypress:_onKeyPress&#8217;<br />
class=&#8217;dojocImageAccordionBody&#8217; waiRole=&#8221;tabpanel&#8221;<br />
&gt;&lt;/div&gt;&lt;/div&gt;<br />
&lt;/div&gt;<br />
&lt;/div&gt;<br />
eg2.<br />
&lt;div dojoType=&#8221;dijit.Declaration&#8221; widgetClass=&#8221;simpleConnectedWidget&#8221; &gt;<br />
Just a plain ol&#8217; piece of text<br />
&lt;script type=&#8221;dojo/connect&#8221; event=&#8221;dblclick&#8221;&gt;<br />
console.debug(&#8221;Ouch!  I&#8217;ve been double-clicked&#8221;);<br />
&lt;/script&gt;<br />
&lt;/div&gt;</p>
<p>Notes</p>
<p>* widgetsInTemplate is automatically set to true, so any widgets you place in the template will be automatically filled in.<br />
* If you do not specify mixin, the widget class will be a subclass of dijit._Widget and mix in dijit._Templated. If you specify mixin, the first class listed must be a subclass of dijit._Widget. At least one of the mixins should itself mixin dijit._Templated, or you should supply dijit._Templated yourself as a mixin.<br />
* Only one extension point implementation of preamble.</p>
<p>programatically create a widget(More flexible &#8211; dijit.declare )<br />
one class -&gt; multiple templates</p>
<p>eg.<br />
dojoc/layout/ImageAccordion.js<br />
// all packages need to dojo.provide() _something_, and only one thing<br />
dojo.provide(&#8221;dojoc.widget.ImageAccordion&#8221;);<br />
// AccordionContainer is the module with dijit.layout.AccordionPane<br />
dojo.require(&#8221;dijit.layout.AccordionContainer&#8221;);<br />
// our declared class<br />
dojo.declare(&#8221;dojoc.widget.ImageAccordion&#8221;,<br />
// we inherit from this class, which in turn mixes<br />
// in _Templated and _Layout<br />
[ dijit.layout.AccordionPane ],<br />
// class properties:<br />
{<br />
templatePath: dojo.moduleUrl(&#8221;dojoc&#8221;,&#8221;layout/templates/ImageAccordion.html&#8221;),<br />
// Necessary to keep Dijit from using templateString in AccordionPane<br />
templateString: &#8220;&#8221;,<br />
// src: String<br />
//      src url for AccordionPaneExtension header<br />
src: &#8220;&#8221;<br />
});</p>
<p>dojoc/widgets/template/ImageAccordion.html:<br />
&lt;div class=&#8217;dojocImageAccordion&#8217;<br />
&gt;&lt;div dojoAttachPoint=&#8217;titleNode,focusNode&#8217;<br />
dojoAttachEvent=&#8217;ondijitclick:_onTitleClick,onkeypress:_onTitleKeyPress,onfocus:_handleFocus,onblur:_handleFocus&#8217;<br />
class=&#8217;dojocImageAccordionTitle&#8217; wairole=&#8221;tab&#8221;<br />
&gt;&lt;img alt=&#8221;${title}&#8221; src=&#8221;${src}&#8221;<br />
&gt;&lt;/div<br />
&gt;&lt;div&gt;&lt;div dojoAttachPoint=&#8217;containerNode&#8217;<br />
style=&#8217;overflow: hidden; height: 1px; display: none&#8217;<br />
class=&#8217;dojocImageAccordionBody&#8217; waiRole=&#8221;tabpanel&#8221;<br />
&gt;&lt;/div&gt;&lt;/div&gt;<br />
&lt;/div&gt;</p>
<p><strong>&lt;The Widget Life-cycle/&gt;</strong></p>
<p>onstructor<br />
Your constructor method will be called before the parameters are mixed into the widget, and can be used to initialize arrays, etc.<br />
parameters are mixed into the widget instance<br />
This is when attributes in the markup (ex: &lt;button iconClass=&#8230;&gt;) are mixed in<br />
postMixInProperties<br />
If you provide a postMixInProperties method for your widget, it will be invoked before rendering occurs, and before any dom nodes are created. If you need to add or change the instance&#8217;s properties before the widget is rendered &#8211; this is the place to do it.<br />
buildRendering<br />
_Templated provides an implementation of buildRendering that most times will do what you need. The template is fetched/read, nodes created and events hooked up during buildRendering. If you dont mixin _Templated (and most OOTB dijits do) and want to handle rendering yourself (e.g. to really streamline a simple widget, or even use a different templating system) this is where you&#8217;d do it.<br />
&#8212;&#8212;&#8212;&#8212;&gt; widget rendered<br />
postCreate<br />
This is typically the workhorse of a custom widget. The widget has been rendered (but note that sub-widgets in the containerNode have not!)<br />
startup<br />
If you need to be sure parsing and creation of any child widgets is complete, use startup.<br />
destroy<br />
Implement destroy if you have special tear-down work to do (the superclasses will take care of most of it for you; be sure to call this.inherited(arguments);)</p>
]]></content:encoded>
			<wfw:commentRss>http://kissnote.com/2009/05/19/%e6%9c%80%e7%ae%80%e5%8d%95%e7%9a%84dojo%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b0-part-2create-a-widget/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>最简单的dojo学习笔记 &#8211; Part 1(dojo basics)</title>
		<link>http://kissnote.com/2009/05/19/%e6%9c%80%e7%ae%80%e5%8d%95%e7%9a%84dojo%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b0-part-1/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://kissnote.com/2009/05/19/%e6%9c%80%e7%ae%80%e5%8d%95%e7%9a%84dojo%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b0-part-1/#comments</comments>
		<pubDate>Tue, 19 May 2009 15:30:08 +0000</pubDate>
		<dc:creator>shengjie</dc:creator>
				<category><![CDATA[Dojo]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://kissnote.com/?p=106</guid>
		<description><![CDATA[&#60;dojo functions/&#62;
1.  dojo.require(&#8221;dojo.fx&#8221;);
//This registers a function to be run when the document (and all required dependencies) are ready
2. dojo.addOnLoad(function(){
console.log(&#8221;document ready!&#8221;);
});
similarly,
var init = function(){
console.log(&#8221;document ready!&#8221;);
}
3. dojo.addOnLoad(init);
4. dojo.byId -  get DomNode
5. digit.byId &#8211; get widget
6. dojo.query &#8211; returns a list of Dom nodes based on CSS selector
eg.  // every element in the page with the class &#8220;blueButton&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p><strong>&lt;dojo functions/&gt;</strong></p>
<p>1.  dojo.require(&#8221;dojo.fx&#8221;);<br />
//This registers a function to be run when the document (and all required dependencies) are ready<br />
2. dojo.addOnLoad(function(){<br />
console.log(&#8221;document ready!&#8221;);<br />
});<br />
similarly,<br />
var init = function(){<br />
console.log(&#8221;document ready!&#8221;);<br />
}<br />
3. dojo.addOnLoad(init);</p>
<p>4. dojo.byId -  get DomNode<br />
5. digit.byId &#8211; get widget</p>
<p>6. dojo.query &#8211; returns a list of Dom nodes based on CSS selector</p>
<p>eg.  // every element in the page with the class &#8220;blueButton&#8221; assigned<br />
dojo.query(&#8221;.blueButton&#8221;).forEach(function(node, index, arr){<br />
console.debug(node.innerHTML);<br />
});</p>
<p>7.dojo.forEach<br />
eg.disable all the select tags<br />
dojo.forEach(<br />
dojo.query(&#8221;select&#8221;, document),<br />
function(selectTag) {<br />
selectTag.disabled = true;<br />
}<br />
);<br />
// &gt;= 1.0 only.<br />
dojo.query(&#8221;select&#8221;, document).forEach(&#8221;item.disabled = true;&#8221;);</p>
<p>8. dojo.connect</p>
<p>eg. connect event to js event handler<br />
function helloPressed(){<br />
alert(&#8217;You pressed the button&#8217;);<br />
}</p>
<p>function init(){<br />
button = dojo.byId(&#8217;helloButton&#8217;);<br />
dojo.connect(button, &#8216;onclick&#8217;, &#8216;helloPressed&#8217;);<br />
}</p>
<p>eg.bind mult connections when exampleObj.bar() gets called, exampleObj.foo() will be called.<br />
var exampleObj = {<br />
counter: 0,<br />
foo: function(){<br />
alert(&#8221;foo&#8221;);<br />
this.counter++;<br />
},<br />
bar: function(){<br />
alert(&#8221;bar&#8221;);<br />
this.counter++;<br />
}<br />
};</p>
<p>dojo.connect(exampleObj, &#8220;foo&#8221;, exampleObj, &#8220;bar&#8221;);</p>
<p><strong>&lt;OO -Object Orientied/&gt;</strong><br />
OO,think is as Java.</p>
<p>pass Functions as Variables<br />
eg.</p>
<p>function applyTwoParameterFn(a, b, function){<br />
return function(a,b);<br />
}<br />
console.debug(applyTwoParameterFn(1, 2, Math.max)); //not as strict as java in terms of type/variables checking.</p>
<p><strong><br />
&lt;delcare a class/&gt;</strong> &#8211; woo&#8230; pretty much like java<br />
dojo.declare(&#8221;ClassName&#8221;, null, {/*class body*/});</p>
<p>dojo.declare(&#8221;Person&#8221;, null, {<br />
constructor: function(name, age, currentResidence){<br />
this.name=name;<br />
this.age=age;<br />
this.currentResidence=currentResidence;<br />
},<br />
moveToNewState: function(newState){<br />
this.currentResidence=newState;<br />
}<br />
});<br />
eg. create person class and instantialize it</p>
<p>var matt= new Person(&#8217;Matt&#8217;, 25, &#8216;New Mexico&#8217;);</p>
<p><strong>&lt;Arrays and Objects as Member Variables/&gt;</strong><br />
eg.<br />
dojo.declare(&#8221;my.classes.bar&#8221;, my.classes.foo, {<br />
constructor: function() {<br />
this.someData = [ ]; // each object has it&#8217;s own array<br />
},<br />
someData: [1, 2, 3, 4], // doesn&#8217;t do what I want: ends up being static<br />
numItem : 5, // one per bar<br />
strItem : &#8220;string&#8221;, // one per bar<br />
statics: { counter: 0, somethingElse: &#8220;hello&#8221; } // static variables<br />
});</p>
<p>IMPORTANT:<br />
Why is this true for arrays and objects, but not primitives? It&#8217;s because, like most OOP languages, JavaScript uses object references. For example, given:</p>
<p>x = { fruit: &#8220;apple&#8221; };<br />
y = x;</p>
<p>Now x and y both refer to the same object. Modifying x.fruit will also affect y.fruit.</p>
<p><strong>&lt;inheritance/&gt;</strong> &#8211; haha, it is java<br />
dojo.declare(&#8221;Employee&#8221;, Person, {<br />
constructor: function(name, age, currentResidence, position){<br />
// remember, Person constructor is called automatically as the parent<br />
this.password=&#8221;";<br />
this.position=position;<br />
},<br />
login: function(){<br />
if(this.password){<br />
alert(&#8217;you have successfully logged in&#8217;);<br />
}else{<br />
alert(&#8217;please ask the administrator for your password&#8217;);<br />
}<br />
}<br />
});<br />
initialize the subclass<br />
var kathryn=new Employee(&#8217; Kathryn &#8216;, 26, &#8216;Minnesota&#8217;, &#8216;Designer&#8217;);</p>
<p>Calling Superclass Methods<br />
someMethod: function() {<br />
// call base class someMethod<br />
this.inherited(arguments);<br />
// now do something else<br />
}</p>
<p><strong>&lt;Mixins/&gt;</strong> &#8211; multiple inheritance, hmm&#8230; java doesn&#8217;t do this.<br />
eg. blizzard class will inherit VanillaSoftServe, MandMs, CookiDough<br />
dojo.declare(&#8221;VanillaSoftServe&#8221;,null, {<br />
constructor: function() { console.debug (&#8221;mixing in Vanilla&#8221;); }<br />
});<br />
dojo.declare(&#8221;MandMs&#8221;,null, {<br />
constructor: function() { console.debug(&#8221;mixing in MandM&#8217;s&#8221;); },<br />
kind: &#8220;plain&#8221;<br />
});<br />
dojo.declare(&#8221;CookieDough&#8221;,null, {<br />
chunkSize: &#8220;medium&#8221;<br />
});<br />
dojo.declare(&#8221;Blizzard&#8221;, [VanillaSoftServe, MandMs, CookieDough], {<br />
constructor: function() {<br />
console.debug(&#8221;A blizzard with &#8220;+<br />
this.kind+&#8221; M and Ms and &#8220;+<br />
this.chunkSize+&#8221; chunks of cookie dough.&#8221;<br />
);<br />
}<br />
});</p>
<p>PS. VanillaSoftServe is the only superclass of Blizzard, others two just mixed in. Does not make sense to me, thinking it as three superclasses makes more sense<br />
<strong><br />
&lt;Understanding The Parser/&gt;</strong><br />
Not sure why dojo doc always tries to complicate this part. Parser is just create widget object for your source node.</p>
<p>pretty straight forward:<br />
* locating the nodes with dojoType attributes in the page<br />
* taking the attributes assigned to them and passing them into the constructor as properties on the configuration object<br />
* passing the source node for the widget as the second parameter to the constructor<br />
constructor: function(args, node){}</p>
<p><strong>&lt;modules/&gt;</strong><br />
modularization &#8211; namespace, collection of your widgets<br />
function sum() {<br />
var sum1; object level var<br />
sum2; globel var<br />
}</p>
<p>Module Helpers<br />
eg.<br />
var imgNode = document.createElement(&#8221;img&#8221;);<br />
imgNode.src = dojo.moduleUrl(&#8221;explosive.space&#8221;,&#8221;images/kaboom.gif&#8221;);</p>
<p>once the module is binded with the gif. It doesn&#8217;t matter where the code snippet is located relative to kaboom.gif.Yeah!!!</p>
<p>Use requireIf to save runtime.<br />
dojo.requireIf(dojo.isIE, &#8220;explosive.space.BlueScreenOfDeathCatcher&#8221;);</p>
]]></content:encoded>
			<wfw:commentRss>http://kissnote.com/2009/05/19/%e6%9c%80%e7%ae%80%e5%8d%95%e7%9a%84dojo%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b0-part-1/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>XAMPP快速安装</title>
		<link>http://kissnote.com/2009/05/17/xampp%e5%bf%ab%e9%80%9f%e5%ae%89%e8%a3%85/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://kissnote.com/2009/05/17/xampp%e5%bf%ab%e9%80%9f%e5%ae%89%e8%a3%85/#comments</comments>
		<pubDate>Sun, 17 May 2009 22:19:48 +0000</pubDate>
		<dc:creator>shengjie</dc:creator>
				<category><![CDATA[网站设计]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[xampp]]></category>

		<guid isPermaLink="false">http://blogs.kissnote.com/?p=72</guid>
		<description><![CDATA[XAMPP, Apache, Mysql, PHP, Perl all in one. 开始你网站开发的第一步只需要短短5分钟。

中国的朋友如果不能看以上youtube视频，这里是ku6的链接 &#8211; XAMPP快速安装。

]]></description>
			<content:encoded><![CDATA[<p>XAMPP, Apache, Mysql, PHP, Perl all in one. 开始你网站开发的第一步只需要短短5分钟。</p>
<p><object width="445" height="364" data="http://www.youtube.com/v/I-aJgvJbEp4&amp;hl=en&amp;fs=1&amp;border=1" type="application/x-shockwave-flash"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/I-aJgvJbEp4&amp;hl=en&amp;fs=1&amp;border=1" /><param name="allowfullscreen" value="true" /></object></p>
<p>中国的朋友如果不能看以上youtube视频，这里是ku6的链接 &#8211; <a href="http://v.ku6.com/show/U7ym8zyGdMMSM4wc.html">XAMPP快速安装</a>。<br />
</p>
]]></content:encoded>
			<wfw:commentRss>http://kissnote.com/2009/05/17/xampp%e5%bf%ab%e9%80%9f%e5%ae%89%e8%a3%85/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://kissnote.com/wp-content/uploads/2009/05/xampp.wmv" length="6380222" type="video/x-ms-wmv" />
		</item>
		<item>
		<title>dojo快速安装</title>
		<link>http://kissnote.com/2009/05/16/dojo%e5%bf%ab%e9%80%9f%e5%ae%89%e8%a3%85/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://kissnote.com/2009/05/16/dojo%e5%bf%ab%e9%80%9f%e5%ae%89%e8%a3%85/#comments</comments>
		<pubDate>Sat, 16 May 2009 22:30:44 +0000</pubDate>
		<dc:creator>shengjie</dc:creator>
				<category><![CDATA[Dojo]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://blogs.kissnote.com/?p=46</guid>
		<description><![CDATA[One Sentence定义: Dojo是Javascript的一个框架（开源工具包）。
快速安装:
三种方法：
1. 无安装，直接使用AOL’S 的DOJO(Content Distribution Network)或者google api.
2. 本地安装最新的编译后的dojo.
3. 本地维护dojo源码，编译。
总的来说，使用dojo，都需要编译和装载dojo.xd.js.
1. 使用 CDN/Google提供的dojo.  – &#60;推荐&#62;:  想初次体验dojo的初学者
&#60;script type=&#8221;text/javascript&#8221; src=&#8221;http://o.aolcdn.com/dojo/1.0.0/dojo/dojo.xd.js&#8221;&#62;&#60;/script&#62;
&#60;script type=&#8221;text/javascript&#8221; SRC=&#8221;http://ajax.googleapis.com/ajax/libs/dojo/1.3/dojo/dojo.xd.js&#8221;&#62;&#60;/script&#62;
2. 本地使用编译过的dojo – &#60;推荐&#62;大多数开发人员
传统方法： 下载编译好的dojo，放在本地服务器使用。
2.1 http://dojotoolkit.org/downloads下载编译最新版本的dojo
2.2 解压到你自己的项目文件夹下，简单起见，把解压后dojo-版本号文件夹改为dojo。Eg.我把解压后的dojo文件夹放在我项目根目录下（apache server）。浏览器中访问http://localhost/dojo/dijit/themes/themeTester.html， 如果能够看到dojo 测试页面，说明安装成功。
3. 编译源代码，DIY版本dojo – &#60;推荐&#62;高级Javascript开发人员
需要更改，维护源程序，使用自定义级别的dojo. IBM, Google很多大公司自己维护自己的dojo版本以及release.
通过repository (http://svn.dojotoolkit.org/src/)下载源程序,自己维护编译。
]]></description>
			<content:encoded><![CDATA[<p>One Sentence定义: Dojo是Javascript的一个框架（开源工具包）。</p>
<p>快速安装:</p>
<p>三种方法：</p>
<p>1. 无安装，直接使用AOL’S 的DOJO(Content Distribution Network)或者google api.<br />
2. 本地安装最新的编译后的dojo.<br />
3. 本地维护dojo源码，编译。</p>
<p>总的来说，使用dojo，都需要编译和装载dojo.xd.js.</p>
<p>1. 使用 CDN/Google提供的dojo.  – &lt;推荐&gt;:  想初次体验dojo的初学者</p>
<p>&lt;script type=&#8221;text/javascript&#8221; src=&#8221;http://o.aolcdn.com/dojo/1.0.0/dojo/dojo.xd.js&#8221;&gt;&lt;/script&gt;</p>
<p>&lt;script type=&#8221;text/javascript&#8221; SRC=&#8221;http://ajax.googleapis.com/ajax/libs/dojo/1.3/dojo/dojo.xd.js&#8221;&gt;&lt;/script&gt;</p>
<p>2. 本地使用编译过的dojo – &lt;推荐&gt;大多数开发人员</p>
<p>传统方法： 下载编译好的dojo，放在本地服务器使用。</p>
<p>2.1 http://dojotoolkit.org/downloads下载编译最新版本的dojo</p>
<p>2.2 解压到你自己的项目文件夹下，简单起见，把解压后dojo-版本号文件夹改为dojo。Eg.我把解压后的dojo文件夹放在我项目根目录下（apache server）。浏览器中访问http://localhost/dojo/dijit/themes/themeTester.html， 如果能够看到dojo 测试页面，说明安装成功。</p>
<p>3. 编译源代码，DIY版本dojo – &lt;推荐&gt;高级Javascript开发人员</p>
<p>需要更改，维护源程序，使用自定义级别的dojo. IBM, Google很多大公司自己维护自己的dojo版本以及release.</p>
<p>通过repository (http://svn.dojotoolkit.org/src/)下载源程序,自己维护编译。</p>
]]></content:encoded>
			<wfw:commentRss>http://kissnote.com/2009/05/16/dojo%e5%bf%ab%e9%80%9f%e5%ae%89%e8%a3%85/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何结束占用端口的线程</title>
		<link>http://kissnote.com/2009/05/15/%e5%a6%82%e4%bd%95%e7%bb%93%e6%9d%9f%e5%8d%a0%e7%94%a8%e7%ab%af%e5%8f%a3%e7%9a%84%e7%ba%bf%e7%a8%8b/#utm_source=feed&amp;utm_medium=feed&amp;utm_campaign=feed</link>
		<comments>http://kissnote.com/2009/05/15/%e5%a6%82%e4%bd%95%e7%bb%93%e6%9d%9f%e5%8d%a0%e7%94%a8%e7%ab%af%e5%8f%a3%e7%9a%84%e7%ba%bf%e7%a8%8b/#comments</comments>
		<pubDate>Fri, 15 May 2009 16:43:03 +0000</pubDate>
		<dc:creator>shengjie</dc:creator>
				<category><![CDATA[Tips Everyday]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[端口]]></category>
		<category><![CDATA[线程]]></category>

		<guid isPermaLink="false">http://blogs.kissnote.com/?p=28</guid>
		<description><![CDATA[比如80端口被占用 （qq音乐开机占用我的80或者是8080端口）。如果你不清楚哪个程序在占用你的端口的话。
windows:

netstat -aon  //找出哪个线程在占用你的80端口，eg.35454线程在占用80端口。
taskkill /pid 35454 //结束占用80端口的程序，现在80端口就可用了。
linux:
lsof -P &#124; grep 80
kill 35454
]]></description>
			<content:encoded><![CDATA[<p>比如80端口被占用 （qq音乐开机占用我的80或者是8080端口）。如果你不清楚哪个程序在占用你的端口的话。</p>
<p><strong>windows:<br />
</strong></p>
<p>netstat -aon  //找出哪个线程在占用你的80端口，eg.35454线程在占用80端口。</p>
<p>taskkill /pid 35454 //结束占用80端口的程序，现在80端口就可用了。</p>
<p><strong>linux:</strong></p>
<p>lsof -P | grep 80</p>
<p>kill 35454</p>
]]></content:encoded>
			<wfw:commentRss>http://kissnote.com/2009/05/15/%e5%a6%82%e4%bd%95%e7%bb%93%e6%9d%9f%e5%8d%a0%e7%94%a8%e7%ab%af%e5%8f%a3%e7%9a%84%e7%ba%bf%e7%a8%8b/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
