<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>TealScientific</title>
	<atom:link href="http://tealscientific.com/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://tealscientific.com/blog</link>
	<description>News, thoughts and opinions on science, engineering, technology and society</description>
	<lastBuildDate>Mon, 13 May 2013 03:34:50 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Perched Pelican</title>
		<link>http://tealscientific.com/blog/?p=2088</link>
		<comments>http://tealscientific.com/blog/?p=2088#comments</comments>
		<pubDate>Mon, 13 May 2013 03:34:50 +0000</pubDate>
		<dc:creator>terry</dc:creator>
				<category><![CDATA[Environment]]></category>
		<category><![CDATA[Gallery]]></category>
		<category><![CDATA[Nature]]></category>

		<guid isPermaLink="false">http://tealscientific.com/blog/?p=2088</guid>
		<description><![CDATA[<p class="wp-caption-text">Perched Pelican in St Marys, GA</p> <p>This pelican was perched atop a post in the St. Marys River on a slightly overcast, March day.</p> <p>(c) TealComp.com 20130322 This work is shared under a Creative Commons Attribution-ShareAlike 3.0 Unported License.</p> <p> </p> <span style="color:#777"> . . . &#8594; Read More: <a href="http://tealscientific.com/blog/?p=2088">Perched Pelican</a></span>]]></description>
				<content:encoded><![CDATA[<div id="attachment_2087" class="wp-caption aligncenter" style="width: 310px"><a href="http://tealscientific.com/blog/wp-content/uploads/2013/05/tls20130322_DSC_4161_1920.jpg" title="click to enlarge"><img src="http://tealscientific.com/blog/wp-content/uploads/2013/05/tls20130322_DSC_4161_1920-300x187.jpg" alt="Perched_Pelican" width="300" height="187" class="size-medium wp-image-2087" /></a><p class="wp-caption-text">Perched Pelican in St Marys, GA</p></div>
<p>This pelican was perched atop a post in the St. Marys River on a slightly overcast, March day.</p>
<p>(c) <a href="http://tealcomp.com/" title="TealComp.com">TealComp.com</a> 20130322<br />
<a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/deed.en_US"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/88x31.png" /></a><br />This work is shared under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/deed.en_US">Creative Commons Attribution-ShareAlike 3.0 Unported License</a>.</p>
<p><script type="text/javascript"><!--
google_ad_client = "ca-pub-5999018131651479";
/* half_banner */
google_ad_slot = "9084909511";
google_ad_width = 234;
google_ad_height = 60;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://tealscientific.com/blog/?feed=rss2&#038;p=2088</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Configuring automatic upgrades on Ubuntu</title>
		<link>http://tealscientific.com/blog/?p=2065</link>
		<comments>http://tealscientific.com/blog/?p=2065#comments</comments>
		<pubDate>Fri, 10 May 2013 03:00:31 +0000</pubDate>
		<dc:creator>terry</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://tealscientific.com/blog/?p=2065</guid>
		<description><![CDATA[<p>Part of keeping systems safe and secure involves keeping them properly patched. This can be quite a chore when you need to manage many systems. One way of easing this burden is to let each system automatically apply some or all updates and patches.</p> <p>This is easy to set up on Ubuntu systems.</p> <p>Note: All <span style="color:#777"> . . . &#8594; Read More: <a href="http://tealscientific.com/blog/?p=2065">Configuring automatic upgrades on Ubuntu</a></span>]]></description>
				<content:encoded><![CDATA[<p>Part of keeping systems safe and secure involves keeping them properly patched.  This can be quite a chore when you need to manage many systems.  One way of easing this burden is to let each system automatically apply some or all updates and patches.</p>
<p>This is easy to set up on Ubuntu systems.</p>
<p>Note: All commands should be entered with superuser privileges.</p>
<ol>
<li> <strong>Make sure the system is up-to-date:</strong><br />
   <code>apt-get update</code><br />
   <code>apt-get upgrade</code>
</li>
<li> <strong>Ensure that the &#8216;unattended-upgrades&#8217; package is installed:</strong><br />
   <code>apt-get install unattended-upgrades</code>
</li>
<li> <strong>Configure unattended-upgrades settings:</strong><br />
   These settings are made in <em>/etc/apt/apt.conf.d/50unattended-upgrades</em>.  Typically, the only required changes will be to specify which packages to include in automatic upgrades.  This is done in the first section and should look something like:</p>
<blockquote><p>
// Automatically upgrade packages from these (origin:archive) pairs<br />
Unattended-Upgrade::Allowed-Origins {<br />
        &#8220;${distro_id}:${distro_codename}-security&#8221;;<br />
//      &#8220;${distro_id}:${distro_codename}-updates&#8221;;<br />
//      &#8220;${distro_id}:${distro_codename}-proposed&#8221;;<br />
//      &#8220;${distro_id}:${distro_codename}-backports&#8221;;<br />
};
</p></blockquote>
<p>In this case, we are allowing security updates to be handled automatically, but regular updates, proposed packages, and backports will still require manual intervention.</p>
<p>This file, <em>/etc/apt/apt.conf.d/50unattended-upgrades</em>, is well-documented.  Take some time to review additional options.  For instance, we see:</p>
<blockquote><p>
// Automatically reboot *WITHOUT CONFIRMATION* if a<br />
// the file /var/run/reboot-required is found after the upgrade<br />
//Unattended-Upgrade::Automatic-Reboot &#8220;false&#8221;;
</p></blockquote>
<p>If we un-comment this option (by deleting the &#8220;//&#8221;) and change &#8220;false&#8221; to &#8220;true&#8221;, the system will reboot without user confirmation when required by an upgrade.  This could cause any users on the system to lose unsaved work, so activating this feature is NOT recommended.
</li>
<li> <strong>Specify upgrade schedules:</strong>.<br />
   Next we modify <em>/etc/apt/apt.conf.d/10periodic</em></p>
<blockquote><p>
APT::Periodic::Update-Package-Lists &#8220;1&#8243;;        // download package lists<br />
APT::Periodic::Download-Upgradeable-Packages &#8220;1&#8243;;  // download upgradeable<br />
APT::Periodic::AutocleanInterval &#8220;14&#8243;;  // auto clean every 14 days<br />
APT::Periodic::Unattended-Upgrade &#8220;1&#8243;;  // enable unattended upgrades<br />
APT::Periodic::Verbose &#8220;2&#8243;;             // enable additional logging<br />
APT::Periodic::RandomSleep &#8220;1&#8243;;         // reduces wait-time
</p></blockquote>
<p>Here, we have specified that, periodically, a list of new packages will be downloaded and then upgradeable packages will be downloaded, the cache of downloaded packages will be cleaned every 14 days, unattended upgrades are enabled, and extra logging (to <em>/var/log/unattended-upgrades</em>) will be enabled.<br />
The <em>RandomSleep</em> setting is in seconds and defaults to 1800 seconds, causing the update process to wait some random number of seconds between 0 and 1800 seconds.  Changing this value to 1, essentially, removes the delay.
</li>
<li> <strong>Set up a cron job to get things going:</strong><br />
   The cron daemon automatically runs scripts found in <em>/etc/cron.daily</em> once a day.  The &#8216;unattended-upgrades&#8217; package should have installed a new cron script, <em>/etc/cron.daily/apt</em>.  This script does a lot to handle the automatic upgrades, using the settings files above to modify its behavior.  The only thing that should be necessary to get things moving is to ensure the correct permissions on the file:<br />
  <code>chmod 755 /etc/cron.daily/apt</code>
</li>
</ol>
<p>Well, that&#8217;s it!</p>
<p><strong>References:</strong></p>
<ul>
<li><a href="https://help.ubuntu.com/10.04/serverguide/automatic-updates.html" title="Ubuntu Official Documentation - Automatic Updates" target="_blank">Ubuntu Official Documentation</a></li>
<li><a href="http://robpickering.com/2012/06/setting-up-automatic-updates-for-ubuntu-893" title="Rob Pickering - Configuring Automatic Updates for Ubuntu" target="_blank">RobPickering.com &#8211; Configuring Automatic Updates for Ubuntu</a></li>
<li><a href="http://www.garron.me/en/linux/turn-off-stop-ubuntu-automatic-update.html" title="Guillermo Garron - Turn Off Ubuntu Automatic Updates" target="_blank">Guillermo Garron &#8211; Turn Off Ubuntu Automatic Updates</a></li>
</ul>
<p><script type="text/javascript"><!--
google_ad_client = "ca-pub-5999018131651479";
/* half_banner */
google_ad_slot = "9084909511";
google_ad_width = 234;
google_ad_height = 60;
//-->
</script><br />
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://tealscientific.com/blog/?feed=rss2&#038;p=2065</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introduction to Maxima</title>
		<link>http://tealscientific.com/blog/?p=2024</link>
		<comments>http://tealscientific.com/blog/?p=2024#comments</comments>
		<pubDate>Fri, 26 Apr 2013 15:54:03 +0000</pubDate>
		<dc:creator>terry</dc:creator>
				<category><![CDATA[Engineering]]></category>
		<category><![CDATA[Science]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://tealscientific.com/blog/?p=2024</guid>
		<description><![CDATA[ <p>Maxima is a free and open source software system for manipulation of symbolic and numeric expressions, high-precision numeric computations, and plotting in two and three dimensions. Maxima is a descendant of Macsyma, the computer algebra system developed in the 1960s at MIT that inspired commercial systems, such as Maple and Mathematica. Maxima was maintained <span style="color:#777"> . . . &#8594; Read More: <a href="http://tealscientific.com/blog/?p=2024">Introduction to Maxima</a></span>]]></description>
				<content:encoded><![CDATA[<div style="float:left; padding:4px;"><img src="http://tealscientific.com/blog/wp-content/uploads/2013/04/logo_maxima.png" alt="Maxima Logo" width="64" height="60" class="size-full wp-image-2026" /></div>
<p><a href="http://maxima.sourceforge.net/" title="Maxima Project" target="_blank">Maxima</a> is a free and open source software system for manipulation of symbolic and numeric expressions, high-precision numeric computations, and plotting in two and three dimensions.  Maxima is a descendant of Macsyma, the computer algebra system developed in the 1960s at MIT that inspired commercial systems, such as Maple and Mathematica.  Maxima was maintained by William Shelter from 1982 until 2001, releasing the code under the <a href="http://www.gnu.org/copyleft/gpl.html" title="GPL License" target="_blank">GNU General Public License (GPL)</a> in 1998.  Maxima is currently maintained by an active group of users and developers.</p>
<p>&nbsp;</p>
<h2>Getting Maxima</h2>
<p>Maxima is likely already in your favorite Linux distribution&#8217;s standard repository.  For example, on Debian or one of its derivatives (like Ubuntu), you can install Maxima and one of its graphical front-ends, wxMaxima, with a command like:<br />
  : sudo apt-get install maxima wxmaxima<br />
Pre-compiled versions for a variety of operating systems and environments can be found on the <a href="http://maxima.sourceforge.net/ports.html" title="Maxima Ports" target="_blank">Maxima ports</a> page.<br />
If you want the latest version of Maxima and you want to tweak and optimize it for your particular computer system, you can <a href="http://maxima.sourceforge.net/download.html" title="Maxima Downloads" target="_blank">download</a> the source code and compile it yourself.</p>
<p>&nbsp;</p>
<h2>Interacting with Maxima</h2>
<p>Whether you start Maxima by entering &#8216;maxima&#8217; on the command-line or by clicking an application launcher icon depends on your operating system and how Maxima itself was installed.  The figure below illustrates the command-line (terminal) version of Maxima.<br />
<div id="attachment_2027" class="wp-caption aligncenter" style="width: 310px"><a href="http://tealscientific.com/blog/wp-content/uploads/2013/04/maxima_03-001_terminal.png"><img src="http://tealscientific.com/blog/wp-content/uploads/2013/04/maxima_03-001_terminal-300x191.png" alt="Terminal Maxima" width="300" height="191" class="size-medium wp-image-2027" /></a><p class="wp-caption-text">Maxima in the Terminal</p></div></p>
<p>Graphical interfaces also exist for Maxima, which can provide some useful shortcuts to features and functions within Maxima.  The one shown in the figure below is <a href="http://andrejv.github.io/wxmaxima/index.html" title="wxMaxima Project" target="_blank">wxMaxima</a>.<br />
<div id="attachment_2028" class="wp-caption aligncenter" style="width: 310px"><a href="http://tealscientific.com/blog/wp-content/uploads/2013/04/maxima_03-002_wxmaxima.png"><img src="http://tealscientific.com/blog/wp-content/uploads/2013/04/maxima_03-002_wxmaxima-300x213.png" alt="wxMaxima" width="300" height="213" class="size-medium wp-image-2028" /></a><p class="wp-caption-text">wxMaxima</p></div></p>
<p>&nbsp;</p>
<p>Maxima is most often used in interactive mode in which users input commands and review outputs.  Input lines are automatically labeled with a &#8216;%i&#8217; followed by a line number.  Output lines receive the same treatment, but with &#8216;%o&#8217;.  The above figure of the terminal interface shows the prompt &#8216;(%i1)&#8217; for the user to input the first command.  wxMaxima may present a blank window and no prompt until the user has typed something.</p>
<p>Issuing a command to Maxima is fairly straight-forward.  For example, we perform a simple computation with:</p>
<pre>
(%i1) 6 * 7 + 13;
</pre>
<p>And, Maxima returns:</p>
<pre>
(%o1)                                 55
</pre>
<p>Note that &#8220;(%i1)&#8221; and &#8220;(%o1)&#8221; are not typed, they are automatically generated by Maxima.  Our input is just the &#8220;6 * 7 + 13;&#8221; part and Maxima&#8217;s output is &#8220;55.&#8221;  In the terminal version of Maxima, we just press the ENTER key after our input to have Maxima perform the computation.  For wxMaxima, we need to press the key combination, SHIFT+ENTER.</p>
<p>When are are done with our Maxima session, we can exit by issuing the quit() command:<br />
<code>(%i99) quit();</code></p>
<p>&nbsp;</p>
<h2>Using Maxima as a Calculator</h2>
<p>Let&#8217;s do a few more computations &#8230;</p>
<p>We can reference previous inputs or outputs in new calculations:</p>
<pre>(%i2) %o1 / 5;</pre>
<p>Maxima returns:</p>
<pre>(%o2)                                 11</pre>
<p>As a shortcut, we can reference the immediately previous output with just the percent symbol (&#8216;%&#8217;):</p>
<pre>
(%i3) % * 6;
(%o3)                                 66
</pre>
<p>Let&#8217;s try another:</p>
<pre>
(%i4) 22 / 7;
                                      22
(%o4)                                 --
                                      7
</pre>
<p>Notice here that, when the numerator and denominator are both integers, Maxima returns a reduced fraction or integer.  If we want to have this fraction evaluated as a floating-point, we can use Maxima&#8217;s float() function:</p>
<pre>
(%i5) float(%o4);
(%o5)                          3.142857142857143
</pre>
<p>And, like any decent, scientific calculator, Maxima provides a large number of built-in operators and functions.  For instance,</p>
<pre>
(%i6) cos(4*%pi/3);
                                        1
(%o6)                                 - -
                                        2
</pre>
<p>That is, the cosine of four-thirds of pi is negative one-half.</p>
<p>&nbsp;</p>
<h2>Doing Algebra with Maxima</h2>
<p>First and foremost, Maxima is a computer algebra system.  Let&#8217;s try doing some examples &#8230;</p>
<pre>(%i7) expand( (x + 2*y)^2 );</pre>
<p>Maxima returns:</p>
<pre>
                                  2            2
(%o7)                          4 y  + 4 x y + x
</pre>
<p>Maxima does an admirable job of representing mathematical expressions in the terminal, but it is not quite publication ready.  Fortunately, Maxima can generate output in <a href="http://www.tug.org/" title="TeX Project" target="_blank">TeX</a>, a popular and well-supported typesetting system, through its tex() function.</p>
<pre>
(%i8) tex(%o7);
$$4\,y^2+4\,x\,y+x^2\leqno{\tt (\%o7)}$$
(%o8) "(\%o7)"
</pre>
<p>In wxMaxima, we can also click on an expression and choose to copy it as <a href="http://www.latex-project.org/" title="LaTeX Project" target="_blank">LaTeX</a> or as an image.<br />
<div id="attachment_2029" class="wp-caption aligncenter" style="width: 209px"><img src="http://tealscientific.com/blog/wp-content/uploads/2013/04/maxima_03-003_output.png" alt="4*y^2 + 4xy + x^2" width="199" height="27" class="size-full wp-image-2029" /><p class="wp-caption-text">Expression as an Image</p></div></p>
<p>&nbsp;</p>
<p>We can create and assign values to variables in Maxima with the colon (&#8216;:&#8217;) operator:</p>
<pre>
(%i9) radius:2; height:10;
(%o9)                                 2
(%o10)                                10
</pre>
<p>Here, we assigned the value, 2, to the variable, <em>radius</em>, and 10 to the variable, <em>height</em>.  And, we did so on the same input line, remembering to terminate each command with a semicolon (&#8216;;&#8217;).</p>
<p>Maxima outputs the result of each command by default.  The output of a variable assignment is just the value of the variable.  In some cases, we may not wish to see such output.  With Maxima&#8217;s alternate command terminator, the dollar-sign (&#8216;$&#8217;), we can <em>suppress</em> the output.  Thus:</p>
<pre>(%i10) radius:2$ height:10$</pre>
<p>Now, let&#8217;s make use of our <em>radius</em> and <em>height</em> variables to compute the volume of a cylinder:</p>
<pre>
(%i11) volume: %pi * radius^2 * height;
(%o11)                             40 %pi
</pre>
<p>That is, the computed volume is stored in the variable, <em>volume</em>, and is 40 times the constant pi.  Remember that Maxima is a symbolic calculator and, since pi can not be represented with complete precision, Maxima normally does not attempt to evaluate it.  We can, however, instruct Maxima to approximate a numerical answer by appending &#8220;,numer&#8221; to our expression:</p>
<pre>
(%i12) volume,numer;
(%o12)                         125.6637061435917
</pre>
<p>We can define functions too:</p>
<pre>
(%i13) volume(radius,height) := %pi * radius^2 * height;
                                                          2
(%o13)                volume(radius, height) := %pi radius  height
</pre>
<p>And, now, we can use our defined function:</p>
<pre>
(%i14) volume(2, 10);
(%o14)                40 %pi
(%i15) volume(3, 8), numer;
(%o15)                          226.1946710584651
</pre>
<p>If we have an equation, say 2*x^2 &#8211; 16 = 0, and we need to solve for the value of x, Maxima can help:</p>
<pre>
(%i16) solve(2*x^2-32, x);
(%o16)                         [x = - 4, x = 4]
</pre>
<p>Maxima can also solve a system of equations:</p>
<pre>
(%i17) solve([2*x - 3*y = 16, 3*x + y = 2], [x, y]);
(%o17)                        [[x = 2, y = - 4]]
</pre>
<p>&nbsp;</p>
<h2>Crunching Calculus with Maxima</h2>
<p>Maxima can perform symbolic differentiation:</p>
<pre>
(%i17) diff( x^2 * cos(x), x );
                                          2
(%o17)                      2 x cos(x) - x  sin(x)
</pre>
<p>and integration:</p>
<pre>
(%i18) integrate(%e^(2*x) - sin(x), x);
                                           2 x
                                         %e
(%o18)                          cos(x) + -----
                                           2
</pre>
<p>&#8216;%e&#8217; is the base of the natural logarithms and is another of Maxima&#8217;s pre-defined constants.</p>
<p>&nbsp;</p>
<p>For definite integration, just specify the limits:</p>
<pre>
(%i19) integrate(cos(x), x, 0, %pi/2);
(%o19)                                 1
</pre>
<p>&nbsp;</p>
<h2>Plotting with Maxima</h2>
<p>Maxima offers us many plotting options and functions.  We can create a simple, two-dimensional plot with plot2d():</p>
<pre>(%i20) plot2d(x^3*sin(x), [x, -2*%pi, 2*%pi]);</pre>
<div id="attachment_2030" class="wp-caption aligncenter" style="width: 310px"><a href="http://tealscientific.com/blog/wp-content/uploads/2013/04/maxima_03-004_plot2d.png"><img src="http://tealscientific.com/blog/wp-content/uploads/2013/04/maxima_03-004_plot2d-300x180.png" alt="Plot2D" width="300" height="180" class="size-medium wp-image-2030" /></a><p class="wp-caption-text">Plot2D Example</p></div>
<p>and, for 3-D plots, there is plot3d():</p>
<pre>(%i21) plot3d(sin(x)*cos(2*y),[x,-4,4],[y,-4,4],[grid,50,50]);</pre>
<div id="attachment_2031" class="wp-caption aligncenter" style="width: 310px"><a href="http://tealscientific.com/blog/wp-content/uploads/2013/04/maxima_03-005_plot3d.png"><img src="http://tealscientific.com/blog/wp-content/uploads/2013/04/maxima_03-005_plot3d-300x180.png" alt="Plot3D" width="300" height="180" class="size-medium wp-image-2031" /></a><p class="wp-caption-text">Plot3D Example</p></div>
<p>&nbsp;</p>
<h2>Saving a Maxima Session</h2>
<p>The constants, variables, and functions we build in a Maxima session could represent a lot of hard work.  If we wish to save some or all of this and later recall it, Maxima provides the save(), load(), and loadfile() functions to help us do this.<br />
To save everything in the current session, just provide a filename to the save() function:</p>
<pre>(%i66) save("mysession");</pre>
<p>To save specific variables, functions, and so on, just list them after the filename:</p>
<pre>(%i67) save("/home/lucy/maxima/myvolumes.mac", volume);</pre>
<p>Note that the &#8220;.mac&#8221; extension is not required.</p>
<p>Loading a saved session is as easy as calling the load() or loadfile() function with the desired filename.  The main difference between these two is that loadfile() typically requires us to specify the path and extension to our saved file.</p>
<pre>loadfile("/home/lucy/maxima/myvolumes.mac");</pre>
<p>&nbsp;</p>
<h2>Citing Maxima in Academic Publications</h2>
<p>Maxima should be cited as:</p>
<blockquote><p>
    Maxima.sourceforge.net. Maxima, a Computer Algebra System.<br />
    Version 5.30.0 (2013). <a href="http://maxima.sourceforge.net/" title="http://maxima.sourceforge.net/" target="_blank">http://maxima.sourceforge.net/</a>
</p></blockquote>
<p>Obviously, substitute the version number and release year as appropriate.</p>
<p>&nbsp;</p>
<h2>Getting Help in Maxima</h2>
<p>Maxima does have a fairly detailed, built-in help, which can be accessed with &#8220;describe(topic)&#8221; or &#8220;? topic.&#8221;  For example,</p>
<pre>
(%i22) describe(permutation);

 -- Function: permutation (&lt;n&gt;, &lt;r&gt;)
     Returns the number of permutations of &lt;r&gt; objects selected from a
     set of &lt;n&gt; objects.

     To use this function write first `load(functs)'.




  There are also some inexact matches for `permutation'.
  Try `?? permutation' to see them.

(%o22)                               true
</pre>
<p>This description could just as easily been displayed by issuing,</p>
<pre>(%i22) ? permutation</pre>
<p>Notice that, in addition to describing the permutation() function and its arguments, we are also told that we must first load <em>functs</em> into our session with <code>load(functs);</code>.  Also, we are told that there are other, possibly related functions, which we can list:</p>
<pre>
(%i23) ?? permutation;

 0: permutation  (Package functs)
 1: permutations  (Functions and Variables for Sets)
 2: random_permutation  (Functions and Variables for Sets)
Enter space-separated numbers, `all' or `none': 
</pre>
<p>For some functions, there are also well-prepared examples.  We can access these with the example(topic) function, as in:</p>
<pre>
(%i24) example(factor);
</pre>
<p>&nbsp;<br />
<h2>Learning More About Maxima</h2>
<p>We have barely scratched the surface of Maxima&#8217;s capabilities.  There are many resources on the Internet, some of which are listed here:</p>
<ul>
<li>Maxima, a Computer Algebra System, project website, <a href="http://maxima.sourceforge.net/" title="http://maxima.sourceforge.net/" target="_blank">http://maxima.sourceforge.net/</a></li>
<li>A 10 minute tutorial for solving Math problems with Maxima, Math-Blog, <a href="http://math-blog.com/2007/06/04/a-10-minute-tutorial-for-solving-math-problems-with-maxima/" title="http://math-blog.com/2007/06/04/a-10-minute-tutorial-for-solving-math-problems-with-maxima/" target="_blank">http://math-blog.com/2007/06/04/a-10-minute-tutorial-for-solving-math-problems-with-maxima/</a></li>
<li>Introduction to Maxima, Richard H. Rand, Dept. of Theoretical and Applied Mechanics, Cornell University, <a href="http://maxima.sourceforge.net/docs/intromax/intromax.html" title="http://maxima.sourceforge.net/docs/intromax/intromax.html" target="_blank">http://maxima.sourceforge.net/docs/intromax/intromax.html</a></li>
<li>Maxima FAQ, University of Utah Department of Mathematics, <a href="http://www.math.utah.edu/faq/maxima/" title="http://www.math.utah.edu/faq/maxima/" target="_blank">http://www.math.utah.edu/faq/maxima/</a></li>
<li>Maxima &#8211; Using its symbolic math capabilities, Hippasus, <a href="http://www.hippasus.com/resources/symmath/maximasym.html" title="http://www.hippasus.com/resources/symmath/maximasym.html" target="_blank">http://www.hippasus.com/resources/symmath/maximasym.html</a></li>
<li>Examples of the Maxima Gnuplot interface, Maxima project website, <a href="http://maxima.sourceforge.net/maxima-gnuplot.html" title="http://maxima.sourceforge.net/maxima-gnuplot.html" target="_blank">http://maxima.sourceforge.net/maxima-gnuplot.html</a></li>
<p>&nbsp;</p>
<p><script type="text/javascript"><!--
google_ad_client = "ca-pub-5999018131651479";
/* half_banner */
google_ad_slot = "9084909511";
google_ad_width = 234;
google_ad_height = 60;
//-->
</script><br />
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://tealscientific.com/blog/?feed=rss2&#038;p=2024</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EFF&#8217;s Legal Guide for Bloggers</title>
		<link>http://tealscientific.com/blog/?p=2018</link>
		<comments>http://tealscientific.com/blog/?p=2018#comments</comments>
		<pubDate>Sat, 13 Apr 2013 03:05:53 +0000</pubDate>
		<dc:creator>terry</dc:creator>
				<category><![CDATA[Society]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://tealscientific.com/blog/?p=2018</guid>
		<description><![CDATA[ <p> The Electronic Frontier Foundation is working hard to defend bloggers&#8217; legal rights. If you post or share information online, you should check out EFF&#8217;s Legal Guide for Bloggers.</p> ]]></description>
				<content:encoded><![CDATA[<div style="float:right;"><a href="https://www.eff.org/issues/bloggers"><img src="https://w2.eff.org/bloggers/badges/bloggers-rights-148x224px.png" alt="Bloggers' Rights at EFF" width="148" height="224" border="0"></a></div>
<p> The <a href="https://www.eff.org/" title="EFF website" target="_blank">Electronic Frontier Foundation</a> is working hard to defend bloggers&#8217; legal rights.  If you post or share information online, you should check out EFF&#8217;s <a href="https://www.eff.org/issues/bloggers/legal" title="Legal Guide for Bloggers" target="_blank">Legal Guide for Bloggers</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://tealscientific.com/blog/?feed=rss2&#038;p=2018</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Planet Four</title>
		<link>http://tealscientific.com/blog/?p=2006</link>
		<comments>http://tealscientific.com/blog/?p=2006#comments</comments>
		<pubDate>Sat, 13 Apr 2013 01:52:44 +0000</pubDate>
		<dc:creator>terry</dc:creator>
				<category><![CDATA[Science]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://tealscientific.com/blog/?p=2006</guid>
		<description><![CDATA[<p>Planet Four is a cool, citizen science project in the Zooniverse, where ordinary people can help scientists identify and measure features on the surface of Mars.</p> Image: NASA/JPL/University of Arizona <p>Currently, the Planet Four project scientists are asking for help finding and marking &#8220;fans&#8221; and &#8220;blotches&#8221; on the Martian surface. It is believed that these <span style="color:#777"> . . . &#8594; Read More: <a href="http://tealscientific.com/blog/?p=2006">Planet Four</a></span>]]></description>
				<content:encoded><![CDATA[<p><a href="http://planetfour.org/" title="Planet Four Project Website" target="_blank">Planet Four</a> is a cool, citizen science project in the <a href="https://www.zooniverse.org/" title="Zooniverse Website" target="_target">Zooniverse</a>, where ordinary people can help scientists identify and measure features on the surface of <a href="http://www.space.com/47-mars-the-red-planet-fourth-planet-from-the-sun.html" title="Mars, Facts and Info from space.com" target="_blank">Mars</a>.</p>
<div style="text-align:center">
<a href="http://hirise.lpl.arizona.edu/ESP_011341_0980" title="click to visit this HiRISE image page" target="_blank"><img src="http://tealscientific.com/blog/wp-content/uploads/2013/04/ESP_011341_0980_460x345.jpg" alt="Image: NASA/JPL/University of Arizona" /></a><br /> Image: NASA/JPL/University of Arizona
</div>
<p>Currently, the <a href="http://planetfour.org/" title="Planet Four Project Website" target="_blank">Planet Four</a> project scientists are asking for help finding and marking &#8220;fans&#8221; and &#8220;blotches&#8221; on the Martian surface.  It is believed that these features indicate wind direction and speed.  By tracking &#8220;fans&#8221; and &#8220;blotches&#8221; over time, scientists hope to gain a better understanding of the climate of Mars.</p>
<p>Images for this project come from the <a href="http://hirise.lpl.arizona.edu/teknikos.php" title="HiRISE camera technical specifications" target="_blank">HiRISE camera</a> aboard the <a href="http://mars.jpl.nasa.gov/mro/" title="NASA JPL: Mars Reconnaissance Orbiter" target="_blank">Mars Reconnaissance Orbiter</a>.  HiRISE can resolve resolutions of 30 centimeters per pixel!  Volunteers with only a little training can help identify features in these images.  Then, by averaging the work of many volunteers, remarkably reliable results can be achieved.</p>
<p><script type="text/javascript"><!--
google_ad_client = "ca-pub-5999018131651479";
/* half_banner */
google_ad_slot = "9084909511";
google_ad_width = 234;
google_ad_height = 60;
//-->
</script><br />
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://tealscientific.com/blog/?feed=rss2&#038;p=2006</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clipping videos from the command-line</title>
		<link>http://tealscientific.com/blog/?p=1998</link>
		<comments>http://tealscientific.com/blog/?p=1998#comments</comments>
		<pubDate>Thu, 11 Apr 2013 02:48:52 +0000</pubDate>
		<dc:creator>terry</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://tealscientific.com/blog/?p=1998</guid>
		<description><![CDATA[<p>So, you need to create a short clip from a longer video. Sure, you could launch your favorite GUI video editor, like OpenShot or Kdenlive, and manipulate your video. But, why not use the command-line for such a simple edit?</p> <p>This is where the Libav or FFmpeg project comes in handy. Both projects provide tools <span style="color:#777"> . . . &#8594; Read More: <a href="http://tealscientific.com/blog/?p=1998">Clipping videos from the command-line</a></span>]]></description>
				<content:encoded><![CDATA[<p>So, you need to create a short clip from a longer video.  Sure, you could launch your favorite GUI video editor, like <a href="http://openshot.org/" title="OpenShot project website" target="_blank">OpenShot</a> or <a href="http://kdenlive.org/" title="Kdenlive project website" target="_blank">Kdenlive</a>, and manipulate your video.  But, why not use the command-line for such a simple edit?</p>
<p>This is where the <a href="https://libav.org/" title="Libav project website" target="_blank">Libav</a> or <a href="http://ffmpeg.org/" title="FFmpeg project website" target="_blank">FFmpeg</a> project comes in handy.  Both projects provide tools for manipulating multimedia files: <a href="http://ffmpeg.org/ffmpeg.html" title="ffmpeg documentation" target="_blank">ffmpeg</a> or <a href="https://libav.org/avconv.html" title="avconv documentation" target="_blank">avconv</a>.</p>
<p>In clipping a video, we need to specify starting position and duration.  For both <em>ffmpeg</em> and <em>avconv</em> this is done with the command-line arguments:</p>
<dl>
<dt>-ss</dt>
<dd>Seek position: When used as an output option, decodes but discards input until the timestamp reaches the specified time.  The seek position can be specified as the number of seconds from the start of the video or in the form HH:MM:SS[.xxx], where HH represents hours, MM represents minutes, SS represents seconds, and .xxx is an optional fraction of a second.</dd>
<dt>-t</dt>
<dd>Duration: This tells the command to stop writing output after the specified duration.  Duration can be given in seconds or in the form HH:MM:SS[.xxx].</dd>
</dl>
<p>Let&#8217;s see some examples &#8230;</p>
<p><strong>Example 1:</strong><br />
<em>Let&#8217;s say you captured your niece&#8217;s hour and a half recital in the video file, called recital.mkv.  You want to create a new video, called myniece.mkv, of just her solo, which starts 22 minutes into the recital and lasts for five minutes and 20 seconds.</em></p>
<p>This example is pretty straight-forward, as we do not need to re-encode the audio or video.  Our seek position (where we want our clip to start) is 00:22:00 and the duration is 00:05:20.  So, the command to do this would be:</p>
<blockquote><p>
avconv -i recital.mkv -ss 00:22:00 -t 00:05:20 -c: copy myniece.mkv
</p></blockquote>
<p>Notice that <em>-c: copy</em> instructs the command to copy all audio and video streams.</p>
<p>Obviously, for those using the <em>FFmpeg</em> project, <em>ffmpeg</em> would replace <em>avconv</em>, and vice versa.</p>
<p><strong>Example 2:</strong><br />
<em>You recorded a 1 minute and 59 second MPEG2 video, experiment1.mpg, in your lab using an old video recorder.  You need to extract a clip from the the 17 second mark to the one minute and 30 second mark.  You do not want to make any changes to the video encoding, but you want to leave out the audio from the final clip.</em></p>
<p>Obviously, the seek position is 17 seconds.  We calculate the duration to be 73 seconds (i.e., 90 seconds minus 17 seconds).<br />
Thus, the command to accomplish this would be:</p>
<blockquote><p>
ffmpeg -i experiment1.mpg -ss 17 -t 73 -c:v copy -an experiment1_clip.mpg
</p></blockquote>
<p>Here:</p>
<ul>
<li><em>-c:v copy</em> instructs the command to copy the video streams from the input video to the output video.</li>
<li><em>-an</em> instructs the command to ignore (do nothing with) the audio.</li>
</ul>
<p><strong>Example 3:</strong><br />
<em>Take the last example and add the requirements that: 1) the video should be encoded as H.264 and 2) the final result should be in a Matroska container.</em></p>
<p>We could just re-encode the clip we produced in the previous example with a command like:</p>
<blockquote><p>
avconv -i experiment1_clip.mpg -c:v libx264 -preset slow -crf 20 -an experiment1_clip.mkv
</p></blockquote>
<p>Notice that <em>avconv</em> and <em>ffmpeg</em> can determine the desired container format (assuming it is supported) from the filename extension.  In this case, &#8220;.mkv&#8221; is recognized as a Matroska container.</p>
<p>The libx264 codec is a product of the <a href="https://www.videolan.org/developers/x264.html" title="VideoLAN x264 site" target="_blank">VideoLAN Organization</a> and it implements the H.264 encoding standard.  This codec has many options and the command can become pretty complex.  Fortunately, there are some pre-defined settings (presets) which you may be able to use.</p>
<p>In the above command, we use the &#8216;slow&#8217; preset with a constant rate factor (a way of specifying the quality of a single-pass H.264 encoding) of 20.</p>
<p>We could also perform the clipping and encoding operations in one command:</p>
<blockquote><p>
ffmpeg -i experiment1.mpg -ss 17 -t 73 -c:v libx264 -preset slow -crf 20 -an experiment1_clip.mkv
</p></blockquote>
<p><script type="text/javascript"><!--
google_ad_client = "ca-pub-5999018131651479";
/* half_banner */
google_ad_slot = "9084909511";
google_ad_width = 234;
google_ad_height = 60;
//-->
</script><br />
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://tealscientific.com/blog/?feed=rss2&#038;p=1998</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Crescent Moon steals the show</title>
		<link>http://tealscientific.com/blog/?p=1954</link>
		<comments>http://tealscientific.com/blog/?p=1954#comments</comments>
		<pubDate>Thu, 11 Apr 2013 02:17:11 +0000</pubDate>
		<dc:creator>terry</dc:creator>
				<category><![CDATA[Gallery]]></category>
		<category><![CDATA[Nature]]></category>
		<category><![CDATA[Science]]></category>

		<guid isPermaLink="false">http://tealscientific.com/blog/?p=1954</guid>
		<description><![CDATA[<p>The young, crescent Moon was the &#8220;star&#8221; of this twilight &#8230;</p> <p class="wp-caption-text">Crescent Moon at Twilight</p> <p>(c) TealComp.com 20130313 This work is shared under a Creative Commons Attribution-ShareAlike 3.0 Unported License.</p> <p> </p> <span style="color:#777"> . . . &#8594; Read More: <a href="http://tealscientific.com/blog/?p=1954">Crescent Moon steals the show</a></span>]]></description>
				<content:encoded><![CDATA[<p>The young, crescent Moon was the &#8220;star&#8221; of this twilight &#8230;</p>
<div id="attachment_1953" class="wp-caption aligncenter" style="width: 310px"><a href="http://tealscientific.com/blog/wp-content/uploads/2013/03/tls20130313_DSC_4072_1920x1080.jpg" title="click to enlarge"><img src="http://tealscientific.com/blog/wp-content/uploads/2013/03/tls20130313_DSC_4072_1920x1080-300x168.jpg" alt="Crescent Moon" width="300" height="168" class="size-medium wp-image-1953" /></a><p class="wp-caption-text">Crescent Moon at Twilight</p></div>
<p>(c) <a href="http://tealcomp.com/" title="TealComp.com">TealComp.com</a> 20130313<br />
<a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/deed.en_US"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/88x31.png" /></a><br />This work is shared under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/deed.en_US">Creative Commons Attribution-ShareAlike 3.0 Unported License</a>.</p>
<p><script type="text/javascript"><!--
google_ad_client = "ca-pub-5999018131651479";
/* half_banner */
google_ad_slot = "9084909511";
google_ad_width = 234;
google_ad_height = 60;
//-->
</script><br />
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://tealscientific.com/blog/?feed=rss2&#038;p=1954</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenShot Video Editor KickStarter Campaign</title>
		<link>http://tealscientific.com/blog/?p=1984</link>
		<comments>http://tealscientific.com/blog/?p=1984#comments</comments>
		<pubDate>Tue, 02 Apr 2013 13:53:21 +0000</pubDate>
		<dc:creator>terry</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://tealscientific.com/blog/?p=1984</guid>
		<description><![CDATA[<p>OpenShot is a free, open-source, non-linear video editor currently available for Linux. OpenShot has an impressive feature list.</p> <p>The creators of OpenShot want to bring their product to other operating systems, including Mac OS X and Windows, and they&#8217;re trying to fund this effort through a KickStarter campaign. As we&#8217;ve discussed here and here, KickStarter <span style="color:#777"> . . . &#8594; Read More: <a href="http://tealscientific.com/blog/?p=1984">OpenShot Video Editor KickStarter Campaign</a></span>]]></description>
				<content:encoded><![CDATA[<p><a href="http://openshot.org/" title="OpenShot Video Editor website" target="_blank">OpenShot</a> is a free, open-source, non-linear video editor currently available for Linux.  OpenShot has an impressive <a href="http://openshot.org/features/" title="OpenShot Features" target="_blank">feature list</a>.</p>
<p>The creators of OpenShot want to bring their product to other operating systems, including Mac OS X and Windows, and they&#8217;re trying to fund this effort through a <a href="http://www.kickstarter.com/" title="KickStarter Website" target="_blank">KickStarter</a> campaign.  As we&#8217;ve discussed <a href="http://tealscientific.com/blog/?p=735" title="Musopen needs yoru help to set music free" target="_blank">here</a> and <a href="http://tealscientific.com/blog/?p=1405" title="Nina Paley’s “Mimi &#038; Eunice’s Intellectual Pooperty”" target="_blank">here</a>, KickStarter is a neat concept where people with great ideas can get funding for art, music, technology, games, films, and more by asking for donations (as little as $1) from millions of contributors.  Project leaders can also offer &#8220;awards&#8221; to backers at various levels, like a signed copy of a funded book or a CD containing the music that was funded by the campaign.  Of course, the real goal is to help get a worthy project off the ground.</p>
<p>The <a href="http://www.kickstarter.com/projects/421164014/openshot-video-editor-for-windows-mac-and-linux" title="OpenShot KickStarter Campaign" target="_blank">OpenShot KickStarter Campaign</a> has already reached its base funding goal!  With each additional level of funding (&#8220;stretch goals&#8221;), additional features (such as more render formats and codecs, an improved cropping tool, animation curve presets, and so on) have a chance of making it into the final product.</p>
<p>Visit the <a href="http://www.kickstarter.com/projects/421164014/openshot-video-editor-for-windows-mac-and-linux" target="_blank">OpenShot KickStarter Campaign</a> and consider making a contribution before the <strong>16 April 2013 deadline</strong>.</p>
<p><script type="text/javascript"><!--
google_ad_client = "ca-pub-5999018131651479";
/* half_banner */
google_ad_slot = "9084909511";
google_ad_width = 234;
google_ad_height = 60;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://tealscientific.com/blog/?feed=rss2&#038;p=1984</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Watermarking a video from the command-line</title>
		<link>http://tealscientific.com/blog/?p=1961</link>
		<comments>http://tealscientific.com/blog/?p=1961#comments</comments>
		<pubDate>Fri, 29 Mar 2013 22:51:02 +0000</pubDate>
		<dc:creator>terry</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://tealscientific.com/blog/?p=1961</guid>
		<description><![CDATA[<p> This article is not intended as a full treatment of this topic. There are far too many options and considerations to do it justice in one article. </p> <p>First, we need some definitions &#8230;</p> <p>Watermarks:</p> Originally, a watermark was a faint impression on paper. This idea is carried over to digital videos as a <span style="color:#777"> . . . &#8594; Read More: <a href="http://tealscientific.com/blog/?p=1961">Watermarking a video from the command-line</a></span>]]></description>
				<content:encoded><![CDATA[<p>
This article is not intended as a full treatment of this topic.  There are far too many options and considerations to do it justice in one article.
</p>
<p>First, we need some definitions &#8230;</p>
<p><strong>Watermarks</strong>:</p>
<div style="padding-left:2em; padding-right:2em;">
Originally, a watermark was a faint impression on paper.  This idea is carried over to digital videos as a small (or sometimes partially transparent) logo or text that appears on some or all video frames.<br />
There are a lot of options for producing this watermark image.  We like to use <a href="http://www.gimp.org/" title="GNU Image Manipulation Program" >GIMP</a> for our GUI image creation and manipulation needs.  And we like the <a href="https://en.wikipedia.org/wiki/Portable_Network_Graphics" title="Wikipedia: Portable Network Graphics">PNG</a> (portable network graphics) image format, as it supports lossless compression, 24-bit RGB or 32-bit RGBA color depth, and <em>transparency</em>.<br />
For our examples below, we need to have a watermark image that is the same size (width x height in pixels) as our video frames AND has a transparent background through which our video can be seen.
</div>
<p><strong>Input/Source Video</strong>:</p>
<div style="padding-left:2em; padding-right:2em;">
We need a video to which we are going to add the watermark.  This is our input or source video.  The video must be in a compatible format (<a href="https://en.wikipedia.org/wiki/Comparison_of_container_formats" title="Wikipedia: comparison of container formats">container</a>) and encoding (<a href="https://en.wikipedia.org/wiki/Comparison_of_video_codecs" title="Wikipedia: comparison of video codecs">codec</a>).  There are <em>many</em> of these with various features.  Most are proprietary and not widely supported due to patent restrictions.
</div>
<p><strong>Encoding/Muxing</strong>:</p>
<div style="padding-left:2em; padding-right:2em;">
<a href="http://www.techterms.com/definition/encoding" title="TechTerms: Encoding">Encoding</a> (in this context) is the process of transforming digital content from one standard to another, often with accompanying compression and other useful features.  These standards are implemented as <a href="https://en.wikipedia.org/wiki/Codec" title="Wikipedia: Codec">codecs</a>.<br />
<a href="https://en.wikipedia.org/wiki/Muxing" title="Wikipedia: Mux / Multiplex">Muxing</a> (or <a href="https://en.wikipedia.org/wiki/Muxing" title="Wikipedia: Mux / Multiplex">multiplexing</a>) is the process of combining multiple streams into one, shared medium.  For our purposes, these shared media are video and audio <a href="https://en.wikipedia.org/wiki/Container_format_%28digital%29" title="Wikipedia: Container format">container formats</a>.</p>
<p>There are a lot of video and audio encoder/muxers.  In our case, we have two, popular, command-line options: <a href="http://ffmpeg.org/" title="FFmpeg project website">FFmpeg</a> and <a href="https://libav.org/" title="Libav project website" target="_blank">Libav</a>.</p>
<p>The FFmpeg project has been around for quite some time, so it is widely distributed and ported to a variety of platforms and operating systems.  After a little political shuffle at FFmpeg, some of the active developers forked from the project to form the Libav project.  If you are running a modern Linux distribution, you may already have one of these installed or you may be able to easily obtain it from a standard software repository.  Additional installation options can be found on the project websites.</p>
<p>Be aware that you may not be able to use certain formats or codecs due to the patent laws of your country.  Once you have installed a legitimate version of the Libav tools or FFmpeg tools, you may check which formats are actually supported by issuing:</p>
<blockquote><p>avconv -formats</p></blockquote>
<p><em>-or-</em></p>
<blockquote><p>ffmpeg -formats</p></blockquote>
<p>After issuing one of these commands, you should see a three-column list.  The first column contains &#8216;D&#8217;, &#8216;E&#8217;, or &#8216;DE&#8217;, indicating whether a demuxer, muxer, or both (respectively) are available for the container specified in the second column.  The third column is just a longer name for the container.</p>
<p>As you probably guessed, supported codecs can be checked by replacing <em>-formats</em> with <em>-codecs</em>.<br />
Consult the appropriate project pages for complete explanations of the information printed by these commands.
</div>
<p>&nbsp;</p>
<p>Okay, now let&#8217;s get on with it &#8230;</p>
<p>
<strong>Example 1</strong><br />
In this example, we are going to overlay our watermark image (watermark.png) onto an <a href="https://en.wikipedia.org/wiki/Moving_Picture_Experts_Group" title="Wikipedia: MPEG">MPEG</a>-2 video (input.mpg) and output the result as another MPEG-2 video (output1.mpg) with no audio.</p>
<blockquote><p>
ffmpeg -i input.mpg -vf &#8220;movie=watermark.png [watermark];[in][watermark] overlay=0:0 [out]&#8221; -c:v mpeg2video -an output1.mpg
</p></blockquote>
<p>The equivalent command using avconv from the Libav project is:</p>
<blockquote><p>
avconv -i input.mpg -vf &#8220;movie=watermark.png [watermark];[in][watermark] overlay=0:0 [out]&#8221; -c:v mpeg2video -an output1.mpg
</p></blockquote>
<p>
Let&#8217;s break this down a bit:</p>
<ul>
<li><em>-i input.mpg</em> specifies the input video</li>
<li><em>-vf &#8220;&#8230;&#8221;</em> specifies that a video filter is to be used</li>
<li><em>movie=watermark.png [watermark];</em> starts the video filter graph by specifying watermark.png as a movie stream and naming it <em>[watermark]</em> &#8211; just about any name could be used</li>
<li><em>[in] [watermark] overlay=0:0 [out]</em> overlays the input video stream with the watermark &#8220;movie&#8221; and sends it to the output stream &#8211; positioning is handled by <em>overlay=0:0</em>, which means that the watermark image will perfectly overlap each video frame &#8211; this is why our watermark image had to be the same size as our video frame and have a transparent background &#8211; and, yes, you could take a smaller image and precisely position it pretty much anywhere within a video frame, but let&#8217;s save this complexity for later.</li>
<li><em>-an</em> tells the tool to drop the audio from the output</li>
<li><em>output1.mpg</em> specifies the output file &#8211; its extension (.mpg) tells the tool which container to use.
</ul>
</p>
<p>
<strong>Example 2</strong><br />
Let&#8217;s repeat this operation but keep the audio this time :</p>
<blockquote><p>
avconv -i input.mpg -vf &#8220;movie=watermark.png [watermark];[in][watermark] overlay=0:0 [out]&#8221; -c:v mpeg2video -c:a copy output2.mpg
</p></blockquote>
<p>Just replace <em>avconv</em> with <em>ffmpeg</em>, if you are using ffmpeg.
</p>
<p>
<strong>Example 3</strong><br />
MPEG-2 video with an embedded AC3 track is used by a lot of standard definition video cameras, but we are not limited to these.  In fact, there are some far more efficient and flexible codecs and formats we may be able to use.</p>
<p>In this example, we will re-encode our video with a <a href="https://en.wikipedia.org/wiki/H.264" title="Wikipedia: H.264 / MPEG-4 AVC">H.264 codec</a>, our audio with a <a href="https://en.wikipedia.org/wiki/MP3" title="Wikipedia: MP3 / MPEG-2 audio Layer III">MP3</a> codec, and put the resulting video in a <a href="https://en.wikipedia.org/wiki/MPEG-4_Part_14" title="Wikipedia: MPEG-4 Part 14 / MP4">MP4</a> container.</p>
<blockquote><p>
avconv -i input.mpg -vf &#8220;movie=watermark.png [watermark];[in][watermark] overlay=0:0 [out]&#8221; -c:v libx264 -preset slow -crf 20 -c:a libmp3lame -b:a 192k output3.mp4
</p></blockquote>
<p>Here, &#8220;-c:v libx264 -preset slow -crf 20&#8243; specifies that we use the libx264 implementation of the H.264 standard with the &#8220;slow&#8221; preset and a constant rate factor of 20 for pretty awesome quality.  We encode the audio with the libmp3lame implementation of the MPEG-2 Layer III audio codec and use a bit rate of 192,000 bits per second.  And, finally, the &#8220;.mp4&#8243; extension is recognized so the final product is placed in a MP4 container.  <em>Okay, yes, these settings are probably a bit overkill for something that started as a MPEG-2 video &#8230; it&#8217;s just an example, remember?</em>
</p>
<p>&nbsp;</p>
<p>
It would be nice (or, perhaps, to avoid violating laws) for us to use free or unencumbered video and audio formats.  There are plenty from which we can choose.  One of the most flexible and extensible, free and open source multimedia container formats is <a href="http://www.matroska.org/" title="Matroska Project">Matroska</a>.  Matroska is recognized by <em>avconv</em> and <em>ffmpeg</em> by its .mkv extension and can also be specified with the <em>-f Matroska</em> option.</p>
<p>The <a href="https://www.xiph.org/" title="Xiph.org Foundation">Xiph.org Foundation</a> produces free and open video (<a href="http://www.theora.org/" title="Theora Project">Theora</a>) and audio (<a href="http://www.vorbis.com/" title="Vorbis Project">Vorbis</a>) codecs as well as the OGG container.</p>
<p>In 2010, Google acquired the VP8 encoding technology from On2 Technologies and released it, royalty-free, to the open source community.  The <a href="http://www.webmproject.org/" title="WebM Project">WebM</a> project defines a format optimized for the Web, which contains VP8-encoded video and Vobis-encoded audio.
</p>
<p>
Well, this was fun!  Hopefully, we will have a chance to do some more of this in a future article.</p>
]]></content:encoded>
			<wfw:commentRss>http://tealscientific.com/blog/?feed=rss2&#038;p=1961</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Green-Winged Macaw</title>
		<link>http://tealscientific.com/blog/?p=1931</link>
		<comments>http://tealscientific.com/blog/?p=1931#comments</comments>
		<pubDate>Thu, 14 Mar 2013 15:36:37 +0000</pubDate>
		<dc:creator>terry</dc:creator>
				<category><![CDATA[Environment]]></category>
		<category><![CDATA[Gallery]]></category>
		<category><![CDATA[Nature]]></category>

		<guid isPermaLink="false">http://tealscientific.com/blog/?p=1931</guid>
		<description><![CDATA[<p class="wp-caption-text">Green-Winged Macaw</p> <p>This green-winged macaw (a.k.a. red-and-green macaw) was seen at the Alligator Farm Zoological Park in St. Augustine, FL.</p> <p>The green-winged macaw (scientific name, Ara chloropterus) is a neotropical parrot found in the woodlands and forests of northern and central South America. While its colorful plumage is mostly red, like the scarlet macaw <span style="color:#777"> . . . &#8594; Read More: <a href="http://tealscientific.com/blog/?p=1931">Green-Winged Macaw</a></span>]]></description>
				<content:encoded><![CDATA[<div id="attachment_1930" class="wp-caption aligncenter" style="width: 310px"><a href="http://tealscientific.com/blog/wp-content/uploads/2013/03/tls20121206_DSC_1788_macaw_1920x1201.jpg" title="click to enlarge"><img src="http://tealscientific.com/blog/wp-content/uploads/2013/03/tls20121206_DSC_1788_macaw_1920x1201-300x187.jpg" alt="Green-Winged Macaw" width="300" height="187" class="size-medium wp-image-1930" /></a><p class="wp-caption-text">Green-Winged Macaw</p></div>
<p>This <a href="https://en.wikipedia.org/wiki/Green-winged_Macaw" title="Wikipedia: Red-and-green Macaw">green-winged macaw</a> (a.k.a. red-and-green macaw) was seen at the <a href="http://www.alligatorfarm.com/" title="St. Augustine Alligator Farm Zoological Park" target="_blank">Alligator Farm</a> Zoological Park in St. Augustine, FL.</p>
<p>The green-winged macaw (scientific name, <em>Ara chloropterus</em>) is a neotropical parrot found in the woodlands and forests of northern and central South America.  While its colorful plumage is mostly red, like the scarlet macaw (<em>Ara macao</em>), its wing <a href="https://en.wikipedia.org/wiki/Covert_%28feather%29" title="Wikipedia: Covert feather">covert feathers</a> are mostly green but may contain some yellow.  The green-winged macaw can also be identified by lines of tiny, red feathers in the white patches around its eyes.</p>
<p>Macaws have powerful, curved beaks that help them crack nuts and seeds, which, along with various fruits, stems, and leaves, make up the majority of their diets.  Macaws are also seen to flock to and consume clay from exposed river banks, preferentially <a href="http://www.gigapan.com/gigapans/67800/" title="GigaPan: World's Largest Macaw Clay Lick by Jeff Cremer" target="_blank">clay licks</a> with higher concentrations of sodium.  It is hypothesized that these salt-enriched clays provide a necessary supplement to the birds&#8217; diets.</p>
<p>(c) <a href="http://tealcomp.com/" title="TealComp.com">TealComp.com</a> 20121207<br />
<a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/deed.en_US"><img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/88x31.png" /></a><br />This work is shared under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/deed.en_US">Creative Commons Attribution-ShareAlike 3.0 Unported License</a>.</p>
<p><script type="text/javascript"><!--
google_ad_client = "ca-pub-5999018131651479";
/* half_banner */
google_ad_slot = "9084909511";
google_ad_width = 234;
google_ad_height = 60;
//-->
</script><br />
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://tealscientific.com/blog/?feed=rss2&#038;p=1931</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
