Friday, August 1, 2008

Mystery solved: Why does the active language of my computer change all of a sudden?

If you have more then one language installed on your computer, sometimes the active language changes, seemingly by itself. It takes a restart to go back to the original default language. In the meantime, you will see different characters appearing with many keys you use.

What happens and how do you solve it?
If you click the right ALT key plus the left SHIFT key simultaneously, the active language changes. If you want to change it back, try hitting this key combination again.

Or, if you don't want this key combination to change languages in the first place, go to your control panel, choose languages or country settings. On the Advanced keyboard settings tab, you can disable the shortcut.

Read more >>

Saturday, May 10, 2008

Handy subversion commands

I am using subversion as a versioning system on my local computer. It works great. For integration with windows explorer, I use TurtoiseSVN. Also great.

I thought I'd list some handy subversion and turtoise commands I often use in this blog. Complete documentation can be found on the subversion and TurtoiseSVN websites, by the way.


Note: my subversion repository is located in F:\sv, my working directories are in F:\xampp\htdocs\.

Start the svnserve server:
svnserve -d

Add a new project to the subversion repository:
F:\>svn import "F:\Documents\website" file:///sv/website -m "initial import"

Checkout a project in a new working directory:
- Open Windows Explorer, browse to the new working directory, for example F:\xampp\htdocs\website.
- Click rightmouse button on this directory and click 'SVN Checkout'.
- In the field 'URL of repository' fill in the location of the repository for this project, for example file:///F:/sv/website.

Commit changes:
- From Windows Explorer, rightmouse click on the file or the directory you want to commit.
- Choose 'SVN Commit'. You will see all files that have changed and - if you tick the checkbox 'Show unversioned files' - also files that are not under version control.
- You can now select the files you want to commit, write a comment and click OK.
- If you want to see the exact differences in a file, you can right-mouseclick the file in the list and choose 'Compare with base'.

List all projects in the subversion repository:
svn list --verbose file:///F:/sv

Read more >>

Saturday, January 26, 2008

Opening an Excel file as Administrator on Vista

This week I was coding a Macro in an Excel file that would open a certain Word file. I used the following code to open Word from Excel:

Set wrd = CreateObject("Word.Application")
wrd.Visible = False
Set doc = wrd.Documents.Open(fileName)

When I opened the Excel file by double clicking it in the Windows Explorer and ran the macro, it gave me an error 'Access denied - 70'. It turns out that on Vista, even if you think you are an administrator, you do not always have administrative rights.

To open the Excel file as an administrator, I had to do the following:

- Open the Windows Explorer.
- Right-mouse click on the Excel file and choose "Create Shortcut".
- Right-mouse click on the shortcut and choose "Properties".
- Click on the tab "Shortcut".
- In the "Target" field, add the path to your Excel program before the filename. Leave a space between the path and the filename. In my case, the path to Excel is "C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE".
- Click the "Advanced" button.
- Click "Run as administrator".
- Click "OK" to close the small window and "OK" again to close the properties window.

Now, when you double click the shortcut, you open the Excel file as an administrator and the macro that opens Word runs just fine.

Read more >>

Thursday, January 3, 2008

Check the date a webpage was last changed

When you browse the web, you sometimes want to know when the page you are viewing was last updated. While viewing the page in your browser, type the following in the address bar of your browser and hit Enter:

javascript:alert(document.lastModified);

It gives you a popup with the date the page was last updated.

Note:
It only works for static HTML pages, since dynamically created pages are created on the fly, that is, today.

Read more >>