Chrome临时文件夹修改

参数:–user-data-dir=“[PATH]” 解释:将浏览器的数据存放地点设置到指定路径 功能描述:可以将浏览器数据存放地点设置到非系统盘避免重新安装系统后浏览器数据(cookies\书签、历史记录、密码等)丢失。 使用方法:后面的[PATH]为变量,可以更改为你想要指定的路径,如D:\mychrome\,更改并运行之后程序会自动在D盘创建一个mychrome目录,存放浏览器数据。

来源:http://bbs.webmou.com/viewthread.php?tid=4124&highlight=%25B2%25CE%25CA%25FD

about:cache 查Chrome里cache的内容。

已经测试完全OK

FireFox临时文件夹修改

可以通过about:config来更改: Firefox一样,也有一个临时文件夹,默认也是在系统盘中,这样很容易使系统盘产生磁盘碎片。在Firefox的地址栏中输入“about:config”,打开其配置页面,在页面中右击鼠标,选择“新建→字符串”,新建一个名为browser.cache.disk.parent_directory的首选项,并将其值设置成新的存放文件夹. preference name: browser.cache.disk.parent_directory status: user set type: string value: D:\ftemp (注意这里不要有空格FOX哪里好像不支持空格)

来源:http://hi.baidu.com/momoca/blog/item/e5ffa7ef0ba7a216fdfa3c92.html

已经经过测试,完全OK

IETester

IETester is a free WebBrowser that allows you to have the rendering and javascript engines of IE8IE7 IE 6 and IE5.5 on Vista and XP, as well as the installed IE in the same process.

IE Tester

有了它就可以同时测试IE不同版本的JavaScript表现了。不是是我写的太通用吗?没什么感觉。

SQL Server正则表达式函数

这两天有个需求,需要在数据库中判断字符串的格式,于是从网上搜集了一些资料,整理了一下。

下面这个是一个自定义函数,用户可以调用这个函数判断指定的字符串是否符合正则表达式的规则.
CREATE FUNCTION dbo.find_regular_expression
(
@source varchar(5000),   –需要匹配的源字符串
@regexp varchar(1000),  –正则表达式
@ignorecase bit = 0  –是否区分大小写,默认为false
)
RETURNS bit  –返回结果0-false,1-true
AS
BEGIN

–0(成功)或非零数字(失败),是由 OLE 自动化对象返回的 HRESULT 的整数值。
DECLARE @hr integer

–用于保存返回的对象令牌,以便之后对该对象进行操作
DECLARE @objRegExp integer   DECLARE @objMatches integer

–保存结果
DECLARE @results bit

/*
创建 OLE 对象实例,只有 sysadmin 固定服务器角色的成员才能执行 sp_OACreate,并确定机器中有VBScript.RegExp类库
*/
EXEC @hr = sp_OACreate ‘VBScript.RegExp’, @objRegExp OUTPUT
IF @hr <> 0 BEGIN
SET @results = 0
RETURN @results
END
/*
以下三个分别是设置新建对象的三个属性。下面是’VBScript.RegExp’中常用的属性举例:
Dim regEx,Match,Matches         ‘建立变量。
Set regEx = New RegExp         ‘建立一般表达式。
regEx.Pattern= patrn         ‘设置模式。
regEx.IgnoreCase = True         ‘设置是否区分大小写。
regEx.Global=True                             ‘设置全局可用性。
set Matches=regEx.Execute(string)             ‘重复匹配集合
RegExpTest = regEx.Execute(strng)      ‘执行搜索。
for each match in matches                    ‘重复匹配集合
RetStr=RetStr &”Match found at position ”
RetStr=RetStr&Match.FirstIndex&”.Match Value is ‘”
RetStr=RetStr&Match.Value&”‘.”&vbCRLF Next
RegExpTest=RetStr

*/
EXEC @hr = sp_OASetProperty @objRegExp, ‘Pattern’, @regexp
IF @hr <> 0 BEGIN
SET @results = 0
RETURN @results
END
EXEC @hr = sp_OASetProperty @objRegExp, ‘Global’, false
IF @hr <> 0 BEGIN
SET @results = 0
RETURN @results
END
EXEC @hr = sp_OASetProperty @objRegExp, ‘IgnoreCase’, @ignorecase
IF @hr <> 0 BEGIN
SET @results = 0
RETURN @results
END
–调用对象方法
EXEC @hr = sp_OAMethod @objRegExp, ‘Test’, @results OUTPUT, @source
IF @hr <> 0 BEGIN
SET @results = 0
RETURN @results
END
–释放已创建的 OLE 对象
EXEC @hr = sp_OADestroy @objRegExp
IF @hr <> 0 BEGIN
SET @results = 0
RETURN @results
END
RETURN @results
END

下面是一个简单的测试sql语句,可以直接在查询分析器中运行。
DECLARE @intLength AS INTEGER
DECLARE @vchRegularExpression AS VARCHAR(50)
DECLARE @vchSourceString as VARCHAR(50)
DECLARE @vchSourceString2 as VARCHAR(50)
DECLARE @bitHasNoSpecialCharacters as BIT

— 初始化变量
SET @vchSourceString = ‘Test one This is a test!!’
SET @vchSourceString2 = ‘Test two This is a test’

— 我们的正则表达式应该类似于
— [a-zA-Z ]{}
— 如: [a-zA-Z ]{10}  …  一个十字符的字符串

— 获得字符串长度
SET @intLength = LEN(@vchSourceString)

— 设置完整的正则表达式
SET @vchRegularExpression = ‘[a-zA-Z ]{‘ + CAST(@intLength as varchar) + ‘}’

— 是否有任何特殊字符
SET @bitHasNoSpecialCharacters = dbo.find_regular_expression(@vchSourceString, @vchRegularExpression,0)

PRINT @vchSourceString
IF @bitHasNoSpecialCharacters = 1 BEGIN
PRINT ‘No special characters.’
END ELSE BEGIN
PRINT ‘Special characters found.’
END

PRINT ‘**************’

— 获得字符串长度
SET @intLength = LEN(@vchSourceString2)

— 设置完整的正则表达式
SET @vchRegularExpression = ‘[a-zA-Z ]{‘ + CAST(@intLength as varchar) + ‘}’

— 是否有任何特殊字符
SET @bitHasNoSpecialCharacters = dbo.find_regular_expression(@vchSourceString2, @vchRegularExpression,0)

PRINT @vchSourceString2
IF @bitHasNoSpecialCharacters = 1 BEGIN
PRINT ‘No special characters.’
END ELSE BEGIN
PRINT ‘Special characters found.’
END

GO

http://blog.csdn.net/weir55/archive/2008/04/28/2337096.aspx

Nick Brandt

Nick Brandt
UK

Born and raised in London, Nick Brandt studied Film and Painting at St. Martins School of Art.

He started photographing in December 2000 in East Africa, beginning the body of work that is his signature subject matter and style. He no longer directs, devoting himself full time to his fine art photography now.

Brandt’s first book of photographs, “On This Earth”, was published in October 2005, by Chronicle Books, with forewords by Jane Goodall and Alice Sebold (author of “The Lovely Bones”).

He has had numerous one-man exhibitions between 2004 and 2006, including London, Berlin, New York, Los Angeles, Hamburg, Santa Fe, Sydney, Melbourne and San Francisco.

He now lives in Topanga, California….