Monday, March 28, 2011

The chinese fonts for Adobe reader 9.x in Ubuntu

The recently version Adobe reader 9.4 need additional fonts package to support chinese display.
You can download the fonts from :

ftp://ftp.adobe.com/pub/adobe/reader/unix/9.x/9.1/misc/

where the File:FontPack910_chs_i486-linux.tar.bz2 is chinese simple version.
The files can be extracted by command "tar -xvf FontPack910_chs_i486-linux.tar.bz2 " in the command terminal.
Finally run the "sudo ./INSTALL".
Everything will be fine.

Tuesday, March 22, 2011

Export the Bibliography as You Like Using Jabref

This document introduce how to export the bibliography in a .RTF or .HTML format using the Jabref.
1. Download and install Jabref from website “http://jabref.sourceforge.net/index.php”.

2. Open the database. “File”->”Open database” and choose the right file.

3. Customize entry types. Add the sentence “ Acknowledgement: acknowledgement; bccn; status” to “options”->”Set up general fields”.

4. Use the export template. The templates for RTF or HTML can be downloaded from website “ http://jabref.sourceforge.net/resources.php”. They need be further changed to get what we want, e.g., including acknowledgements. Click “Options”->”Management custom exports ” -> “add new” and choose the right template file, e.g., “edward_elgar.layout”, then give it a name, e.g. “edward” and specify the format, e.g., “.rtf”.

5. Export settings. If you want to index the output file first by entry type and second by the year, you can first click the “Entry type” with control key “Ctrl”, then click the “Year”.  Now you have to make sure the export setting is right: click the “Options”->”Preference”->”file”->”sort order” and choose “Export in current table sort order”.

6. Do export. Click “File”->”Export” and choose the right format, e.g., “edward (*.rtf)”.

Tuesday, March 15, 2011

Integral Histogram for fast Calculation of HOG Features

The original article can be found in

http://smsoftdev-solutions.blogspot.com/2009/08/integral-histogram-for-fast-calculation.html?showComment=1300196607644#c294288376459522527

However, there are some problems when you are going to use it:
First, the input image should be a BGR color image.
Second, the variable "xsobel" and "ysobel" must be "IPL_DEPTH_32F".
Third, the author does not write out the function "doSobel".


To avoid these problems,
you can change a little bit of original codes:

IplImage* img_gray = cvCreateImage(cvGetSize(in), IPL_DEPTH_8U,1);
if(in->nChannels>1){
cvCvtColor(in, img_gray, CV_BGR2GRAY);
}
else
{
cvCopy(in,img_gray);
}
cvEqualizeHist(img_gray,img_gray);
/* Calculate the derivates of the grayscale image in the x and y
directions using a sobel operator and obtain 2 gradient images for the
x and y directions*/
IplImage *xsobel = cvCreateImage(cvGetSize(in), IPL_DEPTH_16S, 1);
IplImage *ysobel = cvCreateImage(cvGetSize(in), IPL_DEPTH_16S, 1);

cvSobel(img_gray,xsobel,1, 0, 3);
cvSobel(img_gray,ysobel, 0, 1, 3);

cvReleaseImage(&img_gray);
/* Create an array of 9 images (9 because I assume bin size 20
degrees and unsigned gradient ( 180/20 = 9), one for each bin which
will have zeroes for all pixels, except for the pixels in the original
image for which the gradient values correspond to the particular bin.
These will be referred to as bin images. These bin images will be
then used to calculate the integral histogram, which will quicken the
calculation of HOG descriptors */
IplImage** bins = (IplImage**) malloc(9 * sizeof(IplImage*));
for (int i = 0; i < 9 ; i++) {
bins[i] = cvCreateImage(cvGetSize(in), IPL_DEPTH_32F,1);
cvSetZero(bins[i]);
}
/* Create an array of 9 images ( note the dimensions of the image, the
cvIntegral() function requires the size to be that), to store the integral
images calculated from the above bin images. These 9 integral
images together constitute the integral histogram */
IplImage** integrals = (IplImage**) malloc(9 * sizeof(IplImage*)); for (int i =
0; i < 9 ; i++) {
integrals[i] = cvCreateImage(cvSize(in->width + 1, in->height + 1),
IPL_DEPTH_64F,1);
}
/* Calculate the bin images. The magnitude and orientation of the
gradient at each pixel is calculated using the xsobel and ysobel
images.{Magnitude = sqrt(sq(xsobel) + sq(ysobel) ), gradient = itan
(ysobel/xsobel) }. Then according to the orientation of the gradient,
the value of the corresponding pixel in the corresponding image is set
*/
int x, y;
float temp_gradient, temp_magnitude;
for (y = 0; y height; y++) {
/* ptr1 and ptr2 point to beginning of the current row in the xsobel
and ysobel images respectively. ptrs[i] point to the beginning of the
current rows in the bin images */
short* ptr1 = (short*) (xsobel->imageData + y * (xsobel->widthStep));
short* ptr2 = (short*) (ysobel->imageData + y * (ysobel->widthStep));
float** ptrs = (float**) malloc(9 * sizeof(float*));
for (int i = 0; i < 9 ;i++){
ptrs[i] = (float*) (bins[i]->imageData + y * (bins[i]->widthStep));
}
/*For every pixel in a row gradient orientation and magnitude are
calculated and corresponding values set for the bin images. */
for (x = 0; x width; x++) {
/* if the xsobel derivative is zero for a pixel, a small value is added
to it, to avoid division by zero. atan returns values in radians, which
on being converted to degrees, correspond to values between -
90 and 90 degrees. 90 is added to each orientation, to shift the
orientation values range from {-90-90} to {0-180}. This is just a matter
of convention. {-90-90} values can also be used for the calculation. */
if (ptr1[x] == 0){
temp_gradient = ((atan(ptr2[x] / (ptr1[x] + 0.00001))) * (180/ PI)) + 90;
}
else{
temp_gradient = ((atan(ptr2[x] / ptr1[x])) * (180 / PI)) + 90;
}
temp_magnitude = sqrt((ptr1[x] * ptr1[x]) + (ptr2[x] * ptr2[x]));

/*The bin image is selected according to the gradient values. The
corresponding pixel value is made equal to the gradient magnitude at
that pixel in the corresponding bin image */
if (temp_gradient <= 20) {
ptrs[0][x] = temp_magnitude;
}
else if (temp_gradient <= 40) {
ptrs[1][x] = temp_magnitude;
}
else if (temp_gradient <= 60) {
ptrs[2][x] = temp_magnitude;
}
else if (temp_gradient <= 80) {
ptrs[3][x] = temp_magnitude;
}
else if (temp_gradient <= 100) {
ptrs[4][x] = temp_magnitude;
}
else if (temp_gradient <= 120) {
ptrs[5][x] = temp_magnitude;
}
else if (temp_gradient <= 140) {
ptrs[6][x] = temp_magnitude;
}
else if (temp_gradient <= 160) {
ptrs[7][x] = temp_magnitude;
}
else {
ptrs[8][x] = temp_magnitude;
}
}
}
cvReleaseImage(&xsobel);
cvReleaseImage(&ysobel);
/*Integral images for each of the bin images are calculated*/
for (int i = 0; i <9 ; i++){
cvIntegral(bins[i], integrals[i]);
}
for (int i = 0; i <9 ; i++){
cvReleaseImage(&bins[i]);
}
/*The function returns an array of 9 images which consitute the
integral histogram*/
return (integrals);
}

Wednesday, March 9, 2011

户口迁移证,派遣证,报到证-关注中国大学生!

刚刚下午写的一篇非常精彩的文章:关注大学生就业:派遣报到证 有效期及作用! 当前文章的内容虽然有些已经过时,因为不符合现代社会,但还是值得我们参考。 因为现在大学生毕业后,学校方已不占主动权,掌握权已经在单位。所以人家单位接收你,你的派遣证等才有用,否则都是白搭。 下边的内容我们多少也看看:

关于户口和派遣的一些问题:07 年7月毕业的同学,户口可以保留在学校2年不打回学校。这个也是你需要办一定手续,如果你毕业了户口没解决,一走了之,就麻烦了,学校或者通过机要系统转回你家乡所在地级市的人事局或劳动局。转到人事局和劳动局也不一样,在人事局是干部,在劳动局是工人,这两个身份不同。大学毕业生都是干部,但是你找的工作没有解决户口,学校把户
口派遣回老家,也有派遣证,有这个证就可以把你户口重新落到你老家所在的地级市。如果你07年7月毕业了,假设在北京找了一个单位,没有户口,那么你可以有如下选择:

1. 申请户口保留在学校2年。7月毕业的学生,留京的最后期限市07年12月底,注意不是2 年,就是说在7-12月你找到一个北京的单位能够解决你的户口,学校仍然可以派遣。而不是2年,在7月之后2年内你可以申请把户口保留在学校,北京之外的城市有单位在这2年内可以给你解决户口,学校仍然可以派遣,注意除了北京,北京是半年,到07年12月底。

2.不保留在学校,转回家。这样的话也需要你去就业中心,毕分办等单位办手续,开派遣证,学校通过机要系统把你的户口转到你家乡的地级市。如果你有派遣证,那么是转到人事局,你有干部身份,如果你不去办理,学校自己给你转回去,你没有派遣证,转到你家乡地级市的劳动局,你就成工人了,丧失了干部身份。干部和工人的区别,中国的特色,详情可咨询就业中心。转回家后需要你持派遣证落户,一般是落在人事局所属的人才交流中心。你要不去落户,就没有户口。

3.不申请户口保留在学校,自己也不去办理将户口转回家,那你就麻烦了。有些同学不明白其中的规定,毕业了,找了工作,没有解决户口,自己户口也不管,离开学校一走了之,这样的话不仅你的户口,学校会直接转走,你还没有派遣证,没有干部身份。你自己不去将户口转回家,不回家报到落户,那你就没有户口,你的档案中间也会出现空白,不连贯。
特别要强调一下:派遣证的问题,这个证件很重要很重要,建议大家一定要重视。

还有:1.如果你找了个北京的单位,给你解决户口了,那就最容易不过了,三方各方面都搞定了,学校给发派遣证,毕业了到单位报道,户口档案都由公司给你处理。

2. 如果找了北京的单位,没有解决户口,你也没有办法解决,可以参照上面几条如何转回家去。如果你找的单位没有解决户口,而你想要北京户口,那么可以考虑买个户口。具体的办法是:找一个有剩余户口名额的单位,它如果想卖户口,可能需要几万块,你和它签约,三方各方面搞定了,学校也给你发派遣证,你的就业方向就等于去了这个卖户口的公司,在学校的统计里。你拿派遣证,到这个公司报道,然后办理户口档案人事代理都让它给你处理。但是实际上你并不去这个卖户口的公司上班,而是去你另外找的,不给你解决户口的单位上班,你在那个公司等于是打工的,户口和档案则在卖户口的公司。这是个解决办法,但是务必务必小心,小心被骗。如果你有熟人或通过关系找熬到有些单位有剩余户口名额,可靠的话就最好了。最后提醒大家一下:毕业生 毕业的时候,是解决户口最容易的时候,如果你的户口一旦转回家去,那想出来就太难了,除非你再考研或者通过单位人才引进,但是人才引进也是很麻烦的。提请大家一定一定注意这个问题,人生大事不可马虎。

第一个问题:在7月份你有如下选择:
一.找到了工作,给你解决户口,签了三方,学校发派遣证,拿派遣证到燕园派出所办理户口迁移证,然后拿派遣证到你所在单位落户,档案学校会通过机要系统转到你的单位。 我校不可以个人自带档案,方老师说过。
二.找到了工作,没有解决户口。这样就无法签订三方,你有如下选择:

1. 向学校申请将档案和户口保留在学校2年,不转回原籍。在2年期间,如果你找到了北京以外的单位,可以解决户口问题,仍然可以给你派遣,当然已经不是应届生了,但是仍然可以派遣。注意:如果要留京,方老师说,在2007年12月底找到仍然可以派遣,是半年而不是2年,过期就户口就无法留京。

2. 转回原籍,你仍然有派遣证,最低转到你家乡所在的地级市人事局。档案学校会给转回去。注意:这需要你自己毕业时候到毕分办去办理,如果你不去办理,一走了之,档案转回家了,但是你的户口没有办理迁移证,户口资料仍然在北大派出所,但是你已经不是这里的户口了,你又没有派遣证可以回家乡落户,就没有户口了。并且如果没有派遣证,档案转回劳动局而不是人事局,丧失了干部身份。 本文来源:www.ieeye.com
第二个问题:毕业了当然不是应届生,其他参见上面解释。
第三个问题:参见上面解释,2年内找到可以解决户口的单位,仍可签三方。

报到证 派遣证区别?以前叫派遣证,现在叫报到证,一样的,一个意思,这东西很重要的,千万不能丢报到证是你拿着到上面所写的地方报到,一般报到后就要申请落户,就用户口迁移证了,没什么特殊的地方!

如果是毕业多年的毕业生,到现在也没找下工作,那么派遣证什么户口,什么档案,似乎没什么用处?

一、报到证全称是“全国普通高等学校大中专毕业生就业派遣报到证”,这是所有普通全日制大中专院校毕业生毕业时必须要拿到的重要证件之一,如果你没有拿到的话,请回学校的就业工作部门(如学生处、毕分办、就业中心等)领取。领取的时候注意一下,你是师范类毕业生,此报到证应当是由当地教育主管部门签发的(如省教育厅的人事处、毕分办或学生处)。如果你在毕业之前没有签订就业协议,那报到证是到生源所在地教育主管部门(如某市教育局)报到的,备注栏为空白(此证为待就业报到证,你仍属于学生身份)。
二、关于你的户口问题,如果你是本地户口的话,一般在入校前是不必迁到学校的,你回家问问家里人,是不是户口还在家。如果你已经把户口迁到学校了,这你要找学校户政管理部门(如校派出所或保卫处)拿户口迁移证或集体户口单页,再持毕业证、报到证到生源地公安户政机关落户就可以了。
三、关于报到证日期的问题。报到证有两个期限,一是报到期限,如果有包分配的地方教育局,一般会要求你在规定期限内(一般是毕业后一个月)报到,否则今年你有可能错过包分配或参加公开招聘的机会,如果是不包分配教育局,错过期限就无所谓了,象我们这儿,错过期限报到就没有太多影响。二是报到证本身的期限,一般是三年,就是说你要在三年内找到工作单位并办理正式就业报到证,确定国家干部身份,否则错过时间就再也办理不了了。
四、关于转行。国家是不鼓励师范类毕业生转行的,所以请你在转行之前慎重考虑,象我省,规定师范类毕业生转行后就没机会再回到教育行业工作了。如果你要转行也可以,但不知你是否在校时领取过师范专业每月的专业奖学金,如果领取过,请在转行前还清奖学金,否则教育主管部门可能不让你转行。
五、关于档案。如果你属于待就业毕业生,学校会将你的档案转回生源所在地教育主管部门(即报到证上让你报到的地方),如果将来就业或转行,请到该部门办理档案转递手续。

所谓派遣证是过去统分统招时期的叫法,而报到证是实行双向选择以后的叫法,名称虽然不同,起的作用基本相同,都是你大学毕业后办理各种就业手续(如户口迁移,档案落户等)的一纸凭证. 根据现行就业政策,大学毕业生可把档案保留在学校2年,在此期间不影响你在任何地方联系工作,毕业后两年内如果你还没有一个稳定的工作单位,那么根据国家政策,你的档案将由学校寄给生源所在地.

Thursday, March 3, 2011

WPS只域显示

发现我们自主的WPS OFFICE 软件真的强大啊。而且免费。
但也有些不熟悉的地方,今天我只是按了下CTRL+F9,结果就是公式只显示域代码,必须得用SHIFT+F9才可以正常显示公式。比较繁琐。
今天发现解决方法就是在工具-》选项-》视图》里的域代码选项给去掉就行了。SO EASY..
不然每次都是
EMBED Equation.KSEE3