Archive for October, 2014

Book Review – Empyrean Key

October 22, 2014

I just finished reading the first book in the Ardentia Series.  And I can’t wait for the second installment “due out early 2015” according to the end of the book.

cover photo

I enjoyed the book. While not what I’d call “excellent,” it was very good, definitely readable — one that I’d recommend to my friends who love the fantasy genre. (Full disclosure: the author is related to a friend of my wife.)  Though SparrowHawk gives it high marks.

There are a couple things to highlight in the positive category, and minor criticism.

This story builds a believable world and likeable characters — in fact, characters, like Jahna, who I want to see succeed.

Creating a world is, in my opinion — not to take anything away from Tomlinson — easy; introducing it to the reader is trickier.  A writer who creates their own world always has a choice, and a fine line to walk.  On the one hand, he or she can chose to not “explain” anything, instead telling the story wholly within the setting, and leave it to the reader to figure out the workings of the world as they go.  The other path is to write the story as one telling someone who is not at all familiar with the setting, taking time (and precious pages) to elaborate on the differences between their world and ours.

Of course it’s not a black and white, either/or decision.  In this case, I think, Tomlinson could’ve provided a more gentle introduction to the unfamiliar places, and meaning of some of the geography.  It’s not horrible, just be ready to keep track of Aedentia, and the gods and heroes, the Pithart, the place of worship, and the backwater town of Groden Cove.  None of this is hard, and perhaps I’m being overly picky.

I’m a little more critical of the introduction of the characters:

I feel now that my third point (below) is closely related to the character intros in this sense: the book, in retrospect, feels too short; and the introduction of the primary characters seemed either a little forced, or missing in depth.  What I mean is, after the fact, i read the description on Amazon.

As a not-so-perceptive telepath and amateur scam-runner, Jahna Mornglow has filled the void left by an absent father, with the friendships of a bloodthirsty bar-maid and a bullied book-worm. Her mother, scarred by the racial prejudices of her past, refuses to nurture Jahna’s Narcean abilities of prophecy and telepathy, warning her of the hate beyond the safety of Groden Cove – a beachside safe haven for misfits and those who wish to be left alone.

I wouldn’t describe Lilac as a “blooodthirsty bar-maid” — not exactly.  And Jahna’s mother’s story seems far too short to fill out that line (maybe, but I failed to get all that from just the few pages she gets).  I guess Lilac maybe is, but I don’t know if I actually think I know her, because we haven’t spent enough time together.  I don’t know if that’s just “first impression” (which, it actually isn’t), or if that’s really who she is.    Moreso with the “bookworm,” he’s acted in ways that are surprising, like I would never have expected that of him.  Again, because I haven’t spent enough time “observing” him to know what he’d do in an unfamiliar situation.

And, yet, I think that if I had another fifty pages, maybe I’d have a better sense of any of them, Lilac included.

All in all, though, I have to say, I do want to continue reading, and my last point is really just this: I just think the cliff-hanger at the end came too soon.  I want to read more, and I find that there isn’t any more, yet.

All that being said, the book did draw me in, as a story should, and I found myself experiencing the characters, and not just “reading” a book.

I did find the author’s blog.  And I eagerly look forward to reading more.

Advertisements

C++ Exception Problem

October 4, 2014

This is going to be a very technical post.

Gory details forthcoming, you’ve been warned.

I think I have a problem with some C++ code, and I’ve narrowed it down as much as I can.  I am using the standard exception, std::overflow_error (though that probably doesn’t matter).  I’m compiling with GCC 4.9.1 (this, I think, does matter).

So here’s the summary, with a fairly complete set of exception-handling clauses, when I throw the overflow_error exception from an activity by itself, it works; but if I have even a fairly simple string declaration and assignment, then all the exception handling gets skipped.

Details, Details

Let’s start with a “working” example; here’s the main body:


#define CHAR char
#define ATOL atol
#define MAIN main

Never mind what I was doing here


int MAIN(int argc, CHAR* argv[])
{
  SixFactor t(26757, -1);
  cout << "t = " << static_cast<std::string>(t) << endl;
  try {
    SixFactor e(0,0);
    e = t*t;
    cout << "got here - no exception" << endl;
  } catch (overflow_error &oe) {
    cout << "caught overflow exception: " << oe.what() << endl;
  } catch (...) {
    cout << "caught an unknown exception" << endl;
  }
  return 0;
}

Strange class name?  It’s pulled from the context of the program where I noticed this.

So what’s in the constructor(s), and the operator* overload function?


class SixFactor
{
  public:
    SixFactor(const ulong m, const int o): _mult(m), _offs(o) {};

and later

SixFactor operator*(const SixFactor &othr) throw(overflow_error) {
  // std::string err_msg = "SixFactor mult. overflow of (";
  // err_msg += static_cast(*this) + ") * (" +
  // static_cast(othr) + ")";
  /// cerr << "throwing an exception: " << err_msg << endl;
  // throw std::overflow_error(err_msg.c_str());
  ////////////////////////////////////////
  // If I uncomment even one of the preceding lines (the string decl. line)
  // then the exception below is *not* caught, but the program terminates
  // abnormally. As it stands w/ the exception only, it "works"

  throw overflow_error("this works");
}

Note that right now, the only un-commented code in this function is the throw statement.

What happens:

Compiling

g++  -g -std=c++11 -Wall -Wextra -v -Weffc++ -Wold-style-cast  -c
      -o test_exception2.o test_exception2.cpp

Running

./test_exception2

Output:

t = 6*26757 - 1
caught overflow exception: this works

When it breaks

Let’s change the code

SixFactor operator*(const SixFactor &othr) throw(overflow_error) {
  std::string err_msg = "SixFactor mult. overflow of (";
  // err_msg += static_cast(*this) + ") * (" +
  // static_cast(othr) + ")";
  /// cerr << "throwing an exception: " << err_msg << endl;
  // throw std::overflow_error(err_msg.c_str());
  ////////////////////////////////////////
  // If I uncomment even one of the preceding lines (the string decl. line)
  // then the exception below is *not* caught, but the program terminates
  // abnormally. As it stands w/ the exception only, it "works"

  throw overflow_error("this works");
}

Note: all I did is add a declaration and assignment (never mind the string doesn’t mean anything).  It shouldn’t change the operation at all.  But it does.

./test_exception2
t = 6*26757 - 1

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
make: *** [test_exc2] Error 255

And Windoze puts up a dialog box:
err_dlg_box

 

So what’s going on here?

That’s my question.  I’m at the point of starting to examine assembly code; right now I don’t know, but I’m putting this out to the “world.”  In a sense, I’m crowd-sourcing for an answer, but I think my crowd might be too small.