Skip to main content

Class 2: Common Unix tools

Held: Thursday, 2 February 2017

We start to expore some of the tools that Unix programmers use

Preliminaries

Overview

  • Detour - A coding challenge
  • Exploring solutions to simple tasks
  • Buffers

Updates

Detour: Coding challenge

The following is presented as close to verbatim as I could make it to ensure accessibility.

Good morning. Welcome to the Microgoogazonbok interview program. As you know, we at Microgoogazonbook need large numbers of SWEs because we chew them up like sunflower seeds. However, we need them to be competent so that they produce useful work before we spit them out. You have indicated that you are “competent” C programmers and that you have taken a reasonable number of undergraduate CS courses. Today we will explore that issue.

You should all know the binary search procedure. At Microgoogazonbook, we deal with large amounts of data. It’s therefore important that we have efficient searching procedures.

Suppose we have an array of a trillion items to search. Approximately how many values in that array do we expect binary search to visit? Calls on candidate.

Since we have limited time, we are going to ask you to implement binary search on ordered arrays of integers with no duplicates.

What do you expect the signature of that procedure to be? Calls on candidate.

Great. We’ll have you return the special value -1 if the value is not found in the array. You can find more details in the repository. You should all know how to use git and Github. Download the project from https://github.com/Grinnell-CSC282/binary-search-2017S and start coding. You may consult each other for help, or even work in pairs. However, you may not Bingle or otherwise search the Web for answers.

You have until 8:30 a.m.

Go!

Testing

Going Over Homework

Remove \r characters.

Find all of the misspelled words in a text file

Extract the five highest grades

Extract URLs

Exercise: Remove all blank spaces at the end of lines

If you have not yet written this program in C, please do so now.

Raymond

What, if anything did you learn from reading Raymond?

A Bit About Basic Tools

  • As you may remember from the first day of class, I noted that to be successful in using nix, you need to know a variety of tools (and know *of a wider variety).
  • There’s no way we can do a full in-depth exploration of each important *nix tools. So we’ll look at common uses of a few important tools.
  • My goal is to do two or three today and to deal with others as they come up.