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