1 / 3
Caption Text
2 / 3
Caption Two
3 / 3
Caption Three margin testing

Thursday, August 12, 2010

如何实现翻墙

http://wenda.google.com.hk/wenda/thread?tid=4104e81842001e9c

  Linkideo-又一个安全免费的Vpn代理服务
  关于Vpn代理的好处,大家心知肚明,不再赘述。Linkideo是英国一个Vpn服务提供商,之前只提供收费VPN服务,如今也开始提供免费Vpn服务。
  Linkideo的免费账号带宽是128kbit/s,速度还是不错的,反正通过该VPN观看YouTube上的视频比较流畅。目前Linkideo分配给用户的IP地址是法国的,暂不知道是否会经常更改IP。
  Linkideo提供的是账号-密码型的VPN服务,所以与用户使用的操作系统无关。关于在各种操作系统上VPN的设置,可以查看Linkideo的Vpn设置指南。
  但需要指出的是Linkideo的免费VPN账号只能用来进行Web浏览,但这对大多数用户而言,已经足够了。
  现在申请Linkideo的免费账号,一起"走向世界"吧!
      
  注册地址:http://www.linkideo.com
      
  VPN的设置方法:
      
  1.打开控制面板的网络连接
      
  2.创建一个新的连接
      
  3.下一步
      
  4.选择连接到我的工作场所的网络
      
  5.选择虚拟专用网络连接
      
  6.在输入栏输入连接的名称,如:Linkideo VPN link
      
  7.选择不拨初始连接,点下一步
  输入VPN服务器地址: pptp1.linkideo.com
      
  8.建议选在我的桌面上添加一个到此连接的快捷方式,点完成
      
  9.在邮箱里找到帐号密码登录就可以啦,不过要先连入宽带。

Wednesday, August 11, 2010

svn: make the branches directory before make a branch

http://dryice.name/blog/freebsd/svn-make-the-branches-directory-before-make-a-branch/

Well, this is a short note to myself so the next time I want to create a branch of a new project, I won't need to search through the Internet.

Before doing

to make a new branch of a new project (which don't have any branches yet), I'll need to do

svn mkdir http://svn.example.com/repos/calc/branches \
-m "make the branches directory to hold all the branches"

first.

Or I'll get an error message like

svn: Path 'branches' not present

The reason is, like the error message said, there is no directory "branches" in the repo, and svn copy, like the "cp" command, won't make a directory if it's not there. It will assume I made a typo. A safe guard. And I need to explicitly create the directory.

How can I get Eclipse to show .* files?

http://stackoverflow.com/questions/98610/how-can-i-get-eclipse-to-show-files

In the package explorer, in the upper right corner of the view, there is a little down arrow. Tool tip will say view menu.

Click that, Select Filters. uncheck .* resources.

So Package Explorer -> View Menu -> Filters -> uncheck .* resources.

Using Subclipse (the Subversion Plug-in for Eclipse)

http://agile.csc.ncsu.edu/SEMaterials/tutorials/subclipse/index.html#section7_0
0.0 Outline
1.0Background of Subversion and Subclipse
2.0Adding Subclipse Plug-in to Eclipse
3.0Subclipse Perspective
4.0Adding a Repository
5.0Adding an Already Existent Project to the Repository
6.0Checking out a Project from the Repository
7.0Committing Resources into the Repository
8.0Synchronizing Resources
9.0History
10.0Disconnecting a Project from the Repository
11.0Exercise
12.0Sources and Further Information

1.0 Background of Subversion and Subclipse

Subclipse is an Eclipse plug-in that provides the functionality to interact with a Subversion server, and to manipulate a project on a Subversion server in the Eclipse environment.

Terminology
In the course of working on a project, a developer should work in the following manner. How to perform all of these task is outlined below.

If the project is new, the following is done the first time:

  • A developer checks in a project for the first time, putting all of the files on the repository.
  • Other developers check out the project into their workspace. If a developer changes workspaces, the code would need to be checked out again.
In the course of working, a developer should strictly follow these steps:
  1. Update their code, to obtain any changes that others made
  2. Work on their code
  3. Periodically (about every half-hour to an hour), the developer should synchronize, which displays any recent changes to the repository and which local code has been changed (synchronize doesn't actually do anything, it just tells you what needs to be done).
  4. If the developer has changed a file locally, and the files on the repository have been changed since the last update, a merge will need to take place
  5. The developer commits his/her changes of the local code to the repository
Top | Contents

2.0 Adding Subclipse Plug-in to Eclipse

If you are working in the laboratory, Subclipse should already be installed.

You can add the Subclipse plug-in to Eclipse by creating an update site in Eclipse and download and install Subclipse.

2.1 Create an update site for Subclipse

2.1.1 Select Help > Software Updates > Find and Install. Select Search for new features to install. Click Next.

2.1.2 Click the New Remote Site button. Give the update site a name, like Subclipse, and type in the following address:http://subclipse.tigris.org/update_1.2.x. Click OK. A new update site will be added to the list.

2.1.3 Press the + next to your Subclipse update site. Eclipse will connect with the site and list all of the updates available. Select the most recent Subclipse update by checking the box next to the update. Click Next.

2.1.4 Check the Subversion feature that you want to install. Click Next.

2.1.5 Accept the terms of the license agreement. Click Next.

2.1.6 Make sure that the Subversion feature is selected to install. Click Finish.

2.1.7 You will be asked to verify the feature that you wish to install. After you have, click Install.

2.1.8 You will now be asked to restart the workbench. Click Yes.

Top | Contents

3.0 Subclipse Perspectives

To change to the Subclipse perspective select Window > Open Perspective > Other... > SVN Repository Exploring.

The SVN Repository Exploring gives you three new views:

  1. The SVN Repository view lists all of the current repositories that you have access to. You can also create a new SVN Repository.
  2. The SVN Annotate view shows the annotations of a file in the repository. In order to view the annotations of a file, you must right click on the file and select Team > Show Annotations.
  3. The SVN Resource History, shows the revision history for a file that is selected in the SVN Repository view.

Top | Contents

4.0 Adding a Repository URL to Subclipse
(I used command to do this, HL)
Top
| Contents


5.0 Check In: Adding an Already Existing Project to the Repository
(I used command to do this, HL)
Top | Contents

6.0 Checking Out a Project from the Repository
(I used command to do this, HL)
Top | Contents

7.0 Synchronizing and Committing Resources to the Repository

Any resources that you have modified will have a black asterisk * in front of the resource name, and any added will have a question mark ? in front of the name.

It is always a good idea to see what needs to be done before committing files.

To synchronize resources, right click on a project and select Team > Synchronize with Repository .... You will be switched to the Team Synchronizing view. From there you can look at your outgoing changes, and others incoming changes, and synchronize your code before committing to the repository. Double-clicking on a file will open a side-by-side view of the file and its changes.

If a file has a two-way red arrow on it, then there is a conflict. Someone else has changed that file while you were working on it. Double-click the file to get a compare editor, and copy-paste what you need to resolve onto your local copy. When you have the local copy finished, right-click on the file and choose Mark as Merged. Note: PLEASE USE THIS FEATURE RESPONSIBLY!! Think very hard before selecting "Mark as Merged", as it will override what is in the repository. An entire history is kept in case you make a mistake, but always pause and check your work before marking as merged.

Note: constantly updating your code from the repository helps avoid conflicts

Top | Contents

8.0 Synchronizing Resources

To commit changes to files in your project, right click on the project and select Team > Commit.... Or, if your are in the "Team Synchronizing" perspective, right-click on the resources and select "Commit". Then you will edit the commit comment, or add a new commit comment to document what changes were made. Always add meaningful commit comments! There is also a list of previously used commit comments to choose from. Once you have committed code, the black asterisk should be gone from modified files.

Top | Contents

9.0 History
To compare your code with the latest from the repository, you may either recheck out the project or right click on the project in the Java/Plug-in Development perspectives and select Compare With > Latest from repository. Using copy and paste, one can recover old code this way. Using Compare With Revision... or Replace With Revision are also helpful.

Also,
Team > Show History shows an entire history of a folder/file.
Top | Contents

10.0 Disconnecting a Project from the Repository
Switch to the Java/Plug-in Development perspective. To disconnect a project from the repository, right click on the project and selectTeam > Disconnect. Eclipse will prompt asking if you wish to delete the metadata associated with the Subversion connection. Choose No. If you choose yes, you will have to delete the project in your workspace in order to check out another copy of the code.

Note: You will rarely need this feature.
Top | Contents

11.0 Exercise
Submit a file called "subclipse_answers.txt" which has the answers to the following questions.
  1. Suppose you are working on your code which as already been set up on the repository and has been set up on your machine. Place the following actions in the order in which you should work (some may not apply!):
    • Check-in
    • Check-out
    • Commit
    • Update
    • Synchronize
    • Work on your code
    • Mark as Merged (if necessary)
    • Resolve conflicts (if necessary)
  2. Suppose you have not set up your code in the repository yet. Place the following actions in the order in which you should work (some may not apply!):
    • Check-in
    • Check-out
    • Commit
    • Update
    • Synchronize
    • Work on your code
    • Mark as Merged (if necessary)
    • Resolve conflicts (if necessary)
  3. True or false? Developers should be committing to the repository often. Please explain why you chose that answer.
  4. True or false? Synchronizing your resources is the same as updating and committing, but in one step.
Top | Contents

12 .0 Sources and Further Information

Top | Contents


Back to Software Engineering Tutorials
Using Subclipse (the Subversion Plug-in for Eclipse) for Configuration Management Tutorial ©2003-2009 North Carolina State University,
Laurie Williams, Dright Ho, Sarah Heckman, and Ben Smith.
Email
the authors with any questions or comments about this tutorial.
Last Updated:
Wednesday, June 28, 2006 1:59:49 PM

Monday, August 9, 2010

Very basics of regexp for mod_rewrite

Regex vocabulary
The following are the minimal building blocks you will need, in order to write regular expressions and RewriteRules. They certainly do not represent a complete regular expression vocabulary, but they are a good place to start, and should help you read basic regular expressions, as well as write your own.

CharacterMeaningExample
.Matches any single characterc.t will match cat, cot, cut, etc.
+Repeats the previous match one or more timesa+ matches a, aa, aaa, etc
*Repeats the previous match zero or more times.a* matches all the same things a+ matches, but will also match an empty string.
?Makes the match optional.colou?r will match color and colour.
^Called an anchor, matches the beginning of the string^a matches a string that begins with a
$The other anchor, this matches the end of the string.a$ matches a string that ends with a.
( )Groups several characters into a single unit, and captures a match for use in a backreference.(ab)+ matches ababab - that is, the +applies to the group. For more on backreferences see below.
[ ]A character class - matches one of the charactersc[uoa]t matches cut, cot or cat.
[^ ]Negative character class - matches any character not specifiedc[^/]t matches cat or c=t but not c/t


In mod_rewrite the ! character can be used before a regular expression to negate it. This is, a string will be considered to have matched only if it does not match the rest of the expression.




Here's the very basics of regexp (expanded from the Apache mod_rewrite documentation)..

Escaping:
\char escape that particular char
For instance to specify special characters..
[].()\ etc.

Text:
. Any single character (on its own = the entire URI)
[chars] Character class: One of following chars
[^chars] Character class: None of following chars
text1
|text2 Alternative: text1 or text2 (i.e. "or")
e.g. [^/] matches any character except /
(foo|bar)\.html matches foo.html and bar.html

Quantifiers:
? 0 or 1 of the preceding text
* 0 or N of the preceding text (hungry)
+ 1 or N of the preceding text
e.g. (.+)\.html? matches foo.htm and foo.html
(foo)?bar\.html matches bar.html and foobar.html

Grouping:
(text) Grouping of text
Either to set the borders of an alternative or for making backreferences where the
nthe group can
be used on the target of a RewriteRule with
$n
e.g. ^(.*)\.html foo.php?bar=$1

Anchors:
^ Start of line anchor
$ End of line anchor
An anchor explicitly states that the character
right next to it MUST
be either the very first character ("^"), or the very last character ("$") of the URI string to match against the pattern, e.g..
^foo(.*) matches foo and foobar but not eggfoo
(.*)l$ matches fool and cool, but not foo


Featured Post

Windows和Ubuntu双系统完全独立的安装方法

http://www.ubuntuhome.com/windows-and-ubuntu-install.html  | Ubuntu Home Posted by Snow on 2012/06/25 安装Windows和Ubuntu双系统时,很多人喜欢先安装windows,然...