Showing posts with label Other Tech. Show all posts
Showing posts with label Other Tech. Show all posts

Tuesday, April 7, 2009

Word 大纲级别

设置文档标题的不同级别,使用大纲级别工具。

可以在大纲视图下看到;

也可以在Word Options中选择自定义,选择所有命令然后将其添加到工具栏,方便使用

Thursday, March 19, 2009

End-end Principle in System Design

Since certainly functionality must be implemented on an end-end basis, "functions placed at the lower levels may be redundant of of little value when compared to the cost of providing them at the higher level.

[Saltzer 1984]

Tuesday, March 17, 2009

Using BCDEDIT.EXE to Clean Up Windows Vista Boot Manager

In this blog post, I will describe how to clean up the Windows Vista Boot Manager using the command line tool calledBCDEDIT.EXE located at C:\Windows\System32 assuming Windows Vista is installed on Drive C.

You may have installed another operating system earlier on another drive and you now have formatted this drive. When you boot your computer, you are presented with a choice of what operating system to start with but one of the entries do not work because you have removed the operating system. BCDEDIT.EXE is a command line tool to manage the BCD store (Windows Vista Boot Manager). For a list of complete commands that BCDEDIT.EXE offers, open a Command Window and type bcdedit /?.

NOTE: To enlarge the images, simply click on the images you would like to view. With Internet Explorer 7, you can right-click on the image to select Open in New Tab.

Removing invalid entries in the Windows Vista Boot Manager
    1. Open an elevated Command Window, refer to my blog post "Opening an Elevated Command Prompt" for instructions.
    2. Type:
      bcdedit > c:\users\yourusername\desktop\bcd.txt
      NOTE: A file called "bcd.txt" should now be on the desktop.
    3. Open "bcd.txt" and note the "identifier" value for the invalid boot entries.
    4. Type:
      bcdedit /delete {identifier}
    5. To remove the timeout of the Windows Boot Manager, type:
      bcdedit /timeout 0

Thursday, March 5, 2009

Microsoft Envisioning

 

http://www.officelabs.com/Pages/Envisioning.aspx

Conversion between Utf-8 and GB2312

Some codes about conversion between utf-8 and gb2312 when handling different text format.

// ChineseCodeLib.h: interface for the CChineseCodeLib class.
//
//////////////////////////////////////////////////////////////////////
#include<string>
using namespace std;

/*
功?能?:?汉?字?GB2312与?UTF-8编?码?互?转?
作?者?:?litz
Email:mycro@163.com
参?考?:?吴?康?彬?先?生?的?文?章?《?UTF-8与?GB2312之?间?的?互?换?》?
http://www.vckbase.com/document/viewdoc/?id=1397
*/


#if !defined(__CCHINESECODELIB_H_)
#define __CCHINESECODELIB_H_


class CChineseCodeLib
{
public:
static void UTF_8ToGB2312(string& pOut,char *pText, int pLen);
static void GB2312ToUTF_8(string& pOut,char *pText, int pLen);
// Unicode 转?换?成?UTF-8
static void UnicodeToUTF_8(char* pOut,wchar_t* pText);
// GB2312 转?换?成? ?Unicode
static void Gb2312ToUnicode(wchar_t* pOut,char *gbBuffer);
// 把?Unicode 转?换?成?GB2312
static void UnicodeToGB2312(char* pOut,unsigned short uData);
// 把?UTF-8转?换?成?Unicode
static void UTF_8ToUnicode(wchar_t* pOut,char* pText);

CChineseCodeLib();
virtual ~CChineseCodeLib();
};

#endif // !defined(__CCHINESECODELIB_H_)




///////////////////////////////////////////////////



// ChineseCodeLib.cpp: implementation of the CChineseCodeLib class.
//
//////////////////////////////////////////////////////////////////////

#include <stdio.h>
#include <tchar.h>
#include <windows.h>
#include "ChineseCodeLib.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CChineseCodeLib::CChineseCodeLib()
{

}

CChineseCodeLib::~CChineseCodeLib()
{

}


void CChineseCodeLib::UTF_8ToUnicode(wchar_t* pOut,char *pText)
{
char* uchar = (char *)pOut;

uchar[1] = ((pText[0] & 0x0F) << 4) + ((pText[1] >> 2) & 0x0F);
uchar[0] = ((pText[1] & 0x03) << 6) + (pText[2] & 0x3F);

return;
}

void CChineseCodeLib::UnicodeToGB2312(char* pOut,unsigned short uData)
{
WideCharToMultiByte(CP_ACP,NULL,(LPCWSTR)&uData,1,pOut,sizeof(wchar_t),NULL,NULL);
return;
}

void CChineseCodeLib::Gb2312ToUnicode(wchar_t* pOut,char *gbBuffer)
{
::MultiByteToWideChar(CP_ACP,MB_PRECOMPOSED,gbBuffer,2,pOut,1);
return;
}

void CChineseCodeLib::UnicodeToUTF_8(char* pOut,wchar_t* pText)
{
// 注?意?wchar_t高?低?字?的?顺?序?,低?字?节?在?前?,?高?字?节?在?后?
char* pchar = (char *)pText;

pOut[0] = (0xE0 | ((pchar[1] & 0xF0) >> 4));
pOut[1] = (0x80 | ((pchar[1] & 0x0F) << 2)) + ((pchar[1] & 0xC0) >> 6);
pOut[2] = (0x80 | (pchar[0] & 0x3F));

return;
}

void CChineseCodeLib::GB2312ToUTF_8(string& pOut,char *pText, int pLen)
{
char buf[4];
char* rst = new char[pLen + (pLen >> 2) + 2];

memset(buf,0,4);
memset(rst,0,pLen + (pLen >> 2) + 2);

int i = 0;
int j = 0;
while(i < pLen)
{
//如?果?是?英?文?直?接?复?制?就?可?以?
if( *(pText + i) >= 0)
{
rst[j++] = pText[i++];
}
else
{
wchar_t pbuffer;
Gb2312ToUnicode(&pbuffer,pText+i);

UnicodeToUTF_8(buf,&pbuffer);

unsigned short int tmp = 0;
tmp = rst[j] = buf[0];
tmp = rst[j+1] = buf[1];
tmp = rst[j+2] = buf[2];


j += 3;
i += 2;
}
}
rst[j] = '\0';

//返?回?结?果?
pOut = rst;
delete []rst;

return;
}

void CChineseCodeLib::UTF_8ToGB2312(string &pOut, char *pText, int pLen)
{
char * newBuf = new char[pLen];
char Ctemp[4];
memset(Ctemp,0,4);

int i =0;
int j = 0;

while(i < pLen)
{
if(pText[i] > 0)
{
newBuf[j++] = pText[i++];
}
else
{
wchar_t Wtemp;
UTF_8ToUnicode(&Wtemp,pText + i);

UnicodeToGB2312(Ctemp,Wtemp);

newBuf[j] = Ctemp[0];
newBuf[j + 1] = Ctemp[1];

i += 3;
j += 2;
}
}
newBuf[j] = '\0';

pOut = newBuf;
delete []newBuf;

return;
}


///////////////////////////////////////////////////



//A test main program:



//Input utf.txt in the same folder with the source files.



//Output resutl.txt



// Decode1.cpp : Defines the entry point for the console application.


#include "ChineseCodeLib.h"

#include <iostream>
#include <fstream>
#include <string>
using namespace std;

#define LEN 100000

char str[LEN];
string res;


int main(int argc, char* argv[])
{
ifstream fin("utf.txt");
ofstream fout("result.txt");

while(!fin.eof())
{
fin.getline(str,LEN);
if(strlen(str)<10)
continue;
CChineseCodeLib::UTF_8ToGB2312(res,str,strlen(str));
//cout<<res<<endl;
fout<<res;
}

fin.close();
fout.close();

return 0;
}




From: http://blog.csdn.net/Mycro/archive/2005/12/06/544637.aspx

Tuesday, February 10, 2009

Photography tips

根据人物的感觉和性别区分使用曝光补

曝光补偿的基本原理已经在上述内容中进行了说明,在拍摄人物时如果皮肤反射率较高,有可能也需要进行曝光补偿。这时应根据皮肤色调选择补偿方向。通常情况下,女性的皮肤即使未经化妆也比较白皙。因此采用相机自动模式进行拍摄有可能会偏黑。这样一来,拍摄对象可就会大为不满了。这时候可以进行正方向补偿,使皮肤变得明亮,才会讨人喜欢。而且曝光补偿可使脸上的斑点和皱纹也变得不那么显眼了,效果非常突出。相反,以男性为拍摄对象时,可以稍微进行负方向补偿,这样可以使人显得更加坚毅。曝光补偿并不只是选择正确的数值,也是对亮度进行调节,从而获得良好的整体图像效果的手段。因此这是一种优先考虑拍摄者自身所希望呈现出的图像效果的技巧。

对黑色被摄体向负方向进行曝光补

对白色被摄体向正方向进行曝光补

提高ISO感光度时图像质量会降低

昏暗部分的噪点比明亮部分的更加明显

如图所示,ISO感光度与画质之间有着密切的联系。提高ISO感光度时产生噪点的原因之一是在对影像信号进行增幅时混入了电子噪点。如果希望保持尽可能高的画质,应该使用低ISO感光度。但低感光度拍摄昏暗的室内或夜景,快门速度会非常低,所以需要注意很容易产生手抖动和被摄体抖动。此外,噪点本身有在昏暗部分比明亮部分更显眼的倾向。所以在室外明亮处拍摄照片时候将感光度提升到ISO 400 噪点不会太醒目。越提高ISO感光度快门速度就越高,可以有效防止手抖动和被摄体抖动。但在使用高感光度的时候,要注意画质劣化的问题。

根据直方图数据读取所需的必要信息

像前面所说过的一样,直方图是对整体亮度进行统计学显示,即使其分布状态均匀也不能绝对地说曝光就一定正确、合适。拍摄白色沙滩上的白色冲浪板时,即使直方图极端偏右也没有什么好奇怪的。相反,如果光凭直方图来判断夜景时的曝光,波峰会向左方偏移得十分厉害,感觉整个图像都是暗部缺失才对。这时最重要的是明确要从直方图中读取什么内容,只要能确认是否有暗部缺失或高光溢出等必要信息,就不必对图形整体分布趋势过于敏感。直方图作为用于确认无法预测的高光溢出或暗部缺失的手段使用也不错。

人物与背景保持一定距离比较有

利用远摄端的特性减少背景

最理想的是同时使用与背景的距离+远摄端

利用距镜头越近看上去越大的特性

广角端是显得人腿最长的焦距

以人物为优先来考虑拍摄位置

大人降低到儿童视线高度位

如果想拍摄全身可以另行拍摄

仔细安排人物以突出主角

晴天人物摄影:逆光+反光板

夜景拍摄:

最好的拍摄时间是在完全天黑

白平衡用目测决定

曝光补偿用负的使之更暗

防止抖动同时减少映射,灵活使用自拍功

拍摄首饰时,也要使用能让画质更漂亮的ISO 80左右的低感光度。此外拍摄光源使用能自由改变角度的台灯虽然方便,但很多时候明亮度并不理想。而荧光灯的光线与数码相机自动白平衡的相性比较好,是推荐使用的道具。不过这样快门速度会变慢,需要防止手抖动,为此准备了可以在桌上使用的迷你三脚架。拍摄使用微距模式,对焦于希望展示的部分,靠近拍摄特写。这次的被摄体比较小,因此使用了能够拍出更大画面的广角端,然后仔细对焦后拍摄即可。然而如之前所料,快门速度相当慢,即使使用了三脚架也还是不太放心。于是使用了自拍功能,注意不给相机带来冲击。此外在拍摄首饰类有光泽的反光物体时,可能操作相机的拍摄者会映到被摄体上。因此通过使用自拍功能,拍摄者可离开相机拍摄,十分方便。

以色彩为表现中心的被摄体不适合黑白拍

黑白照片的玩法虽说是自由的,但由于不包含色彩信息,确实存在被摄体合不合适的问题。旅游的回忆,以及家庭照片等以记录为主要目的的拍摄,可以说不太适合黑白。但也有许多被摄体都可以用黑白来表现,例如稍微具有怀旧氛围的旧街,还有人像等。黑白是用黑与白的浓淡来表现色彩,所以花朵等以色彩为表现核心的东西不适合黑白。拍摄时要考虑被摄体的色彩与表现的平衡。

Sunday, February 1, 2009

Using Webzip to retrieve web pages

Environment settings for retrieving the web pages:

1. Copy all the page list to the circled area:

clip_image002

2. Only select the htm file type:

clip_image004

3. For the followed links, set as the following figure shows and keep others default:

clip_image006

4. Add filters to the project:

clip_image008

In the red circle 1, type in the filter string http://paper.people.com.cn/rmrb/html/ and click the “Add” button. The added filter will be listed in the red circle 2.

5. Keep all the other options default. Next, click the button “Run Now!” and wait for your pages.

Google+