<?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>Ivon神兜兜</title>
	<atom:link href="http://www.ivon.cn/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ivon.cn</link>
	<description>All about Chillout</description>
	<lastBuildDate>Fri, 05 Aug 2011 02:23:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>密码保护：#14 最美的故事仍会延续 Those tiny little things…</title>
		<link>http://www.ivon.cn/201108/those-tiny-little-thing-14.html</link>
		<comments>http://www.ivon.cn/201108/those-tiny-little-thing-14.html#comments</comments>
		<pubDate>Fri, 05 Aug 2011 01:46:25 +0000</pubDate>
		<dc:creator>ivon</dc:creator>
				<category><![CDATA[随感 Moods]]></category>
		<category><![CDATA[雨后天晴]]></category>

		<guid isPermaLink="false">http://www.ivon.cn/?p=681</guid>
		<description><![CDATA[无法提供摘要。这是一篇受保护的文章... ]]></description>
			<content:encoded><![CDATA[<form action="http://www.ivon.cn/wp-pass.php" method="post">
<p>这是一篇受密码保护的文章。您需要提供访问密码：</p>
<p><label for="pwbox-681">密码：<br />
<input name="post_password" id="pwbox-681" type="password" size="20" /></label><br />
<input type="submit" name="Submit" value="提交" /></p></form>
]]></content:encoded>
			<wfw:commentRss>http://www.ivon.cn/201108/those-tiny-little-thing-14.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>密码保护：#13 最慢的更新 Those tiny little things…</title>
		<link>http://www.ivon.cn/201012/those-tiny-little-things-13.html</link>
		<comments>http://www.ivon.cn/201012/those-tiny-little-things-13.html#comments</comments>
		<pubDate>Thu, 30 Dec 2010 02:59:17 +0000</pubDate>
		<dc:creator>ivon</dc:creator>
				<category><![CDATA[其他]]></category>

		<guid isPermaLink="false">http://www.ivon.cn/?p=673</guid>
		<description><![CDATA[无法提供摘要。这是一篇受保护的文章... ]]></description>
			<content:encoded><![CDATA[<form action="http://www.ivon.cn/wp-pass.php" method="post">
<p>这是一篇受密码保护的文章。您需要提供访问密码：</p>
<p><label for="pwbox-673">密码：<br />
<input name="post_password" id="pwbox-673" type="password" size="20" /></label><br />
<input type="submit" name="Submit" value="提交" /></p></form>
]]></content:encoded>
			<wfw:commentRss>http://www.ivon.cn/201012/those-tiny-little-things-13.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>密码保护：#12 大手牵不了小手. Those tiny little things…</title>
		<link>http://www.ivon.cn/201009/those-tiny-little-things-12.html</link>
		<comments>http://www.ivon.cn/201009/those-tiny-little-things-12.html#comments</comments>
		<pubDate>Sat, 18 Sep 2010 02:19:31 +0000</pubDate>
		<dc:creator>ivon</dc:creator>
				<category><![CDATA[随感 Moods]]></category>
		<category><![CDATA[大手]]></category>
		<category><![CDATA[大脚]]></category>
		<category><![CDATA[小手]]></category>
		<category><![CDATA[小脚]]></category>

		<guid isPermaLink="false">http://www.ivon.cn/?p=638</guid>
		<description><![CDATA[无法提供摘要。这是一篇受保护的文章... ]]></description>
			<content:encoded><![CDATA[<form action="http://www.ivon.cn/wp-pass.php" method="post">
<p>这是一篇受密码保护的文章。您需要提供访问密码：</p>
<p><label for="pwbox-638">密码：<br />
<input name="post_password" id="pwbox-638" type="password" size="20" /></label><br />
<input type="submit" name="Submit" value="提交" /></p></form>
]]></content:encoded>
			<wfw:commentRss>http://www.ivon.cn/201009/those-tiny-little-things-12.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>密码保护：#11 年华都是无效信. Those tiny little things…</title>
		<link>http://www.ivon.cn/201008/those-tiny-little-things-11.html</link>
		<comments>http://www.ivon.cn/201008/those-tiny-little-things-11.html#comments</comments>
		<pubDate>Sat, 21 Aug 2010 04:34:51 +0000</pubDate>
		<dc:creator>ivon</dc:creator>
				<category><![CDATA[随感 Moods]]></category>
		<category><![CDATA[树]]></category>

		<guid isPermaLink="false">http://www.ivon.cn/?p=633</guid>
		<description><![CDATA[无法提供摘要。这是一篇受保护的文章... ]]></description>
			<content:encoded><![CDATA[<form action="http://www.ivon.cn/wp-pass.php" method="post">
<p>这是一篇受密码保护的文章。您需要提供访问密码：</p>
<p><label for="pwbox-633">密码：<br />
<input name="post_password" id="pwbox-633" type="password" size="20" /></label><br />
<input type="submit" name="Submit" value="提交" /></p></form>
]]></content:encoded>
			<wfw:commentRss>http://www.ivon.cn/201008/those-tiny-little-things-11.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Java]Floating-point literals recognizer (parser)</title>
		<link>http://www.ivon.cn/201008/javafloating-point-literals-recognizer-parser.html</link>
		<comments>http://www.ivon.cn/201008/javafloating-point-literals-recognizer-parser.html#comments</comments>
		<pubDate>Sun, 08 Aug 2010 05:02:08 +0000</pubDate>
		<dc:creator>ivon</dc:creator>
				<category><![CDATA[编程Coding]]></category>
		<category><![CDATA[floating point]]></category>
		<category><![CDATA[parser]]></category>
		<category><![CDATA[state diagram]]></category>
		<category><![CDATA[浮点数]]></category>

		<guid isPermaLink="false">http://www.ivon.cn/?p=615</guid>
		<description><![CDATA[暑假用Java写的一段很简单的识别浮点数的代码。不想翻译了就直接放上来，大家对照状态图看源程序便知道是怎么回事了。
EBNF:
&#60;floating-point)-&#62;{(0&#124;1&#124;2&#124;3&#124;4&#124;5&#124;6&#124;7&#124;... ]]></description>
			<content:encoded><![CDATA[<p>暑假用Java写的一段很简单的识别浮点数的代码。不想翻译了就直接放上来，大家对照状态图看源程序便知道是怎么回事了。</p>
<p><strong>EBNF:</strong></p>
<p>&lt;floating-point)-&gt;{(0|1|2|3|4|5|6|7|8|9)}+.{(0|1|2|3|4|5|6|7|8|9)}+[e(+|-){(0|1|2|3|4|5|6|7|8|9)}+]</p>
<p><span id="more-615"></span></p>
<p><strong>Definition of floating-point literals in Java:<br />
<strong>Java对于浮点数的定义如下：</strong> </strong></p>
<p>A floating point literal have the following parts: a decimal integer, a decimal point, a fraction, an exponent (starts with an “e” or E followed by an integer, which could be preceded by “+” or “-”).</p>
<p>A floating-point literal can have the following parts: a decimal integer, a decimal point (“.”), a fraction (another decimal number), an exponent, and a type suffix. The exponent part is an “e” or “E” followed by an integer, which can be signed (preceded by “+” or “-”). A floating-point literal must have at least one digit, plus either a decimal point or “e” (or “E”).</p>
<p><strong>According to the definition, the state diagram of floating-point parser is:<br />
<strong>有穷状态机图如下：</strong> </strong></p>
<p><a href="http://www.ivon.cn/wp-content/uploads/2010/08/state-diagram-floating-point.jpg"><img class="alignnone size-thumbnail wp-image-617" title="state-diagram-floating-point" src="http://www.ivon.cn/wp-content/uploads/2010/08/state-diagram-floating-point-800x332.jpg" alt="" width="800" height="332" /></a></p>
<pre>Click to view the source code.
点击查看源代码。 
<pre class="brush: java; light: false; title: ; toolbar: true; notranslate">
package fp;
import java.io.Console;
/**
 *
 * @author Ivon
 */
public class Main {
    char nextChar;
    public static void main(String[] args) {
        int x=0, y=0, z=0;
        /*x is used to record the position of the decimal point
         * y is used to recored the position of &quot;e&quot; and &quot;E&quot;
         */
        Console c = System.console();
        if (c == null) {
            System.err.println(&quot;No console.&quot;);
            System.exit(1);
        }
        String thenumber = c.readLine(&quot;Enter a number: &quot;);
        if (isDigit(thenumber,0)== -1){
            System.out.println(thenumber + &quot; is an integer.&quot;);

        }else
            //The next step is to judge if the input is only a number with decimal point
            {
            x=isDigit(thenumber,0);
            if (thenumber.charAt(x)== '.'){
                x=isNumberWithPoint(thenumber,x);
                if (x&amp;gt;=0) {
                    if (thenumber.charAt(x)=='e'||thenumber.charAt(x)=='E'){
                        isValidExp(thenumber,x);
                    }else{
                        System.out.println(thenumber + &quot; is not a valid float point number.&quot;);
                    }
                }
            }else if(thenumber.charAt(x)== 'E'||thenumber.charAt(x)== 'e'){
                isValidExp(thenumber, x);
            }else{
                System.out.println(thenumber + &quot; is not a valid float point number.&quot;);
            }

        }

    }

    public static int isDigit(String s, int number){
        int isDigitFlag=-999;
        for (int i=number; i&amp;lt;s.length();i++){
            if ( !Character.isDigit(s.charAt(i)) ) {
                isDigitFlag = i;
                break;
            }else{
                isDigitFlag = -1;
            }
        }
        return (isDigitFlag);

    }

    public static int isNumberWithPoint(String thenumber,int x){
                if (x+1==thenumber.length()){
                    System.out.println(thenumber+&quot; is a number with decimal point.&quot;);
                    return -1;
                }
                if (isDigit(thenumber, x+1) == -1){
                    System.out.println(thenumber+&quot; is a number with decimal point.&quot;);
                    return -1;
                }else{
                    return isDigit(thenumber, x+1); //return the position of the next non-digit
                }

    }

    public static int isValidExp(String thenumber, int x){
        if (x+1==thenumber.length()){
            System.out.println(thenumber+&quot; is a valid float point number.&quot;);
            return 1;

        }
                if(thenumber.charAt(x+1)=='+'||thenumber.charAt(x+1)=='-'){
                    x++;
                }

                    if (isDigit(thenumber, x+1) == -1){
                    System.out.println(thenumber+&quot; is a valid float point number.&quot;);
                    }else{
                    System.out.println(thenumber+&quot; is not a valid float point number.&quot;);
                    }
         return 1;
    }

}
</pre>
<p><strong>Test Case:<br />
 以下是测试用例: </strong></p>
<p>Integer:</p>
<p>11 – Pass</p>
<p>hello - Fail</p>
<p>$$$ - fail</p>
<p>Number with float point:</p>
<p>11.11 – Pass</p>
<p>11..11 – fail</p>
<p>1abc1 – fail</p>
<p>Float Point Number:</p>
<p>11e – Pass</p>
<p>11w – fail</p>
<p>11e11 – pass</p>
<p>11ee11 – fail</p>
<p>11e-1 – pass</p>
<p>11e+1 – pass</p>
<p>11e++1 – pass</p>
<p>11e+1w – fail</p>
<p>Should you have any better approach, please don't hesitate to correct me.<br />
 如果有误，欢迎指正
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ivon.cn/201008/javafloating-point-literals-recognizer-parser.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>密码保护：#10 Happy Birthday. Those tiny little things…</title>
		<link>http://www.ivon.cn/201007/those-tiny-little-things-10.html</link>
		<comments>http://www.ivon.cn/201007/those-tiny-little-things-10.html#comments</comments>
		<pubDate>Thu, 29 Jul 2010 03:56:01 +0000</pubDate>
		<dc:creator>ivon</dc:creator>
				<category><![CDATA[其他]]></category>

		<guid isPermaLink="false">http://www.ivon.cn/?p=599</guid>
		<description><![CDATA[无法提供摘要。这是一篇受保护的文章... ]]></description>
			<content:encoded><![CDATA[<form action="http://www.ivon.cn/wp-pass.php" method="post">
<p>这是一篇受密码保护的文章。您需要提供访问密码：</p>
<p><label for="pwbox-599">密码：<br />
<input name="post_password" id="pwbox-599" type="password" size="20" /></label><br />
<input type="submit" name="Submit" value="提交" /></p></form>
]]></content:encoded>
			<wfw:commentRss>http://www.ivon.cn/201007/those-tiny-little-things-10.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>密码保护：#9 Fireworks. those tiny little things…</title>
		<link>http://www.ivon.cn/201007/those-tiny-little-things-9.html</link>
		<comments>http://www.ivon.cn/201007/those-tiny-little-things-9.html#comments</comments>
		<pubDate>Sat, 03 Jul 2010 22:52:15 +0000</pubDate>
		<dc:creator>ivon</dc:creator>
				<category><![CDATA[随感 Moods]]></category>
		<category><![CDATA[花火]]></category>

		<guid isPermaLink="false">http://www.ivon.cn/?p=580</guid>
		<description><![CDATA[无法提供摘要。这是一篇受保护的文章... ]]></description>
			<content:encoded><![CDATA[<form action="http://www.ivon.cn/wp-pass.php" method="post">
<p>这是一篇受密码保护的文章。您需要提供访问密码：</p>
<p><label for="pwbox-580">密码：<br />
<input name="post_password" id="pwbox-580" type="password" size="20" /></label><br />
<input type="submit" name="Submit" value="提交" /></p></form>
]]></content:encoded>
			<wfw:commentRss>http://www.ivon.cn/201007/those-tiny-little-things-9.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>密码保护：#8 Firefly. those tiny little things…</title>
		<link>http://www.ivon.cn/201006/those-tiny-little-things-8.html</link>
		<comments>http://www.ivon.cn/201006/those-tiny-little-things-8.html#comments</comments>
		<pubDate>Thu, 17 Jun 2010 04:41:28 +0000</pubDate>
		<dc:creator>ivon</dc:creator>
				<category><![CDATA[随感 Moods]]></category>
		<category><![CDATA[萤火虫]]></category>

		<guid isPermaLink="false">http://www.ivon.cn/?p=570</guid>
		<description><![CDATA[无法提供摘要。这是一篇受保护的文章... ]]></description>
			<content:encoded><![CDATA[<form action="http://www.ivon.cn/wp-pass.php" method="post">
<p>这是一篇受密码保护的文章。您需要提供访问密码：</p>
<p><label for="pwbox-570">密码：<br />
<input name="post_password" id="pwbox-570" type="password" size="20" /></label><br />
<input type="submit" name="Submit" value="提交" /></p></form>
]]></content:encoded>
			<wfw:commentRss>http://www.ivon.cn/201006/those-tiny-little-things-8.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>密码保护：#7 big day~ those tiny little things…</title>
		<link>http://www.ivon.cn/201006/those-tiny-little-things-7.html</link>
		<comments>http://www.ivon.cn/201006/those-tiny-little-things-7.html#comments</comments>
		<pubDate>Fri, 11 Jun 2010 05:19:52 +0000</pubDate>
		<dc:creator>ivon</dc:creator>
				<category><![CDATA[随感 Moods]]></category>
		<category><![CDATA[避风港]]></category>

		<guid isPermaLink="false">http://www.ivon.cn/?p=561</guid>
		<description><![CDATA[无法提供摘要。这是一篇受保护的文章... ]]></description>
			<content:encoded><![CDATA[<form action="http://www.ivon.cn/wp-pass.php" method="post">
<p>这是一篇受密码保护的文章。您需要提供访问密码：</p>
<p><label for="pwbox-561">密码：<br />
<input name="post_password" id="pwbox-561" type="password" size="20" /></label><br />
<input type="submit" name="Submit" value="提交" /></p></form>
]]></content:encoded>
			<wfw:commentRss>http://www.ivon.cn/201006/those-tiny-little-things-7.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>密码保护：#6 NY trip with Amy~ those tiny little things…</title>
		<link>http://www.ivon.cn/201005/those-tiny-little-things-6.html</link>
		<comments>http://www.ivon.cn/201005/those-tiny-little-things-6.html#comments</comments>
		<pubDate>Sat, 29 May 2010 04:28:04 +0000</pubDate>
		<dc:creator>ivon</dc:creator>
				<category><![CDATA[旅行 Travel]]></category>
		<category><![CDATA[随感 Moods]]></category>
		<category><![CDATA[成长]]></category>

		<guid isPermaLink="false">http://www.ivon.cn/?p=553</guid>
		<description><![CDATA[无法提供摘要。这是一篇受保护的文章... ]]></description>
			<content:encoded><![CDATA[<form action="http://www.ivon.cn/wp-pass.php" method="post">
<p>这是一篇受密码保护的文章。您需要提供访问密码：</p>
<p><label for="pwbox-553">密码：<br />
<input name="post_password" id="pwbox-553" type="password" size="20" /></label><br />
<input type="submit" name="Submit" value="提交" /></p></form>
]]></content:encoded>
			<wfw:commentRss>http://www.ivon.cn/201005/those-tiny-little-things-6.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

