My Year in Books 2016

Shocker: they aren’t all self-help or by Stephen King.

My GoodReads Year in Books

This year I read/listened to about 41 books (“about” because I didn’t finish a couple of them and because I still have a week and a half left to finish a couple more). I mostly read non-fiction, self-help, and horror fiction. Below are some of the more memorable reads from this year.

Code by Charles Petzold

Code: The Hidden Language of Computer Hardware and Software — Charles Petzold

If you have ever been interested in how the nuts and bolts (bits and bytes?) of computers work, this is the book to read.

Petzold starts out describing data transfer via tin cans and string and quickly moves you on to telegraphs, relays, binary logic gates, etc.. until the end of the book when you have “built” a model computer with full features like memory and an assembly language.

I think the book is targeted more towards a lay-person with interest in computers, but it is a fun read regardless of your technical ability as long as you are willing to think while you read.

Shenandoah by Sue Eisenfeld

Shenandoah: A Story of Conservation and Betrayal — Sue Eisenfeld

I’m not a huge fan of reading history unless I can directly relate to the subject matter. In this case, I read Eisenfeld’s Shenandoah right before our camping trip to Shenandoah this year.

What’s interesting about Shenandoah National Park is that unlike its cousin parks out in the western United States, Shenandoah became a national landmark long after the land area was already inhabited by people. This means that if you visit the park today, you can find remnants of roads, cabins, cemeteries, and orchards all throughout the park.

This book looks at the history of the people of Shenandoah before the land became a park and the lasting effects that it has had on the United States.

Never Split the Difference by Chris Voss

Never Split The Difference: Negotiating As If Your Life Depended On It — Chris Voss

Never Split the Difference is probably the best “self-help” book I read all year. You can find my notes on it in this previous post.

Voss was a master negotiator with the FBI, often helping negotiate for the lives of hostages. Each chapter provides an exciting story from his tenure with the FBI, along with the techniques he used to help direct the negotiation in his favor. He then goes into additional examples of how he has used these techniques when buying a new car, negotiating salary increases, and even how to get an unresponsive individual to respond to your emails.

Like any self-help book, it’s easy to read but more difficult to put into practice. I’ve already used many of the strategies Voss teaches in his book, and it is one of the most useful self-help books I’ve ever read.

Never Broken by Jewel

Never Broken: Songs Are Only Half The Story — Jewel

I am not a huge fan of Jewel’s music, nor am I a folk music listener in general. Before reading this book, the only things I knew about Jewel was that she’s an Alaskan singer/songwriter that had a few hits in the late 90s.

After reading the book however, I learned that she is a pretty incredible person: she dealt with abuse from her family, lived out of her car for a while, paid her way through music school, is a yodeler, and has spent a lot of time about thinking about life and philosophy (one of my favorite observations from her was that “hardwoods grow slowly”, referencing how growth needs to be a long-term goal).

Overall, Jewel’s Never Broken has many good lessons and interesting stories from her time growing up as a folk singer. After reading it, I have a much better appreciation for her music too.

Priceless by Robert K. Wittman

Priceless: How I Went Undercover to Rescue the World’s Stolen Treasures — Robert K. Wittman

Another book on my list from a former FBI agent (these FBI guys sure do have interesting stories to tell!).

Robert Wittman specialized in art crime during his FBI tenure, helping track down stolen masterpieces. Lots of art crime is difficult to prosecute because details are difficult to verify — a lot of the time Wittman’s stories come down to Ocean’s Eleven style sting operations with lots of planning, false identities, and large SWAT teams storming into hotel rooms to take down the criminal dealers and save the works of art.

Besides the crime thriller aspect of the stories, the book also provides good introductory background on art and the different types of crimes that get committed, from breaking into and stealing from museums to illegally selling Native American bald eagle feather headdresses, making the book both exciting and informative.

The Hidden Life of Trees by Peter Wohlleben

The Hidden Life Of Trees: What They Feel, How They Communicate — Peter Wohlleben

Peter Wohlleben is a German forester who has spent his life in nature, initially as part of the logging industry but more recently as a custodian of natural growing forests. His book The Hidden Life Of Trees discusses the importance of diversified (yet native) flora and how old-growth natural (not planted by humans) forests have amazing ecosystems.

Wohlleben anthropomorphizes trees to the point that you will feel bad the next time you accidentally snap off a twig, however the book is full of amazing information about how trees “communicate” with each other and how trees share some of the same “senses” that we humans have like the senses of sound and touch.

The Hidden Life of Trees is a light read that will make you appreciative of your surroundings the next time you are taking a hike in the woods.

Full Dark, No Stars by Stephen King

Full Dark, No Stars — Stephen King

I read six Stephen King books this year (still have quite the backlog to get through) and Full Dark was by far my favorite.

This book is a collection of four short stories. I only really liked three of the stories, but even so this is one of my favorite Stephen King books of all time.

Although I generally like all of King’s books, I think this one was especially great because it wasn’t focused on the psychic /other-worldly aspects like in many of his other stories — instead this book focuses on real-seeming characters with their real-seeming problems.

I think the relatability to the characters in this book is what makes the stories especially terrifying.

Thanks for reading. You might also enjoy following me on Twitter.

Want to learn even more SQL?

Sign up for my newsletter to receive weekly SQL tips!

Book Notes: Never Split the Difference by Chris Voss

I highlight and take notes when I read nonfiction books. Once I finish a book, I format and edit my notes so that I can easily remind myself of what I learned without having to reread the book. These notes are not a substitute for reading the book, they only serve as a reminder of key concepts.

Regardless of all of these techniques, you always have to stay emotionally cool or none of them will work. Let knee-jerk reactions pass and pause in silence instead.

“Contrary to popular opinion, listening is not a passive activity. It is the most active thing you can do.”

“Good negotiators, going in, know they have to be ready for possible surprises; great negotiators aim to use their skills to reveal the surprises they are certain exist.”

You have to stay open minded about a negotiation — best to “[hold] multiple hypotheses” to better understand where someone is coming from.

“Most people approach a negotiation so preoccupied by the arguments that support their position that they are unable to listen attentively.”

“The goal is to identify what your counterparts actually need…and get them feeling safe enough to talk and talk and talk some more about what they want.”

“There are essentially three voice tones available to negotiators: the late-night FM DJ voice, the positive/playful voice, and the direct or assertive voice.” You should use the positive/playful voice majority of the time. Rarely use the assertive. FM DJ voice is downward inflecting and says you are in control.

“While mirroring is most often associated with forms of nonverbal communication, especially body language, as negotiators a “mirror” focuses on the words and nothing else. Not the body language. Not the accent. Not the tone or delivery. Just the words.”

Paraphrasing what the other person just said is another form of mirroring.

“By repeating back what people say, you trigger this mirroring instinct and your counterpart will inevitably elaborate on what was just said and sustain the process of connecting.”

“The results were stunning: the average tip of the waiters who mirrored was 70 percent more than of those who used positive reinforcement.”

Label how someone is feeling — this will make them feel listened to as well as make them continue to talk — either because you labelled their emotions accurately or you purposefully did not.

“In every negotiation, in every agreement, the result comes from someone else’s decision. And sadly, if we believe that we can control or manage others’ decisions with compromise and logic, we’re leaving millions on the table.”

“Saying “No” gives the speaker the feeling of safety, security, and control. You use a question that prompts a “No” answer, and your counterpart feels that by turning you down he has proved that he’s in the driver’s seat.”

“Gun for a “Yes” straight off the bat, though, and your counterpart gets defensive, wary, and skittish”

“That’s why I tell my students that, if you’re trying to sell something, don’t start with “Do you have a few minutes to talk?” Instead ask, “Is now a bad time to talk?” Either you get “Yes, it is a bad time” followed by a good time or a request to go away, or you get “No, it’s not” and total focus.”

“Sometimes, if you’re talking to somebody who is just not listening, the only way you can crack their cranium is to antagonize them into “No.” One great way to do this is to mislabel one of the other party’s emotions or desires.”

“Another way to force “No” in a negotiation is to ask the other party what they don’t want. “Let’s talk about what you would say ‘No’ to,””

The best way to get a response to an email — send a question that you know the response will be no: “Have you given up on this project?”

Don’t strive for “yes” in negotiations — yes means someone is agreeing with you just to finish negotiating. Strive for “that’s right”, where someone is truly agreeing with you.

Use pauses to encourage people to keep talking. Can also use phrases like “Yes,” “OK,” “Uh-huh,” or “I see”.

Use paraphrasing + labeling to try and get a “that’s right”.

NEVER compromise/split the difference: “To make my point on compromise, let me paint you an example: A woman wants her husband to wear black shoes with his suit. But her husband doesn’t want to; he prefers brown shoes. So what do they do? They compromise, they meet halfway. And, you guessed it, he wears one black and one brown shoe. Is this the best outcome? No! In fact, that’s the worst possible outcome. Either of the two other outcomes — black or brown — would be better than the compromise. Next time you want to compromise, remind yourself of those mismatched shoes.”

“We don’t compromise because it’s right; we compromise because it is easy and because it saves face. We compromise in order to say that at least we got half the pie. Distilled to its essence, we compromise to be safe. Most people in a negotiation are driven by fear or by the desire to avoid pain. Too few are driven by their actual goals.”

Don’t think that any negotiation has a deadline — rarely are deadlines hard set.

Acknowledge the other person’s fears all up front: “”I got a lousy proposition for you,” I said, and paused until each asked me to go on. “By the time we get off the phone, you’re going to think I’m a lousy businessman. You’re going to think I can’t budget or plan. You’re going to think Chris Voss is a big talker. His first big project ever out of the FBI, he screws it up completely. He doesn’t know how to run an operation. And he might even have lied to me.””

Make them feel like they have something to lose: ““Still, I wanted to bring this opportunity to you before I took it to someone else,” I said. Suddenly, their call wasn’t about being cut from $2,000 to $500 but how not to lose $500 to some other guy.”

“Instead of saying, “I’m worth $110,000,” Jerry might have said, “At top places like X Corp., people in this job get between $130,000 and $170,000.””

If you can’t negotiate money, start negotiation other things: vacation, work hours, etc…

When talking numbers, use precise ones — $102,378 instead of $100,000 — it makes it seem like you’ve done a calculation.

If negotiating salary, establish success criteria — next time you will then able to negotiate for an even higher salary when you prove that you did well.

Calibrated questions: “queries that the other side can respond to but that have no fixed answers. It buys you time. It gives your counterpart the illusion of control — they are the one with the answers and power after all — and it does all that without giving them any idea of how constrained they are by it.”

Most of the time, calibrated questions use “how”, “what”, and sometimes “why”.

“Another simple rule is, when you are verbally assaulted, do not counterattack. Instead, disarm your counterpart by asking a calibrated question.”

“When someone’s tone of voice or body language does not align with the meaning of the words they say, use labels to discover the source of the incongruence”

Try to get the other person to commit to you three times. After the first commitment, try summarizing (paraphrase + label) to get the second commitment, and then try calibrated (“how”,”what”) questions about success criteria to get the third commitment.

The first time they agree to something or give you a commitment, that’s №1. For №2 you might label or summarize what they said so they answer, “That’s right.” And №3 could be a calibrated “How” or “What” question about implementation that asks them to explain what will constitute success, something like “What do we do if we get off track?”

“At the front counter the young lady asked me if I wanted to join their frequent buyer program. I asked her if I got a discount for joining and she said, “No.” So I decided to try another angle. I said in a friendly manner, “My name is Chris. What’s the Chris discount?” She looked from the register, met my eyes, and gave a little laugh. “I’ll have to ask my manager, Kathy,” she said and turned to the woman who’d been standing next to her. Kathy, who’d heard the whole exchange, said, “The best I can do is ten percent.””

If you are pushed to go first to name a price, allude to what some other high-end client would pay “Harvard business school would pay $20,000 for my services”.

The Ackerman model of bargaining: 1. Set your goal price 2. Make your first offer 65% of goal 3. use empathy and different ways of saying no until the other side counters and increase your offer each time to 85%, 95%, and eventually 100% of goal 4. make the final amount not-round $23,768 instead of $24,000 — maybe the non-round figure is all you have in the bank! 5. At the final offer, offer a non-monetary item to prove you are at your limit.

“A more subtle technique is to label your negative leverage and thereby make it clear without attacking. Sentences like “It seems like you strongly value the fact that you’ve always paid on time” or “It seems like you don’t care what position you are leaving me in” can really open up the negotiation process.”

“But the moment when we’re most ready to throw our hands up and declare “They’re crazy!” is often the best moment for discovering Black Swans that transform a negotiation. It is when we hear or see something that doesn’t make sense — something “crazy” — that a crucial fork in the road is presented: push forward, even more forcefully, into that which we initially can’t process; or take the other path, the one to guaranteed failure, in which we tell ourselves that negotiating was useless anyway.”

Thanks for reading. You might also enjoy following me on Twitter.

Want to learn even more SQL?

Sign up for my newsletter to receive weekly SQL tips!

XmlReader vs XmlDocument Performance

Running C# Tests for Code Performance

Recently I have been working on a project where I needed to parse XML files that were between 5mb and 20mb in size. Performance was critical for the project, so I wanted to make sure that I would parse these files as quickly as possible.

The two C# classes that I know of for parsing XML are XmlReader and XmlDocument. Based on my understanding of the two classes, XmlReader should perform faster in my scenario because it reads through an XML document only once, never storing more than the current node in memory. On the contrary, XmlDocument stores the whole XML file in memory which has some performance overhead.

Not knowing for certain which method I should use, I decided to write a quick performance test to measure the actual results of these two classes.

The Data

In my project, I knew what data I needed to extract from the XML up front so I decided to configure test in a way that mimics that requirement. If my project required me to run recursive logic in the XML document, needing a piece of information further down in the XML in order to know what pieces of information to pull earlier on from the XML, I would have set up an entirely different test.

For my test, I decided to use the Photography Stack Exchange user data dump as our sample file since it mimics the structure and file size of one my actual project’s data. The Stack Exchange data dumps are great sample data sets because they involve real-world data and are released under a Creative Commons license.

The Test

The C# code for my test can be found in its entirety on GitHub.

In my test I created two methods to extract the same exact data from the XML; one of the methods used XmlReader and the other XmlDocument.

The first test uses XmlReader. The XmlReader object only stores a single node in memory at a time, so in order to read through the whole document we need to usewhile(reader.Read()) in order to loop all of the nodes. Inside of the loop, we check if each node is an element that we are looking for and if so then parse out the necessary data:

On the other hand, the code for XmlDocument is much simpler: we load the whole XML file into memory and then write a LINQ query to find the elements of interest:

After writing these two methods and confirming that they are returning the same exact results it was time to pit them against each other. I wrote a method to run each of my two XML parsing methods above 50 times and to take the average elapsed run time of each to eliminate any outlier data:

Results and Conclusions

Cutting to the chase, XmlReader performed faster in my test:

Performance test results.

Now, is this ~.14 seconds of speed difference significant? In my case, it is, because I will be parsing many more elements and many more files dozens of times a day. After doing the math, I estimate I will save 45–60 seconds of parsing time for each set of XML files, which is huge in an almost-real-time system.

Would I have come to the same conclusion if blazing fast speed was not one of my requirements? No, I would probably go the XmlDocument route because the code is much cleaner and therefore easier to maintain.

And if my XML files were 50mb, 500mb, or 5gb in size? I would probably still use XmlReader at that point because trying to store 5gb of data in memory will not be pretty.

What about a scenario where I need to go backwards in my XML document — this might be a case where I would use XmlDocument because it is more convenient to go backwards and forwards with that class. However, a hybrid approach might be my best option if the data allows it: if I can use XmlReader to get through the bulk of my content quickly and then load just certain child trees of elements into XmlDocument for easier backwards/forwards traversal, then that would seem like an ideal scenario.

In short, XmlReader was faster than XmlDocumet for me in my scenario. The only way I could come to this conclusion though was by running some real world tests and measuring the performance data.

So should you use XmlReader or XmlDocument in your next project? The answer is it depends.

Thanks for reading. You might also enjoy following me on Twitter.

Want to learn even more SQL?

Sign up for my newsletter to receive weekly SQL tips!