Archive for category 计算机与 Internet

Microsoft PowerPoint: Convert and Replace Image to PNG Format

The following procedures are written according to and tested under PowerPoint 2010 (14.0.7182.5000 64-bit, Office Professional Plus)


Image could take a substantial storage space in a PPT file. We can replace EMF format images with compressed PNG or any other desired format.

Solution 1:

This could easily be achieved by the following steps:

  1. Right click on picture, select ‘Save as Picture’. In the dialog box, select desired picture format and save the picture.
  2. Import the picture by either copy-and-paste or going to ‘Insert’ tab -> ‘Images’ group -> ‘Picture’.
  3. Remove the old one and place the new one to the right location.

Solution 2:

When the amount of task gets large, it is better to use macro.

  1. Add macro functionality to the current presentation.
    1. Go to ‘Customize Ribbon’ (Right click on Ribbon, select ‘Customize the Ribbon’).
    2. On the right side of the window, under ‘Customize the Ribbon’, locate and check the ‘Developer’ tab.
    3. Click ‘OK’.
    4. In main window, switch to ‘Developer’ tab. Click ‘Macros’ in the ‘Code’ group.
    5. In the ‘Macro’ dialog box, fill the Macro name as ‘ConvertShapeToPNG’ and click the ‘Create’ button.
    6. In the VBA window, fill in the newly added macro with the code attached at the end of this post.
    7. Close the VBA window, and go back to the main window of slides.
  2. (Optional) Save the slides including the macro. Due to security limitations, the slides has to be saved into a macro-enabled file.
    1. Click ‘Save’, and a prompt saying that you have to save the file as a macro-enabled file type.
    2. Click ‘No’ to refuse to save it as  a macro-free presentation.
    3. Follow the aforementioned instruction to save the file.
    4. (After editing) When done, save the file as macro-free presentation by changing back the file format in ‘Save as’ dialog. Answer ‘Yes’ to the question and the macro is automatically removed.
  3. Add a button in the Ribbon for the macro.
    1. Go to ‘Customize Ribbon’ (Right click on Ribbon, select ‘Customize the Ribbon’).
    2. On the right side of the window, in ‘Choose commands from’, select ‘Macros’. The macro we just added should show up below.
    3. Under ‘Customize the Ribbon’, click ‘New Tab’ and rename the new tab and group as desired.
    4. Drag the macro from the left to the new group.
    5. Click ‘OK’ and return to the main window.
  4. In the slide, select a single picture that you wish to convert. Click the Ribbon button for the macro, and see the change.



Stack Exchange: How to convert multiple embedded PNGs to JPEGs in Powerpoint file?

Stack Overflow: Convert internal images in powerpoint to one format


(Click “阅读更多” below to get the code)

阅读更多 »



How Nvidia breaks Chrome Incognito | charliehorse55

Summary: Video card makers don’t like erasing G-RAM buffers before handing them over to other applications, because they think that would significantly slow down the performance. Application developers don’t like erasing the buffers before returning them back to GPU, since they think it would not be their job. After all, users have to do their own cleaning job.
Well done, another industry standard.


Chrome OS: Entirely disable mouse accelaration


Chrome OS is light weighted. That means users have few options to customize it into forms suitable for themselves.

One of the missing features is disabling mouse accelaration. Under current design, user can only adjust “mouse pointer speed” in the Settings page. No accelaration adjustment. Accelaration is meaningful for touchpads. But for external mice, it’s awkward. At least true to me.

In older versions of Chrome OS, one can find a way to disable accelaration by typing xset m 0 in the terminal console. In later updates, xset is deprecated with no successor at all.

With the latest beta channel update, it’s possible to achieve that again. But the command becomes much more complicated.

That’s the way Google makes simple life not simple.

inputcontrol –mouse_custom_point_accel=\
inputcontrol –use_mouse_custom_point_accel=1

Note: the “4” in the second line is the linear speed that you may want to change. With the last line of command, Chrome OS will pick up user definition of mouse accelaration, ignoring the “mouse speed” option in the Settings page.


Reference – Issue 359288: Find the holy grail of mouse acceleration curves


– END –


Windows – Run Google Drive client in desired language

Put the following commands into a .cmd batch script, and run.


set LANG=en_US
cd /d “C:\Program Files\Google\Drive”
start “” googledrivesync.exe


You can change the value of variable LANG to any other one as your desire.

Reference –

Google Product Forums – Google Drive client localized, can I have it in english instead


BTW I found Google’s Drive client for Windows is pretty nasty, since it doesn’t support NTFS junction / symbol link folders. A few more discoveries show that Google has deliberately banned the support for this low-level function, provided by the OS, by actively detecting whether a folder is a junction / symbol link. Maybe there’s good reasons not to do it, but clearly Dropbox has not found why. Or it might just be another awesome bug that Google has fixed by removing the entire feature.


– END –


Ubuntu – Clear screen in shell

This belongs to my collection of life tricks.

To clear the screen, type this command in bash:


printf “\ec”


Reference –

Stack Overflow – Clear the Ubuntu bash screen for real


– END –


Update: (Solved) Windows Live Writer removing EXIF data in uploaded photos

Six months ago I noticed this problem, which removes your photo’s EXIF data silently while uploading them to WordPress. Now I solved it.

The reason to my particular case is that, I have been using watermarks on photos, before I noticed this feature removes EXIF data and therefore stopped using it. However, simply removing text string in “Watermark” setting does not stop Windows Live Writer from putting watermarks onto the pictures. In fact, if you clear the text string after using this feature, it will put BLANK watermark on your photos.

The reason why WLW’s features such as watermarks, resizing, framing, etc stripe EXIF data is, IMO, that it uses some old-fashioned JPEG codec library (DLL file) which does not support EXIF processing. I can remember there used to be an Intel JPEG Library DLL file inside Live Writer’s installation folder. Althogh now the standalone file is gone, and I guess it is using some newer version of it and includes the library in its own, WLW still fails to handle EXIF properly.

In this post, the author also discovered that framing (adding borders to) the phoros also removes EXIF. It’s interesting that the article was posted no sooner than I visited, when I also found this issue of WLW. But at that time I thought that article did not help. But now, re-visiting this post, with a flash in my head I knew what is going on.

Anyway, here’s your solution.


The idea is you have to remove all picture effects provided by Windows Live Writer. In the above example, simply leaving the watermark string blank does not help, because WLW will put a blank watermark then. You have to remove, from its default settings, the “watermark” entry entirelly. This involves system registry operations, so use with caution.

  1. Close Windows Live Writer properly. Launch regedit.
  2. Go to registry location: HKCU\Software\Microsoft\Windows Live\Writer\Weblogs. In this key, you can see all the blogs that are managed by WLW. Double click to open a blog, then you will see a subkey called ImageDefaults
  3. Under this subkey, there are several items to be modified.  In this subkey, a value called Decorators contains all the picture effects to be deployed upon newly added pictures. Remove “Watermark” and the proceeding single comma and white space in the text.
  4. Under this subkey, remove subkey Watermark.
  5. Make sure you haven’t done anything other than the above 3 steps, otherwise you might have damaged your system, and I don’t bear the responsibility. Now you can close Registry program.
  6. Re-launch WLW and you should see changes on new-added photos. Older photos, especially those you have posted already, won’t get changed at all. You have to delete and re-insert all the photos in draft posts in order to keep EXIF during uploading.

Conclusion: This method at least solves the particular problem that Watermark feature removes EXIF data in photos, and even though you stop using Watermark feature by clearing the watermark text, it continues removing EXIF because it then leaves blank watermark. The reason why watermark, as well as many picture effects, removes EXIF is that WLW uses a JPEG codec library which does not support EXIF processing.

– END –


Paste unformatted text with MathType installed in Word 2003

(原创文章,转载注明出处)安装 MathType 后,在 Word 2003 中使用无格式粘贴

Word 2003 provides an easy way to delete the “format” or “style” of a newly pasted text, by clicking a small button besides the pasted block. By selecting from the opened menu you can decide whether the pasted text should maintain its style as in where it comes from, or become adapted to the style in the target document, or drop all the styles.

But you may not find this pop-up button after pasting, even if you have “Tools -> Options -> Edit -> Show Paste Option” checked, if you have MathType installed. Actually the button’s appearance has been suppressed due to a series of MathType’s macro executions. There’s no solution except you uninstall MathType or upgrade it to version 6.7.

If you want to paste the text without its format, when you cannot get rid of old versions of MathType, here are some solutions.

  1. Paste the text to notepad at first, then select the text in notepad and copy them to clipboard, then paste them into Word. Note that this will replace all non-character objects (images, equations, etc.) with a white space. Hyperlinks are also removed.
  2. In Word, go to menu “Edit -> Selective Paste” and then choose “Plain text” in the pop-up box. Objects will be removed too.
  3. Paste the text WITH style first, then hit menu “Edit -> Clear -> Clear Formats”. Objects will be kept, so you can use this method to deal with picture-containing texts. However, this will bring the styles into the style list of your editing documents. This may ruin your work (often drives me crazy!) if you are making a nicely styled layout. A compromise between way 1,2 & 3 is made by pasting the text into a new separate Word document first, while keeping images and styles, then clear its format in Word, and then paste the unformatted text into the target document. This action should prevent style contamination to your main document.
  4. A macro can help you to paste text more quickly. Refer to this post to establish the working environment. Note that you should allow macro to run before using this method, so it may be unfeasible if macro is disallowed. I set ctrl+shift+v as its shortcut key and it works really well. But this action will also remove the objects.

To make a comparison, only way 3 will keep all the images or other “objects” while pasting, but it’s pretty awkward. All other 3 will only paste characters, but you can do it fast (way 4).

You may ask why I don’t use Word 2007 or 2010? Newer versions are more and more hard to use. Microsoft declares it’s making their GUI more friendly and convenient, but NO!!!