Wednesday, September 3, 2008

How to Rip a DVD into AVI

For future reference, I am making this post to remind myself how to backup my DVDs, especially after my hard drive crashed last week. This method is based on this excellent post.

The idea is to backup or rip a DVD into an AVI. Here's what you need first
  1. Download DVD Decrypter
  2. Download Auto Gordian Knot
As discussed in the original post, DVD Decrypter will remove any encryption that is embedded into the DVD.

Auto Gordian Knot, aka AutoGK, is a set of tools that will allow you to convert the decrypted DVD into an AVI. Don't worry, AutoGK has a single GUI where you specify the parameters for your conversion.

After installing DVD Decrypter and AutoGK, do the following
  1. Open DVD Decrypter
  2. Go to: Mode/IFO


  3. In the information files list to your right, select the item that is the longest in case of a movie. In case of TV show, select the episode of interest.


  4. Select the folder location of your decrypted DVD

  5. Finally, click on the decrypt button (with the green arrow)
Depending on the length of your DVD/episode and your platform, it usually takes less than 30 minutes to rip a 150 minutes DVD. When the decryption process in complete open up AutoGK and do the following
  1. For your input file, choose the first VOB file in the extracted directory
  2. Set the name and location of the output AVI
  3. Select the first audio track
  4. Select a subtitle (if any)
  5. Select the output size. Usually, a 120 minutes DVD converts well to 700 MB. For 30 minute TV episodes, I would choose 175 MB while for a 1 hour episode, i would choose 350 MB. Alternatively, you can set the quality percentage. I find this the fastest way as AutoGK will perform a single pass. I usually keep this setting at around 65%
  6. Click on advanced settings and choose Xvid and set the audio to VBR MP3 at 128 kbps . Note that you may need to download XviD (or DivX)
  7. Click on add job
  8. Click start
Voila!

Cite as:
Saad, T. "How to Rip a DVD into AVI". Weblog entry from Please Make A Note. https://pleasemakeanote.blogspot.com/2008/09/how-to-rip-dvd-into-avi.html

Monday, September 1, 2008

How to Post Math Equations in Blogger using ASCIIMathMIL

I know that most of us working directly with mathematics are looking for a fundamental solution to posting equations on blogger. So far, I would have my equations written in MathType, print the screen, paste, crop, and save in paint. It is a pain... a dual monitor setup would be helpful, nonethless, this is too much to go through.

I've seen several models over the net that provide different solutions, but none of them was what I was looking for, especially that I am not a LaTeX guru.

So far, the neatest model to post equations on blogger is described on Fundamental Thinking. The method uses Peter Jepsen's ASCIIMathML script.

Here's how to set it up on your blog:

  1. Download ASCIIMathML.js and host it somewhere online such as your google pages website. This will allow you to modify the script to fit your needs (like changing the forecolor of the equations). Alternatively, you can just point to the location of the script (http://www1.chapman.edu/~jipsen/mathml/ASCIIMathML.js)
  2. In Blogger, add a new HTML/Java Script widget
  3. Add the following to the new widget
    <script src="http://www1.chapman.edu/~jipsen/mathml/ASCIIMathML.js" type="text/javascript"></script>
    (In case you decided to host the script on your own website, you will need to replace src with the correct location).
Voila!

Now you're all set. All you need to to do is either learn the ASCIIMathML syntax, type in LaTeX, or copy from Mathtype as LaTeX.

To type in LaTeX, you have to wrap your equations with a dollar sign.

Alternatively, you can use some online LaTeX editors such as Thornahawk's Numerical Analysis notes or CodeCogs', and then copy and paste the code into your post.

Finally, if you use MathType, you can set it up so that it copies the equations as LaTeX. Here's how you do it
  1. In Mathtype, go to
    Preferences/Translators
  2. Select "Translation to other language"
  3. Select "TeX -- LaTeX 2.09 and later"
  4. Deselect "include MathType data in translation"
Make sure you replace the \[ and \] generated by MathType by the dollar sign.

This, I think, is by far the easiest way of getting your equations into blogger. Sometimes, the translation generated by MathType is not well interpreted by the ASCIIMathML script. For example, type the following in MathType

$\lim_{x\rightarrow 0}$

This will not be translated correctly with the ASCIIMathML.

After all this, I think we need a better solution.


UPDATE: As Bob Mathews from design science (the makers of MathType) has kindly noted, if you choose the Format/Inline Equation in MathType, the LaTeX code will exclude the \[ and \] symbols.

Cite as:
Saad, T. "How to Post Math Equations in Blogger using ASCIIMathMIL". Weblog entry from Please Make A Note. https://pleasemakeanote.blogspot.com/2008/09/how-to-post-math-equations-in-blogger.html

How to Change the Manufacturer/OEM/Computer Logo in System Properties

In Windows Vista, there's usually a logo in the system properties (right click "My Computer"/Properties) that refers to the manufacturer of your machine. The original post can be found here. This can be easily changed by modifying the registry. Here's how
  1. Create your own logo and save it as a bitmap (*.bmp) - Make sure the size is 120x120 pixels
  2. Open the registry editor (click Start/regedit)
  3. Go to:
    HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ OEMInformation
  4. Modify the "Logo" entry &/ the "Manufacturer" entry
Voila!

Note that the "&/" symbol stand for "and, or".

Cite as:
Saad, T. "How to Change the Manufacturer/OEM/Computer Logo in System Properties". Weblog entry from Please Make A Note. https://pleasemakeanote.blogspot.com/2008/09/how-to-change-manufactureroemcomputer.html

Wednesday, August 27, 2008

How to hyperlink to a specific page in a pdf file

I was working on my new website today and in one section, I needed to hyperlink to a magazine's pdf file over the internet. However, I was only interested in linking to an article in that magazine that starts on page 38. Can this be done? Yes!!! Here's how:

http://www.somewebsite.com/somePDFFile.pdf#page=page-number
Voila!

In my case, the link read something like

http://www.somewebsite.com/somePDFFile.pdf#page=38

Cite as:
Saad, T. "How to hyperlink to a specific page in a pdf file". Weblog entry from Please Make A Note. https://pleasemakeanote.blogspot.com/2008/08/how-to-hyperlink-to-specific-page-in.html

Thursday, August 7, 2008

An Easy Way to Remember the Navier Stokes Equations

[I have written parts of this article in 2005 on the CFD-Wiki website. Here's the original article]

Most of those working closely to fluid dynamics are very familiar with the Navier-Stokes equations and most likely have a clear idea of how they look like (i.e. they can write them down on paper with no need to look through a reference book). I am not one of those people yet, at least most of the time especially in spherical or cylindrical coordinates - unless written in vector form.

When I was an undergraduate student, looking at the NS equations was as confusing as I would feel when I walk in a huge mall with hunderds of people around. Of course, these equations require familiarity and in depth knowledge before they get fixed in your brain. So, I was looking for a way to "understand" these equations rather than memorize them. Eventually, after seeing them a lot of times, I figured out a way to understandably memorize the NS equations. The essential ingredient is, of course, the physics that each term represents. Once you understand the physics, it is a piece of cake to put the equations together. Moreover, there was a more fundamental process going on behind the scenes. This corresponds to the fact that all differential equations that govern heat, mass, momentum, chemcial reactions, energy.... have exactely the same form! This is where I will start, and here, I follow Patankar's superb insights into the problem [1].

Conservation

The most fundamental law of physics is that of conservation. Any quantity is conserved. Of course, these quantities can change form or transform (i.e. a chemical reaction), but they are still conserved. A differential equation expresses such a conservation principle. Each term in the differential equation represents a physical mechanism through which the conserved quantity evolves. Such terms include for example a chemical source term where extra species are either created or used up to proceed with the reaction. For generality, we shall pick a dummy physical quantity and call it phi. It can be the temperature, the velocity, the concentration, the density, the electric field etc...

Three Mechanisms


There are three mechanisms that the terms in a differential equation usually describe;
  1. Accumulation
  2. Convection
  3. Diffusion
All you need to do is remember these as well as their mathematical form. Of course, you need to understand these mechanisms as well. Remembering and understanding go hand in hand :)

The accumulation or transient process accounts for the temporal rate of change of the a given quantity within an infinitesimal volume. This will have the form


The convection process accounts for the transport of the quantity due to any existing velocity field. This term is almost always described by a first derivative multiplied by a velocity. Convection occurs at the macro level and it is the source of nonlinearity in the NS equations.


Finally, the diffusion process describes the tranport of the quantity due to the presence of any gradients of that quantity. This happens at the molecular level. By itself, diffusion is a linear process provided the diffusion coefficient is a constant.

(Eq. 3)

where Gamma is called the diffusion coefficient. This is equivalent to the thermal conductivity in conduction heat transfer, which is a diffusion process.

Notice that several simplifications may be made to the forms given above when certain properties hold. For example, when compressibility effects are negligible, one may extract the density outside the differential operators.

The Source Term

In certain cases, there are terms that cannot be cast into the transient, convective, and diffusive terms. These are then lumped into what is a called a source term. For example, the gravitational effects, the pressure gradient, and any other body forces are part of the source term in the Navier-Stokes equations.

The Generic Scalar Transport Equation


The universality of the three mechanisms discussed above makes it possible for us to construct a general differential equation that describes the conservation principle of a quantity. Note that the placement of the terms comes from the fundamental principles of deriving the conservation equations, i.e. transient and convective terms should balance diffusive and source terms. Therefore, some signs in the source terms may need to be modified as the source terms is always placed on the right hand side of the equation. Here it is

(Eq. 4)

Voila!

Eq. 4 can now be specialized to any process in the realm of heat, mass, and momentum transfer. For example, to obtain the continuity equation (for compressible flows) set phi = 1. Since diffusion is not present and in the absence of sources set those to zero to obtain


To obtain the energy equation for an incompressible fluid, and in terms of the temperature, simply set phi = T to obtain


Note that you can divide by the density of course. But I kept the above form so that it matches the generic equation.

Now for the Navier-Stokes equations, we replace phi by one velocity component at a time (remember, that the velocity components are also quantities and in this case their momentum is conserved). Let us consider a cartesian coordinate system and start with the axial velocity component. By replacing phi with u, and setting the appropriate form for the source term, we get


similarly, for the other coordinate directions, replace u by v and w respectively. The most subtle part is of course figuring out the source term. So if you just remember that typically the body forces in a fluid problem are those arising from the pressure and gravity, then the rest should be easy.

REFERENCES
[1] Patankar, S. V., Numerical Heat Transfer and Fluid Flow, Hemisphere, Washington, D.C., 1980.

Cite as:
Saad, T. "An Easy Way to Remember the Navier Stokes Equations". Weblog entry from Please Make A Note. https://pleasemakeanote.blogspot.com/2008/08/easy-way-to-remember-navier-stokes.html