顯示具有 Self-Learning 標籤的文章。 顯示所有文章
顯示具有 Self-Learning 標籤的文章。 顯示所有文章

Internet Explorer (IE) 9 Beta 版本正式提供下載,初步試用心得分享!

微軟在今天正式宣布IE9 Beta可以提供下載使用,雖然我目前是使用Mozilla Firefox + Google Chrome 兩個瀏覽器,除了【非必要】的情況外,幾乎很少使用到微軟的IE了,但是這次微軟的IE9似乎釋出了許多新的功能,既然如此就給它一個機會,下載Beta版本來試用看看吧!

在開頭要先提醒大家,IE9已經不支援Windows XP了!如果你是使用XP的玩家,就要先說聲抱歉...。

快速瀏覽IE9的各種特點

微軟替IE9打造了一個叫做【Beauty Of the Web】的網站。裡面詳細的介紹了IE9的特點,如果想要了解的人不妨參考一下這個網站。

下載

想要下載IE9 Beta版本可以連到微軟的網頁:

IE9 Beta 首頁:http://windows.microsoft.com/zh-TW/internet-explorer/products/ie-9/home


點選畫面當中的【立刻取得】之後,會連結到IE9的下載頁面,選擇想要測試的語言和作業系統版本就可以開始下載了。



下載完安裝之後,在這裡要特別提醒大家,安裝完他會【強迫你重新開機】!如果你還在使用其他的應用程式記得先儲存或關閉(怎麼這麼惱人...)。

以下我們針對IE9的幾個特點分別來介紹。

1. 簡潔的介面

在打開IE9後,第一個畫面應該類似這樣,可以看到整個介面的配置上還蠻簡潔的。


在介面的配置上,我們可以看到IE9把網址列和分頁列作在一起,想要讓整個瀏覽的頁面最大化。不過這有好有壞,壞處就是當分頁一多的時候,會看起來很擁擠(應該會有附加元件可以解決吧,這部分還不清楚)。


另外一個顯著的改變是,IE9把所有的提示放到了【瀏覽器的最下方】,當你在瀏覽時,會發現下方會出現類似這樣的訊息:


這樣的設計我想也是為了簡化整個使用者操作的步驟以及為了介面上的考量所設計。

2. 新的分頁標籤

當你打開一個新的分頁標籤後,會看到這樣的分頁標籤,下方的長條圖代表瀏覽頻率的高低(當然這個功能在Firefox和Chrome中都有附加元件可以達成),不過目前沒有辦法針對要顯示的網站作自訂,這邊列出來的只是比較常被瀏覽的網頁:



3. 下載管理員

當你在下載時,會跑出一個【下載管理員】來幫助你。你可以在【管理】中的【檢視下載】中叫出它,或是直接使用【Ctrl+j】的快速鍵:


4. 支援硬體加速

IE9支援了【硬體加速】。當瀏覽器需要處理大量的圖像資料、HTML5、時,它會利用電腦的【GPU(圖形處理器)】來處理,加快速度。這個功能在IE9上預設是開啟的,如果您想要關閉當然也可以,在【管理】當中的【網際網路選項】中的進階標籤下,可以看到【加速圖形】的選項:


不過開啟這個功能照道理來說在瀏覽的體驗上會比較好,可以參考微軟所提供的這段影片:



5. 支援多種新的標準

IE9支援了許多新的網路標準,最重要得當然就是HTML5和CSS3了。其它的標準還包括了Web Open Font Format(WOFF)和WebM等。關於IE9支援HTML5的標準可以參考該影片:



為了讓大家知道HTML5的威力,微軟還特地打造了一個叫做【TestDrive】的網站,用來展示IE9如何展現HTML5所能打造的效果:


6. 新的 Javascript 引擎

IE9採用了新的Javascript引擎,叫作【Chakra】。效能看起來比IE8好上非常多

(來源網站:HTML5, Hardware Accelerated: First IE9 Platform Preview Available for Developers)

在實際的瀏覽體驗上,目前我只有短短的試用幾個小時,不過的確是【蠻快速的】,甚至比起Firefox來說,有過之而無不及,使用上有接近Chrome的速度感。不過我的Firefox裝了許多的外掛,而且Firefox還有許多的其他優點,在這裡就先不提了。不過就初步的使用感覺來說,IE9相當不錯。

7. 與Windows 7的緊密結合

IE9可以和Windows 7緊密的結合,利用【釘選到工具列】這樣的動作,你可以將不同的網站獨立成一個【類似應用程式】的方式來進行存取。這和之前我們介紹過的Google Chrome的【建立應用程式捷徑】可以說是相當類似。

使用的方式就是把某個分頁拖曳到Windows 7的工具列上就可以了。往後想要進行存取時就可以直接點選。

使用心得

在短暫的試用之後,我必須說IE9真的【蠻不錯的】!最基本的瀏覽速度上,的確可以明顯的感受到比起之前的IE系列要快上不少,比起Firefox也快上一些,有接近Google Chrome的效能,看來新的Javascript引擎有發揮它的功效,不過Firefox也快要推出Firefox 4了,【據說】效能也是有大幅進步,這個部份就要之後的比較才會知道了。在介面上IE9也相當的簡潔,不會讓人感到複雜或難上手。

這次的IE9改版我個人覺得總算讓微軟出了一口氣,的確有快馬加鞭趕上的趨勢,對於那些【叛逃】到其他瀏覽器的用戶來說,會不會因為IE9的推出而【回鍋】,目前還很難說,畢竟使用者的習慣也是很難改變的。不過對於其他還在使用IE的使用者,有一個更好用、更快速的瀏覽器,當然是好事情一件囉!

也歡迎大家發表對於使用IE9的感想:)

【延伸閱讀】
IEBlog
IE9 TestDrive
T客邦:先嗆先嬴?IE9 的硬體加速第一名
Beauty of the Web

TED - 吸收新的IDEAS順便加強英文!

今天要跟大家分享一個我時常上去瀏覽的網站,那就是【TED - Ideas worth spreading】


TED是一個小型的非營利組織,從1984成立到現在也超過20年了。他主要成立的宗旨是為了提供人們三方面的全新資訊:科技(Technology)、娛樂(Entertainment)和設計(Design)。TED每年都會在美國加州(California)的Long Beach舉辦Conference,並且邀請許多各界知名的人士前來演講。TED本身也有許多計畫正在進行,包括了TED Talks、TED翻譯計畫、TEDx Community等等。

今天主要要介紹的就是
TED Talks。這是一個充滿高品質演講的計畫!裡面邀請到許多在各種領域成功的人士前來演講,不管是經驗分享或是新的Ideas發表,都相當值得一看。


網頁的左邊有很多篩選影片的條件,你可以看最多人瀏覽的影片、科技相關、娛樂相關、或是根據不同的活動(TED2008、TED2009...etc)。最棒的是,TED有一個TED Translation的計畫,他們會把這些演講加上不同的字幕,所以這些演講幾乎都有清楚的字幕可以選擇,也有中文的喔!


在每一個演講的下方都有【Substitles Avaliable for(字幕) 】的選項清單,可以根據自己的需求作選擇,同時,你還可以把該場演講以mp3或mp4的格式下載到電腦中,如此一來就可以反覆收聽了:


不管你是要吸收新知,聽取大師們的演講,還是想要練練英文聽力,TED Talks的高品質影片都可以滿足你們需求。還沒上去過的話建議大家可以去使用看看囉!

十招專業簡報技巧!

一個好的簡報,可以讓你的演說更加的專業和打動人心,不管你是不是用powerpoint來作為輔助的工具,以下的數點應該都可以幫助你完成一場更加完美的報告,讓我們看下去吧!

  • 嘗試製作良好的投影片
一個良好的投影片可以幫助聽眾更快的進入你要訴說的主題。當你在描述一個觀念或故事的時候,有投影片的輔助會讓演說更加的清楚易懂。在製作投影片有幾點要注意:
  1. 不要從許多不同的來源複製貼上,這會讓你的投影片很雜亂,沒有架構可言。
  2. 盡量讓投影片簡單、易懂,不要放太多的文字或物件在一張投影片上,這會擾亂聽眾。
  3. 一張投影片只訴說一件事情。
  4. 適當地字體大小和顏色配置
  5. 標題和內文使用的字體和大小應該具有一致性。
  6. 黑白對比有時候是最枯燥的,但也最清楚。兩個相近的顏色擺在一起是看不清楚的。

  • KISS原則
永遠記得Keep it Simple and Straight(KISS)。

  • 一張圖片勝過千言萬語
一張生動的圖片勝過你的長篇大論,嘗試去找一張可以高品質的圖片是很不容易的,不過這也會讓你的簡報更加生動。(Flickr是個相當好得圖片來源,而且品質很高)
  • 謹慎使用動畫
當你在投影片中使用動畫時,務必謹慎且小心。過多的動畫只會干擾聽眾的視覺。當我們在解釋一個模型或流程的時候,適當地動畫輔助就很有用。

  • 最重要的是聽眾
記住以下幾點:
  1. 聽眾是誰?
  2. 你要他們記得什麼?
  3. 他們期待聽到什麼?
  4. 最重要的核心概念是什麼?

  • 練習
不斷地練習是成功的第一步,也是最中要的一步。
  1. 徹底的瞭解你的投影片。
  2. 保持平順且合適的說話節奏。
  3. 適當地使用肢體語言。
  4. 眼光與聽眾接觸。
之前我也寫過一篇「簡報與我」,有興趣的讀者也可以搭配閱讀,希望大家都可以成為一個出色的報告者!

arg 和 arg max

最近在讀paper時看到了這個數學式子 y* = argmax f(t),想當初數學這麼爛的我一定不懂argmax是什麼,找了好一會兒才找到,記錄一下避免忘記 :)

  • y = f(t) 是一般常見的函式,代表給定一個t值,丟到f函式中會回傳一個值給y。
  • y = max f(t) 代表:y 是f(t)函式所有的值中最大的output。
  • y = arg max f(t) 代表:y 是f(t)函式中,會產生最大output的那個參數t。

看起來很模糊,舉個例子應該比較好理解:

假設有一個函式 f(t),t 的可能範圍是 {0,1,2},f(t=0) = 10 ; f(t=1) = 20 ; f(t=2) = 7,那分別對應的y如下:

  • y = max f(t)  = 20
  • y* = arg max f(t) = 1

這樣應該就很好理解了吧 :)


歐巴馬就職演說


My fellow citizens:

I stand here today humbled by the task before us, grateful for the trust youhave bestowed, mindful of the sacrifices borne by our ancestors. I thank President Bush for his service to our nation, as well as the generosity and cooperation he has shown throughout this transition.

Forty-four Americans have now taken the presidential oath. The words have been spoken during rising tides of prosperity and the still waters of peace. Yet, every so often the oath is taken amidst gathering clouds and raging storms. At these moments, America has carried on not simply because of the skill or vision of those in high office, but because We the People have remained faithful to the ideals of our forbearers, and true to our founding

So it has been. So it must be with this generation of Americans. That we are in the midst of crisis is now well understood. Our nation is at war, against a far-reaching network of violence and hatred. Our economy is badly weakened, a consequence of greed and irresponsibility on the part of some, but also our collective failure to make hard choices and prepare the nation for a new age. Homes have been lost; jobs shed; businesses shuttered. Our health care is too costly; our schools fail too many; and each day brings further evidence that the ways we use energy strengthen our adversaries and threaten our planet.

These are the indicators of crisis, subject to data and statistics. Less measurable but no less profound is a sapping of confidence across our land — a nagging fear that America's decline is inevitable, and that the next generation must lower its sights.

Today I say to you that the challenges we face are real. They are serious and they are many. They will not be met easily or in a short span of time. But know this, America — they will be met.

On this day, we gather because we have chosen hope over fear, unity of purpose over conflict and discord. On this day, we come to proclaim an end to the petty grievances and false promises, the recriminations and worn out dogmas, that for far too long have strangled our politics.

We remain a young nation, but in the words of Scripture, the time has come to set aside childish things. The time has come to reaffirm our enduring spirit; to choose our better history; to carry forward that precious gift, that noble idea, passed on from generation to generation: the God-given promise that all are equal, all are free, and all deserve a chance to pursue their full measure of happiness.

In reaffirming the greatness of our nation, we understand that greatness is never a given. It must be earned. Our journey has never been one of short-cuts or settling for less. It has not been the path for the faint-hearted — for those who prefer leisure over work, or seek only the pleasures of riches and fame. Rather, it has been the risk-takers, the doers, the makers of things — some celebrated but more often men and women obscure in their labor, who have carried us up the long, rugged path towards prosperity and freedom.

For us, they packed up their few worldly possessions and traveled across oceans in search of a new life.

For us, they toiled in sweatshops and settled the West; endured the lash of the whip and plowed the hard earth. For us, they fought and died, in places like Concord and Gettysburg; Normandy and Khe Sahn.

Time and again these men and women struggled and sacrificed and worked till their hands were raw so that we might live a better life. They saw America as bigger than the sum of our individual ambitions; greater than all the differences of birth or wealth or faction.

This is the journey we continue today. We remain the most prosperous, powerful nation on Earth. Our workers are no less productive than when this crisis began. Our minds are no less inventive, our goods and services no less needed than they were last week or last month or last year. Our capacity remains undiminished. But our time of standing pat, of protecting narrow interests and putting off unpleasant decisions — that time has surely passed. Starting today, we must pick ourselves up, dust ourselves off, and begin again the work of remaking America.

For everywhere we look, there is work to be done. The state of the economy calls for action, bold and swift, and we will act — not only to create new jobs, but to lay a new foundation for growth. We will build the roads and bridges, the electric grids and digital lines that feed our commerce and bind us together. We will restore science to its rightful place, and wield technology's wonders to raise health care's quality and lower its cost. We will harness the sun and the winds and the soil to fuel our cars and run our factories. And we will transform our schools and colleges and universities to meet the demands of a new age. All this we can do. And all this we will do.

Now, there are some who question the scale of our ambitions — who suggest that our system cannot tolerate too many big plans. Their memories are short. For they have forgotten what this country has already done; what free men and women can achieve when imagination is joined to common purpose, and necessity to courage.

What the cynics fail to understand is that the ground has shifted beneath them — that the stale political arguments that have consumed us for so long no longer apply. The question we ask today is not whether our government is too big or too small, but whether it works — whether it helps families find jobs at a decent wage, care they can afford, a retirement that is dignified. Where the answer is yes, we intend to move forward. Where the answer is no, programs will end. And those of us who manage the public's dollars will be held to account — to spend wisely, reform bad habits, and do our business in the light of day — because only then can we restore the vital trust between a people and their government.

Nor is the question before us whether the market is a force for good or ill. Its power to generate wealth and expand freedom is unmatched, but this crisis has reminded us that without a watchful eye, the market can spin out of control — and that a nation cannot prosper long when it favors only the prosperous. The success of our economy has always depended not just on the size of our Gross Domestic Product, but on the reach of our prosperity; on our ability to extend opportunity to every willing heart — not out of charity, but because it is the surest route to our common good.

As for our common defense, we reject as false the choice between our safety and our ideals. Our Founding Fathers, faced with perils we can scarcely imagine, drafted a charter to assure the rule of law and the rights of man, a charter expanded by the blood of generations. Those ideals still light the world, and we will not give them up for expedience's sake. And so to all other peoples and governments who are watching today, from the grandest capitals to the small village where my father was born: know that America is a friend of each nation and every man, woman, and child who seeks a future of peace and dignity, and that we are ready to lead once more.

Recall that earlier generations faced down fascism and communism not just with missiles and tanks, but with sturdy alliances and enduring convictions. They understood that our power alone cannot protect us, nor does it entitle us to do as we please. Instead, they knew that our power grows through its prudent use; our security emanates from the justness of our cause, the force of our example, the tempering qualities of humility and restraint.

We are the keepers of this legacy. Guided by these principles once more, we can meet those new threats that demand even greater effort — even greater cooperation and understanding between nations. We will begin to responsibly leave Iraq to its people, and forge a hard-earned peace in Afghanistan. With old friends and former foes, we will work tirelessly to lessen the nuclear threat, and roll back the specter of a warming planet. We will not apologize for our way of life, nor will we waver in its defense, and for those who seek to advance their aims by inducing terror and slaughtering innocents, we say to you now that our spirit is stronger and cannot be broken; you cannot outlast us, and we will defeat you.

For we know that our patchwork heritage is a strength, not a weakness. We are a nation of Christians and Muslims, Jews and Hindus — and non-believers. We are shaped by every language and culture, drawn from every end of this Earth; and because we have tasted the bitter swill of civil war and segregation, and emerged from that dark chapter stronger and more united, we cannot help but believe that the old hatreds shall someday pass; that the lines of tribe shall soon dissolve; that as the world grows smaller, our common humanity shall reveal itself; and that America must play its role in ushering in a new era of peace.

To the Muslim world, we seek a new way forward, based on mutual interest and mutual respect. To those leaders around the globe who seek to sow conflict, or blame their society's ills on the West — know that your people will judge you on what you can build, not what you destroy. To those who cling to power through corruption and deceit and the silencing of dissent, know that you are on the wrong side of history; but that we will extend a hand if you are willing to unclench your fist.

To the people of poor nations, we pledge to work alongside you to make your farms flourish and let clean waters flow; to nourish starved bodies and feed hungry minds. And to those nations like ours that enjoy relative plenty, we say we can no longer afford indifference to suffering outside our borders; nor can we consume the world's resources without regard to effect. For the world has changed, and we must change with it.

As we consider the road that unfolds before us, we remember with humble gratitude those brave Americans who, at this very hour, patrol far-off deserts and distant mountains. They have something to tell us today, just as the fallen heroes who lie in Arlington whisper through the ages. We honor them not only because they are guardians of our liberty, but because they embody the spirit of service; a willingness to find meaning in something greater than themselves. And yet, at this moment — a moment that will define a generation — it is precisely this spirit that must inhabit us all.

For as much as government can do and must do, it is ultimately the faith and determination of the American people upon which this nation relies. It is the kindness to take in a stranger when the levees break, the selflessness of workers who would rather cut their hours than see a friend lose their job which sees us through our darkest hours. It is the firefighter's courage to storm a stairway filled with smoke, but also a parent's willingness to nurture a child, that finally decides our fate.

Our challenges may be new. The instruments with which we meet them may be new. But those values upon which our success depends — hard work and honesty, courage and fair play, tolerance and curiosity, loyalty and patriotism — these things are old. These things are true. They have been the quiet force of progress throughout our history. What is demanded then is a
return to these truths. What is required of us now is a new era of responsibility — a recognition, on the part of every American, that we have duties to ourselves, our nation, and the world, duties that we do not grudgingly accept but rather seize gladly, firm in the knowledge that there
is nothing so satisfying to the spirit, so defining of our character, than giving our all to a difficult task.

This is the price and the promise of citizenship.

This is the source of our confidence— the knowledge that God calls on us to shape an uncertain destiny.

This is the meaning of our liberty and our creed — why men and women and children of every race and every faith can join in celebration across this magnificent mall, and why a man whose father less than sixty years ago might not have been served at a local restaurant can now stand before you to take a most sacred oath.

So let us mark this day with remembrance, of who we are and how far we have traveled. In the year of America's birth, in the coldest of months, a small band of patriots huddled by dying campfires on the shores of an icy river. The capital was abandoned. The enemy was advancing. The snow was stained with blood. At a moment when the outcome of our revolution was most in doubt, the father of our nation ordered these words be read to the people:

"Let it be told to the future world...that in the depth of winter, when nothing but hope and virtue could survive ... that the city and the country, alarmed at one common danger, came forth to meet [it]."

America. In the face of our common dangers, in this winter of our hardship, let us remember these timeless words. With hope and virtue, let us brave once more the icy currents, and endure what storms may come. Let it be said by our children's children that when we were tested we refused to let this journey end, that we did not turn back nor did we falter; and with eyes fixed on the horizon and God's grace upon us, we carried forth that great gift of freedom and delivered it safely to future generations.

“What I Want For You- And Every Child in America” - by President-Elect Barack Obama

Dear Malia and Sasha,

I know that you've both had a lot of fun these last two years on the campaign trail, going to picnics and parades and state fairs, eating all sorts of junk food your mother and I probably shouldn't have let you have. But I also know that it hasn't always been easy for you and Mom, and that as excited as you both are about that new puppy, it doesn't make up for all the time we've been apart. I know how much I've missed these past two years, and today I want to tell you a little more about why I decided to take our family on this journey.

When I was a young man, I thought life was all about me—about how I'd make my way in the world, become successful, and get the things I want. But then the two of you came into my world with all your curiosity and mischief and those smiles that never fail to fill my heart and light up my day. And suddenly, all my big plans for myself didn't seem so important anymore. I soon found that the greatest joy in my life was the joy I saw in yours. And I realized that my own life wouldn't count for much unless I was able to ensure that you had every opportunity for happiness and fulfillment in yours. In the end, girls, that's why I ran for President: because of what I want for you and for every child in this nation.

I want all our children to go to schools worthy of their potential—schools that challenge them, inspire them, and instill in them a sense of wonder about the world around them. I want them to have the chance to go to college—even if their parents aren't rich. And I want them to get good jobs: jobs that pay well and give them benefits like health care, jobs that let them spend time with their own kids and retire with dignity.

I want us to push the boundaries of discovery so that you'll live to see new technologies and inventions that improve our lives and make our planet cleaner and safer. And I want us to push our own human boundaries to reach beyond the divides of race and region, gender and religion that keep us from seeing the best in each other.

Sometimes we have to send our young men and women into war and other dangerous situations to protect our country—but when we do, I want to make sure that it is only for a very good reason, that we try our best to settle our differences with others peacefully, and that we do everything possible to keep our servicemen and women safe. And I want every child to understand that the blessings these brave Americans fight for are not free—that with the great privilege of being a citizen of this nation comes great responsibility.

That was the lesson your grandmother tried to teach me when I was your age, reading me the opening lines of the Declaration of Independence and telling me about the men and women who marched for equality because they believed those words put to paper two centuries ago should mean something.

She helped me understand that America is great not because it is perfect but because it can always be made better—and that the unfinished work of perfecting our union falls to each of us. It's a charge we pass on to our children, coming closer with each new generation to what we know America should be.

I hope both of you will take up that work, righting the wrongs that you see and working to give others the chances you've had. Not just because you have an obligation to give something back to this country that has given our family so much—although you do have that obligation. But because you have an obligation to yourself. Because it is only when you hitch your wagon to something larger than yourself that you will realize your true potential.

These are the things I want for you—to grow up in a world with no limits on your dreams and no achievements beyond your reach, and to grow into compassionate, committed women who will help build that world. And I want every child to have the same chances to learn and dream and grow and thrive that you girls have. That's why I've taken our family on this great adventure.

I am so proud of both of you. I love you more than you can ever know. And I am grateful every day for your patience, poise, grace, and humor as we prepare to start our new life together in the White House.

Love, Dad

Precision and Recall - Information Retrieval


在資訊檢索或資料探勘的領域中,一個最基本的問題就是要如何衡量一個系統的效能?這裡指的系統效能是說:當我們進行一個Query時,在一個檢索或搜尋系統中,到底回傳回來的結果,是不是使用者想要的?回傳的效率有多好?
這裡介紹兩個用來評估檢索結果的方法,叫做【查準率(Precision)】和【查全率(Recall)】


先來看看定義:
  • Precision = Relevant Documents Retrieved / Total Retrieved Documents
  • Recall = Relevant Documents Retrieved / Total Relevant Docuements
從上面的公式可以看出來,Precision和Recall的分子都是Relevant Document Retrieved(抓回來的相關文章數目),差別的地方在於Precision的分母是【抓回文章的總數】;而Recall的分母則是【相關文章的總數】。


舉個例子:假設現在資料庫中有10000筆資料,和美食有關的文章有500篇。使用者在輸入美食的關鍵字後,回傳的文章有4000篇,其中有400篇是和美食有關的。

Precision = 400 / 4000 = 10%
Recall = 400 / 500 = 80%

在這裡代表的意思就是,這個搜尋引擎的查準率是10%、查全率是80%。

繼續延伸下去,如果我們要做比較細部的分析,可以將以上的兩個比率畫分成下面的四個象限:


tp : 代表文章和此query有相關,而且系統判斷正確回傳。
fp : 代表文章和此query沒有相關,但是系統判斷錯誤卻被搜尋引擎回傳。
fn : 代表文章和此query有相關,但是系統判斷錯誤沒有回傳。
tn : 代表文章和此query沒有相關,而且系統判斷正確沒有回傳。

所以我們得出:
Precision = tp / tp+fp
Recall = tp / tp+fn

其實這和統計上的Type 1 error、Type 2 error 也有相關,不過在這裡就不再多說了...,有興趣的可以到Google找找,相信會有很多資訊的。

tf-idf (term frequency–inverse document frequency)

寫作業會用到,先把學到的記錄一下以免忘記...。

TF-IDF常被用在Data Mining相關的領域上,用來計算某個字詞在文章中的相對重要程度

字詞的重要性隨著它在文件中出現的次數成正比增加但同時會隨著出現在越多文章中而下降。這是很正確的想法,舉個例子來說:

假設我們要找的詞是:【演算法的範例】。正常來說,我們按照段詞切字的法則應該會把這個字串切割成三個短詞【演算法】【的】【範例】。

假設【演算法】在文章A中出現10次、【的】出現100次、【範例】出現30次,文章A總共有1000個詞,則三個短詞的TF(Trem Frequency)分別是0.01、0.1和0.03。

如果我們資料庫中總共有10000篇文章,【演算法】總共出現在15篇文章、【的】出現在10000篇文章、【應用】出現在5000篇文章,則IDF分別是:2.82、0、0.30。

用一般的想法來思考,【演算法】這個詞應該是我們最重要的搜尋詞、接著是【應用】,最不重要的是【的】。因為【的】實在是太常出現了,不可能有文章中沒有這個詞,所以從上面的計算結果可以看出其IDF是0,在計算TF-IDF的值時,即使他的TF再高,最後的結果都會變成0。【演算法】這個詞可能TF的值不是很高,但是可以利用IDF來提高它的權重,這也比較符合我們一般的思考結果。

參考資料:

【Wikipedia TF-IDF】
【數學之美 系列九 -- 如何確定網頁和查詢的相關性】

N-gram Stemmer Similarity Matrix



記錄一下。

Normalization

資料庫正規化的目的在於減少重複的欄位,避免不正常的情況產生,進而增加效率。(Database Normalization is a technique for designing relational database tables to minimize duplication of information and, in so doing, to safeguard the database against certain types of logical or structural problems, namely data anomalies.)

First normal form

First normal form is that it does not allow duplicate rows or nulls. A table with unique key and without any nullable columns is in 1NF.

Second normal from
- Must in 1NF
- No Partial Dependency (Non-Primary Attributes have to full funtional dependency to primary key)
- In simple terms, a table is 2NF if it is in 1NF and all fields are dependent on the whole of the primary key, or a relation is in 2NF if it is in 1NF and every non-key attribute is fully dependent on each candidate key of the relation.

Third normal form
- Must in 2NF
- Every non-prime attribute of R is non-transitively dependent on every key of R. (i.e. Do not have X->Y, Y->Z , then X->Z)


存款準備率

最近在ptt上看到一個火紅的討論就是彭淮南要調降存款準備率5碼...討論的沸沸揚揚、轟轟烈烈,可是我不知道會有什麼影響..趁這個機會搞懂吧!

存款準備率就是銀行存款和存款準備金之間的比率。假設一間銀行有存款1000元,存款準備率是10%,銀行就必須要準備100元的現金在銀行裡隨時給存款戶提領,剩下90%的現金可以拿去投資賺錢(放款或其他投資)。

如果銀行準備的現金超過中央銀行所規定的"法定存款準備率",超出的部分叫做"超額準備金"。

- 提高存款準備率代表銀行必須要準備更多的現金,而減少投資行為,如此會降低銀行的獲利。通常代表經濟過熱,要抑制在市場上流動的現金,因而提高存款準備率。(緊縮的貨幣政策)

- 調降存款準備率代表銀行可以擁有更多的資金去投資,進而刺激經濟,通常在市場景氣不好時會調降存款準備率,增加在市場上流動的現金。

The Claremont Report on Database Research

這是老師給我們的一個研究報告,內容主要是在勾勒未來在資料庫的研究上,有什麼新的方向可以去實現。花了點時間把它KO了,覺得內容還不錯,把重點記錄在這裡。

New Database Engine Architecture

主要是提到因為Relational Database Management Systems有一些缺點。像是在處理media和merging的混合型資料時,效能低落;另外,因為目前硬體環境的大幅進步,所以文中也建議資料庫的整體設計必須要開創一個新的局面,也就是要設計出可以完美利用multi-core processors和large memory的引擎。

Declarative Programming Languages

首先,我對於什麼是Declarative Programming Language並不清楚,不過文中提到了一個發展的新趨勢,也就是Map Reduce。Map-Reduce是一個由Google所提出的framework,主要的核心概念是parallel computing,用在處理相當大量的資料上有顯著的成果。

The Interplay of structured and unstructured data

因為網際網路的發展快速,加上Web 2.0概念的興起,資料量有了爆炸性的成長。要如何從這些錯綜複雜的異質性(heterogeneous)資料裡面,找出有用的資訊,甚至是發展一套全新的Mining Technic來extract都是可以思考的方向。

Cloud data services

Cloud Computing是最近很火紅的名詞。也因為這樣新的架構的提出,造成了data management architecture的改變,相關的議題還有Grid Computing,也是用在處理大量的資料。我覺得這和上一個觀點可以互相結合,以往由特定幾個大企業提供服務和資訊的時代已經過去了,現今的趨勢已經從企業端轉移到客戶端(Enterprise to Client),不管是資料量的成長和專業及非專業工作者的數量上都和過去有顯著的不同,以往可能需要特定專業的知識才能使用資料庫,但未來的趨勢一定會朝向人人都可以建立自己的資料庫,並且根據不同的用途,會有不同的資料庫被建立起來(像是管理家人三餐的資料庫、每個家人健康狀況的資料庫等等)。這也意味者資料庫的用途將不再侷限在大型企業用來儲存和處理大量的資料上,而要如何將這些分散各地的資料整合起來,從中挖掘出有意義的資訊,就是很好的研究方向吧!

Mobile and Virtual World

最後一個論點提到了Mobile裝置的普及和虛擬世界的現象。未來的移動式裝置勢必會有更加爆炸性的成長,我們可以根據不同的users在不同的時空環境下,提供適當的資訊。比如說:當衛星偵測到使用者正在台北火車站週遭逛街時,可以即時提供附近商家的折扣資訊或活動訊息。甚至我還想到,如果能夠進一步整合人體感知裝置,感應目前人體的內心情緒,分析出這個人目前想要購買的商品或是用餐的種類、環境、地點等等,就可以提供更加精準的資訊或廣告。但是要達到這樣的目的,除了必須要有人工智慧的相關分析外,還要有相當快速且即時的分析系統和運算能力,另外就是快速的無線網路了。有良好的資訊基礎建設的支持,才會創造美好的使用者經驗(User Experience)。

這篇文章的最後也公佈了近20年來討論過的議題:

相關討論:

The Claremont Database Research Self-Assessment Meeting
Mark Logic CEO Blog

Why HTML is not good at representing Information on the Internet?

I try to use the following contents to explain why HTML is not good at representing the Information on the Internet. On the other hand, I want to show you why we replace HTML with XML.

HTML is good at showing the layout of the Web Page. For example, we can use the , tags to represent the table form on the Internet. In other words, HTML is suitable to show the docuements to users. But, if we want to use HTML to exchange informations, it will be very difficult.

See the following HTML :

<tr>

<td> aaa </td>
<td> bbb </td>

</tr>

It will show a table on the web page when we use and tags.

Now, we will use a crawlers to grab some informations from many web pages and show the information to our customers, it will be very very difficult to write the program. Because different web pages will use different HTML tags to represent data. The page A use <td> and page B use < ul>. Our program have to deal with different situations...damn it!

If we can use some meaningful tags such as tag to represent the price and tag to represnt the name, it will be great!

XML can make the world better.

[Ajax] 初步練習

CSS觀念
  • 外部連接套用

    在這種方式下,所有的 CSS 樣式宣告都是存在另外一個檔案中。該檔案通常名稱為 .css。在 HTML 文件的

    ..
    之中,我們將用以下的程式碼將這個 .css 檔案連接進入

  • <link rel=stylesheet type="text/css" href="external-stylesheet.css">

  • 以上這一行會將 external-stylesheet.css 這個檔案內所宣告的樣式加入 HTML 文件。

重點整理

  • 非同步應用是使用JavaScript物件作出請求,而不是提交表單。
  • 請求和回應是由網頁瀏覽器處理,而不是直接由JavaScript程式所處理。
  • 一旦網頁瀏覽器得到非同步請求的回應,他會以伺服器的回應回頭呼叫JavaScript程式。
  • 執行Ajax程式一定要執行JavaScript程式。所以如果將瀏覽器的JS功能關閉,也就不能使用Ajax的程式了。
  • 所有的JS程式碼都必須放在<script>和</script>之間。

[GWT] 自學GWT - 3 (檔案結構)

這一篇我想研究一下GWT的檔案結構。到底我們建立好一個application之後,裡面所有檔案的意義是什麼呢?既然想要研究,就不要"知其然不知其所以然",一知半解是不好的XD

OK,follow up.

開始

為了熟悉指令的用法,我們在Command Line下,用applicationCreator去建立一個GWT的應用程式。(在這裡我們將此應用程式放在一個空的資料夾下,命名為Sample)

切換到Sample資料夾下,看看我們建立了什麼檔案。我們從圖中可以看到,利用applicationCreator建立的應用程式最原始有兩個檔案和一個資料夾。請看以下的解釋:
  • GWTApps-compile.cmd : 這個是一個簡單的shell script。如果你用記事本等軟體打開來看就會發現,其實不過是jdk的java指令罷了。而這個script主要的功用就是將我們的Java source code轉換成JavaScript。執行這個檔案之後,會產生一個www資料夾,會將產生的JavaScript放在裡面。
  • GWTApps-shell.cmd:這也是一個Shell Script。和前一個不同的是,這個script會執行hosted mode,也就是說它會產生一個類似瀏覽器的web server來執行我們的應用程式。(執行後會產生兩個資料夾:tomcat和.gwt-cache)
在src的資料夾下是我們所指定的package目錄,裡面有三個檔案,分別是GWTApps.gwt.xml、GWTApps.html和GWTApps.java。
  • GWTApps.java:這個就是我們的java原始檔案。我們可以在這裡撰寫我們的程式,最後會被轉換成JavaScript的就是這個檔案。
  • GWTApps.gwt.xml:這個xml檔案定義了我們的entry class在哪裡。也就是說我們要load進入web browser的是哪個module。
  • GWTApps.html:這是在執行的時候會被讀入的HTML頁面。
以上就是GWT最基本的檔案結構,看起來相當簡單吧!


[GWT] 自學GWT - 2 (Build in Eclipse)

這一篇要來談談怎麼樣在Eclipse裡面建置GWT的專案。

基本上我有點不太喜歡在Eclipse裡面搞這個有的沒的,因為會牽扯到path和classpath的問題。不過研究了快一個小時總算搞定了,當然要記錄一下,以茲紀念xD (其實是怕以後忘記...)

前言

GWT內部提供了兩個script來建立Eclipse的專案。分別是projectCreato和applicationCreator。我們只要在Command Line鍵入相對應的指令就可以Build好一個Eclipse的專案了。

開始吧

  • 建議先建立一個新的資料夾,最好不要在GWT原本的資料夾或是Eclipse的workspaces。這裡我們建立一個FirstGWTApps的資料夾,並且切換到該目錄下。
  • 接著使用projectCreator的指令去建立一個Eclipse的專案。指令的格式如下:
projectCreator -eclipse 專案名稱
  • 再來使用applicationCreator來建立我們的應用程式。指令的格式如下:
applicationCreator -eclipse 專案名稱 應用程式名稱
GWT建議我們的應用程式取名為xxx.xxx.client.應用程式名稱

  • 都建立好之後,就可以在Eclipse裡面Import我們的專案。
  • 最後選擇Run,Eclipse就會啟動一個Web Server來執行我們的專案囉!

[GWT] 自學GWT - 1

GWT已經Release很久了,現在才開始熟悉它好像有點慢XD
不過"亡羊補牢、猶時未晚",有開始總是好的嘛!對於我這個Google-addicter來說,當然要去了解一下GWT的用法囉! 廢話不多說,開始吧。

先來了解一下什麼是GWT。根據Google官方的解釋:
Google Web Toolkit (GWT) makes it easier to write high-performance AJAX applications. You write your front end in the Java programming language and GWT compiles your source into highly optimized JavaScript. Writing web apps today is a tedious and error-prone process. You spend 90% of your time working around browser quirks, and JavaScript's lack of modularity makes sharing, testing, and reusing AJAX components difficult and fragile. It doesn't have to be that way.

把關鍵字挑出來看,也就是說,GWT主要是用來進行JavaJava Script之間的轉換,我們只要用Java的語法去進行撰寫程式的動作,GWT Compiler會將我們的Java程式碼轉換成Java Script,這樣就不用去和Java Script進行奮鬥了。這對於完全不熟悉Java Script又想要開發AJAX應用程式的我來說,真是一大福音XD。

GWT的應用程式有兩種模式:Hosted ModeWeb Mode.
  • Hosted Mode:簡單來說,就是指本機端。我們可以在這裡用Java語言去撰寫應用程式,然後透過JVM去Compile。
  • Web Mode:在這個模式下,我們的應用程式被GWT Compiler轉換成JS和HTML。
要開始動手撰寫前,必須要先去下載GWT。下載回來之後,將檔案解壓縮會得到GWT的作業環境和Sample Code。根據GWT Tutorial的說法,GWT所提供的Sample都放在samples的資料夾下面。

下一篇我們來介紹一下要如何開始我們的第一個Sample!