顯示具有 calculate 標籤的文章。 顯示所有文章
顯示具有 calculate 標籤的文章。 顯示所有文章

2019年1月29日 星期二

使用 Google Sheets 與 Google Script 進行簡易的人力管理

專案貢獻計算01

應該稱得上是第二份工作,老闆是一位三進三出工研院的強者,他主張所有都公開透明,採用美式(G社)的管理風格,讓各類 Project 都灑出去,決定好 Project Owner 後,各個 Project Owner 再去找成員進去。

每個 Project 重要程度不一,若成員想要達到好考績,不見得要參加各種專案,但是只參加一個專案肯定分數上又不是不夠的,而各類 Project 都參加又不貢獻,那分數依舊不佳。

這其實是一個有效管理極度壓榨人力的機制!但是好是壞,就看實際應用情況了,像是我也被老闆提醒一個觀念:資深工程師,本身就會身負重要職責,那本身就是對應著他價碼的任務的,若強用這種架構,那不就資淺的永遠難以翻身?

先無論其實用性,在這樣的概念上,試試看純靠 Google Sheets 製作,列個專案列表且每個專案依照其重要程度或開發時間列個重要分數,每個專案在列出成員貢獻度,最後再來個 Google Script 把各個成員的分數算一下,收工!

專案貢獻計算02

而 Google script 就只是輸入 工作表名稱 和 成員名稱,接著就會把他們計算出來,程式碼如下:

專案貢獻計算03

有需要可以參考:github.com/changyy/blog.changyy.org/blob/master/note/calc-member-contribution.gs

2014年7月6日 星期日

iOS 開發筆記 - 計算一個字的寬度

程式碼:     NSString *words = @"Hello World! 您好!";
    for( int i=0 ; i<[words length] ; ++i ) {
        unichar word = [words characterAtIndex:i];
        CGSize wordSize = [[NSString stringWithFormat:@"%C", word] sizeWithAttributes:nil];
        NSLog(@"Char: %C, Font Width: %f", word, wordSize.width);
    }


Char: H, Font Width: 8.666016
Char: e, Font Width: 6.673828
Char: l, Font Width: 2.666016
Char: l, Font Width: 2.666016
Char: o, Font Width: 6.673828
Char:  , Font Width: 3.333984
Char: W, Font Width: 11.326172
Char: o, Font Width: 6.673828
Char: r, Font Width: 3.996094
Char: l, Font Width: 2.666016
Char: d, Font Width: 6.673828
Char: !, Font Width: 3.333984
Char:  , Font Width: 3.333984
Char: 您, Font Width: 12.000000
Char: 好, Font Width: 12.000000
Char: !, Font Width: 12.000000


若要指定 font ,可以透過設定 Attributes:

@{
    NSFontAttributeName: [UIFont fontWithName:@"Courier" size:16]
}


指定 Courier 字型: Char: H, Font Width: 9.601562
Char: e, Font Width: 9.601562
Char: l, Font Width: 9.601562
Char: l, Font Width: 9.601562
Char: o, Font Width: 9.601562
Char: , Font Width: 9.601562
Char: W, Font Width: 9.601562
Char: o, Font Width: 9.601562
Char: r, Font Width: 9.601562
Char: l, Font Width: 9.601562
Char: d, Font Width: 9.601562
Char: !, Font Width: 9.601562
Char: , Font Width: 9.601562
Char: 您, Font Width: 16.000000
Char: 好, Font Width: 16.000000
Char: !, Font Width: 16.000000