真好,哈!
「20 校園」分類文章彙整
digital sanitation engineering: Sorting Python Dictionary By Value
In 43_A 學人精, 博班生活 on 四月 9, 2009 at 12:55 午後Original Page: http://blog.modp.com/2008/09/sorting-python-dictionary-by-value-take.html
Here’s why another reason why you should blog all your technical problems and solutions. Sometimes someone finds a better way.
In my original sorting a dict by value entry, I said the best way is:
sorted(adict.iteritems(), key=lambda (k,v): v)
Turns out I’m wrong. Gregg Lind (aka “write-only”) replied to the article with a comment pointing to his performance notes. PEP 0265 has the “best answer” that is at least 2x faster:
from operator import itemgetter sorted(d.iteritems(), key=itemgetter(1))
Thanks all!
My performance test is here:
#!/usr/bin/env python
import cProfile
def sbv0(adict,reverse=False):
return sorted(adict.iteritems(), key=lambda (k,v): v, reverse=reverse)
from operator import itemgetter
def sbv6(d,reverse=False):
return sorted(d.iteritems(), key=itemgetter(1), reverse=reverse)
imax= 10000
dmax = 500
D = dict(zip([str(i) for i in range(dmax)],range(dmax)))
cProfile.run('for i in xrange(imax): sbv0(D, reverse=False)')
cProfile.run('for i in xrange(imax): sbv6(D, reverse=False)')
Results are
Old Way:
5020002 function calls in 6.623 CPU seconds
New Way:
20002 function calls in 3.920 CPU seconds
usual word for quoting statements in papers
In 02 備忘錄, 20 校園, 22 研究方向, 40 專業領域, 博班生活 on 十月 25, 2008 at 1:39 amGramma:
Author_Name(Published_Year) + Words_of_Listing + Quote_Statement
Words_of_Listing
- point out
- mention
- indicate
- emphasize
- address
- present
- note
- discuss
從 Prof. Yu 上課之中整理出來的
江蕙─落雨聲
In 02 備忘錄, 04 哀哀, 10 家人, 43_A 學人精, 博班生活 on 十月 18, 2008 at 4:21 am人孤單 像斷翅的鳥隻
飛袂行 咁講是阮的命
~~~~~~~~~~~~~~~
雖然我的阿母還在世
但我身在遠方努力
一直沒時間能回去見
夜半 淚流滿面
[ISDPM]上課筆記
In 02 備忘錄, 20 校園, 21 碩班課業, 40 專業領域, 425257 on 五月 5, 2008 at 9:09 午後# 策略目標->行動->要定評估方式->反應達到目標與否。學校評鑑、政策研考也是一樣,要有明確的評估方式。
# critical success factors and end-means 方式去建立評估項目
## critical success factors 找 key person 來面談, 還可以使用 delphi(一致性、集中性) or focus group, AHP
## 意見要收斂,建立 stop rules
## AHP 會做到績效指標
# 規劃標與建置標不能同一組人,因為怕難的都不做;監審標,監工、審察、考核
# 規劃->分析->設計->執行->控制->評估、修改->完成
## 成本移轉與技術移轉都很重要
## 工作計劃書,工作說明
## 工作分解結構(work branch-down analysis)設計
## 組織分解結構(organization branch-down structure)設計
## 工作流程設計
## 專案工作排程,PERL+CPM (critical path method)
# key topic
## on time
## on budget (cost)
## full functionality (quality)
## user acceptance **
## favorable costs-to-benefits ratio
## low maintenance, modeling and documenting
## scalability
## integration with other systems
## minimal negative cross impacts
## reusability
# risk model = probability + impact, avoid, transfer and recovery
chapter 8
# PMBOK 的九大管理中,第一步都是 planing
# 在評估的方式:40%技術 20%管理 20%經費編列的合理性 5%簡報 15%過去資料
# 企劃書的規式與評審項目要對應
# element of project master plan, very good format!!
# vision > mission > objective
寫在教育部長的blog 的留言~
In 01 論, 04 哀哀, 20 校園 on 四月 8, 2008 at 6:02 午後原文:孩子學母語 阿嬤麻ㄟ通
在泰北(美斯樂)的中國人,那裡的小孩每天上課12個小時
除了要學習泰語,還要用泰語學習數學與其它的學科
八小時上課時間之後,還要再用華語學習一遍今天上課的內容,並且還要再學習華語。
結果,那裡的小孩子長大後,都不會說華語。
因為生活上會用華語的只有在跟家人長輩才用得到,
出了家門,見到的都是泰國人,只能用泰語~
當小孩的年紀更大,離開家鄉去到曼谷或清邁上班、打工
每天也只有泰語可用…
偶爾遇到說英語的外國人,也應對不上幾句…
因為他們小時候沒有學過英語,只有華語…
中國的文化在泰北有保存下來,因為那時候孤軍的第二輩還保有中國的文化…
但隨著時間過去,新移民(從雲南來的非法入境)人口也漸漸增加…
他們帶來的,並不是漢族文化,而是中國的少數民族的文化…
現在再去看那裡的中國人,其實很多都是頭戴銀飾的女人…
反觀台灣,我們用語言來保留民族文化
但這是我們這群大人想的~
小孩子他們管什麼文不文化嗎?
有人為小孩的未來想過嗎?
教育是百年大計,還是現在的政策操作?!
[ISDPM] 3/31 碩班上課
In 02 備忘錄, 20 校園, 21 碩班課業 on 三月 31, 2008 at 8:34 午後Review
- LAM 的意思
Today’s topic
- concurrency control: prevent dead lock.
- 不一定都會做到最高階的正規化
- 1NF 在解決 repeating groups, 用填值的方式
- 2NF 在解決 partial dependancies 部份相依(也是在處理 composite key 的問題, 多出來的欄位就是 composite entity)
- 3NF 在解決 transitive dependancies 遞移相依(JOB_CLASS ->決定 -> CHG_HOUR, 且造出 JOB_ID)
- BCNF 就是超過一個決定項的,就是 BCNF,
- 4NF, 解決 multi-value dependencies
- Data warehouse: 多面項、多維度的整合資料庫群
- Star schema: fact 出去依維度擴張,snowflake schema: 維度可以分得更細,fact constellation: 2 個以上。
[ISDPM] 3/3碩班上課
In 01 論, 20 校園, 21 碩班課業, 23 學生生活 on 三月 3, 2008 at 9:19 午後PPT: http://docs.google.com/Presentation?id=ddpk72gs_359dnxttpc9
* 方法 <-> 流程
(需求工程,Requirement Engineering;成本工程;某某工程,即用科學化、系統化的方法與流程)
* 規劃:
- 就要談’可衡量的’目標及效益,KPI,找關建成功因素,再依其找到 end & means 及 weights (ex: AHP)
- 範圍,誰用? 環境? 層級?
- 需求分析、成本分析
- 時間、人力、資源
* 分析
- 資訊需求、功能需求、作業需求
- 流程、功能、資訊、對象、目標、效益
* 設計
* 建置
* 操作
* 維護
* 控制
* 稽核
* 資訊服務業是創意產業
* 有趣的 Turban 版的 SDLC
* Prototyping
- I/O prototyping, no db
- function prototyping, only process
- sub-sys prototyping, by functional dimension
* OOD, data/program independent by data behavior
meet new friends~ Larry Coryell & Paco de Lucía
In 02 備忘錄, 20 校園, 50 音樂, 51 Jazz, 99 呼朋引伴 on 四月 29, 2007 at 11:42 午後Larry Coryell
He was born in Galveston, Texas, in 1943. After graduating from Richland High School in eastern Washington, he moved to Seattle to attend the University of Washington. In 1965, Coryell moved to New York City where he became part of Chico Hamilton’s quintet, replacing Gabor Szabo. In 1967 and 1968, he recorded with Gary Burton and Jim Pepper. His music during the late 1960s and early 1970s combined the influences of rock, jazz and eastern music. He formed his own group, The Eleventh House, in 1973. Following the break-up of this band, Coryell played mainly acoustic guitar, but returned to electric guitar later in the 1980s. In 1979, Coryell formed “The Guitar Trio” with jazz fusion guitarist John McLaughlin, and flamenco guitarist Paco de Lucia and toured Europe briefly, eventually releasing a video recorded at Royal Albert Hall in London entitled “Meeting of Spirits”. In early 1980 Larry was replaced by Al Di Meola, due to drug addiction.
Paco de Lucía
Paco de Lucía (born December 21, 1947) in Algeciras, Spain, is recognized as flamenco legend all over the world. He is a composer and guitarist, and leading proponent of the Modern Flamenco style. Not only skilled in flamenco, he is one of the very few flamenco guitarists who has also successfully crossed over into other genres of music, such as jazz, classical, and world music. He is the winner of 2004 Prince of Asturias Awards in Arts.
Michelle Branch (from 老外你好台)
Michelle Jacquet DeSevren Branch Landau (born July 2, 1983) is a Grammy Award-winning American singer, songwriter and guitarist. She made her debut in 2000, and released the platinum-selling albums The Spirit Room and Hotel Paper in August 2001 and June 2003 respectively. In 2004, she formed the musical duo The Wreckers with fellow musician Jessica Harp.
Amel Larrieux (from 老外你好台)
Amel Larrieux is an American R&B and soul singer and songwriter.
又一天 從實驗室地板醒來
In 00 炫耀, 01 論, 20 校園, 22 研究方向, 23 學生生活 on 四月 29, 2007 at 8:58 am收好睡袋 拖著狼狽的眼袋 雜亂無章的頭髮
像是受困的鬥士 又再面對另一日的煎熬
目的是活著! 目的是活著! 活在思緒便祕的日子裡…
有幸找到 漫天的煙灰 數十年後的雜草
看破嗎? 陷在這場圍城戰的領導又喊衝~
我標準工作桌面
In 00 炫耀, 20 校園, 21 碩班課業, 23 學生生活, 40 專業領域 on 三月 18, 2007 at 10:23 午後一般配備
- Mac Book *1
- Logitech BlueTooth Mouse *1
- LCD Monitor *1
- Extra White gum
- 「小富80Kg」*1
- 相聲 or Music *1
- 杯子 *1 (沒拍到)
| From NCCU Master Life |
SAD 0313 #2
In 20 校園, 21 碩班課業, 40 專業領域, 41_C 系統管理 on 三月 14, 2007 at 5:10 午後一、DW V.S. DB
Data Warehouse: 可以幫助我們做趨勢分析, 不能做 update, 為 snapshot。
Database: 所有資料的最新狀況。
二、最難做的 ES 系統
因為需求訪談做不出來,或被訪者不想被訪(說不出個所以然)。
三、Capability 就是「企業的流程」
四、能力成熟度模型 (CMM)
- 第一級:初始級
在初始級,企業一般不具備穩定的軟體開發與維護的環境。常常在遇到問題的時候,就放棄原定的計划而只專注於程式化與測試。 - 第二級:可重復級
在這一級,建立了管理軟體項目的政策以及為貫徹執行這些政策而定的措施。基於過往的項目的經驗來計划與管理新的項目。 - 第三級:定義級
在這一級,有關軟體工程與管理工程的一個特定的、面對整個企業的軟體開發與維護的過程的文件將被制訂出來。同時,這些過程是集成到一個協調的整體。這就稱為企業的標準軟體過程。 - 第四級:定量管理級
在這一級,企業對產品與過程建立起定量的質量目標,同時在過程中加入規定得很清楚的連續的度量。作為企業的度量方案, 要對所有項目的重要的過程活動進行生產率和質量的度量。軟體 產品因此具有可預期的高質量。 - 第五級:(不斷)優化級
在這個等級,整個企業將會把重點放在對過程進行不斷的優化。企業會採取主動去找出過程的弱點與長處,以達到預防缺陷 的目標。同時,分析有關過程的有效性的資料,作出對新技術的 成本與收益的分析,以及提出對過程進行修改的建議。
ADBM 0312 #1
In 02 備忘錄, 20 校園, 21 碩班課業, 40 專業領域, 41 資訊技術 on 三月 12, 2007 at 3:44 午後Data Models
- Structure
- Operation
- Constraints <- SA 寫清楚,不然就只有靠程式人員的經驗
Database State: Snapshot 某個時間的狀態
Intention V.S. extension
*下次考式會給你一個小小的Schema來畫。*
- Internal Schema 內部結構
- Conceptual schema 企業組織
- External Schema 使用者與AP
Logical Data Independence and Physical Data Independence, 中間叫 mapping
DDL: Data Definition Language
DML: Data Manipulation Language (SQL)
Multi-Tier Client-Server Architecture.
- Hierarchical Data Model,
- Network Model,
- Relational Model,
- Object Oriented Model, 使用O/R Mapping 機制而使用 Relational Database.
*請看黑體字,謝謝。*
Entity 跟 Attribute 怎麼分,決定你的功力。如果是用來描述別人的,就是Attribute。如果有獨立存在的意義,那就是 Entity。
Entity, Attribute, Relationship 在 ER Model.
兩條線是total participation, 就是全部都會,如果只有一條就不見的是全部。
虛線是不登記,但算的出來。
Weak Entity, 會有一個 own entity, 一個 own relationship.
Recursive Relationship: 一個 supervisor 看很多個 supervises.
Constraints: Cardinality and Existence Dependent.
Notation: 1:1, 1:N, N:1, or M:N.
* Review All E-R Diagrams. *
UML class diagram 與 E-R Model 不同在 UML 有動態的資料。
BDC-02-27 企業資料通訊
In 20 校園, 21 碩班課業, 41 資訊技術 on 二月 27, 2007 at 3:43 午後- 什麼是通訊?
- 什麼是網路?
A network is a transmission system that connects two or more applications running on different computers. - Internet 網際網路
- Client-Server Application
- Internal Corporate Networks / Intranet 網間網路、企業網路、企業內部網路
- Transaction 寫入一筆帳就是一個 Transaction
- 企業用到的資料可以分成四大類:DATA(ASCII, Number)、Audio(Voice)、Image、Visual(Video)。Video 的同時很難做。
- Frame 在線路上傳輸的最小單元
- Data link 來源與目的地可走的路徑
- OSI Network Structure.
- 網路的深度不要超過四層。24^4 因為網路會被分掉…
- Trunk Lines 比 Access Lines 大(不要問我大在那裡,謝謝:P)
- packet switching
- 多功 Multiplexing (笑話:一條高速公路,有車子要上去,有車子要下來…叫多功
)
SAD-02-27 Intro. ITIL
In 20 校園, 21 碩班課業 on 二月 27, 2007 at 10:31 am內容:
- final project 是以 ITIL 為主軸做 SD Final Project
- final test 50%, project 50%
- infrastructure 成本漸低,但管理成本建高因此會需要一套新的方法論。
- 介紹很多 ITIL 管理的內容
SAD final project topic:
- 事件管理
- 問題管理
- 服務台
- Configuration management
- Change management
- Capacity management
課程助教:邱耀漢 94256511@nccu.edu.tw
組員:
- 潘忠緯 94306029@nccu.edu.tw
- 林耀弘 94306027@nccu.edu.tw
- 李維怡 94306036@nccu.edu.tw
- 趙逢毅 95356019@nccu.edu.tw
Topic: 事件管理




