Thursday, October 29, 2015

Convert .ogv files to .mp4 without losing quality in Ubuntu

Hey

There are two methods to achieve this.


  1. Type the following: avconv -i my-video.ogv -c:v libx264 -preset veryslow -qp 0 -vf scale="1280:trunc(ow/a/2)*2" -c:a libmp3lame -qscale:a 3 -ac 2 my-video.mp4
  2. Use vlc media player:
  • go to "Media" -> "Convert/Save" -> "File" and then add your file
  • Press "Convert/Save" and choose "Video H.264 + mp3 (mp4)"

Cheers !!!

Wednesday, June 17, 2015

Open files with different encoding (like Shift-JIS) in Visual C++

Hey,

If you happened to be in Japan and need to go through comments which are written in Japanese for some of your Visual C++ projects, then you may also have encountered that the comments are not displayed properly.

The reason is that the files are opened with different encoding; not in Shift-JIS.

To resolve this issue,
- in the "Solution Explorer", right click on some file and choose "Open with"
- in "Choose the program you want to use to open this file", select "C++ Source Code Editor (with encoding)" at set it as default.
- in next popup, choose "Japanese (Shift-JIS) - Codepage 932"and press OK

If the comments are still not visible, you may want to choose a different encoding scheme until you get it right.

PS
I am using Visual Studio 2013 Professional Edition

Cheers!

Wednesday, March 11, 2015

Importing LaTeX equations to MS Word

Hey,

This is how it is done.
The credit should go to original contributor at [here]


  • Let's assume your equation is x=y+z
  • Create the following .html file using your favorite text editor and insert the equation between $$ marks.


<!DOCTYPE html>
<html>
<head>
<script type="text/javascript"
  src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<title>tex texample</title>
</head>
<body>

$$x=y+z$$

</body>
</html>
  • View that in a web browser, right click and select "show MathML as/MathML Code"
  • Select all and copy it into your favorite text editor in a new document.
  • Add <?xml version="1.0"?> at the beginning and again copy everything.
  • Paste it in MS Word and there you have your equation.