The mindmap of project charter Thursday, December 29, 2011


Project charter is one of the important concepts in PMBOK. It authorizes a project and documents initial requirements from stakeholders. If signed off, the project is initiated.

There's a mindmap of project charter created by leadershipchamps. Due to permission, there just provides the link

http://leadershipchamps.files.wordpress.com/2009/11/projec-charter.jpg

And in this mindmap, provides a template of project charter

on-line Rita 6th Edition & 5th Edition Wednesday, December 28, 2011

1> link of 6th edition: http://www.scribd.com/doc/39409875/Rita-6th-Edition
2> 5th edition: http://www.scribd.com/doc/36918639/C-Rita-5th-Edition

Upgrade JDK for ICS compiling Tuesday, December 20, 2011

Follow the bellowing steps to upgrade the correct JDK for ICS building


sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jdk

run Python script in Android.mk on Android building system Friday, September 23, 2011

Insert the bellowing line into Android.mk

$(shell python $(LOCAL_PATH)/scripts/myprepare.py)

When running mm command or other command to build your apk, the script myprepare.py will be invoked.

You can copy some files or do any thing python can do. But notice: don't add any print function in your python script.

[Refer] Empty parameter lists Thursday, September 15, 2011

C distinguishes between a function declared with an empty parameter list and a function declared with a parameter list consisting of only void. The former is an unprototyped function taking an unspecified number of arguments, while the latter is a prototyped function taking no arguments.

    // C code

    extern int  foo();          // Unspecified parameters
    extern int  bar(void);      // No parameters

    void baz()
    {
        foo(0);         // Valid C, invalid C++
        foo(1, 2);      // Valid C, invalid C++

        bar();          // Okay in both C and C++
        bar(1);         // Error in both C and C++
    } 
C++, on the other hand, makes no distinction between the two declarations and considers them both to mean a function taking no arguments.
    // C++ code

    extern int  xyz();

    extern int  xyz(void);  // Same as 'xyz()' in C++,
                            // Different and invalid in C 
For code that is intended to be compiled as either C or C++, the best solution to this problem is to always declare functions taking no parameters with an explicit void prototype. For example:
    // Compiles as both C and C++
    int bosho(void)
    {
        ...
    } 
Empty function prototypes are a deprecated feature in C99 (as they were in C89).

Refer to http://david.tribble.com/text/cdiffs.htm

do {} while (0) Friday, September 9, 2011

http://c2.com/cgi/wiki?TrivialDoWhileLoop

A demo using mmap to read a file Thursday, September 8, 2011

#include
  #include
  #include
  #include
  #include
  #include

  int main (int argc, char *argv[])
  {
          struct stat sb;
          off_t len;
          char *p;
          int fd;

          if (argc < 2) {
                  fprintf (stderr, "usage: %s \n", argv[0]);
                  return 1;
          }

          fd = open (argv[1], O_RDONLY);
          if (fd == -1) {
                  perror ("open");
                  return 1;
          }

          if (fstat (fd, &sb) == -1) {
                  perror ("fstat");
                  return 1;
          }

          if (!S_ISREG (sb.st_mode)) {
                  fprintf (stderr, "%s is not a file\n", argv[1]);
                  return 1;
          }

          p = mmap (0, sb.st_size, PROT_READ, MAP_SHARED, fd, 0);
          if (p == MAP_FAILED) {
                  perror ("mmap");
                  return 1;
          }

          if (close (fd) == -1) {
                  perror ("close");
                  return 1;
          }

          for (len = 0; len < sb.st_size; len++)
                  putchar (p[len]);

          if (munmap (p, sb.st_size) == -1) {
                  perror ("munmap");
                  return 1;
          }

          return 0;
  }

create_singlethread_workqueue

struct workqueue_struct *create_singlethread_workqueue(const char *name);

Creates a workqueue. Each workqueue has one dedicated processes ("kernel threads"), which run functions submitted to the queue.

Timeline of Linux Kernel Thursday, August 11, 2011


Project charter 翻译自rita

项目章程包含什么

许多公司要求项目章程包含诸如详细的日程安排表、完整的风险分析等等,但这类信息在项目管理的启动阶段是无法获得的。项目章程不是项目管理计划。

项目名称和描述(这个项目是什么)

客户满意度修复项目
在过去的几个月里面,质量管理部门发现,很多客户在我们的计算机网络上订购XYZ设备花费的时间要比用竞争对手的多十倍。这个项目的目的就是调查原因并且提出一个解决方案。这个解决方法将会作为后续的项目。质量控制部门能提供详细的记录,可以帮助当前项目。

项目经理任命以及授权水平(谁被授权领导这个项目,他/她是否有权利决定、管理和批准对于预算、日程、项目组成员组成等问题的变更?)

比如,Alexis Sherman是项目经理,有权利挑选项目组成员,决定项目的最终预算。

业务需要或者业务驱动力(为什么考虑在某个时候要做这个项目?)

这个项目的目的是避免客户满意度的下滑趋势。

项目的合理性(业务分析,基于财务或者其他基础,解释这个项目的合理性)

我们期待改善的客户满意度会在第一年为公司增加至少200,000美元的收入,由于减少服务电话的数目。附带的效益是,我们期待这个项目在修复问题的同时能够得到持续改善客户满意度的方法。

资源预备 (能提供什么资源以及多少?)

Morgan Kolb和Danny Levins全部时间投入这个项目,因为他们熟悉这类计算机网络。其他资源将由项目经理决定。

项目干系人(当前已知的,谁会影响、或者被影响?)

项目干系人包括:Connor,来自质量控制;Ruth,客户服务;Mary,市场。这些资源有助于项目经理管理项目。

项目干系人的需求(项目和产品范围相关的需求)

项目章程的附件包含现有系统的详细说明以及现有系统能满足的需求。当前项目不会改变现有的需求。
项目必须利用质量控制部的数据。

产品描述/交付物(具体的交付物是什么以及项目的结果是什么?)

  • 一份报告。
报告概述:什么能被改变、每个改变的成本以及每个改变会在客户下订单方面能节省多少时间。
  • 一份必须完成的改变的清单。
一个WBS大体列出两个星期期限内完成项目的计划,以及一个星期后影响项目完成的风险清单。

约束和假设

在9月1日前完成项目。预算¥5000以内。我们认为Kerry会全程辅助这个项目。测试是在供应商的计算机上完成。
约束就是固有的限制条件,比如只有5个人可用等;但是假设意味着不确定,可能正确也可能不正确。

项目章程对项目经理有什么用

不要低估项目章程的作用。项目章程是非常重要的文档,没有它就不能开始项目。项目章程就是项目目标、度量成功的定义,那么没有项目章程,项目和项目经理就不能成功。
项目章程至少有下面这些益处:
  • 正式认可(批准)项目的存在或者建立项目。
这意味着一个项目不能没有项目章程。没有项目章程,项目就不存在。
  • 给项目经理授权花钱和使用公司的资源。
  • 定义项目的粗略需求。(因此,当项目后续进行发生较小变更的时候,项目章程不一定改变。但反过来,当发生影响项目章程的变化的时候,就会面对项目是否还要继续的问题了。)
  • 把项目和组织正在进行的工作联系起来。
项目章程
  • 是发起人发起,而不是项目经理发起
  • 在启动过程组创建
足够广发以至于不需要项目变化而改变。
任何对项目章程的改变都需要考虑项目是不是继续进行。

most-used and must-known shortkey for terminal on ubuntu Wednesday, March 30, 2011

Ubuntu shortkey in terminal

ctrl+a or Home

Moves the cursor to the start of a line.

ctrl+e or End
Moves the cursor to the end of a line.

ctrl+b
Moves to the beginning of the previous or current word.

ctrl+k
Deletes from the current cursor position to the end of the line.

ctrl+u
Deletes the whole of the current line.

ctrl+w
Deletes the word before the cursor.

Issue when using identi.ca API Tuesday, March 22, 2011

When I used identi.ca API, "https://identi.ca/api/statuses/update.format", by Python2.6, an error returns from identi.ca server:

You must validate your email address before posting.

It's because I does not confirm the email from identi.ca after registered.

overview of android log system Wednesday, March 9, 2011

The bellowing diagram is from Tetsuyuki Kobabayshi.

It clearly illustrates the mechnisam of logging system and relationship among every attendee. Most of source code are rasided in system/core

Note: system buffer just occurs on Android 2.3.x or later.


The set of DLNA-certified Mobile devices Friday, February 11, 2011

DISCARDED because DLNA home site provides this feature.

I'll collect the DLNA-certified mobile devices here. And update this post gradually.
SonyEricsson Xperia arc

 refer from http://gigazine.net/news/20110106_xperia_arc/

Motorola Oprah
Refer from: http://technologizer.com/2010/09/13/android-motorola-defy-tmobile/













panasonic LUMIX

Refer from http://headlines.yahoo.co.jp/hl?a=20101001-00000083-zdn_m-mobi

You can tweet via voice without internet connection Tuesday, February 1, 2011

1> Send a voicemail to one of these international phone numbers (+16504194196 or +390662207294 or +97316199855)
2> The messages can be listened by dialing the same phone numbers or going to twitter.com/speak2tweet.

Create the assembly listing of cpp file on Symbian Thursday, January 20, 2011

  1. go ot group folder where bld.inf file is stored.for example, cd \uiqsrc\qapps\sharedui\qcontactssharedui\group
  2. > abld reallyclean
  3. > abld makefile armv5 
  4. > abld listing armv5 urel QContacUI ContactsListBoxModel
    • The final two arguments are the MMP and CPP names for the function you want to look at
    • The final output is: Created [...]\contactslistboxmodel.ARMV5.lst. And the .lst file is one we're interested in

examples of pack function in Perl Monday, January 17, 2011

$foo = pack("WWWW",65,66,67,68);
# foo eq "ABCD"
$foo = pack("W4",65,66,67,68);
# same thing
$foo = pack("W4",0x24b6,0x24b7,0x24b8,0x24b9);
# same thing with Unicode circled letters.
$foo = pack("U4",0x24b6,0x24b7,0x24b8,0x24b9);
# same thing with Unicode circled letters. You don't get the UTF-8
# bytes because the U at the start of the format caused a switch to
# U0-mode, so the UTF-8 bytes get joined into characters
$foo = pack("C0U4",0x24b6,0x24b7,0x24b8,0x24b9);
# foo eq "\xe2\x92\xb6\xe2\x92\xb7\xe2\x92\xb8\xe2\x92\xb9"
# This is the UTF-8 encoding of the string in the previous example

$foo = pack("ccxxcc",65,66,67,68);
# foo eq "AB\0\0CD"

# NOTE: The examples above featuring "W" and "c" are true
# only on ASCII and ASCII-derived systems such as ISO Latin 1
# and UTF-8. On EBCDIC systems, the first example would be
# $foo = pack("WWWW",193,194,195,196);

$foo = pack("s2",1,2);
# "\1\0\2\0" on little-endian
# "\0\1\0\2" on big-endian

$foo = pack("a4","abcd","x","y","z");
# "abcd"

$foo = pack("aaaa","abcd","x","y","z");
# "axyz"

$foo = pack("a14","abcdefg");
# "abcdefg\0\0\0\0\0\0\0"

$foo = pack("i9pl", gmtime);
# a real struct tm (on my system anyway)

$utmp_template = "Z8 Z8 Z16 L";
$utmp = pack($utmp_template, @utmp1);
# a struct utmp (BSDish)

@utmp2 = unpack($utmp_template, $utmp);
# "@utmp1" eq "@utmp2"

sub bintodec {
unpack("N", pack("B32", substr("0" x 32 . shift, -32)));
}

$foo = pack('sx2l', 12, 34);
# short 12, two zero bytes padding, long 34
$bar = pack('s@4l', 12, 34);
# short 12, zero fill to position 4, long 34
# $foo eq $bar
$baz = pack('s.l', 12, 4, 34);
# short 12, zero fill to position 4, long 34

$foo = pack('nN', 42, 4711);
# pack big-endian 16- and 32-bit unsigned integers
$foo = pack('S>L>', 42, 4711);
# exactly the same
$foo = pack('s<', -42, 4711);
# pack little-endian 16- and 32-bit signed integers
$foo = pack('(sl)<', -42, 4711);
# exactly the same



ref to http://perldoc.perl.org/functions/pack.html

Exchangeable image file format(exif) Friday, January 14, 2011

Exif (Exchangeable image file format) 是可交换图像文件的缩写,由日本电子工业发展协会(JEIDA - Japan Electronic Industry Development Association)创建。专门为数码相机的照片设定的,可以记录数字照片的属性信息和拍摄数据。
Exif 可以附加于 JPEG、TIFF、RIFF 等文件之中,为其增加有关数码相机拍摄信息的内容和索引图或图像处理软件的版本信息。(例如:在JPEG文件中,Exif信息通常在JPEG格式的APP1段加入。)

版本

Exif 最初由日本电子工业发展协会在 1996 年制定,版本为 1.0。1998 年,升级到 2.1,增加了对音频文件的支持。2002 年 3 月,发表了 2.2 版。

标准

  1. EXIF.org
  2. EXIF 2.1 官方标准(PDF文档)
  3. EXIF 2.2 官方标准(PDF文档)
  4. EXIF 文件格式说明


工具

  1. EXIF 免费软件:PhotoMe
  2. exiftool强大的工具

常用字段

Artist   有些相机可以输入使用者的名字   
ColorSpace 色域、色彩空间  
ComponentsConfiguration 图像构造(多指色彩组合方案)  
CompressedBitsPerPixel( BPP) 压缩时每像素色彩位 指压缩程度
Compression 压缩比  
DateTime 日期和时间  
DateTimeDigitized 数字化时间  
DateTimeOriginal 创建时间  
ExifImageLength 图像高度 指纵向像素数 (Pixel Y Dimension)
ExifImageWidth 图像宽度 指横向像素数 (Pixel X Dimension)
ExifOffset Exif信息位置 定义Exif在信息在文件中的写入,有些软件不显示
ExifVersion Exif版本  
ExposureBiasValue 曝光补偿  
ExposureProgram 曝光程序 指程序式自动曝光的设置,各相机不同,可能是Sutter Priority(快门优先)、Aperture Priority(快门优先)等等。
ExposureTime 曝光时间 即快门速度
FileSource 源文件  
Flash 是否使用闪光灯  
FlashPixVersion FlashPix版本 (个别机型支持)  
FNumber 光圈系数  
FocalLength 焦距 一般显示镜头物理焦距,有些软件可以定义一个系数,从而显示相当于35mm相机的焦距
Image Description 图像描述、来源 指生成图像的工具
Interoperability IFD 通用性扩展项定义指针 和TIFF文件相关 具体含义不详
ISO speed ratings 感光度  
Lightsource 光源 指白平衡设置
Make 生产者 指产品生产厂家
MakerNote(User Comment) 作者标记、说明、记录  
MaxApertureValue 最大光圈  
MeteringMode 测光方式 平均式测光、中央重点测光、点测光等。
Model 型号 指设备型号
Orientation 方向 有的相机支持,有的不支持
ResolutionUnit 分辨率单位 一般为PPI
Software 软件 显示固件 Firmware版本
Xresolution X方向分辨率  
Yresolution Y方向分辨率  
YCbCrPositioning 色相定位

Read Exif via Python

Installtion

  1. download library
  2. extract it
  3. copy exif.py to Lib folder
  4. Some API demo source code can been found in comments sectio in exif.py

Demo

import EXIF
# extract thumbnail in Exif and save it
f = open("c:\\p2.jpg",'rb')
tags = EXIF.process_file(f)
# save the thumbnail into a jpg format file
f = open("c:\\a.jpg",'wb')
f.write(tags["JPEGThumbnail"])
f.close()

Unix && Linux Distribution Timeline Wednesday, January 12, 2011