Posts

Showing posts from 2017

Retro Review: The Mummy's Tomb

Image
Synopsis
30 years after the events of the previous film, Steve Banning is telling his house guests about the undead mummy he and Babe Jensen (now named Babe Hanson for some reason) battled in Egypt all those years ago. But unbeknownst to any of them, the villains from the previous film survived and have waited 30 years (again, for some reason) to plot their revenge.

Review
Now we're talkin'. I found the original 1932 The Mummy to be tedious (and lacking in much mummy, ironically), and found the sequel, 1940s The Mummy's Hand to be an improvement, but still...lacking much of the mummy. However, this time around he gets plenty of screen time and the plot moves at a quicker pace.

I found the timing to be too coincidental: Steve is telling his guests about the mummy, and miles away in Egypt, the plot for revenge is being hatched. What timing. And yes, that's the part I find unbelievable, and not that an ancient mummy walks the earth! But I digress.

The film takes some inter…

Universal Monsters and Retro Review: The Mummy's Hand

Image
I've only recently become a fan of the old Universal monster movies. My interest was first piqued a long time ago by one of my favorite retro video games, Zombies Ate My Neighbors, with its extensive use of classic monster movie imagery. But only in the past two years have I begun going through those old films. And while they're not specific to Halloween, so closely has this imagery been associated with the season that they may as well be Halloween movies for me, and that's when I watch them.

These films tend to run a little over an hour, which is obviously very short for a film by today's standards. And even though they're quite old, I was surprised by how well some of them still hold up. For example, I think House of Frankenstein is a great film.

I recently watched The Mummy's Hand, which is the first sequel to 1932's The Mummy. Even though that film is considered a horror classic, I don't care much for it, as I found it extremely slow and not having…

How Unit Tests Have Helped Me Write Better Code

Image
I am not perfect. This fact alone supports the need to do my due diligence when it comes to the code I write to make sure it does what it's supposed to, without unintended side-effects, in the most efficient, and extensible, way possible.
Rather than say why I think developers should write unit tests, I will instead describe how I've benefited from them.
PROLOGUE A number of years back, I worked with a lead developer who had a wide breadth of technical knowledge and whom I considered highly intelligent, perhaps even borderline brilliant. He was (and is) a smart individual, but he saw no use in unit tests. He told me that when he first started working for the company, one of the first things he did was to delete all the unit tests, and he even tried to convince me that the practice of writing unit tests was now being considered a thing of the past, and told me he'd forward me a link to an article he'd read stating as much.
I try to keep an open mind, but in this case I wasn…

Creating Buttons That Act Like Links in Angular

While working on a pet project in Angular tonight, I wanted to create some buttons that act like links. Turns out, this is easy -- just apply the routerLink directive to a button and it will act like a link. Here's an example:

<button class="btn btn-success" routerlink="/exercises/edit">Edit an Exercise</button>

Where Everybody Knows Your Name

Image
The classic television sitcom Cheers tells us that "Sometimes you want to go where everybody knows your name." And when I was in my late teens and earlier twenties, there was a place like that where I spent a lot of my time. Only it wasn't a bar, it was a pool hall.

The Rack Room was located on Route 1 in Langhorne, Pennsylvania. It was located behind a Denny's with which it shared a parking lot. It was a pool hall (and a parking lot for that matter) in which I spent a lot of my free time.

I'd been introduced to the place when I was 16. I'd been working part-time at a grocery store and one of my friends/co-workers from there was a regular. I hadn't spent much time in pool halls up until that point, and truth be told I still can't shoot a very good game. I spent just as much time in the Rack Room's arcade playing the latest Mortal Kombat game as I did shooting pool But it wasn't as much about the pool as it was about having a place to hang out…

I-95 Marketplace Remembered

One of the staples of my youth was the I-95 Marketplace, an indoor fleamarket which was located in Langhorne, Pennsylvania. It was only open Friday through Sunday (adding Thursdays and eventually the other weekdays during the holidays), and the interior was a large, open space comprised of small shops separated by poles and canvas. You could find all sorts of products there, from clothing, electronics, toys, furniture, books -- pretty much anything.

I would typically go there Friday evenings after school. I'd walk through the woods behind my house, cross two sections of creek, walk under two sections of I-95 itself (the northbound and the southbound), before finally emerging from the woods and arriving at the back of the marketplace building. I have many vivid memories of making the trek in dark, rainy weather, often arriving with wet (or drenched!) sneakers and cuffs, sometimes muddy, but always ready to head inside and spend my allowance on comic books or music or whatever else …

How To Mock Out Child Components In Unit Tests of Angular 2 Code

I was struggling with this one for a bit but found a solution this past weekend. When writing unit tests of a component that contains child components, the solution is to do the following:
1.Create small mock classes in your test file to represent the child components and include just the functionality you’ll be mocking. These classes should have the @Component() decorator applied to them and contain selectors that match the real components they are being substituted for. 2.Specify these mock components in the declarations section of the object you’re passing to TestBed.configureTestingModule().
Example: ActivityMgmtComponent has a few child components. Here are two of them:
<activity-edit#viewEditActivity></activity-edit> <activity-history#viewActivityHistory></activity-history>
Notice the # values – these are there to support the @ViewChild decorator function. This allows the parent component to call functions on the child components.
@ViewChild('viewActivity…

"Arithmetic operation resulted in an overflow" Error When Retrieving Data From Oracle In .NET

I ran into this fun little exception today when calling a stored procedure in Oracle from some .NET code. The error message was "Arithmetic operation resulted in an overflow", and from what I was able to Google, it seemed like it was caused by a difference in precision between numeric data types in .NET and Oracle, or by the need to compile the code in 32-bit mode. But in my case, neither was the cause. When one of our DBAs suggested I try the same code using the simple "SELECT 1 FROM DUAL" query, and the exception still occurred, I began to look for other reasons.

Fortunately, it was an easy fix. The cause of the problem was actually a setting on the DevArt OracleCommand object being used in the .NET code. Here is the offending line of code:

command.FetchSize = int.MaxValue;
Removing this line of code corrected the problem.

Using Webpack to Bundle CSS with Images and Fonts

One of my teams at work is currently developing in Angular 2, and we use Webpack for all of our TypeScript transpilation, module loading, and bundling. Yesterday we ran into an issue where one of the developers had made references to CSS files located in the node_modules directory of one of the 3rd party libraries we're using. This presented a problem because we don't distribute the node_modules folder as part of our build and deployment process -- we use JavaScript bundles created by Webpack.

To correct the problem, I leveraged Webpack again, this time to bundle the required CSS files. The first step was to create a SASS file (.scss) which would be used as the entry point by Webpack. The reasoning behind using SASS was to allow us to do more than just reference the other stylesheets. But for the time being, it would do just that, and act as our entry point for Webpack to build its dependancy graph of our styles.

Here's what the SASS file looked like at the start:

@import&#…