Several days ago, I upgrade firefox from 3.0 to 4.0 for my notebook. But the performance bad, thus degrades the user experience.
Now I hope to find away to go back.
Several days ago, I upgrade firefox from 3.0 to 4.0 for my notebook. But the performance bad, thus degrades the user experience.
Now I hope to find away to go back.
Recently, I want to use blend3 to design the UI of one of my projects, however, when I open the solution from blend3, I find the menu to enable the design view is gray, I can not switch.
Later I found a post help to solve the issue.
http://social.msdn.microsoft.com/Forums/en-SG/wpf/thread/d84742fa-6fa1-40fb-b6c0-f00330d2c3f5
Exactly the same problem I am faced, and the solution worked.
“Please add <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> in the first property group of in your project file and then Blend should be able to load design surface for you.
Actually, I think we can use text compare tool to compare the difference of the project file can enable design view and not.
When executing a python script, I get the Non-ASCII character error, and I know it’s caused by the encoding issue.
The solution:
Add the below line at the top of the .py file
#coding:utf-8
下载安装文件:
服务端安装文件:VisualSVN-Server-1.6.2
客户端安装文件:TortoiseSVN-1.5.5.14361-win32-svn-1.5.4
上面是我使用的版本。
在VisualSVN Server 的官网 http://www.visualsvn.com 上提供了两个产品。一个是VisualSVN,另一个是VisualSVN Server (下面简称Server)。前者是一个集成到Visual Studio里的插件,功能挺强大,但是需要收费滴
一、VisualSVN Server的配置和使用方法【服务器端】
1,VisualSVN Server的安装
下载安装包,解压后得到.exe文件,双击进行安装
windows下配置SVN服务器(VisualSVN Server) – 心雨 – 心雨
其中的Repositories大家改到另一个磁盘目录进行保存,具体原因不用说了(据实际安装中,程序路径和仓库代码路径必须在同一个盘符下,否则启动服务时失败而导致安装失败,奇怪的问题)。
另建议复选 Usesecure connection项,这时候只有443和8443两个端口可用(注意自己公司的防火墙问题,如果有冲突则需要开放该对应端口以使用)。
还有就是建议使用 Subversion身份验证模式。(具体如果处于域里面则已包含了域验证,相对安全了)
一步步Next,安装完毕,默认选择打开操作管理界面(也可以开始->程序->VisualSVN打开操作管理界面)
windows下配置SVN服务器(VisualSVN Server) – 心雨 – 心雨
2,添加一个代码库【Repository】
右击Repository
windows下配置SVN服务器(VisualSVN Server) – 心雨 – 心雨
windows下配置SVN服务器(VisualSVN Server) – 心雨 – 心雨
上图中的CheckBox如果选中,则在代码库StartKit下面会创建trunk、branches、tags三个子目录;不选中,则只创建空的代码库StartKit
点击OK按钮,代码库就创建成功
windows下配置SVN服务器(VisualSVN Server) – 心雨 – 心雨
创建完代码库后,没有任何内容在里面。我会在这个教程的第二部分说明如何迁入源代码。
先来看一下,给代码库创建用户及分配权限
3,给代码库创建用户及分配权限
下面,我们开始安全性设置,在左侧的Users上点击右键
windows下配置SVN服务器(VisualSVN Server) – 心雨 – 心雨
windows下配置SVN服务器(VisualSVN Server) – 心雨 – 心雨
点击OK,我们就创建一个用户了。按照上面的过程,分别添加用户Developer1、tester1、manager1,然后添加这些用户到我们刚才创建的项目里
右击刚才新建的代码库StartKit
windows下配置SVN服务器(VisualSVN Server) – 心雨 – 心雨
点击上图中的”Add…”按钮,在下图中选择我们刚才添加的用户,点击OK按钮
说明:大家可能注意到了下图中的Groups,是的,你也可以先创建组,把用户添加到各个组中,然后对组进行授权
windows下配置SVN服务器(VisualSVN Server) – 心雨 – 心雨
按照下图所示,分别对用户【或组】进行授权:
windows下配置SVN服务器(VisualSVN Server) – 心雨 – 心雨
因为用户starter在团队中是新来者,不希望他向代码库中提交新代码,所以他只能读取代码库中的代码,不能提交代码。tester1是测试人员,不负责代码编写,所以也是只读权限。而Developer1和manager1是开发人员和项目经理,自然具有读、写的权限。
在实际的项目开发过程中,Developer和tester往往不可能只有一个人,这时候使用组来授权更加方便,这个大家可以自己练习一下。
二、TotoiseSVN的基本使用方法
(一)、签入源代码到SVN服务器
假如我们使用Visual Studio在文件夹StartKit中创建了一个项目,我们要把这个项目的源代码签入到SVN Server上的代码库中里,首先右键点击StartKit文件夹,这时候的右键菜单如下图所示:
windows下配置SVN服务器(VisualSVN Server) – 心雨 – 心雨
点击Import,弹出下面的窗体,其中http://zt.net.henu.edu.cn 是服务器名,svn是代码仓库的根目录,StartKit是我们在上个教程中添加的一个代码库:
说明:左下角的CheckBox,在第一次签入源代码时没有用,但是,在以后你提交代码的时候是非常有用的。
windows下配置SVN服务器(VisualSVN Server) – 心雨 – 心雨
点击OK按钮,会弹出下面的窗体,要求输入凭据
windows下配置SVN服务器(VisualSVN Server) – 心雨 – 心雨
windows下配置SVN服务器(VisualSVN Server) – 心雨 – 心雨
源代码已经成功签入SVN服务器了。这时候团队成员就可以迁出SVN服务器上的源代码到自己的机器了
(二)、签出源代码到本机
在本机创建文件夹StartKit,右键点击Checkout,弹出如下图的窗体:
windows下配置SVN服务器(VisualSVN Server) – 心雨 – 心雨
在上图中URL of Repository:下的文本框中输入svn server中的代码库的地址,其他默认,点击OK按钮,就开始签出源代码了。
说明:上图中的Checkout Depth,有4个选项,分别是迁出全部、只签出下一级子目录和文件、只签出文件、只签出空项目,默认的是第一项。上面的例子中,我们也可以使用web的方式访问代码库,在浏览器中输入http://zt.net.henu.edu.cn/svn/StartKit/
这时候也会弹出对话框,要求输入用户名和密码,通过验证后即可浏览代码库中的内容。
搞定!源代码已经成功签出到刚才新建的StartKit目录中。
打开StartKit目录,可以看到如下图的文件夹结构:
windows下配置SVN服务器(VisualSVN Server) – 心雨 – 心雨
一旦你对文件或文件夹做了任何修改,那么文件或文件夹的显示图片机会发生变化。下图中我修改了其中的二个文件
windows下配置SVN服务器(VisualSVN Server) – 心雨 – 心雨
(附:不同状态所对应的图片)
windows下配置SVN服务器(VisualSVN Server) – 心雨 – 心雨
现在我们已经知道怎么将源代码签入到SVN服务器,怎么从服务器签出代码到本机,也简单了解了不同状态所对应的图案啦。
(三)提交修改过的文件到SVN服务器
上面的图2-2-7中,我修改了位于Model文件中的二个文件ImageInfo.cs和NewsInfo.cs,下面演示如何提交到SVN服务器。
注意:提交源代码到服务器时,一定确保本机的代码是最新版本,否则可能提交失败,或者造成版本冲突。
在Model文件夹上点击右键或在Model文件下的空白处点击右键,点击SVN Commit…弹出下面的窗体:
windows下配置SVN服务器(VisualSVN Server) – 心雨 – 心雨
点击ok
windows下配置SVN服务器(VisualSVN Server) – 心雨 – 心雨
(四)添加新文件到SVN服务器
我们在Model文件下添加一个新的类文件UserInfo.cs,在Model文件下的空白处点击右键,点击SVN Commit…,和上面讲的提交修改过的文件到SVN服务器一样,就可以了。
另外也可以在文件UserInfo.cs上点击右键,点击TortoiseSVN=>>Add,弹出如下图的窗体:
windows下配置SVN服务器(VisualSVN Server) – 心雨 – 心雨
选中UserInfo.cs文件,点击OK按钮,这样并没有将这个文件提交到SVN服务器,只是将这个文件标记为源代码库库中的文件,并将其状态置为修改状态。之后,我们要再SVN Commit这个文件一次,才可以将其真正提交到SVN服务器上的代码库中。
上面讲是添加文件,实际上,添加文件夹的步骤也是一样的,这里就不说了。
(五)更新本机代码与SVN服务器上最新的版本一致
这个也很简单,只要在需要更新的文件夹上点击右键或在该文件下的空白处点击右键,点击SVN Update,就可以了。
注意:更新操作可能会因为版本冲突而失败,这是可以使用合并【Merge】或其他方法解决;也可能因为锁定【Get Lock】而失败,这是需要先解锁【Release Lock】。
六、重命名文件或文件夹,并将修改提交到SVN服务器
只要在需要重命名的文件或文件夹上点击右键,点击TortiseSVN=>& gt;Rename…,在弹出的窗体中输入新名称,点击OK按钮,就可以了。此方法也不是直接重命名,而是将该文件或文件夹的名称标记为重命名后名称,也需要我们使用SVN Commit提交到SVN服务器后才真正重命名。
七、删除文件或文件夹,并将修改提交到SVN服务器
最简单就是,你直接删除文件或文件夹,然后使用SVN Commit提交更新到SVN服务器。另外一种方法是在你要删除的文件或文件夹上点击右键=>>TortoiseSVN=>> Delete删除,此方法也不是直接删除,而是将该文件或文件夹的状态置为删除,也需要我们使用SVN Commit提交到SVN服务器后才真正删除。
说明:实际上,从你把源代码迁签入SVN服务器开始,每一个版本的数据和文件,就算是你已经删除了的,也都可以随时迁出。
以上只是TortoiseSVN最简单的几个功能,其实他的功能远不止这些,其他的功能大家可以在使用的过程中慢慢体会,有些功能我会在下面的教程中使用到,到时候会和大家讲清楚用法。
注意:向SVN服务器提交源代码的时候,一定不要提交bin、obj等文件夹,否则会很麻烦。但是web项目的bin目录除外,但是web项目的bin目录中的引用其他项目而生成的dll不需要提交。
一个好习惯:如果项目中引用了其他的第三方的程序集,比如 EnterpriseLibrary、FCKEditor等,这时候不要简单从他们的安装位置引用,而是在你的解决方案下,添加一个Library的目录,把需要的程序集复制到这里,然后从Library目录引用,这样有什么好处,自己想一想吧
三、版本库迁移
假如有两个服务器A和B,版本库原来在A服务器上,现在要移到B服务器,做法如下
1,将A中的版本库更新到MYeclipse(注意要删除掉….\WebRoot\WEB-INF\下的calsses文件夹,因为这里包含Myeclipse自动编译文件,如果不删除就上传至版本库,check出来的项目同步时会报错),右击项目-team-disconntect(断开)-选择第一项-Yes,目的是将原来使用svn或cvs时项目中的.cvs和.svn文件清除掉
2,在B上安装客户端和服务端,再按上面讲的步骤在B的服务端上建版本库,然后把项目拷贝到B中的某个位置,使用svn客户端右击项目,选择import导入到版本库中
(参考:http://www.cnblogs.com/lzhdim/archive/2009/04/23/1442189.html
http://hi.baidu.com/hsyl/blog/item/7ad43b2986af8bf498250a54.html )
Recent days, I am developing a self project. The project seeks to leverage the cool features of prism which is a framework for building composite applications.
Since .NET 4.0 framework, not matter full package or client profile package, they all require SP3 be installed in XP operating system. So if I decided to develop the project base on .net 4, it might cause deployment issues if user doesn’t want to do additional things except for “a simple double click”.
Finally, I decide to develop my project based on .NET 3.5 sp1 which has fewer restrictions on the outside. Therefore, I lost many awesome new features included in WPF 4.0, like VisualStateManagement, various transition effects, and ease functions.
The navigation feature added in prism 4.0 is very useful and handy, and I like it very much. But in Prism 2.x, there isn’t this feature. At first, I want to try the prism4.0 and .net 3.5sp1 combination, but later, I found prism4.0 was targeted to .NET 4.0 which means I have to use earlier version of prism—2.x. (I found David hill-Microsoft guy had launched a poll-whether prism 4.0 should support earlier versions of .NET framework, before diving to develop prism 4.0, it seems most people choose not. It’s really a pity I didn’t see that before.)
Since prism is an open-source project, I update the source of prism 2.x to support the neat navigation feature. It tests to be successful.
If anyone wants to use Navigations API in prism 2.x, I can email you the compiled binaries.
Today, I am just writing an vc++ application, and in an API, I want to specify the string to be Unicode with _T marco, The error “_T is not declared identifier” is thrown to me.
The error is simply caused by forgotten the parentheses, and the right way is to use it in the following form.
MessageBox(handle, _T(“aa”));
As you may know, mole for VS 2008 is really awesome debugger visualizer for WPF. However, Mole 2010 is no longer free.
In my opinion, it’s worth the money. but developers in China are not very rich, we always try to save every penny if we can find a substitute.
Anyway, Josh smith lists it’s new features here.
http://joshsmithonwpf.wordpress.com/2011/03/03/using-mole-2010-to-analyze-collections/
Excerpt from internet:
The various kinds of join statements confused me sometimes, so I take some time to digest the concept, and found the following from bbs somewhere easy to understand.
So put it here in case I forget.
DECLARE
@TA TABLE (IDA INT,VA VARCHAR(10))
DECLARE
@TB TABLE (IDB INT,VB VARCHAR(10))
INSERT INTO @TA
SELECT
1,’AA’ UNION SELECT
2,’BC’ UNION SELECT
3,’CCC’
INSERT INTO @TB
SELECT
1,’2′ UNION SELECT
3,’58’ UNION SELECT
4,’67’
–内联接简单写法
SELECT A.IDA,A.VA,B.IDB,B.VB FROM @TA A,@TB B
WHERE A.IDA=B.IDB
–内联接
SELECT A.IDA,A.VA,B.IDB,B.VB FROM @TA A INNER JOIN @TB B
ON A.IDA=B.IDB
SELECT A.IDA,A.VA,B.IDB,B.VB FROM @TA A JOIN @TB B
ON A.IDA=B.IDB
–左外联接
SELECT A.IDA,A.VA,B.IDB,B.VB FROM @TA A LEFT JOIN @TB B
ON A.IDA=B.IDB
SELECT A.IDA,A.VA,B.IDB,B.VB FROM @TA A LEFT OUTER JOIN @TB B
ON A.IDA=B.IDB
–右外联接
SELECT A.IDA,A.VA,B.IDB,B.VB FROM @TA A RIGHT JOIN @TB B
ON A.IDA=B.IDB
SELECT A.IDA,A.VA,B.IDB,B.VB FROM @TA A RIGHT OUTER JOIN @TB B
ON A.IDA=B.IDB
–完整外联接
SELECT A.IDA,A.VA,B.IDB,B.VB FROM @TA A FULL JOIN @TB B
ON A.IDA=B.IDB
SELECT A.IDA,A.VA,B.IDB,B.VB FROM @TA A FULL OUTER JOIN @TB B
ON A.IDA=B.IDB
–交叉联接
SELECT A.IDA,A.VA,B.IDB,B.VB FROM @TA A CROSS JOIN @TB B
–自联接
SELECT A.IDA,A.VA,B.IDA,B.VA FROM @TA A,@TA B WHERE A.IDA=B.IDA+1
查询分析器中执行:
–建表table1,table2:
create table table1(id int,name varchar(10))
create table table2(id int,score int)
insert into table1 select 1,’lee’
insert into table1 select 2,’zhang’
insert into table1 select 4,’wang’
insert into table2 select 1,90
insert into table2 select 2,100
insert into table2 select 3,70
如表
————————————————-
table1|table2|
————————————————-
idname|idscore|
1lee|190|
2zhang|2100|
4wang|370|
————————————————-
以下均在查询分析器中执行
一、外连接
1.概念:包括左向外联接、右向外联接或完整外部联接
2.左连接:left join 或 left outer join
(1)左向外联接的结果集包括 LEFT OUTER 子句中指定的左表的所有行,而不仅仅是联接列所匹配的行。如果左表的某行在右表中没有匹配行,则在相关联的结果集行中右表的所有选择列表列均为空值(null)。
(2)sql语句
select * from table1 left join table2 on table1.id=table2.id
————-结果————-
idnameidscore
——————————
1lee190
2zhang2100
4wangNULLNULL
——————————
注释:包含table1的所有子句,根据指定条件返回table2相应的字段,不符合的以null显示
3.右连接:right join 或 right outer join
(1)右向外联接是左向外联接的反向联接。将返回右表的所有行。如果右表的某行在左表中没有匹配行,则将为左表返回空值。
(2)sql语句
select * from table1 right join table2 on table1.id=table2.id
————-结果————-
idnameidscore
——————————
1lee190
2zhang2100
NULLNULL370
——————————
注释:包含table2的所有子句,根据指定条件返回table1相应的字段,不符合的以null显示
4.完整外部联接:full join 或 full outer join
(1)完整外部联接返回左表和右表中的所有行。当某行在另一个表中没有匹配行时,则另一个表的选择列表列包含空值。如果表之间有匹配行,则整个结果集行包含基表的数据值。
(2)sql语句
select * from table1 full join table2 on table1.id=table2.id
————-结果————-
idnameidscore
——————————
1lee190
2zhang2100
4wangNULLNULL
NULLNULL370
——————————
注释:返回左右连接的和(见上左、右连接)
二、内连接
1.概念:内联接是用比较运算符比较要联接列的值的联接
2.内连接:join 或 inner join
3.sql语句
select * from table1 join table2 on table1.id=table2.id
————-结果————-
idnameidscore
——————————
1lee190
2zhang2100
——————————
注释:只返回符合条件的table1和table2的列
4.等价(与下列执行效果相同)
A:select a.*,b.* from table1 a,table2 b where a.id=b.id
B:select * from table1 cross join table2 where table1.id=table2.id (注:cross join后加条件只能用where,不能用on)
三、交叉连接(完全)
1.概念:没有 WHERE 子句的交叉联接将产生联接所涉及的表的笛卡尔积。第一个表的行数乘以第二个表的行数等于笛卡尔积结果集的大小。(table1和table2交叉连接产生3*3=9条记录)
2.交叉连接:cross join (不带条件where…)
3.sql语句
select * from table1 cross join table2
————-结果————-
idnameidscore
——————————
1lee190
2zhang190
4wang190
1lee2100
2zhang2100
4wang2100
1lee370
2zhang370
4wang370
——————————
注释:返回3*3=9条记录,即笛卡尔积
4.等价(与下列执行效果相同)
A:select * from table1,table2
VisualStateManager is a new feature first introduced by wpftoolkit, and later will added in wpf4.0. We know that Blend3 and Blend4 all have built in support for that, how about if we want to take advantage of this in Blend2.
Here is a solution from the blog of expression and blend team.