All posts by Jonathan Mattingly

About Jonathan Mattingly

I am applied mathematician and probabilist living in downtown Durham and working in the Duke Mathematics Department. I returned to my home state of North Carolina in 2003 after 15 years away. I am a graduate of Durham's NCSSM, Yale and Princeton.

Git – Setting up new repositories

Setting up a new repository – locally

Here is the standard way to start a new repository from an existing directory. The first part just tells creates some content. You really just need to start from the “git init” line and add all the files you want with “git add”.

mkdir api-test
cd api-test
git init
touch README
git add README
git commit -m ‘first commit’

 

Pushing to a duke math gitlab repository

Assuming  I have already set up a get lab repository called api-test the following command pushes the git repository I set up above to that repository. Of course you would replace “jonm” with your username. gitlab actually tells you what to so.

git remote add origin git@git.math.duke.edu:jonm/api-test.git
git push -u origin master

Math Everywhere and Git

Git is a version control software which will allow use to keep the files up to date and prevent the proliferation of different version. It has a number of features

  • We can never “loose” a file. We can always roll things back to a previous date. (This assumes that changes are regularly checked it as described below.)
  • One can edit the files on you laptop and then merge them in to the online site when one is ready for them to be seen.
  • We can all work at once with out much danger of having conflicting edits.
  • If we want to start an experimental branch we can. Or a branch for a future instructor to edit with out letting them change the main branch.

The basic model is that each person has there own copy of the repository. They work on it locally checking in their changes  to the local repository. Then when they are ready they “push” their changes to the main repository. At any time they can update their local repository by “pulling” the changes others have made. You can have as many copies of the repository as you want. That way you can have one on your laptop, work and home machine.

Running “ssh-add” as described here will keep you from having to repeatedly enter your ssh password.

The first time you run git

The very first time you run git on a machine you need to run the commands below with “John Doe” replaced with your name and the email replaced with yours. This lets git know who you are.

% git config --global user.name "John Doe"
% git config --global user.email johndoe@example.com

You should only have to do this once on each machine.

Making a local Copy of Matheverywhere

To make a local copy you “clone” the master repository. Changing to the location where you want the local directory copy to be, one types (all on one line):

% git clone git@git.math.duke.edu:jonm/math-everywhere.git matheverywhere

This will create a copy of the math everywhere repository in a directory “matheverywhere”. To have it called something else replace the last “matheverywhere” in the above command with some other directory name.

Now what ?

Now you have a local copy of math everywhre. You can edit this all you want and not change anything on line until you are ready.

  1. When you are ready you should “commit” the files to you local repository.  (see here for directions)
  2. “push” the file to the central  repository (see here for directions)
  3. Log in to one of the math server and “pull” the update to the web server. The directions for this are given below.

 

Updating the version on the web server

The version that the web server uses is just a repository like any other repository.  You need to “pull” the latest version to update it.

On a math department machine:

  1.  change to the math_everywhere directory
    % cd /home/system/httpd/htdocs/courses/math_everywhere
  2. pull the latest version
    % git pull
  3. make sure that the permissions  have been set correctly
    % chmod -R ag+rX .

If you find you keep having to type in the password for your ssh key repeatedly. You should use the ssh-add command to make it so you only have to type it once per session.

% ssh-add

If you have ‘sshed’ into the math machine, you should follow the directions here to use ssh-agent.

The Probability Workbook

For almost 10 years I have been interested in producing an online “schaum’s guide” for stochastic calculus. I envisioned a number of detailed problems  which would lead people through learning stochastic calculus when coupled with short intro text.

Because of this interest, I have periodically explored technologies for  creating an online mathematics text book. After playing around with a number of systems and always concluded that the technology was not yet mature, I recently came to the conclusion that  I was tired of waiting and that things were “good enough”.

I discovered that WordPress was fairly easy to use (thought esthetically not completely satisfactory) and that it was possible to install MathJax as a plugin. (My then postdoc Scott Mckinley was using it to post mathematical discussions and commentaries on a personal blog. )  I was  exploring various hosting options when Duke announced that it was starting a WordPress site for Faculty/Staff to use. I immediately started pressing Duke to add the MathJax plugin. (Shockingly ) It took some convincing, some help form Dr. Yu, and 6 months to get the plugin installed.

Once MathJax was installed, I launched the “Probability Workbook“. Since I was teaching “Introduction to  Probability (Math 230)” that semester I decided to  begin with a collections of problems for basic probability.  Sayan Mukherjee was also teaching Math 230 and I recruited him to join my effort. We both used the site to assign our weekly problems sets. Initially many of the problems were taken from various books (with citation). Overtime we have added our own questions and expect that to grow the repository.  I have also invited a number of other probabilist to add to the problem archive.

This spring I hope to return to my original motivation and create a problem of pool for introductory stochastic calculus.

 

Reflections on a Partially Flipped Class

 

In the Spring of 2013, I partially flipped my “Introduction to probability” class (math 230 at Duke). If you don’t know what I mean by flipping or partially flipping a class, all will be explained presently. When this all started, I had never heard of flipping either. (And I might have made up partially flipping.)

Just to give away the ending (and hopefully encourage you to read on), the semester I partially flipped my class was the most satisfying  course teaching experience I have had to date. Furthermore, I received the best evaluations and I feel I taught the bulk of the class the most I ever have before.

It all started with Sayan Mukherjee. He was teaching Intro Prob (math 230/stats 230) in the fall of 2012. One day the semester before, he excitedly proclaimed that he was going to “flip” his class. I had no idea what that meant, so I asked. (I now understand that this is all the rage and is talked about heavily in pedagogical circles.) He had decided to use videos made by a colleague at Harvard to replace the standard lectures for the class. This freed him  to use all of his class time for group learning and working problems.

I found it an intriguing idea, but at first had no intention of adopting any part of it. However, over the term, I realized that I was at my best in office hours. My lectures were good, but there was nothing quite as effective as explaining something to a student who had already batted with the question first (or at least thought about it some). I began to see that the students who came to my office hours had a much better experience in the class and learned a lot more. Of course, coming to office hours regularly selects a specific subset. But I also increasingly valued to more iterative mode of learning and teaching.

Nonetheless, I decided that it was time to rethink my teaching. Driven by my experiences in the non-majors class “Math Everywhere” and my general feeling that I needed to better my engage students. The more I talked with Sayan the more I wanted to adopt some of the things he was doing. Furthermore, we both grew to feel that completely replacing the lectures with 45min-60min video lectures was not the best idea. A governing principle developed that the students could only be consistently expected to watch videos which were around 7-10min (15 min at most).

By Christmas 2012-2013, I was ready to jump. I decided to make a number of short video lectures which would replace the more perfunctory initial part of the discussion of a new topic. The plan was to create short videos which mirrored the basic discussion of a topic common to any book on the topic. I tried when ever possible to pair the video with a reading assignment so that students had a choice weather to watch a video or read the book.

The videos/reading were assigned before the lecture and the students were expected to  have completed the assignment  before coming to class. To encourage the students to comply, I randomly give pop-quizzes during the first 5 min of class. The quizzes did not test understanding, only if they had watched the video or done the reading. For example, students were asked “which of the following was an example discussing in todays assignment ?” (The quizzes were the lest effective part of my partial flip and have been replaced by online (sakai) quizzes this year.)  In class, I would quickly hit the high notes of the video and recall the main results/themes. Then I would add any finer points I wanted and quickly move to examples. Sometimes I would start with an example at the board, but whenever possible I would quickly mover to a set of equations/examples for the students to think about. I always started with something which was essentially a restatement of a example or definition already presented. I also usually tried to make the last question hard enough/open ended enough to keep the best students busy.

Usually the students started out working alone or talking with their immediate neighbors. After a few minutes I would prod them to talk in larger groups. I would circulate in the room and often make comments to various groups or the room when I saw issues which were causing confusion. I also would often suggest that two groups talk to each other if they had two different parts of the puzzle.

Then I would lead the class in a debriefing after 15-25 min had passed. Sometimes this meant that I would let groups give solutions or partial solutions. Sometimes this meant that I would lead give a solution and get feed back on why people were confused.

I found that the students were much more involved and, at least anecdotally, had better retention of information from earlier in the semester.  By all metrics I can think of it was the best semester teaching I have ever had. I had more students asking to Flunch  (faculty student lunch) with me than I have ever had (by far). I had more students asking for extra, out of lecture/class, information about topics we touched on. My evaluations were better than they ever have been. I also covered more material than I ever had in the class. And lastly, the students did better on what I felt were harder exams than they had in previous years. I especially noticed that the “middle” students did much better.  All of these results were during a semester when I taught two sections of Math 230 each with almost 40 students.

I spent a lot of time talking to various people around campus to find a room and camera set up to make my videos. After being bounced around and discovering that none of the rooms were well configured for someone giving a black board lecture. In the end OIT and the Link sent me back to the computing staff in the mathematics department and the camera set up in Math/Physics Room 119. I recorded the first few videos in room 119, but eventually switched to recording them in my office at my blackboard using and iPad. I used a tripod mount to hold the iPad and a wide angle lens get the iPad to cover the whole (all be it small) black board. I used the iMovie software on my iPad and iMac to edit to edit the files and upload them to YouTube.

The videos are far from perfect. A number have small errors (just like real lectures). Also, I only managed to cover about 1/2 the term before I ran out of steam. In the evaluations the students lamented the videos ending which has further encouraged me to round out my collection this term.

Overall I really enjoyed this format and plan not to return to straight lecturing if at all possible. They got more out of it and I got or out of it. It was a lot of fun.

 

 

 

Where to eat in Durham

The Durham restaurant is lively an full of many interesting and affordable choices