Thursday, March 24, 2011

FireFox Update (4.0) and Vimperator 3.0

My favorite web browser Firefox has been updated to 4.0. I got it today. After the installation, I found that my must-have adding Vimperator has also been updated to 3.0. The new interface for Vimperator looks nice; however, my clean UI is changed. All the toolbar, navigation bar, bookmark bar and tags are visible. I would like only tabs visible.

The command to display UI bars is different. In its help page, it still says that the following command is for displaying UI bars:

  :set go+=mTB

I thought I could use it to disable UI bars. There is no go settings in this new version. What I found is that the following command can be used to hide all:

  :set gui=none
:set gui=tabs

The first one is to disable all UI bars and the next one is for displaying tabs bar.

Other than that, I have not found anything changed in terms of features, except some minor changes in UI. For example, the command line displays a triangle instead colon (:). Vimperator works great!

Read More...

Saturday, March 19, 2011

VIM Tip: Add Syntax file for svg graphics

Today I found a graphics from Wikipedia about stomach. The graphics is a svg file, which is actually in XML. I like this type of graphics since it is a graphics in XML format. It makes it very easy to change some parts, specially some words in the graphics. I use VIM to edit the file.

stomach diagram.svg

Get the Syntax File

However, my MacVIM does have syntax file. I quickly found it from VIM web site, svg.vim. I saved it to my Desktop.

Copy svg.vim to Syntax Directory

According to VIM web svg.vim instruction, this file should be copied to VIM syntax directory first. At my Mac, I open my Terminal and copy the file to my vim syntax directory. My VIM's syntax directory is at ~/.vim/syntax/, where some other syntax files are, such as ps1.vim for PowerShell scripts and m.vim for Objective-C.

MyMac:~ userMe$ cp ~/Desktop/svg.vim ~/.vim/syntax/


Add a Line to filetype.vim

The next step is to add a line to my VIM's filetype.vim file. This file is located at my local vim directory:

MyMac:~ userMe$ vi ~/.vim/filetype.vim

In my vi editor, a line is added:

" my filetype file
if exists("did_load_filetypes")
finish
endif
augroup filetypedetect
au! BufRead,BufNewFile *.ps1 setfiletype ps1
au! BufRead,BufNewFile *.m setfiletype objc
au! BufNewFile,BufRead *.svg setfiletype svg
augroup END

Load syntax file From .vimrc

The above change seems OK, but I found that I also have a line in my vim configuration file to load the syntax files. The configuration file is ~/.vimrc, where syntax files are loaded. I added a line for svg:

" Load syntax source from file
source ~/.vim/syntax/ps1.vim
source ~/.vim/syntax/svg.vim

After that, restart my VIM and I'll syntax for the svg file I want to edit:



I should say that I would not need to do above steps to edit svg files by using VIM. However, it would be nice to have correct syntax highlighting if it is available. Finally I used my VIM to edit the svg file and changed texts from English to Chinese:


Reference

See my previous blog on VIM Syntax Settings.

Read More...

Wednesday, March 09, 2011

XCODE4.0 is Out!

Two days before iPad 2 release, today Apple released iOS4.3 for iPhone4 & iPad, as well as massive updates(I wrote a blog today about those items). The most expected XCODE 4.0 is released. I can be purchased from Mac Apple Store at $4.99, unbelievable low price comparing to Microsoft Visual Studio ($799 from MSRP for Professional version to $3,799 for Ultimate). For registered Apple Developers($99 annual fee), it is FREE!

However, this is the first time Apple charges a fee for XCODE. Mac users get XCODE with Mac computer for free. By default is not installed. It is an optional item on CD for most Mac computers, except MacBook Air(with OS X on USB). I got Air last year and I installed XCODE from my iMac CD. It runs without any problems.

I have watched many WWDC 2011 videos from iTunes. I am very impressed by XCODE 4.0 architecture and development. This is the one I am going to get soon when I have time in coming weeks. Here are some pictures of XCODE 4.0







Read More...

Saturday, March 05, 2011

Migration of Web Sites from IIS6 to IIS7

This note is about my experience to move a web site project from IIS6 to IIS7. The project was developed in ASP.Net in VS 2005. The requirement is to move the web site from one Windows box to another one. The only difference is IIS.

At first, I just copied all the files from IIS6 box to another box. That's the way normally I deploy a web site. However, after the set up on the new box in the same file and web site configuration, the new web site got exception when I tried to access to it from IE. After about one hour exploration, I found that it was caused by a http setting in my web.config. Rick Strahl's blog has one comment on this issue: HttpModule and HttpHander Sections in IIS 7 web.config files.

As Rick said, "you've probably seen the IIS 7 Exception that lets you know that in Integrated mode in IIS 7 you are not supposed to have an httpModules or httpHandlers section", however, my case web.config is different. The following http section caused the exception:

<add path="Reserved.ReportViewerWebControl.axd" verb="*" 
type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
validate="false"/>


After I comment it out, the web site on IIS 7 is OK. This is my note on this issue. I think Rick's view is related to the migration from IIS 6 to IIS 7.

Read More...