Warning: Undefined array key "hide_archive_titles" in /home1/smartva9/public_html/smartvania/wp-content/themes/baton/includes/theme-functions.php on line 254

Month: November 2015

Spartacus

It is really interesting to see why this film, Spartacus was made in the first place. Obviously, historical epics were massively successful during this time period. But this particular film was made as an answer to 1959’s Ben-Hur. In fact, it was Kirk Douglas’s answer to that movie. Douglas was originally set to star in that movie, but Charlton Heston was cast over Douglas at the last minute, giving Douglas a feeling of bitter resentment. Both films have a very common theme: one man rising against the mighty Roman Empire to fight for their beliefs. I think Ben-Hur is the better film, but there is much to admire about this film.

The movie, based off the popular novel by Howard Fast, was written by Dalton Trumbo. Trumbo is a well-known screenwriter, not only for his writing talent but because he was blacklisted because of his associated ties with communism. Kirk Douglas and director Stanley Kubrick stood strong behind their screenwriter and they publicly announced Trumbo wrote their movie, instead of Trumbo hiding behind a pseudonym. I found that to be a very courageous move on the part of Douglas and Kubrick, because that could have easily hurt the movie’s chance at the box office. Luckily, the film was a box office smash and was very popular with the critics and the audience alike.

This film has a Roman slave named Spartacus (Kirk Douglas) as the film’s central character. Spartacus is held at a gladiatorial school ran by the amusing Lentulus Batiatus (Peter Ustinov). One day, he starts a revolt because he became angered at the notion of fighting to the death for the entertainment of spoiled women. This revolt soon spread all across Italy, where thousands of slaves joined the cause. Their plan was for Silesian pirates to transport them away from Italy to new lands. Meanwhile in Rome, Senator Gracchus (Charles Laughton) schemes to have the slaves taken down by a Roman garrison. After they failed, his mentor Marcus Licinius Crassus (Laurence Olivier) decides to lead his own army against Spartacus’s slaves. Now Spartacus must face the might and power of the Roman army.

Now compared to other epics of the time, I didn’t like this film as much. It’s certainly not a bad film, not even close to being so. The problem is the movie is a tad overlong and the story drags at certain moments. Some of the dialogue was cheesy too. By today’s standards, the dialogue does not hold up very well and some of the words are laughingly bad. These complaints dragged the movie down, but only to a very small degree.

There are many things I did admire about the film. There are plenty of majestic battle sequences and I liked them very much. I loved watching how the revolt started and I was cheering for Spartacus the entire time. I liked the political backdrop of the movie. Obviously, Spartacus uprising has a major political undertone which is revolution, a very appropriate theme. We also get to go behind the scenes and see how Roman politics influenced the war. It’s a common fact that Roman senators always schemed against each other. The film also did something different, when compared to other epics. These other epics usually provide the normal happy ending. Well, that is not much the case with this film. If you follow history, you’ll know the fate of Spartacus. But I’m not going to spoil anything for those who don’t know. But the ending was very powerful and memorable. Speaking of powerful, my favorite scene was when a Roman general asked Spartacus’s army where Spartacus was. Each soldier stood up and said, “I’m Spartacus.” A very powerful scene showing the loyalty the slaves had for Spartacus and his cause.

This film was the first big film of Stanley Kubrick’s career. He was 30 when he directed the film, but he already had 4 feature films under his belt before this film. He masterfully directed the film, but it is publicly known that he disowned the film. It’s his most straightforward film, and it was nominated for 6 Oscars (and won 4 of them). But Kubrick didn’t like the film he made. He is one of my favorite directors, and you’ll see more reviews of his films down the line.

The film features fine performances from everyone involved. One of Kubrick’s strengths is getting the very best out of his actors. Kirk Douglas portrayed Spartacus as a strong man driven by perseverance. Peter Ustinov, who won Best Supporting Actor at the Oscars for his role as Batiatus, does a wonderful job. He is consistently funny and he has a great screen presence whenever onscreen. Laurence Olivier delivers a deep performance as Crassus, who is identified as bisexual in the movie. Jean Simmons does a good job as Varinia, the wife of Spartacus. She delivered some emotional performances. Just watch the ending of the movie to see why I say so. Also, keep an eye on a meaty supporting turn by Tony Curtis as Antoninus, the man who loves Spartacus like a brother. Finally, Charles Laughton is great as the soft-hearted scheming Roman Senator, Gracchus.

Overall, I liked Spartacus, but I didn’t really love it much. It runs into some boring stretches and parts of the movie such as the dialogue and costumes don’t hold up well. But I liked how the film strived to be more historically accurate than previous epics. This is a nice film to learn something about Ancient Rome. The film does feature wonderful, bold performances, great direction, good production design, and spectacular battles. Not the greatest epics ever made, but good enough.

My Grade: B

 

Ben-Hur

In 1956, The Ten Commandments was released to a massive success around the world. It had such a worldwide appeal due to the story being well-known everywhere. Three years later, another wildly successful epic was released in the form of Ben-Hur. This movie seems like the first cousin of The Ten Commandments. Both are stories based off biblical events, and Charlton Heston plays the lead role in both films. Heston wasn’t nominated for any major awards with his 1956 film, but he was nominated and won an Oscar for his amazing portrayal of Judah Ben-Hur, an influential man amongst his people.

If I had to choose what my favorite epic was from this era, I would have chosen Ben-Hur. It has such a fascinating story as it’s about a man who wants what is only right for his people. His people are conquered by the Romans, and he wants a better life for them. The movie goes into so much detail on the man Judah was. He was alive for the teachings of Jesus Christ, although he was not seen to be an ardent supporter. However, one of the best scenes in the movie was Judah and his family watching Jesus being marched with a cross on his back on his way to be crucified. That scene did admittedly tear me up.

Judah Ben-Hur (Charlton Heston) is a rich Jewish merchant whom resides in Jerusalem. An old childhood Roman friend of his named Messala (Stephen Boyd) arrives to become commanding officer of Jerusalem. Both men are extremely happy to see each other at first, but their friendship becomes divided over political issues. When the governor arrives during a welcome parade, a tile falls off the roof accidentally injuring the governor. Messala takes advantage of the incident and the broken friendship with Judah to send Judah into slavery and his mother and sister into prison. Judah makes a name for himself in the galleys and becomes a Roman prince. Now Judah comes back home and he vows revenge on Messala for how he treated his family.

Charlton Heston had the fortune to appear in what are the two most famous epics of all time. He was able to convince me in his performance as Moses. Now in this film, he even more so convinces me as Judah Ben-Hur. Both men want to do what is right for their people, but they are two different men. Heston does an amazing job in this role and I believe he deserves his Oscar victory. Stephen Boyd does well as Messala. Both Heston and Boyd have excellent chemistry, which makes the broken friendship even more gut-wrenching. We also get strong supporting performances from Cathy O’Donnell and Martha Scott who portrayed Ben-Hur’s mother and sister respectively. They mostly spend their time in the film battling leprosy, which is a very gruesome disease. The makeup department did a very good job in accurately showing the symptoms of leprosy. I also liked Hugh Griffith’s performance as Sheik Ilderim, who turns out to be a useful ally for Ben-Hur. He provided some comedy, especially when it came to offering Ben-Hur his daughters to marry. Finally, Haya Harareet does a fine job as the love interest of Ben-Hur, Esther.

At the time of the film’s release, it had the largest budget of any film released. It had a price tag of around fifteen million dollars, or 123 million dollars when adjusted to today’s standards by inflation. I believe the budget was spent properly. The epic is beautiful and is home too many large, grand scenes. The most famous scene is the well-known chariot scene, which would hold up well in any movie released today. The race itself was epic and it features some hardcore chariot racing. The chariot race takes time to complete, and I’m glad it does. It’s my favorite sequence of the movie and it’s arguably the most action-packed scene of the 210-minute film. When one thinks of Ben-Hur, they will always bring up the chariot scene. It is a very influential scene on future movies.

There were some other scenes I loved to such as the scene in the galleys where Judah rescues a Roman general at sea during war and he becomes an adopted son of the general. Whenever Judah and Messala appear onscreen together is always worth watching. Judah’s search for his family is also a powerful section of the movie. The movie looks gorgeous and the production design is wonderful. Ancient Rome actually looked authentic, which is hard to say of movies released during this time period. Jerusalem also looked authentic too. I also loved the score by Miklos Rosza. It was a beautiful score to listen to and it works very well with the movie.

Overall, Ben-Hur is a flat-out great epic. The movie does run into pacing problems, but that can be expected at a movie clocked around three-and-a-half hours. Everything is consistent with the film ranging from the acting to the special effects (no CGI of course) to the wonderful direction of William Wyler. Without Wyler’s consistent tonal direction, who knew if this film would work. As a history film, this film may not always be accurate. But they did get the tone mostly right. A winner of 11 Oscars including Best Picture, this is one of my favorite epics to watch.

My Grade: A

Vertigo

Vertigo is one of the more complicated movies I have ever seen, and just trying to think about what exactly is happening was enough to make my head spin in opposite directions, and I mostly mean that as a compliment. It just shows what a competent movie director Alfred Hitchcock made. There are many things happening in the movie, so you will have to pay attention to keep up with what is going on. It took me two grasps to understand the basics of the plot. Kudos to Hitchcock in creating a movie that effectively employs plot twists and turns to keep the movie audience guessing.

So in a way. this thriller could be about Hitchcock himself and the way he handles women in his movies. Hitchcock is famous for his control over the production, especially when it comes to his movies. They all have the same qualities in his films, and thus end up looking foolish. Vertigo is one of his best films, because he spoofs himself in away. The men in the movie, especially the main character Scottie Ferguson, treats the women rather in a disrespectful, obsessive way. It shows how men can become obsessive over things they can’t have, especially the women.

As it is with many Hitchcock films, they are all technically impressive. A big part of the film is the term “vertigo” itself. By definition, vertigo is essentially being afraid of heights. Scottie’s backstory is explained in the beginning, and part of it shows why he was afraid of heights after going through a rooftop chase and almost falling off a roof. The way his vertigo explained was actually quite frightening. Seeing the shots from ground to sky as the camera moves away from the ground made his fear even more realistic.

So what is this film all about? Well, Scottie Ferguson (James Stewart) is a former detective who is retired because of his paranoia with heights. One day, a former colleague named Gavin (Tom Helmore) approaches Scottie with a request to follow his wife around, Madeleine (Kim Novak) because he fears she was possessed by a dead person. Scottie reluctantly agrees to do so. During his investigation, Scottie begins to fall in love with her. But due to a tragic accident, Madeleine dies. Soon thereafter, Scottie meets another woman named Judy (also played by Kim Novak), who uncannily looks similar to the deceased Madeleine. Scottie begins to grow obsessed with her and he eventually tries to groom her into a mirror image of Madeleine. Doing so helps begin what is a shocking climax perhaps resulting in a murder conspiracy.

This film is very much well-acted. James Stewart is one of Hollywood’s “Golden Age” stars and he delivers a magnificent performance. He made his fear of heights very believable and his growing obsession in the latter part of the film was incredible to watch, even though he was a treating a woman a way a man should never treat a woman-through compulsive obsession. He treated Judy like an object, and in a sense mirrors Hitchcock’s reality. Kim Novak delivered a convincing performance in her roles as Madeleine and Judy. She’s blond, icy, and often humiliated-very normal in a Hitchcock thriller. But without spoiling anything, Judy and Madeleine are two characters who are closely related and Novak was able to play both of the roles effectively.

Overall, Vertigo is a very strong Hitchcock thriller. It’s undeniably scary and creepy, with Hitchcock excels at making his films be. The beginning is very effectively scary, as we are introduced to Scottie’s vertigo. His obsession towards the women was also creepy, but at the same time, puts you to the edge of your seat making you wonder what will happen next. I won’t spoil anything, but the ending is a shocker and its something you won’t see coming thanks to the masterful direction of Hitchcock and wonderful, convincing performances from Stewart and Novak. The plot twists and turns when you least expect it, so be prepared to bring your mind to the film. You’ll need it.

My Grade: A-

The Bridge on the River Kwai

The Bridge on the River Kwai is a war movie that is often very entertaining, but it sets itself apart from other war movies. Unlike those other movies, this particular film is a provocative film that asks complex questions, but doesn’t answer them easily. It is all up to the audience to believe what happened and why it happened. Of course, everyone may have different opinions and the movie seems to ask for that. Usually in war movies, they are concerned about the bigger picture such as who wins or who loses, which is all very fair questions. But the reason this film works more than most war films is because it poses questions that are deeper than the winner or loser. The movie talks about individualism. It’s not all about who wins or loses the war, but who is in that war and how does war affect the individual.

The most famous quote of the movie is actually the final line of the film. It goes “Madness! Madness!” This quote was nominated by AFI as one of the top 100 quotes of all time. Regardless of that honor, it’s a very effective quote because it sums up the entire movie. Every character is mad in one away or another. The film also has a prominent theme of obsession. The movie is about building a bridge, and Colonel Nicholson (the main character) will do anything it takes to complete the task, even though if it means the Japanese soldiers will use the bridge to try and defeat the Allies, of course which Nicholson belonged with.

This film takes place in 1943, at a Japanese POW camp during the middle of World War Two. The Japanese have captured British soldiers, led by Colonel Nicholson. Nicholson and his soldiers are ordered to build a bridge to accommodate a railway. Nicholson convinces his soldiers to build the bridge for British morality and to show the Japanese what they stand for. But over time, Nicholson develops an obsessive disorder with completing the bridge, which is being seen as collaborating with the enemy. Unknowingly to Nicholson or Saito, there is a plot to destroy the bridge. An American named Shears, a former POW who escaped the camp, is part of the team that is tasked with blowing up the bridge.

If you put the movie on about three-quarters into it, you would be forgiven if you thought Saito and Nicholson were allies. But the a good portion of the beginning of the film, it was quite the opposite. The film opens with Nicholson and his troops being led into the camp and being introduced to Saito. It became clear right away that each man’s morale opposed each other. It also became clear that Nicholson possessed a brave spirit. He endured torture for the sake of his beliefs, and he risked the chance of being killed. One of my favorite scenes in the movie was when Nicholson took out a copy of the Geneva Convention out of his pocket (to prove to Saito that officers don’t have to work on the bridge) and gave it to Saito, in which Saito used it to slap Nicholson across the face drawing blood. Then, he was dragged to “The Oven,” a hut that stands in the fierce sun. But once Nicholson was released, that is when the two men began to work together, drawing up some interesting questions.

My favorite sections of the movie was when Nicholson, played wonderfully by Alec Guinness was onscreen. However, the other half of the film is based on the plot trying to destroy the bridge. Shears was a former POW, but as an escapee and at a local hospital imitating an officer, he is coerced into the plot so his imitation as an officer wont become public. I liked the slow, grueling pace of these scenes, attempting to reach the bridge because it shows what it would be like in reality. It certainly was no picnic. It’s not nearly as convincing as the scenes in the jungle, but it’s good enough.

This film was the film that gave Alec Guinness his Oscar. He gave such an intense performance as the colonel who slowly begins a moral descent, perhaps the only thing that kept him alive. Guinness deserved his Oscar for his powerful performance. William Holden does an expert job in playing a typical American, Shears. He likes the booze and the women, but also is compelled by adventure even if the outcome seems a little murky. I also liked the performance of Sessue Hayakawa, as the strict Japanese commandant. He was actually one of the first Asian stars in Hollywood, from the era of silent film. So it was nice for the film to harken back to its beginning. Finally, the movie boasts excellent supporting turns by Jack Hawkins, as the leader of the crew headed to destroy the bridge and James Donald, the doctor of the camp and the man who questions the sanity of Colonel Nicholson. His expression on his face in the scene where Nicholson recruits sick and injured soldiers to help with the bridge was yet another powerful moment in the film.

The film is directed by David Lean, who excels at directing these kind of big, explosive films. Lean is famously hard to work with. It is on record that Guinness and Lean did not like each other during filming, but somehow Guinness was still able to deliver a powerhouse performance. Despite his personality, Lean is experienced in such films. He delivered a film that is entertaining, but still was able to put important themes and messages in the movie such as what it takes to stay alive under times of duress (such as this war).

Overall, The Bridge on the River Kwai is an incredibly powerful, expertly-made war film that shows how war can make people mad. From start to finish, I was glued to the movie taking in all the excellent performances and a excellent story thanks to the Oscar-winning screenplay by Carl Foreman and Michael Wilson. One note to mention is this film is not based on historical truth. It’s a fictional story, despite a similar event that actually happened. The only thing that is real is the harsh treatment of the soldiers in the POW camp. Everything about the film: the acting, directing, cinematography, score, and story just screams perfection. This is one of my all-time favorite war movies.

My Grade: A+

12 Angry Men

https://www.youtube.com/watch?v=fSG38tk6TpI

12 Angry Men is one of best courtroom dramas in the history of cinema. Even though it is an older film, it is also a refreshing take on courtroom dramas. On the surface, this film is a pure drama about the courtroom, but it goes much, much deeper than that. I was discussing in an earlier review (Dial M for Murder) about the use of a single location. Well, this film inhabits that single location very much so, and the film is actually famous for that. Outside of three minutes, the film takes place in a single New York City courtroom. That works very well in this film takes to the expert directing by first-time director Sidney Lumet and veteran cinematographer Boris Kaufman. The film is expertly shot and the use of the focal length’s shots allow the audience to feel more of each character’s feelings. Lumet later discussed how a “lens plot” occurred to him. As the movie progressed, he changed the lenses to longer focal lengths, in order for the background to gradually close in on the characters. A very good technique I must point out.

Another thing that made this film an interesting addition to the courtroom dramas is we don’t know much about the case, only through secondhand evidence do we piece together what is going on. All we know is that a Spanish-American boy is accused of murdering his father. Other than a very bored-looking judge who assumes he knows the outcome of the case, we learn the case through the eyes of twelve jurors. In most courtroom movies, it’s clear they like to come to a final verdict. This movie is very different because we don’t know whether the boy is guilty or not, although we can assume based off the events of the movie. The movie is all about reasonable evidence, a very important study in criminal justice. Through the evidence depicted in the case, did the boy commit the murder or not?

In the first few minutes in the jury room, it’s clear that the majority of the jurors believe he is guilty. However, there must be an unanimous vote before they can issue their decision. The problem is that one juror, Juror #8 believes the boy is not guilty. This is where all the fun begins. The film is based on emotion, logic, and even prejudice to describe what is going on. This particular juror does not sway from his opinion, even though the other jurors are growing more angry, more restless. But as Juror #8 (Henry Fonda) describes why he believes the boy is not guilty, and he presents an admirable case why, people begin to agree with #8. There are a few arrogant jurors who refuse to move their votes for their own reasons. For example, Juror #10 (Ed Begley) is an extreme racist, as seen in a massive prejudiced rant in which the reaction of the other jurors proved to be one of the most powerful scenes of the movie. Then there is Juror #3 (Lee J. Cobb), who is just a very angry man in general and he gradually becomes angrier as more people side with #8. Then there is Juror #4 (E.G Marshall), a man with wire-rimmed glasses who tries to avoid emotion in this thinking with only the use of logic. I think it was a wise movie not to give the character names. It makes each character much more powerful. I could actually remember the juror by their numbers, That’s a testament for how great and unique each character is.

In the 95 minutes the film runs, we become invested in each character very much so. Whether he is a racist bigot or whether he is a man who simply believes in what is right, we truly sympathize with them all. That is what you can attribute to a wonderful cast. It’s interesting, because there was only one bankable star here (at the time), and that was Henry Fonda who played Juror #8 very well. He presented his case as believable as he can be. The rest of the cast were some of the best actors of New York City at the time, such as Lee J. Cobb, Martin Balsam, Jack Warden, Ed Begley, Joseph Sweeney, Jack Klugman, E.G Marshall, John Fiedler, Edward Binns, Robert Webber, and George Voskovec. They all perform very well in their roles. They need to be angry, and they certainly did get angry.

Sidney Lumet is one of the best and influential American directors of all time. This was is first feature film, and he knocks it out of the park from the very first scene. In each film he does, he always has something to say-usually something controversial. Not so much in this film, but in subsequent films. He does talk about how emotions can cloud the thinking of people, and cause them to think and act irrationally. As some of the conversations and rants in this film will point out.

12 Angry Men, based off a television play, ended up being one of the greatest courtroom dramas ever made. It came out at a time where lavish productions were aplenty. Despite the critical acclaim of this film, the movie actually wasn’t a box-office hit when it originally opened. But enough people have seen this over the years and to see how great this film is. It spends 92 minutes in a room filled with a table and twelve men, and somehow we get incredibly tense moments that added up to be a very powerful, influential film.

My Grade: A

Java interview questions

The Toptal Engineering Blog has published a great post called
8 Essential Java Interview Questions” on there you can submit your Java interview questions, answers and hire freelancers,
and they were happy to share with us these questions. If you would like to like them on Facebook click on the link Toptal on Facebook
8 Essential Java Interview Questions
Click on the question to see the answer

The main distinction between fail-fast and fail-safe
iterators is whether or not the collection can be modified while it is being iterated.
Fail-safe iterators allow this; fail-fast iterators do not.


Of the three, LinkedList is generally going to give you the best performance. Here’s why:

ArrayList and
Vector each use an array to store the elements of the list.
As a result, when an element is inserted into (or removed from) the middle of the list, the elements that follow must all be shifted accordingly.
Vector is synchronized, so if a thread-safe implementation is
not needed, it is recommended to use ArrayList rather than Vector.


In Java, Strings are immutable
and are stored in the String pool. What this means is that, once a String is created, it stays in the pool in memory until being garbage collected.
Therefore, even after you’re done processing the string value (e.g., the password), it remains available in memory for an indeterminate period of time thereafter
(again, until being garbage collected) which you have no real control over. Therefore, anyone having access to a memory dump can potentially extract the sensitive data and exploit it.


A single ThreadLocal
instance can store different values for each thread independently. Each thread that accesses the get() or set() method of a
ThreadLocal instance is accessing its own, independently initialized copy of the variable. ThreadLocal i
nstances are typically private static fields in classes that wish to associate state with a thread (e.g., a user ID or transaction ID).
The example below, from the ThreadLocal Javadoc,
generates unique identifiers local to each thread. A thread’s id is assigned the first time it invokes ThreadId.get() and remains unchanged on subsequent calls.

public class ThreadId {
			// Next thread ID to be assigned
			private static final AtomicInteger nextId = new AtomicInteger(0);
				// Thread local variable containing each thread's ID
			private static final ThreadLocal<Integer> threadId =
				new ThreadLocal<Integer>() {
					@Override protected Integer initialValue() {
						return nextId.getAndIncrement();
				}
			};

			// Returns the current thread's unique ID, assigning it if necessary
			public static int get() {
				return threadId.get();
			}
		}
		


In Java, each thread has its own stack, including its own copy of variables it can access.
When the thread is created, it copies the value of all accessible variables into its own stack. The volatile
keyword basically says to the JVM “Warning, this variable may be modified in another Thread”.

In all versions of Java, the volatile keyword guarantees global ordering on reads and writes
to a variable. This implies that every thread accessing a volatile field will read the variable’s current value instead of (potentially) using a cached value.

In Java 5 or later, volatile reads and writes establish a happens-before
relationship, much like acquiring and releasing a mutex.

Using volatile may be faster than a lock, but
it will not work in some situations. The range of situations in which volatile is
effective was expanded in Java 5; in particular, double-checked locking now works correctly.

One common example for using volatile is for a flag to terminate a thread. If you’ve started a thread, and you want to be able to safely interrupt it from a different thread, you can have the thread periodically check a flag (i.e., to stop it, set the flag to true). By making the flag volatile, you can ensure that the thread that is checking its value will see that it has been set to true without even having to use a synchronized block. For example:

public class Foo extends Thread {
		private volatile boolean close = false;
		public void run() {
			while(!close) {
				// do work
			}
		}
		public void close() {
			close = true;
			// interrupt here if needed
		}
	}
	


sleep() is a blocking operation that keeps a hold on the monitor / lock of the shared object for the specified number of milliseconds.

wait(), on the other hand, simply pauses the thread until either (a) the specified number of milliseconds have elapsed or
(b) it receives a desired notification from another thread (whichever is first), without keeping a hold on the monitor/lock of the shared object.

sleep() is most commonly used for polling, or to check for certain results, at a regular interval. wait() is generally used in
multithreaded applications, in conjunction with notify() / notifyAll(), to achieve synchronization and avoid race conditions.


Here is an example of a typical recursive function, computing the arithmetic series 1, 2, 3…N. Notice how the addition is performed after
the function call. For each recursive step, we add another frame to the stack.

public int sumFromOneToN(int n) {
	  if (n < 1) {
		return n;
	  }

	  return n + sumFromOneToN(n - 1);
	}
	

Tail recursion occurs when the recursive call is in the tail position within its enclosing context –
after the function calls itself, it performs no additional work. That is, once the base case is complete,
the solution is apparent. For example:

public int sumFromOneToN(int n, int a) {
	  if (n < 1) {
		return a;
	  }

	  return sumFromOneToN(n - 1, a + n);
	}
	

Here you can see that a plays the role of the accumulator – instead of computing the sum on
the way down the stack, we compute it on the way up, effectively making the return trip unnecessary,
since it stores no additional state and performs no further computation. Once we hit the base case, the work is done – below is that same function, “unrolled”.

public int sumFromOneToN(int n) {
	  int a = 0;

	  while(n > 0) {
		a += n--;
	  }
	  
	  return a;
	}
	

Many functional languages natively support tail call optimization, however the JVM does not. In order
to implement recursive functions in Java, we need to be aware of this limitation to avoid
StackOverflowErrors. In Java, iteration is almost universally preferred to recursion.


This can be done using Thread.UncaughtExceptionHandler.

Here’s a simple example:

// create our uncaught exception handler
	Thread.UncaughtExceptionHandler handler = new Thread.UncaughtExceptionHandler() {
		public void uncaughtException(Thread th, Throwable ex) {
			System.out.println("Uncaught exception: " + ex);
		}
	};

	// create another thread
	Thread otherThread = new Thread() {
		public void run() {
			System.out.println("Sleeping ...");
			try {
				Thread.sleep(1000);
			} catch (InterruptedException e) {
				System.out.println("Interrupted.");
			}
			System.out.println("Throwing exception ...");
			throw new RuntimeException();
		}
	};

	// set our uncaught exception handler as the one to be used when the new thread
	// throws an uncaught exception
	otherThread.setUncaughtExceptionHandler(handler);

	// start the other thread - our uncaught exception handler will be invoked when
	// the other thread throws an uncaught exception
	otherThread.start();
	

The Ten Commandments

The 1950’s was a decade home to many epics. Perhaps one of the best ones produced was 1956’s The Ten Commandments. This film fits the definition of an epic very well. It will fill you up with awe, with amazement, and with wonder due to the use of gigantic set pieces, colorful costume designs, a bombastic score, and storytelling that many of us know about (especially if you’re from Christianity or Jewish heritage). The film runs at a lengthy three hours and forty minutes, which is common for epics during the golden age of epics. Despite the lengthy film, I felt the movie had a good pace to it. It did not seem like a long movie, and I was almost disappointed when the credits appeared. When that happens in a 3+ hour film, you know you have a good film on your hands.

This film is based off historical events or to be more specific, the tale of Moses from his birth to his death. In Ancient Egypt, Pharoah Ramses I decreed all newborn Hebrew males shall die. However, a newborn male named Moses (Charlton Heston) was cast away in the Nile in a reed basket. He was saved by pharaoh’s daughter, Bithiah (Nina Foch), and he grew up in court of the pharaoh’s brother, Seti (Cedric Hardwicke). Moses made a name to himself and became a favorite to take the throne after Seti. But once Moses’s heritage is revealed, everything changes. Moses is cast from Egypt, where he marries and raises a family. He is commanded by God to return to Egypt so he can free the Hebrew people from slavery. However, Seti’s son, Rameses (Yul Brynner) does all he can to stop Moses.

There are just many scenes in the movies to goggle at. I am very impressed on how the story was told, and I can understand why the movie became a classic. Some of my favorite scenes are the parting of the Red Sea, where Moses splits the Red Sea so his people can cross the sea and be saved from Rameses, who was chasing them down. Another powerful scene I loved was when Yahweh was speaking to Moses on the top of Mount Sinai, issuing Moses the Ten Commandments while all his people were sinning at the base of the mountain. Just seeing God as a ball of fire, speaking with a commanding holy voice gave me the chills. Despite this being a film released in 1956, I believe the special effects hold up fairly well. The parting of the Red Sea is incredible, and it is amazing how that scene was done without the use of any CGI.

I have previously reviewed a movie from Cecil B. DeMille, which was released nine years previously in 1947 called Unconquered. That movie showed DeMille had a good hand in making entertaining epics. He really succeeds on the grand scale, as proved by the success of this film. The acting was also consistent and everyone seemed to have a fun time. Sometimes the acting would be downright silly, but there is no denying the fun the cast had. Charlton Heston is no stranger to epics, and I loved his performance here as Moses. Maybe towards the end when he becomes a whole new person he got a little silly, but overall he did a good job. Yul Brynner is good as Moses’s fiercest rival, Rameses, He created a memorable villain, who feels betrayed by his father that he would give power to Moses and not him. Anne Baxter does a good job as Nefretiri who was Mose’s love interest. Baxter did good, but sometimes her seductiveness would feel out of place in the film. Finally, I must mention Edward G. Robinson as Dathan, the man who was in charge of the slaves. I felt he gave a light, comedic touch to a man in what otherwise would be a sinister character.

Overall, The Ten Commandments is a great epic that holds up very well, nearly sixty years after its original release. The film does justice to the story, as told in the Bible. It’s obvious the film takes a stance against slavery, and its fun to see Moses outdo Rameses, The special effects are pretty cool, but get ready to be blown away by the Red Sea scene. This sweeping epic is a grand, fun movie. Not only does it enlighten people on the story of Moses and what he did for his people, but it also is fun, silly, and entertaining. The movie does a little into stretching the imagination, but its fun to watch and one of the best epics of all time.

My Grade: A

On the Waterfront

https://www.youtube.com/watch?v=xSImMMMf5nA

“You don’t understand! I coulda had class. I coulda been a contender. I coulda been somebody instead of a bum, which is what I am.”

Ah, the earnest dialogue spoken by Marlon Brando in one of the most famous scenes in the history of cinema. Brando sitting in the taxi with his brother, Charley (Rod Steiger) trying to explain his reasoning why he opposes Johnny Friendly, Hoboken’s most powerful man with a gun pointed to his face. This scene is so earnest, so powerful, delivered perfectly by Brando, who does fantastic by showing a sweet, gentle side to his nature despite performing the tough-guy act. As the great critic Roger Ebert quotes, “What other actor, when his brother draws a pistol to force him to do something shameful, would put his hand on the gun and push it away with the gentleness of a caress?”

Before we get too much ahead of ourselves, I should at least point out this movie I’m reviewing is On the Waterfront, arguably one of the greatest movies ever made. It is special in many ways, but it is unanimously praised in how it changed the landscape of acting. The casting of Marlon Brando helped dearly. He changed how things were in a film. He made acting less predictable and did things never done before in cinema. He provided such texture to his role and in each scene he is in, you can see how he manages the line between gentleness and tough-guy act. Director Elias Kazan made a point not only Brando’s acting was better than most, it was also more influential than most. He brought such a tenderness to his character and he won Best Actor at the Academy Awards in 1954, which he wholeheartedly deserved.

I really found the plot interesting, and there is actually truth behind the plot. Terry Malloy (Marlon Brando) is a young man who tends to his pigeons and works on the docks for a corrupt boss of the unions, Johnny Friendly (Lee J. Cobb), while he dreams to be a boxer. One day, he witnesses a murder committed by some thugs of Friendly’s. Terry becomes close with the sister of the victim, Edie Boyle (Eve Marie Saint) because he feels responsible for her brother’s death. She introduces him to Father Barry (Karl Malden) who attempts to have Malloy take a stand against Friendly in order to smash the racketeering.

As I mentioned in the above paragraph, this film is based off some truth. The film has an obvious political agenda, based off the HUAC (House Un-American Activities Commission) hearings. The director, Elia Kazan was called to the committee, and he named names. Names who were affiliated with the Communist Party. Critics have commented in the past that this film may have hidden, political motives, because of what he did at those HUAC meetings. I actually believe the film is based off that, but I applaud him in making the film. No one should be afraid to state what they believe in. Another part of history is the longshoremen of the Hoboken docks. Hoboken had trouble in all its racketeering, so that all plays an influential part in the movie.

The main role of any director is to get the best performances he can out of his actors. Well, Kazan was certainly up for the task in this film. Everyone churned in amazing performances. I already gave my love letter to Brando, who previously worked with Kazan in 1951’s A Streetcar for Desire. The film could have turned out to be very different. Frank Sinatra was originally cast as Terry, but the producers went ahead to cast Brando instead. The best move they could have done. This is Eve Marie Saint’s first film role, and she eagerly rises for the challenge. A perfect foil for Brando. Her scene with Brando in the bar as they talked about feelings for each other is another priceless cinematic scene. Another important role was Rod Steiger, who played Terry’s brother, also mixed up with Friendly. That taxi scene was incredible, as Brando and Steiger had amazing chemistry. Despite opposite views, the brothers very much love each other. Karl Malden as Father Barry does a wonderful job, although it feels like his acting is overshadowed by the heavyweights. Finally, Lee J. Cobb as the union boss, Friendly does an excellent job. I loved his final scenes of the movie. His fate is very deserving, and without spoiling much, I was laughing in the face of Friendly’s as the movie came to a close.

Overall, this is just one incredible film. If you were to say that this is the best film of all time, I would have no issue with that. This is one of my favorites , and it’s one of those few films I can find no fault with. From the masterful direction to the skilled direction to the expert  cinematography, there is much to love about the film. This was nominated for twelve Oscars and won eight of them. Brando and Saint took home awards and so did Kazan as director. Cobb, Malden, and Steiger were all nominated. This gripping crime thriller should be a showcase for film professors everywhere. This film changed the perspective of acting and it changed American acting for the better. The film and the muckraking articles that inspired it brought light to crime in the Hoboken streets and perhaps those streets became cleaner in the immediate aftermath. If you love movies, check this film out.

My Grade: A+

Dial M for Murder

If you are looking for a well-crafted thriller to enjoy, look no further than Alfred Hitchcock’s 1954 masterpiece, Dial M for Murder. On the outside, nothing much seems to happen with the film, but once you see it, well you are in for a surprise. As Hitchcock films goes, this one is more off-beat. However, you can classify the film as one of best films of the legendary director’s career.

If you look at the film from the outside, you are wondering how on earth is this film even good. For starters, most of the film is located in a single apartment room save for exterior shots and a scene at a theater. You need a well-crafted screenplay for single-location movies to work. Also outside of one rather fantastic murder scene, most of the film is talk, talk, and more talk. But this film does work because everyone plays their cards right. The screenplay is well-crafted and despite all the talk, it creates an aura of tension and mystery which builds up over the course of the film, before we reach the shocking ending. The build-up is excellent and it is very much worth it when the end is revealed.  I also like that despite the movie being located in one room 98% of the time, you never get that feel of unintentional claustrophobia. So thanks to the excellent screenplay by Frederick Knott and masterful direction by Alfred Hitchcock, you never really think about that one location.

Now it’s time to describe the plot of the movie, which takes place in London. The wealthy Margot Mary Wendice (Grace Kelly) had a brief love affair with an American author named Mark Halliday (Robert Cummings). Her husband, Tony (Ray Milland), a professional tennis player, was away from home at the time on a tour. However, he quits tennis because he wants to spend more time with Margot, and help a marriage that is crumbling apart. One day, Mark decides to visit the couple from America. During the affair, Mark had written letters to Margot. She insists she destroyed them all, but one letter was stolen. She claimed she was blackmailed, but she never really thought much about that letter. When Tony arrives home, he insists Mark and Margot go to the theater, and he will arrive shortly thereafter. However, he ends up calling an old colleague, Captain Lesgate (Anthony Dawson). Together, they plot the murder of his wife so he can gain her fortune. But complications arise in the form of failed opportunities, the police led by Chief Inspector Hubbard (John Williams), and Tony trying to constantly cover his footsteps so he will not be implicated in any wrongdoing.

Here is a film that is a masterpiece when it comes to delivering acting skills. Ray Milland injects his character with an incredible amount of charm, and his character is often likable even if his motives are not. His simple charm was enough to win me and many, many people over, enough to believe how he would do nothing wrong. Grace Kelly is absolutely magnificent in her role as Margot. During the murder scene, her performance was enough for me to wish she was nominated for an Oscar, which sadly enough she wasn’t. These were the two main attractions of the movies, but there was another great performance to point out. John Williams (no, not the legendary composer), has been a staple of Hitchcock movies, so it is no surprise for him to show up here. I really loved his finesse role as the police detective who figures out this case, piece-by-piece with a remarkable eye.

Hitchcock is one of Hollywood’s most famous auteurs. When one think of his works, usually The Birds, Vertigo, Rear Window, or, Psycho comes to mind. But never count out this underrated film. During the first phase of 3-D phase in the 40’s and 50’s, many films were subjected to 3D treatment. However the faze begin to die out in the mid 1950’s, and this is the last film to use 3D during that phase. I did not have the opportunity to watch the movie in 3D, but it could have been cool. For those who watch Hitchcock films, you should be familiar with him appearing in his movies somehow, someway. In Dial M for Murder, you’ll really have to search to find him and it’s a genius move to see where you’ll find him.

Overall, Dial M for Murder is just pure, classic Hitchcock. It’s one of his underrated films, but there is no denying it is a masterpiece. The premise is a simple one, but Hitchcock turned into a twisting tale that pierces the heart with a load of dread and thrills. It’s a very captivating movie, not only from the direction, but also from charming performances from Milland and Kelly, whom characters are likable. The film is good at talking, but you should be good at watching. I highly recommend this fine thriller that has Hitchcock in top form.

My Grade: A

Unconquered

Unconquered is one of those old, swash-buckling epics that came out during the era of epics during the 1940’s and 1950’s. Is it the greatest epic ever? Of course not, but all that matters to me was the entertainment factor of the movie. In that part, the movie succeeded. I had a fun time watching our main character, Chris Holden pick fights with the Natives, his fellow countrymen, and even the women. I’m not sure if this film is entirely historically accurate and some whitewashing may be prevalent, but does it really matter much? Especially in an older movie like this film? This film was filmed in technicolor, which of course added to the “expensive” budget, but it really gave definition to the epic as lighting and color techniques helped this film out.

I find it rather fascinating what the film was based on. In  1862, the descendants of the Holdens of Virginia wrote a letter about similar events to the one Anny Hale gone through in the film. The basic plot outline of Abby’s and this woman is very similar. Both were English women sentenced to the American colonies, accused of murder. But had lustful men come after her. There is a real historical document pertaining to the events of this movie, but the movie decides to expand upon the story, making it somewhat a fictional story.

Cecil B. DeMille, known for his great 1956 epic The Ten Commandments, directs a film that takes place in pre-Revolution colonial America. London gal Abby Hale is sentenced to slavery in the colonies, but she is bought and freed by colonist Chris Holden. But her freedom is taken away by a rival of Holden, Garth. This rivalry helps culminate a disastrous relationship between the colonists of Fort Pitt and the Indians, who want their land free of the white men.

We get some good acting here. No one is particularly great, but it seems like everyone is having a fun time. The biggest star, Gary Cooper, is no stranger to Westerns and this film uses his talents very effectively. He definitely delivers the charm of a leading man. Paulette Goddard was pretty good as Abby, but I feel like her character is annoying at times. I liked Boris Karloff as the chief of the Indians, despite the fact this is clearly an example of Hollywood ancient bias. I also liked Howard Da Silva does a solid job as the villainous Garth, who takes advantage of the Natives for his own self. Finally, Cecil Kellaway turns in a solid performance as Chris’s friend, Jeremy Love.

Overall, Unconquered is a solid, old-fashioned historical epic. There is nothing remotely special about the film and it doesn’t try to be. It just wants to entertain movie-watchers of all ages, and it succeeds in that category. As a history student, I can easily point out many of the historical differences. But this is a movie review, not a history lesson. I will save that lecture for another day.  The tone may be historically inaccurate, but one should overlook the details. On its merit as a fun adventure movie, Unconquered succeeds very much so.

My Grade: A-

The Wizard of Oz

I have seen this 1939 classic, The Wizard of Oz countless number of times growing up, and now here in my early stages of adulthood. Despite that fact, the magic the film has never lessens its hold on me. In fact each time I see it, it grows more magical as I appreciate the film even more and more. This is one of those few films that can successfully be handed down from generation to generation. People of all ages loved this magical film since its release in 1939, arguably one of the greatest years in movie history. This adventure story has themes that all children can relate to. Every child has a need for adventure and to discover the world beyond their homes and families. But the movie also shows the world is not always a happy world, as evil can persist beyond the comfort of your home. Other prevalent themes include helping others find a path, and helping others see who they truly are. The movie is good at making symbolisms. For example, Toto (Dorothy’s dog) is a symbol for comfort. As children tend to find comfort in pets. If you take the symbolism and the themes away, you are left with a simple adventure story full of heart, wisdom, and most importantly magic.

Before I discuss my opinion of the film even further, let’s talk about the basic plot of the film. Dorothy (Judy Garland) lives at a Kansas farm with her faithful dog companion Toto, and her Auntie Em (Clara Blandick) and Uncle Henry (Charley Grapewin). However, a tornado strikes the farm and somehow transports Dorothy and Toto to a far-away magical land of Oz. When she lands in Oz, she immediately meets the Munchkins: a group of small people, and Glinda, a good witch (Billie Burke). They claim that her landing accidentally killed the Wicked Witch of the East, which is caused for celebration. Now Dorothy wants to go home, but Glinda tells her about the Wicked Witch of the West (played beautifully by Margaret Hamilton). In order to go back to Kansas, Dorothy must travel on the Yellow Brick Road towards Emerald City, where the Wizard may be able to grant her wish. Along the way, she meets new pals such as the Scarecrow (Ray Bolger), The Cowardly Lion (Bert Lahr), and the Tin Man (Jack Haley), and enemies such as the forementioned Wicked Witch of the West.

I absolutely love the story and the themes, but I admire the technical side of the film. Keep in mind that this film is almost eighty years old, so it’s amazing how the visual effects hold up fairly well by today’s standards. The tornado looks very real, and one of the most memorable scene is inside the tornado as Dorothy is being whisked away to Oz. We see images pop outside her window, and it looks so realistic. I also loved the transition of color in the film. The film starts out black-and-white, but once we land in Oz, vibrant colors adorn everyone and everything, which I find to be a symbol for happiness because she’s away from home. I may have had more issues with the costume design. It is plainly obvious how fake the Cowardly Lion’s suit is, and how awkward the makeup is on the Tin Man. But this was back in 1939, long before the days of CGI.

This movie is also accompanied by wonderful music, bolstered by great songs including the Oscar-winning song, “Somewhere over the Rainbow.” It’s a song that routinely plays in my mind because it is such a great song. There are other recognizable songs such as “If I Had a Heart.”

Believe it or not, this film suffered through many production problems ranging from Margaret Hamilton being severely burned to Toto being out of commission for several weeks because he was stepped on. Also, Jack Haley wasn’t the first choice to play the Tin Man. He only got the role because the actor who originally had the part suffered severe allergies to the makeup. There were many more issues the film had while in production. So that attains to the talent of those who put together this film and kept the magic intact.

As for the acting, everyone does a fantastic job. The cast was relatively unknown at the time, with the exception for Judy Garland. She was already a bona fide star, but this film propelled her to superstardom. She does an amazing job in the iconic role as Dorothy. Another standout was Margaret Hamilton as the Wicked Witch of the West. It’s a known fact that many scenes with her in them were cut because here performance was felt to be too scary for kids. Despite all the cuts, her performance was magnificent and even today, her performance still creeps me out. But on the whole, everyone should be applauded because they did such a great job.

Overall, The Wizard of Oz is a timeless classic that will live on for ages and ages. It is not my favorite film of all time, but I am very appreciative of the film and how instrumental it is in cinema history. Bolstered by a wonderful story, great acting, memorable songs, and a colorful production design, this film is a great film from the early days of cinema. The themes are also timeless. But it also shows that while adventures are fun, “there’s no place like home.”

My Grade: A