Monday, March 30, 2009

Error Accessing and Displaying CHM Files: Reasons and Solutions

Error Accessing and Displaying CHM Files: Reasons and Solutions
By Dennis Crane

So, you've got in trouble. Some or even all of your CHM files seem to have gotten corrupted. They show a "The page cannot be displayed" error in the left-hand pane of the CHM viewer. There are several possible reasons why your CHM e-books and documentation files are unreadable.

The CHM viewer component is not properly registered on your PC
The system file \system32\hhctrl.ocx may get missing, corrupted, or unregistered.

Solution: Run "regsvr32 hhctrl.ocx" command from the command line to register the library in the system.


Your CHM files are stored in the folder with '#' (hash) character in the path
Many C# developers discovered that their documentation and e-books in CHM format cannot be read because they were storing their CHM files in the directories like 'C:\E-books\C#\'
The hash character signifies an anchor in HTML so the CHM viewer fails to resolve the path properly and to retrieve the content.

Solution: Remove the '#' (hash) character from the directory name. Also avoid using '?', '&', and '+' characters in directory names.

A security update for Windows XP® may block access to CHM files
Windows XP® security update blocks active content in CHM files to protect your system security. Additional information is available here.

Solution: Run Windows Explorer, right-click on the CHM file, and select Properties from the popup menu. Click on the Unblock button immediately below the Advanced button on the General page. Click Apply to show the content. Once the CHM file has been unblocked, the Unblock button disappears.


The CHM file is in the restricted Internet zone
When a CHM file that you are trying to access is stored remotely, e.g. on the network drive or on a remote server, you may also get in trouble. If the associated security zone is restricted, then CHM files won't be displayed as well.

Solution: Modify the ItssRestrictions registry entry to enable a specific security zone.
Follow these steps:
1. Run 'regedit' command from the command line.
2. Locate and then click the following subkey:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HTMLHelp\1.x\ItssRestrictions
Note: If this registry subkey does not exist, then create it.
3. Right-click the ItssRestrictions subkey, point to New, and then click DWORD Value.
4. Type MaxAllowedZone, and then press ENTER.
5. Right-click the MaxAllowedZone value, and then click Modify.
6. In the Value data box, type a number from 0 and 4, and then click OK.
The values settings are
0 = My Computer
1 = Local Intranet Zone
2 = Trusted sites Zone
3 = Internet Zone
4 = Restricted Sites Zone

For most CHM files, the value of 1 should be enough to allow use without opening up access from/to remote CHM files in email/internet locations.
7. Quit Registry Editor.

Warning Enable only those security zones that you trust. Do not enable security zones about which you are not sure.

Saturday, March 14, 2009

股票量价关系

股票量价关系

在股市里没有定式,一般来讲交投清淡意味着:
1 在趋势之内的正常缩量;
2 在新趋势开使前的迷茫阶段。

量价关系的类型分为两大类。一类是常见的类型,即低量低价、量增价平、量增价涨、
量缩价涨、量增价跌和量缩价跌等六种;另一类是比较特殊的类型,即地量地价、天量
天价、无量空涨、无量阴跌、底部放量和顶部对倒等六种。

1、低量低价

低量低价主要是指个股(或大盘)成交量非常稀少的同时、个股股价也非常低的一种量
价配合现象。低量低价一般只会出现在股票长期底部盘整的阶段。

当股价从高位一路下跌后,随着成交量的明显减少,股价在某一点位附近止跌企稳,并
且在这一点位上下,进行长时间的低位横盘整理。经过数次反复筑底以后,股价最低点
也日渐明朗,同时,由于量能的逐渐萎缩至近期最低值,从而使股票的走势出现低量低
价的现象。

低量低价的出现,只是说明股价阶段性底部形成的可能性大大增强,而不能作为买入股
票的依据。投资者还应在研究该股基本面是否良好、否具有投资价值等情况后,才能做
出投资决策。

2、量增价平

量增价平主要是指个股(或大盘)在成交量增加的情况下、而个股的股价却几乎维持在
一定价位水平上下波动的一种量价配合现象。量增价平既可以出现在上升行情的各个阶
段,也可以出现在下跌行情的各个阶段之中。同时,它既可以作为卖出股票的信号,也
可以作为买人股票的信号。区别买卖信号的主要特征,是要判断“量增价平”中的“价
”是高价还是低价。

如果股价在经过一段时间比较大的涨幅后、处在相对高价位区时,成交量仍在增加,而
股价却没能继续上扬,呈现出高位量增价平的现象,这种股价高位放量滞涨的走势,表
明市场主力在维持股价不变的情况下,可能在悄悄地出货。因此,股价高位的量增价平
是一种顶部反转的征兆,一旦接下来股价掉头向下运行,则意味着股价顶部已经形成,
投资者应注意股价的高位风险。

如果股价在经过一段比较长时间的下跌后、处在低价位区时,成交量开始持续放出,而
股价却没有同步上扬,呈现出低位量增价平的现象,这种股价低位放量滞涨的走势,可
能预示着有新的主力资金在打压建仓。一旦接下来股价在成交量的有效配合下掉头向上
,则表明股价的底部已经形成,投资者应密切关注该股。

3、量增价涨

量增价增主要是指个股(或大盘)在成交量增加的同时、而个股的股价也同步上涨的一
种量价配合现象。量增价涨只出现在上升行情中,而且大部分是出现在上升行情的初期
,也有小部分是出现在上升行情的中途。

在经过前期一轮较长时间的下跌和底部盘整后,市场中逐渐出现诸多利好因素,这些利
好因素增强了市场预期向好的心理、刺激了股市的需求,市场交换逐渐活跃起来。随着
成交量的放大和股价的同步上升,投资者购买股票短期内就可获得利润,赚钱的示范效
应激起了更多投资者的投资意愿。

随着成交量的逐渐放大,股价也开始缓慢向上攀升,股价走势呈现量增价增的态势,这
种量价之间的良好配合,对未来股价的进一步上扬,形成了真实的实质性支撑。

4、量缩价涨

量缩价涨主要是指个股(或大盘)在成交量减少的情况下、个股的股价却反而上涨的一
种量价配合现象。量缩价涨多出现在上升行情的末期,有一小部分也会出现在下降行情
中期的反弹过程中。不过,量缩价涨的现象在上升行情和下降行情中的研判是不一样的。

在持续的上升行情中,适度的量缩价涨表明主力控盘程度比较高,维持股价上升的实力
较强,大量的流通筹码被主力锁定。但量缩价涨毕竟所显示的是一种量价背离的趋势,
因此,在随后的上升过程中出现成交量再次放大的情况,则可能意味着主力可能在高位
出货。

在持续的下降行情中,有时也会出现量缩价涨的反弹走势。当股价经过短期内的大幅度
下跌后,由于跌幅过猛,主力没能全部出货,因此,他们会抓住大部分投资者不忍轻易
割肉的心理,用少量资金再次将股价拉高,造成量缩价涨的假象,从而利用这种反弹走
势达到出货的目的。

总之,对于量缩价涨的行情,投资者应区别对待,一般以持股或持币观望为主。

5、量增价跌

量增价跌主要是指个股(或大盘)在成交量增加的情况下、个股的股价却反而下跌的一
种量价配合现象。量增价跌现象大部分是出现在下跌行情的初期,也有小部分是出现在
上升行情的初期。不过,量增价跌的现象在上升行情和下降行情中的研判也是不一样的。

在下跌行情的初期,股价经过一段比较大的涨幅后,市场上的获利筹码越来越多,一些
投资者纷纷抛出股票,致使股价开始下跌。同时,也有一些投资者对股价的走高仍抱有
预期,在股价开始下跌时,还在买入股票,多空双方对股价看法的分歧,是造成股价高
位量增价跌的主要原因。不过,这种高位量增价跌的现象持续时间一般不会很长,一旦
股价向下跌破市场重要的支撑位、股价的下降趋势开始形成后,量增价跌的现象将逐渐
消失,这种高位量增价跌现象是卖出信号。

在上升行情初期,有的股票也会出现量增价跌现象。当股价经过一段比较长时间的下跌
和底部较长时间盘整后,主力为了获取更多的低位筹码,采取边打压股价边吸货的手段
,造成股价走势出现量增价跌现象,但这种现象也会随着买盘的逐渐增多、成交量的同
步上扬而消失,这种量增价跌现象是底部买入信号。

6、量缩价跌

量缩价跌主要是指个股(或大盘)在成交量减少的同时、个股的股价也同步下跌的一种
量价配合现象。量缩价跌现象既可以出现在下跌行情的中期,也可能出现在上升行情的
中期,但它们的研判过程和结果是不一样。

在上升行情中,当股价上升到一定高度时,市场成交量开始减少,股价也随之小幅下跌
,呈现出一种量缩价跌现象,而这种量缩价跌是对前期上升行情的一个主动调整过程,
“价跌”是股价主动整理的需求,是为了清洗市场浮筹和修正较高的技术指标,而“量
缩”则表明投资者有很强的持筹信心和惜售心理。当股价完成整理过程后,又会重新上
升。

在下跌行情中,当股价开始从高位下跌后,由于市场预期向坏,一些获利投资者纷纷出
逃,而大多数投资者选择持币观望,市场承接乏力,因而,造成股价下跌、成交萎缩的
量缩价跌现象。这种量缩价跌现象的出现,预示着股价仍将继续下跌。

上升行情中的量缩价跌,表明市场充满惜售心理,是市场的主动回调整理,因而,投资
者可以持股待涨或逢低介入。不过,上升行情中价跌的幅度不能过大,否则可能就是主
力不计成本出货的征兆。

下跌行情中的量缩价跌,表明投资者在出货以后不再做“空头回补”,股价还将维持下
跌方向,因而,投资者应以持币观望为主。

Tuesday, March 10, 2009

CHM Error

Resolution for end users

Warning If you are prompted to open or to save a .chm file from a Web site, you should do so only if you need the file and if you trust the Web site that is providing the file.

In the File Download dialog box, click Save, and then choose where you want to save the .chm file. Then, use one of the following methods:

Method 1

  1. Double-click the .chm file.
  2. In the Open File-Security Warning dialog box, click to clear the Always ask before opening this file check box.
  3. Click Open.

Method 2

  1. Right-click the CHM file, and then click Properties.
  2. Click Unblock.
  3. Double-click the .chm file to open the file.

Resolution for system administrators

To resolve this issue, use one of the following methods.

Use UNC file paths and file shares to link to .chm files

If your intranet Web page uses the HTTP URL scheme to link to .chm files, security update 896358 may prevent users from seeing topics in the .chm file. Replacing an HTTP file path with a UNC file path can make it possible again to open .chm files from the Web page.

To use a UNC file path instead of an HTTP URL, follow these steps:
  1. Put the .chm files on a file share server that can be addressed by using a UNC file path.

    A UNC file path looks similar to the following path:
    \\productmanuals\helpfiles
  2. Use the ItssRestrictions\UrlAllowList value to enable the systems in your intranet to access the .chm files from that file share.

    For more information, click the following article number to view the article in the Microsoft Knowledge Base:
    896054 (http://support.microsoft.com/kb/896054/ ) You cannot open remote content by using the InfoTech protocol after you install security update 896358, security update 840315, or Windows Server 2003 Service Pack 1
  3. Update the links on your intranet Web page to use UNC file paths in the URLs that link to the .chm files.
Note This method works only for pages that are served from the Intranet zone. This method does not work for pages that are served from the Internet zone.

Set up Web applications to download .chm files

On the Web page that links to .chm files, add instructions that advise the user to save the file instead of opening the file directly. For more information, see the "Resolution for end users" section.

You can also use the DownloadOptions tag to remove the Open button from the File Download dialog box that appears after a user clicks a link to the .chm file. Put this tag inside the tag of your HTML page. This usage is illustrated in the following example.




For more information, visit the following Microsoft Web site:
http://msdn2.microsoft.com/library/ms534184.aspx (http://msdn2.microsoft.com/library/ms534184.aspx)
Note The use of the DownloadOptions tag is supported only in Microsoft Windows XP with Service Pack 2 and in Windows Server 2003 with Service Pack 1.

Sunday, March 1, 2009

Word Shortcut Keys

©

Ctrl-Alt-C

®

Ctrl-Alt-R

Ctrl-Alt-T

Application window—maximize

Alt-F10

Application window—previous

Alt-Shift-F6

Application window—restore

Alt-F5

AutoFormat

Ctrl-Alt-K

AutoText—create

Alt-F3

AutoText—insert entry

F3

AutoText—insert entry

Ctrl-Alt-V

Bold

Ctrl-B

Bookmarks

Ctrl-Shift-F5

Break—column

Ctrl-Shift-Enter

Break—page

Ctrl-Enter

Browse a document

Ctrl-Alt-Home

Browse next/previous item

Ctrl-PgDn/PgUp

Case change (capitalization)

Shift-F3

Case—All Caps

Ctrl-Shift-A

Close

Ctrl-F4

Close

Ctrl-W

Copy

Ctrl-C

Copy formatting

Ctrl-Shift-C

Customize a menu

Ctrl-Alt =

Customize a shortcut

Ctrl-Alt-Num +

Cut

Ctrl-X

Date Field

Alt-Shift-D

Dialog box next tabbed section

Ctrl-Tab

Dialog box previous tabbed section

Ctrl-Shift-Tab

Document window—move

Ctrl-F7

Document window—restore

Ctrl-F5

Document window—size

Ctrl-F8

Drawing—constrain shape to symmetrical

Shift-drag

Drawing—draw from center

Ctrl-drag

Ellipsis

Ctrl-Alt- .

Em Dash

Ctrl-Alt-Num -

En Dash

Ctrl-Num -

Endnote

Ctrl-Alt-E

Exit application

Alt-F4

Fields—display code (toggle)

Shift-F9

Fields—display codes (toggle)

Alt-F9

Fields—double-click in field

Alt-Shift-F9

Fields—insert blank field

Ctrl-F9

Fields—lock a field

Ctrl-3

Fields—lock a field

Ctrl-F11

Fields—next field

F11

Fields—previous field

Shift-F11

Fields—unlink a field

Ctrl-6

Fields—unlink a field

Ctrl-Shift-F9

Fields—unlock a field

Ctrl-4

Fields—unlock a field

Ctrl-Shift-F11

Fields—update

Alt-Shift-U

Fields—update link in source

Ctrl-Shift-F7

Fields—update selected field

F9

Find

Ctrl-F

Font

Ctrl-D

Font Face

Ctrl-Shift-F

Font grow/shrink 1 pt.

Ctrl- ] or [

Font next/previous size

Ctrl-Shift- >or <

Font Size

Ctrl-Shift-P

Footnote

Ctrl-Alt-F

Go Back (3 maximum)Shift-F5

Go Back (3 maximum)

Ctrl-Alt-Z

GoTo

Ctrl-G

GoTo Next/Previous Paragraph

Ctrl-Up/Down

GoTo Next/Previous Word

Ctrl-Left/Right

Graphic—crop

Shift-drag

Graphic—original proportions

Ctrl-click

Hanging indent—decrease

Ctrl-Shift-T

Hanging Indent—increase

Ctrl-T

Hard hyphen -

Ctrl-Shift -

Hard space

Ctrl-Shift-spacebar

Header/Footer—link to previous

Alt-Shift-R

Heading Level 1

Ctrl-Alt-1

Heading Level 2

Ctrl-Alt-2

Heading Level 3

Ctrl-Alt-3

Help

F1

Help—What’s This?

Shift-F1

Hidden text

Ctrl-Shift-H

Hyperlink

Ctrl-K

Indent—decrease

Ctrl-Shift-M

Indent—increase

Ctrl-M

Insert Comment

Ctrl-Alt-M

Insert ListNum field

Ctrl-Alt-L

Italics

Ctrl-I

Justify—Center

Ctrl-E

Justify—Full

Ctrl-J

Justify—Left

Ctrl-L

Justify—Right

Ctrl-R

Line-spacing 1

Ctrl-1

Line-spacing 1.5

Ctrl-5

Line-spacing 2

Ctrl-2

List Bullet Style

Ctrl-Shift-L

Macros—edit

Alt-F8

Macros—view VBA code

Alt-F11

Mark—Index entry

Alt-Shift-X

Mark—TOA citation

Alt-Shift-I

Mark—TOC entry

Alt-Shift-O

Maximize window

Ctrl-F10

Menu Bar

F10

Merge—data edit

Alt-Shift-E

Merge—field insert

Alt-Shift-F

Merge—preview

Alt-Shift-K

Merge—to document

Alt-Shift-N

Merge—to printer

Alt-Shift-M

Microsoft Script Editor

Alt-Shift-F11

Microsoft System Info

Ctrl-Alt-F1

Move between master/subdocument

Ctrl-\

New document

Ctrl-N

Newline within paragraph

Shift-Enter

Next window

Ctrl-F6

Nonprinting characters on/off

Ctrl-Shift-8

Normal Style

Ctrl-Shift-N

Open a document

Ctrl-O

Outlining—collapse

Alt-Shift -

Outlining—collapse

Alt-Shift-Num -

Outlining—expand

Alt-Shift =

Outlining—expand

Alt-Shift-Num +

Outlining—move up/down

Alt-Shift-Up/Down

Outlining—promote/demote

Alt-Shift-Left/Right

Outlining—Show 1st line

Alt-Shift-L

Outlining—Show Heading 1

Alt-Shift-1

Outlining—Show Heading 2

Alt-Shift-2

Outlining—Show Heading 3

Alt-Shift-3

Outlining—Show Heading 4

Alt-Shift-4

Outlining—Show Heading 5

Alt-Shift-5

Outlining—Show Heading 6

Alt-Shift-6

Outlining—Show Heading 7

Alt-Shift-7

Outlining—Show Heading 8

Alt-Shift-8

Outlining—Show Heading 9

Alt-Shift-9

Outlining—Show All HeadingsAlt-Shift-A

Page number field

Alt-Shift-P

Pane—Close

Alt-Shift-C

Paragraph Space Above (add/delete 12 pt.)Ctrl-0 (zero)

Paste

Ctrl-V

Paste formatting

Ctrl-Shift-V

Print

Ctrl-P

Print Preview

Ctrl-Alt-I

Remove Character formatsCtrl-spacebar

Remove Character formats

Ctrl-Shift-Z

Remove menu item

Ctrl-Alt -

Remove Paragraph formats

Ctrl-Q

Repeat FindShift-F4

Repeat Find

Ctrl-Alt-Y

Repeat/Redo

Ctrl-Y

Replace

Ctrl-H

Revision Marks on/off

Ctrl-Shift-E

Save

Ctrl-S

Save AsF12

Select All

Ctrl-A

Selection extended

F8

Selection reduced

Shift-F8

Shortcut Menu

Shift-F10

Small Caps

Ctrl-Shift-K

Soft hyphen -

Ctrl -

Spelling and Grammar check

F7

Spell-It—display next misspelling

Alt-F7

Spike—cut to

Ctrl-F3

Spike—paste

Ctrl-Shift-F3

Split a window

Ctrl-Alt-S

Style box

Ctrl-Shift-S

Subscript

Ctrl =

Superscript

Ctrl-Shift =

Symbol Font

Ctrl-Shift-Q

Table—remove border lines

Ctrl-Alt-U

Table—to column bottom

Alt-PgDn

Table—to column top

Alt-PgUp

Table—to row beginning

Alt-Home

Table—to row end

Alt-End

Thesaurus

Shift-F7

Time Field

Alt-Shift-T

To bottom/top of screen

Ctrl-Alt-PgDn/PgUp

Underline

Ctrl-U

Underline—double

Ctrl-Shift-D

Underline—word

Ctrl-Shift-W

Undo

Ctrl-Z

View—Normal

Ctrl-Alt-N

View—Outline

Ctrl-Alt-O

View—Page

Ctrl-Alt-P

Window pane—next

F6

Window pane—previous

Shift-F6

Wednesday, February 11, 2009

ssh/scp without password

Whenever you need to use scp to copy files, it asks for passwords. Same with rsync as it (by default) uses ssh as well. Usually scp and rsync commands are used to transfer or backup files between known hosts or by the same user on both the hosts. It can get really annoying the password is asked every time. I even had the idea of writing an expect script to provide the password. Of course, I didn't. Instead I browsed for a solution and found it after quite some time. There are already a couple of links out there which talk about it. I am adding to it...

Lets say you want to copy between two hosts host_src and host_dest. host_src is the host where you would run the scp, ssh or rsyn command, irrespective of the direction of the file copy!

  1. On host_src, run this command as the user that runs scp/ssh/rsync

    $ ssh-keygen -t rsa

    This will prompt for a passphrase. Just press the enter key. It'll then generate an identification (private key) and a public key. Do not ever share the private key with anyone! ssh-keygen shows where it saved the public key. This is by default ~/.ssh/id_rsa.pub:

    Your public key has been saved in /.ssh/id_rsa.pub

  1. Transfer the id_rsa.pub file to host_dest by either ftp, scp, rsync or any other method.

  1. On host_dest, login as the remote user which you plan to use when you run scp, ssh or rsync on host_src.

  2. Copy the contents of id_rsa.pub to ~/.ssh/authorized_keys

    $ cat id_rsa.pub >>~/.ssh/authorized_keys
    $ chmod 700 ~/.ssh/authorized_keys

    If this file does not exists, then the above command will create it. Make sure you remove permission for others to read this file. If its a public key, why prevent others from reading this file? Probably, the owner of the key has distributed it to a few trusted users and has not placed any additional security measures to check if its really a trusted user.

  1. Note that ssh by default does not allow root to log in. This has to be explicitly enabled on host_dest. This can be done by editing /etc/ssh/sshd_config and changing the option of PermitRootLogin from no to yes. Don't forget to restart sshd so that it reads the modified config file. Do this only if you want to use the root login.

Well, thats it. Now you can run scp, ssh and rsync on host_src connecting to host_dest and it won't prompt for the password. Note that this will still prompt for the password if you are running the commands on host_dest connecting to host_src. You can reverse the steps above (generate the public key on host_dest and copy it to host_src) and you have a two way setup ready!

Thursday, February 5, 2009

Tuesday, February 3, 2009

root password

Ubuntu Default Root Password or the sudo way

The first time I installed Ubuntu on a computer, I was rather used to debian and went through the whole install process easily.

When I rebooted my system and open a text-console, my first action was to su - in order to gain root's grants. What a surprise when I was promted for a password. Damn, What was it?!?

Through the installation process, I was asked to enter a username, I entered my usual username, type and confirmed my password, but I was never asked to enter the super-user root's password!?!

On a usual debian install, you are actually asked for root password and eventually you may want to create a first normal user(which is actually safer).

Ubuntu being a bit more user friendly, thought it was easier for the user to be promted for his password when he wants to do administration actions such as installing software, updating the system... To do this, ubuntu uses the sudo package which allow a user to gain root access for an action. In order to make sure that the user in front of the computer is actually the real user (not somebody using your access), the user is prompted for his password.

In Ubuntu, by default, there is not really a root user, but only root access which can be gained using sudo, for instance, to update your repository list:

:~$sudo apt-get update

Root is created without predefined password, it does not have a password, but it does not have an empty password either, you just can't login!!!

I actually like to be logged as root when I've got many this to do. I find sudo usefull when only one or two actio are to be done, but when doing administration task, typing sudo all the time just drive me cray :).

One way to gain root prompt is to launch a shell as root. Therefore, using sudo you can type:

:~$ sudo sh
Password:
sh-3.1#

And there you are, you have a root shell.

If you want to be able to login as root, you need to define a password for root:

:~$ sudo passwd
Password:
Enter new UNIX password:
Retype new UNIX password: