Rotate video with ffmpeg command

On Linux, you should have ffmpeg tool and libraries installed on your system.

Original post here:

Rotate 90 clockwise:

ffmpeg -i in.mov -vf "transpose=1" out.mov

For the transpose parameter you can pass:

0 = 90 Counter CLockwise and Vertical Flip (default) 
1 = 90 Clockwise 
2 = 90 Counter Clockwise 
3 = 90 Clockwise and Vertical Flip

TCP handshake (connection setup)

From original post:

Establishing a normal TCP connection requires three separate steps:

Tcp-handshake.svg

  1. The first host (Alice) sends the second host (Bob) a “synchronize” (SYN) message with its own sequence number x, which Bob receives.
  2. Bob replies with a synchronize-acknowledgment (SYN-ACK) message with its own sequence number y and acknowledgement number x + 1, which Alice receives.
  3. Alice replies with an acknowledgment message with acknowledgement number y + 1, which Bob receives and to which he doesn’t need to reply.

Additional image (in more details):

3whs

Confidence Interval

Basic steps for calculating Confidence Interval (CI): (Wikipedia)

The basic breakdown of how to calculate a confidence interval for a population mean is as follows:

  1. Identify the sample mean, \bar{x} . While \bar{x} differs from \mu, population mean, they are still calculated the same way: \sum {x_i \over n} .
  2. Identify whether the standard deviation is known, \sigma, or unknown, s.
    • If standard deviation is known then z* is used as the critical value. This value is only dependent on the confidence level for the test. Typical confidence levels are:[24]
99% 2.58
95% 1.96
90% 1.64
    • If the standard deviation is unknown then t* is used as the critical value. This value is dependent on the confidence level (C) for the test and degrees of freedom. The degrees of freedom is found by subtracting one from the number of observations, n-1. The critical value is found from the t-distribution table. In this table the critical value is written as tα(r), where r is the degrees of freedom and \alpha = {1-C \over 2}.
  1. Plug the found values into the appropriate equations:
    • For a known standard deviation: (\bar{x} - z^* {\sigma \over \sqrt{n}}, \bar{x} + z^* {\sigma \over \sqrt{n}})
    • For an unknown standard deviation: (\bar{x} - t^* {\sigma \over \sqrt{n}}, \bar{x} + t^* {\sigma \over \sqrt{n}})
  2. The final step is to interpret the answer. Since the found answer is an interval with an upper and lower bound it is appropriate to state that based on the given data we are __ % (dependent on the confidence level) confident that the true mean of the population is between __ (lower bound) and __ (upper bound).[25]

Variance and Standard Deviation

Here, there is a simple explanation why we have to square the differences. Basically, it’s because “we have to be fair” when comparing data statistics. One could think that we could use module operator, instead of squaring the differences. We could, but the results may not indicate always the same idea.

The “Population Standard Deviation”:

The “Sample Standard Deviation“:

 

Git Merge Conflicts

We can use mergetool to solve conflicts in git.
Here is short (a very short) example. Original post is here.

$ git mergetool

[…]

Both of you have modified planets.md. When you open the file in your text editor, you’ll see both changes:

the number of planets are
<<<<<<< HEAD
nine
=======
eight
>>>>>>> branch-a

In branch-a, you wrote the word “nine,” but your friend wrote “eight.” Git automatically addsconflict markers to the affected areas. A conflict-marked area begins with <<<<<<< and ends with >>>>>>>. These are also known as the conflict markers. The two conflicting blocks themselves are divided by a =======.

Joining or Merging PDF Files

Joining or merging a PDF file may sound easy, and it is. However, sometimes we would like to keep or preserve each file orientation when joining multiple PDFs with different size.

When I first tried joining such files with pdfjoin, all the files after the first one got rotated. I’m not sure, but I think it might be because of differences on files that I was working on.

But I solved my problem with –rotateoversize false parameter.

pdfjoin --rotateoversize false FILE_1.pdf FILE_2.pdf FILE_3.pdf  -o Joined_file.pdf

That’s all,

Differences Between \input and \include Tags of Latex

\input{filename} append all commands defined in filename into the target file. This is equivalent to manually typing all the commands from filename right into the current file where the\input line is. (It may remember inline functions or macros of C).

\include{filename} is equivalent to call \clearpage before and after \input{filename}. So, filename must have all dependencies (commands) that it needs most of the time.