<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Zhi Chen&apos;s Blog</title>
<link>http://www.wou.edu/~chenz/blogs/</link>
<description></description>
<language>en</language>
<copyright>Copyright 2011</copyright>
<lastBuildDate>Fri, 06 May 2011 15:06:01 -0800</lastBuildDate>
<generator>http://www.movabletype.org/?v=4.23-en</generator>
<docs>http://blogs.law.harvard.edu/tech/rss</docs> 


<item>
<title>Using CSS to &quot;Crop&quot; Images</title>
<description><![CDATA[<p>Advantage: very fast, no extra memory cost,and very easy to learn.<br />
Output: Original picture partially displayed, with html/css tags in source code</p>

<p>Example:<br />
     #photoclip { <br />
position:absolute; <br />
height: 100px; <br />
width: 50px; <br />
clip:<strong> rect(0px, 100px, 40px, 0px);     </strong>        <br />
overflow: hidden; <br />
background: url(yourimagelocation); <br />
} </p>

<p></p>

<p>Here, the rect() function accepts 4 variables. first two are the coords of the starting point of the cropping rectangle. The last two are cropping width, and cropping height.</p>

<p>"Overflow:hidden" means it will hide everything else outside of the cropping rectangle.</p>

<p>then in the html, you need to call the css style in div:<br />
<div id="photoclip" ></div></p>

<p>and also you can define the "width" and "height" of the dive .</p>

<p></p>

<p><br />
Disadvantage:<br />
When right clicking the pic and save , it is still the original picture. It is not actually cropping it, but hiding part of the picture.</p>]]></description>
<link>http://www.wou.edu/~chenz/blogs/archives/2011/05/using-css-to-cr.html</link>
<guid>http://www.wou.edu/~chenz/blogs/archives/2011/05/using-css-to-cr.html</guid>
<category></category>
<pubDate>Fri, 06 May 2011 15:06:01 -0800</pubDate>
</item>

<item>
<title>Data type convert in between ORDImage type and Blob</title>
<description><![CDATA[<p>Just learned something new : Oracle has some multimedia database functions. These functions are "JAVA" functions. so It might be a little different from other oracle functions. Multi-media includes: different types of video, image, audio. I am suprised those files can be operated by Oracle.  The ORDImage is a class to deal with picutres. the code below was my test of how to convert between this type and blob.</p>

<p> </p>

<p><br />
   pid varchar2(10) default 'chenz';<br />
	v_id number default 0; <br />
	Photo blob default null;<br />
   Photo2 blob default null;<br />
   vx1 number default 0;<br />
   vy1 number default 0;<br />
   vx2 number default 0;<br />
   vy2 number  default 0;<br />
   vw number default 0;<br />
   vh number  default 0; <br />
  attributes clob;<br />
   img_mimeType varchar2(32); <br />
   img_contentLength integer;<br />
   fileFormat varchar2(32);<br />
   img_width integer;<br />
	img_height integer;<br />
   contentFormat varchar2(32);<br />
   compressionFormat varchar2(32);<br />
   image1 ORDSYS.ORDIMAGE;<br />
   image2 ORDSYS.ORDIMAGE;<br />
 <br />
   opt varchar2(100) default null;<br />
begin<br />
 <br />
   <br />
   <br />
   <br />
   <br />
   DBMS_LOB.CREATETEMPORARY(attributes, TRUE, DBMS_LOB.CALL); <br />
   select max(id) into v_id from directory.staff_pic where name=pid;   <br />
   select  content into Photo  from directory.staff_pic  where id=v_id    ;<br />
   for i in (select * from directory.staff_pic where id=v_id) loop<br />
       Photo :=i.content;<br />
       vx1:=i.x1;<br />
       vx2:=i.x2;<br />
       vy1:=i.y1;<br />
       vy2:=i.y2;<br />
       vw:=i.width;<br />
       vh:=i.height;<br />
   end loop;<br />
   <br />
   <br />
   <br />
   <br />
   opt:='cut='||vx1||' '||vx2||' '||vw||' '||vh||'';<br />
--   htp.p(opt);<br />
   <br />
   ORDSYS.ORDImage.getProperties(Photo,<br />
      attributes,<br />
      img_mimeType,<br />
      img_width,<br />
      img_height,<br />
      fileFormat,<br />
      compressionFormat,<br />
      contentFormat,<br />
      img_contentLength);<br />
      <br />
      <br />
      <br />
      <br />
      <br />
     select ordsys.ordimage(ordsys.ordsource( photo, null, null, null, null, 1),<br />
   null, null, null, null, null, null, null)<br />
   into image1 from dual;<br />
   image1.setProperties( );<br />
  </p>

<p>------------------------------------------------------------------------------<br />
----------Code below is to convert Ordimage to Blob--------<br />
------------------------------------------------------------------------------</p>

<p><br />
 <br />
  photo2:=ordsys.ordimage.getContent(image1);<br />
    <br />
    owa_util.mime_header('image/jpeg', FALSE, NULL);<br />
      wpg_docload.download_file(Photo2);<br />
end test3;</p>

<p></p>

<p>end test;<br />
</p>]]></description>
<link>http://www.wou.edu/~chenz/blogs/archives/2011/04/data-type-conve.html</link>
<guid>http://www.wou.edu/~chenz/blogs/archives/2011/04/data-type-conve.html</guid>
<category></category>
<pubDate>Mon, 25 Apr 2011 11:02:09 -0800</pubDate>
</item>

<item>
<title>Five Nines</title>
<description><![CDATA[<p><br />
Availability	   Downtime per Year<br />
99%	        87 hours and 36 minutes<br />
99.5%	43 hours and 48 minutes<br />
99.95%	4 hours and 23 minutes<br />
99.99%	53 minutes<br />
99.999%	5 minutes</p>

<p>-------------------------------------------------------<br />
In my opinion, the 99.999 % is kinda impossible. I do not believe anyone can fix a server problem in five minutes. So basically it is saying , this server is super stable with no down time.<br />
</p>]]></description>
<link>http://www.wou.edu/~chenz/blogs/archives/2011/01/five-nines.html</link>
<guid>http://www.wou.edu/~chenz/blogs/archives/2011/01/five-nines.html</guid>
<category></category>
<pubDate>Fri, 28 Jan 2011 11:11:24 -0800</pubDate>
</item>

<item>
<title>Printshop Meeting</title>
<description><![CDATA[<p>We had a meeting with print shop and business about this new print shop app. We basically went through all the functions and details and talk about some potential features. </p>

<p>1. Cheri wanted to add a function that she can view invoices from previous years. Thats fairly simple and I can just add one view offering this option.</p>

<p>2. In the form, they need 2 fields "Account" & "Activity Code" to be editable, because a few accounts or activities are not attached with particular indexes. I am thinking of adding a local table to  store these special accounts and activity code. When loading invoices, it will check this local table first to see if thers any special ones, otherwise load the default.</p>

<p>3. Darin and Cheri also wanted a JV number input box. As above, it also can be included in that local table.</p>

<p>4. The Index search didn't work , I guess it was due to the code changing i made last night. But anyway, i need to fix it. And next time don't change any code before presenting.</p>

<p>5. Two fake indexes are needed to hold the bills of city halls or something else. So I'll make DPSST and OTHER in the indexes table. ( maybe a job to update the table every July 1)</p>

<p>6. 2 print reports and a yearly Report are needed too. Print reports are kinda easy . The yearly reports shouldn't be hard, depends on what records are needed. </p>

<p>So anyway, seems I need to spend one more week on this project</p>]]></description>
<link>http://www.wou.edu/~chenz/blogs/archives/2011/01/printshop-meeti.html</link>
<guid>http://www.wou.edu/~chenz/blogs/archives/2011/01/printshop-meeti.html</guid>
<category></category>
<pubDate>Fri, 07 Jan 2011 12:07:35 -0800</pubDate>
</item>

<item>
<title>Some errors after the server has been moved.</title>
<description><![CDATA[<p>1. print shop error<br />
I got a error report from Darin that printing app is not showing students' credit and balance. I found out the perl script of loading balance on Bar isn't working. Adam told me only several computers can use that script. Print shop people can use it because they log into portal and loading the data on oracle.wou.edu to access this script. </p>

<p>because oracle server has been moved, so the script folder doesn't have it's new IP. After the new IP is added in, the problem is fixed.</p>

<p><br />
2. Got bunch of directory error saying my code kept looking for some file ''XXX.jpg'' in folder and couldn't find them. <br />
    The program runs fun, but I guess that annoys Mike Ross a lot. :(<br />
      Im gonna check the code today..If it gives hundreds errors , i think the job or the directory failed. but if there are only several errors , then it might be bad coding that didnt catch all error possibilities.<br />
     From the feed back from Mike, "the number of errors received varies quite a bit - sometimes a lot of errors all at once, then times when no errors of this type are received at all.  Overall, it's a fairly steady stream of errors, but not tons of errors all the time." I think it should be lack of enough error catch.</p>]]></description>
<link>http://www.wou.edu/~chenz/blogs/archives/2011/01/print-shop-appl.html</link>
<guid>http://www.wou.edu/~chenz/blogs/archives/2011/01/print-shop-appl.html</guid>
<category></category>
<pubDate>Fri, 07 Jan 2011 11:24:04 -0800</pubDate>
</item>

<item>
<title>1000</title>
<description><![CDATA[<p>1111aa</p>]]></description>
<link>http://www.wou.edu/~chenz/blogs/archives/2010/11/1000.html</link>
<guid>http://www.wou.edu/~chenz/blogs/archives/2010/11/1000.html</guid>
<category></category>
<pubDate>Tue, 30 Nov 2010 16:38:32 -0800</pubDate>
</item>

<item>
<title>Printshop logics</title>
<description><![CDATA[<p>I reviewed the printshop algorithm again since it has some bugs now. The original design was using portal id to pull the users' "ldap"s. </p>

<p>So here are two problems I have with this design:<br />
1. It has to look through "portal.users" talbe (generated from "directory" table). In the portal talble, the particular user has only one portal ID. And his name cannot be found on our WOU online directory. </p>

<p>    I wonder if "not classified" staff member should be included in these tables too.</p>

<p>2. The function transfer V number to ldap always pull one of the ID back no matter how many status a user has. But if he is a staff, the print shop credit are supposed to go to the department index.</p>]]></description>
<link>http://www.wou.edu/~chenz/blogs/archives/2010/11/printshop-logic.html</link>
<guid>http://www.wou.edu/~chenz/blogs/archives/2010/11/printshop-logic.html</guid>
<category>General</category>
<pubDate>Mon, 22 Nov 2010 10:16:19 -0800</pubDate>
</item>

<item>
<title>Perl Regular Expression Summary (1)</title>
<description><![CDATA[<p>* -- Match pre-string multiple times.(0+ times)<br />
Dot(.)can match any single char，Therefore, '.*'can match any string. For instance : /fred.*barney/ will match any string which contains 'fred', and 'barney'. <br />
+ -- Match pre-string multiple times. (1+times)<br />
For instance: /(fred)+/ matches something like : fredfredfred<br />
 <br />
？-- Match pre-string 0 or 1 time.<br />
 <br />
| -- Equals: "OR" <br />
For instance: /fred( |\t)+barney/  it matches fred，barney and contains  'space', tabs inbetween， (+)means repeat once or more times.<br />
 <br />
[] - Match any single char in between.<br />
 <br />
[0-9] - Any digit , equals: \d。<br />
 <br />
[A-Za-z0-9_] equals：\w match all letters : capital, lower case, and under scroll. <br />
 <br />
[\f\t\n\r ] equals：\s，containing 5 different "blanks": form-feed，tab， switch line，"enter" and "space"<br />
 <br />
[^\d]   not-numbers            capital letters : \D<br />
        ^ means "NOT"</p>

<p><br />
[^\w]  not word chars               \W<br />
[^\s]  not a space/blank            \S<br />
 /i case not sensitive<br />
 <br />
/x - allow to add any numbers of "blanck"(space, enter or w/e) <br />
/-?\d+\.?\d*/            #这是什么含义？<br />
/ -? \d+ \.? \d* /x     #要好些<br />
 <br />
^ matches the "beginning"， $ matches the end of the string. So， /^fred/ matches a string begins with 'fred' , it wont match 'manfred'.<br />
/rock$/ won't match 'knute rockne'<br />
(note: ^ in [] means "NOT", Otherwise , means string begins). <br />
 <br />
/^\s*$/           #It matches a blank line          #它将匹配一个空行（blank line）<br />
 <br />
\b 词界锚定，是针对单词使用的。如/\bfred\b/可以匹配上单词fred，但不能匹配frederick,alfred, man fred mann <br />
 <br />
=~ 将告诉Perl 将右边的模式在左边的字符串上进行匹配 <br />
my $some_other = "I dream of betty rubble.";<br />
      if($some_other =~ /\brub/){<br />
         print "Aye, there's the rub.\n";<br />
      }</p>]]></description>
<link>http://www.wou.edu/~chenz/blogs/archives/2010/08/perl-regular-ex.html</link>
<guid>http://www.wou.edu/~chenz/blogs/archives/2010/08/perl-regular-ex.html</guid>
<category></category>
<pubDate>Thu, 12 Aug 2010 15:48:42 -0800</pubDate>
</item>

<item>
<title>Perl Notes (1) -- Basics</title>
<description><![CDATA[<p><strong> First Line of Code</strong><br />
#!/usr/bin/perl -w<br />
-w means to produce warning message.<br />
<big><strong>Scalar Data</strong></big><br />
A scalar is the simplest kind of data -- a number or a string of characters.<br />
Numbers</p>

<p>    * Float Literials: 1.25, -1.0, 1.25e3<br />
    * Integer Literials: 3, -4, 2000</p>

<p><strong>Strings</strong></p>

<p>    * Single Quoted String: 'hello', '', 'hello\n'<br />
    * Double Quoted String: "hello", "", "hello\n"<br />
    * back slash escape: \n is Newline, \r is Return, \t is Tab, \b is Backspace, \f is Formfeed, \a is Bell, etc ...<br />
    * Scalar Opertors: Numerical (+, -, *, /, %, ++, --, **, <, <=, ==, >=, >, !=) and String (. for concatenation, eq, ne, lt, gt, le, ge and x for repeating -- "fred"x3 is "fredfredfred")<br />
    * Other operators: !, ~, \, +, - (logical not, bit not, reference operator, unary plus, unary minus)<br />
      &, |, ^, &&, ||, ?:(bit and, bit or, bit xor, logical and, logical or, if-else)<br />
      , (comma) => (comma-arrow)<br />
      not, and, or, xor (logical not, and, or, xor)<br />
    * + can automatically convert number to string -- 3 + "a" is "3a"</p>

<p><strong>Scalar variables</strong><br />
Begin with a dollar sign followed by a letter and then possibly more letters, or digits or underscores. Case sensitive.<br />
The chop and chomp functions<br />
chop($x): removes the last character of $x.<br />
chomp ($x): remove the newline (input record separator).<br />
Interpolation of Scalars into Strings<br />
$a = "fred";<br />
$b = " some text of $a";<br />
Now $b is "some text of fred"<br />
When scalar is in double quoted string, it is interpolated.<br />
But not in single quoted string:<br />
$a = 'fred'; $b = 'some text of $a';<br />
Now $b is some text of $a', not changed.<br />
The variable name will be the longest possible variable name that make sense at the part of the string:<br />
$fred = "pay";<br />
$fredday = "wrong";<br />
$a = "It's $freday"; # not payday, but It's wrong"<br />
$a = "It's ${fred}day"; # OK, it's payday<br />
$a = "It's "$fred"."day"; $a = "It's".$fred."day";<br />
undef: if you use a variable before it is assigned a value, like a zero in numbers or empty string in strings.<br />
&ltSTDIN> as a Scalar Variable<br />
chomp ($a = &ltSTDIN>);<br />
Arrays and List Data<br />
List Literal Representation<br />
(1, 2, 3)<br />
() -- empty list<br />
(1 .. 5) -- same as (1, 2, 3, 4, 5)<br />
(1.2 .. 6.1) -- same as (1, 2, 3, 4, 5, 6) if the number is not a whole number, just take the inside bound<br />
@a = qw(b1, b2, b3); is same as @a = ("b1", "b2" "b3");<br />
Array Variable<br />
Start with @<br />
The value of an assigned array variable is (), -- an empty list </p>]]></description>
<link>http://www.wou.edu/~chenz/blogs/archives/2010/08/perl-notes-1---.html</link>
<guid>http://www.wou.edu/~chenz/blogs/archives/2010/08/perl-notes-1---.html</guid>
<category></category>
<pubDate>Tue, 03 Aug 2010 10:26:34 -0800</pubDate>
</item>

<item>
<title>Perl Notes (2)-- Array Operators and Functions</title>
<description><![CDATA[<p> Assignment:<br />
      @a = (1,2,3);<br />
      @b = @a;<br />
      @c= 1; -- promote 1 to list (1)<br />
      @d = (4, 5, @a, 6, 7); -- put 4, 5 ahead of @a, and 6, 7 after @a and all assign to @d<br />
      ($d, @e) = ($a, $b, $c); -- $give $a to $d, and $b and $c to @e<br />
      ($e, @a) = @a; -- remove first element of @a to $e<br />
      $a = @b; -- If an array variable is assigned to a scalar variable, the value is the length of the array<br />
      @b = (4, 5, 6); $a = @b ; -- $a is 3<br />
      @b = (4, 5, 6); ($a) = @b; -- This is an array assignment, $a is 4 (the first element)<br />
    * Access Array Element:<br />
      $a[0] -- Notes it start at zero and use $ not @<br />
      @a[0,1]; is same as ($a[0], $a[1]), not we use @ when slicing an array<br />
      If you access array beyond the end of the current array, undef is returned without warning<br />
      $#array is the index value of the last element of the @array<br />
      If you use negative number in array index, it count from the last element. $array[-1] is the last element of @array<br />
    * The push and pop function:<br />
      push(@myList, $newValue); -- same as @myList = (@myList, $newValue)<br />
      push(@myList, 4, 5, 6);<br />
      $oldValue = pop(@myList); -- remove the last element of @myList, if @myList is empty, $oldValue is undef<br />
    * The shift and unshift function:<br />
      unshift(@b, $a); -- same as @b = ($a, @b), unshift do the "left" as similar push on the right side<br />
      $x = shift(@a); -- remove the first element<br />
    * The reversie function:<br />
      @b = reverse (@a);<br />
    * The sort function:<br />
      @a = sort (@b);<br />
    * The chomp function:<br />
      @stuff = ("hello\n", "world\n", "happy days"); chomp(@stuff); # now @stuff is ("hello", "world", "happy days")<br />
    * &ltSTDIN> as an array:<br />
      @a = &ltSTDIN> ; # read standard input in list context<br />
    * A scalar value used within a list context is promoted to a single-element array.<br />
    * Array variable is interpolated in double quoted string similar to scalar variable<br />
</p>]]></description>
<link>http://www.wou.edu/~chenz/blogs/archives/2010/08/perl-notes-1.html</link>
<guid>http://www.wou.edu/~chenz/blogs/archives/2010/08/perl-notes-1.html</guid>
<category></category>
<pubDate>Tue, 03 Aug 2010 10:20:27 -0800</pubDate>
</item>

<item>
<title>wierd dbms_lob.session error</title>
<description><![CDATA[<p><br />
I got this error when I was tring to parse the value from one varchar column and save it into another blob column. Here is the code:</p>

<p>	  dbms_lob.createtemporary(temp_blob,true,dbms_lob.call);<br />
	  tempraw:=	utl_raw.cast_to_raw(v_summary);<br />
	  dbms_lob.writeappend(temp_blob,length(v_summary),tempraw);<br />
          <br />
          update tablename<br />
	  set summary2=temp_blob<br />
	  where report_id=i.report_id;<br />
	  commit;<br />
       <br />
and it gave me an error:</p>

<p>ORA-06502: PL/SQL: numeric or value error<br />
ORA-06512: at "SYS.DBMS_LOB", line 826<br />
ORA-06512: at "SECURITY.TEST", line 14<br />
ORA-06512: at line 22</p>

<p>_--------------------------------------------------------_</p>

<p><br />
ORA-6502 mostly occurs during execution of code in an oracle database due to a bug in the SQL or PL/SQL code. The primary reason this oracle error occurs is when you try to assign a value to a numeric variable but the value is larger than the variable can handle.  ORA-06502 oracle error also occurs if you are trying to assign a non-numeric value to a numeric variable </p>]]></description>
<link>http://www.wou.edu/~chenz/blogs/archives/2010/03/wierd-dbms-lobs.html</link>
<guid>http://www.wou.edu/~chenz/blogs/archives/2010/03/wierd-dbms-lobs.html</guid>
<category></category>
<pubDate>Wed, 10 Mar 2010 09:59:49 -0800</pubDate>
</item>

<item>
<title>AMCharts </title>
<description><![CDATA[<p>1.Stock : Multiple data set
   I like that you can add / remove  a set of data by clicking the colored buttons beside.
   In this category, the &#8220;Smoothed line chart&#8221; looks pretty simple and nice too. But maybe because of the color, when I see it I kinda think it is designed for kindergarden or elementry schools&#8230;. weird.</p>

<ol>
<li><p>Column &amp; Bar : Columns with rounded corners looks the best.</p>

<p>Histrogram is supposed to be used in some certain situation. but the one on this site doesn&#8217;t not look good. </p></li>
<li><p>Line &amp; Area
In this category I picked two:
Auto-reloading chart is cool. But maybe refresh the page too much.
and the one on  Line &amp; Area main page.</p></li>
<li><p>Pie &amp; Donut:
The 2D pie chart is good .
The &#8220;Advanced navigation menus&#8221; look cool though, even it is not a chart.</p></li>
</ol>

<p>5.Scatter &amp; Bubble:
   Timeline is better.</p>
]]></description>
<link>http://www.wou.edu/~chenz/blogs/archives/2009/12/amcharts-2.html</link>
<guid>http://www.wou.edu/~chenz/blogs/archives/2009/12/amcharts-2.html</guid>
<category></category>
<pubDate>Thu, 17 Dec 2009 16:22:08 -0800</pubDate>
</item>

<item>
<title>Onsubmit  and Onclick</title>
<description><![CDATA[<p>1.	response the "UCS HOMEWORK"<br />
2.	Call Roy again<br />
3.	the "Onclick" and "Submit" attributes in HTML<br />
Lets see some code:</p>

<p></p>

<p>&lt;script language="javascript" type="text/javascript"&gt;<br />
&lt;!--<br />
   Function Check()<br />
   {<br />
     Return false;<br />
   }<br />
--&gt;<br />
&lt;/script&gt;</p>

<p></p>

<p>&lt;form&gt;</p>

<p><br />
&lt;form action="..." name="form1"&gt;<br />
  ...<br />
  ...<br />
&lt;input type="submit" value="1" onClick="return Check()"&gt;<br />
  &lt;input type="submit" value="2" onClick="return Check()"&gt;<br />
&lt;/form&gt;</p>

<p><br />
If the button type is "Submit", then it will submit the form first and then run the javascript. So, even the Check() function returns false, it will submit the form anyway.</p>

<p>Solution:<br />
    Change the type to "Button" instead.</p>

<p></p>

<p><br />
&lt;form action="..." name="form2" onsubmit="return Check()"&gt;<br />
  ...<br />
  ...<br />
  &lt;input type="check" value="1"&gt;<br />
 <br />
&lt;/form&gt;</p>

<p></p>

<p><br />
</p>]]></description>
<link>http://www.wou.edu/~chenz/blogs/archives/2009/11/post.html</link>
<guid>http://www.wou.edu/~chenz/blogs/archives/2009/11/post.html</guid>
<category></category>
<pubDate>Mon, 16 Nov 2009 15:48:06 -0800</pubDate>
</item>

<item>
<title>Tree structure</title>
<description><![CDATA[<p>I found some this sql queries very interesting:<br />
And I tried to used on my project (because the division and department sctructure is kind like the tree structure)</p>

<p>create table tree (  <br />
    id number(10) not null primary key,  <br />
     name varchar2(100) not null,  <br />
    super number(10) not null                // 0 is root  <br />
 );  <br />
 -- from leaf to root   <br />
#select * from tree start with id = ? connect by id = prior super   <br />
# -- from root to leaf  <br />
# select * from tree start with id = ? connect by prior id = suepr  <br />
# -- the whole tree<br />
# select * from tree start with super = 0 connect by prior id = suepr<br />
--------------------------------------------------------------------------------------------------</p>

<p>Example:</p>

<p>create table test_connect_by (<br />
  parent     number,<br />
  child      number,<br />
  constraint uq_tcb unique (child)<br />
);</p>

<p><br />
insert into test_connect_by values ( 5, 2);<br />
insert into test_connect_by values ( 5, 3);<br />
insert into test_connect_by values (18,11);<br />
insert into test_connect_by values (18, 7);<br />
insert into test_connect_by values (17, 9);<br />
insert into test_connect_by values (17, 8);<br />
insert into test_connect_by values (26,13);<br />
insert into test_connect_by values (26, 1);<br />
insert into test_connect_by values (26,12);<br />
insert into test_connect_by values (15,10);<br />
insert into test_connect_by values (15, 5);<br />
insert into test_connect_by values (38,15);<br />
insert into test_connect_by values (38,17);<br />
insert into test_connect_by values (null, 38);<br />
insert into test_connect_by values (null, 26);<br />
insert into test_connect_by values (null, 18);</p>

<p>-------------------------------------------------------------------------</p>

<p>select lpad(' ',2*(level-1)) || to_char(child) s <br />
  from test_connect_by <br />
  start with parent is null<br />
  connect by prior child = parent;<br />
--------------------------------------------------------------------------------<br />
Then it shows :<br />
-----------------------------------------------------<br />
(Reporting Bugs btw, i cannot type more "space" before string in the entry, so i use '-' instead)<br />
38<br />
--15<br />
----10<br />
----5<br />
------2<br />
------3<br />
----17<br />
----9<br />
----8<br />
--6<br />
26<br />
--13<br />
--1<br />
--12<br />
18<br />
--11<br />
--7</p>

<p><br />
</p>]]></description>
<link>http://www.wou.edu/~chenz/blogs/archives/2009/07/tree-structure.html</link>
<guid>http://www.wou.edu/~chenz/blogs/archives/2009/07/tree-structure.html</guid>
<category></category>
<pubDate>Thu, 02 Jul 2009 11:29:37 -0800</pubDate>
</item>

<item>
<title>Learning notes of my addon project</title>
<description><![CDATA[<p>I have been working on a "warcraft" project recently, and learned something about XML and lua. I was impressed warcraft can load lua funtions by reading throught the xml file. It seems that xml file can hold sorted values. below are my learning notes, we can see some interesting features.</p>

<p></p>

<p>Learning Notes</p>

<p><br />
1. Start Xml flie for WoW<br />
1 <Ui xmlns="http://www.blizzard.com/wow/ui/"<br />
2 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ><br />
3 </Ui></p>

<p><br />
2.Loading a lua file<br />
1. <Script file="lua file"/><br />
2. In "toc" file,  write:                ---------> Like a "header" of C++</p>

<p></p>

<p>## Interface: 20400                    ---------> Game version  游戏版本<br />
## Title: NewAddon        <br />
## DefaultState: Enabled<br />
## LoadOnDemand: 0<br />
## SavedVariablesPerCharacter:<br />
Filename.xml                           --------->this header includes a xml<br />
Filename.lua     --------->and a lua fiel<br />
  </p>

<p>3. Frame:<br />
Frame --------->can be the class of parent frames<br />
Button --------->button<br />
EditBox --------->like labels in HTML, but more like a layer<br />
GameTooltip --------->Mouse event<br />
ColorSelect --------->Choose color<br />
MessageFrame ---------> also like labels .. Sometimes it is very similar as edit box<br />
Minimap --------->Loading mini map in WoW, including the battle ground .<br />
Model --------->it is for 3D animations of the characters. I haven't really used it<br />
MovieFrame --------->I don't know. I think it is for 3D image ( a functionality in WOW     to show a target's icon, it shows 3D animation)<br />
ScrollFrame --------->a frame can scroll up and down, like a textarea in HTML.<br />
ScrollingMessageFrame --------->same as above, but only showing text<br />
SimpleHTML --------->every thing in this tag will be HTML<br />
Slider --------->a slider bar, like a bar to set the volumn<br />
StatusBar --------->a bar , to show health , mana, or casting skills.</p>

<p><br />
4.Programming in Lua<br />
1. Over write Blizzard's functions<br />
2 old_add = add; -- Save the original add function<br />
3 add = function(a,b) -- add has a new function<br />
4 if ( old_add(a,b) == 0 ) then return nil end<br />
5 return a + b<br />
6 end<br />
--. define another function with the same name<br />
7 function add(a,b) -- same function as above<br />
8 local ret = a + b<br />
9 if ( ret == 0 ) then return nil end<br />
10 return ret<br />
11 end<br />
5. Use ":"<br />
This is how to call a method of an object, not using "." but ":"<br />
Like : frame:Show();<br />
6. How to drag an iterm in WoW<br />
---------------When Click the mouse down----------------<br />
<OnMouseDown><br />
  if not (TargetRange_moving or TargetRange_IsLocked() ) then<br />
   TargetRange_moving = this;<br />
         this:StartMoving();<br />
  end<br />
  </OnMouseDown></p>

<p></p>

<p>  <br />
---------------When loose the mouse button----------------  <br />
<OnMouseUp><br />
  if TargetRange_moving == this then<br />
   TargetRange_moving = nil;          this:StopMovingOrSizing();<br />
  end<br />
</OnMouseUp></p>

<p>------------------Drag-----------------------------------  <br />
<OnDragStop><br />
  if TargetRange_moving == this then<br />
   TargetRange_moving = nil;<br />
   this:StopMovingOrSizing();<br />
        end<br />
  </OnDragStop> </p>]]></description>
<link>http://www.wou.edu/~chenz/blogs/archives/2009/06/learning-notes.html</link>
<guid>http://www.wou.edu/~chenz/blogs/archives/2009/06/learning-notes.html</guid>
<category></category>
<pubDate>Tue, 09 Jun 2009 09:33:20 -0800</pubDate>
</item>


</channel>
</rss>
