Tuesday, April 8, 2014

Movies - non fiction

All the President's Men [1976] @ Wikipedia

  • All the President's Men is a 1976 American political thriller film based on the 1974 non-fiction book of the same name by Carl Bernstein and Bob Woodward, the two journalists investigating the Watergate scandal for The Washington Post. 

Bugsy - [1991] @ Wikipedia

Bugsy is a 1991 American crime-drama film directed by Barry Levinson which tells the story of mobster Bugsy Siegel. Based on Benjamin Siegel (February 28, 1906[1] – June 20, 1947) was an American mobster with the Luciano crime family. Nicknamed "Bugsy" Siegel was known as one of the most "infamous and feared gangsters of his day". Described as handsome and charismatic, he became one of the first front-page-celebrity gangsters. He was also a driving force behind the development of the Las Vegas Strip.

Nixon [1995] @ Wikipedia 

  • Nixon is a 1995 American biographical film that tells the story of the political and personal life of former US President Richard Nixon as a complex and, in many respects, admirable, though deeply flawed, person. Nixon begins with a disclaimer that the film is "an attempt to understand the truth [...] based on numerous public sources and on an incomplete historical record."

The Insider - [1999] @ Wikipedia

  • The Insider is a 1999 American drama film directed by Michael Mann, based on the true story of a CBSs "60 Minutes segment" about Jeffrey Wigand, a whistleblower in the tobacco industry. 
  • The CBS's 60 Minutes story originally aired in November 1995 in an altered form because of objections by CBS' then-owner, Laurence Tisch, who also controlled the Lorillard Tobacco Company. The story later aired in a complete and uncensored form on February 4, 1996.

Good night and Good Luck - [2005] @ Wikipedia

  • Good Night, and Good Luck. is a 2005 American drama film portrays the conflict between veteran radio and television journalist Edward R. Murrow and U.S. Senator Joseph McCarthy of Wisconsin, especially relating to the anti-Communist Senator's actions with the Senate Permanent Subcommittee on Investigations.
  • Based on Edward R. Murrow, a pioneer of television news broadcasting, Murrow produced a series of TV news reports that helped lead to the censure of Senator Joseph McCarthy.

Charlie Wilson's War - [2007] @ Wikipedia 

The ides of March - [2008] @ Wikipedia

  • Based on Farragut North  a 2008 play written by Beau Willimon, who worked for Sen. Charles E. Schumer (D-NY) and former Governor of Vermont and 2004 Democratic presidential candidate Howard Dean,  loosely based on the 2004 Democratic primary campaign of Howard Dean. 
  • The play is billed as "a classic tale of hubris set against a contemporary landscape – about the lust for power and the costs one will endure to achieve it". It is titled after Farragut North, a Washington Metro station, on the Red Line. Farragut North serves downtown Washington and is located just north of Farragut Square near Connecticut Avenue. 
  • Titled the play for the Metrorail station located nearest the district's center for think tanks, lobbyists, and advocacy groups.

W. - [2008] @ Wikipedia

  • W. is a 2008 American biographical drama film based on the life and presidency of George W. Bush. It was produced and directed by Oliver Stone, written by Stanley Weiser, and stars Josh Brolin as Bush.

The Informant! - [2009] @ Wikipedia

The Informant! is a 2009 American biographical-comedy-crime movie based on a true Story about Mark Whitacre's involvement as a whistle blower in the lysine price-fixing conspiracy of the mid-1990s Mark Whitacre, a rising star at Decatur, Illinois based Archer Daniels Midland (ADM) in the early 1990s, blows the whistle on the company’s price-fixing tactics at the urging of his wife Ginger
Based on the 2000 nonfiction book The Informant: A true Story, by journalist Kurt Eichenwald.

Extraordinary Measures - [2010] @ Wikipedia



      Fair Game - [2010] @ Wikipedia

      • Fair Game is a 2010 biographical spy drama film directed by Doug Liman and starring Naomi Watts and Sean Penn.[3] It is based on Valerie Plame's memoir, Fair Game: My Life as a Spy, My Betrayal by the White House,[3] and Joseph C. Wilson's memoir, The Politics of Truth: Inside the Lies that Led to War and Betrayed My Wife's CIA Identity: A Diplomat's Memoir. 

          Nothing but Truth - [2010] @ Wikipedia

          • Nothing but the Truth is a 2008 American drama film written and directed by Rod Lurie. According to comments made by Lurie in The Truth Hurts, a bonus feature on the DVD release, his inspiration for the screenplay was the case of journalist Judith Miller, who in July 2005 was jailed for contempt of court for refusing to testify before a federal grand jury investigating a leak naming Valerie Plame as a covert CIA operative, but this was merely a starting point for what is primarily a fictional story. In an April 2009 interview, Lurie stressed: "I should say that the film is about neither of these women although certainly their stories as reported in the press went into the creation of their characters and the situation they find themselves in."
          • Inside Job is a 2010 documentary film, directed by Charles H. Ferguson, about the late-2000s financial crisis.  In five parts, the film explores how changes in the policy environment and banking practices helped create the financial crisis.. 

          J. Edgar [2011] @ Wikipedia

          • J. Edgar is a 2011 American biographical drama film directed, co-produced, and scored by Clint Eastwood.Written by Dustin Lance Black, the film based on the career of FBI director J. Edgar Hoover. 

          Game Change - [2012] @ Wikipedia

          • Game Change is a 2012 American HBO political drama film based on events of the 2008 United States presidential election campaign, directed by Jay Roach and written by Danny Strong, 
          • Based on the 2010 book of the same name documenting the campaign by political journalists Mark Halperin and John Heilemann. 

          The Wolf of Wall Street - [2013] @ Wikipedia

          • The Wolf of Wall Street is a 2013 american drama film directed by Martin Scorsese, based on Jordan Belfort's memoir of the same name. Belfort, a New York stockbroker who ran a financial services firm that engages in securities fraud and corruption on Wall Street in the 1990s was convicted of fraud crimes related to stock market manipulation and running a penny stock boiler room, for which he spent 22 months in prison. He recounted his life in his memoir, The Wolf of Wall Street.

          Citizen Four - [2014] @ Wikipedia

          • Citizenfour is a 2014 documentary film directed by Laura Poitras concerning Edward Snowden and the NSA spying scandal. Shot in the cinéma vérité style. The film features Glenn Greenwald and was co-produced by Poitras, Mathilde Bonnefoy, and Dirk Wilutzky, with Steven Soderbergh and others serving as executive producers. Citizenfour won the Academy Award for Best Documentary Feature at the 2015 Oscars..




          Thursday, April 3, 2014

          Apr 2014: Media Coverage of High Freq Trading Stories



            • "Reg NMS, as it is often called, grew out of an effort nearly a decade ago to keep the U.S. abreast of financial centers such as London, Frankfurt and Hong Kong that were leaping ahead in embracing electronic systems. Securities and Exchange Commission officials worried that control of U.S. capital markets could begin to shift offshore if the U.S. didn't evolve."
          1. HFT - Brad's IEX ; WSJ article Orginally appeared on Jun 29 ,2013

            "IEX also will forgo the so-called rebates that many exchanges pay firms that help provide buy and sell orders. The payments, typically about 25 to 30 cents per 100 shares, primarily benefit high-frequency trading firms that provide orders".

          2. HFT - Birth of an Electronic Trading Venue - TradeBot - WSJ article pub. on Dec 15 2006
            • "In Mr. Cummings's world, the fundamentals of a stock are of little consequence. His firm favors large stocks, such as Microsoft, because it can trade in and out quickly. On one recent afternoon, a computer screen in Tradebot headquarters indicated that the firm accounted for more than 10% of that day's trading in Microsoft. On many days, Tradebot's trading totals account for as much as 5% of all Nasdaq trading, on par with trading levels at such giant firms as Fidelity Investments."
          3. HFT trading shop - Meet Getco HFT Trading King. [ Aug 2009]
            1. "Traders at Getco, a private company with fewer than 250 employees, use powerful computers and algorithms to engage in high-frequency trading. "
            2. "They are probably the biggest market maker in the U.S. stock market," said Justin Schack, a vice president at Rosenblatt Securities Inc. who closely tracks high-frequency trading. A market maker is a firm that always stands ready to buy or sell a stock.
          4. NYSE's Fast-Trade Hub Rises Up in New Jersey - WSJ.com [Jul 2009]
            • MAHWAH, N.J. -- The future of the New York Stock Exchange is inside the red-brick building that is rising from the ground here about 35 miles from Wall Street.
            • The exchange is building a similar facility outside London, which will cater to clients who want access to overseas markets. The combined price tag for the two data centers will be about $500 million, according to people familiar with the matter.
            • The NYSE is seeking to stem a slide in market share from more than 80% in 2004 to about 40% this year, according to data from Equity Research Desk, a research company in Greenwich, Conn. Second-quarter earnings are expected to slide 40% from a year ago to 45 cents a share, according to a survey of analysts by Thomson Reuters.

          5. Fast Trader's new Edge is Light Speed - WSJ.com [Jun 2010]

            • Critics call the practice the modern day equivalent of looking at share prices listed in tomorrow's newspaper stock tables today.
            • "It is a rigged game," Sal Arnuk, co-founder of brokerage firm Themis Trading, said Wednesday at a Securities and Exchange Commission roundtable discussion in Washington, D.C., referring to the trading activity, which some call "latency arbitrage."
          6. HFT - Flash Crash - Most likely cause - Initial suspect
            • Fund managers at Waddell & Reed Financial Inc. in Overland Park, Kan., moved to hedge their U.S. stock holdings, which total more than $7 billion, by betting that the S&P 500 would fall. Waddell decided on a large short sale of futures contracts known as E-minis, which mimic movement of the S&P 500. As Waddell's computers began parceling out the trade, other investors also were trying to hedge their portfolios, so trading volume in E-minis shot up to six times the usual volume. 
            • But liquidity, the ability to buy or sell easily, was drying up. Between about 2:35 and 2:45, the six "market-making" firms that were most active that afternoon in E-mini trading—they step in as buyers or sellers on many trades—cut back their trading. Some pulled out altogether.
            • As a result, traders say, the big Waddell trade accelerated the sell-off. Waddell says it did not intend to "disrupt" the market.
          7. HFT - Flash Crash - Did Shutdowns Make Plunge Worse?
            • "Some high-frequency traders, including Mr. Cummings at Tradebot, say their moves didn't accelerate declines. He says other firms selling large positions caused the market turmoil and that Tradebot would have been risking losses if it had continued trading. He says exchanges need to install better systems that automatically stop or slow trading when the market becomes overly chaotic."
          8. HFT - Flash Crash - Trading-Firm Breakdowns Accompanied Market Chaos - Wsj.com May 2010
            • As the stock market spiraled out of control two weeks ago, two major firms that handle trades for retail brokerages suffered trading breakdowns.
            • One, the big Chicago hedge-fund firm Citadel Investment Group, stopped taking orders for a number of securities, according to an internal email and people familiar with the matter. Shortly after the market plunged, Citadel asked clients, including discount brokers such as E*Trade Financial Corp. and TD Ameritrade Holding Corp., to route orders elsewhere.
          9. HFT - Haim Bodek Story - An insider narrative of HFT market participants - WSJ.com [Jun 29,2013]
            • "Haim Bodek told the SEC what he had learned about order types. His sword was a gift from a friend who said he would need it in business.
          10. "HFT - charles schwab position on HFT [Apr 2014]
            • "The integrity of the markets is at the heart of our economy. High-frequency trading undermines that integrity and causes the market to lose credibility and investors to lose trust. This hurts our economy and country. It is time to treat the cancer aggressively."
          11. "HFT- What Goldman Sachs President[@Apr 2014]  (gary cohen) thinks about HFT ?[ Apr 2014 ]
            • "Three powerful forces have been at work: technology, regulation and competition. The result has been narrower spreads, faster execution and lower overall explicit costs to trading stocks."
          12. HFT- What Mark Cuban's thinks about HFT ? [ Apr 2014]
            • "The output of the algorithms, the This Then That creates the trade (again, this is a simplification — I'm open to better examples), which creates a profit of  some relatively small amount. When you do this millions of times a day, that totals up to real money. IMHO, this is the definition of high-frequency trading. Taking advantage of an advantage in speed and algorithmic processing to jump in front of trades from slower market participants to create small, guaranteed wins millions of times a day. A high frequency of trades is required to make money. Therein lies the problem. This is where the game is rigged



          Monday, February 10, 2014

          Java programming with lambda expressions

          Java programming with lambda expressions

          A mathematical example demonstrates the power of lambdas in Java 8

          By
          Jan 29, 2014 8:41 PM PT
          In the technical keynote address for JavaOne 2013, Mark Reinhold, chief architect for the Java Platform Group at Oracle, described lambda expressions as the single largest upgrade to the Java programming model ever. While there are many applications for lambda expressions, this article focuses on a specific example that occurs frequently in mathematical applications; namely, the need to pass a function to an algorithm.
          As a gray-haired geek, I have programmed in numerous languages over the years, and I have programmed extensively in Java since version 1.1. When I started working with computers, almost no one had a degree in computer science. Computer professionals came mostly from other disciplines such as electrical engineering, physics, business, and mathematics. In my own former life I was a mathematician, and so it should come as no surprise that my initial view of a computer was that of a giant programmable calculator. I've broadened my view of computers considerably over the years, but I still welcome the opportunity to work on applications that involve some aspect of mathematics.
          Many applications in mathematics require that a function be passed as a parameter to an algorithm. Examples from college algebra and basic calculus include solving an equation or computing the integral of a function. For over 15 years Java has been my programming language of choice for most applications, but it was the first language that I used on a frequent basis that did not allow me to pass a function (technically a pointer or reference to a function) as a parameter in a simple, straightforward manner. That shortcoming is about to change with the upcoming release of Java 8.
          The power of lambda expressions extends well beyond a single use case, but studying various implementations of the same example should leave you with a solid sense of how lambdas will benefit your Java programs. In this article I will use a common example to help describe the problem, then provide solutions written in C++, Java before lambda expressions, and Java with lambda expressions. Note that a strong background in mathematics is not required to understand and appreciate the major points of this article.

          Learning about lambdas

          Lambda expressions, also known as closures, function literals, or simply lambdas, describe a set of features defined in Java Specification Request (JSR) 335. Less formal/more readable introductions to lambda expressions are provided in a section of the latest version of the Java Tutorial and in a couple of articles by Brian Goetz, "State of the lambda" and "State of the lambda: Libraries edition." These resources describe the syntax of lambda expressions and provide examples of use cases where lambda expressions are applicable. For more about lambda expressions in Java 8, watch Mark Reinhold's technical keynote address for JavaOne 2013.

          Lambda expressions in a mathematical example

          The example used throughout this article is Simpson's Rule from basic calculus. Simpson's Rule, or more specifically Composite Simpson's Rule, is a numerical integration technique to approximate a definite integral. Don't worry if you are unfamiliar with the concept of a definite integral; what you really need to understand is that Simpson's Rule is an algorithm that computes a real number based on four parameters:
          • A function that we want to integrate.
          • Two real numbers a and b that represent the endpoints of an interval [a,b] on the real number line. (Note that the function referred to above should be continuous on this interval.)
          • An even integer n that specifies a number of subintervals. In implementing Simpson's Rule we divide the interval [a,b] into n subintervals.
          To simplify the presentation, let's focus on the programming interface and not on the implementation details. (Truthfully, I hope that this approach will let us bypass arguments about the best or most efficient way to implement Simpson's Rule, which is not the focus of this article.) We will use type double for parameters a and b, and we will use type int for parameter n. The function to be integrated will take a single parameter of type double and a return a value of type double.

          Function parameters in C++

          To provide a basis for comparison, let's start with a C++ specification. When passing a function as a parameter in C++, I usually prefer to specify the signature of the function parameter using a typedef. Listing 1 shows a C++ header file named simpson.h that specifies both the typedef for the function parameter and the programming interface for a C++ function named integrate. The function body forintegrate is contained in a C++ source code file named simpson.cpp (not shown) and provides the implementation for Simpson's Rule.

          Listing 1. C++ header file for Simpson's Rule

          
          #if !defined(SIMPSON_H)
          #define SIMPSON_H
          #include 
          using namespace std;
          typedef double DoubleFunction(double x);
          double integrate(DoubleFunction f, double a, double b, int n)
              throw(invalid_argument);
          #endif
          
          
          Calling integrate is straightforward in C++. As a simple example, suppose that you wanted to use Simpson's Rule to approximate the integral of the sine function from 0 to π (PI) using 30 subintervals. (Anyone who has completed Calculus I should be able to compute the answer exactly without the help of a calculator, making this a good test case for the integrate function.) Assuming that you had included the proper header files such as  and "simpson.h", you would be able to call function integrateas shown in Listing 2.

          Listing 2. C++ call to function integrate

          
          double result = integrate(sin, 0, M_PI, 30);
          
          
          That's all there is to it. In C++ you pass the sine function as easily as you pass the other three parameters.

          Another example

          Instead of Simpson's Rule I could have just as easily used the Bisection Method (aka the Bisection Algorithm) for solving an equation of the form f(x) = 0. In fact, the source code for this article includes simple implementations of both Simpson's Rule and the Bisection Method.

          Java without lambda expressions

          Now let's look at how Simpson's Rule might be specified in Java. Regardless of whether or not we are using lambda expressions, we use the Java interface shown in Listing 3 in place of the C++ typedef to specify the signature of the function parameter.

          Listing 3. Java interface for the function parameter

          
          public interface DoubleFunction
            {
              public double f(double x);
            }
          
          
          To implement Simpson's Rule in Java we create a class named Simpson that contains a method,integrate, with four parameters similar to what we did in C++. As with a lot of self-contained mathematical methods (see, for example, java.lang.Math), we will make integrate a static method. Method integrate is specified as follows:

          Listing 4. Java signature for method integrate in class Simpson

          
          public static double integrate(DoubleFunction df, double a, double b, int n)
          
          
          Everything that we've done thus far in Java is independent of whether or not we will use lambda expressions. The primary difference with lambda expressions is in how we pass parameters (more specifically, how we pass the function parameter) in a call to method integrate. First I'll illustrate how this would be done in versions of Java prior to version 8; i.e., without lambda expressions. As with the C++ example, assume that we want to approximate the integral of the sine function from 0 to π (PI) using 30subintervals.

          Using the Adapter pattern for the sine function

          In Java we have an implementation of the sine function available in java.lang.Math, but with versions of Java prior to Java 8, there is no simple, direct way to pass this sine function to the method integratein class Simpson. One approach is to use the Adapter pattern. In this case we would write a simple adapter class that implements the DoubleFunction interface and adapts it to call the sine function, as shown in Listing 5.

          Listing 5. Adapter class for method Math.sin

          
          import com.softmoore.math.DoubleFunction;
          public class DoubleFunctionSineAdapter implements DoubleFunction
            {
              public double f(double x)
                {
                  return Math.sin(x);
                }
            }
          
          
          Using this adapter class we can now call the integrate method of class Simpson as shown in Listing 6.

          Listing 6. Using the adapter class to call method Simpson.integrate

          
          DoubleFunctionSineAdapter sine = new DoubleFunctionSineAdapter();
          double result = Simpson.integrate(sine, 0, Math.PI, 30);
          
          
          Let's stop a moment and compare what was required to make the call to integrate in C++ versus what was required in earlier versions of Java. With C++, we simply called integrate, passing in the four parameters. With Java, we had to create a new adapter class and then instantiate this class in order to make the call. If we wanted to integrate several functions, we would need to write an adapter class for each of them.
          We could shorten the code needed to call integrate slightly from two Java statements to one by creating the new instance of the adapter class within the call to integrate. Using an anonymous class rather than creating a separate adapter class would be another way to slightly reduce the overall effort, as shown in Listing 7.

          Listing 7. Using an anonymous class to call method Simpson.integrate

          
          DoubleFunction sineAdapter = new DoubleFunction()
            {
              public double f(double x)
                {
                  return Math.sin(x);
                }
            };
          double result = Simpson.integrate(sineAdapter, 0, Math.PI, 30);
          
          
          Without lambda expressions, what you see in Listing 7 is about the least amount of code that you could write in Java to call the integrate method, but it is still much more cumbersome than what was required for C++. I am also not that happy with using anonymous classes, although I have used them a lot in the past. I dislike the syntax and have always considered it to be a clumsy but necessary hack in the Java language.

          Java with lambda expressions and functional interfaces

          Now let's look at how we could use lambda expressions in Java 8 to simplify the call to integrate in Java. Because the interface DoubleFunction requires the implementation of only a single method it is a candidate for lambda expressions. If we know in advance that we are going to use lambda expressions, we can annotate the interface with @FunctionalInterface, a new annotation for Java 8 that says we have a functional interface. Note that this annotation is not required, but it gives us an extra check that everything is consistent, similar to the @Override annotation in earlier versions of Java.
          The syntax of a lambda expression is an argument list enclosed in parentheses, an arrow token (->), and a function body. The body can be either a statement block (enclosed in braces) or a single expression. Listing 8 shows a lambda expression that implements the interface DoubleFunction and is then passed to method integrate.

          Listing 8. Using a lambda expression to call method Simpson.integrate

          
          DoubleFunction sine = (double x) -> Math.sin(x);
          double result = Simpson.integrate(sine, 0, Math.PI, 30);
          
          
          Note that we did not have to write the adapter class or create an instance of an anonymous class. Also note that we could have written the above in a single statement by substituting the lambda expression itself, (double x) -> Math.sin(x), for the parameter sine in the second statement above, eliminating the first statement. Now we are getting much closer to the simple syntax that we had in C++. But wait! There's more!
          The name of the functional interface is not part of the lambda expression but can be inferred based on the context. The type double for the parameter of the lambda expression can also be inferred from the context. Finally, if there is only one parameter in the lambda expression, then we can omit the parentheses. Thus we can abbreviate the code to call method integrate to a single line of code, as shown in Listing 9.

          Listing 9. An alternate format for lambda expression in call to Simpson.integrate

          
          double result = Simpson.integrate(x -> Math.sin(x), 0, Math.PI, 30);
          
          
          But wait! There's even more!

          Method references in Java 8

          Another related feature in Java 8 is something called a method reference, which allows us to refer to an existing method by name. Method references can be used in place of lambda expressions as long as they satisfy the requirements of the functional interface. As described in the resources, there are several different kinds of method references, each with a slightly different syntax. For static methods the syntax isClassname::methodName. Therefore, using a method reference, we can call the integrate method in Java as simply as we could in C++. Compare Java 8 call shown in Listing 10 below with original C++ call shown in Listing 2 above.

          Listing 10. Using a method reference to call Simpson.integrate

          
          double result = Simpson.integrate(Math::sin, 0, Math.PI, 30);
          
          
          Page 2
          Page 2 of 2
          As a final thought, although I prefer writing the interface DoubleFunction because I think that it makes the code easier to understand, even that interface can be eliminated. Java 8 has a new package,java.util.function, that contains a number of commonly used functional interfaces. Many are expressed using generics, but there are specializations for primitive types. I'll leave the use of one of these interfaces in place of DoubleFunction as the proverbial exercise for the reader. (For a hint, look closely at DoubleUnaryOperator in java.util.function. If you get stuck, see class Simpson2 in the source code provided with this article.)

          In conclusion

          Overall I have found it a pleasure to code in Java, and it has been my preferred programming language for more than 15 years. There are (still) a few places where Java's syntax seems awkward, however. With the addition of lambda expressions, Java 8 will correct one of them. Taken together, the major points of this article remind me of Cay Horstmann's so-called March of Progress, a portion of which is copied below with his permission.

          The March of Progress, by Cay Horstmann

          1980: C
          printf("%10.2f", x);
          1988: C++
          cout << setw(10) << setprecision(2) << showpoint << x;
          1996: Java
          java.text.NumberFormat formatter = java.text.NumberFormat.getNumberInstance();
          formatter.setMinimumFractionDigits(2);
          formatter.setMaximumFractionDigits(2);
          String s = formatter.format(x);
          for (int i = s.length(); i < 10; i++) System.out.print(' ');
          System.out.print(s);
          2004: Java
          System.out.printf("%10.2f", x);

          Learn more about this topic

          Shak.blog.notes 08/20/2024

          Thinking Like an Architect - InfoQ tags: blog ...