Profil de BillBill的小茶坊PhotosBlogListes Outils Aide

寅 娄

Occupation
Lieu
Centres d'intérêt 
无可救药的爱着计算机,喜欢和数字打交道

Lecteur Windows Media

Bill的小茶坊

If one wants to succeed, it is quite necessary for him to live a life of abstinence.
4 juin

被电到了

巴赫的《无伴奏大提琴组曲》在电脑里放了很久,最近拿出来听了一下,结果就被电到了,太喜欢了,非常赞。
 
没想到大提琴能营造出如此瑰丽的音乐色彩,在巴赫缜密严谨的谱曲下,6首组曲像广袤的大海一样让听者完全沉醉了。
 
强烈推荐一记。
31 mai

My Last Week

最后一周,红宝已经差不多都背出来了,昨天小模考了一下,一般般,类反错1、2个,填空2个,阅读3个,数学很Happy,这样。
其他的course project也做的差不多了,dlx终于知道怎么写vhdl了,小小地写了一下,理论上这个pipeline是可以跑起来了,下周去做做实验~OO的project也开始有点领悟了,其实如果直接做的话1天不到就能做完,但是我总是想设计得更好,结果就一直没写,总想有人在旁边reassure我一下
18 mai

心情好差

红宝开始过最后认真的一遍,这次要把反义词一起背进去,之后就快速地过红宝吧,也没时间慢慢来了。
TODOlist上N多事情没完成,心里一直觉得不踏实,好多好多的project还有考试。这个学期犯了几个错误,唉。
感觉这个学期精力太分散,要做的事情太多,结果一件都没做好。
稀疏的光线透过窗帘照进来,照在昏黄的壁橱上,希望就这么一点么。。。。。
4 mai

Pumping Lemma

The two examples of most importance are pumping lemma for regular languages and pumping lemma for context-free grammar(CFG).
 
Pumping Lemma for regular languages:
Let L be a regular language. Then there exists an integer p which is no less than 1, depending only on L, such that every string w in L of length at least p, which is often called the "pumping length", can be written as w = xyz, satisfying the following conditions:
a) |y| > 0
b) |xy| <= p
c) for all i >= 0, x(y^i)z belongs to L
Proof. For any regular language L, there exists an FA that accepts it, and we assume such FA has minimal states, denoting p as the number of states. For any given string w in L, whose length is at least p, there is a path from start state A_0 to final state A_p-1. Since such path length is at least p and we have p states, according to pigeonhole principle, there exists two states, denoted as A_i and A_j, which are the same, i.e. A_i = A_j. Thus, this FA has three parts. The first one is from A_0 to A_i-1, which is denoted as x, the second one is from A_i to A_j, which is a cycle and is denoted as y, the last part is the rest. Note that for all i >=0, x(y^i)z can be accepted by this FA. Thus, x(y^i)z belongs to L.
 
Pumping Lemma for CFG:
Let L be a context-free language, then there exists some integer p > 0 such that for any string s in L with |s| >= p can be written as s = uvxyz satisfying the following conditions:
a) |vxy| <= p
b) |vy| >= 1
c) for all i >=0, u(v^i)x(y^i)z belongs to L
 
1 mai

java.util.ConcurrentModificationException

今天写程序的时候抛出了这个异常,怎么调都不对
后来查了API才明白,是对Iterator的理解不够啊~
 
常用的Iterator使用方法是这样的(假设这是一个Hashset<T>的迭代器):
while (iterator.hasNext()) {
    T t = iterator.next();
}
 
如果在while中对Hashset进行了增加或删除,则会抛出这个异常,原因是Hashset中所做的修改不会通知它的迭代器,而在迭代器中有一个状态,一旦它检查到状态和它预计的不一致时,为了安全考虑就抛出了这样的异常
 
正确的使用方法应该是用Iterator自己的remove(),但是对于插入似乎没有好的方法
 
暂时没有查到很好的解决方法,我只能自己搞了一个ArrayList<T>来模拟集合的行为。
 
澳门  
Photo 1 sur 50