Monday, January 31, 2011

ROOTS
The Newton method can be used to find the solutions of
f(x)=0 
Suppose x0 is a sufficiently close approximation to a solution.  Then a better approximation x1is found by:
                   f(x0)
x1= x0 -
 ¾¾¾
                  f ’(x0)
The specified interval is explored for changes in the sign of the function.  If one is detected in a given subinterval, then a root must lie inside that subinterval. The center of it is then chosen as a first approximation and Newton's method applied to obtain the sequence of approximations:  x0, x1, x2, ... , xn.  The xn is assumed correct if it differs from the previous value in the sequence by less than the specified error.
SYSTEMS OF SIMULTANEOUS NONLINEAR EQUATIONS
Suppose that, instead of a single nonlinear equation, we have a systems system of simultaneous nonlinear equations. We can solve it using the generalized Newton method, which is just a generalization of what we did to find the roots of a one-variable function. To illustrate, suppose we want to solve the system:

F(x,y,z) = 0  ;  G(x,y,z) = 0  ;  H(x,y,z) = 0         (I)
Assume (x0,y0,z0) is close to a solution.  Now expand all three equations into their Taylor series.  Neglecting terms of order higher than the first, we get:
Fx*(x-x0) + Fy*(y-y0) + Fz*(z-z0) = - F(x0,y0,z0)
Gx*(x-x0) + Gy*(y-y0) + Gz*(z-z0) = - G(x0,y0,z0)          (II)
Hx*(x-x0) + Hy*(y-y0) + Hz*(z-z0) = - H(x0,y0,z0)
            F        F         F
where  Fx = ———, Fy = ———— , Fz = ——— , all evaluated at (x0,y0,z0).
           
x        y         z
Similarly for Gx, Gy, Gz, Hx, Hy, Hz.
Solving system (II) for (x-x0), (y- y0) and (z-z0), we obtain corrections on the initial approximation, that is, if its solutions are Dx, Dy and Dz, where
x-x0=Dx;  y-y0=Dy ;  z-z0=Dz
then a closer approximation to the solution is
x1=x0+Dx ;  y1=y0+Dy ;  z1=z0+Dz
We now use x1, y1 and z1 as initial approximations and again set a system of linear equations then solve it to obtain x2, y2, and z2.  This process is continued until all the variables in the current approximation in the sequence differ from the values of the previous approximation by less than the specified error and all equations differ from zero by less than said error.
funactions 

Available Functions

In addition to the functions generally available, this program lets you use 8 additional mathematical functions. These are sinh, cosh, tanh, asinh, acosh, atanh, asin, acos. They return, correspondingly, the hyperbolic sine, cosine, and tangent, inverse hyperbolic sine, cosine, and tangent, inverse trigonometric sine and cosine.
Below is a list of the functions available, including the 8 that have been added.
FUNCTIONS:     RETURNS:
sgn            sign
int            integer value (fractions are discarded)
cint           integer value (fractions are rounded)
abs            absolute value
rnd            random
sqr            square root
log            natural logarithm
exp            exponential
sin            trigonometric sine
cos            trigonometric cosine
tan            trigonometric tangent
asin           inverse trigonometric sine
acos           inverse trigonometric cosine
atn            inverse trigonometric tangent
sinh           hyperbolic sine
cosh           hyperbolic cosine
tanh           hyperbolic tangent
asinh          inverse hyperbolic sine
acosh          inverse hyperbolic cosine
atanh          inverse hyperbolic tangent

Available Operators

Arithmetic Operators (In order of precedence)
Negation (-)
Exponentiation (^)
Multiplication and division (*, /)
Integer division (\)
Modulus arithmetic (mod)

Addition and subtraction (+, -)

Comparison Operators (These all have EQUAL precedence)
Equality (=)
Inequality (<>)
Less than (<)
Greater than (>)
Less than or equal to (<=)
Greater than or equal to (>=)

Logical Operators (In order of precedence)
Negation (not)
Conjunction (and)
Disjunction (or)
Exclusion (xor)
Equivalence (eqv)
Implication (imp)

Notes:
If an expression contains operators from different categories, the Arithmetic Operators are evaluated first, then the Comparison Operators, then the Logical Operators. For each category, the precedence is as listed above.
When operators of equal precedence are found, they are evaluated in order of appearance from left to right.
Parentheses always override Operator Precedence rules. Expressions are evaluated from the inside out, starting with the innermost set of parentheses. Use parentheses to eliminate any possible ambiguity.
You’ll probably use the Arithmetic Operators more often than the others.
Built-in Constants
The constants pi and e are built-in for your convenience:
pi = 3.14159… = atn(1)*4
 

mathmatic numarical

INTEGRATION

Suppose we want to find 
x4
òf(x)dx
x0
Many different numerical methods exist to approximate such an integral. Here we use a 4-point Newton-Cotes formula.
We can approximate f(x) in the interval [x0,x4] by a polynomial, then analytically integrate the polynomial term by term. The higher the degree of the polynomial, the greater the accuracy of the resulting approximation to the integral. Here we use the fourth degree polynomial f(x)=a x4+b x3+c x2+d x+e, and use the method of Undetermined Coefficients to find a, b, c, d and e. If we then analytically integrate this polynomial term by term, the result is an approximation to the integral of f(x) from x0 to x4, and it is:
x4
òf(x)dx»2h/45[7f(x0)+32f(x1)+12f(x2)+32f(x3)+7f(x4)]
x0
where h=(x4-x0)/4 and the selected points are equally spaced.  If we have n subintervals, with n being a multiple of 4, we have the following extended formula,
xn
ò
f(x)dx»2h/45[7f(x0)+32f(x1)+12f(x2)+32f(x3)+14f(x4)+...+7f(
xn)]
x0
in which h=(xn-x0)/n:
The integration is performed once and the result stored.  It is then performed again with twice as many subintervals and the result compared with the previous one.  The process is continued until two conditions are met:
a) The result differs from the previous one by less than the specified error.
b) The number of subintervals is at least the number specified by the user.
MULTIPLE INTEGRATION

Suppose what we want is a Multiple Integral. OK, then suppose f(x) above is in turn an integral, for example, over the variable y, with limits that may be functions of x.  We would then have a double integral
 d     b(x)
ò  ò g(x,y) dy dx
 c     a(x)
If we group it like this:
 d            b(x)
ò [  ò g(x,y) dy ]dx
 c            a(x)
we see that the part inside the brackets is something like f(x).
We would first perform the integration over y. For such integration over y we would in turn use the method previously described. Again, y itself may be an integral over another variable, say z, and so on.
Each integration is performed once and the result stored.  It is then performed again with twice as many subintervals and the result compared with the previous one.  The process is continued until two conditions are met:
a) The result differs from the previous one by less than the specified error.
b) The number of subintervals is at least the number specified by the user.
DIFFERENTIATION

Some central difference formulas to find derivates:
First derivative:
               f(x-2h)-8f(x-h)+8f(x+h)-f(x+2h)
f ’(x) = ¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾
                                       12h
Second derivative:
               -f(x-2h)+16f(x-h)-30f(x)+16f(x+h)-f(x+2h)
f ’’(x) =
¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾
                                              12h2
Higher derivatives:
    1           n                         n!
¾¾¾     
S   (-1)n  ¾¾¾¾¾¾   f( x+ (n-2k)h )
(2h)
n     k=0               (n-k)!  k!
In all cases h is a small quantity.
PARTIAL DIFFERENTIATION
Here we use the convention
          F                   ²F                   ²F
Fx =
¾¾  , F xx = ¾¾¾  , Fxy = ¾¾¾
         
x                   x²                  xy
and similarly for all other combinations.
Suppose we have a function of 4 variables F(x,y,z,t). If h is a small quantity, then the first and second order partial derivatives of F(x,y,z,t) can be approximated by the following expressions. Here we assume that the function and all of its 1st and 2nd order partial derivatives are continuous at the point we’re interested in.
            F(x-2h,y,z,t)-8*F(x-h,y,z,t)+8*F(x+h,y,z,t)-F(x+2h,y,z,t)
F
x =
  ¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾
                                                            12h

    
        F(x,y-2h,z,t)-8*F(x,y-h,z,t)+8*F(x,y+h,z,t)-F(x,y+2h,z,t)
F
y
=  ¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾
                                                            12h

           F(x,y,z-2h,t)-8*F(x,y,z-h,t)+8*F(x,y,z+h,t)-F(x,y,z+2h,t)
Fz
= 
¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾
                                                            12h

           F(x,y,z,t-2h)-8*F(x,y,z,t-h)+8*F(x,y,z,t+h)-F(x,y,z,t+2h)
Ft
= 
¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾
                                                           12h

              -F(x-2h,y,z,t)+16*F(x-h,y,z,t)-30*F(x,y,z,t)+16*F(x+h,y,z,t)-F(x+2h,y,z,t)
Fxx
=  ¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾
                                                                               12h²

              -F(x,y-2h,z,t)+16*F(x,y-h,z,t)-30*F(x,y,z,t)+16*F(x,y+h,z,t)-F(x,y+2h,z,t)
Fyy
=  ¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾
                                                                               12h²

     
       -F(x,y,z-2h,t)+16*F(x,y,z-h,t)-30*F(x,y,z,t)+16*F(x,y,z+h,t)-F(x,y,z+2h,t)
Fzz
= 
¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾
                                                                              12h²

             -F(x,y,z,t-2h)+16*F(x,y,z,t-h)-30*F(x,y,z,t)+16*F(x,y,z,t+h)-F(x,y,z,t+2h)
Ftt
=  ¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾
                                                                              12h²

               Fx
(x,y-2h,z,t)-8*Fx(x,y-h,z,t)+8*Fx(x,y+h,z,t)-Fx(x,y+2h,z,t)
Fxy
=  ¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾
                                                                  12h

               Fx
(x,y,z-2h,t)-8*Fx(x,y,z-h,t)+8*Fx(x,y,z+h,t)-Fx(x,y,z+2h,t)
Fx
z =  ¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾
                                                                 12h

               Fx
(x,y,z,t-2h)-8*Fx(x,y,z,t-h)+8*Fx(x,y,z,t+h)-Fx(x,y,z,t+2h)
Fx
t =  ¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾
                                                                 12h

               Fy
(x,y,z-2h,t)-8*Fy(x,y,z-h,t)+8*Fy(x,y,z+h,t)-Fy(x,y,z+2h,t)
Fy
z =  ¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾
                                                                 12h

               Fy
(x,y,z,t-2h)-8*Fy(x,y,z,t-h)+8*Fy(x,y,z,t+h)-Fy(x,y,z,t+2h)
Fy
t =  ¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾
                                                                 12h

               F
z(x,y,z,t-2h)-8*Fz(x,y,z,t-h)+8*Fz(x,y,z,t+h)-Fz(x,y,z,t+2h)
F
zt =  ¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾
                                                                 12h

Accounting, Finance and Economics

Summary

This document defines "Free Cultural Works" as works or expressions which can be freely studied, applied, copied and/or modified, by anyone, for any purpose. It also describes certain permissible restrictions that respect or protect these essential freedoms. The definition distinguishes between free works, and free licenses which can be used to legally protect the status of a free work. The definition itself is not a license; it is a tool to determine whether a work or license should be considered "free."

Preamble

Social and technological advances make it possible for a growing part of humanity to access, create, modify, publish and distribute various kinds of works - artworks, scientific and educational materials, software, articles - in short: anything that can be represented in digital form. Many communities have formed to exercise those new possibilities and create a wealth of collectively re-usable works.
Most authors, whatever their field of activity, whatever their amateur or professional status, have a genuine interest in favoring an ecosystem where works can be spread, re-used and derived in creative ways. The easier it is to re-use and derive works, the richer our cultures become.
To ensure the graceful functioning of this ecosystem, works of authorship should be free, and by freedom we mean:
  • the freedom to use the work and enjoy the benefits of using it
  • the freedom to study the work and to apply knowledge acquired from it
  • the freedom to make and redistribute copies, in whole or in part, of the information or expression
  • the freedom to make changes and improvements, and to distribute derivative works
If authors do not take action, their works are covered by existing copyright laws, which severely limit what others can and cannot do. Authors can make their works free by choosing among a number of legal documents known as licenses. For an author, choosing to put their work under a free license does not mean that they lose all their rights, but it gives to anyone the freedoms listed above.
It is important that any work that claims to be free provides, practically and without any risk, the aforementioned freedoms. This is why we hereafter give a precise definition of freedom for licenses and for works of authorship.

Identifying Free Cultural Works

This is the Definition of Free Cultural Works, and when describing your work, we encourage you to make reference to this definition, as in, "This is a freely licensed work, as explained in the Definition of Free Cultural Works." If you do not like the term "Free Cultural Work," you can use the generic term "Free Content," or refer instead to one of the existing movements that express similar freedoms in more specific contexts. We also encourage you to use the Free Cultural Works logos and buttons, which are in the public domain.
Please be advised that such identification does not actually confer the rights described in this definition; for your work to be truly free, it must use one of the Free Culture Licenses or be in the public domain.
We discourage you to use other terms to identify Free Cultural Works which do not convey a clear definition of freedom, such as "Open Content" and "Open Access." These terms are often used to refer to content which is available under "less restrictive" terms than those of existing copyright laws, or even for works that are just "available on the Web".

Defining Free Culture Licenses

Licenses are legal instruments through which the owner of certain legal rights may transfer these rights to third parties. Free Culture Licenses do not take any rights away -- they are always optional to accept, and if accepted, they grant freedoms which copyright law alone does not provide. When accepted, they never limit or reduce existing exemptions in copyright laws.

Essential freedoms

In order to be recognized as "free" under this definition, a license must grant the following freedoms without limitation:
  • The freedom to use and perform the work: 
  • The licensee must be allowed to make any use, private or public, of the work. For kinds of works where it is relevant, this freedom should include all derived uses ("related rights") such as performing or interpreting the work. There must be no exception regarding, for example, political or religious considerations.
  • The freedom to study the work and apply the information: 
  • The licensee must be allowed to examine the work and to use the knowledge gained from the work in any way. The license may not, for example, restrict "reverse engineering".
  • The freedom to redistribute copies: 
  • Copies may be sold, swapped or given away for free, as part of a larger work, a collection, or independently. There must be no limit on the amount of information that can be copied. There must also not be any limit on who can copy the information or on where the information can be copied.
  • The freedom to distribute derivative works: 
  • In order to give everyone the ability to improve upon a work, the license must not limit the freedom to distribute a modified version (or, for physical works, a work somehow derived from the original), regardless of the intent and purpose of such modifications. However, some restrictions may be applied to protect these essential freedoms or the attribution of authors (see below).

Permissible restrictions

Not all restrictions on the use or distribution of works impede essential freedoms. In particular, requirements for attribution, for symmetric collaboration (i.e., "copyleft"), and for the protection of essential freedom are considered permissible restrictions.

Defining Free Cultural Works

In order to be considered free, a work must be covered by a Free Culture License, or its legal status must provide the same essential freedoms enumerated above. It is not, however, a sufficient condition. Indeed, a specific work may be non-free in other ways that restrict the essential freedoms. These are the additional conditions in order for a work to be considered free:
  • Availability of source data: 
  • Where a final work has been obtained through the compilation or processing of a source file or multiple source files, all underlying source data should be available alongside the work itself under the same conditions. This can be the score of a musical composition, the models used in a 3D scene, the data of a scientific publication, the source code of a computer application, or any other such information.
  • Use of a free format: 
  • For digital files, the format in which the work is made available should not be protected by patents, unless a world-wide, unlimited and irrevocable royalty-free grant is given to make use of the patented technology. While non-free formats may sometimes be used for practical reasons, a free format copy must be available for the work to be considered free.
  • No technical restrictions: 
  • The work must be available in a form where no technical measures are used to limit the freedoms enumerated above.
  • No other restrictions or limitations:
  •   The work itself must not be covered by legal restrictions (patents, contracts, etc.) or limitations (such as privacy rights) which would impede the freedoms enumerated above. A work may make use of existing legal exemptions to copyright (in order to cite copyrighted works), though only the portions of it which are unambiguously free constitute a free work.
In other words, whenever the user of a work cannot legally or practically exercise his or her basic freedoms, the work cannot be considered and should not be called "free."

Versioning

New versions of this definition shall be released as soon as a consensus (achieved directly or through a vote, as per the authoring process) has developed around suggested changes. Numbering shall be 0.x for initial draft releases, 1.x, 2.x .. for major releases, x.1, x.2 .. for minor releases. A minor release is made when the text is modified in ways which do not have an impact on the scope of existing or hypothetical licenses covered by this definition.

Media Foundation

Microsoft Media Foundation
(MF) is a COM-based multimedia framework pipeline and infrastructure platform for digital media in Windows Vista & Windows 7. It is the intended replacement for Microsoft DirectShow, Windows Media SDK, DirectX Media Objects (DMOs) and all other legacy multimedia APIs such as Audio Compression Manager (ACM) and Video for Windows (VfW). The existing DirectShow technology is intended to be replaced by Media Foundation step-by-step, starting with a few features. For some time there will be a co-existence of Media Foundation and DirectShow. Media Foundation will not be available for previous Windows versions, including Windows XP.
The first release, present in Windows Vista, focuses on audio and video playback quality, high-definition content (i.e. HDTV), content protection and a more unified approach for digital data access control for digital rights management (DRM) and its interoperability. It integrates DXVA 2.0 for offloading more of the video processing pipeline to hardware, for better performance. Videos are processed in the colorspace they were encoded in, and are handed off to the hardware, which composes the image in its native colorspace. This prevents intermediate colorspace conversions to improve performance. MF includes a new video renderer, called Enhanced Video Renderer (EVR), which is the next iteration of VMR 7 and 9. EVR has better support for playback timing and synchronization. It uses the Multimedia Class Scheduler Service (MMCSS), a new service that prioritizes real time multimedia processing, to reserve the resources required for the playback, without any tearing or glitches.

Architecture

Media Foundation Architecture
The MF architecture is divided into the Control layer, Core Layer and the Platform layer. The core layer encapsulates most of the functionality of Media Foundation. It consists of the media foundation pipeline, which has three components: Media Source, Media Sink and Media Foundation Transforms (MFT). A media source is an object that acts as the source of multimedia data, either compressed or uncompressed. It can encapsulate various data sources, like a file, or a network server or even a camcorder, with source specific functionality abstracted by a common interface. A source object can use a source resolver object which creates a media source from an URI, file or bytestream. Support for non-standard protocols can be added by creating a source resolver for them. A source object can also use a sequencer object to use a sequence of sources (a playlist) or to coalesce multiple sources into single logical source. A media sink is the recipient of processed multimedia data. A media sink can either be a renderer sink, which renders the content on an output device, or an archive sink, which saves the content onto a persistent storage system such as a file. A renderer sink takes uncompressed data as input whereas an archive sink can take either compressed or uncompressed data, depending on the output type. The data from media sources to sinks are acted upon by MFTs; MFTs are certain functions which transform the data into another form. MFTs can include multiplexers and demultiplexers, codecs or DSP effects like reverb. The core layer uses services like file access and networking and clock synchronization to time the multimedia rendering. These are part of the Platform layer, which provides services necessary for accessing the source and sink byte streams, presentation clocks and an object model that lets the core layer components function asynchronously, and is generally implemented as OS services. Pausing, stopping, fast forward, reverse or time-compression can be achieved by controlling the presentation clock.
However, the media pipeline components are not connected; rather they are just presented as discrete components. An application running in the Control layer has to choose which source types, transforms and sinks are needed for the particular video processing task at hand, and set up the "connections" between the components (a topology) to complete the data flow pipeline. For example, to play back a compressed audio/video file, the pipeline will consist of a file source object, a demultiplexer for the specific file container format to split the audio and video streams, codecs to decompress the audio and video streams, DSP processors for audio and video effects and finally the EVR renderer, in sequence. Or for a video capture application, the camcorder will act as video and audio sources, on which codec MFTs will work to compress the data and feed to a multiplexer that coalesces the streams into a container; and finally a file sink or a network sink will write it to a file or stream over a network. The application also has to co-ordinate the flow of data between the pipeline components. The control layer has to "pull" (request) samples from one pipeline component and pass it onto the next component in order to achieve data flow within the pipeline. This is in contrast to DirectShow's "push" model where a pipeline component pushes data to the next component. Media Foundation allows content protection by hosting the pipeline within a protected execution environment, called the Protected Media Path. The control layer components are required to propagate the data through the pipeline at a rate that the rendering synchronizes with the presentation clock. The rate (or time) of rendering is embedded as a part of the multimedia stream as metadata. The source objects extract the metadata and pass it over. Metadata is of two types: coded metadata, which is information about bit rate and presentation timings, and descriptive metadata, like title and author names. Coded metadata is handed over to the object that controls the pipeline session, and descriptive metadata is exposed for the application to use if it chooses to.
Media Foundation provides a Media Session object that can be used to setup the topologies, and facilitate a data flow, without the application doing it explicitly. It exists in the control layer, and exposes a Topology loader object. The application specifies the required pipeline topology to the loader, which then creates the necessary connections between the components. The media session object manages the job of synchronizing with the presentation clock. It creates the presentation clock object, and passes a reference to it to the sink. It then uses the timer events from the clock to propagate data along the pipeline. It also changes the state of the clock to handle pause, stop or resume requests from the application.

Media Foundation Transform

Media Foundation Transforms (MFTs) represent a generic model for processing media data. They are used in Media Foundation primarily to implement decoders, encoders, mixers and digital signal processors (DSPs) – between media sources and media sinks. Media Foundation Transforms are an evolution of the transform model first introduced with DirectX Media Objects (DMOs). Hybrid DMO/MFT Objects can also be created. Applications can use MFTs inside the Media Foundation pipeline, or use them directly as stand-alone objects. MFTs also support hardware-accelerated video processing and their behaviors are more clearly specified. MFTs can be any of the following type:
  • Audio and video codecs
  • Audio and video effects
  • Multiplexers and demultiplexers
  • Tees
  • Color-space converters
  • Sample-rate converters
  • Video scalers
Microsoft recommends developers to write a Media Foundation Transform instead of a DirectShow filter, for Windows Vista & Windows 7. For video editing and video capture, Microsoft recommends using DirectShow as they are not the primary focus of Media Foundation in Windows Vista.
Enhanced Video Renderer
Media Foundation uses the Enhanced Video Renderer (EVR) for rendering video content, which acts as a mixer as well. It can mix up to 16 simultaneous streams, with the first stream being a reference stream. All but the reference stream can have per-pixel transparency information, as well as any specified z-order. The reference stream cannot have transparent pixels, and has a fixed z-order position, at the back of all streams. The final image is composited onto a single surface by coloring each pixel according to the color and transparency of the corresponding pixel in all streams.
Internally, the EVR uses a mixer object for mixing the streams. It can also deinterlace the output and apply color correction, if required. The composited frame is handed off to a presenter object, which schedules them for rendering onto a Direct3D device, which it shares with the DWM and other applications using the device. The frame rate of the output video is synchronized with the frame rate of the reference stream. If any of the other streams (called substreams) have a different frame rate, EVR discards the extra frames (if the substream has a higher frame rate), or uses the same frame more than once (if it has a lower frame rate).

Supported media formats

Windows Media Audio and Windows Media Video are the only default supported formats for encoding through Media Foundation in Windows Vista. For decoding, an MP3 file source is available in Windows Vista to read MP3 streams but an MP3 file sink to output MP3 is only available in Windows 7 Format support is extensible however; developers can add support for other formats by writing encoder/decoder MFTs and/or custom media sources/media sinks.
Windows 7 expands upon the codec support available in Windows Vista. It includes AVI, WAV, AAC/ADTS file sources to read the respective formats  an MPEG-4 file source to read MP4, M4A, M4V, MP4V, MOV and 3GP container formats and an MPEG-4 file sink to output to MP4 format  Windows 7 also includes a media source to read MPEG transport stream/BDAV MPEG-2 transport stream (M2TS, MTS, M2T and AVCHD) files.
Similar to Windows Vista, transcoding (encoding) support is not exposed through any built-in Windows application but several codecs are included as Media Foundation Transforms (MFTs) In addition to Windows Media Audio and Windows Media Video encoders and decoders, and ASF file sink and file source introduced in Windows Vista, Windows 7 includes an H.264 encoder with Baseline profile level 3 and Main profile support and an AAC Low Complexity (AAC-LC) profile encoder 
For playback of various media formats, Windows 7 also introduces an H.264 decoder with Baseline, Main, and High profile support, up to level 5.1, AAC-LC and HE-AAC v1 (SBR) multichannel, HE-AAC v2 (PS) stereo decoders, MPEG-4 Part 2 Simple Profile and Advanced Simple Profile decoders  which includes decoding popular codec implementations such as DivX, Xvid and Nero Digital as well as MJPEGand DV  MFT decoders for AVI. Windows Media Player 12 uses the built-in Media Foundation codecs to play these formats by default.
MIDI playback is also not yet supported using Media Foundation.

Benefits over DirectShow

Media Foundation offers the following benefits:
  • Is scalable for high-definition content and DRM-protected content.
  • Allows DirectX Video Acceleration to be used outside of the DirectShow infrastructure. DXVA 2.0 is available to user-mode components without using the DirectShow video renderer.
  • Provides better resilience to CPU, I/O, and memory stress for low-latency glitch-free playback of audio and video. Video tearing has been minimized. The improved video processing support also enables high color spaces and enhanced full-screen playback. Enhanced video renderer (EVR) which is also available for DirectShow, offers better timing support and improved video processing.
  • Media Foundation extensibility enables different content protection systems to operate together.
  • Media Foundation uses the Multimedia Class Scheduler Service (MMCSS), a new system service in Windows Vista & Windows 7. MMCSS enables multimedia applications to ensure that their time-sensitive processing receives prioritized access to CPU resources

True IT confessions

Supergeeks fess up to some of the dumbest things they've ever done

it's one of the unwritten laws of physics: At some time or another, everybody screws up.

But when IT pros make mistakes, they don't mess around. Entire buildings go dark. Web sites disappear. Companies grind to a halt. Because if you're going to mess up, you might as well make it count.
"I always tell my guys, hey, you're gonna do stupid stuff," says Rich Casselberry, director of IT operations at Enterasys, a networking systems vendor. "It's OK to do something stupid if you have the wrong information. But if you do something stupid because you're stupid, that's a problem. The trick is to not flip out, which only makes it worse, or try to hide it. You need to figure out how to keep it from happening again."
[ For more adventures in IT mishaps, check out Stupid user tricks
3: IT admin follies and Stupid QA tricks: Colossal testing oversights ] 

We've gathered up some of the more egregious examples from IT pros brave enough to share their screwups with us. Backups gone bad, people with admin privileges who probably shouldn't, what can go south when you unplug the wrong equipment -- in some cases, we've obscured their identities to spare them embarrassment; other geeks, however, are perfectly willing to own up to their youthful mistakes.
Sure, some of these mishaps are amusing in retrospect. But don't laugh too hard. We know you've probably done worse.
True IT confession No. 1: The case of the mysterious invisible backup
 
Our first tale of misadventure involves a longtime IT
Harry had his share of mishaps when he started out a decade ago at a major networking equipment maker in the Northeast. There was the time he changed an environmental variable that broke everything on his company's financial apps, earning an e-mail from his boss ordering him to "never hack on this system again." Or the time he crashed the company's core ERP system by overwriting /dev/tty. Harry says after he accidentally ripped the company's T1 lines out of the wall with his pager, he was banned from ever reentering the telecom closet.
But the worst one happened after Harry installed an Emerald tape backup system. Did he bother to read the manual? Please. This was child's play. Just load install.exe and let the software do its thing.
It seemed to work perfectly. Four hours later, the first backup completed and everything looked fine.
Fast-forward six months. Harry gets a call late one night at home from one of his work pals. That night's backup tape is completely blank, the friend tells him. Worse, the last four weeks of backups are also blank.
As Harry soon discovered, that particular backup program installs in demo mode by default. Demo mode looked exactly like real mode and even took the same amount of time as an actual backup, but nothing ever got written to tape -- a fact that was noted in the manual, which Harry might have seen had he read it.
ortunately, the company used ADP for payroll processing. ADP shipped back historical payroll records, so the firm lost only a week's worth of data. The bad news? Harry was up until 3 a.m. manually stuffing payroll envelopes, along with his boss, the VP of finance, the entire payroll department, and the company's brand-new CIO, whom he met for the first time that night.
"I got to say, I was pretty popular," he jokes. "I think the only reason they didn't fire me was by that point they had gotten so used to me screwing up, they realized I couldn't do anything right."
Lessons learned? 1. Test the restores, not the backups, says Harry. "No one cares if the backup works; they care if the restore does." 2. Think before you type. 3. Remove your pager (or BlackBerry) before entering the telecom closet, just to be safe.
True IT confession No. 2: Sometimes it takes a janitor to clean up an IT mess

Late one night in 1997, Josh Stephens was working all alone at his console at a large Midwestern telecom company. Stephens was making changes to the Cisco Catalyst switches at the telco's main customer call center, which was located several states away. That's when the spanning tree protocols hit the fan.
"I'm still not sure exactly how I did it, but I caused some sort of broadcast storm and STP freak-out that locked up not only the switch I was working on but every single switch in that facility," he says. That broadcast storm brought down hundreds of call center users, stranding many of them in the middle of customer calls.
[ Of course, janitorial services and IT don't always mix: Server room. Windex. Zot. ]


Worse, the switches were "locked hard," requiring a physical power-off and a slow methodical plan to bring them back online, one at a time. The datacenter was hundreds of miles away and had no on-site IT staff, so Stephens did the next best thing: He called maintenance.
"I ended up finding a janitor that had keys to all of my LAN closets and I talked him through (a) which devices were the Catalyst switches, and (b) how to power them off," he says. "I also promised him he wouldn't get fired for helping me."
Though the call center was down for more than hour, nobody ever found out why or who was behind the glitch, says Stephens, who is now VP of technology and Head Geek (yes, that's the actual title) for SolarWinds, a maker of network management software.
Lessons learned? 1. Don't make changes without scheduling a window for them, even if the changes seem minor, says Stephens. 2. Never conduct a change control event without IT resources near the gear you're changing. 3. Be nice to the janitors. One day they might save your assets.

True IT confession No. 3: Put your hands up and step away from the terminal

One of the unavoidable facts of tech life is that when managers are given administrative rights to complex systems, bad things tend to happen.
Back in the late '80s, Johanna Rothman was director of development for a small, distributed process systems maker in the Boston area. Company management insisted on mandatory overtime for everyone, Rothman included. After three months of this, Rothman and her team were cranky and exhausted -- a recipe for disaster.
[ More manager mishaps when meddling in IT can be found in "More stupider user tricks: IT horror stories redux" ]
"One night at 9 p.m., I realize we have a bunch of files to be deleted," she says. "I'm on a Unix system, and the system won't let me delete them -- I'm not root. Well, I'm the Director. I have the root password. I log in as root. I start rm -r -- the recursive delete -- from the directory I know is the right directory. I know this."
After a few minutes, the rm command stops working. Rothman, still busy deleting all the applications, kills the job, calls the IT manager, and explains what she's done.
"He says, 'Move away from the keyboard. I'm coming in to start the restore.' I say, 'I can help. Where are the tapes?' He says, 'Go away. Just leave. I don't need more of your help.'"
The restore takes two days. Rothman says she slept in late on both days and told everyone else on her team to do the same. She also left voicemail apologies to all the developers.
"I think the only reason I didn't get fired is because management was too busy with the crisis to realize what a mess I'd made," says Rothman, who now runs her own IT consulting group and keeps a safe distance from Unix root directories.
Lesson learned? 1. There is no reason for anyone higher than the level of manager to have the root password, says Rothman. 2. Too much overtime makes people tired and stupid. The more tired they are, the stupider they get.
True IT confession No. 4: What can Brown do for you?

Here's one of those rare backup mishaps in which data did in fact get backed up. But what it got backed up to is where things goes sour.
Twenty-seven years ago, David Guggenheim had just gotten his first "real job" as biological data manager at an environmental consulting firm in Southern California. At that time, the firm's hardware consisted of a PDP-11 and a time-share IBM 360 mainframe in Los Angeles, accessed via dial-up.
"It was time to archive an important project from the IBM mainframe, so I cracked my knuckles and began pounding out the JCL [Job Control Language] necessary to write our data to tapes that would then be shipped to our office," he says. "I submitted the job, satisfied that our data would be safely backed up."

The UPS truck was filled floor to ceiling with boxes, all of them addressed to Guggenheim. He opened the first one. It was full of punch cards. And so were all the rest of them.

"It was our data from the IBM mainframe," he says. "To my horror, I realized that instead of specifying output to magnetic tape, I specified output to punch cards. I can't remember my JCL very well any more, but as I recall, it was the difference between specifying '=0' versus '=1.' I was absolutely humiliated."
It gets worse. A few days after the entire staff got involved clearing enough floor space for the mountain of boxes, the bill arrived. The cost of a punch-card backup job was nearly $1,000 (and remember, we're talking about 1982 dollars here).
"I had blown our budget out of the water, killed a forest, and still failed to back up our data onto tape," says Guggenheim, who's now Dr. David Guggenheim, Ph.D., president of 1planet 1ocean, and a senior fellow at The Ocean Foundation. "I've spent my career since then doing environmental work, so hopefully I paid penance for the dead trees."
Lessons learned? 1. Little mistakes can cause huge problems, so keep checking until it hurts. 2. Immediately own up to your errors; humility is a great teacher. 3. Take the time to appreciate the humor of a colossal screw-up, says Guggenheim. "It does wonders for the sting."

True IT confession No. 5: Unplug at your own risk

Back in the mid-'90s, Jan Aleman was interim IT manager for a major telecom company in the Netherlands. He was called in to replace a CTO who'd left under less-than-voluntary circumstances. Before the ex-CTO got canned, though, he'd ordered a $300,000 IBM failover system for the company's mission-critical billing engine.
"A very good IBM salesman had sold them this overpriced hardware, assuring them that if the primary system failed it would rollover seamlessly to the secondary one," says Aleman. "He said it was completely redundant, that nothing could go wrong. I said, 'All right, let's see if it actually works.'"

[ For more IT tales told on the down low, check out InfoWorld's weekly Off the Record blog or subscribe to the InfoWorld Off the Record RSS feed. ]


So Aleman yanked the power plug for the primary system out of the wall, right in front of the IBM salesman. All the company's core systems went dark. The critical billing engine was down for the rest of the afternoon. The phone switches still worked, but nobody in the back office could get anything done.
Though the failover system was installed and running, nobody had bothered to test it. So the next thing Aleman did was institute biweekly tests of the system on weekends.
"I unplugged the company," says Aleman, who is now CEO of Servoy, a developer of hybrid (SaaS and on-premises) software. "Needless to say, they were not very happy, but nothing bad ever happened to me. I'm still not sure how I managed to pull that off."
Lessons learned? 1. Always test systems before you bet the company on them (repeat as needed). 2. Think twice before you yank that power cord.
True IT confession No. 6: Never let another be the master of your domains

Back around 2003 or so, "Fred" (not his real name) was the IT manager for a regional cable company in the Midwest. At the time, the company had about 35,000 subscribers. To boost its business services, it decided to become a domain name reseller for Network Solutions....