搜尋此網誌

2018年12月28日 星期五

12 Tips to Speed up Windows 7

https://www.pcmag.com/feature/251692/12-tips-to-speed-up-windows-7

11. Don't Use a Beautiful Desktop Background

Personalize - Desktop Background - choose a solid color (e.g. Black).

12. Turn Off Aero Effects

Control Panel - Performance Information and Tools - Adjust Visual Effects - Adjust for Best Performance (this will turn off everything).

2018年1月28日 星期日

Convert UTF-16LE to UTF-8

Jack Jr. reported an interesting problem: Under manager@ms14:www/secure, he tried to add an RCS keyword $Date$ to index.htm, hoping that RCS will automatically update the modified time. 
However, it did not work. The string was not replaced. What puzzles him is, when he created a new file for testing, everything works fine.

Let us inspect the checked-out index.htm file. When you edit it by vim, on the status line you see "[converted][dos]". The message "[dos]" simply indicates that this file was created in DOS/Windows environment, where newline characters in text files consists of CR+LF (\015\012). On the contrary, in Unix newline characters are a single LF. However, this is not the cause which prevented RCS to work properly.

Let's inspect the contents of index.htm, with a better tool. 工欲善其事,必先利其器. You may use the "dump.cpp" program you developed in the VoIP class, which we adopted to inspect WAV files. You may also use a Unix command "od -t x1 index.htm" to inspect each byte. Now you should see the problem. Each character is stored as two bytes. The ASCII code of the string "Date" is "44 61 74 65", but it was stored as "44 00 61 00 74 00 65 00". That's why RCS failed to recognize this keyword.

By inspecting the beginning of the index.htm file, we see "FF FE", which is BOM (byte order mark, https://en.wikipedia.org/wiki/Byte_order_mark). By checking some article (https://unix.stackexchange.com/…/process-a-file-that-starts…) we learned that this indicates that the file is encoded in UTF-16, little endian!

So the solution should be simple. We need to convert this file from UTF-16LE to UTF-8. Let's type the command "mv index.htm index.bak; iconv -f UTF-16LE -t UTF-8 index.bak > index.htm". 

Before we check-in the new UTF-8 file, please inspect its size. You can see that its size is almost half of the UTF-16 file. Now check in and check out index.htm. The converted file works fine with RCS keywords now.


2017年8月22日 星期二

Linux Hostname Configuration

Reference: https://jblevins.org/log/hostname

In CentOS, add a line "HOSTNAME=gauss" in /etc/sysconfig/network.

2017年4月12日 星期三

[Excel] Freeze panes to lock rows and columns

https://support.office.com/en-us/article/Freeze-panes-to-lock-rows-and-columns-dab2ffc9-020d-4026-8121-67dd25f2508f
  1. To lock more than one row or column, or to lock both rows and columns at the same time, move your cursor to the first scrolling cell (i.e. your cursor is below the rows you want to freeze and to the right of any columns you want to freeze).
  2. Then choose the View tab, and then click Freeze Panes. 

2016年9月11日 星期日

Change the default application associated with an extension file name

https://support.microsoft.com/en-us/help/18539/windows-7-change-default-programs

Start - "Default Programs" - Associate a file type with a program.

2015年1月24日 星期六

Reset your Firefox Master Password if you've forgotten it

Reset your Firefox Master Password if you've forgotten it

  1.  In the Firefox location bar, enter the following location: chrome://pippki/content/resetpassword.xul
  2. Press Enter.
  3. The "Reset Master Password" page will appear. Click the Reset button, to reset your master password.  

2014年12月25日 星期四

How to create numbered headings or outline numbering in Word 2010

How to create numbered headings or outline numbering in Word 2010

  1. Set up your Heading paragraph styles
    • Modify the Heading 1 style so that it is based on "No style". Modify Heading 2 so it's based on Heading 1. Modify Heading 3 based on Heading 2. And so on. Not everyone does this, but I find it useful because of the way the formatting of Word's styles cascade.
    • Now, modify the Paragraph settings (Format - Paragraph - Indent) of every Heading style so that the Left Indent is 0. Do this even if you want your headings to be indented from the left margin, and even if you want a hanging indent. Why? Because for outline-numbered styles, we will set the paragraph indent and the hanging indents (if any) when we set up the numbering.
  2. Create a list style
    • on the Home tab, in the Paragraph group, click the Multilevel list menu and choose Define New List Style (not "Define New Multilevel List") at the bottom.
    • In the Define New List Style dialog (Figure 2), do (only) two things:
      1. Give your list style a name.
        Hint: Give it a plural name. That makes it clear that this is a list style that's controlling more than one paragraph style. And, give it a name directly related to the paragraph styles you're going to use. We're going to use paragraph styles Heading 1, Heading 2, Heading 3 etc. So I suggest that you name the list style as Headings.
      2. On the Format menu, click Numbering.
    • We're now in the Modify Multilevel List dialog box (Figure 4). The list style is the coordinating mechanism for the whole "set" of paragraph styles we'll use. So we set up all levels of numbering in this one dialog box.
    • To set up the numbering:
      1. In the Modify multilevel list dialog, click the More button.
      2. Attach the Heading paragraph styles to the 9 levels in the list style. To do that:
        1. In the 'Click level to modify' list, select level 1. In the 'Link level to style' box, choose Heading 1. That attaches paragraph style Heading 1 to level 1 of the list style.
        2. In the 'Click level to modify' list, select level 2 and attach style Heading 2. And attach Heading 3 to level 3, Heading 4 to level 4 and so on.
      3. Now we tell Word about the numbering itself for Level 1
        1. In the 'Click level to modify' list, click level 1.
        2. Delete anything in the 'Enter formatting for number" box.
        3. If you want the numbering to start with some text (eg to number a paragraph as "Chapter 1" or "Section 1") then enter the text including any space in the 'Enter formatting for number' box. Leave the insertion point after your text.
        4. From the Number style for this level list, choose the kind of numbering you want.
      4. Set up numbering for levels 2 to 9.
        1. In the 'Click level to modify' list, choose Level 2.
        2. Delete anything in the 'Enter formatting for number" box.
        3. If you want to include a previous level's numbering, then use the 'Include level number from' box. If you want punctuation after each level, add it into the 'Enter formatting for number' box as you go. For example, for Level 2, I might want the numbering to be "1.1". That is, I want the Level 1 number and the Level 2 number. So, from the 'Include level number from' box, I choose 'Level 1'. Then I type a full stop (full point, period, whatever). Then I choose from the 'Number style for this level' box.
      5. Next, set up the indents: how far in from the left margin do you want the different levels to appear? The default indents are actually quite reasonable. If you prefer to change them, then you have two choices. The easy way is to click the "Set for all levels" button.
      6. OK, OK back to your document.
    • To apply the Heading styles to your text
      1. click once within a paragraph, or select text from two or more paragraphs
      2. on the Home tab, click the thumbnail for the Heading 1 style  (or, for keyboard junkies, use Ctrl-Alt-1, which is the built-in keyboard shortcut for applying style Heading 1).