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 –







– END –


Printing Python code in LaTeX

LaTeX does not support printing Python code with useful markup and format out of box.

This page links to the minted package, which provides a ready-for-use package for CTAN and LaTeX.

This page gives a minimal implementation (only some customization in .tex file, no packages) for marking Python code.

This is a black-and-white version. I don’t use it.


– END –


How to debug small programs

Nice article on basic programming. Those who are serious on writing code should be able to debug their own code, rather than to have their code debugged.

Fabulous adventures in coding

One of the most frequent categories of bad questions I see on StackOverflow is:

I wrote this program for my assignment and it doesn’t work.
[20 lines of code].

And… that’s it.

If you’re reading this, odds are good it’s because I or someone else linked here from your StackOverflow question shortly before it was closed and deleted. (If you’re reading this and you’re not in that position, consider leaving your favourite tips for debugging small programs in the comments.)

StackOverflow is a question-and-answer site for specific questions about actual code; “I wrote some buggy code that I can’t fix” is not a question, it’s a story, and not even an interesting story. “Why does subtracting one from zero produce a number that is larger than zero, causing my comparison against zero on line 12 to incorrectly become true?” is a specific question about…

View original post 1,348 more words