Showing posts with label computer. Show all posts
Showing posts with label computer. Show all posts

Friday, March 13, 2009

Create Virtual Drive in Windows by Mounting Directory

(Mar 13, 2009)

To create a virtual drive in Windows from a directory, we can use the Command Prompt in Windows and input

subst drive_letter: folder_path


For example, if we want to create a virtual z drive from a directory d:\temp, we can issue a command

subst z: d:\temp

To remove the virtual drive, we can use

subst drive_letter: /D

For example subst z: /D


//=================================

More details are available from http://www.askvg.com/create-a-virtual-drive-for-your-desired-folder-in-my-computer-using-subst-command/

Monday, March 02, 2009

Using TortoiseSVN

Using TortoiseSVN

(Mar 2, 2009)

Although GUI of TortoiseSVN is very good, it may not be intuitive for some people.  Here, I discussed some aspects of TortoiseSVN that may be important to a beginner in a version control system.

  1. Repository and working files (files we are working with) are stored in different places.  This aspect will be obvious if we are working on other version control systems, such as MS SourceSafe, because server and client interfaces are separated in the first place.  In that case, we have to set up a server and then use a client interface to connect to the server.

    For TortoiseSVN, however, this may be a bit confusing since TortoiseSVN can act as both server and client at the same time and on the same machine . A place to store a repository and working files seem to be just a folder.  Nonetheless, the behavior of server-client is still preserved and the repository and working files must be in different places.

  2. TortoiseSVN integrates itself to a Windows Explorer.  There is nothing to call from Windows' start menu.  Its behavior is changed according to the items we are interacting with.  For example, if we right click in an empty area in a folder, its menu will allow us to 'Create repository here'.  If we click on a checked out file, its menu will allow us to update from or commit to a repository.

  3. Don't try to add files by going to a working folder.  This must be done in a repository folder.  Basically, a brand new file is not associated with any repositories.  TortoiseSVN will not know where the new file should go.  Thus, we have to call a repository first.  This can be done by going to a repository folder, right click on an empty space, choose 'TortoiseSVN=>Repo-browser'.  When we arrive there, right click on the file pane and choose 'Add file...'. Notice that TortoiseSVN is very obsessed with right clicking on something.

  4. Although a file is added, it remains a normal file in a normal folder.  TortoiseSVN does not associate any version-control features to the file directly. 

  5. Version-control features will be available to working folders only.  In addition, working folders can be created by checking out things from a repository.  Note that pre-existing files in the folder may be perished.  Make sure you copy the files to somewhere else before doing so.  Alternatively, just check out items to another folder, preferably a brand-new one.

  6. We use a version-control system because we want to track change and revert to previous files, if needed.  For TortoiseSVN, reverting can be done at a working folder, not a repository.  This makes sense because a single repository may be checked out to many places.  Going to the repository will give TortoiseSVN no information about a target place.  Note that reverting to a single target is reasonable.  Why?  This is because it is normal that we want to check if reverting will fix an issue.  If so, we can commit the reverted file to a repository again with some check-in note.

    To execute version reverting, go to a target item, right click on it, and choose 'TortoiseSVN=>Show log'.  Then find a desired revision in a log, right click on the revision, and choose 'Revert to this revision'.

  7. A checked out folder is equipped with version-control features.  When we create a new file in the folder, it will mark with '?' on its icon to indicate that it is not a repository.  If it is not supposed to be in a repository, you can tell TortoiseSVN to ignore it.  Otherwise, you can add it to the repository.  This time, we can do it directly by right clicking on the file and choose an appropriate command.  ( Now, you see that TortoiseSVN is 'right-clicking oriented', right? :P )


This document can be view in my blog or Google docs.
(Use my blog to comment and Google docs for printing)


Tuesday, December 16, 2008

Any Video Converter and CamStudio

(Dec 16, 2008)

I tried to convert AVI video files created by CamStudio to the WMV format. After searching the Internet for good candidates, I decided to use 'Any Video Converter' to do the job. It works well if the number of frames per second in an AVI file is 30.

CamStudio, however, may increase the number of frames per second if your machine is fast. To make the change, go to 'Options->Video Options' and uncheck 'Auto Adjust'.

Any Video Converter is available at http://www.any-video-converter.com
I use a free version (see the bottom of its webpage)

CamStudio is released under GPL. Its website is at http://camstudio.org/

Saturday, November 15, 2008

The Cost of Running a PC

(Nov 15, 2008)

Knowing the cost of running a PC is important since it will help approximate the budget of an organization well. AnandTech gives a good example on cost estimation.

http://anandtech.com/casecoolingpsus/showdoc.aspx?i=3458&p=2

Sunday, November 09, 2008

YouTube Downloader and Video Converter

(Nov 9, 2008)

Jua, my roommate, asked me to help download YouTube videos about electronic stability control. I tried two software and the winner is YouTube Downloader
http://youtubedownload.altervista.org/

The tool not only downloads a flash video, but also converts it to various format. You gotta find it useful if you are still looking for a good YouTube downloading program.

Tuesday, February 19, 2008

Set SVN server with Apache on Windows

(Feb 19, 2008)

We can download subversion zip package and just expand it some where. Then, copy mod_dav_svn.so to Apache's module directory. To prevent confusion, I copied it to modules/svn directory. Next, add this line to httpd.conf

LoadModule dav_svn_module modules/svn/mod_dav_svn.so
LoadModule authz_svn_module modules/svn/mod_authz_svn.so

Finally, uncomment this line in the config file to allow dav. Note that this line must come before dav_svn_module line

LoadModule dav_module modules/mod_dav.so

But wait, this just makes Apache load itself with SVN capability. We need to config SVN server and create repository too. Also note that we should not assign the document root to the root of repository to avoid name conflicts. If name conflicts occur, we will normally get Error 301.

The best practice of configure SVN server is at http://svn.spears.at/. I claimed it the best practice since it elegantly separate SVN configuration from other of Apache by using an Include command :
Include c:/etc/subversion.conf

In subversion.conf, we may enter some thing like this:

<Location /super_angel>
DAV svn
SVNPath E:/svn_repos/super_angel

AuthType Basic
AuthName "Subversion Super-Angel repository"
AuthUserFile c:/etc/svn-auth-file

Require valid-user

AuthzSVNAccessFile c:/etc/svn-acl
</Location>

This will create a virtual address at localhost:8080/super_angel. This virtual address will be mapped to E:/svn_repos/super_angel, which is an actual repository for a project. Thus, we need to create a repository there using a command:
svnadmin create --fs-type bdb E:/svn_repos/super_angel

Next, we need to create an authentication password file. If the file is to be a brand new one, the command will have a c flag:
htpasswd -cm C:\etc\svn-auth-file john

For additional users, a command will be
htpasswd -m C:\etc\svn-auth-file Jane

Finally, we need to assign usage rights and groups for users in svn-acl file. The content of the file will look like this.
#
# specify groups here
#
[groups]
team1 = moo, pinyotae

#
# team1 group has a read/write access to project1 repository
# all subdirectories
# all others have read access only
#
[super_angel:/]
@team1 = rw
* = r

This will ready our Apache. We just need to restart it and access our repository at the virtual address we specify earlier.

Note: svn-acl is actually flexible. Please refer to http://svn.spears.at/ for more details.

Wednesday, February 13, 2008

Good and Free Utility Software

(Feb 12, 2008)

(references
Free Commander: http://www.freecommander.com/
FileAnt: http://www.fileant.com/
Capivara: http://capivara.sourceforge.net/

There are some software I expect to use often in the near future. First, I need a better file manager able to view Thai file names. Second, I need a software to synchronize my local folder with an FTP server.

For the file manger, there are two good candidates that catch my attention. The first one is 'FileAnt' and the second is 'Free Commander'. I have used FileAnt for a while and I like it. It has a unique feature--double click to go up one level. In details, if we double click on an empty space of a folder, we will go out of the current folder. This is very handy and make navigation fast. FileAnt, however, cannot view Thai file names.

So, I looked for another candidate and end up with Free Commander (http://www.freecommander.com/). Its user interface looks good and can view Thai file names. It has a shortcut to a favorite folder. If we set up favorite folders, ctrl-shift+1 (or 2, 3, 4, ..) will take us to a favorite folder. In fact, the shortcut can be set to a pair of folders. Namely, if we enter a shortcut, it will change an active panel to a folder and an inactive one to another folder we set. This should be very convenient when we need to transfer files between two specific folders often to back up data, for example.

For file synchronization, I chose Capivara (http://capivara.sourceforge.net/) since it has all features I need. These features are SFTP support and file change detection (the second is a must for file synchronizer). Its user interface is very intuitive too. With Capivara, we can have files at three places: home, office, and central server. We can choose to work at an office and just synchronize to the server when we are done. Then, we can retrieve updated files at home from the server to continue our work and synchronize again when we finish. This scenario will make every thing handy and safe (unless we force overwriting a newer files carelessly).

Wednesday, January 30, 2008

We should try to reduce initialization task ourselves

(Jan 30, 2008)

I tried implement an efficient way to build an isotropic image. For a long time, I thought a compiler optimization will handle initialization overhead automatically, but for Visual C++ 2005, it does not.

Consider the following code:

for( int z = 0; z < y =" 0;" x =" 0;"> arVoxels[8];
NVImage_t arValues[8]; // keep H.U. values of relevant voxels


In fact, we can move all declarations outside the most outer loop (z) as follows:

float fX, fY, fZ; // for true position
float fa, fb, fc; // relative voxel distance as in 2.1.
NVVoxel arVoxels[8];
NVImage_t arValues[8]; // keep H.U. values of relevant voxels

for( int z = 0; z < y =" 0;" x =" 0;" z =" 0;" y =" 0;" x =" 0;"> arVoxels[8];
NVImage_t arValues[8]; // keep H.U. values of relevant voxels

We can see that for each z, there will be two threads. Hence, if we move declarations to the most outer loop, two threads will use the same variable storage, and that is not correct. What we should do is moving these declarations just one step outer as shown below:

#pragma omp parallel
for( int z = 0; z < y =" 0;"> arVoxels[8];
NVImage_t arValues[8]; // keep H.U. values of relevant voxels

for( int x = 0; x < nNewSizeX-2; x++ ) {

From my experiment, this makes things much faster since array initialization is expensive. Note: we can even reduce initialization further if we divide the loop ourselves and create 'multiple sections'. For each section, declare its own variables. I, however, will not do this since the code will be clutter, and we have to know the number of sections before hand, which is normally equal to the number of physical cores in a system. Thus, changing CPU may cause some performance issue. Using OpenMP in this way, nonetheless, is very flexible regarding to system configurations.

Associativity in Modern CPU Cache

(Jan 30, 2008)

Recently, I have used OpenMP to perform multi-processing a lot. However, OpenMP may cause 'false share' often if we are not careful. False share is a situation that two threads write in a different memory locations, but unfortunately, the two memory locations are assigned the same cache slot. If this situation happens, performance will be degraded significantly.

Cache associativity will play an important role on this issue, especially if we have 8 cores or more.
So, let's look at cache associativity for some modern CPUs.

AMD Athlon 64 X2 has 2-way associative L1 cache and 16-way for L2 cache (ref).
AMD Phenom has 2-way associative L1 cache, 16-way for L2 and 32-way for L3 cache s (ref-page 4)

Intel Core 2 E4000 and E6000 series: 8-way associative L1 cache (ref-page 9) and from what I got from CPU-Z, it has 16-way associative L2 cache.

Intel Core 2 E8000 series: 8-way associative L1 cache and 24-way associative L2 cache (from CPU-Z).

So, I think CPUs from both manufactures should do well in scaling, but from what I got from Tom's hardware, Phenom scales very well and better than Core 2 Quad. I, however, cannot confirm this until both platform are more matured and more serious evaluation are available.

Saturday, September 15, 2007

Aurora: Embedding LaTex Math into MS Office

Sep 15, 2007

A few days ago, I found an interesting (but not free) tool for embedding LaTex Math into MS PowerPoint. Its name is Aurora, http://elevatorlady.ca/. Interestingly, this tool works in other MS Office tools, including Word, Excel, and Visio.

I have not tried it yet, but I will surely take a look at it when I have more time.

Sunday, September 09, 2007

ว่าด้วยเรื่องของ JFileSync

JFileSync เป็นโปรแกรมที่ทำการ synchronize file บนสองไดเรกทอรีแบบง่ายๆ มีการเปรียบเทียบให้เห็นความเก่าใหม่ของไฟล์ที่เข้าใจง่าย ตอนนี้พึ่งลองใช้บน Windows XP 32 bits ก็คงยังวิจารณ์อะไรไม่ได้มาก แต่ที่สังเกตเห็นก็คือ มันไม่รองรับการติดต่อไปที่ remote file ที่ไม่ใช่้ JFileSync server ทำให้เราต้องแม็พไดรฟ์ก่อนทุกคราไป

ยังไงก็ตามด้วยความง่ายและเพียงพอต่อความต้องการเราก็พบว่ามันน่าพอใจแล้วสำหรับซอฟต์แวร์ฟรีตัวนี้
http://jfilesync.sourceforge.net/