Whiteboard White-knuckling – Part 6

image1

This past weekend I thought about the dilemma that resulted from expecting J to do the insertion sort exactly how it was detailed online. Today I tried something new. And it worked!

Today’s whiteboarding session was a selection sort. Easy stuff right? Instead of giving J a problem to whiteboard immediately, I wrote down the word Firefox and cut up the paper so each piece had a single letter. I had J sit down and I put the letters in front of him.

Then I explained the selection sort algorithm. As he did the first pass through the letters, I adapted the lesson on the fly and asked him to “Narrate the decisions your finger is making as you move through the list and select the items to sort.”

He pointed out his finger and pulled out the “e” first.

I asked him, “How did you know that the ‘e’ was the first character to pull out? He said, and pointed with his finger, “I go through the list. And the ‘e’ was the lowest letter. So I pulled it out.”

As we went through the sorting algorithm J asked, “What do I do with the array when I pull it out? Do I compare the rest of the elements with the now empty space in the array?”

This caused me to pause.

“It’s kind of dependent on the language you’re using,” I answered. “When someone asks you what language you’re most familiar with, what do you tell them?”

He thought for a bit and responded, “Java.” Then I asked another question, “What language are you programming in now?” He said, “We’re doing operating systems right now, but even that is in Java.”

I was about to pivot and ask him to write out the pseudo code on the whiteboard in Java. Then I thought to ask another question, “Are you still interested in pursuing secure computing?”

Then we launched into a conversation about how he’s not being asked to program that much during this, his last semester of undergraduate work.

Keeping my thoughts to myself, I said, “Ok, we’re going to pursue C programming from now on.” With his interest in pursuing a career in secure computing, digital forensics, and national defense, we’re going to spend the rest of our time together, focusing on pointers, addresses, null-terminated strings, and the rest of the C gotchas I struggled with (and still struggle with).

“Amor fati. Love everything that happens to you.” – Seneca

Whiteboard White-knuckling Part 5

Whiteboard White-knuckling Part 4

Whiteboard White-knuckling Part 3

Whiteboard White-knuckling Part 2

Whiteboard White-knuckling Part 1

Whiteboard White-knuckling – Part 5

img_1749

Just finished the insertion sort with J. He got the sort working correctly. After doing this sort with Nick the other day. I was able to see that there needed to be a check to see if the input array had only one item. The nature of the insertion sort algorithm requires the user to check the second element in the array against the first one.

Perhaps the lesson to learn here is that all programmers will code a problem in a hundred different and small ways. Yet another lesson in life that, each person is unique and the solutions offered will never come in exactly how you expect them to.

Lessons pointed out today:

  • Be careful of your indentation. The if and else at the bottom of your code looks like it’s a new code block and not part of the while. Keep this in mind!
  • I really enjoy the data structure you drew on the right side. I particularly like to see all the data constrained in little boxes.
  • Proposed the question, “What would you do if you entered a codebase where the original authors used brackets on the line following the for statement?” J answered: “I would conform my coding style to theirs.” I smiled, “Excellent answer.”

“Look at today as an investment in tomorrow.” – Unknown

Whiteboard White-knuckling Part 4

Whiteboard White-knuckling Part 3

Whiteboard White-knuckling Part 2

Whiteboard White-knuckling Part 1

Swift Pair Programming – Session 4

Today Nick and I worked on the insertion sort in swift. The biggest problem we ran into was learning how to iterate through an array in swift backward. We ended up using “stride” to define the start, end, and increment amount.

Here’s the code for stride:

for index in stride(from: 5, to: 1, by: -1) {
  print(index)
}

There is also a way to do this in swift using the reverse function:

// Print 10 through 1
for i in reverse(1...10) {
  println(i)
}

Next week we’ll be tackling the merge sort.

Self-criticism is one of the most common obstacles to great performance in any field

“Self-criticism is one of the most common obstacles to great performance in any field. It’s often called the silent killer of business, because so many executives suffer from it, yet so few dare to speak out about it. I’ve heard a variety of people, from junior associates to the most senior executives, privately admit that much of their workday was consumed by negativity, their inner critics constantly pointing out their failings, or predicting disappointing outcomes for their projects and initiatives. In some cases, they (and I) were amazed that they got anything done at all, considering that, as one executive reported, ‘Eighty percent of my day is spent fighting my inner critic.'” – The Charisma Myth

I’m still working on quieting the inner critic. Buddhists call it the “Monkey Mind”: that endless, chattering, berating, irritating, loud, abrasive voice that constantly mocks, taunts, and trashes us.

The worst part of this, and something we can get hung up on is, this voice is us! Or is it? Where does this voice come from? I believe it comes from unregulated self-hate. How do we stamp out the monkey? Is there a metaphorical banana we can give him to quiet him down? It’s hard to talk when you’re eating right?

Words frame our entire world view. Words frame our sense of self. Words encapsulate and border in our personalities. Have you ever heard the saying, “Words can’t express how upset I feel right now.”

We all know there are limits to words. Words are limiting. How do we make this obstacle become the way? We need to prune words of self-loathing from our conversations with ourselves. Let’s play a game:

What are some of the worst things you can say about yourself?

  • I suck at programming. Everyone’s going to find out.
  • I’m so angry right now!
  • I hate you.

Here are different ways to phrase them.

  • I’ve assessed my strengths and pinpointed my weaknesses in programming. I can study hard and work on the parts I’ve identified.
  • I’m experiencing anger right now.
  • I’m experiencing frustration now. It will pass. Please give me time to calm myself down and I will loop back around with you to discuss this further.

In Buddhism, we talk about feeling anger rather than saying, “I am angry.” We do not identify with the anger and become our anger. We realize that anger is a passing feeling. And we know that most feelings only last about 2 minutes.

Takeaways

Think about the words you use when you are condeming yourself. Try to be aware of the way you are talking to yourself. Are the words your inner critic lobs at you compassionate? What can you do to take the sting out of your own worst enemy? Trim his words. Craft your self-message to build yourself up.

Whiteboard White-knuckling – Part 3

img_1729Today I had J do an insertion sort. We only had about 20 minutes to work through it today. As the timer ticked down, I stopped him when he had 5 minutes left before his shift ended.

He wasn’t able to complete the insertion sort today. When he described where he got stuck he said, “I feel like I’m suppose to move the selected element above the list then move all of the items that have been previously passed through all to the left at once.”

He’s going to attempt to code out the insertion sort on Wednesday. I asked him not to look up the insertion sort online in the meantime. I look forward to these sorting algorithm challenges 🙂

Click here to see Part 2 – Merge Sort

Click here to see Part 1 – Bubble Sort

As we begin to see and appreciate our essential selves, we manifest automatically that beauty and our true capacities, simply by letting them happen

41psrbzymcl-_ac_us160_“Many people carry around with them an image of the kind of person they wish they were, much as a tennis player imagines the kind of serve he wishes he could deliver. When our behavior does not seem to measure up to our ideal, we grow dejected and then start trying hard to correct it (‘Perhaps I should take a series of lessons, or a course on personality development, or read a book about how to become less self-critical, or undergo therapy, or join an encounter group’). Such steps are not necessarily foolish – I have taken them all – but what is needed is not so much the effort to improve ourselves, as the effort to become more aware of the beauty of what we already are. As we begin to see and appreciate our essential selves, we manifest automatically that beauty and our true capacities, simply by letting them happen.” – Gallaway

During the last few weeks of high school, we were asked to come up with a quote that would accompany our senior portrait in the yearbook. If you open my high school yearbook and flip to my portrait you’ll find the following quote next to my face:

“Each day I will strive to be better than my former self.” – Thom Yorke

But what does better mean? Better in what ways? Who are we competing against? How will we know if we’ve won? When does it end?

Ask any of my friends and they’ll tell you I spend too much time in my head. “But I’m striving to get better,” I’ll tell them. That’s when they say, “Yeah, but you think too much.”

“What is needed is not so much the effort to improve ourselves, as the effort to become more aware of the beauty of what we already are.” – Galloway

Where are we meant to draw the line in self-improvement? What is good enough? Does it exist at all?

“As we being to see and appreciate our essential selves, we manifest automatically that beauty and our true capacities, simply letting them happen.” – Galloway

Perhaps the lesson lies within the striving.

Charles Duhigg, author of “The Power of Habit” suggests setting cues and rewards to make any habit stick. He goes on to say that we need to perform a behavior for at least 30 days before it becomes a habit.

We aggressively block off our precious time for our most desirable habits. Let’s take it a step further. How about we start aggressively scheduling our downtime too? We need time to appreciate our accomplishments.

Let’s play a game

In our over-scheduled lives, why not lean into the obstacle?

Get your phone. No, really. Go get your phone. Go ahead, I’ll wait.

Got it? Good. Open your calendar. Add a recurring 20-minute event: “Me Time.” Now set it and forget it. Each time that reminder comes up, stop, take a deep breath and shake it out.

Come back in a few weeks and let me know how it’s helped. You might find that this one little break in your routine will ease your mind, slow things down, and give you a chance to reflect on the accomplishments you’ve made this week.

We need to check in with ourselves to be better than our former selves.

We have to earn the attention and trust of our listeners and readers

feynman-1.jpg

“None of us ever truly has a captive audience. We have to earn the attention and trust of our listeners and readers.” – Rachel Toor

I find myself talking at length about subjects I am most interested in. Perhaps to the chagrin of my colleagues. Sometimes I get heated and animated because I love the concepts or feel that I have something brilliant to say and I speak loudly, quickly, and intrusively.

After reading this article on the Chronicle of Education I’m having second thoughts.

In every situation, simply carrying on, is going to bore your audience. A conversation needs a back and forth. Or else it’s a soliloquy.

This aint no Shakespeare play. This is real life!

“Early-career professors who worry about their authority may feel the need to prove that they deserve to be at the head of the class. They may suffer from impostor syndrome, having just learned the stuff they’re teaching. Eager to cover any inadequacies or incomplete knowledge, they trot out what they do know. They may be uncomfortable with silence and rush to fill it.” – Rachel Toor

Guilty.

“Or it’s possible that, like me, they just get so excited about the material that they can’t refrain from pointing out every single thing they think is cool. I’ve learned that it’s often a bad idea to teach a book I adore because if my students don’t love it as much as I do, first my feelings get hurt and then I rush in to show them what they’re missing. In class I’ll talk too much instead of waiting for them to say all the things they would have said if I’d only given them a chance. I try to be aware of that; sometimes I succeed.” – Rachel Toor

Guilty.

“How do they manage to miss the way the temperature in the room cools when they filibuster? Do they not see how people shut down? How suddenly everyone’s cuticles need picking or there’s a rush to use the bathroom?” – Rachel Toor

Guilty.

Takeaways

“Since then, at the start of every course, I ask each student to wait until three others have had a chance speak before they pipe up again. That can allow time and space for those who need a few extra moments to have their say. I try to follow the same rule myself in meetings.” – Rachel Toor

I love simple rules. Rules to live by. Rules that can be applied universally. When I find a rule like this I immediately put it into place and test it out. What’s your experience with this?

Can you stop yourself from talking about subjects you love until at least 3 people have had a chance to talk? Test it out and let me know!

Swift Pair Programming – Session 1

Just finished pair programming with Nick. He’s in San Francisco. And I’m in Hawaii. We’re using ScreenHero to pair and it’s fantastic. There was a bit of a lag in screensharing because my internet connection was pretty bad. Next time I’ll be pairing from the library or from Hi Capacity. An hour goes by really quickly. Maybe we need to meet for longer?

Prior to meeting I made a list of the topics that I understand the least:

  • Closures
  • Coalescing operators
  • Optional binding
  • Force unwrapping
  • Guard statements
  • Optional chaining
  • veratic parameters
  • inout parameters
  • Nested function that returns a function
  • Currying

Questions that came up this session

How to we indicate a multi type array?

Lessons learned

  • Playground will not show up the play button if its a playground inside of the xcode project.
  • edit all in scope.
  • can’t do ++ in swift
  • Figure out how to do a next item in swift that is safe
  • Use inout in your parameter list to mutate parameter. Be sure to call method with & on parameter to indicate inout status

Shared tools:

SpectacleApp – FREE mac app to move and resize windows with ease. Window control with simple and customizable keyboard shortcuts. For mac.

Next Week:

We’re planning on finishing the bubble sort.

White-knuckle Whiteboarding Part 2 – Merge Sort

mergeToday I had J do a merge sort. This time I held silent. I managed to stay silent for 40 minutes while J worked on the code. This time through, the code is more robust and cleaner. J is showing more familiarity with arrays and sorting.

Feedback given today:

  • “Keep your left indentation clearer so others can follow along while you trace through the program.”
  • “Good to see you started manipulating the data before writing any code.”
  • “Now that you’ve explained how your code works, please run through the code with the sample data given.”

Check out White-Knuckle Whiteboarding Part 1 here