Showing posts with label sofware. Show all posts
Showing posts with label sofware. Show all posts

Saturday, September 12, 2009

SVN: exclude some files out of version control (using svn:ignore)

Sometimes, you don’t want SVN to include all you files in the source code directory because they may be temporary files generated by developers or tools (vimcreates .swp file when a file is opened in vim).
SVN book: http://svnbook.red-bean.com/en/1.5/svn.advanced.props.special.ignore.html

Two ways

o   Global change: it is applied to all svn operations performed using the runtime configuration. In other words, it changes the configuration of svn application (not a specific directory/file under control of svn)

o   Bind configuration to a specific version tree using svn:ignore property.

o   The ignore pattern checking is applied only during adding of unversioned directories/files to svn control.
Once an object is under Subversion's control, the ignore pattern mechanisms no longer apply to it. In other words, don't expect Subversion to avoid committing changes you've made to a versioned file”

o   Its value contains a list of NEWLINE-delimited file pattern

o   They don’t override global global-ignores configuration, but append to the list

o   “the patterns found in the svn:ignore  property apply only to the directory on which that property is set, and not to any of its subdirectories.”
Use switch –R if you want to apply it recursively.

o   Usage
svn propset svn:ignore -F file-contains-ignore-patterns path-ignore-to-be-applied
Examples:
    svn propset svn:ignore -F .svn-ignore .
    #recursive. If you change the direcotry tree after this command is run,
    #you need to return following command to make the newly created directories/files controlled also by ignore pattern.
    svn -R propset svn:ignore -F .svn-ignore .   
    # edit a property

    svn propedit svn:ignore .     #edit the ignore patterns using the preconfigured editor.
Note:
  *)  If you use a file to specify ignore patterns, you must rerun the command
              "svn propset svn:ignore -F your-patter-file ."
    to make svn reread the file after the pattern file is changed.
  *)  One alternative is to use
              "svn propedit svn:ignore ."
       to edit the property configuration. Then the change you made immediately takes effect. However, the new property value will not be written back to the original pattern file. You can use command
    "svn propget svn:ignore . >  pattern-file"
to export the new value to your pattern file.

o   File Pattern
*: match any sequence of characters
?: match single character
[char-set]: match the specified char set.

o   Command “svn add”
When you use wildcards, you should be careful because it may make svn bypass the ignores check.
See http://svnbook.red-bean.com/trac/ticket/115.
Basically, “svn add * bypasses the ignores system. However, it has been fixed. So if you are using a latest svn version, it should not be a problem.
Anyway, use “svn add --force . when you can (it makes svn check the whole specified directory tree).

o   Command “svn status” won’t list ignored directories/files.
Use “svn status --no-ignore” to list status of all files including ignored ones.

Saturday, March 15, 2008

Edit binary file in hex mode in vim

It will be nice if we can edit binary file directly in vim. VIM provides basic support which has a few restrictions.
(1) Open a binary file
    vim -b datafile
or
    :set binary
(2) Many characters are unprintable. You can see the Hex format by using:
    :set display=uhex
Or you can use ga command to see the value of current character.
(3) To see current position, use
    g CTRL-G
The output is verbose:
    Col 6 of 38; Line 31 of 31; Word 94 of 96; Byte 747 of 780
(4) Move to a specific byte offset:
    234go
(5) xxd can be used to convert the file into hex dump format
    %!xxd
Result should look like this:   
    0000000: 6262 630a 6465 660a 6768 696b 0aab de0a  bbc.def.ghik....
There are two parts: hex part and printable character part.
Go back:
    %!xxd -r
Note: only changes in hex part have effect. Changes in printable text part are ignored.

Of course, tool xxd can be used independently in command line.

Friday, March 14, 2008

Google Apps

I have heard of "Google Apps" for a long time, but I have not tried it. Recently, I am investigating some web2.0 applications including Google YouTube, CodeSearch... Gradually, I knew more about Google Apps. It is integration of various Google Applications including Gmail, doc&Spreadsheet, GTalk... The standard edition of Google Apps is free!! And premier edition is $50 which is much cheaper than Microsoft office. As a result, it may become first choice of small companies which don't want to spend lots of money to buy MS Office. By using Google Apps, users can build web site for their companies and make use of Google Doc, GTalk, Gmail and much more applications made by Google.
However, these two rivals are not counterparts. Google Apps aims to provide a way for businesses to build applications conveniently. The end users don't need to maintain any software and hardware to run the system. The infrastructure is provided and managed by Google. In addition, all applications in Google Apps are web-based which means collaboration and communication become light-weight. In other words, users don't need to install any client-side software. This is the largest advantage of Google Apps.
But, Google Apps is not as powerful as MS Office. For example, Google Doc&Spreadsheets provides just very basic editing functionality, which may not meet requirements of advanced users. If someday Google provide its own desktop tools like MS Office, future of Google Apps will be bright.
After all, it is a good thing because Google Apps is a new choice for users. And it may benefit small companies which own limited amount of money.

Thursday, February 21, 2008

Audio Record

Recently, I am looking for a good audio recording software.
In my English class, we use Sanako to do this job. It is easy to use, but I think it is too simple in terms of functionality. As a result, I wanted to find a free and great audio recording software. At last, I found one which I think satisfies my requirements. It is Audacity -- a open source software. It is powerful. It supports multi-tracks.
Chinese software:
(1) wavecn
    It looks like a great product. However, I have not tried it.

Some commercial software:
(1) Cooledit