Cs

Working with texts part 3 - word chains

At this point, we've done a fair amount of playing with text so it's time for a fun little project. We're going to generate some text "in the style" of a source text. The technique we're going to use is usually called a Markov Chain text generator. Basically a model where the next state or word is based entirely on the current state. I don't dwell on the math under the hood but in case you're interested, here are a few links: Wikipedia, Explained Visually, UC Davis Math.
# COMMENTS

Working with texts part 2 - bag of words

Following up on a previous post, we're going to continue to talk about playing with text. This time, building and working with a bag of words from a text. A bag of words is a simple language processing model where you just consider individual words in a text. What they are and how many times they occur. This is a pretty simple model but you can still have a good bit of fun with your students with it.
# COMMENTS

Code Review Revisited or research - the teacher version

Last semester I wrote about how I was introducing my students to code review. I thought it worked pretty well and was anxious to try it again. Well, I did the lesson(s) again this past week and it looks like it's a keeper. The setup was pretty much the same with some hiccups due to using a new platform. Last semester I used plain GitHub public repos. This time, I've been using GitHub classroom which I like very much but I forgot that I made this assignment use private repos which turned out to be a hassle.
# COMMENTS

Solve A To Solve B

So many programming assignments involve a direct solution. Write a program to do this or write a problem to solve that. It's pretty typical. There's nothing wrong with assignments like these. They allow students to practice what they've been learning and it gives them the opportunity to create some cool programs. All the same, I like it when there's an indirect problem. You're faced with a problem but in order to solve it you first have to solve some other problem
# COMMENTS

An experiment with code review

Sometimes professional practices don't work well in the classroom and sometimes they do. One professional practice that does work well is code review - reading and reflecting on other peoples code. I've had my students do code reviews in the past but this time I did things differently. Here's what I did and here's how it went Two weeks ago my students completed a lab. The lab involved reading in a poorly indented C++ program and spit out a properly indented one.
# COMMENTS

Who Played Spiderman - part 3

Parts 1 and 2 Part 1 Part 2 Part 3 In the first two parts of this set of posts I wrote about the motivation and design a question answering system that can answer "who" queries like "who played Spiderman" or "who shot John Lennon?" It's not perfect. When doing the Spiderman query, chances are the desired answer will be at or near the top of the list of most frequently appearing names but so will "
# COMMENTS

Who Played Spiderman part 2

Parts 1 and 3 Part 1 Part 3 Part 2 When we left off last time we used a search engine API to gather a whole bunch of documents with the term "played Spiderman" or "who played Spiderman." Now we have to process these documents to answer the question. Fortunately, the documents are basically just big strings of text. Since we're doing a "who" query we want to find all the names in all the documents.
# COMMENTS

Who Played Spiderman part 1 or my Nifty Assignment (that was rejected)

Parts 2 and 3 Part 2 Part 3 I wasn't going to teach this lesson today. I was planning on starting a multi day project starting with an exercise in specification writing and design. Beforehand though, we had to talk about classes. One of my students asked if probability and/or statistics were really important for CS. I started to cite a few examples and then decided to segue into this.
# COMMENTS

Compile Each Concept

We've all been there: Student: Teacher, I need help Teacher (comes over) Student (shows screen listing three bazillion errors) The student has just written pages of code and finally decided to try to run it only to end up with pages of errors. Error messages can at times be hard to read for beginners but to see and truth be told, they frequently don't even read them but over the years I've developed a practice that I've found helpful as a software developer and if students adopt the same practice it can save them a lot of time and effort.
# COMMENTS